From d5ca55d432746c7776762991642be7c1ea74a31d Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 26 Jun 2019 14:19:18 +0200 Subject: listing files works, as we got them from GetPix --- camlibs/lumix/lumix.c | 58 +++++++-------------------------------------------- 1 file changed, 8 insertions(+), 50 deletions(-) diff --git a/camlibs/lumix/lumix.c b/camlibs/lumix/lumix.c index 6e4737209..3b5d4c07d 100644 --- a/camlibs/lumix/lumix.c +++ b/camlibs/lumix/lumix.c @@ -257,17 +257,19 @@ folder_list_func (CameraFilesystem *fs, const char *folder, CameraList *list, * * This function is a CameraFilesystem method. */ -int -file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list, - void *data, GPContext *context); -int +static int file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list, void *data, GPContext *context) { Camera *camera = data; + int i; - int numpix = NumberPix(camera); - + for (i=0;ipl->numpics;i++) { + if (camera->pl->pics[i].url_large) { + char *s = strrchr(camera->pl->pics[i].url_large, '/')+1; + gp_list_append (list, s, NULL); + } + } return GP_OK; } @@ -314,48 +316,6 @@ camera_id (CameraText *id) return GP_OK; } -static char *replaceWord(const char *s, const char *oldW, - const char *newW) -{ - char *result; - int i, cnt = 0; - int newWlen = strlen(newW); - int oldWlen = strlen(oldW); - - // Counting the number of times old word - // occur in the string - for (i = 0; s[i] != '\0'; i++) - { - if (strstr(&s[i], oldW) == &s[i]) - { - cnt++; - - // Jumping to index after the old word. - i += oldWlen - 1; - } - } - - // Making new string of enough length - result = (char *)malloc(i + cnt * (newWlen - oldWlen) + 1); - - i = 0; - while (*s) - { - // compare the substring with the result - if (strstr(s, oldW) == s) - { - strcpy(&result[i], newW); - i += newWlen; - s += oldWlen; - } - else - result[i++] = *s++; - } - - result[i] = '\0'; - return result; -} - static size_t write_callback(char *contents, size_t size, size_t nmemb, void *userp) { @@ -868,11 +828,9 @@ GetPix(Camera *camera,int num) { if (strstr((char*)attrcontent,"DLNA.ORG_PN=JPEG_MED")) { camera->pl->pics[i].url_thumb = strdup((char*)xmlNodeGetContent(child)); } - child = child->next; } } while ((next = xmlNextElementSibling (next))); - return strdup((char*)xchar); } -- cgit v1.2.1