[gnome-disk-utility/udisks2-port] Fix running from source tree



commit 8cae86f519afd2e6a1e27f54d6c3612db14bcb5e
Author: David Zeuthen <davidz redhat com>
Date:   Tue Mar 8 15:22:13 2011 -0500

    Fix running from source tree
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 src/palimpsest/gduapplication.c |    9 +++++++++
 src/palimpsest/gduapplication.h |    2 +-
 src/palimpsest/gduwindow.c      |    7 +++++--
 3 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/src/palimpsest/gduapplication.c b/src/palimpsest/gduapplication.c
index 79b3f12..df5c925 100644
--- a/src/palimpsest/gduapplication.c
+++ b/src/palimpsest/gduapplication.c
@@ -119,3 +119,12 @@ gdu_application_new (void)
                                       "flags", G_APPLICATION_FLAGS_NONE,
                                       NULL));
 }
+
+gboolean _gdu_application_get_running_from_source_tree (GduApplication *app);
+
+gboolean
+_gdu_application_get_running_from_source_tree (GduApplication *app)
+{
+  g_return_val_if_fail (GDU_IS_APPLICATION (app), FALSE);
+  return app->running_from_source_tree;
+}
diff --git a/src/palimpsest/gduapplication.h b/src/palimpsest/gduapplication.h
index 8bb8b68..0b82027 100644
--- a/src/palimpsest/gduapplication.h
+++ b/src/palimpsest/gduapplication.h
@@ -35,7 +35,7 @@ G_BEGIN_DECLS
 GType         gdu_application_get_type   (void) G_GNUC_CONST;
 GApplication *gdu_application_new        (void);
 GtkWidget    *gdu_application_get_widget (GduApplication *app,
-                                            const gchar    *name);
+                                          const gchar    *name);
 
 
 G_END_DECLS
diff --git a/src/palimpsest/gduwindow.c b/src/palimpsest/gduwindow.c
index d808a54..416742a 100644
--- a/src/palimpsest/gduwindow.c
+++ b/src/palimpsest/gduwindow.c
@@ -102,6 +102,8 @@ on_row_inserted (GtkTreeModel *tree_model,
   gtk_tree_view_expand_all (GTK_TREE_VIEW (gdu_window_get_widget (window, "device-tree-treeview")));
 }
 
+gboolean _gdu_application_get_running_from_source_tree (GduApplication *app);
+
 static void
 gdu_window_constructed (GObject *object)
 {
@@ -122,8 +124,9 @@ gdu_window_constructed (GObject *object)
 
   window->builder = gtk_builder_new ();
   error = NULL;
-  path = (TRUE /*app->running_from_source_tree*/) ? "../../data/ui/palimpsest.ui" :
-                                         PACKAGE_DATA_DIR "/gnome-disk-utility/palimpsest.ui";
+  path = _gdu_application_get_running_from_source_tree (window->application)
+    ? "../../data/ui/palimpsest.ui" :
+      PACKAGE_DATA_DIR "/gnome-disk-utility/palimpsest.ui";
   if (gtk_builder_add_from_file (window->builder,
                                  path,
                                  &error) == 0)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]