Changeset View
Changeset View
Standalone View
Standalone View
app/savebar.cpp
Show First 20 Lines • Show All 340 Lines • ▼ Show 20 Line(s) | 340 | } else { | |||
---|---|---|---|---|---|
341 | slideIn(); | 341 | slideIn(); | ||
342 | } | 342 | } | ||
343 | } | 343 | } | ||
344 | 344 | | |||
345 | void SaveBar::triggerAction(const QString& action) | 345 | void SaveBar::triggerAction(const QString& action) | ||
346 | { | 346 | { | ||
347 | QList<QUrl> lst = DocumentFactory::instance()->modifiedDocumentList(); | 347 | QList<QUrl> lst = DocumentFactory::instance()->modifiedDocumentList(); | ||
348 | if (action == "first") { | 348 | if (action == "first") { | ||
349 | goToUrl(lst[0]); | 349 | emit goToUrl(lst[0]); | ||
350 | } else if (action == "previous") { | 350 | } else if (action == "previous") { | ||
351 | int pos = lst.indexOf(d->mCurrentUrl); | 351 | int pos = lst.indexOf(d->mCurrentUrl); | ||
352 | --pos; | 352 | --pos; | ||
353 | Q_ASSERT(pos >= 0); | 353 | Q_ASSERT(pos >= 0); | ||
354 | goToUrl(lst[pos]); | 354 | emit goToUrl(lst[pos]); | ||
355 | } else if (action == "next") { | 355 | } else if (action == "next") { | ||
356 | int pos = lst.indexOf(d->mCurrentUrl); | 356 | int pos = lst.indexOf(d->mCurrentUrl); | ||
357 | ++pos; | 357 | ++pos; | ||
358 | Q_ASSERT(pos < lst.size()); | 358 | Q_ASSERT(pos < lst.size()); | ||
359 | goToUrl(lst[pos]); | 359 | emit goToUrl(lst[pos]); | ||
360 | } else { | 360 | } else { | ||
361 | qWarning() << "Unknown action: " << action ; | 361 | qWarning() << "Unknown action: " << action ; | ||
362 | } | 362 | } | ||
363 | } | 363 | } | ||
364 | 364 | | |||
365 | void SaveBar::setCurrentUrl(const QUrl &url) | 365 | void SaveBar::setCurrentUrl(const QUrl &url) | ||
366 | { | 366 | { | ||
367 | d->mCurrentUrl = url; | 367 | d->mCurrentUrl = url; | ||
368 | updateContent(); | 368 | updateContent(); | ||
369 | } | 369 | } | ||
370 | 370 | | |||
371 | } // namespace | 371 | } // namespace |