[tracker/needle] tracker-needle: Added email support
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/needle] tracker-needle: Added email support
- Date: Tue, 26 Oct 2010 20:33:35 +0000 (UTC)
commit e367cd4e566c2c75d23b5560df5f9c41e27608c2
Author: Martyn Russell <martyn lanedo com>
Date: Tue Oct 26 21:33:01 2010 +0100
tracker-needle: Added email support
src/tracker-needle/Makefile.am | 4 ++--
src/tracker-needle/tracker-needle.vala | 8 +++++++-
src/tracker-needle/tracker-query.vala | 22 ++++++++++++++++++++++
3 files changed, 31 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-needle/Makefile.am b/src/tracker-needle/Makefile.am
index 65692e4..04a7629 100644
--- a/src/tracker-needle/Makefile.am
+++ b/src/tracker-needle/Makefile.am
@@ -27,8 +27,8 @@ tracker_needle_CFLAGS = \
-DTRACKER_UI_DIR=\"$(datadir)/tracker/\" \
-DLOCALEDIR=\""$(localedir)"\" \
-DSRCDIR=\"$(abs_srcdir)/\" \
- -I$(top_srcdir)/src/libtracker-sparql \
- -I$(top_builddir)/src/libtracker-sparql \
+ -I$(top_srcdir)/src \
+ -I$(top_builddir)/src \
$(WARN_CFLAGS) \
$(GCOV_CFLAGS) \
$(TRACKER_APPS_CFLAGS) \
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
index 1fd1d91..1cc5ded 100644
--- a/src/tracker-needle/tracker-needle.vala
+++ b/src/tracker-needle/tracker-needle.vala
@@ -355,7 +355,8 @@ public class Tracker.Needle {
Tracker.Query.Type.MUSIC,
Tracker.Query.Type.IMAGES,
Tracker.Query.Type.VIDEOS,
- Tracker.Query.Type.DOCUMENTS
+ Tracker.Query.Type.DOCUMENTS,
+ Tracker.Query.Type.MAIL
};
Tracker.Query query = new Tracker.Query ();
@@ -434,6 +435,11 @@ public class Tracker.Needle {
pixbuf_small = tracker_pixbuf_new_from_name (theme, "x-office-presentation", size_medium);
}
break;
+ case Tracker.Query.Type.MAIL:
+ if (count == 0) {
+ pixbuf_small = tracker_pixbuf_new_from_name (theme, "emblem-mail", size_medium);
+ }
+ break;
default:
break;
diff --git a/src/tracker-needle/tracker-query.vala b/src/tracker-needle/tracker-query.vala
index 59a2fac..2b6963d 100644
--- a/src/tracker-needle/tracker-query.vala
+++ b/src/tracker-needle/tracker-query.vala
@@ -181,6 +181,28 @@ public class Tracker.Query {
";
break;
+ case Type.MAIL:
+ string no_subject = _("No Subject");
+
+ query = @"
+ SELECT
+ ?urn
+ nie:url(?urn)
+ tracker:coalesce(nco:fullname(?sender), nco:nickname(?sender), \"Unknown\")
+ tracker:coalesce(nmo:messageSubject(?urn), \"$no_subject\")
+ nmo:receivedDate(?urn)
+ tracker:coalesce(nco:fullname(?to), nco:nickname(?to), \"Unknown\")
+ WHERE {
+ ?urn a nmo:Email ;
+ nmo:sender ?sender ;
+ nmo:to ?to ;
+ fts:match \"$criteria_escaped\" .
+ }
+ ORDER BY DESC(fts:rank(?urn)) ASC(nmo:messageSubject(?email)) ASC(nmo:receivedDate(?email))
+ OFFSET $offset LIMIT $limit
+ ";
+ break;
+
default:
assert_not_reached ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]