diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2013-10-18 18:22:33 +0200 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2013-10-19 21:15:36 +0200 |
commit | c9cc3bbd9ce9ac569996bb013880230d9fa1815e (patch) | |
tree | aeefd715e3c14d6d74e14d4f583e738090f81b4a /mediainfo | |
parent | 2e423f71205853b5c86fd66a3200d3af0a0acbec (diff) |
mi-app: use an idle-handler to set the initial directory
This ensures we don't emit selection changed signals before we're up and running.
Diffstat (limited to 'mediainfo')
-rw-r--r-- | mediainfo/src/mi-app.vala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mediainfo/src/mi-app.vala b/mediainfo/src/mi-app.vala index 7e6bbc6..88dfdec 100644 --- a/mediainfo/src/mi-app.vala +++ b/mediainfo/src/mi-app.vala @@ -62,10 +62,6 @@ public class MediaInfo.App : Window chooser = new FileChooserWidget (FileChooserAction.OPEN); paned.pack1 (chooser, false, false); - if (directory != null) { - //chooser.set_current_folder (GLib.Environment.get_home_dir ()); - chooser.set_current_folder (directory); - } chooser.set_show_hidden (false); if (uri != null) { @@ -75,6 +71,13 @@ public class MediaInfo.App : Window return false; }); } else { + if (directory != null) { + //chooser.set_current_folder (GLib.Environment.get_home_dir ()); + Idle.add ( () => { + chooser.set_current_folder (directory); + return false; + }); + } chooser.selection_changed.connect (on_update_preview); } |