Strip formatting when looking up the clickable.
authorBas Pape <baspape@gmail.com>
Tue, 27 Aug 2013 19:59:37 +0000 (21:59 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 10 Oct 2013 18:07:12 +0000 (20:07 +0200)
In the TopicWidget the list of Clickables is initialized with text
stripped of formatting, so when looking up their positions again, the
formatting should be stripped as well.

Fixes #1115

src/qtui/topicwidget.cpp

index 8b8e16d..827452c 100644 (file)
@@ -24,6 +24,8 @@
 #include "iconloader.h"
 #include "networkmodel.h"
 #include "uisettings.h"
+#include "graphicalui.h"
+#include "uistyle.h"
 
 TopicWidget::TopicWidget(QWidget *parent)
     : AbstractItemView(parent)
@@ -191,7 +193,8 @@ void TopicWidget::updateResizeMode()
 void TopicWidget::clickableActivated(const Clickable &click)
 {
     NetworkId networkId = selectionModel()->currentIndex().data(NetworkModel::NetworkIdRole).value<NetworkId>();
-    click.activate(networkId, _topic);
+    UiStyle::StyledString sstr = GraphicalUi::uiStyle()->styleString(GraphicalUi::uiStyle()->mircToInternal(_topic), UiStyle::PlainMsg);
+    click.activate(networkId, sstr.plainText);
 }