summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoresoleyman <emil@soleyman.com>2020-08-13 10:21:27 -0500
committerDavid King <amigadave@amigadave.com>2020-09-22 09:46:47 +0100
commitc8dbff649229f28bc47493977f7c3f8ac8f7f0cc (patch)
tree1dab9666f5f8aa7a292d7f25ac18855e59bcde1d
parent054c14aa6c97a99511b95f628984701ff2a45117 (diff)
downloadcheese-c8dbff649229f28bc47493977f7c3f8ac8f7f0cc.tar.gz
Remember last used camera
During setup_camera() in cheese-application.vala, we were not explicitly assigning the camera from settings and only assigning the camera from the command line. This now checks for values from both the command line and from settings and allows the command line to override settings. Fixes: https://gitlab.gnome.org/GNOME/cheese/-/issues/76
-rw-r--r--src/cheese-application.vala8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cheese-application.vala b/src/cheese-application.vala
index d14571cf..0bc02407 100644
--- a/src/cheese-application.vala
+++ b/src/cheese-application.vala
@@ -199,6 +199,14 @@ public class Cheese.Application : Gtk.Application
mode.set_enabled (false);
shoot.set_enabled (false);
+ /* If no device has been given on the commandline, retrieve it from
+ * gsettings.
+ */
+ if (device == null)
+ {
+ device = settings.get_string ("camera");
+ }
+
var video_preview = main_window.get_video_preview ();
camera = new Camera (video_preview, device,
settings.get_int ("photo-x-resolution"),