[gnome-commander] Simplify error handling



commit 519ad127ba5c7787375b90d191f3d090208172ad
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Tue Jul 14 23:55:07 2009 +0200

    Simplify error handling

 src/gnome-cmd-file-selector.cc |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index d4a76bf..5596a00 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -1473,29 +1473,21 @@ static void on_con_open_done (GnomeCmdCon *con, GnomeCmdFileSelector *fs)
 }
 
 
-static void on_con_open_failed (GnomeCmdCon *con, const gchar *emsg, GnomeVFSResult result, GnomeCmdFileSelector *fs)
+static void on_con_open_failed (GnomeCmdCon *con, const gchar *msg, GnomeVFSResult result, GnomeCmdFileSelector *fs)
 {
     g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
     g_return_if_fail (fs->priv->con_opening != NULL);
     g_return_if_fail (fs->priv->con_opening == con);
     g_return_if_fail (fs->priv->con_open_dialog != NULL);
 
-    gchar *s;
-
     DEBUG('m', "on_con_open_failed\n");
     gtk_signal_disconnect_by_data (GTK_OBJECT (con), fs);
 
-    if (emsg)
-        s = g_strdup (emsg);
+    if (msg)
+        gnome_cmd_show_message (NULL, msg);
     else
-        s = g_strdup_printf (_("Failed to open connection: %s\n"), gnome_vfs_result_to_string (result));
-
-    if (result != GNOME_VFS_OK || emsg != NULL)
-        create_error_dialog (s);
+        gnome_cmd_show_message (NULL, _("Failed to open connection."), gnome_vfs_result_to_string (result));
 
-    g_free (s);
-
-    gtk_widget_destroy (fs->priv->con_open_dialog);
     fs->priv->con_open_dialog = NULL;
     fs->priv->con_opening = NULL;
 }



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