gnome-commander r2098 - in trunk: . src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r2098 - in trunk: . src
- Date: Tue, 23 Sep 2008 16:51:48 +0000 (UTC)
Author: epiotr
Date: Tue Sep 23 16:51:47 2008
New Revision: 2098
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2098&view=rev
Log:
file_is_in_list(GnomeCmdFileSelector *fs, GnomeCmdFile *f) -> GnomeCmdFileList::has_file(const GnomeCmdFile *f)
Modified:
trunk/ChangeLog
trunk/src/gnome-cmd-file-list.cc
trunk/src/gnome-cmd-file-list.h
trunk/src/gnome-cmd-file-selector.cc
Modified: trunk/src/gnome-cmd-file-list.cc
==============================================================================
--- trunk/src/gnome-cmd-file-list.cc (original)
+++ trunk/src/gnome-cmd-file-list.cc Tue Sep 23 16:51:47 2008
@@ -1495,19 +1495,19 @@
}
-void gnome_cmd_file_list_update_file (GnomeCmdFileList *fl, GnomeCmdFile *finfo)
+void GnomeCmdFileList::update_file(GnomeCmdFile *f)
{
- if (!gnome_cmd_file_needs_update (finfo))
+ if (!gnome_cmd_file_needs_update (f))
return;
- gint row = get_row_from_file (fl, finfo);
+ gint row = get_row_from_file (this, f);
if (row == -1)
return;
- FileFormatData data(finfo, FALSE);
+ FileFormatData data(f, FALSE);
for (gint i=1; i<GnomeCmdFileList::NUM_COLUMNS; i++)
- gtk_clist_set_text (*fl, row, i, data.text[i]);
+ gtk_clist_set_text (*this, row, i, data.text[i]);
}
Modified: trunk/src/gnome-cmd-file-list.h
==============================================================================
--- trunk/src/gnome-cmd-file-list.h (original)
+++ trunk/src/gnome-cmd-file-list.h Tue Sep 23 16:51:47 2008
@@ -85,6 +85,8 @@
void remove_files(GList *files);
void remove_all_files() { clear(); }
+ gboolean has_file(const GnomeCmdFile *f);
+
void select_all();
void unselect_all();
@@ -114,6 +116,7 @@
gboolean file_is_wanted(GnomeCmdFile *f);
+ void update_file(GnomeCmdFile *f);
void show_files(GnomeCmdDir *dir);
void show_column(ColumnID col, gboolean value) { gtk_clist_set_column_visibility (GTK_CLIST (this), col, value); }
@@ -163,6 +166,11 @@
remove_file((GnomeCmdFile *) files->data);
}
+inline gboolean GnomeCmdFileList::has_file(const GnomeCmdFile *f)
+{
+ g_list_index (get_visible_files(), f) != -1;
+}
+
inline GnomeCmdFile *GnomeCmdFileList::get_selected_file()
{
GnomeCmdFile *f = get_focused_file();
@@ -170,9 +178,6 @@
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);
-
void gnome_cmd_file_list_show_dir_size (GnomeCmdFileList *fl, GnomeCmdFile *finfo);
void gnome_cmd_file_list_focus_file (GnomeCmdFileList *fl, const gchar *focus_file, gboolean scroll_to_file);
Modified: trunk/src/gnome-cmd-file-selector.cc
==============================================================================
--- trunk/src/gnome-cmd-file-selector.cc (original)
+++ trunk/src/gnome-cmd-file-selector.cc Tue Sep 23 16:51:47 2008
@@ -739,12 +739,6 @@
}
-inline gboolean file_is_in_list (GnomeCmdFileSelector *fs, GnomeCmdFile *f)
-{
- return g_list_index (fs->file_list()->get_visible_files(), f) != -1;
-}
-
-
inline void add_file_to_cmdline (GnomeCmdFileSelector *fs, gboolean fullpath)
{
g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
@@ -809,7 +803,7 @@
g_return_if_fail (GNOME_CMD_IS_FILE (f));
g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
- if (fs->priv->cwd == dir && file_is_in_list (fs, f))
+ if (fs->priv->cwd == dir && fs->file_list()->has_file(f))
{
fs->file_list()->remove_file(f);
update_selected_files_label (fs);
@@ -823,10 +817,10 @@
g_return_if_fail (GNOME_CMD_IS_FILE (f));
g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
- if (file_is_in_list (fs, f))
+ if (fs->file_list()->has_file(f))
{
- gnome_cmd_file_invalidate_metadata (f); // FIXME: should be hadled in GnomeCmdDir, not here
- gnome_cmd_file_list_update_file (fs->file_list(), f);
+ gnome_cmd_file_invalidate_metadata (f); // FIXME: should be handled in GnomeCmdDir, not here
+ fs->file_list()->update_file(f);
update_selected_files_label (fs);
}
}
@@ -838,10 +832,10 @@
g_return_if_fail (GNOME_CMD_IS_FILE (f));
g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
- if (file_is_in_list (fs, f))
+ if (fs->file_list()->has_file(f))
{
- // gnome_cmd_file_invalidate_metadata (f, TAG_FILE); // FIXME: should be hadled in GnomeCmdDir, not here
- gnome_cmd_file_list_update_file (fs->file_list(), f);
+ // gnome_cmd_file_invalidate_metadata (f, TAG_FILE); // FIXME: should be handled in GnomeCmdDir, not here
+ fs->file_list()->update_file(f);
GnomeCmdFileList::ColumnID sort_col = GNOME_CMD_FILE_LIST (fs->file_list())->get_sort_column();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]