X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Ftopicwidget.cpp;h=e18625cd0cc871dfe5c1672e5ed10f181428df4d;hp=9e6435da59e1d5b2a96b380c1277187917298939;hb=fcacaaf16551524c7ebb6114254d005274cc3d63;hpb=b7447afe8e836376776dac26704e227a678d2913 diff --git a/src/qtui/topicwidget.cpp b/src/qtui/topicwidget.cpp index 9e6435da..e18625cd 100644 --- a/src/qtui/topicwidget.cpp +++ b/src/qtui/topicwidget.cpp @@ -35,8 +35,8 @@ TopicWidget::TopicWidget(QWidget *parent) ui.topicLineEdit->setLineWrapEnabled(true); ui.topicLineEdit->installEventFilter(this); - connect(ui.topicLabel, SIGNAL(clickableActivated(Clickable)), SLOT(clickableActivated(Clickable))); - connect(ui.topicLineEdit, SIGNAL(noTextEntered()), SLOT(on_topicLineEdit_textEntered())); + connect(ui.topicLabel, &StyledLabel::clickableActivated, this, &TopicWidget::clickableActivated); + connect(ui.topicLineEdit, &MultiLineEdit::noTextEntered, this, &TopicWidget::on_topicLineEdit_textEntered); UiSettings s("TopicWidget"); s.notify("DynamicResize", this, SLOT(updateResizeMode())); @@ -67,7 +67,7 @@ void TopicWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bot QModelIndex currentTopicIndex = selectionModel()->currentIndex().sibling(selectionModel()->currentIndex().row(), 1); if (changedArea.contains(currentTopicIndex)) setTopic(selectionModel()->currentIndex()); -}; +} void TopicWidget::setUseCustomFont(const QVariant &v) { @@ -114,19 +114,11 @@ 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(); @@ -263,7 +255,7 @@ bool TopicWidget::eventFilter(QObject *obj, QEvent *event) if (event->type() != QEvent::KeyRelease) return QObject::eventFilter(obj, event); - QKeyEvent *keyEvent = static_cast(event); + auto *keyEvent = static_cast(event); if (keyEvent->key() == Qt::Key_Escape) { switchPlain(); @@ -280,9 +272,7 @@ 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, " ");