summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorCătălin Badea <catalin.badea392@gmail.com>2012-08-10 14:03:43 (GMT)
committerCătălin Badea <catalin.badea392@gmail.com>2012-08-10 14:03:43 (GMT)
commite8c8e82f7113893bcb09a10397644c846b820b57 (patch)
treec271a6ab4deb90472a2fcfcc47c8cc23b0148b75 /Swift
parent80f2cbf4d3f805cf4464a51ccd20fb647a49ff50 (diff)
downloadswift-contrib-e8c8e82f7113893bcb09a10397644c846b820b57.zip
swift-contrib-e8c8e82f7113893bcb09a10397644c846b820b57.tar.bz2
Fix scrolling to next day.catalinb/history
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtHistoryWindow.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp
index 932922e..e54bd51 100644
--- a/Swift/QtUI/QtHistoryWindow.cpp
+++ b/Swift/QtUI/QtHistoryWindow.cpp
@@ -176,14 +176,24 @@ void QtHistoryWindow::handleScrollRequested(int pos) {
}
void QtHistoryWindow::handleScrollReachedTop() {
+ if (dates_.empty()) {
+ return;
+ }
+
int year, month, day;
- ui_.calendarWidget_->selectedDate().getDate(&year, &month, &day);
+ QDate firstDate = *dates_.begin();
+ firstDate.getDate(&year, &month, &day);
onScrollReachedTop(boost::gregorian::date(year, month, day));
}
void QtHistoryWindow::handleScrollReachedBottom() {
+ if (dates_.empty()) {
+ return;
+ }
+
int year, month, day;
- ui_.calendarWidget_->selectedDate().getDate(&year, &month, &day);
+ QDate lastDate = *dates_.rbegin();
+ lastDate.getDate(&year, &month, &day);
onScrollReachedBottom(boost::gregorian::date(year, month, day));
}