From: Marcus Eggenberger Date: Wed, 12 Mar 2008 15:20:41 +0000 (+0000) Subject: topic changes are now handled properly X-Git-Tag: 0.2.0-alpha3~8 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=b68ffc844fc7504ecceeaa9348107ca5c249bd51;hp=858c7dbcbfa84deda9a71b4f4d25b1555bae3cc1 topic changes are now handled properly --- diff --git a/src/qtui/topicwidget.cpp b/src/qtui/topicwidget.cpp index f5e6c9e1..cb646eda 100644 --- a/src/qtui/topicwidget.cpp +++ b/src/qtui/topicwidget.cpp @@ -33,21 +33,16 @@ TopicWidget::TopicWidget(QWidget *parent) void TopicWidget::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { Q_UNUSED(previous); - setTopicForIndex(current); + setTopic(current.sibling(current.row(), 1).data().toString()); } void TopicWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { QItemSelectionRange changedArea(topLeft, bottomRight); - QModelIndex currentIndex = selectionModel()->currentIndex(); - if(changedArea.contains(currentIndex)) - setTopicForIndex(currentIndex); + QModelIndex currentTopicIndex = selectionModel()->currentIndex().sibling(selectionModel()->currentIndex().row(), 1); + if(changedArea.contains(currentTopicIndex)) + setTopic(currentTopicIndex.data().toString()); }; -void TopicWidget::setTopicForIndex(const QModelIndex &index) { - QModelIndex topicIndex = index.sibling(index.row(), 1); - setTopic(topicIndex.data().toString()); -} - void TopicWidget::setTopic(const QString &newtopic) { if(_topic == newtopic) return; diff --git a/src/qtui/topicwidget.h b/src/qtui/topicwidget.h index 95ceadfc..37d23214 100644 --- a/src/qtui/topicwidget.h +++ b/src/qtui/topicwidget.h @@ -32,7 +32,6 @@ public: TopicWidget(QWidget *parent = 0); void setTopic(const QString &newtopic); - void setTopicForIndex(const QModelIndex &index); virtual bool eventFilter(QObject *obj, QEvent *event);