some minor fixes:
authorMarcus Eggenberger <egs@quassel-irc.org>
Wed, 4 Jun 2008 10:36:32 +0000 (12:36 +0200)
committerMarcus Eggenberger <egs@quassel-irc.org>
Wed, 4 Jun 2008 10:39:11 +0000 (12:39 +0200)
 - strange behavior of disabled autoadd for custom views
 - permanently remvoed buffers disappear now instantly
 - fixed a gcc warning BR #162

src/qtui/mainwin.cpp
src/uisupport/bufferviewfilter.cpp

index 64d4fd7..925c64f 100644 (file)
@@ -520,7 +520,7 @@ void MainWin::closeEvent(QCloseEvent *event) {
 }
 
 void MainWin::systrayActivated( QSystemTrayIcon::ActivationReason activationReason) {
-  if (activationReason == QSystemTrayIcon::Trigger) {
+  if(activationReason == QSystemTrayIcon::Trigger) {
     toggleVisibility();
   }
 }
@@ -528,11 +528,12 @@ void MainWin::systrayActivated( QSystemTrayIcon::ActivationReason activationReas
 void MainWin::toggleVisibility() {
   if(isHidden() /*|| !isActiveWindow()*/) {
     show();
-    if(isMinimized())
-      if (isMaximized())
+    if(isMinimized()) {
+      if(isMaximized())
         showMaximized();
       else
         showNormal();
+    }
 
     raise();
     activateWindow();
index 5dcb7e8..396922d 100644 (file)
@@ -93,6 +93,7 @@ void BufferViewFilter::configInitialized() {
   connect(config(), SIGNAL(bufferAdded(const BufferId &, int)), this, SLOT(invalidate()));
   connect(config(), SIGNAL(bufferMoved(const BufferId &, int)), this, SLOT(invalidate()));
   connect(config(), SIGNAL(bufferRemoved(const BufferId &)), this, SLOT(invalidate()));
+  connect(config(), SIGNAL(bufferPermanentlyRemoved(const BufferId &)), this, SLOT(invalidate()));
 
   disconnect(config(), SIGNAL(initDone()), this, SLOT(configInitialized()));
 
@@ -180,10 +181,10 @@ bool BufferViewFilter::filterAcceptBuffer(const QModelIndex &source_bufferIndex)
     // add the buffer if...
     if(config()->isInitialized() && !config()->removedBuffers().contains(bufferId) // it hasn't been manually removed and either
        && ((config()->addNewBuffersAutomatically() && !config()->temporarilyRemovedBuffers().contains(bufferId)) // is totally unknown to us (a new buffer)...
-          || activityLevel > Buffer::OtherActivity)) { // or was just temporarily hidden and has a new message waiting for us.
+          || (config()->temporarilyRemovedBuffers().contains(bufferId) && activityLevel > Buffer::OtherActivity))) { // or was just temporarily hidden and has a new message waiting for us.
       addBuffer(bufferId);
     }
-    // note: adding the buffer to the valid list does not temper with the filters ("show only channels" and stuff)
+    // note: adding the buffer to the valid list does not temper with the following filters ("show only channels" and stuff)
     return false;
   }