[polari] joinDialog: Stop setting up name completion



commit 9041990f1f57d6b8afc266314f823b4c047efeaf
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Feb 16 19:38:36 2017 +0100

    joinDialog: Stop setting up name completion
    
    The room list is generally better suited for picking rooms than
    log history, which is why the completion is no longer hooked up
    to the entry - setting it up is therefore just a waste of resources,
    so stop doing that.

 data/resources/join-room-dialog.ui |   17 -----------------
 src/joinDialog.js                  |   23 -----------------------
 2 files changed, 0 insertions(+), 40 deletions(-)
---
diff --git a/data/resources/join-room-dialog.ui b/data/resources/join-room-dialog.ui
index 56791f8..5da39d5 100644
--- a/data/resources/join-room-dialog.ui
+++ b/data/resources/join-room-dialog.ui
@@ -1,22 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <object class="GtkListStore" id="liststore">
-    <columns>
-      <!-- column-name name -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
-  <object class="GtkEntryCompletion" id="nameCompletion">
-    <property name="model">liststore</property>
-    <property name="text-column">0</property>
-    <property name="inline-completion">True</property>
-    <child>
-      <object class="GtkCellRendererText"/>
-      <attributes>
-        <attribute name="text">0</attribute>
-      </attributes>
-    </child>
-  </object>
   <template class="Gjs_JoinDialog" parent="GtkDialog">
     <property name="title" translatable="yes">Join Chat Room</property>
     <property name="modal">True</property>
diff --git a/src/joinDialog.js b/src/joinDialog.js
index 6660f75..abc321e 100644
--- a/src/joinDialog.js
+++ b/src/joinDialog.js
@@ -3,7 +3,6 @@ const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
 const Gtk = imports.gi.Gtk;
 const Tp = imports.gi.TelepathyGLib;
-const Tpl = imports.gi.TelepathyLogger;
 const GObject = imports.gi.GObject;
 
 const AccountsMonitor = imports.accountsMonitor;
@@ -25,7 +24,6 @@ const JoinDialog = new Lang.Class({
                        'mainStack',
                        'connectionCombo',
                        'connectionButton',
-                       'nameCompletion',
                        'connectionStack',
                        'filterEntry',
                        'connectionsList',
@@ -172,32 +170,11 @@ const JoinDialog = new Lang.Class({
 
     _onAccountChanged: function() {
         this._nameEntry.set_text('');
-        this._nameCompletion.model.clear();
 
         let selected = this._connectionCombo.get_active_text();
         let account = this._accounts[selected];
         if (!account)
             return;
-        let logManager = Tpl.LogManager.dup_singleton();
-
-        logManager.get_entities_async(account, Lang.bind(this,
-            function(m, res) {
-                let [, entities] = logManager.get_entities_finish(res);
-                let names = entities.filter(function(e) {
-                    return e.type == Tpl.EntityType.ROOM;
-                }).map(function(e) {
-                    return e.alias;
-                });
-                for (let i = 0; i < names.length; i++) {
-                    let model = this._nameCompletion.model;
-                    let iter = model.append();
-                    model.set_value(iter, 0, names[i]);
-                    if (names[i].startsWith('#')) {
-                        iter = model.append();
-                        model.set_value(iter, 0, names[i].substr(1));
-                    }
-                }
-            }));
 
        this._serverRoomList.setAccount(account);
     },


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