// Start monitoring kinetic scroll
if (scrollerMonitor) {
killTimer(scrollerMonitor);
+ scrollerMonitor = 0;
}
if (scroller) {
scrollerMonitor = startTimer(500);
void BookView::timerEvent(QTimerEvent *e)
{
- if (e->timerId() == scrollerMonitor) {
#ifdef Q_WS_MAEMO_5
+ if (e->timerId() == scrollerMonitor) {
if (scroller &&
((scroller->state() == QAbstractKineticScroller::AutoScrolling) ||
(scroller->state() == QAbstractKineticScroller::Pushing))) {
} else {
killTimer(scrollerMonitor);
}
-#endif // Q_WS_MAEMO_5
}
+#else
+ Q_UNUSED(e);
+#endif // Q_WS_MAEMO_5
}
void BookView::keyPressEvent(QKeyEvent* event)
Trace t("Book::partFromChapter");
QString id = chapters[index];
QString href = content[id].href;
- QString baseRef(href);
- QUrl url(QString("file://") + href);
- if (url.hasFragment()) {
- QString fragment = url.fragment();
- baseRef.chop(fragment.length() + 1);
+ int hashPos = href.indexOf("#");
+ if (hashPos != -1) {
+ href = href.left(hashPos);
}
+
qDebug() << "Chapter" << index;
qDebug() << " id" << id;
qDebug() << " href" << href;
- qDebug() << " base href" << baseRef;
for (int i = 0; i < parts.size(); i++) {
QString partId = parts[i];
- if (content[partId].href == baseRef) {
- qDebug() << "Part index for" << baseRef << "is" << i;
+ if (content[partId].href == href) {
+ qDebug() << "Part index for" << href << "is" << i;
return i;
}
}
qWarning() << "Book::partFromChapter: Could not find part index for"
- << baseRef;
+ << href;
return -1;
}
* Works on Symbian (far from usable)
* Make modal dialogs closeable on Mac
* Fix progress and bookmark positions
+ * Improve chapter navigation: Work around a QUrl bug
-- Akos Polster <akos@pipacs.com> Thu, 16 Sep 2010 02:00:00 +0200