diff options
Diffstat (limited to 'Swift/QtUI/QtHistoryWindow.cpp')
-rw-r--r-- | Swift/QtUI/QtHistoryWindow.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp index c2dcbcb..932922e 100644 --- a/Swift/QtUI/QtHistoryWindow.cpp +++ b/Swift/QtUI/QtHistoryWindow.cpp @@ -61,7 +61,6 @@ QtHistoryWindow::QtHistoryWindow(SettingsProvider* settings, UIEventStream* even connect(conversation_, SIGNAL(scrollReachedTop()), this, SLOT(handleScrollReachedTop())); connect(conversation_, SIGNAL(scrollReachedBottom()), this, SLOT(handleScrollReachedBottom())); connect(conversation_, SIGNAL(fontResized(int)), this, SLOT(handleFontResized(int))); - connect(conversation_, SIGNAL(contentSizeChanged()), this, SLOT(handleContentSizeChanged())); connect(ui_.searchBox_->lineEdit(), SIGNAL(returnPressed()), this, SLOT(handleReturnPressed())); connect(ui_.calendarWidget_, SIGNAL(clicked(const QDate&)), this, SLOT(handleCalendarClicked(const QDate&))); connect(ui_.calendarWidget_, SIGNAL(activated(const QDate&)), this, SLOT(handleCalendarClicked(const QDate&))); @@ -74,7 +73,6 @@ QtHistoryWindow::~QtHistoryWindow() { disconnect(conversation_, SIGNAL(scrollReachedTop()), this, SLOT(handleScrollReachedTop())); disconnect(conversation_, SIGNAL(scrollReachedBottom()), this, SLOT(handleScrollReachedBottom())); disconnect(conversation_, SIGNAL(fontResized(int)), this, SLOT(handleFontResized(int))); - disconnect(conversation_, SIGNAL(contentSizeChanged()), this, SLOT(handleContentSizeChanged())); disconnect(ui_.searchBox_->lineEdit(), SIGNAL(returnPressed()), this, SLOT(handleReturnPressed())); disconnect(ui_.calendarWidget_, SIGNAL(clicked(const QDate&)), this, SLOT(handleCalendarClicked(const QDate&))); disconnect(ui_.calendarWidget_, SIGNAL(activated(const QDate&)), this, SLOT(handleCalendarClicked(const QDate&))); @@ -110,6 +108,10 @@ void QtHistoryWindow::addMessage(const std::string &message, const std::string & QString messageHTML(P2QSTRING(message)); messageHTML = Qt::escape(messageHTML); + QString searchTerm = ui_.searchBox_->lineEdit()->text(); + if (searchTerm.length()) { + messageHTML.replace(searchTerm, "<span style='background-color: yellow'>" + searchTerm + "</span>"); + } // note: time uses localtime QDate date = QDate(time.date().year(), time.date().month(), time.date().day()); @@ -235,8 +237,4 @@ boost::gregorian::date QtHistoryWindow::getLastVisibleDate() { return boost::gregorian::date(boost::gregorian::not_a_date_time); } -void QtHistoryWindow::handleContentSizeChanged() { - conversation_->findText(ui_.searchBox_->lineEdit()->text(), QWebPage::HighlightAllOccurrences); -} - } |