[gnome-commander] noop: code cleanup
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] noop: code cleanup
- Date: Fri, 7 Jan 2011 22:48:38 +0000 (UTC)
commit c7e5aa4ce01ab485ed3de8716dd8a31628ece0fa
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Fri Jan 7 23:42:36 2011 +0100
noop: code cleanup
libgcmd/gnome-cmd-plugin.cc | 25 ++++++++-----------------
plugins/fileroller/file-roller-plugin.cc | 2 +-
src/plugin_manager.cc | 18 +++++-------------
3 files changed, 14 insertions(+), 31 deletions(-)
---
diff --git a/libgcmd/gnome-cmd-plugin.cc b/libgcmd/gnome-cmd-plugin.cc
index fc81c14..81f9b2f 100644
--- a/libgcmd/gnome-cmd-plugin.cc
+++ b/libgcmd/gnome-cmd-plugin.cc
@@ -33,8 +33,7 @@ static GtkObjectClass *parent_class = NULL;
* Gtk class implementation
*******************************/
-static void
-destroy (GtkObject *object)
+static void destroy (GtkObject *object)
{
//GnomeCmdPlugin *plugin = GNOME_CMD_PLUGIN (object);
@@ -43,8 +42,7 @@ destroy (GtkObject *object)
}
-static void
-class_init (GnomeCmdPluginClass *klass)
+static void class_init (GnomeCmdPluginClass *klass)
{
GtkObjectClass *object_class;
GnomeCmdPluginClass *plugin_class;
@@ -62,8 +60,7 @@ class_init (GnomeCmdPluginClass *klass)
}
-static void
-init (GnomeCmdPlugin *plugin)
+static void init (GnomeCmdPlugin *plugin)
{
}
@@ -73,8 +70,7 @@ init (GnomeCmdPlugin *plugin)
* Public functions
***********************************/
-GtkType
-gnome_cmd_plugin_get_type ()
+GtkType gnome_cmd_plugin_get_type ()
{
static GtkType type = 0;
@@ -98,8 +94,7 @@ gnome_cmd_plugin_get_type ()
}
-GtkWidget *
-gnome_cmd_plugin_create_main_menu (GnomeCmdPlugin *plugin, GnomeCmdState *state)
+GtkWidget *gnome_cmd_plugin_create_main_menu (GnomeCmdPlugin *plugin, GnomeCmdState *state)
{
GnomeCmdPluginClass *klass;
@@ -111,8 +106,7 @@ gnome_cmd_plugin_create_main_menu (GnomeCmdPlugin *plugin, GnomeCmdState *state)
}
-GList *
-gnome_cmd_plugin_create_popup_menu_items (GnomeCmdPlugin *plugin, GnomeCmdState *state)
+GList *gnome_cmd_plugin_create_popup_menu_items (GnomeCmdPlugin *plugin, GnomeCmdState *state)
{
GnomeCmdPluginClass *klass;
@@ -124,8 +118,7 @@ gnome_cmd_plugin_create_popup_menu_items (GnomeCmdPlugin *plugin, GnomeCmdState
}
-void
-gnome_cmd_plugin_update_main_menu_state (GnomeCmdPlugin *plugin, GnomeCmdState *state)
+void gnome_cmd_plugin_update_main_menu_state (GnomeCmdPlugin *plugin, GnomeCmdState *state)
{
GnomeCmdPluginClass *klass;
@@ -137,8 +130,7 @@ gnome_cmd_plugin_update_main_menu_state (GnomeCmdPlugin *plugin, GnomeCmdState *
}
-void
-gnome_cmd_plugin_configure (GnomeCmdPlugin *plugin)
+void gnome_cmd_plugin_configure (GnomeCmdPlugin *plugin)
{
GnomeCmdPluginClass *klass;
@@ -148,4 +140,3 @@ gnome_cmd_plugin_configure (GnomeCmdPlugin *plugin)
klass->configure (plugin);
}
-
diff --git a/plugins/fileroller/file-roller-plugin.cc b/plugins/fileroller/file-roller-plugin.cc
index 4847bdf..e29f50e 100644
--- a/plugins/fileroller/file-roller-plugin.cc
+++ b/plugins/fileroller/file-roller-plugin.cc
@@ -98,7 +98,7 @@ static void on_extract_cwd (GtkMenuItem *item, GnomeVFSURI *uri)
gint argc;
gchar **argv;
- if (target_dir==NULL)
+ if (!target_dir)
{
t = g_path_get_dirname (local_path);
target_dir = target_name ? g_build_filename (t, target_name, NULL) : g_strdup (t);
diff --git a/src/plugin_manager.cc b/src/plugin_manager.cc
index 322ec17..1602b87 100644
--- a/src/plugin_manager.cc
+++ b/src/plugin_manager.cc
@@ -148,11 +148,9 @@ static void scan_plugins_in_dir (const gchar *dpath)
char *prev_dir;
struct dirent *ent;
- if (dir == NULL)
+ if (!dir)
{
- gchar *msg = g_strdup_printf ("Could not list files in %s: %s", dpath, strerror (errno));
- g_warning (msg);
- g_free (msg);
+ g_warning ("Could not list files in %s: %s", dpath, strerror (errno));
return;
}
@@ -275,7 +273,7 @@ static void update_plugin_list (GtkCList *list, GtkWidget *dialog)
gint row = 0;
gboolean only_update = (list->rows > 0);
- for (GList *tmp=plugins; tmp; tmp=tmp->next)
+ for (GList *tmp=plugins; tmp; tmp=tmp->next, ++row)
{
PluginData *data = (PluginData *) tmp->data;
gchar *text[5];
@@ -297,8 +295,6 @@ static void update_plugin_list (GtkCList *list, GtkWidget *dialog)
gtk_clist_set_pixmap (list, row, 0, blank_pixmap, blank_mask);
gtk_clist_set_row_data (list, row, data);
-
- row++;
}
gtk_clist_select_row (list, old_focus, 0);
@@ -321,9 +317,7 @@ inline void do_toggle (GtkWidget *dialog)
}
-static void
-on_plugin_selected (GtkCList *list, gint row, gint column,
- GdkEventButton *event, GtkWidget *dialog)
+static void on_plugin_selected (GtkCList *list, gint row, gint column, GdkEventButton *event, GtkWidget *dialog)
{
GtkWidget *toggle_button = lookup_widget (dialog, "toggle_button");
GtkWidget *conf_button = lookup_widget (dialog, "conf_button");
@@ -345,9 +339,7 @@ on_plugin_selected (GtkCList *list, gint row, gint column,
}
-static void
-on_plugin_unselected (GtkCList *list, gint row, gint column,
- GdkEventButton *event, GtkWidget *dialog)
+static void on_plugin_unselected (GtkCList *list, gint row, gint column, GdkEventButton *event, GtkWidget *dialog)
{
GtkWidget *toggle_button = lookup_widget (dialog, "toggle_button");
GtkWidget *conf_button = lookup_widget (dialog, "conf_button");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]