diff options
Diffstat (limited to 'Swift/QtUI/QtHistoryWindow.cpp')
-rw-r--r-- | Swift/QtUI/QtHistoryWindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp index 53e7ffe..77a7f12 100644 --- a/Swift/QtUI/QtHistoryWindow.cpp +++ b/Swift/QtUI/QtHistoryWindow.cpp @@ -149,61 +149,61 @@ void QtHistoryWindow::addMessage(const std::string &message, const std::string & previousBottomSenderName_ = P2QSTRING(senderName); } // keep track of the days viewable in the chatView if (!dates_.count(date)) { dates_.insert(date); } } void QtHistoryWindow::handleSomethingSelectedChanged(RosterItem* item) { onSelectedContactChanged(item); } void QtHistoryWindow::resetConversationView() { previousTopMessageWasSelf_ = false; previousBottomMessageWasSelf_ = false; previousTopSenderName_.clear(); previousBottomSenderName_.clear(); dates_.clear(); conversation_->resetView(); } void QtHistoryWindow::handleScrollRequested(int pos) { // first message starts with offset 5 if (pos < 5) { pos = 5; } QDate currentDate; - foreach (const QDate& date, dates_) { + for (const auto& date : dates_) { int snippetPosition = conversation_->getSnippetPositionByDate(date); if (snippetPosition <= pos) { currentDate = date; } } if (ui_.calendarWidget_->selectedDate() != currentDate) { ui_.calendarWidget_->setSelectedDate(currentDate); } } void QtHistoryWindow::handleScrollReachedTop() { if (dates_.empty()) { return; } int year, month, day; QDate firstDate = *dates_.begin(); firstDate.getDate(&year, &month, &day); onScrollReachedTop(boost::gregorian::date(boost::numeric_cast<unsigned short>(year), boost::numeric_cast<unsigned short>(month), boost::numeric_cast<unsigned short>(day))); } void QtHistoryWindow::handleScrollReachedBottom() { if (dates_.empty()) { return; } int year, month, day; QDate lastDate = *dates_.rbegin(); lastDate.getDate(&year, &month, &day); |