[gnome-logs/wip/gl-journal: 4/5] 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/5] Handle matches in gl_journal_query()
- Date: Wed, 2 Oct 2013 20:50:25 +0000 (UTC)
commit 70192af029fd19da40feef0656eb43010cf91a93
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 6a48f9d..07481c0 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]