adding tons of ifdefs so quassel will build again without ssl support
[quassel.git] / src / qtui / topicwidget.cpp
index 7d2d90b..cc66bd4 100644 (file)
 #include <QDebug>
 
 #include "client.h"
+#include "iconloader.h"
 #include "networkmodel.h"
 
 TopicWidget::TopicWidget(QWidget *parent)
   : AbstractItemView(parent)
 {
   ui.setupUi(this);
+  ui.topicEditButton->setPixmap(BarIcon("edit-rename"));
+
   ui.topicLineEdit->hide();
   ui.topicLineEdit->installEventFilter(this);
   ui.topicLabel->show();
@@ -51,7 +54,7 @@ void TopicWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bot
 void TopicWidget::setTopic(const QString &newtopic) {
   if(_topic == newtopic)
     return;
-  
+
   _topic = newtopic;
   ui.topicLabel->setText(newtopic);
   ui.topicLineEdit->setText(newtopic);
@@ -62,7 +65,10 @@ void TopicWidget::on_topicLineEdit_returnPressed() {
   QModelIndex currentIdx = currentIndex();
   if(currentIdx.isValid() && currentIdx.data(NetworkModel::BufferTypeRole) == BufferInfo::ChannelBuffer) {
     BufferInfo bufferInfo = currentIdx.data(NetworkModel::BufferInfoRole).value<BufferInfo>();
-    Client::userInput(bufferInfo, QString("/topic %1").arg(ui.topicLineEdit->text()));
+    if(ui.topicLineEdit->text().isEmpty())
+      Client::userInput(bufferInfo, QString("/quote TOPIC %1 :").arg(bufferInfo.bufferName()));
+    else
+      Client::userInput(bufferInfo, QString("/topic %1").arg(ui.topicLineEdit->text()));
   }
   switchPlain();
 }
@@ -110,6 +116,6 @@ bool TopicWidget::eventFilter(QObject *obj, QEvent *event) {
     switchPlain();
     return true;
   }
-  
+
   return false;
 }