gnome-commander r2049 - in trunk: . src



Author: epiotr
Date: Fri Sep  5 17:18:36 2008
New Revision: 2049
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2049&view=rev

Log:
GnomeCmdFileCollection: get_all_files() -> get_visible_files()

Modified:
   trunk/ChangeLog
   trunk/src/gnome-cmd-file-list.cc
   trunk/src/gnome-cmd-file-list.h
   trunk/src/gnome-cmd-file-selector.cc
   trunk/src/gnome-cmd-main-win.cc
   trunk/src/gnome-cmd-quicksearch-popup.cc

Modified: trunk/src/gnome-cmd-file-list.cc
==============================================================================
--- trunk/src/gnome-cmd-file-list.cc	(original)
+++ trunk/src/gnome-cmd-file-list.cc	Fri Sep  5 17:18:36 2008
@@ -118,7 +118,7 @@
     GtkWidget *popup_menu;
 
     gint cur_file;
-    GnomeCmdFileCollection shown_files;
+    GnomeCmdFileCollection visible_files;
     GList *selected_files;                         // contains GnomeCmdFile pointers
 
     GCompareDataFunc sort_func;
@@ -408,7 +408,7 @@
     if (row == -1)
         return;
 
-    if (row < fl->priv->shown_files.size())
+    if (row < fl->priv->visible_files.size())
         if (g_list_index (fl->priv->selected_files, finfo) == -1)
             select_file (fl, finfo);
         else
@@ -484,7 +484,7 @@
     const gchar *ext1 = gnome_cmd_file_get_extension (f);
     if (!ext1) return;
 
-    for (GList *tmp=fl->get_all_files(); tmp; tmp=tmp->next)
+    for (GList *tmp=fl->get_visible_files(); tmp; tmp=tmp->next)
     {
         GnomeCmdFile *finfo = (GnomeCmdFile *) tmp->data;
 
@@ -510,7 +510,7 @@
 
     Filter filter(pattern, case_sens, gnome_cmd_data_get_filter_type ());
 
-    for (GList *tmp=fl->get_all_files(); tmp; tmp=tmp->next)
+    for (GList *tmp=fl->get_visible_files(); tmp; tmp=tmp->next)
     {
         GnomeCmdFile *finfo = (GnomeCmdFile *) tmp->data;
 
@@ -1437,7 +1437,7 @@
 ******************************************************************************/
 void GnomeCmdFileList::append_file (GnomeCmdFile *f)
 {
-    priv->shown_files.add(f);
+    priv->visible_files.add(f);
     add_file_to_clist (this, f, -1);
 }
 
@@ -1493,7 +1493,7 @@
         GnomeCmdFile *f2 = get_file_at_row (this, i);
         if (priv->sort_func (f2, f, this) == 1)
         {
-            priv->shown_files.add(f);
+            priv->visible_files.add(f);
             add_file_to_clist (this, f, i);
 
             if (i<=priv->cur_file)
@@ -1551,7 +1551,7 @@
         gtk_clist_remove (GTK_CLIST (this), row);
 
         priv->selected_files = g_list_remove (priv->selected_files, f);
-        priv->shown_files.remove(f);
+        priv->visible_files.remove(f);
 
         focus_file_at_row (this, MIN (row, GTK_CLIST (this)->focus_row));
     }
@@ -1562,7 +1562,7 @@
 {
     g_return_if_fail (uri_str != NULL);
 
-    GnomeCmdFile *f = priv->shown_files.find(uri_str);
+    GnomeCmdFile *f = priv->visible_files.find(uri_str);
     g_return_if_fail (GNOME_CMD_IS_FILE (f));
 
     remove_file (f);
@@ -1572,7 +1572,7 @@
 void GnomeCmdFileList::clear()
 {
     gtk_clist_clear (GTK_CLIST (this));
-    priv->shown_files.clear();
+    priv->visible_files.clear();
     gnome_cmd_file_list_free (priv->selected_files);
     priv->selected_files = NULL;
 }
@@ -1595,9 +1595,9 @@
 }
 
 
-GList *GnomeCmdFileList::get_all_files()
+GList *GnomeCmdFileList::get_visible_files()
 {
-    return priv->shown_files.get_list();
+    return priv->visible_files.get_list();
 }
 
 
@@ -1618,7 +1618,7 @@
     gnome_cmd_file_list_free (priv->selected_files);
     priv->selected_files = NULL;
 
-    for (GList *tmp = get_all_files(); tmp; tmp = tmp->next)
+    for (GList *tmp = get_visible_files(); tmp; tmp = tmp->next)
         select_file (this, (GnomeCmdFile *) tmp->data);
 }
 
@@ -1662,7 +1662,7 @@
 {
     g_return_if_fail (GNOME_CMD_IS_FILE_LIST (fl));
 
-    for (GList *tmp = fl->get_all_files(); tmp; tmp = tmp->next)
+    for (GList *tmp = fl->get_visible_files(); tmp; tmp = tmp->next)
     {
         GnomeCmdFile *finfo = (GnomeCmdFile *) tmp->data;
 
@@ -1714,7 +1714,7 @@
 
     GList *sel = g_list_copy (fl->priv->selected_files);
 
-    for (GList *tmp=fl->get_all_files(); tmp; tmp = tmp->next)
+    for (GList *tmp=fl->get_visible_files(); tmp; tmp = tmp->next)
     {
         GnomeCmdFile *finfo = (GnomeCmdFile *) tmp->data;
 
@@ -1761,7 +1761,7 @@
     fl1->unselect_all();
     fl2->select_all();
 
-    for (GList *i=fl1->get_all_files(); i; i=i->next)
+    for (GList *i=fl1->get_visible_files(); i; i=i->next)
     {
         GnomeCmdFile *f1 = (GnomeCmdFile *) i->data;
         GnomeCmdFile *f2;
@@ -1807,7 +1807,7 @@
     gtk_clist_clear (GTK_CLIST (this));
 
     // resort the files and readd them to the list
-    for (GList *list = priv->shown_files.sort(priv->sort_func, this); list; list = list->next)
+    for (GList *list = priv->visible_files.sort(priv->sort_func, this); list; list = list->next)
         add_file_to_clist (this, GNOME_CMD_FILE (list->data), -1);
 
     // refocus the previously selected file if this file-list has the focus
@@ -2236,7 +2236,7 @@
 
 void GnomeCmdFileList::invalidate_tree_size()
 {
-    GList *all_files = get_all_files();
+    GList *all_files = get_visible_files();
 
     for (GList *tmp = all_files; tmp; tmp = tmp->next)
     {

Modified: trunk/src/gnome-cmd-file-list.h
==============================================================================
--- trunk/src/gnome-cmd-file-list.h	(original)
+++ trunk/src/gnome-cmd-file-list.h	Fri Sep  5 17:18:36 2008
@@ -74,8 +74,8 @@
 
     int size();
     bool empty();
-    // int size()                          {  return g_list_length (all_files());  }
-    // bool empty()                        {  return all_files()==NULL;            }    // FIXME should be: size()==0
+    // int size()                          {  return g_list_length (get_visible_files());  }
+    // bool empty()                        {  return get_visible_files()==NULL;            }    // FIXME should be: size()==0
     void clear();
 
     void append_file(GnomeCmdFile *f);
@@ -96,7 +96,7 @@
     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_visible_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
@@ -136,12 +136,12 @@
 
 inline int GnomeCmdFileList::size()
 {
-    return g_list_length (get_all_files());
+    return g_list_length (get_visible_files());
 }
 
 inline bool GnomeCmdFileList::empty()
 {
-    return get_all_files()==NULL;
+    return get_visible_files()==NULL;
 }
 
 inline void GnomeCmdFileList::remove_files (GList *files)

Modified: trunk/src/gnome-cmd-file-selector.cc
==============================================================================
--- trunk/src/gnome-cmd-file-selector.cc	(original)
+++ trunk/src/gnome-cmd-file-selector.cc	Fri Sep  5 17:18:36 2008
@@ -161,7 +161,7 @@
 {
     g_return_if_fail (GNOME_CMD_IS_FILE_SELECTOR (fs));
 
-    GList *all_files = fs->file_list()->get_all_files();
+    GList *all_files = fs->file_list()->get_visible_files();
 
     if (!all_files)
         return;
@@ -255,7 +255,7 @@
 
     fs->file_list()->invalidate_tree_size();
 
-    for (GList *files = fs->file_list()->get_all_files(); files; files = files->next)
+    for (GList *files = fs->file_list()->get_visible_files(); files; files = files->next)
         gnome_cmd_file_list_show_dir_size (fs->file_list(), (GnomeCmdFile *) files->data);
 
     update_selected_files_label (fs);
@@ -825,7 +825,7 @@
 
 inline gboolean file_is_in_list (GnomeCmdFileSelector *fs, GnomeCmdFile *f)
 {
-    return g_list_index (fs->file_list()->get_all_files(), f) != -1;
+    return g_list_index (fs->file_list()->get_visible_files(), f) != -1;
 }
 
 

Modified: trunk/src/gnome-cmd-main-win.cc
==============================================================================
--- trunk/src/gnome-cmd-main-win.cc	(original)
+++ trunk/src/gnome-cmd-main-win.cc	Fri Sep  5 17:18:36 2008
@@ -1310,8 +1310,8 @@
     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 = fs1->file_list()->get_all_files();
-    state->inactive_dir_files = fs2->file_list()->get_all_files();
+    state->active_dir_files = fs1->file_list()->get_visible_files();
+    state->inactive_dir_files = fs2->file_list()->get_visible_files();
     state->active_dir_selected_files = fs1->file_list()->get_selected_files();
     state->inactive_dir_selected_files = fs2->file_list()->get_selected_files();
 

Modified: trunk/src/gnome-cmd-quicksearch-popup.cc
==============================================================================
--- trunk/src/gnome-cmd-quicksearch-popup.cc	(original)
+++ trunk/src/gnome-cmd-quicksearch-popup.cc	Fri Sep  5 17:18:36 2008
@@ -71,7 +71,7 @@
         popup->priv->matches = NULL;
     }
 
-    for (GList *files = popup->priv->fl->get_all_files(); files; files = files->next)
+    for (GList *files = popup->priv->fl->get_visible_files(); files; files = files->next)
     {
         GnomeCmdFile *finfo = (GnomeCmdFile *) files->data;
         gint res;



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