summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/BatchImport.vala2
-rw-r--r--src/CheckerboardLayout.vala4
-rw-r--r--src/DesktopIntegration.vala22
-rw-r--r--src/Resources.vala2
-rw-r--r--src/folders/FoldersBranch.vala2
-rw-r--r--src/import-roll/ImportRollBranch.vala2
-rw-r--r--src/main.vala7
-rw-r--r--src/photos/WebPSupport.vala6
-rw-r--r--src/util/image.vala2
9 files changed, 34 insertions, 15 deletions
diff --git a/src/BatchImport.vala b/src/BatchImport.vala
index ae4f573..9b3e1e6 100644
--- a/src/BatchImport.vala
+++ b/src/BatchImport.vala
@@ -1851,7 +1851,7 @@ private class PrepareFilesJob : BackgroundImportJob {
warning("Unable to perform MD5 checksum on file %s: %s", file.get_path(),
err.message);
- return ImportResult.convert_error(err, ImportResult.FILE_ERROR);
+ return ImportResult.FILE_ERROR;
}
// we only care about file extensions and metadata if we're importing a photo --
diff --git a/src/CheckerboardLayout.vala b/src/CheckerboardLayout.vala
index 85232f3..a22412d 100644
--- a/src/CheckerboardLayout.vala
+++ b/src/CheckerboardLayout.vala
@@ -1070,10 +1070,10 @@ public class CheckerboardLayout : Gtk.DrawingArea {
ctx.save();
ctx.add_class("view");
var val = ctx.get_property("border-color", Gtk.StateFlags.NORMAL);
- focus_color = *(Gdk.RGBA*)val.get_boxed();
+ border_color = *(Gdk.RGBA*)val.get_boxed();
val = ctx.get_property("border-color", Gtk.StateFlags.FOCUSED);
- border_color = *(Gdk.RGBA*)val.get_boxed();
+ focus_color = *(Gdk.RGBA*)val.get_boxed();
// Checked in GtkIconView - The selection is drawn using render_background
val = ctx.get_property("background-color", Gtk.StateFlags.FOCUSED | Gtk.StateFlags.SELECTED);
diff --git a/src/DesktopIntegration.vala b/src/DesktopIntegration.vala
index 754d9a1..d29e0f7 100644
--- a/src/DesktopIntegration.vala
+++ b/src/DesktopIntegration.vala
@@ -105,13 +105,13 @@ public async void files_send_to(File[] files) {
}
AppWindow.get_instance().set_busy_cursor();
- try{
- var portal = new Xdp.Portal();
+ try {
+ var portal = new Xdp.Portal.initable_new();
// Use empty list for addresses instead of null to word around bug in xdg-desktop-portal-gtk
yield portal.compose_email(parent, {null}, null, null,
_("Send files per Mail: ") + file_names.str, null, file_paths, Xdp.EmailFlags.NONE, null);
- } catch (Error e){
+ } catch (Error e) {
// Translators: The first %s is the name of the file, the second %s is the reason why it could not be sent
AppWindow.error_message(_("Unable to send file %s, %s").printf(
file_names.str, e.message));
@@ -175,12 +175,16 @@ public void set_background(Photo photo, bool desktop, bool screensaver) {
}
var parent = Xdp.parent_new_gtk(AppWindow.get_instance());
- var portal = new Xdp.Portal();
Xdp.WallpaperFlags flags = Xdp.WallpaperFlags.PREVIEW;
if (desktop) flags |= Xdp.WallpaperFlags.BACKGROUND;
if (screensaver) flags |= Xdp.WallpaperFlags.LOCKSCREEN;
- portal.set_wallpaper.begin(parent, save_as.get_uri(), flags, null);
+ try {
+ var portal = new Xdp.Portal.initable_new();
+ portal.set_wallpaper.begin(parent, save_as.get_uri(), flags, null);
+ } catch (Error err) {
+ AppWindow.error_message(_("Unable to set background: %s").printf(err.message));
+ }
GLib.FileUtils.chmod(save_as.get_parse_name(), 0644);
}
@@ -313,12 +317,16 @@ private void on_desktop_slideshow_exported(Exporter exporter, bool is_cancelled)
}
var parent = Xdp.parent_new_gtk(AppWindow.get_instance());
- var portal = new Xdp.Portal();
Xdp.WallpaperFlags flags = Xdp.WallpaperFlags.PREVIEW;
if (set_desktop_background) flags |= Xdp.WallpaperFlags.BACKGROUND;
if (set_screensaver) flags |= Xdp.WallpaperFlags.LOCKSCREEN;
- portal.set_wallpaper.begin(parent, xml_file.get_uri(), flags, null);
+ try {
+ var portal = new Xdp.Portal.initable_new();
+ portal.set_wallpaper.begin(parent, xml_file.get_uri(), flags, null);
+ } catch (Error err) {
+ AppWindow.error_message(_("Unable to set background: %s").printf(err.message));
+ }
}
}
diff --git a/src/Resources.vala b/src/Resources.vala
index d03a214..0bd8512 100644
--- a/src/Resources.vala
+++ b/src/Resources.vala
@@ -853,6 +853,7 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
/// Locale-specific starting date format for multi-date strings,
/// i.e. the "Tue Mar 08" in "Tue Mar 08 - 10, 2006"
/// See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format
+ /// xgettext:no-c-format
START_MULTIDAY_DATE_FORMAT_STRING = C_("MultidayFormat", "%a %b %d");
/// Locale-specific ending date format for multi-date strings,
@@ -863,6 +864,7 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
/// Locale-specific calendar date format for multi-month strings,
/// i.e. the "Tue Mar 08" in "Tue Mar 08 to Mon Apr 06, 2006"
/// See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format
+ /// xgettext:no-c-format
START_MULTIMONTH_DATE_FORMAT_STRING = C_("MultimonthFormat", "%a %b %d");
/// Locale-specific calendar date format for multi-month strings,
diff --git a/src/folders/FoldersBranch.vala b/src/folders/FoldersBranch.vala
index 49b2d97..bfa461d 100644
--- a/src/folders/FoldersBranch.vala
+++ b/src/folders/FoldersBranch.vala
@@ -9,7 +9,7 @@ public class Folders.Branch : Sidebar.Branch {
new Gee.HashMap<File, Folders.SidebarEntry>(file_hash, file_equal);
private File home_dir;
- public class Branch() {
+ public Branch() {
base (new Folders.Root(),
Sidebar.Branch.Options.STARTUP_OPEN_GROUPING
| Sidebar.Branch.Options.HIDE_IF_EMPTY,
diff --git a/src/import-roll/ImportRollBranch.vala b/src/import-roll/ImportRollBranch.vala
index 0c582ac..dd3edfa 100644
--- a/src/import-roll/ImportRollBranch.vala
+++ b/src/import-roll/ImportRollBranch.vala
@@ -1,7 +1,7 @@
public class ImportRoll.Branch : Sidebar.Branch {
private Gee.HashMap<int64?, ImportRoll.SidebarEntry> entries;
- public class Branch() {
+ public Branch() {
base (new ImportRoll.Root(),
Sidebar.Branch.Options.HIDE_IF_EMPTY,
ImportRoll.Branch.comparator);
diff --git a/src/main.vala b/src/main.vala
index f4eed30..25a0690 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -571,9 +571,12 @@ void main(string[] args) {
Application.init(!is_string_empty(filename));
// set custom data directory if it's been supplied
- if (CommandlineOptions.data_dir != null)
+ if (CommandlineOptions.data_dir != null) {
+ if (CommandlineOptions.profile == null) {
+ AppWindow.error_message("Using the --datadir option without passing --profile and --create is deprecated\n. Plesae migrate to a proper profile instead.");
+ }
AppDirs.set_data_dir(CommandlineOptions.data_dir);
- else
+ } else
AppDirs.try_migrate_data();
// Verify the private data directory before continuing
diff --git a/src/photos/WebPSupport.vala b/src/photos/WebPSupport.vala
index 2f4723c..b467b24 100644
--- a/src/photos/WebPSupport.vala
+++ b/src/photos/WebPSupport.vala
@@ -183,7 +183,13 @@ private class WebpSniffer : PhotoFileSniffer {
if (calc_md5)
detected.md5 = md5_checksum.get_string();
+ // We have never reached the header parsing state, but also didn't encounter any error
+ if (detected.file_format != PhotoFileFormat.WEBP) {
+ return null;
+ }
+
return detected;
+
}
}
diff --git a/src/util/image.vala b/src/util/image.vala
index 95ac998..5b78a50 100644
--- a/src/util/image.vala
+++ b/src/util/image.vala
@@ -343,7 +343,7 @@ private Cairo.Surface get_background_surface() {
string color_b;
var config = Config.Facade.get_instance();
- var type = "checkered"; //config.get_transparent_background_type();
+ var type = config.get_transparent_background_type();
switch (type) {
case "checkered":
color_a = "#808080";