gnome-commander r2303 - in branches/gcmd-1-3: . src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r2303 - in branches/gcmd-1-3: . src
- Date: Sat, 22 Nov 2008 16:54:27 +0000 (UTC)
Author: epiotr
Date: Sat Nov 22 16:54:27 2008
New Revision: 2303
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2303&view=rev
Log:
Add History::front() and History::reverse() functions
Modified:
branches/gcmd-1-3/ChangeLog
branches/gcmd-1-3/src/gnome-cmd-advrename-dialog.cc
branches/gcmd-1-3/src/history.h
Modified: branches/gcmd-1-3/src/gnome-cmd-advrename-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-advrename-dialog.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-advrename-dialog.cc Sat Nov 22 16:54:27 2008
@@ -1432,11 +1432,7 @@
for (GList *i=defaults.templates.ents; i; i=i->next)
gtk_combo_box_append_text (GTK_COMBO_BOX (priv->template_combo), (const gchar *) i->data);
- if (defaults.templates.ents)
- gtk_entry_set_text (GTK_ENTRY (priv->template_entry), (const gchar *) defaults.templates.ents->data);
- else
- gtk_entry_set_text (GTK_ENTRY (priv->template_entry), "$N");
-
+ gtk_entry_set_text (GTK_ENTRY (priv->template_entry), defaults.templates.empty() ? "$N" : defaults.templates.front());
gtk_editable_set_position (GTK_EDITABLE (priv->template_entry), -1);
gtk_widget_grab_focus (priv->template_entry);
gtk_entry_select_region (GTK_ENTRY (priv->template_entry), -1, -1);
Modified: branches/gcmd-1-3/src/history.h
==============================================================================
--- branches/gcmd-1-3/src/history.h (original)
+++ branches/gcmd-1-3/src/history.h Sat Nov 22 16:54:27 2008
@@ -28,24 +28,27 @@
gint max;
gboolean is_locked;
- History(gint max): ents(NULL), pos(NULL), is_locked(FALSE) { this->max = max; }
+ History(gint max): ents(NULL), pos(NULL), is_locked(FALSE) { this->max = max; }
~History();
- guint size() { return g_list_length (ents); }
- gboolean empty() { return ents==NULL; }
+ guint size() { return g_list_length (ents); }
+ gboolean empty() { return ents==NULL; }
+
+ const gchar *front() { return empty() ? NULL : (const gchar *) ents->data; }
void add(const gchar *text);
+ void reverse() { pos = ents = g_list_reverse (ents); }
- gboolean can_back() { return pos && pos->next; }
- gboolean can_forward() { return pos && pos->prev; }
+ gboolean can_back() { return pos && pos->next; }
+ gboolean can_forward() { return pos && pos->prev; }
const gchar *first();
const gchar *back();
const gchar *forward();
const gchar *last();
- void lock() { is_locked = TRUE; }
- void unlock() { is_locked = FALSE; }
+ void lock() { is_locked = TRUE; }
+ void unlock() { is_locked = FALSE; }
};
#endif // __HISTORY_H__
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]