Fixed a bug that did not remove users from channel nick list.
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 25 Oct 2006 17:13:48 +0000 (17:13 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 25 Oct 2006 17:13:48 +0000 (17:13 +0000)
gui/channelwidget.cpp
gui/channelwidget.ui
network/server.cpp

index 17e85e7..0987936 100644 (file)
@@ -110,7 +110,7 @@ void ChannelWidget::recvMessage(Message msg) {
       "<td width=50><div style=\"color:%2;\">[%1]</div></td>")
       .arg(msg.timeStamp.toLocalTime().toString("hh:mm:ss")).arg("darkblue");
   if(!n.isEmpty())
-    html += QString("<td width=100><div align=right style=\"white-space:nowrap;margin-left:6px;color:%2;\">%1</div></td>")
+    html += QString("<td width=150><div align=right style=\"white-space:pre;margin-left:6px;color:%2;\">%1</div></td>")
         .arg(n).arg("mediumseagreen");
   html += QString("<td><div style=\"margin-left:6px;color:%2;\">%1</div></td>""</tr></table>")
       .arg(s).arg(c);
@@ -160,7 +160,7 @@ void ChannelWidget::renameNick(QString oldnick, QString newnick) {
 }
 
 void ChannelWidget::removeNick(QString nick) {
-  nicks[nick].toMap().remove(nick);
+  nicks.remove(nick);
   updateNickList();
 }
 
@@ -301,7 +301,9 @@ void IrcWidget::updateNick(QString net, QString nick, VarMap props) {
 
 void IrcWidget::removeNick(QString net, QString nick) {
   VarMap chans = nicks[net].toMap()[nick].toMap()["Channels"].toMap();
+  qDebug() << "REMOVE" << nick;
   foreach(QString bufname, chans.keys()) {
+    qDebug() << "remove from"<<bufname;
     getBuffer(net, bufname)->removeNick(nick);
   }
   VarMap netnicks = nicks[net].toMap();
index 7cedde0..dee4645 100644 (file)
@@ -31,7 +31,7 @@
   </property>
   <layout class="QVBoxLayout" >
    <property name="margin" >
-    <number>9</number>
+    <number>1</number>
    </property>
    <property name="spacing" >
     <number>6</number>
     </layout>
    </item>
    <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
+    <widget class="QSplitter" name="splitter" >
+     <property name="sizePolicy" >
+      <sizepolicy>
+       <hsizetype>7</hsizetype>
+       <vsizetype>5</vsizetype>
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
      </property>
-     <property name="spacing" >
-      <number>6</number>
+     <property name="lineWidth" >
+      <number>1</number>
      </property>
-     <item>
-      <widget class="QTextEdit" name="chatWidget" >
-       <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>7</hsizetype>
-         <vsizetype>7</vsizetype>
-         <horstretch>4</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="font" >
-        <font>
-         <family>Monospace</family>
-        </font>
-       </property>
-       <property name="readOnly" >
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QTreeWidget" name="nickTree" >
-       <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>5</hsizetype>
-         <vsizetype>5</vsizetype>
-         <horstretch>1</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="layoutDirection" >
-        <enum>Qt::LeftToRight</enum>
-       </property>
-       <property name="dragEnabled" >
-        <bool>true</bool>
-       </property>
-       <property name="textElideMode" >
-        <enum>Qt::ElideRight</enum>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <widget class="QTextBrowser" name="chatWidget" >
+      <property name="sizePolicy" >
+       <sizepolicy>
+        <hsizetype>7</hsizetype>
+        <vsizetype>5</vsizetype>
+        <horstretch>4</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="font" >
+       <font>
+        <family>Bitstream Vera Sans Mono</family>
+        <pointsize>8</pointsize>
+        <weight>50</weight>
+        <bold>false</bold>
+       </font>
+      </property>
+      <property name="html" >
+       <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+p, li { white-space: pre-wrap; }
+&lt;/style>&lt;/head>&lt;body style=" font-family:'Bitstream Vera Sans Mono'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;">
+&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Nimbus Mono L';">&lt;/p>&lt;/body>&lt;/html></string>
+      </property>
+     </widget>
+     <widget class="QTreeWidget" name="nickTree" >
+      <property name="sizePolicy" >
+       <sizepolicy>
+        <hsizetype>5</hsizetype>
+        <vsizetype>5</vsizetype>
+        <horstretch>1</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="layoutDirection" >
+       <enum>Qt::LeftToRight</enum>
+      </property>
+      <property name="dragEnabled" >
+       <bool>true</bool>
+      </property>
+      <property name="textElideMode" >
+       <enum>Qt::ElideRight</enum>
+      </property>
+      <property name="rootIsDecorated" >
+       <bool>true</bool>
+      </property>
+      <property name="sortingEnabled" >
+       <bool>false</bool>
+      </property>
+      <property name="animated" >
+       <bool>false</bool>
+      </property>
+      <property name="columnCount" >
+       <number>1</number>
+      </property>
+      <column>
+       <property name="text" >
+        <string>32 Users</string>
        </property>
-       <property name="sortingEnabled" >
-        <bool>false</bool>
+      </column>
+      <item>
+       <property name="text" >
+        <string>@ Operators</string>
        </property>
-       <property name="animated" >
-        <bool>false</bool>
+       <item>
+        <property name="text" >
+         <string>New Sub Item</string>
+        </property>
+       </item>
+       <item>
+        <property name="text" >
+         <string>New Item</string>
+        </property>
+       </item>
+       <item>
+        <property name="text" >
+         <string>New Item</string>
+        </property>
+       </item>
+      </item>
+      <item>
+       <property name="text" >
+        <string>4 Voiced</string>
        </property>
-       <property name="columnCount" >
-        <number>1</number>
+       <item>
+        <property name="text" >
+         <string>New Item</string>
+        </property>
+       </item>
+       <item>
+        <property name="text" >
+         <string>New Item</string>
+        </property>
+       </item>
+       <item>
+        <property name="text" >
+         <string>New Item</string>
+        </property>
+       </item>
+      </item>
+      <item>
+       <property name="text" >
+        <string>19 Users</string>
        </property>
-       <column>
+       <item>
         <property name="text" >
-         <string>32 Users</string>
+         <string>New Sub Item</string>
         </property>
-       </column>
+       </item>
        <item>
         <property name="text" >
-         <string>@ Operators</string>
+         <string>New Item</string>
         </property>
-        <item>
-         <property name="text" >
-          <string>New Sub Item</string>
-         </property>
-        </item>
-        <item>
-         <property name="text" >
-          <string>New Item</string>
-         </property>
-        </item>
-        <item>
-         <property name="text" >
-          <string>New Item</string>
-         </property>
-        </item>
        </item>
        <item>
         <property name="text" >
-         <string>4 Voiced</string>
+         <string>New Item</string>
         </property>
-        <item>
-         <property name="text" >
-          <string>New Item</string>
-         </property>
-        </item>
-        <item>
-         <property name="text" >
-          <string>New Item</string>
-         </property>
-        </item>
-        <item>
-         <property name="text" >
-          <string>New Item</string>
-         </property>
-        </item>
        </item>
        <item>
         <property name="text" >
-         <string>19 Users</string>
+         <string>New Item</string>
         </property>
-        <item>
-         <property name="text" >
-          <string>New Sub Item</string>
-         </property>
-        </item>
-        <item>
-         <property name="text" >
-          <string>New Item</string>
-         </property>
-        </item>
-        <item>
-         <property name="text" >
-          <string>New Item</string>
-         </property>
-        </item>
-        <item>
-         <property name="text" >
-          <string>New Item</string>
-         </property>
-        </item>
        </item>
-      </widget>
-     </item>
-    </layout>
+      </item>
+     </widget>
+    </widget>
    </item>
    <item>
     <layout class="QHBoxLayout" >
      </property>
      <item>
       <widget class="QComboBox" name="ownNick" >
-       <item>
-        <property name="text" >
-         <string>mainNick</string>
-        </property>
-       </item>
-       <item>
-        <property name="text" >
-         <string>altNick</string>
-        </property>
-       </item>
+       <property name="sizeAdjustPolicy" >
+        <enum>QComboBox::AdjustToContents</enum>
+       </property>
       </widget>
      </item>
      <item>
-      <widget class="QLineEdit" name="inputEdit" />
+      <widget class="QLineEdit" name="inputEdit" >
+       <property name="sizePolicy" >
+        <sizepolicy>
+         <hsizetype>3</hsizetype>
+         <vsizetype>0</vsizetype>
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
      </item>
     </layout>
    </item>
   <tabstop>nickTree</tabstop>
   <tabstop>topicEdit</tabstop>
   <tabstop>chanSettingsButton</tabstop>
+  <tabstop>chatWidget</tabstop>
  </tabstops>
  <resources/>
  <connections/>
index bf78eaf..66475a9 100644 (file)
@@ -324,7 +324,7 @@ void Server::handleServerNick(QString prefix, QStringList params) {
   }
   emit nickRenamed(network, oldnick, newnick);
   if(oldnick == currentNick) {
-    currentNick == newnick;
+    currentNick = newnick;
     emit ownNickSet(network, newnick);
   }
 }
@@ -380,7 +380,11 @@ void Server::handleServerQuit(QString prefix, QStringList params) {
 void Server::handleServer001(QString prefix, QStringList params) {
   currentServer = prefix;
   currentNick = params[0];
+  VarMap n;
+  n["Channels"] = VarMap();
+  nicks[currentNick] = n;
   emit ownNickSet(network, currentNick);
+  emit nickAdded(network, currentNick, VarMap());
   emit displayMsg("", Message(Message::Server, params[1], prefix));
 }
 
@@ -423,7 +427,6 @@ void Server::handleServer353(QString prefix, QStringList params) {
       c["Mode"] = mode;
       chans[buf] = c;
       n["Channels"] = chans;
-      n["Nick"] = nick;
       nicks[nick] = n;
       emit nickAdded(network, nick, n);
     }