[gitg] Locate local resources robustly for debugging
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Locate local resources robustly for debugging
- Date: Sat, 2 Mar 2013 13:35:18 +0000 (UTC)
commit 0d800ddb616647399cc155a85ce866da6bc799d6
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sat Mar 2 14:29:23 2013 +0100
Locate local resources robustly for debugging
.../gitg-gtk-diff-view-request-resource.vala | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/libgitg-gtk/gitg-gtk-diff-view-request-resource.vala
b/libgitg-gtk/gitg-gtk-diff-view-request-resource.vala
index fbe3779..f31c37e 100644
--- a/libgitg-gtk/gitg-gtk-diff-view-request-resource.vala
+++ b/libgitg-gtk/gitg-gtk-diff-view-request-resource.vala
@@ -50,7 +50,25 @@ namespace GitgGtk
path = path.substring(pre.length);
}
- d_resource = File.new_for_path("resources" + path);
+ File? repopath;
+
+ try
+ {
+ repopath = Ggit.Repository.discover(File.new_for_path("."));
+ }
+ catch
+ {
+ repopath = null;
+ }
+
+ if (repopath != null)
+ {
+ d_resource =
File.new_for_path(Path.build_filename(repopath.get_path(), "..", "libgitg-gtk", "resources", path));
+ }
+ else
+ {
+ d_resource = File.new_for_path(Path.build_filename("resources",
path));
+ }
}
return d_resource;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]