Cosmetic fixes for the notifications
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 4 Aug 2008 21:12:00 +0000 (23:12 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 4 Aug 2008 21:12:00 +0000 (23:12 +0200)
src/qtui/mainwin.cpp

index f82b971..22d3724 100644 (file)
@@ -594,12 +594,7 @@ void MainWin::messagesInserted(const QModelIndex &parent, int start, int end) {
     BufferInfo::Type bufType = Client::networkModel()->bufferType(bufId);
 
     if(flags & Message::Highlight || bufType == BufferInfo::QueryBuffer) {
     BufferInfo::Type bufType = Client::networkModel()->bufferType(bufId);
 
     if(flags & Message::Highlight || bufType == BufferInfo::QueryBuffer) {
-      QString title = Client::networkModel()->networkName(bufId); qDebug() << bufId << "title" << title;
-      if(bufType == BufferInfo::QueryBuffer) {
-        QString sender = Client::messageModel()->index(i, ChatLineModel::SenderColumn).data(ChatLineModel::DisplayRole).toString();
-        sender = sender.mid(1, sender.length() - 2); // remove < >
-        title += " - " + sender;
-      }
+      QString title = Client::networkModel()->networkName(bufId) + " - " + Client::networkModel()->bufferName(bufId);
 
       // FIXME Don't instantiate this for every highlight...
       UiSettings uiSettings;
 
       // FIXME Don't instantiate this for every highlight...
       UiSettings uiSettings;
@@ -608,12 +603,11 @@ void MainWin::messagesInserted(const QModelIndex &parent, int start, int end) {
       bool displayDesktop = uiSettings.value("NotificationDesktop", QVariant(true)).toBool();
       if(displayBubble || displayDesktop) {
         if(uiSettings.value("DisplayPopupMessages", QVariant(true)).toBool()) {
       bool displayDesktop = uiSettings.value("NotificationDesktop", QVariant(true)).toBool();
       if(displayBubble || displayDesktop) {
         if(uiSettings.value("DisplayPopupMessages", QVariant(true)).toBool()) {
-          // FIXME don't invoke style engine for this!
           QString text = idx.data(ChatLineModel::DisplayRole).toString();
           if(displayBubble) displayTrayIconMessage(title, text);
           QString text = idx.data(ChatLineModel::DisplayRole).toString();
           if(displayBubble) displayTrayIconMessage(title, text);
-  #  ifdef HAVE_DBUS
+  ifdef HAVE_DBUS
           if(displayDesktop) sendDesktopNotification(title, text);
           if(displayDesktop) sendDesktopNotification(title, text);
-  #  endif
+  endif
         }
         if(uiSettings.value("AnimateTrayIcon", QVariant(true)).toBool()) {
           QApplication::alert(this);
         }
         if(uiSettings.value("AnimateTrayIcon", QVariant(true)).toBool()) {
           QApplication::alert(this);