[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: Sat, 12 Nov 2011 14:49:46 +0000 (UTC)
commit e660762e77dde8f2aa149ab8cbb51faa01082708
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Sat Nov 12 15:45:27 2011 +0100
noop: code cleanup
src/gnome-cmd-about-plugin.cc | 4 ++--
src/gnome-cmd-chmod-dialog.cc | 4 ++--
src/gnome-cmd-chown-dialog.cc | 4 ++--
src/gnome-cmd-cmdline.cc | 8 ++++----
src/gnome-cmd-convert.cc | 8 ++++----
src/gnome-cmd-data.cc | 8 ++++----
src/gnome-cmd-delete-dialog.cc | 6 +++---
src/gnome-cmd-dir.cc | 4 ++--
src/gnome-cmd-file-popmenu.cc | 8 ++++----
src/gnome-cmd-file-props-dialog.cc | 8 ++++----
src/gnome-cmd-main-menu.cc | 8 ++++----
src/plugin_manager.cc | 4 ++--
src/utils.cc | 10 +++++-----
13 files changed, 42 insertions(+), 42 deletions(-)
---
diff --git a/src/gnome-cmd-about-plugin.cc b/src/gnome-cmd-about-plugin.cc
index 2dba1ee..94f8b36 100644
--- a/src/gnome-cmd-about-plugin.cc
+++ b/src/gnome-cmd-about-plugin.cc
@@ -609,9 +609,9 @@ static void set_value_array_from_list (GValue *value, GSList *list)
GValue tmp_value = { 0 };
- for (GSList *tmp = list; tmp; tmp = tmp->next)
+ for (GSList *i = list; i; i = i->next)
{
- char *str = (char *) tmp->data;
+ char *str = (char *) i->data;
g_value_init (&tmp_value, G_TYPE_STRING);
g_value_set_string (&tmp_value, str);
diff --git a/src/gnome-cmd-chmod-dialog.cc b/src/gnome-cmd-chmod-dialog.cc
index fd8caff..915b706 100644
--- a/src/gnome-cmd-chmod-dialog.cc
+++ b/src/gnome-cmd-chmod-dialog.cc
@@ -98,9 +98,9 @@ static void do_chmod (GnomeCmdFile *in, GnomeVFSFilePermissions perm, gboolean r
inline void do_chmod_files (GnomeCmdChmodDialog *dialog)
{
- for (GList *tmp = dialog->priv->files; tmp; tmp = tmp->next)
+ for (GList *i = dialog->priv->files; i; i = i->next)
{
- GnomeCmdFile *f = (GnomeCmdFile *) tmp->data;
+ GnomeCmdFile *f = (GnomeCmdFile *) i->data;
gboolean recursive = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->recurse_check));
const gchar *mode_text = get_combo_text (dialog->priv->recurse_combo);
ChmodRecursiveMode mode = strcmp (mode_text, recurse_opts[CHMOD_ALL_FILES]) == 0 ? CHMOD_ALL_FILES :
diff --git a/src/gnome-cmd-chown-dialog.cc b/src/gnome-cmd-chown-dialog.cc
index 11db2cb..85d7b94 100644
--- a/src/gnome-cmd-chown-dialog.cc
+++ b/src/gnome-cmd-chown-dialog.cc
@@ -98,9 +98,9 @@ static void on_ok (GtkButton *button, GnomeCmdChownDialog *dialog)
gboolean recurse = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->recurse_check));
- for (GList *tmp = dialog->priv->files; tmp; tmp = tmp->next)
+ for (GList *i = dialog->priv->files; i; i = i->next)
{
- GnomeCmdFile *f = (GnomeCmdFile *) tmp->data;
+ GnomeCmdFile *f = (GnomeCmdFile *) i->data;
g_return_if_fail (f != NULL);
diff --git a/src/gnome-cmd-cmdline.cc b/src/gnome-cmd-cmdline.cc
index 7527f8a..bfa4920 100644
--- a/src/gnome-cmd-cmdline.cc
+++ b/src/gnome-cmd-cmdline.cc
@@ -51,9 +51,9 @@ inline void update_history_combo (GnomeCmdCmdline *cmdline)
text[1] = NULL;
- for (GList *tmp = cmdline->priv->history; tmp; tmp = tmp->next)
+ for (GList *i = cmdline->priv->history; i; i = i->next)
{
- gchar *command = text[0] = (gchar *) tmp->data;
+ gchar *command = text[0] = (gchar *) i->data;
cmdline->priv->combo->append(text, command);
}
@@ -408,8 +408,8 @@ void gnome_cmd_cmdline_set_history (GnomeCmdCmdline *cmdline, GList *history)
// free the old history
- for (GList *tmp = cmdline->priv->history; tmp; tmp = tmp->next)
- g_free (tmp->data);
+ for (GList *i = cmdline->priv->history; i; i = i->next)
+ g_free (i->data);
cmdline->priv->history = history;
}
diff --git a/src/gnome-cmd-convert.cc b/src/gnome-cmd-convert.cc
index 4ad936b..4489f38 100644
--- a/src/gnome-cmd-convert.cc
+++ b/src/gnome-cmd-convert.cc
@@ -62,10 +62,10 @@ inline gint word_is_roman_numeral (gchar *text)
{
gint len = 0;
- for (gchar *tmp = text; *tmp; ++tmp, ++len)
- if (*tmp != (gunichar)'i' && *tmp != (gunichar)'v' && *tmp != (gunichar)'x' && *tmp != (gunichar)'l' &&
- *tmp != (gunichar)'c' && *tmp != (gunichar)'d' && *tmp != (gunichar)'m')
- return *tmp == ' ' || *tmp == '_' ? len : 0;
+ for (gchar *i = text; *i; ++i, ++len)
+ if (*i != (gunichar)'i' && *i != (gunichar)'v' && *i != (gunichar)'x' && *i != (gunichar)'l' &&
+ *i != (gunichar)'c' && *i != (gunichar)'d' && *i != (gunichar)'m')
+ return *i == ' ' || *i == '_' ? len : 0;
return len;
}
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index c3473d8..36103be 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -133,9 +133,9 @@ inline void save_devices (const gchar *fname)
if (fd)
{
- for (GList *tmp = gnome_cmd_con_list_get_all_dev (gnome_cmd_data.priv->con_list); tmp; tmp = tmp->next)
+ for (GList *i = gnome_cmd_con_list_get_all_dev (gnome_cmd_data.priv->con_list); i; i = i->next)
{
- GnomeCmdConDevice *device = GNOME_CMD_CON_DEVICE (tmp->data);
+ GnomeCmdConDevice *device = GNOME_CMD_CON_DEVICE (i->data);
if (device && !gnome_cmd_con_device_get_autovol (device))
{
gchar *alias = gnome_vfs_escape_string (gnome_cmd_con_device_get_alias (device));
@@ -346,9 +346,9 @@ inline void remove_vfs_volume (GnomeVFSVolume *volume)
path = gnome_vfs_volume_get_device_path (volume);
localpath = gnome_vfs_get_local_path_from_uri (uri);
- for (GList *tmp = gnome_cmd_con_list_get_all_dev (gnome_cmd_data.priv->con_list); tmp; tmp = tmp->next)
+ for (GList *i = gnome_cmd_con_list_get_all_dev (gnome_cmd_data.priv->con_list); i; i = i->next)
{
- GnomeCmdConDevice *device = GNOME_CMD_CON_DEVICE (tmp->data);
+ GnomeCmdConDevice *device = GNOME_CMD_CON_DEVICE (i->data);
if (device && gnome_cmd_con_device_get_autovol (device))
{
gchar *device_fn = (gchar *) gnome_cmd_con_device_get_device_fn (device);
diff --git a/src/gnome-cmd-delete-dialog.cc b/src/gnome-cmd-delete-dialog.cc
index cf8c291..3e1d9d2 100644
--- a/src/gnome-cmd-delete-dialog.cc
+++ b/src/gnome-cmd-delete-dialog.cc
@@ -220,9 +220,9 @@ static gboolean update_delete_status_widgets (DeleteData *data)
gnome_cmd_show_message (*main_win, gnome_vfs_result_to_string (data->vfs_status));
if (data->files)
- for (GList *tmp = data->files; tmp; tmp = tmp->next)
+ for (GList *i = data->files; i; i = i->next)
{
- GnomeCmdFile *f = GNOME_CMD_FILE (tmp->data);
+ GnomeCmdFile *f = GNOME_CMD_FILE (i->data);
GnomeVFSURI *uri = f->get_uri();
if (!gnome_vfs_uri_exists (uri))
@@ -233,7 +233,7 @@ static gboolean update_delete_status_widgets (DeleteData *data)
cleanup (data);
- return FALSE; // Returning FALSE here stops the timeout callbacks
+ return FALSE; // returning FALSE here stops the timeout callbacks
}
return TRUE;
diff --git a/src/gnome-cmd-dir.cc b/src/gnome-cmd-dir.cc
index 60c5d09..fe3fce4 100644
--- a/src/gnome-cmd-dir.cc
+++ b/src/gnome-cmd-dir.cc
@@ -392,9 +392,9 @@ static GList *create_file_list (GnomeCmdDir *dir, GList *info_list)
// create a new list with GnomeCmdFile objects
- for (GList *tmp = info_list; tmp; tmp = tmp->next)
+ for (GList *i = info_list; i; i = i->next)
{
- GnomeVFSFileInfo *info = (GnomeVFSFileInfo *) tmp->data;
+ GnomeVFSFileInfo *info = (GnomeVFSFileInfo *) i->data;
if (info && info->name)
{
diff --git a/src/gnome-cmd-file-popmenu.cc b/src/gnome-cmd-file-popmenu.cc
index 2a4e091..40650d9 100644
--- a/src/gnome-cmd-file-popmenu.cc
+++ b/src/gnome-cmd-file-popmenu.cc
@@ -539,9 +539,9 @@ GtkWidget *gnome_cmd_file_popmenu_new (GnomeCmdFileList *fl)
// Add favorite applications
match_count = 0;
- for (GList *tmp=gnome_cmd_data.options.fav_apps; tmp; tmp = tmp->next)
+ for (GList *i=gnome_cmd_data.options.fav_apps; i; i = i->next)
{
- GnomeCmdApp *app = (GnomeCmdApp *) tmp->data;
+ GnomeCmdApp *app = (GnomeCmdApp *) i->data;
if (fav_app_matches_files (app, files))
{
add_fav_app_menu_item (menu, app, pos++, files);
@@ -549,9 +549,9 @@ GtkWidget *gnome_cmd_file_popmenu_new (GnomeCmdFileList *fl)
}
}
- for (GList *tmp=plugin_manager_get_all (); tmp; tmp = tmp->next)
+ for (GList *i=plugin_manager_get_all (); i; i = i->next)
{
- PluginData *data = (PluginData *) tmp->data;
+ PluginData *data = (PluginData *) i->data;
if (data->active)
{
GList *items = gnome_cmd_plugin_create_popup_menu_items (data->plugin, main_win->get_state());
diff --git a/src/gnome-cmd-file-props-dialog.cc b/src/gnome-cmd-file-props-dialog.cc
index d3b3451..c52d9a8 100644
--- a/src/gnome-cmd-file-props-dialog.cc
+++ b/src/gnome-cmd-file-props-dialog.cc
@@ -83,9 +83,9 @@ static void calc_tree_size_r (GnomeCmdFilePropsDialogPrivate *data, GnomeVFSURI
if (result != GNOME_VFS_OK) return;
if (!list) return;
- for (GList *tmp = list; tmp; tmp = tmp->next)
+ for (GList *i = list; i; i = i->next)
{
- GnomeVFSFileInfo *info = (GnomeVFSFileInfo *) tmp->data;
+ GnomeVFSFileInfo *info = (GnomeVFSFileInfo *) i->data;
if (strcmp (info->name, ".") != 0 && strcmp (info->name, "..") != 0)
{
@@ -100,9 +100,9 @@ static void calc_tree_size_r (GnomeCmdFilePropsDialogPrivate *data, GnomeVFSURI
}
}
- for (GList *tmp = list; tmp; tmp = tmp->next)
+ for (GList *i = list; i; i = i->next)
{
- GnomeVFSFileInfo *info = (GnomeVFSFileInfo *) tmp->data;
+ GnomeVFSFileInfo *info = (GnomeVFSFileInfo *) i->data;
gnome_vfs_file_info_unref (info);
}
diff --git a/src/gnome-cmd-main-menu.cc b/src/gnome-cmd-main-menu.cc
index 226e976..9d8eb0a 100644
--- a/src/gnome-cmd-main-menu.cc
+++ b/src/gnome-cmd-main-menu.cc
@@ -923,9 +923,9 @@ void gnome_cmd_main_menu_update_connections (GnomeCmdMainMenu *main_menu)
// Add all open connections
gint match_count = 0;
- for (GList *tmp = all_cons; tmp; tmp = tmp->next)
+ for (GList *i = all_cons; i; i = i->next)
{
- GnomeCmdCon *con = GNOME_CMD_CON (tmp->data);
+ GnomeCmdCon *con = GNOME_CMD_CON (i->data);
if (!GNOME_CMD_IS_CON_REMOTE (con) || gnome_cmd_con_is_open (con))
{
add_connection (main_menu, con,
@@ -943,9 +943,9 @@ void gnome_cmd_main_menu_update_connections (GnomeCmdMainMenu *main_menu)
add_separator (main_menu, connections_menu));
// Add all open connections that are not permanent
- for (GList *tmp = all_cons; tmp; tmp = tmp->next)
+ for (GList *i = all_cons; i; i = i->next)
{
- GnomeCmdCon *con = GNOME_CMD_CON (tmp->data);
+ GnomeCmdCon *con = GNOME_CMD_CON (i->data);
if (gnome_cmd_con_is_closeable (con) && gnome_cmd_con_is_open (con))
add_connection (main_menu, con,
gnome_cmd_con_get_close_text (con),
diff --git a/src/plugin_manager.cc b/src/plugin_manager.cc
index 1a8ea83..d7ce8c3 100644
--- a/src/plugin_manager.cc
+++ b/src/plugin_manager.cc
@@ -273,9 +273,9 @@ 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, ++row)
+ for (GList *i=plugins; i; i=i->next, ++row)
{
- PluginData *data = (PluginData *) tmp->data;
+ PluginData *data = (PluginData *) i->data;
gchar *text[5];
text[0] = NULL;
diff --git a/src/utils.cc b/src/utils.cc
index f7a0eef..03450fe 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -973,9 +973,9 @@ gboolean app_needs_terminal (GnomeCmdFile *f)
GList *libs = app_get_linked_libs (f);
if (!libs) return FALSE;
- for (GList *tmp = libs; tmp; tmp = tmp->next)
+ for (GList *i = libs; i; i = i->next)
{
- gchar *lib = (gchar *) tmp->data;
+ gchar *lib = (gchar *) i->data;
lib = g_strstrip (lib);
if (g_str_has_prefix (lib, "libX11"))
{
@@ -1290,11 +1290,11 @@ void patlist_free (GList *pattern_list)
gboolean patlist_matches (GList *pattern_list, const gchar *s)
{
- for (GList *tmp = pattern_list; tmp; tmp = tmp->next)
+ for (GList *i=pattern_list; i; i=i->next)
#ifdef FNM_CASEFOLD
- if (fnmatch ((gchar *) tmp->data, s, FNM_NOESCAPE|FNM_CASEFOLD) == 0)
+ if (fnmatch ((gchar *) i->data, s, FNM_NOESCAPE|FNM_CASEFOLD) == 0)
#else
- if (fnmatch ((gchar *) tmp->data, s, FNM_NOESCAPE) == 0) // omit FNM_CASEFOLD as it is a GNU extension.
+ if (fnmatch ((gchar *) i->data, s, FNM_NOESCAPE) == 0) // omit FNM_CASEFOLD as it is a GNU extension.
#endif
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]