[Goodies-commits] r3171 - in xfce4-places-plugin/trunk: . panel-plugin

Diego Ongaro ongardie at xfce.org
Sat Sep 8 05:00:23 CEST 2007


Author: ongardie
Date: 2007-09-08 03:00:22 +0000 (Sat, 08 Sep 2007)
New Revision: 3171

Modified:
   xfce4-places-plugin/trunk/ChangeLog
   xfce4-places-plugin/trunk/panel-plugin/cfg.c
   xfce4-places-plugin/trunk/panel-plugin/cfg.h
   xfce4-places-plugin/trunk/panel-plugin/model.c
   xfce4-places-plugin/trunk/panel-plugin/model.h
   xfce4-places-plugin/trunk/panel-plugin/model_system.c
   xfce4-places-plugin/trunk/panel-plugin/model_system.h
   xfce4-places-plugin/trunk/panel-plugin/model_user.c
   xfce4-places-plugin/trunk/panel-plugin/model_user.h
   xfce4-places-plugin/trunk/panel-plugin/model_volumes.c
   xfce4-places-plugin/trunk/panel-plugin/model_volumes.h
   xfce4-places-plugin/trunk/panel-plugin/places.c
   xfce4-places-plugin/trunk/panel-plugin/places.h
   xfce4-places-plugin/trunk/panel-plugin/view.c
   xfce4-places-plugin/trunk/panel-plugin/view.h
Log:
2007-09-07	Diego Ongaro <ongardie at gmail.com>

* view.c: fix bug from previous commit
* *.{c,h}: removed all C++-style comments


Modified: xfce4-places-plugin/trunk/ChangeLog
===================================================================
--- xfce4-places-plugin/trunk/ChangeLog	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/ChangeLog	2007-09-08 03:00:22 UTC (rev 3171)
@@ -4,6 +4,7 @@
 	terminal (context menu "Open" action)
 	* view.c: improve how icon theme changes and screen changes are
 	handled
+	* *.{c,h}: removed all C++-style comments
 
 2007-08-23	Diego Ongaro <ongardie at gmail.com>
 

Modified: xfce4-places-plugin/trunk/panel-plugin/cfg.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/cfg.c	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/cfg.c	2007-09-08 03:00:22 UTC (rev 3171)
@@ -33,14 +33,14 @@
 #include "places.h"
 #include "model.h"
 
-// Init
+/* Init */
 static void     places_cfg_init_defaults(PlacesConfig *cfg);
 
-// Configuration File
+/* Configuration File */
 static void     places_cfg_load(PlacesData*);
 static void     places_cfg_save(PlacesData*);
 
-// Configuration Dialog
+/* Configuration Dialog */
 static void     places_cfg_button_show_cb(GtkComboBox*, PlacesData*);
 static gboolean places_cfg_button_label_cb(GtkWidget *entry, GdkEventFocus*, PlacesData*);
 #if USE_RECENT_DOCUMENTS
@@ -181,19 +181,19 @@
     if(rcfile == NULL)
         return;
 
-    // BUTTON
+    /* BUTTON */
     xfce_rc_write_bool_entry(rcfile, "show_button_icon", cfg->show_button_icon);
     xfce_rc_write_bool_entry(rcfile, "show_button_label", cfg->show_button_label);
     xfce_rc_write_entry(rcfile, "label",           cfg->label);
 
-    // MENU
+    /* MENU */
     xfce_rc_write_bool_entry(rcfile, "show_icons",     cfg->show_icons);
     xfce_rc_write_bool_entry(rcfile, "show_volumes",   cfg->show_volumes);
     xfce_rc_write_bool_entry(rcfile, "show_bookmarks", cfg->show_bookmarks);
 #if USE_RECENT_DOCUMENTS
     xfce_rc_write_bool_entry(rcfile, "show_recent",    cfg->show_recent);
 
-    // RECENT DOCUMENTS
+    /* RECENT DOCUMENTS */
     xfce_rc_write_bool_entry(rcfile, "show_recent_clear", cfg->show_recent_clear);
     xfce_rc_write_int_entry(rcfile, "show_recent_number", cfg->show_recent_number);
 #endif
@@ -367,7 +367,7 @@
                      G_CALLBACK(places_cfg_dialog_cb), pd);
 
 
-    // BUTTON: frame, vbox
+    /* BUTTON: frame, vbox */
     vbox_button = gtk_vbox_new(FALSE, 4);
     gtk_widget_show(vbox_button);
     
@@ -375,7 +375,7 @@
     gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), frame_button, FALSE, FALSE, 0);
 
 
-    // BUTTON: Show Icon/Label
+    /* BUTTON: Show Icon/Label */
     tmp_box = gtk_hbox_new(FALSE, 15);
     gtk_widget_show(tmp_box);
     gtk_box_pack_start(GTK_BOX(vbox_button), tmp_box, FALSE, FALSE, 0);
@@ -405,7 +405,7 @@
     gtk_widget_show(tmp_widget);
     gtk_box_pack_start(GTK_BOX(tmp_box), tmp_widget, FALSE, FALSE, 0);
 
-    // BUTTON: Label text entry
+    /* BUTTON: Label text entry */
     tmp_box = gtk_hbox_new(FALSE, 15);
     gtk_widget_show(tmp_box);
     gtk_box_pack_start(GTK_BOX(vbox_button), tmp_box, FALSE, FALSE, 0);
@@ -424,14 +424,14 @@
     gtk_widget_show(tmp_widget);
     gtk_box_pack_start(GTK_BOX(tmp_box), tmp_widget, FALSE, FALSE, 0);
 
-    // MENU: frame, vbox
+    /* MENU: frame, vbox */
     vbox_menu = gtk_vbox_new(FALSE, 4);
     gtk_widget_show(vbox_menu);
     
     frame_menu = xfce_create_framebox_with_content(_("Menu"), vbox_menu);
     gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), frame_menu, FALSE, FALSE, 0);
 
-    // MENU: Show Icons
+    /* MENU: Show Icons */
     tmp_widget = gtk_check_button_new_with_mnemonic(_("Show _icons in menu"));
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tmp_widget), cfg->show_icons);
 
@@ -443,7 +443,7 @@
     gtk_box_pack_start(GTK_BOX(vbox_menu), tmp_widget, FALSE, FALSE, 0);
 
 
-    // MENU: Show Removable Media
+    /* MENU: Show Removable Media */
     tmp_widget = gtk_check_button_new_with_mnemonic(_("Show _removable media"));
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tmp_widget), cfg->show_volumes);
 
@@ -454,7 +454,7 @@
     gtk_widget_show(tmp_widget);
     gtk_box_pack_start(GTK_BOX(vbox_menu), tmp_widget, FALSE, FALSE, 0);   
 
-    // MENU: Show GTK Bookmarks
+    /* MENU: Show GTK Bookmarks */
     tmp_widget = gtk_check_button_new_with_mnemonic(_("Show GTK _bookmarks"));
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tmp_widget), cfg->show_bookmarks);
 
@@ -467,7 +467,7 @@
 
 
 #if USE_RECENT_DOCUMENTS
-    // MENU: Show Recent Documents
+    /* MENU: Show Recent Documents */
     tmp_widget = gtk_check_button_new_with_mnemonic(_("Show recent _documents"));
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tmp_widget), cfg->show_recent);
 
@@ -478,14 +478,14 @@
     gtk_widget_show(tmp_widget);
     gtk_box_pack_start(GTK_BOX(vbox_menu), tmp_widget, FALSE, FALSE, 0);
 
-    // RECENT DOCUMENTS: frame, vbox
+    /* RECENT DOCUMENTS: frame, vbox */
     vbox_recent = gtk_vbox_new(FALSE, 4);
     gtk_widget_show(vbox_recent);
     
     frame_recent = xfce_create_framebox_with_content(_("Recent Documents"), vbox_recent);
     gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), frame_recent, FALSE, FALSE, 0);
 
-    // RECENT DOCUMENTS: Show clear option
+    /* RECENT DOCUMENTS: Show clear option */
     tmp_widget = gtk_check_button_new_with_mnemonic(_("Show cl_ear option"));
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tmp_widget), cfg->show_recent_clear);
 
@@ -496,7 +496,7 @@
     gtk_widget_show(tmp_widget);
     gtk_box_pack_start(GTK_BOX(vbox_recent), tmp_widget, FALSE, FALSE, 0);
 
-    // RECENT DOCUMENTS: Number to display
+    /* RECENT DOCUMENTS: Number to display */
     tmp_box = gtk_hbox_new(FALSE, 15);
     gtk_widget_show(tmp_box);
     gtk_box_pack_start(GTK_BOX(vbox_recent), tmp_box, FALSE, FALSE, 0);
@@ -517,14 +517,14 @@
     gtk_box_pack_start(GTK_BOX(tmp_box), tmp_widget, FALSE, FALSE, 0);
 #endif
 
-    // Search: frame, vbox
+    /* Search: frame, vbox */
     vbox_search = gtk_vbox_new(FALSE, 4);
     gtk_widget_show(vbox_search);
     
     frame_search = xfce_create_framebox_with_content(_("Search"), vbox_search);
     gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), frame_search, FALSE, FALSE, 0);
 
-    // Search: command
+    /* Search: command */
     tmp_box = gtk_hbox_new(FALSE, 15);
     gtk_widget_show(tmp_box);
     gtk_box_pack_start(GTK_BOX(vbox_search), tmp_box, FALSE, FALSE, 0);
@@ -546,4 +546,4 @@
     gtk_widget_show(dlg);
 }
 
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/cfg.h
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/cfg.h	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/cfg.h	2007-09-08 03:00:22 UTC (rev 3171)
@@ -37,10 +37,10 @@
   gchar             *search_cmd;
 } PlacesConfig;
 
-// Init & Finalize
+/* Init & Finalize */
 PlacesConfig* places_cfg_new(PlacesData*);
 void          places_cfg_init_signals(PlacesData*);
 void          places_cfg_finalize(PlacesData*);
 
 #endif
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/model.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model.c	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/model.c	2007-09-08 03:00:22 UTC (rev 3171)
@@ -102,4 +102,4 @@
 }
 */
 
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/model.h
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model.h	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/model.h	2007-09-08 03:00:22 UTC (rev 3171)
@@ -84,4 +84,4 @@
 places_bookmark_group_finalize(PlacesBookmarkGroup*);
 
 #endif
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/model_system.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model_system.c	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/model_system.c	2007-09-08 03:00:22 UTC (rev 3171)
@@ -79,16 +79,16 @@
 
     pbg_priv(bookmark_group)->check_changed = TRUE;
 
-    // These icon names are consistent with Thunar.
+    /* These icon names are consistent with Thunar. */
 
-    // Home
+    /* Home */
     bookmark                = g_new0(PlacesBookmark, 1);
     bookmark->label         = (gchar*) g_get_user_name();
     bookmark->uri           = (gchar*) home_dir;
     bookmark->icon          = "gnome-fs-home";
     bookmarks = g_list_append(bookmarks, bookmark);
 
-    // Trash
+    /* Trash */
     bookmark                = g_new0(PlacesBookmark, 1);
     bookmark->label         = _("Trash");
     bookmark->uri           = "trash:///";
@@ -109,7 +109,7 @@
 
     bookmarks = g_list_append(bookmarks, bookmark);
 
-    // Desktop
+    /* Desktop */
     bookmark                = g_new0(PlacesBookmark, 1);
     bookmark->label         = _("Desktop");
     bookmark->uri           = g_build_filename(home_dir, "Desktop", NULL);
@@ -124,7 +124,7 @@
         places_bookmark_free(bookmark);
     }
     
-    // File System (/)
+    /* File System (/) */
     bookmark                = g_new0(PlacesBookmark, 1);
     bookmark->label         = _("File System");
     bookmark->uri           = "/";
@@ -152,7 +152,7 @@
     }else
         g_free(uri);
 
-    // see if trash gets a different icon (e.g., was empty, now full)
+    /* see if trash gets a different icon (e.g., was empty, now full) */
     trash_info = thunar_vfs_info_new_for_path(pbg_priv(bookmark_group)->trash_path, NULL);
     if(trash_info->custom_icon != NULL)
         trash_is_empty = (strcmp("gnome-fs-trash-full", trash_info->custom_icon) != 0);
@@ -191,4 +191,4 @@
 }
    
 
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/model_system.h
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model_system.h	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/model_system.h	2007-09-08 03:00:22 UTC (rev 3171)
@@ -26,4 +26,4 @@
 places_bookmarks_system_create();
 
 #endif
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/model_user.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model_user.c	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/model_user.c	2007-09-08 03:00:22 UTC (rev 3171)
@@ -83,7 +83,7 @@
 static void
 pbuser_build_bookmarks(PlacesBookmarkGroup *bookmark_group)
 {
-    // As of 2007-04-06, this is pretty much taken from/analogous to Thunar
+    /* As of 2007-04-06, this is pretty much taken from/analogous to Thunar */
 
     GList  *bookmarks = NULL;
     PlacesBookmark *bookmark;
@@ -117,7 +117,7 @@
         for (; g_ascii_isspace (*name); ++name)
             /* pass */;
         
-        /* parse the URI */ // TODO: trash:// URI's
+        /* parse the URI */ /* TODO: trash:// URI's */
         path = g_filename_from_uri(line, NULL, NULL);
         if (G_UNLIKELY(path == NULL || *path == '\0'))
             continue;
@@ -184,12 +184,12 @@
     if(pbg_priv(bookmark_group)->loaded == 0)
         goto pbuser_did_change;
 
-    // see if the file has changed
+    /* see if the file has changed */
     time_t mtime = pbuser_get_mtime(pbg_priv(bookmark_group)->filename);
     if(mtime > pbg_priv(bookmark_group)->loaded)
         goto pbuser_did_change;
     
-    // see if any directories have been created or removed
+    /* see if any directories have been created or removed */
     GList *bookmarks = pbg_priv(bookmark_group)->bookmarks;
     PlacesBookmark *bookmark;
     gboolean ret = FALSE;
@@ -222,7 +222,7 @@
 }
 
 
-// external interface
+/* external interface */
 
 PlacesBookmarkGroup*
 places_bookmarks_user_create()
@@ -238,4 +238,4 @@
     return bookmark_group;
 }
 
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/model_user.h
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model_user.h	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/model_user.h	2007-09-08 03:00:22 UTC (rev 3171)
@@ -26,4 +26,4 @@
 places_bookmarks_user_create();
 
 #endif
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/model_volumes.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model_volumes.c	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/model_volumes.c	2007-09-08 03:00:22 UTC (rev 3171)
@@ -269,4 +269,4 @@
 }
 
 
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/model_volumes.h
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model_volumes.h	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/model_volumes.h	2007-09-08 03:00:22 UTC (rev 3171)
@@ -26,4 +26,4 @@
 places_bookmarks_volumes_create();
 
 #endif
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/places.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/places.c	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/places.c	2007-09-08 03:00:22 UTC (rev 3171)
@@ -29,7 +29,7 @@
 #include "places.h"
 #include "view.h"
 
-#include "string.h" // for strncmp
+#include "string.h"
 
 static void places_construct(XfcePanelPlugin*);
 static void places_finalize(XfcePanelPlugin*, PlacesData*);
@@ -38,28 +38,23 @@
 
 /**
  * Initializes the plugin:
- *
- * 1. Sets up i18n
- * 2. Creates the PlacesData struct
- * 3. Asks the view to initialize
- * 4. Connects the finalize callback.
  */
 static void 
 places_construct(XfcePanelPlugin *plugin)
 {
     DBG("Construct: %s", PLUGIN_NAME);
    
-    // Set up i18n
+    /* Set up i18n */
     xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8"); 
 
-    // Create the PlacesData struct
+    /* Create the PlacesData struct */
     PlacesData *pd = panel_slice_new0(PlacesData);
     pd->plugin = plugin;
 
-    // Initialize view
+    /* Initialize view */
     places_view_init(pd);
 
-    // Connect the finalize callback
+    /* Connect the finalize callback */
     g_signal_connect(pd->plugin, "free-data", 
                      G_CALLBACK(places_finalize), pd);
 
@@ -67,9 +62,6 @@
 
 /**
  * Cleans up resources.
- *
- * 1. Asks the view to finalize
- * 2. Frees the PlacesData struct
  */
 static void 
 places_finalize(XfcePanelPlugin *plugin, PlacesData *pd)
@@ -77,17 +69,16 @@
     DBG("Free data: %s", PLUGIN_NAME);
     g_assert(pd != NULL);
    
-    // finalize the view
+    /* finalize the view */
     places_view_finalize(pd);
     
-    // free the PlacesData struct
+    /* free the PlacesData struct */
     panel_slice_free(PlacesData, pd);
 }
 
 /**
  * Opens Thunar at the location given by path.
  * If path is NULL or empty, it will open Thunar at the default location (home).
- * This function is also abused to open files.
  * The caller is in charge of freeing path.
  */
 void
@@ -106,6 +97,11 @@
     }
 }
 
+/**
+ * Opens the terminal at the location given by path.
+ * If path is NULL or empty, it will open the terminal at the default location (home).
+ * The caller is in charge of freeing path.
+ */
 void
 places_load_terminal(const gchar *const_path)
 {
@@ -135,17 +131,23 @@
         g_free(path);
 }
 
+/**
+ * Loads the file given by path.
+ * If path is NULL or empty, it will do nothing.
+ * The caller is in charge of freeing path.
+ */
 void
 places_load_file(const gchar *path)
 {
-    exo_url_show(path, NULL, NULL);
+    if(path != NULL && strlen(path))
+        exo_url_show(path, NULL, NULL);
 }
 
 void
 places_gui_exec(const gchar *cmd)
 {
-    if(cmd != NULL)
+    if(cmd != NULL && strlen(cmd))
         xfce_exec(cmd, FALSE, TRUE, NULL);
 }
 
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/places.h
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/places.h	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/places.h	2007-09-08 03:00:22 UTC (rev 3171)
@@ -30,13 +30,13 @@
 
 struct _PlacesData
 {
-  // plugin
+  /* plugin */
   XfcePanelPlugin   *plugin;
 
-  // configuration
+  /* configuration */
   PlacesConfig      *cfg;
 
-  // view
+  /* view */
   GtkWidget         *view_button;
   GtkWidget         *view_button_box;
   GtkWidget         *view_button_image;
@@ -45,7 +45,7 @@
   GtkTooltips       *view_tooltips;
   gboolean           view_needs_separator;
 
-  // model
+  /* model */
   GList *bookmark_groups;
 };
 
@@ -56,4 +56,4 @@
 
 
 #endif
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/view.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/view.c	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/view.c	2007-09-08 03:00:22 UTC (rev 3171)
@@ -48,35 +48,35 @@
 #include "model_user.h"
 #include "cfg.h"
 
-// UI Helpers
+/* UI Helpers */
 static void     places_view_update_menu(PlacesData*);
 
-// GTK Callbacks
+/* GTK Callbacks */
 
-//  - Panel
+/*  - Panel */
 static gboolean places_view_cb_size_changed(PlacesData*, gint size);
 static void     places_view_cb_orientation_changed(PlacesData *pd, GtkOrientation orientation,
                                                    XfcePanelPlugin *panel);
 
 static void     places_view_cb_theme_changed(PlacesData *pd);
 
-//  - Menu
+/*  - Menu */
 static void     places_view_cb_menu_position(GtkMenu*, 
                                              gint *x, gint *y, 
                                              gboolean *push_in, 
                                              PlacesData*);
 static void     places_view_cb_menu_deact(PlacesData*, GtkWidget *menu);
 
-//  - Button
+/*  - Button */
 static gboolean places_view_cb_button_pressed(PlacesData*, GdkEventButton *);
 
-//  - Recent Documents
+/*  - Recent Documents */
 #if USE_RECENT_DOCUMENTS
 static void     places_view_cb_recent_item_open(GtkRecentChooser*, PlacesData*);
 static gboolean places_view_cb_recent_items_clear(GtkWidget *clear_item);
 #endif
 
-// Model Visitor Callbacks
+/* Model Visitor Callbacks */
 static void     places_view_add_menu_item(PlacesData*, PlacesBookmark*);
 
 /********** Initialization & Finalization **********/
@@ -93,9 +93,9 @@
     
     pd->view_tooltips = g_object_ref_sink(gtk_tooltips_new());
 
-    // init button
+    /* init button */
 
-    // create the box
+    /* create the box */
     if(xfce_panel_plugin_get_orientation(pd->plugin) == GTK_ORIENTATION_HORIZONTAL)
         pd->view_button_box = gtk_hbox_new(FALSE, BORDER);
     else
@@ -103,7 +103,7 @@
     gtk_container_set_border_width(GTK_CONTAINER(pd->view_button_box), 0);
     gtk_widget_show(pd->view_button_box);
 
-    // create the button
+    /* create the button */
     pd->view_button = xfce_create_panel_toggle_button();
     gtk_widget_show(pd->view_button);
     gtk_container_add(GTK_CONTAINER(pd->view_button), pd->view_button_box);
@@ -111,7 +111,7 @@
     gtk_tooltips_set_tip(pd->view_tooltips, pd->view_button, pd->cfg->label, NULL);
     xfce_panel_plugin_add_action_widget(pd->plugin, pd->view_button);
     
-    // create the image
+    /* create the image */
     if(pd->cfg->show_button_icon){
         pd->view_button_image = g_object_ref(gtk_image_new());
         gtk_widget_show(pd->view_button_image);
@@ -120,7 +120,7 @@
         pd->view_button_image = NULL;
     }
 
-    // create the label
+    /* create the label */
     if(pd->cfg->show_button_label){
         pd->view_button_label = g_object_ref(gtk_label_new(pd->cfg->label));
         gtk_widget_show(pd->view_button_label);
@@ -130,14 +130,14 @@
     }
 
 
-    // signals for icon theme/screen changes
-    pd->view_theme_changed_signal_id = g_signal_connect_swapped(pd->view_button, "style-set",
-                                                                G_CALLBACK(places_view_cb_theme_changed), pd);
-    pd->view_screen_changed_signal_id = g_signal_connect_swapped(pd->view_button, "screen-changed",
-                                                                 G_CALLBACK(places_view_cb_theme_changed), pd);
+    /* signals for icon theme/screen changes */
+    g_signal_connect_swapped(pd->view_button, "style-set",
+                             G_CALLBACK(places_view_cb_theme_changed), pd);
+    g_signal_connect_swapped(pd->view_button, "screen-changed",
+                             G_CALLBACK(places_view_cb_theme_changed), pd);
 
     
-    // connect the signals
+    /* connect the signals */
     g_signal_connect_swapped(pd->view_button, "button-press-event",
                              G_CALLBACK(places_view_cb_button_pressed), pd);
 
@@ -217,7 +217,7 @@
     /* destroy the old menu, if it exists */
     places_view_destroy_menu(pd);
 
-    // Create a new menu
+    /* Create a new menu */
     pd->view_menu = gtk_menu_new();
     
     /* make sure the menu popups up in right screen */
@@ -250,7 +250,7 @@
         bookmark_group = bookmark_group->next;
     }
 
-    // Recent Documents
+    /* Recent Documents */
 #if USE_RECENT_DOCUMENTS
     if(pd->cfg->show_recent || (pd->cfg->search_cmd != NULL && strlen(pd->cfg->search_cmd))){
 #else
@@ -317,10 +317,10 @@
     g_signal_connect_swapped(pd->view_menu, "deactivate",
                              G_CALLBACK(places_view_cb_menu_deact), pd);
 
-    // Quit hiding the menu
+    /* Quit hiding the menu */
     gtk_widget_show_all(pd->view_menu);
 
-    // This helps allocate resources beforehand so it'll pop up faster the first time
+    /* This helps allocate resources beforehand so it'll pop up faster the first time */
     gtk_widget_realize(pd->view_menu);
 }
 
@@ -428,7 +428,7 @@
 
 /********** Gtk Callbacks **********/
 
-// Panel callbacks
+/* Panel callbacks */
 
 static gboolean
 places_view_cb_size_changed(PlacesData *pd, gint wsize)
@@ -444,11 +444,11 @@
 {
     DBG("theme changed");
 
-    // update the button
+    /* update the button */
     if(GTK_WIDGET_REALIZED(pd->view_button))
         places_view_button_update(pd);
     
-    // force a menu update
+    /* force a menu update */
     places_view_destroy_menu(pd);
 }
 
@@ -484,7 +484,7 @@
     places_view_button_update(pd);
 }
 
-// Menu callbacks
+/* Menu callbacks */
 
 /* Copied almost verbatim from xfdesktop plugin */
 static void
@@ -558,15 +558,15 @@
 static void 
 places_view_cb_menu_deact(PlacesData *pd, GtkWidget *menu)
 {
-    // deactivate button
+    /* deactivate button */
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pd->view_button), FALSE);
 }
 
-// Button
+/* Button */
 static gboolean
 places_view_cb_button_pressed(PlacesData *pd, GdkEventButton *evt)
 {
-    // (it's the way xfdesktop menu does it...)
+    /* (it's the way xfdesktop menu does it...) */
     if((evt->state & GDK_CONTROL_MASK) && !(evt->state & (GDK_MOD1_MASK|GDK_SHIFT_MASK|GDK_MOD4_MASK)))
         return FALSE;
 
@@ -659,7 +659,7 @@
         return FALSE;
 }
 
-// Recent Documents
+/* Recent Documents */
 
 #if USE_RECENT_DOCUMENTS
 static void
@@ -763,4 +763,4 @@
 
 }
 
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */

Modified: xfce4-places-plugin/trunk/panel-plugin/view.h
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/view.h	2007-09-08 02:41:22 UTC (rev 3170)
+++ xfce4-places-plugin/trunk/panel-plugin/view.h	2007-09-08 03:00:22 UTC (rev 3171)
@@ -29,17 +29,17 @@
 
 #define BORDER 4
 
-// Init & Finalize
+/* Init & Finalize */
 void     places_view_init(PlacesData*);
 void     places_view_finalize(PlacesData*);
 
-// UI control
+/* UI control */
 void     places_view_open_menu(PlacesData*);
 void     places_view_destroy_menu(PlacesData*);
 
-// cfg use
+/* cfg use */
 void     places_view_reconfigure_model(PlacesData*);
 void     places_view_button_update(PlacesData*);
 
 #endif
-// vim: ai et tabstop=4
+/* vim: set ai et tabstop=4: */




More information about the Goodies-commits mailing list