Remove the obsolete Icon and IconLoader classes
[quassel.git] / src / qtui / topicwidget.cpp
index ed02936..8e11e19 100644 (file)
@@ -20,8 +20,9 @@
 
 #include "topicwidget.h"
 
+#include <QIcon>
+
 #include "client.h"
-#include "iconloader.h"
 #include "networkmodel.h"
 #include "uisettings.h"
 #include "graphicalui.h"
@@ -31,7 +32,7 @@ TopicWidget::TopicWidget(QWidget *parent)
     : AbstractItemView(parent)
 {
     ui.setupUi(this);
-    ui.topicEditButton->setIcon(SmallIcon("edit-rename"));
+    ui.topicEditButton->setIcon(QIcon::fromTheme("edit-rename"));
     ui.topicLineEdit->setLineWrapEnabled(true);
     ui.topicLineEdit->installEventFilter(this);
 
@@ -114,11 +115,19 @@ void TopicWidget::setTopic(const QModelIndex &index)
         switch (Client::networkModel()->bufferType(id)) {
         case BufferInfo::StatusBuffer:
             if (network) {
+#if QT_VERSION < 0x050000
                 newtopic = QString("%1 (%2) | %3 | %4")
                            .arg(Qt::escape(network->networkName()))
                            .arg(Qt::escape(network->currentServer()))
                            .arg(tr("Users: %1").arg(network->ircUsers().count()))
                            .arg(tr("Lag: %1 msecs").arg(network->latency()));
+#else
+                newtopic = QString("%1 (%2) | %3 | %4")
+                           .arg(network->networkName().toHtmlEscaped())
+                           .arg(network->currentServer().toHtmlEscaped())
+                           .arg(tr("Users: %1").arg(network->ircUsers().count()))
+                           .arg(tr("Lag: %1 msecs").arg(network->latency()));
+#endif
             }
             else {
                 newtopic = index0.data(Qt::DisplayRole).toString();