aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-10-12 01:27:58 +0000
committerGuy Harris <guy@alum.mit.edu>2010-10-12 01:27:58 +0000
commit3c27b97c26b4d2bce94b8ece75ecc96082048775 (patch)
treeaf19491d370dd496a98945e0c74883ea511b1fc2 /gtk
parent0267a5293d62605d0e208fd3c21ad37b9a77c71a (diff)
Get rid of C++-style comments; use #if 0/#endif to remove code.
svn path=/trunk/; revision=34485
Diffstat (limited to 'gtk')
-rw-r--r--gtk/menus.c116
1 files changed, 62 insertions, 54 deletions
diff --git a/gtk/menus.c b/gtk/menus.c
index 6971ded1ff..e3fa06ba85 100644
--- a/gtk/menus.c
+++ b/gtk/menus.c
@@ -4364,10 +4364,14 @@ add_recent_items (guint merge_id, GtkUIManager *ui_manager)
GtkActionGroup *action_group;
GtkAction *action;
GtkWidget *submenu_recent_files;
- //GtkRecentManager *manager;
+#if 0
+ GtkRecentManager *manager;
+#endif
GList *items, *l;
- //guint i;
- //static guint changed_id = 0;
+#if 0
+ guint i;
+ static guint changed_id = 0;
+#endif
action_group = gtk_action_group_new ("recent-files-group");
@@ -4377,16 +4381,18 @@ add_recent_items (guint merge_id, GtkUIManager *ui_manager)
}
items = g_object_get_data(G_OBJECT(submenu_recent_files), "recent-files-list");
- //manager = gtk_recent_manager_get_default ();
+#if 0
+ manager = gtk_recent_manager_get_default ();
- //items = gtk_recent_manager_get_items (manager);
- //items = g_list_sort (items, (GCompareFunc) sort_mru_func);
+ items = gtk_recent_manager_get_items (manager);
+ items = g_list_sort (items, (GCompareFunc) sort_mru_func);
+#endif
gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
g_object_set_data (G_OBJECT (ui_manager),
"recent-files-merge-id", GUINT_TO_POINTER (merge_id));
- ///* no items */
+ /* no items */
if (!items){
action = g_object_new (GTK_TYPE_ACTION,
@@ -4407,53 +4413,55 @@ add_recent_items (guint merge_id, GtkUIManager *ui_manager)
return;
}
- //for (i = 0, l = items;
- // i < 4 && l != NULL;
- // i +=1, l = l->next)
- // {
- // GtkRecentInfo *info = l->data;
- // gchar *name = g_strdup_printf ("recent-info-%d-%lu",
- // i,
- // (gulong) time (NULL));
- // gchar *action_name = g_strdup (name);
- // GtkAction *action;
-
- // action = g_object_new (GTK_TYPE_ACTION,
- // "name", action_name,
- // "label", gtk_recent_info_get_display_name (info),
- // "stock_id", NULL,
- // NULL);
- // g_object_set_data_full (G_OBJECT (action), "gtk-recent-info",
- // gtk_recent_info_ref (info),
- // (GDestroyNotify) gtk_recent_info_unref);
- // g_signal_connect (action, "activate",
- // G_CALLBACK (recent_activate_cb), NULL);
- // gtk_action_group_add_action (action_group, action);
- // g_object_unref (action);
-
- // gtk_ui_manager_add_ui (ui_manager, merge_id,
- // "/MenuBar/FileMenu/RecentFiles",
- // name,
- // action_name,
- // GTK_UI_MANAGER_MENUITEM,
- // FALSE);
- //
- // g_print ("* adding action `%s'\n", action_name);
-
- // g_free (action_name);
- // g_free (name);
- // }
- //
- //g_list_foreach (items, (GFunc) gtk_recent_info_unref, NULL);
- //g_list_free (items);
-
- ///* don't connect twice to the same signal */
- //if (!changed_id)
- // {
- // changed_id = g_signal_connect (manager, "changed",
- // G_CALLBACK (recent_manager_changed_cb),
- // ui_manager);
- // }
+#if 0
+ for (i = 0, l = items;
+ i < 4 && l != NULL;
+ i +=1, l = l->next)
+ {
+ GtkRecentInfo *info = l->data;
+ gchar *name = g_strdup_printf ("recent-info-%d-%lu",
+ i,
+ (gulong) time (NULL));
+ gchar *action_name = g_strdup (name);
+ GtkAction *action;
+
+ action = g_object_new (GTK_TYPE_ACTION,
+ "name", action_name,
+ "label", gtk_recent_info_get_display_name (info),
+ "stock_id", NULL,
+ NULL);
+ g_object_set_data_full (G_OBJECT (action), "gtk-recent-info",
+ gtk_recent_info_ref (info),
+ (GDestroyNotify) gtk_recent_info_unref);
+ g_signal_connect (action, "activate",
+ G_CALLBACK (recent_activate_cb), NULL);
+ gtk_action_group_add_action (action_group, action);
+ g_object_unref (action);
+
+ gtk_ui_manager_add_ui (ui_manager, merge_id,
+ "/MenuBar/FileMenu/RecentFiles",
+ name,
+ action_name,
+ GTK_UI_MANAGER_MENUITEM,
+ FALSE);
+
+ g_print ("* adding action `%s'\n", action_name);
+
+ g_free (action_name);
+ g_free (name);
+ }
+
+ g_list_foreach (items, (GFunc) gtk_recent_info_unref, NULL);
+ g_list_free (items);
+
+ /* don't connect twice to the same signal */
+ if (!changed_id)
+ {
+ changed_id = g_signal_connect (manager, "changed",
+ G_CALLBACK (recent_manager_changed_cb),
+ ui_manager);
+ }
+#endif
}
#endif
#endif /* MAIN_MENU_USE_UIMANAGER */