gnome-commander r2525 - in branches/gcmd-1-3/plugins: cvs fileroller test



Author: epiotr
Date: Tue Apr  7 18:10:53 2009
New Revision: 2525
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2525&view=rev

Log:
noop: plugins

Modified:
   branches/gcmd-1-3/plugins/cvs/cvs-plugin.c
   branches/gcmd-1-3/plugins/fileroller/file-roller-plugin.c
   branches/gcmd-1-3/plugins/test/test-plugin.c

Modified: branches/gcmd-1-3/plugins/cvs/cvs-plugin.c
==============================================================================
--- branches/gcmd-1-3/plugins/cvs/cvs-plugin.c	(original)
+++ branches/gcmd-1-3/plugins/cvs/cvs-plugin.c	Tue Apr  7 18:10:53 2009
@@ -146,21 +146,18 @@
 }
 
 
-static GtkWidget *
-create_menu_item (const gchar *name, gboolean show_pixmap,
-                  GtkSignalFunc callback, gpointer data,
-                  CvsPlugin *plugin)
+static GtkWidget *create_menu_item (const gchar *name, gboolean show_pixmap,
+                                    GtkSignalFunc callback, gpointer data,
+                                    CvsPlugin *plugin)
 {
     GtkWidget *item, *label;
-    GdkPixbuf *pixbuf;
-    GtkWidget *pixmap = NULL;
 
     if (show_pixmap)
     {
-        item = gtk_image_menu_item_new ();
-        pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) cvs_plugin_xpm);
-        pixmap = gtk_image_new_from_pixbuf (pixbuf);
+        GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) cvs_plugin_xpm);
+        GtkWidget *pixmap = gtk_image_new_from_pixbuf (pixbuf);
         g_object_unref (G_OBJECT (pixbuf));
+        item = gtk_image_menu_item_new ();
         if (pixmap)
         {
             gtk_widget_show (pixmap);
@@ -256,22 +253,13 @@
 {
     CvsPlugin *plugin = CVS_PLUGIN (p);
 
-    if (cvs_dir_exists (state->active_dir_files))
-    {
-        gtk_widget_set_sensitive (plugin->priv->update, TRUE);
-        gtk_widget_set_sensitive (plugin->priv->diff, TRUE);
-        gtk_widget_set_sensitive (plugin->priv->log, TRUE);
-        gtk_widget_set_sensitive (plugin->priv->last_log, TRUE);
-        gtk_widget_set_sensitive (plugin->priv->last_change, TRUE);
-    }
-    else
-    {
-        gtk_widget_set_sensitive (plugin->priv->update, FALSE);
-        gtk_widget_set_sensitive (plugin->priv->diff, FALSE);
-        gtk_widget_set_sensitive (plugin->priv->log, FALSE);
-        gtk_widget_set_sensitive (plugin->priv->last_log, FALSE);
-        gtk_widget_set_sensitive (plugin->priv->last_change, FALSE);
-    }
+    gboolean dir_exists = cvs_dir_exists (state->active_dir_files);
+
+    gtk_widget_set_sensitive (plugin->priv->update, dir_exists);
+    gtk_widget_set_sensitive (plugin->priv->diff, dir_exists);
+    gtk_widget_set_sensitive (plugin->priv->log, dir_exists);
+    gtk_widget_set_sensitive (plugin->priv->last_log, dir_exists);
+    gtk_widget_set_sensitive (plugin->priv->last_change, dir_exists);
 }
 
 
@@ -313,8 +301,7 @@
 
     optmenu = create_option_menu (dialog, compression_level_strings);
     plugin->priv->compression_level_menu = optmenu;
-    gtk_option_menu_set_history (GTK_OPTION_MENU (optmenu),
-                                 plugin->compression_level);
+    gtk_option_menu_set_history (GTK_OPTION_MENU (optmenu), plugin->compression_level);
     table_add (table, optmenu, 1, 1, GTK_FILL);
 
     check = create_check (dialog, _("Unified diff format"), "check");
@@ -416,7 +403,7 @@
 {
     if (!plugin_nfo.authors)
     {
-        plugin_nfo.authors = g_new (gchar*, 2);
+        plugin_nfo.authors = g_new0 (gchar *, 2);
         plugin_nfo.authors[0] = AUTHOR;
         plugin_nfo.authors[1] = NULL;
         plugin_nfo.comments = g_strdup (_("A plugin that eventually will be a simple CVS client"));

Modified: branches/gcmd-1-3/plugins/fileroller/file-roller-plugin.c
==============================================================================
--- branches/gcmd-1-3/plugins/fileroller/file-roller-plugin.c	(original)
+++ branches/gcmd-1-3/plugins/fileroller/file-roller-plugin.c	Tue Apr  7 18:10:53 2009
@@ -223,20 +223,17 @@
 }
 
 
-static GtkWidget *
-create_menu_item (const gchar *name, gboolean show_pixmap,
-                  GtkSignalFunc callback, gpointer data)
+static GtkWidget *create_menu_item (const gchar *name, gboolean show_pixmap,
+                                    GtkSignalFunc callback, gpointer data)
 {
     GtkWidget *item, *label;
-    GdkPixbuf *pixbuf;
-    GtkWidget *pixmap = NULL;
 
     if (show_pixmap)
     {
-        item = gtk_image_menu_item_new ();
-        pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) file_roller_small_xpm);
-        pixmap = gtk_image_new_from_pixbuf (pixbuf);
+        GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) file_roller_small_xpm);
+        GtkWidget *pixmap = gtk_image_new_from_pixbuf (pixbuf);
         g_object_unref (G_OBJECT (pixbuf));
+        item = gtk_image_menu_item_new ();
         if (pixmap)
         {
             gtk_widget_show (pixmap);

Modified: branches/gcmd-1-3/plugins/test/test-plugin.c
==============================================================================
--- branches/gcmd-1-3/plugins/test/test-plugin.c	(original)
+++ branches/gcmd-1-3/plugins/test/test-plugin.c	Tue Apr  7 18:10:53 2009
@@ -58,19 +58,16 @@
 }
 
 
-static GtkWidget *create_menu_item (const gchar *name, gboolean show_pixmap,
-                  GtkSignalFunc callback, gpointer data)
+static GtkWidget *create_menu_item (const gchar *name, gboolean show_pixmap, GtkSignalFunc callback, gpointer data)
 {
     GtkWidget *item, *label;
-    GdkPixbuf *pixbuf;
-    GtkWidget *pixmap = NULL;
 
     if (show_pixmap)
     {
-        item = gtk_image_menu_item_new ();
-        pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) test_plugin_xpm);
-        pixmap = gtk_image_new_from_pixbuf (pixbuf);
+        GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) test_plugin_xpm);
+        GtkWidget *pixmap = gtk_image_new_from_pixbuf (pixbuf);
         g_object_unref (G_OBJECT (pixbuf));
+        item = gtk_image_menu_item_new ();
         if (pixmap)
         {
             gtk_widget_show (pixmap);



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