[gitg] Open selected folder first when opening repository
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Open selected folder first when opening repository
- Date: Sun, 4 May 2014 15:30:29 +0000 (UTC)
commit f59eadab0a336a1a752543e98abd047b31b1060b
Author: Marcus Karlsson <mk acc umu se>
Date: Tue Mar 11 22:52:32 2014 +0100
Open selected folder first when opening repository
When opening a repository gitg takes the current folder from the file
chooser and attempts to open it as a repository. The user may however
select a folder in the file chooser, which may be the actual repository.
Attempt to open the selected folder and only fall back to the current
folder if nothing is selected.
gitg/gitg-window.vala | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index b1041e6..2b459d5 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -319,7 +319,14 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
chooser.response.connect((c, id) => {
if (id == Gtk.ResponseType.OK)
{
- open_repository(chooser.get_current_folder_file());
+ var file = chooser.get_file();
+
+ if (file == null)
+ {
+ file = chooser.get_current_folder_file();
+ }
+
+ open_repository(file);
}
c.destroy();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]