diff --git a/garcon/garcon-config.c b/garcon/garcon-config.c index 64c7bd45b7082dec1cab91039f28932f9955475b..c1e2b6248a405291f3e1cf1d4217c5800a84ff35 100644 --- a/garcon/garcon-config.c +++ b/garcon/garcon-config.c @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -39,12 +39,12 @@ const guint garcon_micro_version = GARCON_MICRO_VERSION; * @required_minor : the required minor version. * @required_micro : the required micro version. * - * Checks that the <systemitem class="library">garcon</systemitem> - * library in use is compatible with the given version. Generally you - * would pass in the constants #GARCON_MAJOR_VERSION, - * #GARCON_MINOR_VERSION and #GARCON_MICRO_VERSION as the three + * Checks that the <systemitem class="library">garcon</systemitem> + * library in use is compatible with the given version. Generally you + * would pass in the constants #GARCON_MAJOR_VERSION, + * #GARCON_MINOR_VERSION and #GARCON_MICRO_VERSION as the three * arguments to this function; that produces a check that the library - * in use is compatible with the version of + * in use is compatible with the version of * <systemitem class="library">garcon</systemitem> the application was * compiled against. * diff --git a/garcon/garcon-environment.c b/garcon/garcon-environment.c index 61d630b69ac5757fd938d0a18616ad62ba952b1b..690b6beafd651946e76495e6176b73013776ada9 100644 --- a/garcon/garcon-environment.c +++ b/garcon/garcon-environment.c @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -62,8 +62,8 @@ garcon_set_environment (const gchar *env) /** * garcon_get_environment: - * - * Return value: Name of the desktop environment (e.g. XFCE, KDE, GNOME) + * + * Return value: Name of the desktop environment (e.g. XFCE, KDE, GNOME) * which is used or %NULL. */ const gchar * diff --git a/garcon/garcon-environment.h b/garcon/garcon-environment.h index b7eeedc46ed5e75ba31c370ffbe4b758286c7387..2384cf16fca191a1ed9ca55415db2776a83b0a8e 100644 --- a/garcon/garcon-environment.h +++ b/garcon/garcon-environment.h @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/garcon/garcon-gio.c b/garcon/garcon-gio.c index 4c381c0b3e8d8148be17794af6b731226e9edec7..0e9b74da100262e941fdf984eee82ad213e9e673 100644 --- a/garcon/garcon-gio.c +++ b/garcon/garcon-gio.c @@ -49,10 +49,10 @@ has_valid_scheme (const char *uri) if (!g_ascii_isalpha (*p)) return FALSE; - do + do { p++; - } + } while (is_valid_scheme_character (*p)); return *p == ':'; @@ -90,7 +90,7 @@ g_file_new_relative_to_file (const gchar *path, g_return_val_if_fail (path != NULL, NULL); g_return_val_if_fail (G_IS_FILE (file), NULL); - + type = g_file_query_file_type (file, G_FILE_QUERY_INFO_NONE, NULL); if (G_UNLIKELY (type == G_FILE_TYPE_DIRECTORY)) @@ -100,7 +100,7 @@ g_file_new_relative_to_file (const gchar *path, result = g_file_new_for_unknown_input (path, dir); g_object_unref (dir); - + return result; } @@ -116,6 +116,6 @@ g_file_get_uri_relative_to_file (const gchar *path, absolute_file = g_file_new_relative_to_file (path, file); uri = g_file_get_uri (absolute_file); g_object_unref (absolute_file); - + return uri; } diff --git a/garcon/garcon-menu-directory.c b/garcon/garcon-menu-directory.c index ad54d8b04f306b662ff3b93b07fead63d61a1104..2a3e0572fc497ab2de4748e6d4f1bd4160a8f727 100644 --- a/garcon/garcon-menu-directory.c +++ b/garcon/garcon-menu-directory.c @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -50,7 +50,7 @@ _garcon_menu_directory_shutdown (void) /* Desktop entry keys */ #if 0 -static const gchar *desktop_entry_keys[] = +static const gchar *desktop_entry_keys[] = { "Name", "Comment", @@ -152,14 +152,14 @@ garcon_menu_directory_class_init (GarconMenuDirectoryClass *klass) gobject_class = G_OBJECT_CLASS (klass); gobject_class->constructed = garcon_menu_directory_constructed; - gobject_class->finalize = garcon_menu_directory_finalize; + gobject_class->finalize = garcon_menu_directory_finalize; gobject_class->get_property = garcon_menu_directory_get_property; gobject_class->set_property = garcon_menu_directory_set_property; /** * GarconMenuDirectory:filename: * - * The @GFile of an %GarconMenuDirectory. + * The @GFile of an %GarconMenuDirectory. **/ g_object_class_install_property (gobject_class, PROP_FILE, @@ -167,7 +167,7 @@ garcon_menu_directory_class_init (GarconMenuDirectoryClass *klass) "File", "File", G_TYPE_FILE, - G_PARAM_READWRITE | + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY)); @@ -246,7 +246,7 @@ garcon_menu_directory_init (GarconMenuDirectory *directory) -static void +static void garcon_menu_directory_constructed (GObject *object) { GarconMenuDirectory *directory = GARCON_MENU_DIRECTORY (object); @@ -351,9 +351,9 @@ garcon_menu_directory_set_property (GObject *object, * garcon_menu_directory_get_file: * * Get the file for @directory. - * - * Return value: a #GFile. The returned object - * should be unreffed with g_object_unref() when no longer needed. + * + * Return value: a #GFile. The returned object + * should be unreffed with g_object_unref() when no longer needed. */ GFile * garcon_menu_directory_get_file (GarconMenuDirectory *directory) @@ -374,7 +374,7 @@ garcon_menu_directory_get_name (GarconMenuDirectory *directory) void -garcon_menu_directory_set_name (GarconMenuDirectory *directory, +garcon_menu_directory_set_name (GarconMenuDirectory *directory, const gchar *name) { g_return_if_fail (GARCON_IS_MENU_DIRECTORY (directory)); @@ -403,7 +403,7 @@ garcon_menu_directory_get_comment (GarconMenuDirectory *directory) void -garcon_menu_directory_set_comment (GarconMenuDirectory *directory, +garcon_menu_directory_set_comment (GarconMenuDirectory *directory, const gchar *comment) { g_return_if_fail (GARCON_IS_MENU_DIRECTORY (directory)); @@ -430,7 +430,7 @@ garcon_menu_directory_get_icon (GarconMenuDirectory *directory) void -garcon_menu_directory_set_icon (GarconMenuDirectory *directory, +garcon_menu_directory_set_icon (GarconMenuDirectory *directory, const gchar *icon) { g_return_if_fail (GARCON_IS_MENU_DIRECTORY (directory)); @@ -457,12 +457,12 @@ garcon_menu_directory_get_no_display (GarconMenuDirectory *directory) -void +void garcon_menu_directory_set_no_display (GarconMenuDirectory *directory, gboolean no_display) { g_return_if_fail (GARCON_IS_MENU_DIRECTORY (directory)); - + /* Abort if old and new value are equal */ if (directory->priv->no_display == no_display) return; @@ -562,7 +562,7 @@ garcon_menu_directory_get_show_in_environment (GarconMenuDirectory *directory) guint i; g_return_val_if_fail (GARCON_IS_MENU_DIRECTORY (directory), FALSE); - + /* Determine current environment */ env = garcon_get_environment (); @@ -577,7 +577,7 @@ garcon_menu_directory_get_show_in_environment (GarconMenuDirectory *directory) { /* Determine whether our environment is included in this list */ included = FALSE; - for (i = 0; i < g_strv_length (directory->priv->only_show_in); ++i) + for (i = 0; i < g_strv_length (directory->priv->only_show_in); ++i) { if (G_UNLIKELY (g_utf8_collate (directory->priv->only_show_in[i], env) == 0)) included = TRUE; diff --git a/garcon/garcon-menu-directory.h b/garcon/garcon-menu-directory.h index 9b1131a2eae57298c96a36010e3cbc9ef5f13f3f..8d01c9623890eb0eb01ecce1da2dbc98ab0190da 100644 --- a/garcon/garcon-menu-directory.h +++ b/garcon/garcon-menu-directory.h @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/garcon/garcon-menu-element.c b/garcon/garcon-menu-element.c index 7ab8b1a0f13e329094952b3f0e2715594063d0b9..84eea953216f22806ce2a5061433207e4bd90d41 100644 --- a/garcon/garcon-menu-element.c +++ b/garcon/garcon-menu-element.c @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/garcon/garcon-menu-element.h b/garcon/garcon-menu-element.h index 9270688f8d72faa7efbe6a4a32fa0356f3316a01..8aacdd8a2acdf5ebb2a54994c834566ec622e485 100644 --- a/garcon/garcon-menu-element.h +++ b/garcon/garcon-menu-element.h @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/garcon/garcon-menu-item-cache.c b/garcon/garcon-menu-item-cache.c index 26425af125bb062e9ecf5bf0e70b2c2f8ccb7419..2637d01241d1987a9eb38ea6f38af0818511d36d 100644 --- a/garcon/garcon-menu-item-cache.c +++ b/garcon/garcon-menu-item-cache.c @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -62,7 +62,7 @@ _garcon_menu_item_cache_init (void) if (G_LIKELY (_garcon_menu_item_cache == NULL)) { _garcon_menu_item_cache = g_object_new (GARCON_TYPE_MENU_ITEM_CACHE, NULL); - g_object_add_weak_pointer (G_OBJECT (_garcon_menu_item_cache), + g_object_add_weak_pointer (G_OBJECT (_garcon_menu_item_cache), (gpointer) &_garcon_menu_item_cache); } } @@ -74,7 +74,7 @@ _garcon_menu_item_cache_shutdown (void) { if (G_LIKELY (_garcon_menu_item_cache != NULL)) g_object_unref (G_OBJECT (_garcon_menu_item_cache)); - + } @@ -132,7 +132,7 @@ garcon_menu_item_cache_init (GarconMenuItemCache *cache) cache->priv->lock = g_mutex_new (); /* Create empty hash table */ - cache->priv->items = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, + cache->priv->items = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) garcon_menu_item_unref); } @@ -142,9 +142,9 @@ garcon_menu_item_cache_init (GarconMenuItemCache *cache) * garcon_menu_item_cache_get_default: * * Returns the default #GarconMenuItemCache. - * - * Return value: the default #GarconMenuItemCache. The returned object - * should be unreffed with g_object_unref() when no longer needed. + * + * Return value: the default #GarconMenuItemCache. The returned object + * should be unreffed with g_object_unref() when no longer needed. */ GarconMenuItemCache* garcon_menu_item_cache_get_default (void) @@ -181,8 +181,8 @@ garcon_menu_item_cache_lookup (GarconMenuItemCache *cache, g_return_val_if_fail (uri != NULL, NULL); g_return_val_if_fail (desktop_id != NULL, NULL); - /* Acquire lock on the item cache as it's likely that we need to load - * items from the hard drive and store it in the hash table of the + /* Acquire lock on the item cache as it's likely that we need to load + * items from the hard drive and store it in the hash table of the * item cache */ g_mutex_lock (cache->priv->lock); @@ -221,7 +221,7 @@ garcon_menu_item_cache_lookup (GarconMenuItemCache *cache, -void +void garcon_menu_item_cache_foreach (GarconMenuItemCache *cache, GHFunc func, gpointer user_data) @@ -246,8 +246,8 @@ garcon_menu_item_cache_invalidate (GarconMenuItemCache *cache) /* Destroy the hash table */ g_hash_table_unref (cache->priv->items); - + /* Create a new, empty hash table */ - cache->priv->items = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, + cache->priv->items = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) garcon_menu_item_unref); } diff --git a/garcon/garcon-menu-item-cache.h b/garcon/garcon-menu-item-cache.h index 690511d29cde4c7bed2ea940541882efabd35cba..49bbd0e433dec6c8a83e16c9a3ac2a0434d87a27 100644 --- a/garcon/garcon-menu-item-cache.h +++ b/garcon/garcon-menu-item-cache.h @@ -49,7 +49,7 @@ GarconMenuItem *garcon_menu_item_cache_lookup (GarconMenuItemCache *ca const gchar *filename, const gchar *desktop_id); void garcon_menu_item_cache_foreach (GarconMenuItemCache *cache, - GHFunc func, + GHFunc func, gpointer user_data); void garcon_menu_item_cache_invalidate (GarconMenuItemCache *cache); diff --git a/garcon/garcon-menu-item-pool.c b/garcon/garcon-menu-item-pool.c index 957cef18d66f0e7bee958a0de8a177c1fd415ffe..450d8e0ec567285f61a26c55b9fc6083776434ea 100644 --- a/garcon/garcon-menu-item-pool.c +++ b/garcon/garcon-menu-item-pool.c @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -83,7 +83,7 @@ static void garcon_menu_item_pool_init (GarconMenuItemPool *pool) { pool->priv = GARCON_MENU_ITEM_POOL_GET_PRIVATE (pool); - pool->priv->items = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, + pool->priv->items = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) garcon_menu_item_unref); } @@ -137,7 +137,7 @@ garcon_menu_item_pool_lookup (GarconMenuItemPool *pool, -void +void garcon_menu_item_pool_foreach (GarconMenuItemPool *pool, GHFunc func, gpointer user_data) @@ -169,7 +169,7 @@ garcon_menu_item_pool_filter_exclude (const gchar *desktop_id, { g_return_val_if_fail (GARCON_IS_MENU_ITEM (item), FALSE); g_return_val_if_fail (node != NULL, FALSE); - + return garcon_menu_node_tree_rule_matches (node, item); } diff --git a/garcon/garcon-menu-item-pool.h b/garcon/garcon-menu-item-pool.h index db66dbb86ba5a02d9011119a2a807357dd724df3..b75a13a9446a04074ecf0403ce7e5fa48413c143 100644 --- a/garcon/garcon-menu-item-pool.h +++ b/garcon/garcon-menu-item-pool.h @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -50,7 +50,7 @@ void garcon_menu_item_pool_insert (GarconMenuItemPool GarconMenuItem *garcon_menu_item_pool_lookup (GarconMenuItemPool *pool, const gchar *desktop_id); void garcon_menu_item_pool_foreach (GarconMenuItemPool *pool, - GHFunc func, + GHFunc func, gpointer user_data); void garcon_menu_item_pool_apply_exclude_rule (GarconMenuItemPool *pool, GNode *node); diff --git a/garcon/garcon-menu-item.c b/garcon/garcon-menu-item.c index afce79193038b6b18e656b3fa3207af1b2bf77e4..ba9237c293f68497bb81fe002103ce65f4928eda 100644 --- a/garcon/garcon-menu-item.c +++ b/garcon/garcon-menu-item.c @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -163,7 +163,7 @@ garcon_menu_item_class_init (GarconMenuItemClass *klass) /** * GarconMenu:file: * - * The #GFile from which the %GarconMenuItem was loaded. + * The #GFile from which the %GarconMenuItem was loaded. **/ g_object_class_install_property (gobject_class, PROP_FILE, @@ -382,7 +382,7 @@ garcon_menu_item_finalize (GObject *object) g_strfreev (item->priv->only_show_in); g_strfreev (item->priv->not_show_in); - + g_free (item->priv->path); g_list_foreach (item->priv->categories, (GFunc) g_free, NULL); @@ -586,17 +586,17 @@ garcon_menu_item_new (GFile *file) g_key_file_get_boolean (rc, "Desktop Entry", "X-KDE-StartupNotify", NULL); /* Allocate a new menu item instance */ - item = g_object_new (GARCON_TYPE_MENU_ITEM, + item = g_object_new (GARCON_TYPE_MENU_ITEM, "file", file, - "command", exec, + "command", exec, "try-exec", try_exec, - "name", name, + "name", name, "generic-name", generic_name, "comment", comment, - "icon-name", icon, - "requires-terminal", terminal, - "no-display", no_display, - "supports-startup-notification", startup_notify, + "icon-name", icon, + "requires-terminal", terminal, + "no-display", no_display, + "supports-startup-notification", startup_notify, "path", path, NULL); @@ -610,7 +610,7 @@ garcon_menu_item_new (GFile *file) categories = g_list_prepend (categories, g_strdup (*mt)); } - /* Free list */ + /* Free list */ g_strfreev (str_list); /* Assign categories list to the menu item */ @@ -683,9 +683,9 @@ garcon_menu_item_new_for_uri (const gchar *uri) * garcon_menu_item_get_file: * * Get the file for @item. - * - * Return value: a #GFile. The returned object - * should be unreffed with g_object_unref() when no longer needed. + * + * Return value: a #GFile. The returned object + * should be unreffed with g_object_unref() when no longer needed. */ GFile * garcon_menu_item_get_file (GarconMenuItem *item) @@ -943,7 +943,7 @@ garcon_menu_item_get_icon_name (GarconMenuItem *item) -void +void garcon_menu_item_set_icon_name (GarconMenuItem *item, const gchar *icon_name) { @@ -977,7 +977,7 @@ garcon_menu_item_get_path (GarconMenuItem *item) -void +void garcon_menu_item_set_path (GarconMenuItem *item, const gchar *path) { @@ -1011,12 +1011,12 @@ garcon_menu_item_requires_terminal (GarconMenuItem *item) -void +void garcon_menu_item_set_requires_terminal (GarconMenuItem *item, gboolean requires_terminal) { g_return_if_fail (GARCON_IS_MENU_ITEM (item)); - + /* Abort if old and new value are equal */ if (item->priv->requires_terminal == requires_terminal) return; @@ -1030,7 +1030,7 @@ garcon_menu_item_set_requires_terminal (GarconMenuItem *item, -gboolean +gboolean garcon_menu_item_get_no_display (GarconMenuItem *item) { g_return_val_if_fail (GARCON_IS_MENU_ITEM (item), FALSE); @@ -1039,12 +1039,12 @@ garcon_menu_item_get_no_display (GarconMenuItem *item) -void +void garcon_menu_item_set_no_display (GarconMenuItem *item, gboolean no_display) { g_return_if_fail (GARCON_IS_MENU_ITEM (item)); - + /* Abort if old and new value are equal */ if (item->priv->no_display == no_display) return; @@ -1058,7 +1058,7 @@ garcon_menu_item_set_no_display (GarconMenuItem *item, -gboolean +gboolean garcon_menu_item_supports_startup_notification (GarconMenuItem *item) { g_return_val_if_fail (GARCON_IS_MENU_ITEM (item), FALSE); @@ -1067,12 +1067,12 @@ garcon_menu_item_supports_startup_notification (GarconMenuItem *item) -void +void garcon_menu_item_set_supports_startup_notification (GarconMenuItem *item, gboolean supports_startup_notification) { g_return_if_fail (GARCON_IS_MENU_ITEM (item)); - + /* Abort if old and new value are equal */ if (item->priv->supports_startup_notification == supports_startup_notification) return; @@ -1132,7 +1132,7 @@ garcon_menu_item_get_show_in_environment (GarconMenuItem *item) { /* Determine whether our environment is included in this list */ included = FALSE; - for (i = 0; i < g_strv_length (item->priv->only_show_in); ++i) + for (i = 0; i < g_strv_length (item->priv->only_show_in); ++i) { if (G_UNLIKELY (g_utf8_collate (item->priv->only_show_in[i], env) == 0)) included = TRUE; diff --git a/garcon/garcon-menu-merger.c b/garcon/garcon-menu-merger.c index 8b5c82d681ec2ea18ff26c7697b92263b45e97d1..be3b9b692a79f6aeb1be001eefefa2f3ea6bb953 100644 --- a/garcon/garcon-menu-merger.c +++ b/garcon/garcon-menu-merger.c @@ -116,7 +116,7 @@ garcon_menu_merger_class_init (GarconMenuMergerClass *klass) garcon_menu_merger_parent_class = g_type_class_peek_parent (klass); gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = garcon_menu_merger_finalize; + gobject_class->finalize = garcon_menu_merger_finalize; gobject_class->constructed = garcon_menu_merger_constructed; gobject_class->get_property = garcon_menu_merger_get_property; gobject_class->set_property = garcon_menu_merger_set_property; @@ -134,7 +134,7 @@ garcon_menu_merger_class_init (GarconMenuMergerClass *klass) -static void +static void garcon_menu_merger_provider_init (GarconMenuTreeProviderIface *iface) { iface->get_tree = garcon_menu_merger_get_tree; @@ -241,7 +241,7 @@ garcon_menu_merger_prepare_merging (GarconMenuMerger *merger, context->node_type = GARCON_MENU_NODE_TYPE_INVALID; g_node_traverse (tree, G_IN_ORDER, G_TRAVERSE_ALL, -1, - (GNodeTraverseFunc) garcon_menu_merger_resolve_default_dirs, + (GNodeTraverseFunc) garcon_menu_merger_resolve_default_dirs, context); context->node_type = GARCON_MENU_NODE_TYPE_MERGE_DIR; @@ -391,8 +391,8 @@ garcon_menu_merger_insert_default_dirs (GNode *parent, type = GARCON_MENU_NODE_TYPE_APP_DIR; } - /* Append $KDEDIR/share/desktop-directories and $KDEDIR/share/applications - * as a workaround for distributions not installing KDE menu files + /* Append $KDEDIR/share/desktop-directories and $KDEDIR/share/applications + * as a workaround for distributions not installing KDE menu files * properly into $XDG_DATA_DIRS */ /* Get KDEDIR environment variable */ @@ -471,7 +471,7 @@ garcon_menu_merger_insert_default_merge_dirs (GNode *parent, } /* Append user config dir */ - path = g_build_path (G_DIR_SEPARATOR_S, g_get_user_config_dir (), "menus", + path = g_build_path (G_DIR_SEPARATOR_S, g_get_user_config_dir (), "menus", "applications-merged", NULL); if (G_LIKELY (g_file_test (path, G_FILE_TEST_IS_DIR))) { @@ -483,7 +483,7 @@ garcon_menu_merger_insert_default_merge_dirs (GNode *parent, -static gboolean +static gboolean garcon_menu_merger_resolve_default_dirs (GNode *node, GarconMenuMergerContext *context) { @@ -505,7 +505,7 @@ garcon_menu_merger_resolve_default_dirs (GNode *node, -static gboolean +static gboolean garcon_menu_merger_resolve_relative_paths (GNode *node, GarconMenuMergerContext *context) { @@ -561,7 +561,7 @@ garcon_menu_merger_resolve_relative_paths (GNode *node, g_object_unref (config_dir); } - /* Look for the same relative path in the XDG_CONFIG_DIRS entries after the parent + /* Look for the same relative path in the XDG_CONFIG_DIRS entries after the parent * of the current menu file */ for (; relative_path != NULL && config_dirs[i] != NULL; ++i) { @@ -630,7 +630,7 @@ garcon_menu_merger_remove_duplicate_paths (GNode *node, if (garcon_menu_node_tree_get_node_type (child) != type) continue; - if (G_LIKELY (g_list_find_custom (remaining_nodes, child, + if (G_LIKELY (g_list_find_custom (remaining_nodes, child, (GCompareFunc) garcon_menu_node_tree_compare) == NULL)) { remaining_nodes = g_list_prepend (remaining_nodes, child); @@ -753,7 +753,7 @@ garcon_menu_merger_resolve_merge_dirs (GNode *node, dir = g_file_new_for_unknown_input (garcon_menu_node_tree_get_string (node), NULL); - enumerator = g_file_enumerate_children (dir, G_FILE_ATTRIBUTE_STANDARD_NAME, + enumerator = g_file_enumerate_children (dir, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NONE, NULL, NULL); if (G_UNLIKELY (enumerator != NULL)) @@ -780,7 +780,7 @@ garcon_menu_merger_resolve_merge_dirs (GNode *node, g_node_insert_after (node->parent, node, file_node); } - + g_object_unref (file_info); } @@ -845,7 +845,7 @@ garcon_menu_merger_process_merge_files (GNode *node, file = g_file_new_for_uri (garcon_menu_node_tree_get_merge_file_filename (node)); - if (G_UNLIKELY (g_list_find_custom (context->file_stack, file, + if (G_UNLIKELY (g_list_find_custom (context->file_stack, file, (GCompareFunc) compare_files) != NULL)) { g_object_unref (file); @@ -874,7 +874,7 @@ garcon_menu_merger_process_merge_files (GNode *node, g_node_destroy (tree); } } - + garcon_menu_node_tree_free (node); return FALSE; @@ -882,7 +882,7 @@ garcon_menu_merger_process_merge_files (GNode *node, -static void +static void garcon_menu_merger_clean_up_elements (GNode *node, GarconMenuNodeType type) { @@ -898,7 +898,7 @@ garcon_menu_merger_clean_up_elements (GNode *node, continue; } - if (type == GARCON_MENU_NODE_TYPE_DELETED + if (type == GARCON_MENU_NODE_TYPE_DELETED && garcon_menu_node_tree_get_node_type (node) != GARCON_MENU_NODE_TYPE_DELETED && garcon_menu_node_tree_get_node_type (node) != GARCON_MENU_NODE_TYPE_NOT_DELETED) { @@ -911,13 +911,13 @@ garcon_menu_merger_clean_up_elements (GNode *node, { continue; } - - if (type == GARCON_MENU_NODE_TYPE_LAYOUT + + if (type == GARCON_MENU_NODE_TYPE_LAYOUT && garcon_menu_node_tree_get_node_type (child) != GARCON_MENU_NODE_TYPE_LAYOUT) { continue; } - + if (remaining_node != NULL) destroy_list = g_list_prepend (destroy_list, child); else @@ -927,8 +927,8 @@ garcon_menu_merger_clean_up_elements (GNode *node, g_list_foreach (destroy_list, (GFunc) garcon_menu_node_tree_free, NULL); g_list_free (destroy_list); - if (type == GARCON_MENU_NODE_TYPE_LAYOUT - && remaining_node != NULL + if (type == GARCON_MENU_NODE_TYPE_LAYOUT + && remaining_node != NULL && G_NODE_IS_LEAF (remaining_node)) { garcon_menu_node_tree_free (remaining_node); @@ -1062,7 +1062,7 @@ garcon_menu_merger_create_menu (GNode *node, if (G_LIKELY (child == NULL)) { child = g_node_append_data (node, NULL); - g_node_append_data (child, garcon_menu_node_create (GARCON_MENU_NODE_TYPE_NAME, + g_node_append_data (child, garcon_menu_node_create (GARCON_MENU_NODE_TYPE_NAME, path[position])); } @@ -1115,9 +1115,9 @@ garcon_menu_merger_resolve_moves (GNode *node) iter = g_list_next (iter); new_path = g_strsplit (iter->data, "/", -1); - old_node = garcon_menu_merger_find_menu (node, old_path, 0, + old_node = garcon_menu_merger_find_menu (node, old_path, 0, g_strv_length (old_path)-1, NULL); - new_node = garcon_menu_merger_find_menu (node, new_path, 0, + new_node = garcon_menu_merger_find_menu (node, new_path, 0, g_strv_length (new_path)-1, NULL); if (G_LIKELY (old_node != NULL && old_node != new_node)) @@ -1130,7 +1130,7 @@ garcon_menu_merger_resolve_moves (GNode *node) garcon_menu_merger_move_nodes (old_node, new_node, NULL); } else - garcon_menu_merger_move_nodes (old_node, new_node, + garcon_menu_merger_move_nodes (old_node, new_node, g_node_first_child (new_node)); g_node_destroy (old_node); @@ -1157,7 +1157,7 @@ garcon_menu_merger_prepend_default_layout (GNode *node) node_ = garcon_menu_node_create (GARCON_MENU_NODE_TYPE_DEFAULT_LAYOUT, NULL); layout = g_node_prepend_data (node, node_); - node_ = garcon_menu_node_create (GARCON_MENU_NODE_TYPE_MERGE, + node_ = garcon_menu_node_create (GARCON_MENU_NODE_TYPE_MERGE, GUINT_TO_POINTER (GARCON_MENU_LAYOUT_MERGE_MENUS)); g_node_append_data (layout, node_); diff --git a/garcon/garcon-menu-node.c b/garcon/garcon-menu-node.c index c537027b31727611aa3d4c0625bea808c86997e5..11d35f4ecd603d28562a9c0ae31f7a246bdca914 100644 --- a/garcon/garcon-menu-node.c +++ b/garcon/garcon-menu-node.c @@ -2,19 +2,19 @@ /*- * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org>. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ @@ -60,7 +60,7 @@ struct _GarconMenuNodeClass union _GarconMenuNodeData { GarconMenuLayoutMergeType layout_merge_type; - struct + struct { GarconMenuMergeFileType type; gchar *filename; @@ -82,7 +82,7 @@ GType garcon_menu_node_type_get_type (void) { static GType type = G_TYPE_INVALID; - static GEnumValue values[] = + static GEnumValue values[] = { { GARCON_MENU_NODE_TYPE_INVALID, "GARCON_MENU_NODE_TYPE_INVALID", "Invalid" }, { GARCON_MENU_NODE_TYPE_MENU, "GARCON_MENU_NODE_TYPE_MENU", "Menu" }, @@ -139,7 +139,7 @@ garcon_menu_node_class_init (GarconMenuNodeClass *klass) garcon_menu_node_parent_class = g_type_class_peek_parent (klass); gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = garcon_menu_node_finalize; + gobject_class->finalize = garcon_menu_node_finalize; gobject_class->get_property = garcon_menu_node_get_property; gobject_class->set_property = garcon_menu_node_set_property; @@ -453,8 +453,8 @@ garcon_menu_node_tree_get_child_node (GNode *tree, GNode *node = NULL; GNode *child; - for (child = reverse ? g_node_last_child (tree) : g_node_first_child (tree); - node == NULL && child != NULL; + for (child = reverse ? g_node_last_child (tree) : g_node_first_child (tree); + node == NULL && child != NULL; child = reverse ? g_node_prev_sibling (child) : g_node_next_sibling (child)) { if (garcon_menu_node_tree_get_node_type (child) == type) @@ -548,7 +548,7 @@ collect_boolean (GNode *node, -gboolean +gboolean garcon_menu_node_tree_get_boolean_child (GNode *tree, GarconMenuNodeType type) { @@ -659,7 +659,7 @@ garcon_menu_node_tree_rule_matches (GNode *node, -GarconMenuNodeType +GarconMenuNodeType garcon_menu_node_tree_get_node_type (GNode *tree) { if (tree == NULL) @@ -673,7 +673,7 @@ garcon_menu_node_tree_get_node_type (GNode *tree) -const gchar * +const gchar * garcon_menu_node_tree_get_string (GNode *tree) { if (tree == NULL || tree->data == NULL) @@ -716,7 +716,7 @@ garcon_menu_node_tree_get_layout_merge_type (GNode *tree) -GarconMenuMergeFileType +GarconMenuMergeFileType garcon_menu_node_tree_get_merge_file_type (GNode *tree) { g_return_val_if_fail (garcon_menu_node_tree_get_node_type (tree) == GARCON_MENU_NODE_TYPE_MERGE_FILE, 0); @@ -776,7 +776,7 @@ garcon_menu_node_tree_compare (GNode *tree, break; case GARCON_MENU_NODE_TYPE_MERGE_FILE: - return g_utf8_collate (node->data.merge_file.filename, + return g_utf8_collate (node->data.merge_file.filename, other_node->data.merge_file.filename); break; diff --git a/garcon/garcon-menu-parser.c b/garcon/garcon-menu-parser.c index 7c9cb9821e59e0573b2001b3834f921cfd0b864f..f92d41bf394bb80f6331495016dd0e32419399ce 100644 --- a/garcon/garcon-menu-parser.c +++ b/garcon/garcon-menu-parser.c @@ -145,7 +145,7 @@ garcon_menu_parser_class_init (GarconMenuParserClass *klass) garcon_menu_parser_parent_class = g_type_class_peek_parent (klass); gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = garcon_menu_parser_finalize; + gobject_class->finalize = garcon_menu_parser_finalize; gobject_class->get_property = garcon_menu_parser_get_property; gobject_class->set_property = garcon_menu_parser_set_property; @@ -162,7 +162,7 @@ garcon_menu_parser_class_init (GarconMenuParserClass *klass) -static void +static void garcon_menu_parser_provider_init (GarconMenuTreeProviderIface *iface) { iface->get_tree = garcon_menu_parser_get_tree; @@ -274,10 +274,10 @@ garcon_menu_parser_run (GarconMenuParser *parser, &data, &data_length, NULL, error))) { gchar *uri = g_file_get_uri (parser->priv->file); - + if (error != NULL) { - g_warning (_("Could not load menu file data from %s: %s"), + g_warning (_("Could not load menu file data from %s: %s"), uri, (*error)->message); g_error_free (*error); } @@ -295,7 +295,7 @@ garcon_menu_parser_run (GarconMenuParser *parser, parser_context.node = NULL; /* Create markup parse context */ - context = g_markup_parse_context_new (&markup_parser, 0, &parser_context, NULL); + context = g_markup_parse_context_new (&markup_parser, 0, &parser_context, NULL); /* Try to parse the menu file */ if (!g_markup_parse_context_parse (context, data, data_length, error) || @@ -526,14 +526,14 @@ garcon_menu_parser_start_element (GMarkupParseContext *context, } break; - default: + default: break; } } -static void +static void garcon_menu_parser_end_element (GMarkupParseContext *context, const gchar *element_name, gpointer user_data, @@ -561,7 +561,7 @@ garcon_menu_parser_end_element (GMarkupParseContext *context, if (parser_context->node->parent == NULL) parser_context->state = GARCON_MENU_PARSER_STATE_ROOT; - else + else parser_context->state = GARCON_MENU_PARSER_STATE_MENU; } break; @@ -646,7 +646,7 @@ garcon_menu_parser_characters (GMarkupParseContext *context, switch (parser_context->node_type) { case GARCON_MENU_PARSER_NODE_TYPE_NAME: - g_node_append_data (parser_context->node, + g_node_append_data (parser_context->node, garcon_menu_node_create (GARCON_MENU_NODE_TYPE_NAME, data)); break; diff --git a/garcon/garcon-menu-separator.c b/garcon/garcon-menu-separator.c index a33de80bfe3388016bf77ef01be3f35c09bd557a..c2c2f88835a59f3b528b4d0677aa62dfdd9a1cea 100644 --- a/garcon/garcon-menu-separator.c +++ b/garcon/garcon-menu-separator.c @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -48,7 +48,7 @@ _garcon_menu_separator_init (void) if (G_LIKELY (_garcon_menu_separator == NULL)) { _garcon_menu_separator = g_object_new (GARCON_TYPE_MENU_SEPARATOR, NULL); - g_object_add_weak_pointer (G_OBJECT (_garcon_menu_separator), + g_object_add_weak_pointer (G_OBJECT (_garcon_menu_separator), (gpointer) &_garcon_menu_separator); } } diff --git a/garcon/garcon-menu-tree-provider.c b/garcon/garcon-menu-tree-provider.c index ff8fe95b58a6fa990c64a51629829e567febfade..9681dad0603541eed99564bb97af81c76c4a08e9 100644 --- a/garcon/garcon-menu-tree-provider.c +++ b/garcon/garcon-menu-tree-provider.c @@ -34,7 +34,7 @@ garcon_menu_tree_provider_get_type (void) if (g_once_init_enter (&type__volatile)) { - type = g_type_register_static_simple (G_TYPE_INTERFACE, + type = g_type_register_static_simple (G_TYPE_INTERFACE, g_intern_static_string ("GarconMenuTreeProvider"), sizeof (GarconMenuTreeProviderIface), NULL, diff --git a/garcon/garcon-menu.c b/garcon/garcon-menu.c index 851bf78a00a7256477c5f4d65bfd5b180b4a5b87..ee9ad413b6faccbf4f090bed0d24ba3c6ab97052 100644 --- a/garcon/garcon-menu.c +++ b/garcon/garcon-menu.c @@ -59,7 +59,7 @@ /* Potential root menu files */ -static const gchar GARCON_MENU_ROOT_SPECS[][30] = +static const gchar GARCON_MENU_ROOT_SPECS[][30] = { "menus/applications.menu", "menus/xfce-applications.menu", @@ -178,14 +178,14 @@ garcon_menu_class_init (GarconMenuClass *klass) garcon_menu_parent_class = g_type_class_peek_parent (klass); gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = garcon_menu_finalize; + gobject_class->finalize = garcon_menu_finalize; gobject_class->get_property = garcon_menu_get_property; gobject_class->set_property = garcon_menu_set_property; /** * GarconMenu:file: * - * The #GFile from which the %GarconMenu was loaded. + * The #GFile from which the %GarconMenu was loaded. **/ g_object_class_install_property (gobject_class, PROP_FILE, @@ -200,7 +200,7 @@ garcon_menu_class_init (GarconMenuClass *klass) /** * GarconMenu:directory: * - * The directory entry associated with this menu. + * The directory entry associated with this menu. **/ g_object_class_install_property (gobject_class, PROP_DIRECTORY, @@ -332,9 +332,9 @@ garcon_menu_set_property (GObject *object, * @file : #GFile for the .menu file you want to load. * * Creates a new #GarconMenu for the .menu file referred to by @file. - * This operation only fails @file is invalid. To load the menu + * This operation only fails @file is invalid. To load the menu * tree from the file, you need to call garcon_menu_load() with the - * returned #GarconMenu. + * returned #GarconMenu. * * The caller is responsible to destroy the returned #GarconMenu * using g_object_unref(). @@ -357,13 +357,13 @@ garcon_menu_new (GFile *file) * @filename : Path/URI of the .menu file you want to load. * * Creates a new #GarconMenu for the .menu file referred to by @filename. - * This operation only fails if the filename is NULL. To load the menu + * This operation only fails if the filename is NULL. To load the menu * tree from the file, you need to call garcon_menu_load() with the - * returned #GarconMenu. + * returned #GarconMenu. * * <informalexample><programlisting> * GarconMenu *menu = garcon_menu_new (filename); - * + * * if (garcon_menu_load (menu, &error)) * ... * else @@ -429,7 +429,7 @@ garcon_menu_new_applications (void) g_free (filename); } - + return menu; } @@ -439,11 +439,11 @@ garcon_menu_new_applications (void) * garcon_menu_get_file: * @menu : a #GarconMenu. * - * Get the file for @menu. It refers to the .menu file from which + * Get the file for @menu. It refers to the .menu file from which * @menu was or will be loaded. - * - * Return value: a #GFile. The returned object - * should be unreffed with g_object_unref() when no longer needed. + * + * Return value: a #GFile. The returned object + * should be unreffed with g_object_unref() when no longer needed. */ GFile * garcon_menu_get_file (GarconMenu *menu) @@ -470,13 +470,13 @@ garcon_menu_get_name (GarconMenu *menu) * * Returns the #GarconMenuDirectory of @menu or %NULL if the <Menu> * element that corresponds to @menu has no valid <Directory> element. - * The menu directory may contain a lot of useful information about - * the menu like the display and icon name, desktop environments it + * The menu directory may contain a lot of useful information about + * the menu like the display and icon name, desktop environments it * should show up in etc. * * Return value: #GarconMenuDirectory of @menu or %NULL if - * @menu has no valid directory element. The returned object - * should be unreffed with g_object_unref() when no longer needed. + * @menu has no valid directory element. The returned object + * should be unreffed with g_object_unref() when no longer needed. */ GarconMenuDirectory* garcon_menu_get_directory (GarconMenu *menu) @@ -497,7 +497,7 @@ garcon_menu_set_directory (GarconMenu *menu, /* Abort if directories are equal */ if (garcon_menu_directory_equal (directory, menu->priv->directory)) return; - + /* Destroy old directory */ if (menu->priv->directory != NULL) g_object_unref (menu->priv->directory); @@ -520,24 +520,24 @@ garcon_menu_set_directory (GarconMenu *menu, * @cancellable : a #GCancellable * @error : #GError return location * - * This function loads the entire menu tree from the file referred to + * This function loads the entire menu tree from the file referred to * by @menu. It resolves merges, moves and everything else defined * in the menu specification. The resulting tree information is - * stored within @menu and can be accessed using the public #GarconMenu + * stored within @menu and can be accessed using the public #GarconMenu * API afterwards. * * @cancellable can be used to handle blocking I/O when reading data - * from files during the loading process. + * from files during the loading process. * * @error should either be NULL or point to a #GError return location * where errors should be stored in. * * Return value: %TRUE if the menu was loaded successfully or - * %FALSE if there was an error or the process was + * %FALSE if there was an error or the process was * cancelled. **/ gboolean -garcon_menu_load (GarconMenu *menu, +garcon_menu_load (GarconMenu *menu, GCancellable *cancellable, GError **error) { @@ -598,7 +598,7 @@ garcon_menu_get_menus (GarconMenu *menu) GList *menus = NULL; g_return_val_if_fail (GARCON_IS_MENU (menu), NULL); - + /* Copy submenu list */ menus = g_list_copy (menu->priv->submenus); @@ -670,8 +670,8 @@ garcon_menu_resolve_menus (GarconMenu *menu) g_return_if_fail (GARCON_IS_MENU (menu)); - menus = garcon_menu_node_tree_get_child_nodes (menu->priv->tree, - GARCON_MENU_NODE_TYPE_MENU, + menus = garcon_menu_node_tree_get_child_nodes (menu->priv->tree, + GARCON_MENU_NODE_TYPE_MENU, FALSE); for (iter = menus; iter != NULL; iter = g_list_next (iter)) @@ -696,8 +696,8 @@ garcon_menu_get_directories (GarconMenu *menu) GList *dirs = NULL; /* Fetch all application directories */ - dirs = garcon_menu_node_tree_get_string_children (menu->priv->tree, - GARCON_MENU_NODE_TYPE_DIRECTORY, + dirs = garcon_menu_node_tree_get_string_children (menu->priv->tree, + GARCON_MENU_NODE_TYPE_DIRECTORY, TRUE); if (menu->priv->parent != NULL) @@ -727,7 +727,7 @@ garcon_menu_resolve_directory (GarconMenu *menu) directory = garcon_menu_lookup_directory (menu, iter->data); } - if (G_LIKELY (directory != NULL)) + if (G_LIKELY (directory != NULL)) { /* Set the directory (assuming that we found at least one valid name) */ menu->priv->directory = directory; @@ -749,8 +749,8 @@ garcon_menu_get_directory_dirs (GarconMenu *menu) GList *dirs = NULL; /* Fetch all application directories */ - dirs = garcon_menu_node_tree_get_string_children (menu->priv->tree, - GARCON_MENU_NODE_TYPE_DIRECTORY_DIR, + dirs = garcon_menu_node_tree_get_string_children (menu->priv->tree, + GARCON_MENU_NODE_TYPE_DIRECTORY_DIR, TRUE); if (menu->priv->parent != NULL) @@ -771,7 +771,7 @@ garcon_menu_lookup_directory (GarconMenu *menu, GFile *file; GFile *dir; gboolean found = FALSE; - + g_return_val_if_fail (GARCON_IS_MENU (menu), NULL); g_return_val_if_fail (filename != NULL, NULL); @@ -792,7 +792,7 @@ garcon_menu_lookup_directory (GarconMenu *menu, /* Update search status */ found = TRUE; } - + /* Destroy the file objects */ g_object_unref (file); g_object_unref (dir); @@ -812,7 +812,7 @@ garcon_menu_get_app_dirs (GarconMenu *menu) GList *dirs = NULL; /* Fetch all application directories */ - dirs = garcon_menu_node_tree_get_string_children (menu->priv->tree, + dirs = garcon_menu_node_tree_get_string_children (menu->priv->tree, GARCON_MENU_NODE_TYPE_APP_DIR, TRUE); @@ -874,8 +874,8 @@ garcon_menu_collect_files_from_path (GarconMenu *menu, return; /* Skip directory if it's not a directory */ - if (G_UNLIKELY (g_file_query_file_type (dir, - G_FILE_QUERY_INFO_NONE, + if (G_UNLIKELY (g_file_query_file_type (dir, + G_FILE_QUERY_INFO_NONE, NULL) != G_FILE_TYPE_DIRECTORY)) { return; @@ -976,12 +976,12 @@ garcon_menu_resolve_items (GarconMenu *menu, g_return_if_fail (menu != NULL && GARCON_IS_MENU (menu)); - menu_only_unallocated = garcon_menu_node_tree_get_boolean_child (menu->priv->tree, + menu_only_unallocated = garcon_menu_node_tree_get_boolean_child (menu->priv->tree, GARCON_MENU_NODE_TYPE_ONLY_UNALLOCATED); /* Resolve items in this menu (if it matches the only_unallocated argument. - * This means that in the first pass, all items of menus without - * <OnlyUnallocated /> are resolved and in the second pass, only items of + * This means that in the first pass, all items of menus without + * <OnlyUnallocated /> are resolved and in the second pass, only items of * menus with <OnlyUnallocated /> are resolved */ if (menu_only_unallocated == only_unallocated) { @@ -1088,7 +1088,7 @@ garcon_menu_remove_deleted_menus (GarconMenu *menu) submenu = iter->data; /* Check whether there is a <Deleted/> element */ - deleted = garcon_menu_node_tree_get_boolean_child (submenu->priv->tree, + deleted = garcon_menu_node_tree_get_boolean_child (submenu->priv->tree, GARCON_MENU_NODE_TYPE_DELETED); /* Determine whether this submenu was deleted */ @@ -1135,7 +1135,7 @@ items_collect (const gchar *desktop_id, * garcon_menu_get_items: * @menu : a #GarconMenu. * - * Returns all #GarconMenuItem<!---->s included in @menu. The items are + * Returns all #GarconMenuItem<!---->s included in @menu. The items are * sorted by their display names in ascending order. * * The caller is responsible to free the returned list using @@ -1143,7 +1143,7 @@ items_collect (const gchar *desktop_id, * g_list_free (list); * </programlisting></informalexample> * when no longer needed. - * + * * Return value: list of #GarconMenuItem<!---->s included in @menu. **/ GList * @@ -1174,7 +1174,7 @@ garcon_menu_get_layout (GarconMenu *menu, if (G_LIKELY (!default_only)) { - layout = garcon_menu_node_tree_get_child_node (menu->priv->tree, + layout = garcon_menu_node_tree_get_child_node (menu->priv->tree, GARCON_MENU_NODE_TYPE_LAYOUT, TRUE); } @@ -1200,9 +1200,9 @@ layout_has_menuname (GNode *layout, { GList *nodes; GList *iter; - gboolean has_menuname = FALSE; + gboolean has_menuname = FALSE; - nodes = garcon_menu_node_tree_get_child_nodes (layout, GARCON_MENU_NODE_TYPE_MENUNAME, + nodes = garcon_menu_node_tree_get_child_nodes (layout, GARCON_MENU_NODE_TYPE_MENUNAME, FALSE); for (iter = g_list_first (nodes); !has_menuname && iter != NULL; iter = g_list_next (iter)) @@ -1222,9 +1222,9 @@ layout_has_filename (GNode *layout, { GList *nodes; GList *iter; - gboolean has_filename = FALSE; + gboolean has_filename = FALSE; - nodes = garcon_menu_node_tree_get_child_nodes (layout, GARCON_MENU_NODE_TYPE_FILENAME, + nodes = garcon_menu_node_tree_get_child_nodes (layout, GARCON_MENU_NODE_TYPE_FILENAME, FALSE); for (iter = g_list_first (nodes); !has_filename && iter != NULL; iter = g_list_next (iter)) @@ -1291,7 +1291,7 @@ garcon_menu_get_elements (GarconMenu *menu) if (type == GARCON_MENU_NODE_TYPE_FILENAME) { /* Search for desktop ID in the item pool */ - item = garcon_menu_item_pool_lookup (menu->priv->pool, + item = garcon_menu_item_pool_lookup (menu->priv->pool, garcon_menu_node_tree_get_string (node)); /* If the item with this desktop ID is included in the menu, append it to the list */ @@ -1301,7 +1301,7 @@ garcon_menu_get_elements (GarconMenu *menu) if (type == GARCON_MENU_NODE_TYPE_MENUNAME) { /* Search submenu with this name */ - submenu = garcon_menu_get_menu_with_name (menu, + submenu = garcon_menu_get_menu_with_name (menu, garcon_menu_node_tree_get_string (node)); /* If there is such a menu, append it to the list */ @@ -1322,7 +1322,7 @@ garcon_menu_get_elements (GarconMenu *menu) { /* Get all menu items of this menu */ menu_items = garcon_menu_get_items (menu); - + /* Append submenus */ menu_items = g_list_concat (menu_items, garcon_menu_get_menus (menu)); @@ -1350,7 +1350,7 @@ garcon_menu_get_elements (GarconMenu *menu) } } } - + return items; } @@ -1360,7 +1360,7 @@ static gint garcon_menu_compare_items (gconstpointer *a, gconstpointer *b) { - return g_utf8_collate (garcon_menu_element_get_name (GARCON_MENU_ELEMENT (a)), + return g_utf8_collate (garcon_menu_element_get_name (GARCON_MENU_ELEMENT (a)), garcon_menu_element_get_name (GARCON_MENU_ELEMENT (b))); } @@ -1410,7 +1410,7 @@ static const gchar* garcon_menu_get_element_icon_name (GarconMenuElement *element) { GarconMenu *menu; - + g_return_val_if_fail (GARCON_IS_MENU (element), NULL); menu = GARCON_MENU (element); diff --git a/garcon/garcon-menu.h b/garcon/garcon-menu.h index 0ab5c89a1b5ab6cec70bd29e53ef1000254322e7..13dc3b5e3bf5cc448257f7c2cf5452770f0c26ad 100644 --- a/garcon/garcon-menu.h +++ b/garcon/garcon-menu.h @@ -42,7 +42,7 @@ GType garcon_menu_get_type (void) G_GNUC_CONST; GarconMenu *garcon_menu_new (GFile *file) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; GarconMenu *garcon_menu_new_for_path (const gchar *filename) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; GarconMenu *garcon_menu_new_applications (void) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; -gboolean garcon_menu_load (GarconMenu *menu, +gboolean garcon_menu_load (GarconMenu *menu, GCancellable *cancellable, GError **error); GFile *garcon_menu_get_file (GarconMenu *menu); diff --git a/garcon/garcon.c b/garcon/garcon.c index 0eda8a48acf414b071886391e92336498e9cca32..af390273ed447088b86354788f10061f13426942 100644 --- a/garcon/garcon.c +++ b/garcon/garcon.c @@ -9,11 +9,11 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * - * You should have received a copy of the GNU Library General - * Public License along with this library; if not, write to the + * You should have received a copy of the GNU Library General + * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -47,12 +47,12 @@ static gint garcon_ref_count = 0; /** * garcon_init: - * @env : name of the desktop environment (e.g. XFCE, GNOME or KDE) + * @env : name of the desktop environment (e.g. XFCE, GNOME or KDE) * or %NULL. * - * Initializes the garcon library. @env optionally defines the - * name of the desktop environment for which menus will be generated. - * This means that items belonging only to other desktop environments + * Initializes the garcon library. @env optionally defines the + * name of the desktop environment for which menus will be generated. + * This means that items belonging only to other desktop environments * will be ignored. **/ void @@ -141,6 +141,6 @@ garcon_config_lookup (const gchar *filename) } } } - + return path; } diff --git a/tests/test-menu-parser.c b/tests/test-menu-parser.c index 21297660925977aeadea3c3c36f64aafb6f411fd..601cd9c9e182f9cb4eebe0dd970e1c691c441154 100644 --- a/tests/test-menu-parser.c +++ b/tests/test-menu-parser.c @@ -36,7 +36,7 @@ -static gboolean print_node (GNode *node, +static gboolean print_node (GNode *node, gint depth); @@ -68,7 +68,7 @@ print_child_nodes (GNode *node, for (child = g_node_first_child (node); child != NULL; child = g_node_next_sibling (child)) { - g_node_traverse (child, G_PRE_ORDER, G_TRAVERSE_ALL, 1, + g_node_traverse (child, G_PRE_ORDER, G_TRAVERSE_ALL, 1, (GNodeTraverseFunc) print_node, GINT_TO_POINTER (depth+2)); } } @@ -149,7 +149,7 @@ print_node (GNode *node, INDENT; g_print ("<Separator/>\n"); break; case GARCON_MENU_NODE_TYPE_MERGE: - INDENT; + INDENT; switch (garcon_menu_node_tree_get_layout_merge_type (node)) { case GARCON_MENU_LAYOUT_MERGE_ALL: @@ -168,7 +168,7 @@ print_node (GNode *node, switch (garcon_menu_node_tree_get_merge_file_type (node)) { case GARCON_MENU_MERGE_FILE_PATH: - g_print ("<MergeFile type=\"path\">%s</MergeFile>\n", + g_print ("<MergeFile type=\"path\">%s</MergeFile>\n", garcon_menu_node_tree_get_merge_file_filename (node)); break; case GARCON_MENU_MERGE_FILE_PARENT: @@ -206,7 +206,7 @@ print_tree (GarconMenuTreeProvider *provider) -static const gchar ROOT_SPECS[][30] = +static const gchar ROOT_SPECS[][30] = { "menus/applications.menu", "menus/xfce-applications.menu", @@ -259,7 +259,7 @@ main (int argc, parser = garcon_menu_parser_new (file); g_object_unref (file); - + if (G_LIKELY (garcon_menu_parser_run (parser, NULL, &error))) { print_tree (GARCON_MENU_TREE_PROVIDER (parser)); @@ -275,8 +275,8 @@ main (int argc, { if (error != NULL) { - g_error ("Could not merge menus in %s: %s", - argc > 1 ? argv[1] : FILENAME, + g_error ("Could not merge menus in %s: %s", + argc > 1 ? argv[1] : FILENAME, error->message); g_error_free (error); diff --git a/tests/test-menu-spec.c b/tests/test-menu-spec.c index bfc82e0773152e611a9d6ac196aae52bdf2f2155..408130bf9e29ebdffa4c5a9caa5e15a75cf5c843 100644 --- a/tests/test-menu-spec.c +++ b/tests/test-menu-spec.c @@ -35,7 +35,7 @@ void -print_menu (GarconMenu *menu, +print_menu (GarconMenu *menu, const gchar *path) { GarconMenuDirectory *directory; @@ -54,9 +54,9 @@ print_menu (GarconMenu *menu, name = g_strdup (""); else { - name = g_strdup_printf ("%s%s/", path, - (directory == NULL - ? garcon_menu_element_get_name (GARCON_MENU_ELEMENT (menu)) + name = g_strdup_printf ("%s%s/", path, + (directory == NULL + ? garcon_menu_element_get_name (GARCON_MENU_ELEMENT (menu)) : garcon_menu_directory_get_name (directory))); } @@ -64,7 +64,7 @@ print_menu (GarconMenu *menu, menus = garcon_menu_get_menus (menu); /* Print child menus */ - for (iter = menus; iter != NULL; iter = g_list_next (iter)) + for (iter = menus; iter != NULL; iter = g_list_next (iter)) { /* Only display menus which are not hidden or excluded from this environment */ if (G_LIKELY (garcon_menu_element_get_visible (iter->data))) @@ -78,12 +78,12 @@ print_menu (GarconMenu *menu, items = garcon_menu_get_elements (menu); /* Print menu items */ - for (iter = items; iter != NULL; iter = g_list_next (iter)) + for (iter = items; iter != NULL; iter = g_list_next (iter)) { - if (GARCON_IS_MENU_ITEM (iter->data) + if (GARCON_IS_MENU_ITEM (iter->data) && garcon_menu_element_get_visible (iter->data)) { - g_printf ("%s\t%s\t%s\n", name, garcon_menu_item_get_desktop_id (iter->data), + g_printf ("%s\t%s\t%s\n", name, garcon_menu_item_get_desktop_id (iter->data), garcon_menu_item_get_filename (iter->data)); } }