gnome-commander r2039 - in branches/gcmd-1-3: . src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r2039 - in branches/gcmd-1-3: . src
- Date: Thu, 4 Sep 2008 22:07:57 +0000 (UTC)
Author: epiotr
Date: Thu Sep 4 22:07:56 2008
New Revision: 2039
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2039&view=rev
Log:
GnomeCmdFileList: more C++ rework
Modified:
branches/gcmd-1-3/ChangeLog
branches/gcmd-1-3/src/gnome-cmd-file-list.cc
branches/gcmd-1-3/src/gnome-cmd-file-list.h
branches/gcmd-1-3/src/gnome-cmd-file-popmenu.cc
branches/gcmd-1-3/src/gnome-cmd-file-selector.cc
branches/gcmd-1-3/src/gnome-cmd-main-win.cc
branches/gcmd-1-3/src/gnome-cmd-prepare-copy-dialog.cc
branches/gcmd-1-3/src/gnome-cmd-prepare-move-dialog.cc
branches/gcmd-1-3/src/gnome-cmd-prepare-xfer-dialog.cc
branches/gcmd-1-3/src/gnome-cmd-python-plugin.cc
branches/gcmd-1-3/src/gnome-cmd-quicksearch-popup.cc
branches/gcmd-1-3/src/gnome-cmd-search-dialog.cc
branches/gcmd-1-3/src/gnome-cmd-user-actions.cc
Modified: branches/gcmd-1-3/src/gnome-cmd-file-list.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file-list.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-file-list.cc Thu Sep 4 22:07:56 2008
@@ -118,8 +118,8 @@
GtkWidget *popup_menu;
gint cur_file;
- GList *selected_files; // contains GnomeCmdFile pointers
GnomeCmdFileCollection *shown_files;
+ GList *selected_files; // contains GnomeCmdFile pointers
GCompareDataFunc sort_func;
gint current_col;
@@ -128,14 +128,58 @@
gboolean shift_down;
gint shift_down_row;
GnomeCmdFile *right_mb_down_file;
- gboolean right_mouse_sel_state;
+ gboolean right_mb_sel_state;
guint right_mb_timeout_id;
GtkWidget *selpat_dialog;
GtkWidget *quicksearch_popup;
gchar *focus_later;
+
+ Private(GnomeCmdFileList *fl);
+ ~Private();
};
+GnomeCmdFileList::Private::Private(GnomeCmdFileList *fl)
+{
+ shown_files = new GnomeCmdFileCollection;
+ selected_files = NULL;
+
+ memset(column_pixmaps, NULL, sizeof(column_pixmaps));
+ memset(column_labels, NULL, sizeof(column_labels));
+
+ popup_menu = NULL;
+ quicksearch_popup = NULL;
+ selpat_dialog = NULL;
+
+ focus_later = NULL;
+ shift_down = FALSE;
+ shift_down_row = 0;
+ right_mb_sel_state = FALSE;
+ right_mb_down_file = NULL;
+ right_mb_timeout_id = 0;
+
+ memset(sort_raising, FALSE, sizeof(sort_raising));
+
+ gint col = COLUMN_NAME; // defaults,
+ gboolean b = GTK_SORT_ASCENDING; // used when not set by gnome_cmd_data_get_sort_params()
+
+ gnome_cmd_data_get_sort_params (fl, &col, &b);
+ current_col = col;
+ sort_raising[col] = b;
+ sort_func = file_list_column[col].sort_func;
+
+ for (gint i=0; i<NUM_COLUMNS; i++)
+ gtk_clist_set_column_resizeable (*fl, i, TRUE);
+}
+
+
+GnomeCmdFileList::Private::~Private()
+{
+ delete shown_files;
+ gnome_cmd_file_list_free (selected_files);
+}
+
+
inline gchar *strip_extension (const gchar *fname)
{
gchar *s = g_strdup (fname);
@@ -442,13 +486,13 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
- GnomeCmdFile *f = gnome_cmd_file_list_get_selected_file (fl);
+ GnomeCmdFile *f = fl->get_selected_file();
if (!f) return;
-
+
const gchar *ext1 = gnome_cmd_file_get_extension (f);
if (!ext1) return;
- for (GList *tmp=gnome_cmd_file_list_get_all_files (fl); tmp; tmp = tmp->next)
+ for (GList *tmp=fl->get_all_files(); tmp; tmp=tmp->next)
{
GnomeCmdFile *finfo = (GnomeCmdFile *) tmp->data;
@@ -474,7 +518,7 @@
Filter filter(pattern, case_sens, gnome_cmd_data_get_filter_type ());
- for (GList *tmp=gnome_cmd_file_list_get_all_files (fl); tmp; tmp=tmp->next)
+ for (GList *tmp=fl->get_all_files(); tmp; tmp=tmp->next)
{
GnomeCmdFile *finfo = (GnomeCmdFile *) tmp->data;
@@ -562,7 +606,7 @@
static char *build_selected_file_list (GnomeCmdFileList *fl, int *file_list_len)
{
- GList *sel_files = gnome_cmd_file_list_get_selected_files (fl);
+ GList *sel_files = fl->get_selected_files();
int listlen = g_list_length (sel_files);
if (listlen > 1)
@@ -711,7 +755,7 @@
static gboolean on_right_mb_timeout (GnomeCmdFileList *fl)
{
- GnomeCmdFile *focus_file = gnome_cmd_file_list_get_focused_file (fl);
+ GnomeCmdFile *focus_file = fl->get_focused_file();
if (fl->priv->right_mb_down_file == focus_file)
{
@@ -1109,12 +1153,12 @@
if (g_list_index (fl->priv->selected_files, finfo) == -1)
{
select_file (fl, finfo);
- fl->priv->right_mouse_sel_state = 1;
+ fl->priv->right_mb_sel_state = 1;
}
else
{
unselect_file (fl, finfo);
- fl->priv->right_mouse_sel_state = 0;
+ fl->priv->right_mb_sel_state = 0;
}
fl->priv->right_mb_down_file = finfo;
@@ -1148,7 +1192,7 @@
if (finfo)
{
fl->select_row(row+1);
- if (fl->priv->right_mouse_sel_state)
+ if (fl->priv->right_mb_sel_state)
select_file (fl, finfo);
else
unselect_file (fl, finfo);
@@ -1205,10 +1249,7 @@
{
GnomeCmdFileList *fl = GNOME_CMD_FILE_LIST (object);
- delete fl->priv->shown_files;
- gnome_cmd_file_list_free (fl->priv->selected_files);
-
- g_free (fl->priv);
+ delete fl->priv;
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(*GTK_OBJECT_CLASS (parent_class)->destroy) (object);
@@ -1275,32 +1316,10 @@
static void init (GnomeCmdFileList *fl)
{
- fl->priv = g_new0 (GnomeCmdFileList::Private, 1);
- fl->priv->shown_files = new GnomeCmdFileCollection;
- // fl->priv->selected_files = NULL;
- // fl->priv->shift_down = FALSE;
- // fl->priv->selpat_dialog = NULL;
- // fl->priv->right_mb_down_file = NULL;
- // fl->priv->right_mb_timeout_id = 0;
- // fl->priv->quicksearch_popup = NULL;
- // fl->priv->focus_later = NULL;
-
- // for (gint i=0; i<GnomeCmdFileList::NUM_COLUMNS; i++)
- // fl->priv->sort_raising[i] = FALSE;
-
- gint col = GnomeCmdFileList::COLUMN_NAME; // defaults,
- gboolean b = GTK_SORT_ASCENDING; // used when not set by gnome_cmd_data_get_sort_params()
-
- gnome_cmd_data_get_sort_params (fl, &col, &b);
- fl->priv->current_col = col;
- fl->priv->sort_raising[col] = b;
- fl->priv->sort_func = file_list_column[col].sort_func;
+ fl->priv = new GnomeCmdFileList::Private(fl);
init_dnd (fl);
- for (gint i=0; i<GnomeCmdFileList::NUM_COLUMNS; i++)
- gtk_clist_set_column_resizeable (*fl, i, TRUE);
-
gtk_signal_connect_after (*fl, "scroll-vertical", GTK_SIGNAL_FUNC (on_scroll_vertical), fl);
gtk_signal_connect (*fl, "click-column", GTK_SIGNAL_FUNC (on_column_clicked), fl);
@@ -1567,156 +1586,38 @@
}
-/******************************************************************************
-*
-* Function: gnome_cmd_file_list_get_selected_files
-*
-* Purpose: Returns a list with all selected files. The list returned is
-* a copy and should be freed when no longer needed. The files
-* in the list is however not refed before returning.
-*
-* Params:
-*
-* Returns:
-*
-* Statuses:
-*
-******************************************************************************/
-
-GList *gnome_cmd_file_list_get_selected_files (GnomeCmdFileList *fl)
+GList *GnomeCmdFileList::get_selected_files()
{
- g_return_val_if_fail (GNOME_CMD_IS_FILE_LIST (fl), NULL);
-
- if (fl->priv->selected_files)
- return g_list_copy (fl->priv->selected_files);
+ if (priv->selected_files)
+ return g_list_copy (priv->selected_files);
- GnomeCmdFile *file = gnome_cmd_file_list_get_selected_file (fl);
+ GnomeCmdFile *file = get_selected_file();
return file ? g_list_append (NULL, file) : NULL;
}
-/******************************************************************************
-*
-* Function: gnome_cmd_file_list_get_marked_files
-*
-* Purpose: Returns a list with all marked files. The list returned is
-* a copy and should be freed when no longer needed. The files
-* in the list is however not refed before returning.
-* A marked file is a file that has been selected with ins etc.
-* The file that is currently focused is not marked.
-*
-* Params:
-*
-* Returns:
-*
-* Statuses:
-*
-******************************************************************************/
-
-GList *gnome_cmd_file_list_get_marked_files (GnomeCmdFileList *fl)
-{
- g_return_val_if_fail (GNOME_CMD_IS_FILE_LIST (fl), NULL);
-
- return fl->priv->selected_files ? g_list_copy (fl->priv->selected_files) : NULL;
-}
-
-
-/******************************************************************************
-*
-* Function: gnome_cmd_file_list_get_all_files
-*
-* Purpose: Returns a list with all files shown in the file-list. The list
-* is the same as that in the file-list it self so make a copy and ref the files
-* if needed.
-*
-* Params:
-*
-* Returns:
-*
-* Statuses:
-*
-******************************************************************************/
-
-GList *gnome_cmd_file_list_get_all_files (GnomeCmdFileList *fl)
+GList *GnomeCmdFileList::get_marked_files()
{
- g_return_val_if_fail (GNOME_CMD_IS_FILE_LIST (fl), NULL);
-
- return fl->priv->shown_files->get_list();
+ return priv->selected_files ? g_list_copy (priv->selected_files) : NULL;
}
-/******************************************************************************
-*
-* Function: gnome_cmd_file_list_get_selected_file
-*
-* Purpose: Returns the currently focused file if any. The returned file is not
-* refed. The ".." file is NOT returned if focused
-*
-* Params:
-*
-* Returns:
-*
-* Statuses:
-*
-******************************************************************************/
-
-GnomeCmdFile *gnome_cmd_file_list_get_selected_file (GnomeCmdFileList *fl)
+GList *GnomeCmdFileList::get_all_files()
{
- g_return_val_if_fail (GNOME_CMD_IS_FILE_LIST (fl), NULL);
-
- GnomeCmdFile *finfo = gnome_cmd_file_list_get_focused_file (fl);
-
- return !finfo || strcmp (finfo->info->name, "..") == 0 ? NULL : finfo;
+ return priv->shown_files->get_list();
}
-/******************************************************************************
-*
-* Function: gnome_cmd_file_list_get_first_selected_file
-*
-* Purpose: Returns the first selected file if any or the focused one otherwise.
-* The returned file is not refed. The ".." file is NOT returned if focused
-*
-* Params:
-*
-* Returns:
-*
-* Statuses:
-*
-******************************************************************************/
-
-GnomeCmdFile *gnome_cmd_file_list_get_first_selected_file (GnomeCmdFileList *fl)
+GnomeCmdFile *GnomeCmdFileList::get_first_selected_file()
{
- g_return_val_if_fail (GNOME_CMD_IS_FILE_LIST (fl), NULL);
-
- if (fl->priv->selected_files)
- return (GnomeCmdFile *) fl->priv->selected_files->data;
-
- return gnome_cmd_file_list_get_selected_file (fl);
+ return priv->selected_files ? (GnomeCmdFile *) priv->selected_files->data : get_selected_file();
}
-/******************************************************************************
-*
-* Function: gnome_cmd_file_list_get_focused_file
-*
-* Purpose: Returns the currently focused file if any. The returned file is not
-* refed. The ".." file is returned if focused
-*
-* Params:
-*
-* Returns:
-*
-* Statuses:
-*
-******************************************************************************/
-
-GnomeCmdFile *gnome_cmd_file_list_get_focused_file (GnomeCmdFileList *fl)
+GnomeCmdFile *GnomeCmdFileList::get_focused_file()
{
- g_return_val_if_fail (GNOME_CMD_IS_FILE_LIST (fl), NULL);
-
- return fl->priv->cur_file < 0 ? NULL : get_file_at_row (fl, fl->priv->cur_file);
+ return priv->cur_file < 0 ? NULL : get_file_at_row (this, priv->cur_file);
}
@@ -1725,7 +1626,7 @@
gnome_cmd_file_list_free (priv->selected_files);
priv->selected_files = NULL;
- for (GList *tmp = gnome_cmd_file_list_get_all_files (this); tmp; tmp = tmp->next)
+ for (GList *tmp = get_all_files(); tmp; tmp = tmp->next)
select_file (this, (GnomeCmdFile *) tmp->data);
}
@@ -1769,7 +1670,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
- for (GList *tmp = gnome_cmd_file_list_get_all_files (fl); tmp; tmp = tmp->next)
+ for (GList *tmp = fl->get_all_files(); tmp; tmp = tmp->next)
{
GnomeCmdFile *finfo = (GnomeCmdFile *) tmp->data;
@@ -1821,7 +1722,7 @@
GList *sel = g_list_copy (fl->priv->selected_files);
- for (GList *tmp=gnome_cmd_file_list_get_all_files (fl); tmp; tmp = tmp->next)
+ for (GList *tmp=fl->get_all_files(); tmp; tmp = tmp->next)
{
GnomeCmdFile *finfo = (GnomeCmdFile *) tmp->data;
@@ -1868,7 +1769,7 @@
fl1->unselect_all();
fl2->select_all();
- for (GList *i=gnome_cmd_file_list_get_all_files (fl1); i; i=i->next)
+ for (GList *i=fl1->get_all_files(); i; i=i->next)
{
GnomeCmdFile *f1 = (GnomeCmdFile *) i->data;
GnomeCmdFile *f2;
@@ -1906,9 +1807,9 @@
}
-void GnomeCmdFileList::sort ()
+void GnomeCmdFileList::sort()
{
- GnomeCmdFile *selfile = gnome_cmd_file_list_get_selected_file (this);
+ GnomeCmdFile *selfile = get_selected_file();
gtk_clist_freeze (GTK_CLIST (this));
gtk_clist_clear (GTK_CLIST (this));
@@ -1949,7 +1850,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
- GnomeCmdFile *finfo = gnome_cmd_file_list_get_selected_file (fl);
+ GnomeCmdFile *finfo = fl->get_selected_file();
if (GNOME_CMD_IS_FILE (finfo))
{
@@ -1969,7 +1870,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
- GList *files = gnome_cmd_file_list_get_selected_files (fl);
+ GList *files = fl->get_selected_files();
if (files)
{
@@ -1983,7 +1884,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
- GList *files = gnome_cmd_file_list_get_selected_files (fl);
+ GList *files = fl->get_selected_files();
if (files)
{
@@ -2000,7 +1901,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
- GList *files = gnome_cmd_file_list_get_selected_files (fl);
+ GList *files = fl->get_selected_files();
if (files)
{
@@ -2017,7 +1918,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
- GList *files = gnome_cmd_file_list_get_selected_files (fl);
+ GList *files = fl->get_selected_files();
if (files)
{
@@ -2033,7 +1934,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
- GnomeCmdFile *finfo = gnome_cmd_file_list_get_selected_file (fl);
+ GnomeCmdFile *finfo = fl->get_selected_file();
if (finfo)
gnome_cmd_file_show_properties (finfo);
@@ -2050,7 +1951,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
- GList *files = gnome_cmd_file_list_get_selected_files (fl);
+ GList *files = fl->get_selected_files();
if (files)
{
@@ -2064,7 +1965,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
- GList *files = gnome_cmd_file_list_get_selected_files (fl);
+ GList *files = fl->get_selected_files();
if (files)
{
@@ -2078,7 +1979,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
- GnomeCmdFile *finfo = gnome_cmd_file_list_get_selected_file (fl);
+ GnomeCmdFile *finfo = fl->get_selected_file();
if (!finfo) return;
@@ -2094,7 +1995,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
- GnomeCmdFile *finfo = gnome_cmd_file_list_get_selected_file (fl);
+ GnomeCmdFile *finfo = fl->get_selected_file();
if (!finfo) return;
@@ -2261,7 +2162,7 @@
{
case GDK_Return:
case GDK_KP_Enter:
- return mime_exec_file (gnome_cmd_file_list_get_focused_file (this));
+ return mime_exec_file (get_focused_file());
case GDK_KP_Add:
case GDK_plus:
@@ -2343,7 +2244,7 @@
void GnomeCmdFileList::invalidate_tree_size()
{
- GList *all_files = gnome_cmd_file_list_get_all_files (this);
+ GList *all_files = get_all_files();
for (GList *tmp = all_files; tmp; tmp = tmp->next)
{
Modified: branches/gcmd-1-3/src/gnome-cmd-file-list.h
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file-list.h (original)
+++ branches/gcmd-1-3/src/gnome-cmd-file-list.h Thu Sep 4 22:07:56 2008
@@ -96,6 +96,15 @@
void sort();
GList *sort_selection(GList *list);
+ GList *get_all_files(); // Returns a list with all files shown in the file-list. The list is the same as that in the file-list it self so make a copy and ref the files if needed
+ GList *get_selected_files(); // Returns a list with all selected files. The list returned is a copy and should be freed when no longer needed. The files in the list is however not refed before returning
+ GList *get_marked_files(); // Returns a list with all marked files. The list returned is a copy and should be freed when no longer needed. The files in the list is however not refed before returning
+ // A marked file is a file that has been selected with ins etc. The file that is currently focused is not marked
+
+ GnomeCmdFile *get_focused_file(); // Returns the currently focused file if any. The returned file is not reffed. The ".." file is returned if focused
+ GnomeCmdFile *get_selected_file(); // Returns the currently focused file if any. The returned file is not reffed. The ".." file is NOT returned if focused
+ GnomeCmdFile *get_first_selected_file(); // Returns the first selected file if any or the focused one otherwise. The returned file is not reffed. The ".." file is NOT returned if focused
+
void show_column(ColumnID col, gboolean value) { gtk_clist_set_column_visibility (GTK_CLIST (this), col, value); }
ColumnID get_sort_column();
@@ -125,12 +134,29 @@
GtkType gnome_cmd_file_list_get_type ();
GtkWidget *gnome_cmd_file_list_new ();
+inline int GnomeCmdFileList::size()
+{
+ return g_list_length (get_all_files());
+}
+
+inline bool GnomeCmdFileList::empty()
+{
+ return get_all_files()==NULL;
+}
+
inline void GnomeCmdFileList::remove_files (GList *files)
{
for (; files; files = files->next)
remove_file((GnomeCmdFile *) files->data);
}
+inline GnomeCmdFile *GnomeCmdFileList::get_selected_file()
+{
+ GnomeCmdFile *f = get_focused_file();
+
+ return !f || strcmp (f->info->name, "..") == 0 ? NULL : f;
+}
+
void gnome_cmd_file_list_show_files (GnomeCmdFileList *fl, GList *files, gboolean sort);
void gnome_cmd_file_list_update_file (GnomeCmdFileList *fl, GnomeCmdFile *finfo);
@@ -138,26 +164,8 @@
void gnome_cmd_file_list_show_dir_size (GnomeCmdFileList *fl, GnomeCmdFile *finfo);
-GList *gnome_cmd_file_list_get_all_files (GnomeCmdFileList *fl);
-GList *gnome_cmd_file_list_get_selected_files (GnomeCmdFileList *fl);
-GList *gnome_cmd_file_list_get_marked_files (GnomeCmdFileList *fl);
-
-GnomeCmdFile *gnome_cmd_file_list_get_focused_file (GnomeCmdFileList *fl);
-GnomeCmdFile *gnome_cmd_file_list_get_selected_file (GnomeCmdFileList *fl);
-GnomeCmdFile *gnome_cmd_file_list_get_first_selected_file (GnomeCmdFileList *fl);
-
void gnome_cmd_file_list_focus_file (GnomeCmdFileList *fl, const gchar *focus_file, gboolean scroll_to_file);
-inline int GnomeCmdFileList::size()
-{
- return g_list_length (gnome_cmd_file_list_get_all_files (this));
-}
-
-inline bool GnomeCmdFileList::empty()
-{
- return gnome_cmd_file_list_get_all_files (this)==NULL;
-}
-
void gnome_cmd_file_list_select_pattern (GnomeCmdFileList *fl, const gchar *pattern, gboolean case_sens);
void gnome_cmd_file_list_unselect_pattern (GnomeCmdFileList *fl, const gchar *pattern, gboolean case_sens);
void gnome_cmd_file_list_invert_selection (GnomeCmdFileList *fl);
Modified: branches/gcmd-1-3/src/gnome-cmd-file-popmenu.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file-popmenu.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-file-popmenu.cc Thu Sep 4 22:07:56 2008
@@ -460,7 +460,7 @@
};
g_return_val_if_fail (GNOME_CMD_IS_FILE_LIST (fl), NULL);
- GList *files = gnome_cmd_file_list_get_selected_files (fl);
+ GList *files = fl->get_selected_files();
if (!files) return NULL;
GnomeCmdFilePopmenu *menu = (GnomeCmdFilePopmenu *) gtk_type_new (gnome_cmd_file_popmenu_get_type ());
Modified: branches/gcmd-1-3/src/gnome-cmd-file-selector.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file-selector.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-file-selector.cc Thu Sep 4 22:07:56 2008
@@ -152,7 +152,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
- GnomeCmdFile *f = gnome_cmd_file_list_get_selected_file (fs->file_list());
+ GnomeCmdFile *f = fs->file_list()->get_selected_file();
gnome_cmd_file_list_show_dir_size (fs->file_list(), f);
}
@@ -161,7 +161,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
- GList *all_files = gnome_cmd_file_list_get_all_files (fs->file_list());
+ GList *all_files = fs->file_list()->get_all_files();
if (!all_files)
return;
@@ -202,7 +202,7 @@
}
}
- GList *sel_files = gnome_cmd_file_list_get_marked_files (fs->file_list());
+ GList *sel_files = fs->file_list()->get_marked_files();
for (GList *tmp = sel_files; tmp; tmp = tmp->next)
{
GnomeCmdFile *f = (GnomeCmdFile *) tmp->data;
@@ -255,7 +255,7 @@
fs->file_list()->invalidate_tree_size();
- for (GList *files = gnome_cmd_file_list_get_all_files (fs->file_list()); files; files = files->next)
+ for (GList *files = fs->file_list()->get_all_files(); files; files = files->next)
gnome_cmd_file_list_show_dir_size (fs->file_list(), (GnomeCmdFile *) files->data);
update_selected_files_label (fs);
@@ -415,7 +415,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
- GnomeCmdFile *f = gnome_cmd_file_list_get_selected_file (fs->file_list());
+ GnomeCmdFile *f = fs->file_list()->get_selected_file();
if (GNOME_CMD_IS_FILE (f))
{
@@ -561,7 +561,7 @@
GnomeCmdDir *dir = fs->get_directory();
g_return_if_fail (GNOME_CMD_IS_DIR (dir));
- GList *files = gnome_cmd_file_list_get_selected_files (fs->file_list());
+ GList *files = fs->file_list()->get_selected_files();
fs->file_list()->remove_files(files);
g_list_free (files);
}
@@ -825,7 +825,7 @@
inline gboolean file_is_in_list (GnomeCmdFileSelector *fs, GnomeCmdFile *f)
{
- return g_list_index (gnome_cmd_file_list_get_all_files (fs->file_list()), f) != -1;
+ return g_list_index (fs->file_list()->get_all_files(), f) != -1;
}
@@ -833,7 +833,7 @@
{
g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
- GnomeCmdFile *f = gnome_cmd_file_list_get_selected_file (fs->file_list());
+ GnomeCmdFile *f = fs->file_list()->get_selected_file();
if (f && gnome_cmd_data_get_cmdline_visibility ())
{
@@ -1712,7 +1712,7 @@
if (!fs_is_active)
{
- GnomeCmdFile *file = gnome_cmd_file_list_get_selected_file (other->file_list());
+ GnomeCmdFile *file = other->file_list()->get_selected_file();
if (file && file->info->type == GNOME_VFS_FILE_TYPE_DIRECTORY)
dir = gnome_cmd_dir_new_from_info (file->info, dir);
@@ -1993,7 +1993,7 @@
return TRUE;
case GDK_Page_Down:
- f = gnome_cmd_file_list_get_selected_file (file_list());
+ f = file_list()->get_selected_file();
if (f && f->info->type == GNOME_VFS_FILE_TYPE_DIRECTORY)
do_file_specific_action (this, f);
return TRUE;
@@ -2025,7 +2025,7 @@
case GDK_Right:
case GDK_KP_Right:
- f = gnome_cmd_file_list_get_selected_file (file_list());
+ f = file_list()->get_selected_file();
if (f && f->info->type == GNOME_VFS_FILE_TYPE_DIRECTORY)
do_file_specific_action (this, f);
stop_kp (GTK_OBJECT (file_list()));
@@ -2037,7 +2037,7 @@
&& gnome_cmd_cmdline_is_empty (gnome_cmd_main_win_get_cmdline (main_win)))
gnome_cmd_cmdline_exec (gnome_cmd_main_win_get_cmdline (main_win));
else
- do_file_specific_action (this, gnome_cmd_file_list_get_focused_file (file_list()));
+ do_file_specific_action (this, file_list()->get_focused_file());
return TRUE;
case GDK_Escape:
Modified: branches/gcmd-1-3/src/gnome-cmd-main-win.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-main-win.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-main-win.cc Thu Sep 4 22:07:56 2008
@@ -1310,10 +1310,10 @@
GnomeCmdState *state = &mw->priv->state;
state->active_dir_uri = gnome_cmd_file_get_uri (GNOME_CMD_FILE (dir1));
state->inactive_dir_uri = gnome_cmd_file_get_uri (GNOME_CMD_FILE (dir2));
- state->active_dir_files = gnome_cmd_file_list_get_all_files (fs1->file_list());
- state->inactive_dir_files = gnome_cmd_file_list_get_all_files (fs2->file_list());
- state->active_dir_selected_files = gnome_cmd_file_list_get_selected_files (fs1->file_list());
- state->inactive_dir_selected_files = gnome_cmd_file_list_get_selected_files (fs2->file_list());
+ state->active_dir_files = fs1->file_list()->get_all_files();
+ state->inactive_dir_files = fs2->file_list()->get_all_files();
+ state->active_dir_selected_files = fs1->file_list()->get_selected_files();
+ state->inactive_dir_selected_files = fs2->file_list()->get_selected_files();
return state;
}
Modified: branches/gcmd-1-3/src/gnome-cmd-prepare-copy-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-prepare-copy-dialog.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-prepare-copy-dialog.cc Thu Sep 4 22:07:56 2008
@@ -75,7 +75,7 @@
gint num_files;
gchar *dest_dir_frame_msg, *text;
GtkWidget *label;
- GList *tmp = gnome_cmd_file_list_get_selected_files (from->file_list());
+ GList *tmp = from->file_list()->get_selected_files();
if (!tmp)
{
Modified: branches/gcmd-1-3/src/gnome-cmd-prepare-move-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-prepare-move-dialog.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-prepare-move-dialog.cc Thu Sep 4 22:07:56 2008
@@ -71,7 +71,7 @@
gchar *dest_dir_frame_msg, *text;
GtkWidget *label;
- GList *tmp = gnome_cmd_file_list_get_selected_files (from->file_list());
+ GList *tmp = from->file_list()->get_selected_files();
if (!tmp)
{
Modified: branches/gcmd-1-3/src/gnome-cmd-prepare-xfer-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-prepare-xfer-dialog.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-prepare-xfer-dialog.cc Thu Sep 4 22:07:56 2008
@@ -380,7 +380,7 @@
gchar *dest_str = NULL;
GnomeCmdPrepareXferDialog *dialog = (GnomeCmdPrepareXferDialog *) gtk_type_new (gnome_cmd_prepare_xfer_dialog_get_type ());
- dialog->src_files = gnome_cmd_file_list_get_selected_files (from->file_list());
+ dialog->src_files = from->file_list()->get_selected_files();
gnome_cmd_file_list_ref (dialog->src_files);
dialog->default_dest_dir = to->get_directory();
dialog->src_fs = from;
Modified: branches/gcmd-1-3/src/gnome-cmd-python-plugin.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-python-plugin.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-python-plugin.cc Thu Sep 4 22:07:56 2008
@@ -254,7 +254,7 @@
GList *selected_files;
GList *f;
- selected_files = gnome_cmd_file_list_get_selected_files (active_fl);
+ selected_files = active_fl->get_selected_files();
f = selected_files = active_fl->sort_selection(selected_files);
gint n;
Modified: branches/gcmd-1-3/src/gnome-cmd-quicksearch-popup.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-quicksearch-popup.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-quicksearch-popup.cc Thu Sep 4 22:07:56 2008
@@ -71,7 +71,7 @@
popup->priv->matches = NULL;
}
- for (GList *files = gnome_cmd_file_list_get_all_files (popup->priv->fl); files; files = files->next)
+ for (GList *files = popup->priv->fl->get_all_files(); files; files = files->next)
{
GnomeCmdFile *finfo = (GnomeCmdFile *) files->data;
gint res;
Modified: branches/gcmd-1-3/src/gnome-cmd-search-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-search-dialog.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-search-dialog.cc Thu Sep 4 22:07:56 2008
@@ -631,7 +631,7 @@
*/
static void on_goto (GtkButton *button, GnomeCmdSearchDialog *dialog)
{
- GnomeCmdFile *finfo = gnome_cmd_file_list_get_selected_file (GNOME_CMD_FILE_LIST (dialog->priv->result_list));
+ GnomeCmdFile *finfo = GNOME_CMD_FILE_LIST (dialog->priv->result_list)->get_selected_file();
if (!finfo)
return;
Modified: branches/gcmd-1-3/src/gnome-cmd-user-actions.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-user-actions.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-user-actions.cc Thu Sep 4 22:07:56 2008
@@ -65,7 +65,7 @@
// The file returned from this function is not to be unrefed
inline GnomeCmdFile *get_selected_file (const FileSelectorID fsID)
{
- GnomeCmdFile *finfo = gnome_cmd_file_list_get_first_selected_file (get_fl (fsID));
+ GnomeCmdFile *finfo = get_fl (fsID)->get_first_selected_file();
if (!finfo)
create_error_dialog (_("No file selected"));
@@ -704,7 +704,7 @@
void file_create_symlink (GtkMenuItem *menuitem, gpointer not_used)
{
GnomeCmdFileSelector *inactive_fs = get_fs (INACTIVE);
- GList *f = gnome_cmd_file_list_get_selected_files (get_fl (ACTIVE));
+ GList *f = get_fl (ACTIVE)->get_selected_files ();
guint selected_files = g_list_length (f);
if (selected_files > 1)
@@ -723,7 +723,7 @@
}
else
{
- GnomeCmdFile *finfo = gnome_cmd_file_list_get_focused_file (get_fl (ACTIVE));
+ GnomeCmdFile *finfo = get_fl (ACTIVE)->get_focused_file();
gnome_cmd_file_selector_create_symlink (inactive_fs, finfo);
}
}
@@ -763,7 +763,7 @@
GnomeCmdFileList *active_fl = get_fl (ACTIVE);
- GList *sel_files = gnome_cmd_file_list_get_selected_files (active_fl);
+ GList *sel_files = active_fl->get_selected_files();
string s;
@@ -911,7 +911,7 @@
gdk_window_get_pointer (NULL, NULL, NULL, &mask);
GnomeCmdFileList *fl = get_fl (ACTIVE);
- GList *sfl = gnome_cmd_file_list_get_selected_files (fl);
+ GList *sfl = fl->get_selected_files();
sfl = fl->sort_selection(sfl);
string fnames;
@@ -950,7 +950,7 @@
string uri = "[U]";
GnomeCmdFileList *fl = get_fl (ACTIVE);
- GList *sfl = gnome_cmd_file_list_get_selected_files (fl);
+ GList *sfl = fl->get_selected_files();
sfl = fl->sort_selection(sfl);
get_file_list (filename, sfl, gnome_cmd_file_get_name);
@@ -1065,7 +1065,7 @@
void command_open_nautilus (GtkMenuItem *menuitem, gpointer not_used)
{
- GnomeCmdFile *f = gnome_cmd_file_list_get_selected_file (get_fl (ACTIVE));
+ GnomeCmdFile *f = get_fl (ACTIVE)->get_selected_file();
open_uri_in_nautilus (gnome_cmd_file_get_uri_str (GNOME_CMD_IS_DIR (f) ? f : GNOME_CMD_FILE (get_fs (ACTIVE)->get_directory())));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]