summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Koller <kollix@aon.at>2016-11-12 14:39:40 (GMT)
committerMartin Koller <kollix@aon.at>2016-11-12 14:39:40 (GMT)
commitd06ed0a4d404234548ee13c460c3b0f4f7404cd0 (patch)
tree07f551753cd6630213749ca45dfaf53438537334
parent2cb4c366cd6823c2ef2dfc2b17b8f3d865cd8649 (diff)
make sure clearing the recent files also removes it from the config file
-rw-r--r--mainWindow/kpMainWindow_File.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/mainWindow/kpMainWindow_File.cpp b/mainWindow/kpMainWindow_File.cpp
index be75cc9..d3fd5b2 100644
--- a/mainWindow/kpMainWindow_File.cpp
+++ b/mainWindow/kpMainWindow_File.cpp
@@ -95,7 +95,8 @@ void kpMainWindow::setupFileMenuActions ()
d->actionNew = KStandardAction::openNew (this, SLOT (slotNew ()), ac);
d->actionOpen = KStandardAction::open (this, SLOT (slotOpen ()), ac);
- d->actionOpenRecent = KStandardAction::openRecent (this, SLOT (slotOpenRecent (const QUrl &)), ac);
+ d->actionOpenRecent = KStandardAction::openRecent(this, &kpMainWindow::slotOpenRecent, ac);
+ connect(d->actionOpenRecent, &KRecentFilesAction::recentListCleared, this, &kpMainWindow::slotRecentListCleared);
d->actionOpenRecent->loadEntries (KSharedConfig::openConfig ()->group (kpSettingsGroupRecentFiles));
#if DEBUG_KP_MAIN_WINDOW
qCDebug(kpLogMainWindow) << "\trecent URLs=" << d->actionOpenRecent->items ();
@@ -522,6 +523,13 @@ void kpMainWindow::slotOpenRecent (const QUrl &url)
//---------------------------------------------------------------------
+void kpMainWindow::slotRecentListCleared()
+{
+ d->actionOpenRecent->saveEntries(KSharedConfig::openConfig()->group(kpSettingsGroupRecentFiles));
+}
+
+//---------------------------------------------------------------------
+
#if HAVE_KSANE
// private slot
void kpMainWindow::slotScan ()