Changeset View
Changeset View
Standalone View
Standalone View
app/mainwindow.cpp
Show First 20 Lines • Show All 1113 Lines • ▼ Show 20 Line(s) | 1110 | { | |||
---|---|---|---|---|---|
1114 | d->mViewMainPage->setStatusBarVisible(visible); | 1114 | d->mViewMainPage->setStatusBarVisible(visible); | ||
1115 | d->mBrowseMainPage->setStatusBarVisible(visible); | 1115 | d->mBrowseMainPage->setStatusBarVisible(visible); | ||
1116 | } | 1116 | } | ||
1117 | 1117 | | |||
1118 | void MainWindow::slotPartCompleted() | 1118 | void MainWindow::slotPartCompleted() | ||
1119 | { | 1119 | { | ||
1120 | d->updateActions(); | 1120 | d->updateActions(); | ||
1121 | const QUrl url = d->mContextManager->currentUrl(); | 1121 | const QUrl url = d->mContextManager->currentUrl(); | ||
1122 | if (!url.isEmpty()) { | 1122 | if (!url.isEmpty() && GwenviewConfig::historyEnabled()) { | ||
1123 | d->mFileOpenRecentAction->addUrl(url); | 1123 | d->mFileOpenRecentAction->addUrl(url); | ||
1124 | d->mGvCore->addUrlToRecentFiles(url); | 1124 | d->mGvCore->addUrlToRecentFiles(url); | ||
1125 | } | 1125 | } | ||
1126 | 1126 | | |||
1127 | if (KProtocolManager::supportsListing(url)) { | 1127 | if (KProtocolManager::supportsListing(url)) { | ||
1128 | const QUrl dirUrl = d->mContextManager->currentDirUrl(); | 1128 | const QUrl dirUrl = d->mContextManager->currentDirUrl(); | ||
1129 | d->mGvCore->addUrlToRecentFolders(dirUrl); | 1129 | d->mGvCore->addUrlToRecentFolders(dirUrl); | ||
1130 | } | 1130 | } | ||
▲ Show 20 Lines • Show All 338 Lines • ▼ Show 20 Line(s) | 1466 | { | |||
1469 | } | 1469 | } | ||
1470 | } | 1470 | } | ||
1471 | 1471 | | |||
1472 | void MainWindow::loadConfig() | 1472 | void MainWindow::loadConfig() | ||
1473 | { | 1473 | { | ||
1474 | d->mDirModel->setBlackListedExtensions(GwenviewConfig::blackListedExtensions()); | 1474 | d->mDirModel->setBlackListedExtensions(GwenviewConfig::blackListedExtensions()); | ||
1475 | d->mDirModel->adjustKindFilter(MimeTypeUtils::KIND_VIDEO, GwenviewConfig::listVideos()); | 1475 | d->mDirModel->adjustKindFilter(MimeTypeUtils::KIND_VIDEO, GwenviewConfig::listVideos()); | ||
1476 | 1476 | | |||
1477 | if (GwenviewConfig::historyEnabled()) { | ||||
1477 | d->mFileOpenRecentAction->loadEntries(KConfigGroup(KSharedConfig::openConfig(), "Recent Files")); | 1478 | d->mFileOpenRecentAction->loadEntries(KConfigGroup(KSharedConfig::openConfig(), "Recent Files")); | ||
1478 | foreach(const QUrl &url, d->mFileOpenRecentAction->urls()) { | 1479 | foreach(const QUrl& url, d->mFileOpenRecentAction->urls()) { | ||
1479 | d->mGvCore->addUrlToRecentFiles(url); | 1480 | d->mGvCore->addUrlToRecentFiles(url); | ||
1480 | } | 1481 | } | ||
1482 | } else { | ||||
1483 | d->mFileOpenRecentAction->clear(); | ||||
1484 | } | ||||
1485 | d->mFileOpenRecentAction->setVisible(GwenviewConfig::historyEnabled()); | ||||
1486 | | ||||
1481 | d->mStartMainPage->loadConfig(); | 1487 | d->mStartMainPage->loadConfig(); | ||
1482 | d->mViewMainPage->loadConfig(); | 1488 | d->mViewMainPage->loadConfig(); | ||
1483 | d->mBrowseMainPage->loadConfig(); | 1489 | d->mBrowseMainPage->loadConfig(); | ||
1484 | d->mContextManager->loadConfig(); | 1490 | d->mContextManager->loadConfig(); | ||
1485 | d->mSideBar->loadConfig(); | 1491 | d->mSideBar->loadConfig(); | ||
1486 | } | 1492 | } | ||
1487 | 1493 | | |||
1488 | void MainWindow::saveConfig() | 1494 | void MainWindow::saveConfig() | ||
1489 | { | 1495 | { | ||
1490 | d->mFileOpenRecentAction->saveEntries(KConfigGroup(KSharedConfig::openConfig(), "Recent Files")); | 1496 | d->mFileOpenRecentAction->saveEntries(KConfigGroup(KSharedConfig::openConfig(), "Recent Files")); | ||
muhlenpfordt: Always saving the entries here makes sure the old list is removed from the config file after… | |||||
1491 | d->mViewMainPage->saveConfig(); | 1497 | d->mViewMainPage->saveConfig(); | ||
1492 | d->mBrowseMainPage->saveConfig(); | 1498 | d->mBrowseMainPage->saveConfig(); | ||
1493 | d->mContextManager->saveConfig(); | 1499 | d->mContextManager->saveConfig(); | ||
1494 | GwenviewConfig::setFullScreenModeActive(isFullScreen()); | 1500 | GwenviewConfig::setFullScreenModeActive(isFullScreen()); | ||
1495 | } | 1501 | } | ||
1496 | 1502 | | |||
1497 | void MainWindow::print() | 1503 | void MainWindow::print() | ||
1498 | { | 1504 | { | ||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |
Always saving the entries here makes sure the old list is removed from the config file after disabling the history.