[Xfce4-commits] <garcon:master> Fix compilation errors.

Nick Schermer nick at xfce.org
Sun Aug 16 18:06:01 CEST 2009


Updating branch refs/heads/master
         to 470608d5532e453ea92ea4237c0877302d23d724 (commit)
       from 6c29032506a81eb7e07f0fb2ba46c976bf3694ce (commit)

commit 470608d5532e453ea92ea4237c0877302d23d724
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Aug 16 11:50:31 2009 +0200

    Fix compilation errors.

 garcon/Makefile.am             |    4 +---
 garcon/garcon-menu-directory.c |    2 +-
 garcon/garcon-menu-item-pool.c |    1 -
 garcon/garcon-menu-item-pool.h |    1 +
 garcon/garcon-menu-item.c      |    4 ++--
 garcon/garcon-menu-merger.c    |   16 ++++++++--------
 garcon/garcon-menu-node.c      |    4 ++--
 garcon/garcon-menu-node.h      |    1 +
 garcon/garcon-menu.c           |   17 ++++++++---------
 garcon/garcon-menu.h           |    5 +++++
 10 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/garcon/Makefile.am b/garcon/Makefile.am
index 901ee48..ad12afb 100644
--- a/garcon/Makefile.am
+++ b/garcon/Makefile.am
@@ -66,9 +66,7 @@ libgarcon_sources =							\
 libgarconincludedir = $(includedir)/garcon-1/garcon
 
 libgarconinclude_HEADERS =						\
-	$(libgarcon_headers)						\
-	garcon.h							\
-	garcon-config.h
+	$(libgarcon_headers)
 
 libgarcon_1_la_SOURCES =						\
 	$(libgarcon_sources)						\
diff --git a/garcon/garcon-menu-directory.c b/garcon/garcon-menu-directory.c
index e5bf627..f387535 100644
--- a/garcon/garcon-menu-directory.c
+++ b/garcon/garcon-menu-directory.c
@@ -569,7 +569,7 @@ garcon_menu_directory_get_show_in_environment (GarconMenuDirectory *directory)
   const gchar *env;
   gboolean     show = TRUE;
   gboolean     included;
-  int          i;
+  guint        i;
 
   g_return_val_if_fail (GARCON_IS_MENU_DIRECTORY (directory), FALSE);
   
diff --git a/garcon/garcon-menu-item-pool.c b/garcon/garcon-menu-item-pool.c
index b5c23da..e0aee1e 100644
--- a/garcon/garcon-menu-item-pool.c
+++ b/garcon/garcon-menu-item-pool.c
@@ -22,7 +22,6 @@
 #include <config.h>
 #endif
 
-#include <garcon/garcon-menu-item.h>
 #include <garcon/garcon-menu-node.h>
 #include <garcon/garcon-menu-item-pool.h>
 
diff --git a/garcon/garcon-menu-item-pool.h b/garcon/garcon-menu-item-pool.h
index db5844c..db66dbb 100644
--- a/garcon/garcon-menu-item-pool.h
+++ b/garcon/garcon-menu-item-pool.h
@@ -26,6 +26,7 @@
 #define __GARCON_MENU_ITEM_POOL_H__
 
 #include <glib-object.h>
+#include <garcon/garcon-menu-item.h>
 
 G_BEGIN_DECLS
 
diff --git a/garcon/garcon-menu-item.c b/garcon/garcon-menu-item.c
index 5c3dacd..24eb851 100644
--- a/garcon/garcon-menu-item.c
+++ b/garcon/garcon-menu-item.c
@@ -1099,7 +1099,7 @@ garcon_menu_item_get_show_in_environment (GarconMenuItem *item)
   const gchar *env;
   gboolean     show = TRUE;
   gboolean     included;
-  int          i;
+  guint        i;
 
   g_return_val_if_fail (GARCON_IS_MENU_ITEM (item), FALSE);
 
@@ -1152,7 +1152,7 @@ garcon_menu_item_only_show_in_environment (GarconMenuItem *item)
 {
   const gchar *env;
   gboolean     show = FALSE;
-  int          i;
+  guint        i;
 
   g_return_val_if_fail (GARCON_IS_MENU_ITEM (item), FALSE);
 
diff --git a/garcon/garcon-menu-merger.c b/garcon/garcon-menu-merger.c
index 42a05d3..982c467 100644
--- a/garcon/garcon-menu-merger.c
+++ b/garcon/garcon-menu-merger.c
@@ -258,7 +258,7 @@ garcon_menu_merger_new (GarconMenuTreeProvider *provider)
 
 
 
-gboolean
+static gboolean
 garcon_menu_merger_prepare_merging (GarconMenuMerger        *merger,
                                     GNode                   *tree,
                                     GarconMenuMergerContext *context)
@@ -400,7 +400,7 @@ garcon_menu_merger_insert_default_dirs (GNode *parent,
   int                  i;
   gchar               *path;
   gchar               *kde_data_dir;
-  const gchar         *basename;
+  const gchar         *base_name;
 
   g_return_if_fail (parent != NULL);
   g_return_if_fail (defaults_node != NULL);
@@ -409,12 +409,12 @@ garcon_menu_merger_insert_default_dirs (GNode *parent,
 
   if  (garcon_menu_node_tree_get_node_type (defaults_node) == GARCON_MENU_NODE_TYPE_DEFAULT_DIRECTORY_DIRS)
     {
-      basename = "desktop-directories";
+      base_name = "desktop-directories";
       type = GARCON_MENU_NODE_TYPE_DIRECTORY_DIR;
     }
   else
     {
-      basename = "applications";
+      base_name = "applications";
       type = GARCON_MENU_NODE_TYPE_APP_DIR;
     }
 
@@ -429,7 +429,7 @@ garcon_menu_merger_insert_default_dirs (GNode *parent,
   if (G_UNLIKELY (kde_dir != NULL))
     {
       /* Build KDE data dir */
-      kde_data_dir = g_build_filename (kde_dir, "share", basename, NULL);
+      kde_data_dir = g_build_filename (kde_dir, "share", base_name, NULL);
 
       /* Add it as a directory dir if it exists */
       if (G_LIKELY (g_file_test (kde_data_dir, G_FILE_TEST_IS_DIR)))
@@ -448,7 +448,7 @@ garcon_menu_merger_insert_default_dirs (GNode *parent,
   dirs = g_get_system_data_dirs ();
   for (i = 0; dirs[i] != NULL; i++)
     {
-      path = g_build_path (G_DIR_SEPARATOR_S, dirs[i], basename, NULL);
+      path = g_build_path (G_DIR_SEPARATOR_S, dirs[i], base_name, NULL);
       if (G_LIKELY (g_file_test (path, G_FILE_TEST_IS_DIR)))
         {
           node = g_node_new (garcon_menu_node_create (type, path));
@@ -458,7 +458,7 @@ garcon_menu_merger_insert_default_dirs (GNode *parent,
     }
 
   /* Append user data dir */
-  path = g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (), basename, NULL);
+  path = g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (), base_name, NULL);
   if (G_LIKELY (g_file_test (path, G_FILE_TEST_IS_DIR)))
     {
       node = g_node_new (garcon_menu_node_create (type, path));
@@ -541,7 +541,7 @@ garcon_menu_merger_resolve_relative_paths (GNode                   *node,
   const gchar        **config_dirs;
   gchar               *absolute_path = NULL;
   gchar               *relative_path = NULL;
-  gint                 i;
+  guint                i;
 
   g_return_val_if_fail (context != NULL, FALSE);
 
diff --git a/garcon/garcon-menu-node.c b/garcon/garcon-menu-node.c
index fd686bb..d4a247a 100644
--- a/garcon/garcon-menu-node.c
+++ b/garcon/garcon-menu-node.c
@@ -446,7 +446,7 @@ typedef struct
 
 
 
-gboolean
+static gboolean
 collect_children (GNode *node,
                   Pair  *pair)
 {
@@ -507,7 +507,7 @@ garcon_menu_node_tree_get_child_nodes (GNode             *tree,
 
 
 
-gboolean
+static gboolean
 collect_strings (GNode *node,
                  Pair  *pair)
 {
diff --git a/garcon/garcon-menu-node.h b/garcon/garcon-menu-node.h
index 38ccd08..a1370f4 100644
--- a/garcon/garcon-menu-node.h
+++ b/garcon/garcon-menu-node.h
@@ -93,6 +93,7 @@ typedef struct _GarconMenuNode      GarconMenuNode;
 #define GARCON_IS_MENU_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GARCON_TYPE_MENU_NODE)
 #define GARCON_MENU_NODE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GARCON_TYPE_MENU_NODE, GarconMenuNodeClass))
 
+GType                     garcon_menu_node_type_get_type                (void);
 GType                     garcon_menu_node_get_type                     (void) G_GNUC_CONST;
 
 GarconMenuNode           *garcon_menu_node_new                          (GarconMenuNodeType      node_type) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
diff --git a/garcon/garcon-menu.c b/garcon/garcon-menu.c
index 8b8146e..50803a7 100644
--- a/garcon/garcon-menu.c
+++ b/garcon/garcon-menu.c
@@ -32,7 +32,6 @@
 #include <garcon/garcon-menu-element.h>
 #include <garcon/garcon-menu-item.h>
 #include <garcon/garcon-menu-directory.h>
-#include <garcon/garcon-menu-item-pool.h>
 #include <garcon/garcon-menu-item-cache.h>
 #include <garcon/garcon-menu-separator.h>
 #include <garcon/garcon-menu-monitor.h>
@@ -898,7 +897,7 @@ garcon_menu_collect_files_from_path (GarconMenu  *menu,
   GFileEnumerator *enumerator;
   GFileInfo       *file_info;
   GFile           *file;
-  gchar           *basename;
+  gchar           *base_name;
   gchar           *new_id_prefix;
   gchar           *desktop_id;
 
@@ -933,16 +932,16 @@ garcon_menu_collect_files_from_path (GarconMenu  *menu,
         break;
 
       file = g_file_resolve_relative_path (dir, g_file_info_get_name (file_info));
-      basename = g_file_get_basename (file);
+      base_name = g_file_get_basename (file);
 
       /* Treat files and directories differently */
       if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY)
         {
           /* Create new desktop-file id prefix */
           if (G_LIKELY (id_prefix == NULL))
-            new_id_prefix = g_strdup (basename);
+            new_id_prefix = g_strdup (base_name);
           else
-            new_id_prefix = g_strjoin ("-", id_prefix, basename, NULL);
+            new_id_prefix = g_strjoin ("-", id_prefix, base_name, NULL);
 
           /* Collect files in the directory */
           garcon_menu_collect_files_from_path (menu, desktop_id_table, file, new_id_prefix);
@@ -953,13 +952,13 @@ garcon_menu_collect_files_from_path (GarconMenu  *menu,
       else
         {
           /* Skip all filenames which do not end with .desktop */
-          if (G_LIKELY (g_str_has_suffix (basename, ".desktop")))
+          if (G_LIKELY (g_str_has_suffix (base_name, ".desktop")))
             {
               /* Create desktop-file id */
               if (G_LIKELY (id_prefix == NULL))
-                desktop_id = g_strdup (basename);
+                desktop_id = g_strdup (base_name);
               else
-                desktop_id = g_strjoin ("-", id_prefix, basename, NULL);
+                desktop_id = g_strjoin ("-", id_prefix, base_name, NULL);
 
               /* Insert into the files hash table if the desktop-file id does not exist there yet */
               if (G_LIKELY (g_hash_table_lookup (desktop_id_table, desktop_id) == NULL))
@@ -970,7 +969,7 @@ garcon_menu_collect_files_from_path (GarconMenu  *menu,
         }
 
       /* Free absolute path */
-      g_free (basename);
+      g_free (base_name);
 
       /* Destroy file */
       g_object_unref (file);
diff --git a/garcon/garcon-menu.h b/garcon/garcon-menu.h
index b519323..bd8c096 100644
--- a/garcon/garcon-menu.h
+++ b/garcon/garcon-menu.h
@@ -22,6 +22,7 @@
 #define __GARCON_MENU_H__
 
 #include <gio/gio.h>
+#include <garcon/garcon-menu-item-pool.h>
 
 G_BEGIN_DECLS
 
@@ -47,9 +48,13 @@ gboolean             garcon_menu_load               (GarconMenu   *menu,
 GFile               *garcon_menu_get_file           (GarconMenu   *menu);
 GarconMenuDirectory *garcon_menu_get_directory      (GarconMenu   *menu);
 GList               *garcon_menu_get_menus          (GarconMenu   *menu);
+void                 garcon_menu_add_menu           (GarconMenu   *menu,
+                                                     GarconMenu   *submenu);
 GarconMenu          *garcon_menu_get_menu_with_name (GarconMenu   *menu,
                                                      const gchar  *name);
 GarconMenu          *garcon_menu_get_parent         (GarconMenu   *menu);
+GarconMenuItemPool  *garcon_menu_get_item_pool      (GarconMenu   *menu);
+GList               *garcon_menu_get_items          (GarconMenu   *menu);
 GList               *garcon_menu_get_elements       (GarconMenu   *menu);
 
 struct _GarconMenuClass



More information about the Xfce4-commits mailing list