f-spot r4395 - in trunk: . src
- From: rubenv svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r4395 - in trunk: . src
- Date: Wed, 17 Sep 2008 11:47:39 +0000 (UTC)
Author: rubenv
Date: Wed Sep 17 11:47:39 2008
New Revision: 4395
URL: http://svn.gnome.org/viewvc/f-spot?rev=4395&view=rev
Log:
2008-09-17 Ruben Vermeersch <ruben savanne be>
* src/TagSelectionWidget.cs: Fix a Preferences.Get is obsolete warning,
small cleanups in the process. Number of warnings down to 36.
Modified:
trunk/ChangeLog
trunk/src/TagSelectionWidget.cs
Modified: trunk/src/TagSelectionWidget.cs
==============================================================================
--- trunk/src/TagSelectionWidget.cs (original)
+++ trunk/src/TagSelectionWidget.cs Wed Sep 17 11:47:39 2008
@@ -387,27 +387,23 @@
void ExpandDefaults ()
{
- object val = FSpot.Preferences.Get (FSpot.Preferences.EXPANDED_TAGS);
-
- if (val == null)
+ int [] tags = FSpot.Preferences.Get<int []> (FSpot.Preferences.EXPANDED_TAGS);
+ if (tags == null) {
ExpandAll ();
- else {
- TreeIter [] iters = ModelIters ();
- if (iters == null || iters.Length == 0)
- return;
-
- ArrayList expanded_tags = new ArrayList (val as int[]);
- if (expanded_tags.Count < 1)
- return;
+ return;
+ }
- foreach (TreeIter iter in iters)
- {
- GLib.Value v = new GLib.Value ();
- Model.GetValue (iter, IdColumn, ref v);
- int tag_id = (int)(uint) v;
- if (expanded_tags.Contains (tag_id)) {
- ExpandRow (Model.GetPath (iter), false);
- }
+ TreeIter [] iters = ModelIters ();
+ if (iters == null || iters.Length == 0 || tags.Length == 0)
+ return;
+
+ foreach (TreeIter iter in iters)
+ {
+ GLib.Value v = new GLib.Value ();
+ Model.GetValue (iter, IdColumn, ref v);
+ int tag_id = (int)(uint) v;
+ if (Array.IndexOf (tags, tag_id) > -1) {
+ ExpandRow (Model.GetPath (iter), false);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]