core: Allow clean shutdown of the core
[quassel.git] / src / qtui / topicwidget.cpp
index ae83501..9e6435d 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -21,7 +21,7 @@
 #include "topicwidget.h"
 
 #include "client.h"
-#include "iconloader.h"
+#include "icon.h"
 #include "networkmodel.h"
 #include "uisettings.h"
 #include "graphicalui.h"
@@ -31,7 +31,7 @@ TopicWidget::TopicWidget(QWidget *parent)
     : AbstractItemView(parent)
 {
     ui.setupUi(this);
-    ui.topicEditButton->setIcon(SmallIcon("edit-rename"));
+    ui.topicEditButton->setIcon(icon::get("edit-rename"));
     ui.topicLineEdit->setLineWrapEnabled(true);
     ui.topicLineEdit->installEventFilter(this);
 
@@ -201,7 +201,7 @@ void TopicWidget::updateResizeMode()
 void TopicWidget::clickableActivated(const Clickable &click)
 {
     NetworkId networkId = selectionModel()->currentIndex().data(NetworkModel::NetworkIdRole).value<NetworkId>();
-    UiStyle::StyledString sstr = GraphicalUi::uiStyle()->styleString(GraphicalUi::uiStyle()->mircToInternal(_topic), UiStyle::PlainMsg);
+    UiStyle::StyledString sstr = GraphicalUi::uiStyle()->styleString(GraphicalUi::uiStyle()->mircToInternal(_topic), UiStyle::FormatType::PlainMsg);
     click.activate(networkId, sstr.plainText);
 }
 
@@ -280,6 +280,9 @@ QString TopicWidget::sanitizeTopic(const QString& topic)
     // some unicode characters with a new line, which then triggers
     // a stack overflow later
     QString result(topic);
+#if QT_VERSION >= 0x050000
+    result.replace(QChar::CarriageReturn, " ");
+#endif
     result.replace(QChar::ParagraphSeparator, " ");
     result.replace(QChar::LineSeparator, " ");