diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2021-08-18 20:39:48 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2021-08-18 20:39:48 +0200 |
commit | 9ee94b6fd44e93a3eacdcdef9aa96e245a2c961e (patch) | |
tree | f93c4a826d038302d79959c6507a16aa8c20e2a3 /src/camera | |
parent | 29dcf0568d89ade47d70714865d6d917766ec257 (diff) | |
parent | 24cc60499ad147c1897b3b68e0d8e9dde36b013c (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/camera')
-rw-r--r-- | src/camera/GPhoto.vala | 8 | ||||
-rw-r--r-- | src/camera/ImportPage.vala | 12 |
2 files changed, 9 insertions, 11 deletions
diff --git a/src/camera/GPhoto.vala b/src/camera/GPhoto.vala index bc2251c..9bcb151 100644 --- a/src/camera/GPhoto.vala +++ b/src/camera/GPhoto.vala @@ -119,15 +119,11 @@ namespace GPhoto { // if buffer can be loaded into memory, return a Bytes class with // CameraFile being the owner of the data. This way, the CameraFile is freed // when the Bytes are freed - unowned uint8 *data; - ulong data_len; - var res = file.get_data_and_size(out data, out data_len); + unowned uint8[] buffer = null; + var res = file.get_data(out buffer); if (res != Result.OK) return null; - unowned uint8[] buffer = (uint8[]) data; - buffer.length = (int) data_len; - return Bytes.new_with_owner<GPhoto.CameraFile>(buffer, file); } 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) { |