[gitg] Wire up newly cloned repository
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Wire up newly cloned repository
- Date: Thu, 18 Aug 2016 09:01:14 +0000 (UTC)
commit b05523fc15e62bec92f00dd650ad30363f18bf08
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Thu Aug 18 11:00:52 2016 +0200
Wire up newly cloned repository
libgitg/gitg-repository-list-box.vala | 62 ++++++++++++++++++--------------
1 files changed, 35 insertions(+), 27 deletions(-)
---
diff --git a/libgitg/gitg-repository-list-box.vala b/libgitg/gitg-repository-list-box.vala
index 81809b7..610b2b3 100644
--- a/libgitg/gitg-repository-list-box.vala
+++ b/libgitg/gitg-repository-list-box.vala
@@ -402,6 +402,8 @@ namespace Gitg
row.repository = repository;
row.loading = false;
+
+ connect_repository_row(row);
}
else
{
@@ -422,6 +424,38 @@ namespace Gitg
return row;
}
+ private void connect_repository_row(Row row)
+ {
+ var repository = row.repository;
+ var workdir = repository.workdir != null ? repository.workdir : repository.location;
+
+ if (workdir != null)
+ {
+ bind_property("mode", row, "mode");
+
+ row.notify["selected"].connect(() => {
+ notify_property("has-selection");
+ });
+
+ row.request_remove.connect(() => {
+ try
+ {
+ var recent_manager = Gtk.RecentManager.get_default();
+ recent_manager.remove_item(workdir.get_uri());
+ } catch {}
+
+ remove(row);
+ });
+
+ row.can_remove = true;
+ }
+ else
+ {
+ row.can_remove = false;
+ }
+
+ }
+
public Row? add_repository(Repository repository)
{
Row? row = get_row_for_repository(repository);
@@ -434,33 +468,7 @@ namespace Gitg
row = new Row(repository, dirname);
row.show();
- if (f != null)
- {
- bind_property("mode", row, "mode");
- }
-
- if (f != null)
- {
- row.notify["selected"].connect(() => {
- notify_property("has-selection");
- });
-
- row.request_remove.connect(() => {
- try
- {
- var recent_manager = Gtk.RecentManager.get_default();
- recent_manager.remove_item(f.get_uri());
- } catch {}
-
- remove(row);
- });
-
- row.can_remove = true;
- }
- else
- {
- row.can_remove = false;
- }
+ connect_repository_row(row);
add(row);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]