summaryrefslogtreecommitdiff
path: root/src/camera/ImportPage.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2021-08-18 20:39:21 +0200
committerJörg Frings-Fürst <debian@jff.email>2021-08-18 20:39:21 +0200
commit2ed34746222ea505631ae8ef8ca50552af999ad2 (patch)
tree0fff03abf0c122c8852f1e60be31db4cbcee8167 /src/camera/ImportPage.vala
parenteee242571f78cedcca283c6396026c80640572c9 (diff)
New upstream version 0.30.14upstream/0.30.14
Diffstat (limited to 'src/camera/ImportPage.vala')
-rw-r--r--src/camera/ImportPage.vala12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/camera/ImportPage.vala b/src/camera/ImportPage.vala
index 5aab9b3..1e50777 100644
--- a/src/camera/ImportPage.vala
+++ b/src/camera/ImportPage.vala
@@ -1209,10 +1209,9 @@ public class ImportPage : CheckerboardPage {
Gee.ArrayList<ImportSource> import_list = new Gee.ArrayList<ImportSource>();
GPhoto.CameraStorageInformation[] sifs = null;
- int count = 0;
refresh_result = camera.get_storageinfo(out sifs, spin_idle_context.context);
if (refresh_result == GPhoto.Result.OK) {
- for (int fsid = 0; fsid < count; fsid++) {
+ for (int fsid = 0; fsid < sifs.length; fsid++) {
// Check well-known video and image paths first to prevent accidental
// scanning of undesired directories (which can cause user annoyance with
// some smartphones or camera-equipped media players)
@@ -1354,15 +1353,18 @@ public class ImportPage : CheckerboardPage {
// between each mount
public static string? get_fs_basedir(GPhoto.Camera camera, int fsid) {
GPhoto.CameraStorageInformation[] sifs = null;
- int count = 0;
GPhoto.Result res = camera.get_storageinfo(out sifs, null_context.context);
if (res != GPhoto.Result.OK)
return null;
if (fsid >= sifs.length)
return null;
-
- return (sifs[fsid].fields & GPhoto.CameraStorageInfoFields.BASE) != 0 ? (string)sifs[fsid].basedir : "/";
+
+ if (GPhoto.CameraStorageInfoFields.BASE in sifs[fsid].fields) {
+ return (string) sifs[fsid].basedir;
+ } else {
+ return "/";
+ }
}
public static string? get_fulldir(GPhoto.Camera camera, string camera_name, int fsid, string folder) {