diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2021-08-18 20:39:21 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2021-08-18 20:39:21 +0200 |
commit | 2ed34746222ea505631ae8ef8ca50552af999ad2 (patch) | |
tree | 0fff03abf0c122c8852f1e60be31db4cbcee8167 /src | |
parent | eee242571f78cedcca283c6396026c80640572c9 (diff) |
New upstream version 0.30.14upstream/0.30.14
Diffstat (limited to 'src')
-rw-r--r-- | src/camera/GPhoto.vala | 8 | ||||
-rw-r--r-- | src/camera/ImportPage.vala | 12 | ||||
-rw-r--r-- | src/events/EventPage.vala | 25 | ||||
-rw-r--r-- | src/events/EventsDirectoryPage.vala | 3 | ||||
-rw-r--r-- | src/photos/PhotoMetadata.vala | 4 |
5 files changed, 26 insertions, 26 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) { diff --git a/src/events/EventPage.vala b/src/events/EventPage.vala index a482ab8..1375c39 100644 --- a/src/events/EventPage.vala +++ b/src/events/EventPage.vala @@ -50,7 +50,8 @@ public class EventPage : CollectionPage { private const GLib.ActionEntry[] entries = { { "MakePrimary", on_make_primary }, { "Rename", on_rename }, - { "EditEventComment", on_edit_comment } + { "EditComment", on_edit_comment }, + { "EditEventComment", on_edit_event_comment } }; protected override void add_actions(GLib.ActionMap map) { @@ -96,19 +97,19 @@ public class EventPage : CollectionPage { set_page_name(page_event.get_name()); } - protected override void on_edit_comment() { - if (get_view().get_selected_count() == 0) { - EditCommentDialog edit_comment_dialog = new EditCommentDialog(page_event.get_comment(), - true); - string? new_comment = edit_comment_dialog.execute(); - if (new_comment == null) - return; - - EditEventCommentCommand command = new EditEventCommentCommand(page_event, new_comment); - get_command_manager().execute(command); + private void on_edit_event_comment() { + EditCommentDialog edit_comment_dialog = new EditCommentDialog(page_event.get_comment(), + true); + string? new_comment = edit_comment_dialog.execute(); + if (new_comment == null) return; - } + EditEventCommentCommand command = new EditEventCommentCommand(page_event, new_comment); + get_command_manager().execute(command); + return; + } + + protected override void on_edit_comment() { base.on_edit_comment(); } diff --git a/src/events/EventsDirectoryPage.vala b/src/events/EventsDirectoryPage.vala index e88b1a7..7ead1a0 100644 --- a/src/events/EventsDirectoryPage.vala +++ b/src/events/EventsDirectoryPage.vala @@ -190,7 +190,8 @@ public abstract class EventsDirectoryPage : CheckerboardPage { EventDirectoryItem item = (EventDirectoryItem) get_view().get_selected_at(0); - EditCommentDialog edit_comment_dialog = new EditCommentDialog(item.event.get_comment()); + EditCommentDialog edit_comment_dialog = new EditCommentDialog(item.event.get_comment(), + true); string? new_comment = edit_comment_dialog.execute(); if (new_comment == null) return; diff --git a/src/photos/PhotoMetadata.vala b/src/photos/PhotoMetadata.vala index fdda0e6..7c100c0 100644 --- a/src/photos/PhotoMetadata.vala +++ b/src/photos/PhotoMetadata.vala @@ -283,7 +283,7 @@ public class PhotoMetadata : MediaMetadata { #else exiv2.open_buf(buffer, length); #endif - exif = Exif.Data.new_from_data(buffer, length); + exif = Exif.Data.new_from_data(buffer); source_name = "<memory buffer %d bytes>".printf(length); } @@ -294,7 +294,7 @@ public class PhotoMetadata : MediaMetadata { #if NEW_GEXIV2_API exiv2.from_app1_segment(buffer.get_data()); #else - exif = Exif.Data.new_from_data(buffer.get_data(), buffer.get_size()); + exif = Exif.Data.new_from_data(buffer.get_data()); #endif source_name = "<app1 segment %zu bytes>".printf(buffer.get_size()); } |