[gnome-commander] History: made internal class members private



commit eb2f810da8b6dc71d935675e6b4bcd0a25b8b4c0
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Sun Jun 27 12:36:20 2010 +0200

    History: made internal class members private

 src/gnome-cmd-file-selector.cc |    2 +-
 src/history.h                  |   13 +++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index 211a4ec..13ad358 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -484,7 +484,7 @@ static void on_list_con_changed (GnomeCmdFileList *fl, GnomeCmdCon *con, GnomeCm
 
 static void on_list_dir_changed (GnomeCmdFileList *fl, GnomeCmdDir *dir, GnomeCmdFileSelector *fs)
 {
-    if (fs->priv->dir_history && !fs->priv->dir_history->is_locked)
+    if (fs->priv->dir_history && !fs->priv->dir_history->locked())
     {
         gchar *fpath = gnome_cmd_file_get_path (GNOME_CMD_FILE (dir));
         fs->priv->dir_history->add(fpath);
diff --git a/src/history.h b/src/history.h
index 90e4fab..9f3b879 100644
--- a/src/history.h
+++ b/src/history.h
@@ -21,14 +21,17 @@
 #ifndef __HISTORY_H__
 #define __HISTORY_H__
 
-struct History
+class History
 {
-    GList *ents;
-    GList *pos;
     gint max;
     gboolean is_locked;
 
-    History(gint max): ents(NULL), pos(NULL), is_locked(FALSE)       {  this->max = max;  }
+  public:
+
+    GList *ents;
+    GList *pos;
+
+    History(gint max): is_locked(FALSE), ents(NULL), pos(NULL)       {  this->max = max;  }
     ~History();
 
     guint size()                                         {  return g_list_length (ents);  }
@@ -49,6 +52,8 @@ struct History
 
     void lock()                                             {  is_locked = TRUE;         }
     void unlock()                                           {  is_locked = FALSE;        }
+
+    gboolean locked() const                                 {  return is_locked;         }
 };
 
 #endif // __HISTORY_H__



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