beagle r4802 - trunk/beagle/search/Beagle.Search.Tiles
- From: dbera svn gnome org
- To: svn-commits-list gnome org
- Subject: beagle r4802 - trunk/beagle/search/Beagle.Search.Tiles
- Date: Fri, 4 Jul 2008 22:46:52 +0000 (UTC)
Author: dbera
Date: Fri Jul 4 22:46:52 2008
New Revision: 4802
URL: http://svn.gnome.org/viewvc/beagle?rev=4802&view=rev
Log:
Some more cleanup of the last changes. Display the correct information for ArchivedFiles and Files. Remove the unnecessary GetTitle(hit, true) since it was redundant.
Modified:
trunk/beagle/search/Beagle.Search.Tiles/ArchivedFile.cs
trunk/beagle/search/Beagle.Search.Tiles/File.cs
trunk/beagle/search/Beagle.Search.Tiles/TextDocument.cs
Modified: trunk/beagle/search/Beagle.Search.Tiles/ArchivedFile.cs
==============================================================================
--- trunk/beagle/search/Beagle.Search.Tiles/ArchivedFile.cs (original)
+++ trunk/beagle/search/Beagle.Search.Tiles/ArchivedFile.cs Fri Jul 4 22:46:52 2008
@@ -37,7 +37,7 @@
public TileArchivedFile (Beagle.Hit hit, Beagle.Query query) : base (hit, query)
{
- Description = String.Format (Catalog.GetString ("Inside archive {0}"), GetTitle (hit, true));
+ Description = String.Format (Catalog.GetString ("Inside archive {0}"), Utils.GetFirstPropertyOfParent (hit, "beagle:ExactFilename"));
}
protected override void LoadIcon (Gtk.Image image, int size)
@@ -74,8 +74,12 @@
{
DetailsPane details = new DetailsPane ();
- details.AddLabelPair (Catalog.GetString ("Title:"), GetTitle (Hit));
- details.AddLabelPair (Catalog.GetString ("File Name:"), Hit.Uri.Fragment.Substring (1)); // Substring to move past the initial #
+ details.AddLabelPair (Catalog.GetString ("File:"), Hit.GetFirstProperty ("beagle:ExactFilename"));
+
+ string title = Hit.GetFirstProperty ("dc:title");
+ if (! String.IsNullOrEmpty (title))
+ details.AddLabelPair (Catalog.GetString ("Title:"), title);
+
details.AddLabelPair (Catalog.GetString ("Inside File:"), Hit.Uri.LocalPath);
if (Hit ["dc:author"] != null)
Modified: trunk/beagle/search/Beagle.Search.Tiles/File.cs
==============================================================================
--- trunk/beagle/search/Beagle.Search.Tiles/File.cs (original)
+++ trunk/beagle/search/Beagle.Search.Tiles/File.cs Fri Jul 4 22:46:52 2008
@@ -83,28 +83,16 @@
image.Pixbuf = icon;
}
- protected static string GetTitle (Beagle.Hit hit, bool get_parent)
+ protected static string GetTitle (Beagle.Hit hit)
{
string title;
- if (get_parent)
- title = Utils.GetFirstPropertyOfParent (hit, "dc:title");
- else
- title = hit.GetFirstProperty ("dc:title");
-
- if (title == null || title == "") {
- if (get_parent)
- title = Utils.GetFirstPropertyOfParent (hit, "beagle:ExactFilename");
- else
- title = hit.GetFirstProperty ("beagle:ExactFilename");
- }
+ title = hit.GetFirstProperty ("dc:title");
- return title;
- }
+ if (! String.IsNullOrEmpty (title))
+ title = hit.GetFirstProperty ("beagle:ExactFilename");
- protected static string GetTitle (Beagle.Hit hit)
- {
- return GetTitle (hit, false);
+ return title;
}
public override void Open ()
@@ -173,9 +161,9 @@
{
DetailsPane details = new DetailsPane ();
- details.AddLabelPair (Catalog.GetString ("File:"), hit.GetFirstProperty ("beagle:ExactFilename"));
+ details.AddLabelPair (Catalog.GetString ("File:"), Hit.GetFirstProperty ("beagle:ExactFilename"));
- string title = hit.GetFirstProperty ("dc:title");
+ string title = Hit.GetFirstProperty ("dc:title");
if (! String.IsNullOrEmpty (title))
details.AddLabelPair (Catalog.GetString ("Title:"), title);
Modified: trunk/beagle/search/Beagle.Search.Tiles/TextDocument.cs
==============================================================================
--- trunk/beagle/search/Beagle.Search.Tiles/TextDocument.cs (original)
+++ trunk/beagle/search/Beagle.Search.Tiles/TextDocument.cs Fri Jul 4 22:46:52 2008
@@ -38,20 +38,9 @@
Description = String.Format (Catalog.GetPluralString ("{0} page", "{0} pages", count), count);
}
- }
-
- // These files generally have a default title or an auto-generated title.
- // So use the filename for these types of files.
- protected static string GetTitle (Beagle.Hit hit, bool get_parent)
- {
- string title;
-
- if (get_parent)
- title = Utils.GetFirstPropertyOfParent (hit, "beagle:ExactFilename");
- else
- title = hit.GetFirstProperty ("beagle:ExactFilename");
-
- return title;
+ // These files generally have a default title or an auto-generated title.
+ // So use the filename for these types of files.
+ Title = hit.GetFirstProperty ("beagle:ExactFilename");
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]