[gnome-logs/wip/gl-journal: 4/4] Handle matches in gl_journal_query()
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-logs/wip/gl-journal: 4/4] Handle matches in gl_journal_query()
- Date: Wed, 2 Oct 2013 19:45:38 +0000 (UTC)
commit 0f615f24cf79b68900e3318dbabfdc28030bf98a
Author: David King <davidk gnome org>
Date: Wed Oct 2 20:04:54 2013 +0100
Handle matches in gl_journal_query()
src/gl-journal.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/gl-journal.c b/src/gl-journal.c
index 9d3aae0..8be8020 100644
--- a/src/gl-journal.c
+++ b/src/gl-journal.c
@@ -138,8 +138,8 @@ gl_journal_query (GlJournal *self, const GlJournalQuery *query)
{
GlJournalPrivate *priv;
sd_journal *journal;
- gint ret;
gsize i;
+ gint ret;
GList *results = NULL;
g_return_val_if_fail (GL_JOURNAL (self), NULL);
@@ -148,6 +148,23 @@ gl_journal_query (GlJournal *self, const GlJournalQuery *query)
priv = gl_journal_get_instance_private (self);
journal = priv->journal;
+ if (query->matches)
+ {
+ const gchar *match;
+
+ for (i = 0, match = query->matches[i]; match;
+ match = query->matches[++i])
+ {
+ ret = sd_journal_add_match (journal, match, 0);
+
+ if (ret < 0)
+ {
+ g_warning ("Error adding match '%s': %s", match,
+ g_strerror (-ret));
+ }
+ }
+ }
+
ret = sd_journal_seek_tail (journal);
if (ret < 0)
@@ -158,7 +175,6 @@ gl_journal_query (GlJournal *self, const GlJournalQuery *query)
for (i = 0; i < query->n_results; i++)
{
- /* TODO: Handle matches. */
GlJournalResult *result;
const gchar *message;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]