[shotwell] Allow searching for event comments: Closes bgo#723749
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] Allow searching for event comments: Closes bgo#723749
- Date: Tue, 4 Mar 2014 21:51:38 +0000 (UTC)
commit 18c905aff93fadbf2c7b2354f4543c1cc3124d21
Author: Brian Masney <masneyb onstation org>
Date: Tue Mar 4 13:51:15 2014 -0800
Allow searching for event comments: Closes bgo#723749
THANKS | 1 +
src/Event.vala | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/THANKS b/THANKS
index c609bc5..e9d1c9a 100644
--- a/THANKS
+++ b/THANKS
@@ -42,6 +42,7 @@ Dominique Leuenberger <dimstar opensuse org>
Dominic Lloyd <dwlloyd telus net>
Tobias Lott <tobias lott eu org>
Gavrilov Maksim <ulltor gmail com>
+Brian Masney <masneyb onstation org>
mcben <mcbennn gmail com>
Trevor Mehard <mehardtj g cofc edu>
mnemo <mnemo minimum se>
diff --git a/src/Event.vala b/src/Event.vala
index bc7dcd7..ce7c97a 100644
--- a/src/Event.vala
+++ b/src/Event.vala
@@ -570,7 +570,23 @@ public class Event : EventSource, ContainerSource, Proxyable, Indexable {
}
private void update_indexable_keywords() {
- indexable_keywords = prepare_indexable_string(get_raw_name());
+ string[] components = new string[3];
+ int i = 0;
+
+ string? rawname = get_raw_name();
+ if (rawname != null)
+ components[i++] = rawname;
+
+ string? comment = get_comment();
+ if (comment != null)
+ components[i++] = comment;
+
+ if (i == 0)
+ indexable_keywords = null;
+ else {
+ components[i] = null;
+ indexable_keywords = prepare_indexable_string(string.joinv(" ", components));
+ }
}
public unowned string? get_indexable_keywords() {
@@ -788,6 +804,7 @@ public class Event : EventSource, ContainerSource, Proxyable, Indexable {
bool committed = event_table.set_comment(event_id, new_comment);
if (committed) {
this.comment = new_comment;
+ update_indexable_keywords();
notify_altered(new Alteration.from_list("metadata:comment, indexable:keywords"));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]