[polari/wip/kunaaljain/squashed-branch] Removed dead code



commit c5598f8789bdc94fa213bde967ecdb6c7370f480
Author: Kunaal Jain <kunaalus gmail com>
Date:   Fri Aug 26 22:16:48 2016 +0530

    Removed dead code

 src/resultList.js |   19 --------------
 src/resultView.js |   72 +++--------------------------------------------------
 2 files changed, 4 insertions(+), 87 deletions(-)
---
diff --git a/src/resultList.js b/src/resultList.js
index c41e439..3d22ba3 100644
--- a/src/resultList.js
+++ b/src/resultList.js
@@ -37,19 +37,6 @@ const ResultRow = new Lang.Class({
         this.connect('key-press-event',
                      Lang.bind(this, this._onKeyPress));
 
-        // room.connect('notify::channel', Lang.bind(this,
-        //     function() {
-        //         if (!room.channel)
-        //             return;
-        //         room.channel.connect('message-received',
-        //                              Lang.bind(this, this._updatePending));
-        //         room.channel.connect('pending-message-removed',
-        //                              Lang.bind(this, this._updatePending));
-        //     }));
-        // room.bind_property('display-name', this._roomLabel, 'label',
-        //                    GObject.BindingFlags.SYNC_CREATE);
-        //
-        // this._updatePending();
     },
 
     _onButtonRelease: function(w, event) {
@@ -201,12 +188,6 @@ const ResultList = new Lang.Class({
             let uid = events[i].id;
             let row;
             row = this._widgetMap[uid];
-            for (let j = 0; j < this._keywords.length; j++) {
-                // log(this._keywords[j]);
-            //    index = Math.min(index, message.indexOf(this._keywords[j]));
-            //    message = message.replace( new RegExp( "(" + this._keywords[j] + ")" , 'gi' ),"<span 
font_weight='bold'>$1</span>");
-                // print(message);
-            }
 
             if (row) {
                 widgetMap[uid] = row;
diff --git a/src/resultView.js b/src/resultView.js
index 22be3ef..b717d4c 100644
--- a/src/resultView.js
+++ b/src/resultView.js
@@ -156,9 +156,6 @@ const ResultView = new Lang.Class({
         this._logManager = LogManager.getDefault();
         this._cancellable  = new Gio.Cancellable();
 
-        // this._keywords = keywordsText == '' ? [] : keywordsText.split(/\s+/);
-        // this._keyregExp = new RegExp( '(' + this._keywords.join('|')+ ')', 'gi');
-        // print(this._keyregExp);
         this._active = false;
         this._toplevelFocus = false;
         this._fetchingBacklog = false;
@@ -239,9 +236,7 @@ const ResultView = new Lang.Class({
             let obj = { top_query: null,
                         bottom_query: null,
                         rank: rank };
-            // print(this._resultsAvailable.push(obj));
-            // print(this._resultsAvailable.toString());
-            // print(this._resultsAvailable.splice(startIndex, 0, obj).toString());
+
             this._resultsAvailable.splice(startIndex + 1, 0, obj);
             print(this._resultsAvailable.length);
 
@@ -253,11 +248,7 @@ const ResultView = new Lang.Class({
             iter.backward_line();
             buffer.create_mark('view-end' + this._resultsAvailable[startIndex].rank, iter, false);
         }
-        // buffer.insert(iter, String(rank), -1);
-        // buffer.insert(iter, '\n', -1);
-        // if(exists)
-        //     buffer.move_mark_by_name('view-end'+rank, iter);
-        // else
+
         if(!exists)
             buffer.create_mark('view-end' + rank, iter, false);
 
@@ -324,27 +315,12 @@ const ResultView = new Lang.Class({
                  Tp.ChannelTextMessageType.NORMAL,
                  timestamp,
                  channel);
-        // let logManager = LogManager.getDefault();
-        // this._logWalker = logManager.walkEvents(row,
-        //                                         row.channel);
-        //
-        // this._fetchingBacklog = true;
-        // this._logWalker.getEvents(10,
-        //                           Lang.bind(this, this._onLogEventsReady));
-        // this._logManager.query(sparql,this._cancellable,Lang.bind(this, this._onLogEventsReady));
-        // this._logManager.query(sparql1,this._cancellable,Lang.bind(this, this._onLogEventsReady1));
-        // let buffer = this._view.get_buffer();
-        // let iter = buffer.get_end_iter();
-        // buffer.set_text("",-1);
+
         this._endQuery = new LogManager.GenericQuery(this._logManager._connection, 20);
         this._endQuery.run(sparql,this._cancellable,Lang.bind(this, this._onLogEventsReady1, rank));
         // log("!");
         this._startQuery = new LogManager.GenericQuery(this._logManager._connection, 20);
-        // Mainloop.timeout_add(500, Lang.bind(this,
-        //     function() {
-        //         query.run(sparql1,this._cancellable,Lang.bind(this, this._onLogEventsReady1));
-        //         return GLib.SOURCE_REMOVE;
-        //     }));
+
         this._startQuery.run(sparql1,this._cancellable,Lang.bind(this, this._onLogEventsReady, rank));
         for(let i = 0; i < this._resultsAvailable.length; i++) {
             if(this._resultsAvailable[i].rank == rank) {
@@ -354,16 +330,7 @@ const ResultView = new Lang.Class({
         }
         this._resultsAvailable[index].top_query = this._startQuery;
         this._resultsAvailable[index].bottom_query = this._endQuery;
-        //print(this._endQuery.isClosed());
 
-        // Mainloop.timeout_add(5000, Lang.bind(this,
-        //     function() {
-        //         query.next(200,this._cancellable,Lang.bind(this, this._onLogEventsReady1));
-        //     }));
-        // query.next(20,this._cancellable,Lang.bind(this, this._onLogEventsReady1));
-
-        //this._resultStack.buffer.insert(iter,row._content_label.label, -1);
-        // this._resultStack.label = row._content_label.label;
     },
 
     _createTags: function() {
@@ -498,21 +465,7 @@ const ResultView = new Lang.Class({
         // let index = -1;
         let nick = this._pendingLogs[0].sender;
         let type = this._pendingLogs[0].messageType;
-    /*    if (!this._query.isClosed()) {
-            for (let i = 0; i < this._pendingLogs.length; i++)
-                if (this._pendingLogs[i].sender != nick ||
-                    this._pendingLogs[i].messageType != type) {
-                    index = i;
-                    break;
-                }
-        } else {
-            index = 0;
-        }
 
-        if (index < 0)
-            return;*/
-            // index = 0;
-        // print(this._pendingLogs);
         let pending = this._pendingLogs.splice(0);
         // print(this._pendingLogs);
         // print(pending);
@@ -562,19 +515,7 @@ const ResultView = new Lang.Class({
         let index = -1;
         let nick = this._pendingLogs[0].sender;
         let type = this._pendingLogs[0].messageType;
-    /*    if (!this._query.isClosed()) {
-            for (let i = 0; i < this._pendingLogs.length; i++)
-                if (this._pendingLogs[i].sender != nick ||
-                    this._pendingLogs[i].messageType != type) {
-                    index = i;
-                    break;
-                }
-        } else {
-            index = 0;
-        }
 
-        if (index < 0)
-            return;*/
             index = 0;
         // print(this._pendingLogs);
         let pending = this._pendingLogs.splice(index);
@@ -675,12 +616,7 @@ const ResultView = new Lang.Class({
         // print(dx, dy);
         if (hasDeltas)
             this._fetchBacklog();
-        // if (dir == Gdk.ScrollDirection.UP )
-        //     print("UP");
-        // else if (dir == Gdk.ScrollDirection.DOWN)
-        //     print("DOWN");
 
-        //return this._fetchBacklog();
     },
 
     _onKeyPress: function(w, event) {


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