[gnome-commander] noop: code cleanup



commit 7ccc61c743c5ce72e5de2fb52b02e086f4c0412b
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Sun Jun 13 15:49:34 2010 +0200

    noop: code cleanup

 src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc |    1 -
 src/gnome-cmd-dir-indicator.cc                   |   11 +++++------
 src/gnome-cmd-file-list.cc                       |   10 +---------
 3 files changed, 6 insertions(+), 16 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc b/src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc
index 5df868e..252e65a 100644
--- a/src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc
+++ b/src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc
@@ -502,7 +502,6 @@ void gnome_cmd_bookmark_goto (GnomeCmdBookmark *bookmark)
         {
             GnomeCmdDir *dir = gnome_cmd_dir_new (con, gnome_cmd_con_create_path (con, bookmark->path));
             fs->set_connection(con, dir);
-
         }
         else
         {
diff --git a/src/gnome-cmd-dir-indicator.cc b/src/gnome-cmd-dir-indicator.cc
index d1cef99..f29b500 100644
--- a/src/gnome-cmd-dir-indicator.cc
+++ b/src/gnome-cmd-dir-indicator.cc
@@ -88,22 +88,21 @@ static gboolean on_dir_indicator_clicked (GnomeCmdDirIndicator *indicator, GdkEv
 {
     g_return_val_if_fail (GNOME_CMD_IS_DIR_INDICATOR (indicator), FALSE);
 
-    if (event->type == GDK_BUTTON_PRESS && event->button == 1)
+    if (event->type==GDK_BUTTON_PRESS && event->button==1)
     {
         // left click - work out the path
         const gchar *labelText = gtk_label_get_text (GTK_LABEL (indicator->priv->label));
-        gchar *chTo = g_strdup(labelText);
+        gchar *chTo = (gchar *) g_malloc (strlen(labelText)+1);
         gint x = (gint) event->x;
 
-        for (gint i = 0; i < indicator->priv->numPositions; i++)
+        for (gint i=0; i < indicator->priv->numPositions; ++i)
             if (x < indicator->priv->slashPixelPosition[i])
             {
                 strncpy (chTo, labelText, indicator->priv->slashCharPosition[i]);
-                chTo[indicator->priv->slashCharPosition[i]] = 0x0;
+                chTo[indicator->priv->slashCharPosition[i]] = 0;
                 main_win->switch_fs(fs);
                 fs->goto_directory(chTo);
-                g_free (chTo);
-                return TRUE;
+                break;
             }
 
         // pointer is after directory name - just return
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index cc209d5..78a2793 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -2783,15 +2783,7 @@ static void unref_uri_list (GList *list)
 }
 
 
-static void
-drag_data_received (GtkWidget          *widget,
-                    GdkDragContext     *context,
-                    gint                x,
-                    gint                y,
-                    GtkSelectionData   *selection_data,
-                    guint               info,
-                    guint32             time,
-                    GnomeCmdFileList   *fl)
+static void drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint info, guint32 time, GnomeCmdFileList *fl)
 {
     GtkCList *clist = *fl;
     GnomeCmdFile *f;



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