[gnome-commander] GnomeCmdRemoteDialog: more C++ rework
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] GnomeCmdRemoteDialog: more C++ rework
- Date: Thu, 15 Sep 2011 20:20:45 +0000 (UTC)
commit fb449d42a347af3304ddb4fecfa48962532947ba
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Thu Sep 15 22:09:02 2011 +0200
GnomeCmdRemoteDialog: more C++ rework
src/dialogs/gnome-cmd-remote-dialog.cc | 14 ++++++--------
src/dialogs/gnome-cmd-remote-dialog.h | 2 ++
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-remote-dialog.cc b/src/dialogs/gnome-cmd-remote-dialog.cc
index 897b6aa..0c5da9e 100644
--- a/src/dialogs/gnome-cmd-remote-dialog.cc
+++ b/src/dialogs/gnome-cmd-remote-dialog.cc
@@ -125,21 +125,19 @@ static gboolean do_connect_real (GnomeCmdConFtp *server)
}
-inline void do_connect (GnomeCmdRemoteDialog *ftp_dialog, GnomeCmdConFtp *server=NULL)
+inline void GnomeCmdRemoteDialog::do_connect(GnomeCmdConFtp *server)
{
if (!server)
- server = get_selected_server (ftp_dialog);
+ server = get_selected_server (this);
if (!server) // exit as there is no server selected
return;
// store the anonymous ftp password as the user might have changed it
- const gchar *anon_pw = gtk_entry_get_text (GTK_ENTRY (ftp_dialog->priv->anonymous_pw_entry));
+ const gchar *anon_pw = gtk_entry_get_text (GTK_ENTRY (priv->anonymous_pw_entry));
gnome_cmd_data_set_ftp_anonymous_password (anon_pw);
- GnomeCmdCon *con = GNOME_CMD_CON (server);
-
- gtk_widget_destroy (GTK_WIDGET (ftp_dialog));
+ gtk_widget_destroy (*ftp_dialog);
g_timeout_add (1, (GtkFunction) do_connect_real, server);
}
@@ -147,7 +145,7 @@ inline void do_connect (GnomeCmdRemoteDialog *ftp_dialog, GnomeCmdConFtp *server
static void on_connect_btn_clicked (GtkButton *button, GnomeCmdRemoteDialog *ftp_dialog)
{
- do_connect (ftp_dialog);
+ ftp_dialog->do_connect();
}
@@ -244,7 +242,7 @@ static void on_list_row_inserted (GtkTreeModel *tree_model, GtkTreePath *path, G
static void on_list_row_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, GnomeCmdRemoteDialog *dialog)
{
- do_connect (dialog);
+ dialog->do_connect();
}
diff --git a/src/dialogs/gnome-cmd-remote-dialog.h b/src/dialogs/gnome-cmd-remote-dialog.h
index 1996138..67f81bc 100644
--- a/src/dialogs/gnome-cmd-remote-dialog.h
+++ b/src/dialogs/gnome-cmd-remote-dialog.h
@@ -39,6 +39,8 @@ struct GnomeCmdRemoteDialog
operator GObject * () const { return G_OBJECT (this); }
operator GtkWidget * () const { return GTK_WIDGET (this); }
operator GnomeCmdDialog * () const { return GNOME_CMD_DIALOG (this); }
+
+ void do_connect(GnomeCmdConFtp *server=NULL);
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]