Bug 247072 - Nick list takes long time to show with "show hostmasks" turned on
Summary: Nick list takes long time to show with "show hostmasks" turned on
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: 1.3.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-08 17:10 UTC by DrSlony
Modified: 2010-08-09 15:00 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DrSlony 2010-08-08 17:10:33 UTC
Version:           1.3.1 (using KDE 4.4.5) 
OS:                Linux

The nick list takes a very long time (over 5 seconds on #Openoffice.org with 52 nicks in there) to show when "Show hostmasks in nickname list" is turned on.

Reproducible: Always

Steps to Reproduce:
1- Go to Settings > Configure Konversation > Interface > Chat Window and tick "Show hostmasks in nickname list.
2- Join a channel with more than a few people in it.

Actual Results:  
You wait for quite a few seconds before you see anything in the nick list.

Expected Results:  
The nick list should show instantly all the nicks in the channel, with the hostmasks being appended to the nicks as the results come in.
Comment 1 Peter Simonsson 2010-08-09 15:00:35 UTC
commit aeb686f9aa3f908fcc17020ac495b71a907e0d01
Author: Peter Simonsson <peter.simonsson@gmail.com>
Date:   Mon Aug 9 14:59:40 2010 +0200

    Fix slowness of showing nicks in nicklist when hostmasks is shown.
    BUG:247072

diff --git a/src/irc/channel.cpp b/src/irc/channel.cpp
index 9b8d332..85b8c9d 100644
--- a/src/irc/channel.cpp
+++ b/src/irc/channel.cpp
@@ -300,9 +300,6 @@ Channel::Channel(QWidget* parent, QString _name) : ChatWindow(parent)
 
     connect(&userhostTimer,SIGNAL (timeout()),this,SLOT (autoUserhost()));
 
-    // every few seconds try to get more userhosts
-    userhostTimer.start(10000);
-
     m_whoTimer.setSingleShot(true);
     connect(&m_whoTimer,SIGNAL (timeout()),this,SLOT (autoWho()));
 
@@ -2556,12 +2553,10 @@ void Channel::autoUserhost()
         if(!nickString.isEmpty()) m_server->requestUserhost(nickString);
     }
 
-    // Resize columns if needed (on regular basis)
-    if (m_nicknameListViewTextChanged & (1 << Nick::NicknameColumn))
-        nicknameListView->resizeColumnToContents(Nick::NicknameColumn);
-    if (m_nicknameListViewTextChanged & (1 << Nick::HostmaskColumn))
-        nicknameListView->resizeColumnToContents(Nick::HostmaskColumn);
-    m_nicknameListViewTextChanged = 0;
+    if(!nicknameList.isEmpty())
+    {
+        resizeNicknameListViewColumns();
+    }
 }
 
 void Channel::setAutoUserhost(bool state)
@@ -2772,6 +2767,9 @@ void Channel::processPendingNicks()
         m_processingTimer->stop();
         sortNickList();
         nicknameListView->setUpdatesEnabled(true);
+
+        if (Preferences::self()->autoUserhost())
+            resizeNicknameListViewColumns();
     }
 }
 
@@ -3007,6 +3005,17 @@ void Channel::updateChannelNicks(const QString& channel)
     }
 }
 
+void Channel::resizeNicknameListViewColumns()
+{
+    // Resize columns if needed (on regular basis)
+    if (m_nicknameListViewTextChanged & (1 << Nick::NicknameColumn))
+        nicknameListView->resizeColumnToContents(Nick::NicknameColumn);
+    if (m_nicknameListViewTextChanged & (1 << Nick::HostmaskColumn))
+        nicknameListView->resizeColumnToContents(Nick::HostmaskColumn);
+    m_nicknameListViewTextChanged = 0;
+}
+
+
 //
 // NickList
 //
diff --git a/src/irc/channel.h b/src/irc/channel.h
index 967cca7..25ca6fc 100644
--- a/src/irc/channel.h
+++ b/src/irc/channel.h
@@ -147,6 +147,8 @@ class Channel : public ChatWindow
         void adjustOps(int value);
         virtual void emitUpdateInfo();
 
+        void resizeNicknameListViewColumns();
+
     protected slots:
         void purgeNicks();
         void processPendingNicks();