summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2019-06-26 14:19:18 +0200
committerMarcus Meissner <marcus@jet.franken.de>2019-06-26 14:19:18 +0200
commitd5ca55d432746c7776762991642be7c1ea74a31d (patch)
tree493055612430d259ed9d6cdda0721f872718e817
parentc7750565a74471c5ec146bd61d51e48ec3acf460 (diff)
downloadlibgphoto2-d5ca55d432746c7776762991642be7c1ea74a31d.tar.gz
listing files works, as we got them from GetPix
-rw-r--r--camlibs/lumix/lumix.c58
1 files 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;i<camera->pl->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);
}