Changeset View
Changeset View
Standalone View
Standalone View
app/mainwindow.cpp
Show First 20 Lines • Show All 1635 Lines • ▼ Show 20 Line(s) | |||||
1636 | void MainWindow::saveProperties(KConfigGroup& group) | 1636 | void MainWindow::saveProperties(KConfigGroup& group) | ||
1637 | { | 1637 | { | ||
1638 | group.writeEntry(SESSION_CURRENT_PAGE_KEY, int(d->mCurrentMainPageId)); | 1638 | group.writeEntry(SESSION_CURRENT_PAGE_KEY, int(d->mCurrentMainPageId)); | ||
1639 | group.writeEntry(SESSION_URL_KEY, d->mContextManager->currentUrl().toString()); | 1639 | group.writeEntry(SESSION_URL_KEY, d->mContextManager->currentUrl().toString()); | ||
1640 | } | 1640 | } | ||
1641 | 1641 | | |||
1642 | void MainWindow::readProperties(const KConfigGroup& group) | 1642 | void MainWindow::readProperties(const KConfigGroup& group) | ||
1643 | { | 1643 | { | ||
1644 | const QUrl url = group.readEntry(SESSION_URL_KEY, QUrl()); | ||||
rkflx: If you are touching this, you might as well add a `const` ;) | |||||
1645 | if (url.isValid()) { | ||||
1646 | goToUrl(url); | ||||
1647 | } | ||||
1648 | | ||||
1644 | MainPageId pageId = MainPageId(group.readEntry(SESSION_CURRENT_PAGE_KEY, int(StartMainPageId))); | 1649 | MainPageId pageId = MainPageId(group.readEntry(SESSION_CURRENT_PAGE_KEY, int(StartMainPageId))); | ||
1645 | if (pageId == StartMainPageId) { | 1650 | if (pageId == StartMainPageId) { | ||
1646 | d->mCurrentMainPageId = StartMainPageId; | 1651 | d->mCurrentMainPageId = StartMainPageId; | ||
muhlenpfordt: Not needed since it's set in `showStartMainPage()`. | |||||
Agreed, but please split this out into a separate commit on master (no need for a Diff). rkflx: Agreed, but please split this out into a separate commit on master (no need for a Diff). | |||||
1647 | showStartMainPage(); | 1652 | showStartMainPage(); | ||
1648 | } else if (pageId == BrowseMainPageId) { | 1653 | } else if (pageId == BrowseMainPageId) { | ||
1649 | d->mBrowseAction->trigger(); | 1654 | d->mBrowseAction->trigger(); | ||
1650 | } else { | 1655 | } else { | ||
1651 | d->mViewAction->trigger(); | 1656 | d->mViewAction->trigger(); | ||
1652 | } | 1657 | } | ||
1653 | QUrl url = group.readEntry(SESSION_URL_KEY, QUrl()); | | |||
1654 | if (!url.isValid()) { | | |||
1655 | qWarning() << "Invalid url!"; | | |||
1656 | return; | | |||
1657 | } | | |||
1658 | goToUrl(url); | | |||
1659 | } | 1658 | } | ||
1660 | 1659 | | |||
1661 | void MainWindow::showFirstDocumentReached() | 1660 | void MainWindow::showFirstDocumentReached() | ||
1662 | { | 1661 | { | ||
1663 | if (d->mCurrentMainPageId != ViewMainPageId) { | 1662 | if (d->mCurrentMainPageId != ViewMainPageId) { | ||
1664 | return; | 1663 | return; | ||
1665 | } | 1664 | } | ||
1666 | HudButtonBox* dlg = new HudButtonBox; | 1665 | HudButtonBox* dlg = new HudButtonBox; | ||
Show All 23 Lines |
If you are touching this, you might as well add a const ;)