X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Ftopicwidget.cpp;h=9e6435da59e1d5b2a96b380c1277187917298939;hp=8e11e1976114e7e6e5b39637ae148b6f6f3ac01c;hb=ddfb1d2574c4bffd180361a80df9b1cd584bb040;hpb=f3d6f8088d8be6af9319a99fb8d2fee2837b540a diff --git a/src/qtui/topicwidget.cpp b/src/qtui/topicwidget.cpp index 8e11e197..9e6435da 100644 --- a/src/qtui/topicwidget.cpp +++ b/src/qtui/topicwidget.cpp @@ -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 * @@ -20,9 +20,8 @@ #include "topicwidget.h" -#include - #include "client.h" +#include "icon.h" #include "networkmodel.h" #include "uisettings.h" #include "graphicalui.h" @@ -32,7 +31,7 @@ TopicWidget::TopicWidget(QWidget *parent) : AbstractItemView(parent) { ui.setupUi(this); - ui.topicEditButton->setIcon(QIcon::fromTheme("edit-rename")); + ui.topicEditButton->setIcon(icon::get("edit-rename")); ui.topicLineEdit->setLineWrapEnabled(true); ui.topicLineEdit->installEventFilter(this); @@ -202,7 +201,7 @@ void TopicWidget::updateResizeMode() void TopicWidget::clickableActivated(const Clickable &click) { NetworkId networkId = selectionModel()->currentIndex().data(NetworkModel::NetworkIdRole).value(); - 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); } @@ -281,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, " ");