summaryrefslogtreecommitdiff
path: root/src/camera
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2021-05-24 15:23:59 +0200
committerJörg Frings-Fürst <debian@jff.email>2021-05-24 15:23:59 +0200
commitde1fe3ed59903afa50e57455ef362f91da88f877 (patch)
tree1513b35b0c01cdc7b47cb29567f42c3e8090d7e6 /src/camera
parent9d91a24bd761fdf390f046763c772c3c9f6acb52 (diff)
parenteee242571f78cedcca283c6396026c80640572c9 (diff)
Update upstream source from tag 'upstream/0.30.12'
Update to upstream version '0.30.12' with Debian dir 5f21b445fe5b876b8b23e836bf7011297a9d7cc2
Diffstat (limited to 'src/camera')
-rw-r--r--src/camera/GPhoto.vala5
-rw-r--r--src/camera/ImportPage.vala19
2 files changed, 12 insertions, 12 deletions
diff --git a/src/camera/GPhoto.vala b/src/camera/GPhoto.vala
index 39b2109..bc2251c 100644
--- a/src/camera/GPhoto.vala
+++ b/src/camera/GPhoto.vala
@@ -135,9 +135,10 @@ namespace GPhoto {
// filesystem. In these cases shotwell can access the file directly. See:
// http://redmine.yorba.org/issues/2959
public PhotoMetadata? get_fallback_metadata(Camera camera, Context context, string folder, string filename) {
- GPhoto.CameraStorageInformation *sifs = null;
+ // Fixme: Why do we need to query get_storageinfo here first?
+ GPhoto.CameraStorageInformation[] sifs = null;
int count = 0;
- camera.get_storageinfo(&sifs, out count, context);
+ camera.get_storageinfo(out sifs, context);
GPhoto.PortInfo port_info;
camera.get_port_info(out port_info);
diff --git a/src/camera/ImportPage.vala b/src/camera/ImportPage.vala
index 3f70f08..5aab9b3 100644
--- a/src/camera/ImportPage.vala
+++ b/src/camera/ImportPage.vala
@@ -1208,9 +1208,9 @@ public class ImportPage : CheckerboardPage {
Gee.ArrayList<ImportSource> import_list = new Gee.ArrayList<ImportSource>();
- GPhoto.CameraStorageInformation *sifs = null;
+ GPhoto.CameraStorageInformation[] sifs = null;
int count = 0;
- refresh_result = camera.get_storageinfo(&sifs, out count, spin_idle_context.context);
+ refresh_result = camera.get_storageinfo(out sifs, spin_idle_context.context);
if (refresh_result == GPhoto.Result.OK) {
for (int fsid = 0; fsid < count; fsid++) {
// Check well-known video and image paths first to prevent accidental
@@ -1353,18 +1353,16 @@ public class ImportPage : CheckerboardPage {
// Need to do this because some phones (iPhone, in particular) changes the name of their filesystem
// between each mount
public static string? get_fs_basedir(GPhoto.Camera camera, int fsid) {
- GPhoto.CameraStorageInformation *sifs = null;
+ GPhoto.CameraStorageInformation[] sifs = null;
int count = 0;
- GPhoto.Result res = camera.get_storageinfo(&sifs, out count, null_context.context);
+ GPhoto.Result res = camera.get_storageinfo(out sifs, null_context.context);
if (res != GPhoto.Result.OK)
return null;
- if (fsid >= count)
+ if (fsid >= sifs.length)
return null;
- GPhoto.CameraStorageInformation *ifs = sifs + fsid;
-
- return (ifs->fields & GPhoto.CameraStorageInfoFields.BASE) != 0 ? ifs->basedir : "/";
+ return (sifs[fsid].fields & GPhoto.CameraStorageInfoFields.BASE) != 0 ? (string)sifs[fsid].basedir : "/";
}
public static string? get_fulldir(GPhoto.Camera camera, string camera_name, int fsid, string folder) {
@@ -1439,12 +1437,13 @@ public class ImportPage : CheckerboardPage {
import_list.add(video_source);
} else {
// determine file format from type, and then from file extension
- PhotoFileFormat file_format = PhotoFileFormat.from_gphoto_type(info.file.type);
+ string file_type = (string)info.file.type;
+ PhotoFileFormat file_format = PhotoFileFormat.from_gphoto_type(file_type);
if (file_format == PhotoFileFormat.UNKNOWN) {
file_format = PhotoFileFormat.get_by_basename_extension(filename);
if (file_format == PhotoFileFormat.UNKNOWN) {
message("Skipping %s/%s: Not a supported file extension (%s)", fulldir,
- filename, info.file.type);
+ filename, file_type);
continue;
}