[polari/wip/kunaljain/polari-search: 18/18] sample tracker queries



commit 299db95fa8be5b1dfe867aa1636fa01bc04d9a83
Author: Kunaal Jain <kunaalus gmail com>
Date:   Thu Jun 9 02:02:36 2016 +0530

    sample tracker queries

 src/mainWindow.js |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index f48b9cb..82d546c 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -8,6 +8,7 @@ const Tp = imports.gi.TelepathyGLib;
 const AccountsMonitor = imports.accountsMonitor;
 const AppNotifications = imports.appNotifications;
 const ChatroomManager = imports.chatroomManager;
+const LogManager = imports.logManager;
 const JoinDialog = imports.joinDialog;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
@@ -222,6 +223,14 @@ const MainWindow = new Lang.Class({
                            GObject.BindingFlags.SYNC_CREATE |
                            GObject.BindingFlags.BIDIRECTIONAL);
         this._search_bar.connect_entry(this._search_entry);
+
+        //test
+        let logManager = LogManager.getDefault();
+        let query = "select ?text as ?mms where { ?msg a nmo:IMMessage; nie:plainTextContent ?text. ?msg 
nmo:communicationChannel ?channel. ?channel nie:title '#tracker'. ?msg nmo:from ?contact. ?contact 
nco:nickname 'bijan' . ?msg fts:match 'wonderful' }"
+        let query1 = "select ?nick as ?name ?text as ?mms where { ?msg a nmo:IMMessage; nie:plainTextContent 
?text. ?msg nmo:communicationChannel ?channel. ?channel nie:title '#tracker'. ?msg nmo:from ?contact. 
?contact nco:nickname ?nick }"
+        logManager.query(query1,null,Lang.bind(this, this._Log));
+        log("hello");
+        //test
         // search end
 
         let size = this._settings.get_value('window-size').deep_unpack();
@@ -234,6 +243,12 @@ const MainWindow = new Lang.Class({
         this.show_all();
     },
 
+    _Log: function(events) {
+        log(events);
+        for (let i = 0; i < events.length; i++)
+            log(events[i].mms);
+    },
+
     get subtitle() {
         return this._subtitle;
     },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]