[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: Sun, 18 Jul 2010 12:07:14 +0000 (UTC)
commit 4bf1d1a29eac7ad1ceda6e5139ea35ce28ee1198
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Sun Jul 18 14:00:46 2010 +0200
noop: code cleanup
src/gnome-cmd-advrename-dialog.h | 6 +++---
src/gnome-cmd-combo.h | 10 +++++-----
src/gnome-cmd-file-list.cc | 4 ++--
src/gnome-cmd-file-list.h | 14 +++++++-------
src/gnome-cmd-file-selector.cc | 4 +---
src/gnome-cmd-file-selector.h | 12 ++++++------
src/gnome-cmd-main-win.cc | 8 ++++----
src/gnome-cmd-main-win.h | 16 ++++++++--------
src/gnome-cmd-notebook.cc | 2 +-
src/gnome-cmd-notebook.h | 22 +++++++++++-----------
src/gnome-cmd-profile-component.h | 2 +-
src/gnome-cmd-regex.h | 2 +-
src/gnome-cmd-xml-config.cc | 2 +-
13 files changed, 51 insertions(+), 53 deletions(-)
---
diff --git a/src/gnome-cmd-advrename-dialog.h b/src/gnome-cmd-advrename-dialog.h
index c474027..7120dca 100644
--- a/src/gnome-cmd-advrename-dialog.h
+++ b/src/gnome-cmd-advrename-dialog.h
@@ -41,9 +41,9 @@ struct GnomeCmdAdvrenameDialog
Private *priv;
- operator GtkWidget * () { return GTK_WIDGET (this); }
- operator GtkWindow * () { return GTK_WINDOW (this); }
- operator GtkDialog * () { return GTK_DIALOG (this); }
+ operator GtkWidget * () const { return GTK_WIDGET (this); }
+ operator GtkWindow * () const { return GTK_WINDOW (this); }
+ operator GtkDialog * () const { return GTK_DIALOG (this); }
void *operator new (size_t size) { return g_object_new (GNOME_CMD_TYPE_ADVRENAME_DIALOG, NULL); }
void operator delete (void *p) { g_object_unref (p); }
diff --git a/src/gnome-cmd-combo.h b/src/gnome-cmd-combo.h
index 69d126e..1c0819a 100644
--- a/src/gnome-cmd-combo.h
+++ b/src/gnome-cmd-combo.h
@@ -50,9 +50,9 @@ struct GnomeCmdCombo
public:
- operator GObject * () { return G_OBJECT (this); }
- operator GtkObject * () { return GTK_OBJECT (this); }
- operator GtkWidget * () { return GTK_WIDGET (this); }
+ operator GObject * () const { return G_OBJECT (this); }
+ operator GtkObject * () const { return GTK_OBJECT (this); }
+ operator GtkWidget * () const { return GTK_WIDGET (this); }
GtkWidget *entry;
GtkWidget *list;
@@ -101,8 +101,8 @@ struct GnomeCmdCombo
void update_style();
- gpointer get_selected_data() { return sel_data; }
- const gchar *get_selected_text() { return sel_text; }
+ gpointer get_selected_data() const { return sel_data; }
+ const gchar *get_selected_text() const { return sel_text; }
};
inline void *GnomeCmdCombo::operator new (size_t size)
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index 887bc5d..076dabb 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -1622,13 +1622,13 @@ guint GnomeCmdFileList::get_column_default_width (GnomeCmdFileList::ColumnID col
}
-GnomeCmdFileList::ColumnID GnomeCmdFileList::get_sort_column()
+GnomeCmdFileList::ColumnID GnomeCmdFileList::get_sort_column() const
{
return (ColumnID) priv->current_col;
}
-gboolean GnomeCmdFileList::get_sort_order()
+gboolean GnomeCmdFileList::get_sort_order() const
{
return priv->sort_raising[priv->current_col];
}
diff --git a/src/gnome-cmd-file-list.h b/src/gnome-cmd-file-list.h
index d834e6d..5a6b013 100644
--- a/src/gnome-cmd-file-list.h
+++ b/src/gnome-cmd-file-list.h
@@ -71,11 +71,11 @@ struct GnomeCmdFileList
void *operator new (size_t size);
void operator delete (void *p) { g_object_unref (p); }
- operator GObject * () { return G_OBJECT (this); }
- operator GtkObject * () { return GTK_OBJECT (this); }
- operator GtkWidget * () { return GTK_WIDGET (this); }
- operator GtkCList * () { return GTK_CLIST (this); }
- operator GnomeCmdCList * () { return GNOME_CMD_CLIST (this); }
+ operator GObject * () const { return G_OBJECT (this); }
+ operator GtkObject * () const { return GTK_OBJECT (this); }
+ operator GtkWidget * () const { return GTK_WIDGET (this); }
+ operator GtkCList * () const { return GTK_CLIST (this); }
+ operator GnomeCmdCList * () const { return GNOME_CMD_CLIST (this); }
enum ColumnID
{
@@ -155,8 +155,8 @@ struct GnomeCmdFileList
void show_column(ColumnID col, gboolean value) { gtk_clist_set_column_visibility (*this, col, value); }
- ColumnID get_sort_column();
- gboolean get_sort_order();
+ ColumnID get_sort_column() const;
+ gboolean get_sort_order() const;
static guint get_column_default_width(ColumnID col);
void invalidate_tree_size();
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index 0996d19..a091738 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -700,8 +700,6 @@ static void class_init (GnomeCmdFileSelectorClass *klass)
static void init (GnomeCmdFileSelector *fs)
{
- GtkWidget *padding;
-
fs->list = NULL;
fs->priv = new GnomeCmdFileSelector::Private;
@@ -750,10 +748,10 @@ static void init (GnomeCmdFileSelector *fs)
gtk_misc_set_alignment (GTK_MISC (fs->info_label), 0.0f, 0.5f);
// pack the widgets
+ GtkWidget *padding = create_hbox (*fs, FALSE, 6);
gtk_box_pack_start (GTK_BOX (fs), fs->con_hbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), fs->dir_indicator, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (fs->notebook), TRUE, TRUE, 0);
- padding = create_hbox (*fs, FALSE, 6);
gtk_box_pack_start (GTK_BOX (vbox), padding, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (padding), fs->info_label, FALSE, TRUE, 6);
gtk_box_pack_start (GTK_BOX (fs->con_hbox), *fs->con_combo, FALSE, FALSE, 0);
diff --git a/src/gnome-cmd-file-selector.h b/src/gnome-cmd-file-selector.h
index be42447..6f8e5b5 100644
--- a/src/gnome-cmd-file-selector.h
+++ b/src/gnome-cmd-file-selector.h
@@ -67,14 +67,14 @@ struct GnomeCmdFileSelector
Private *priv;
- operator GObject * () { return G_OBJECT (this); }
- operator GtkWidget * () { return GTK_WIDGET (this); }
- operator GtkBox * () { return GTK_BOX (this); }
+ operator GObject * () const { return G_OBJECT (this); }
+ operator GtkWidget * () const { return GTK_WIDGET (this); }
+ operator GtkBox * () const { return GTK_BOX (this); }
GnomeCmdFileList *file_list() const { return list; }
GnomeCmdFileList *file_list(gint n) const;
- GnomeCmdDir *get_directory() { return list->cwd; }
+ GnomeCmdDir *get_directory() const { return list->cwd; }
void goto_directory(const gchar *dir) { return list->goto_directory(dir); }
void first();
@@ -87,10 +87,10 @@ struct GnomeCmdFileSelector
void set_active(gboolean value);
- GnomeCmdCon *get_connection() { return file_list()->con; }
+ GnomeCmdCon *get_connection() const { return file_list()->con; }
void set_connection(GnomeCmdCon *con, GnomeCmdDir *start_dir=NULL);
- gboolean is_local() { return gnome_cmd_con_is_local (get_connection ()); }
+ gboolean is_local() const { return gnome_cmd_con_is_local (get_connection ()); }
gboolean is_active();
GtkWidget *new_tab(GnomeCmdDir *dir=NULL, gboolean activate=TRUE);
diff --git a/src/gnome-cmd-main-win.cc b/src/gnome-cmd-main-win.cc
index f0db797..e22c58e 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -874,7 +874,7 @@ GtkType gnome_cmd_main_win_get_type ()
}
-GnomeCmdFileSelector *GnomeCmdMainWin::fs(FileSelectorID id)
+GnomeCmdFileSelector *GnomeCmdMainWin::fs(FileSelectorID id) const
{
switch (id)
{
@@ -897,7 +897,7 @@ GnomeCmdFileSelector *GnomeCmdMainWin::fs(FileSelectorID id)
}
-FileSelectorID GnomeCmdMainWin::fs()
+FileSelectorID GnomeCmdMainWin::fs() const
{
return priv->current_fs;
}
@@ -1145,7 +1145,7 @@ static void gnome_cmd_main_win_real_switch_fs (GnomeCmdMainWin *mw, GnomeCmdFile
}
-GnomeCmdCmdline *GnomeCmdMainWin::get_cmdline()
+GnomeCmdCmdline *GnomeCmdMainWin::get_cmdline() const
{
return GNOME_CMD_CMDLINE (priv->cmdline);
}
@@ -1294,7 +1294,7 @@ void GnomeCmdMainWin::add_plugin_menu(PluginData *data)
}
-GnomeCmdState *GnomeCmdMainWin::get_state()
+GnomeCmdState *GnomeCmdMainWin::get_state() const
{
GnomeCmdFileSelector *fs1 = fs(ACTIVE);
GnomeCmdFileSelector *fs2 = fs(INACTIVE);
diff --git a/src/gnome-cmd-main-win.h b/src/gnome-cmd-main-win.h
index affc3f0..5652a07 100644
--- a/src/gnome-cmd-main-win.h
+++ b/src/gnome-cmd-main-win.h
@@ -53,15 +53,15 @@ struct GnomeCmdMainWin
void *operator new (size_t size) { return g_object_new (GNOME_CMD_TYPE_MAIN_WIN, NULL); }
void operator delete (void *p) { g_object_unref (p); }
- operator GObject * () { return G_OBJECT (this); }
- operator GtkObject * () { return GTK_OBJECT (this); }
- operator GtkWidget * () { return GTK_WIDGET (this); }
- operator GtkWindow * () { return GTK_WINDOW (this); }
+ operator GObject * () const { return G_OBJECT (this); }
+ operator GtkObject * () const { return GTK_OBJECT (this); }
+ operator GtkWidget * () const { return GTK_WIDGET (this); }
+ operator GtkWindow * () const { return GTK_WINDOW (this); }
GnomeCmdAdvrenameDialog *advrename_dlg;
- GnomeCmdFileSelector *fs(FileSelectorID id);
- FileSelectorID fs();
+ GnomeCmdFileSelector *fs(FileSelectorID id) const;
+ FileSelectorID fs() const;
gboolean key_pressed (GdkEventKey *event);
@@ -70,10 +70,10 @@ struct GnomeCmdMainWin
void set_fs_directory_to_opposite(FileSelectorID fsID);
void set_equal_panes();
- GnomeCmdState *get_state();
+ GnomeCmdState *get_state() const;
void set_cap_state(gboolean state);
- GnomeCmdCmdline *get_cmdline();
+ GnomeCmdCmdline *get_cmdline() const;
void focus_file_lists();
void refocus();
diff --git a/src/gnome-cmd-notebook.cc b/src/gnome-cmd-notebook.cc
index 3a7c328..08c21f7 100644
--- a/src/gnome-cmd-notebook.cc
+++ b/src/gnome-cmd-notebook.cc
@@ -82,7 +82,7 @@ static void gnome_cmd_notebook_class_init (GnomeCmdNotebookClass *klass)
}
-int GnomeCmdNotebook::find_tab_num_at_pos(gint screen_x, gint screen_y)
+int GnomeCmdNotebook::find_tab_num_at_pos(gint screen_x, gint screen_y) const
{
if (!GTK_NOTEBOOK (this)->first_tab)
return -1;
diff --git a/src/gnome-cmd-notebook.h b/src/gnome-cmd-notebook.h
index bfb08fc..e1cd265 100644
--- a/src/gnome-cmd-notebook.h
+++ b/src/gnome-cmd-notebook.h
@@ -42,18 +42,18 @@ struct GnomeCmdNotebook
void *operator new (size_t size) { return g_object_new (GNOME_CMD_TYPE_NOTEBOOK, "show-tabs", FALSE, "scrollable", TRUE, NULL); }
void operator delete (void *p) { g_object_unref (p); }
- operator GtkWidget * () { return GTK_WIDGET (this); }
- operator GtkContainer * () { return GTK_CONTAINER (this); }
- operator GtkNotebook * () { return GTK_NOTEBOOK (this); }
+ operator GtkWidget * () const { return GTK_WIDGET (this); }
+ operator GtkContainer * () const { return GTK_CONTAINER (this); }
+ operator GtkNotebook * () const { return GTK_NOTEBOOK (this); }
- int size() { return gtk_notebook_get_n_pages (*this); }
- bool empty() { return size()==0; }
+ int size() const { return gtk_notebook_get_n_pages (*this); }
+ bool empty() const { return size()==0; }
- gint get_current_page() { return gtk_notebook_get_current_page (*this); }
+ gint get_current_page() const { return gtk_notebook_get_current_page (*this); }
void set_current_page(gint n) { gtk_notebook_set_current_page (*this, n); }
- GtkWidget *page() { return gtk_notebook_get_nth_page (*this, get_current_page()); }
- GtkWidget *page(gint n) { return gtk_notebook_get_nth_page (*this, n); }
+ GtkWidget *page() const { return gtk_notebook_get_nth_page (*this, get_current_page()); }
+ GtkWidget *page(gint n) const { return gtk_notebook_get_nth_page (*this, n); }
gint insert_page(GtkWidget *page, gint n, GtkWidget *label=NULL);
gint insert_page(GtkWidget *page, gint n, const gchar *label) { return insert_page(page, n, label ? gtk_label_new (label) : NULL); }
@@ -65,8 +65,8 @@ struct GnomeCmdNotebook
void remove_page(gint n);
void remove_page() { remove_page (get_current_page()); }
- GtkWidget *get_label() { return gtk_notebook_get_tab_label (*this, page()); }
- GtkWidget *get_label(gint n) { return gtk_notebook_get_tab_label (*this, page(n)); }
+ GtkWidget *get_label() const { return gtk_notebook_get_tab_label (*this, page()); }
+ GtkWidget *get_label(gint n) const { return gtk_notebook_get_tab_label (*this, page(n)); }
void set_label(GtkWidget *label=NULL) { gtk_notebook_set_tab_label (*this, page(), label); }
void set_label(gint n, GtkWidget *label=NULL) { gtk_notebook_set_tab_label (*this, page(n), label); }
void set_label(const gchar *label) { set_label(label ? gtk_label_new (label) : NULL); }
@@ -75,7 +75,7 @@ struct GnomeCmdNotebook
void prev_page();
void next_page();
- int find_tab_num_at_pos(gint screen_x, gint screen_y);
+ int find_tab_num_at_pos(gint screen_x, gint screen_y) const;
};
inline gint GnomeCmdNotebook::insert_page(GtkWidget *page, gint n, GtkWidget *label)
diff --git a/src/gnome-cmd-profile-component.h b/src/gnome-cmd-profile-component.h
index dd65db1..f4ceac1 100644
--- a/src/gnome-cmd-profile-component.h
+++ b/src/gnome-cmd-profile-component.h
@@ -38,7 +38,7 @@ struct GnomeCmdProfileComponent
Private *priv;
- operator GtkWidget * () { return GTK_WIDGET (this); }
+ operator GtkWidget * () const { return GTK_WIDGET (this); }
void *operator new (size_t size) { return g_object_new (GNOME_CMD_TYPE_PROFILE_COMPONENT, NULL); }
void operator delete (void *p) { g_object_unref (p); }
diff --git a/src/gnome-cmd-regex.h b/src/gnome-cmd-regex.h
index 4e3e3ef..24d08b5 100644
--- a/src/gnome-cmd-regex.h
+++ b/src/gnome-cmd-regex.h
@@ -72,7 +72,7 @@ namespace GnomeCmd
public:
- operator gboolean () { return !malformed_pattern; }
+ operator gboolean () const { return !malformed_pattern; }
};
class RegexFind: public Regex
diff --git a/src/gnome-cmd-xml-config.cc b/src/gnome-cmd-xml-config.cc
index 095fadb..b7a7daf 100644
--- a/src/gnome-cmd-xml-config.cc
+++ b/src/gnome-cmd-xml-config.cc
@@ -779,7 +779,7 @@ gboolean gnome_cmd_xml_config_parse (const gchar *xml, gsize xml_len, GnomeCmdDa
{XML_GNOMECOMMANDER_KEYBINDINGS_KEY, "/GnomeCommander/KeyBindings/Key"}
};
- load_data (xml_elem_names, xml_elem_data, G_N_ELEMENTS(xml_elem_data));
+ load_data (xml_elem_names, xml_elem_data, G_N_ELEMENTS (xml_elem_data));
if (xml_len==-1)
xml_len = strlen (xml);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]