Paste P487

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Nov 1 2019, 1:51 PM.
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 17d9901f9b..a6fbd770c3 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -49,6 +49,7 @@
#include <KActionMenu>
#include <KAuthorized>
#include <KConfig>
+#include <KConfigGui>
#include <KDualAction>
#include <KFileItemListProperties>
#include <KHelpMenu>
@@ -201,6 +202,13 @@ DolphinMainWindow::DolphinMainWindow() :
DolphinMainWindow::~DolphinMainWindow()
{
+ if (true /*state and restore*/) {
+ KConfigGui::setSessionConfig(QStringLiteral("dolphin"), QStringLiteral("dolphin"));
+ KConfig *config = KConfigGui::sessionConfig();
+ saveGlobalProperties(config);
+ savePropertiesInternal(config, 1);
+ config->sync();
+ }
}
QVector<DolphinViewContainer*> DolphinMainWindow::viewContainers() const
diff --git a/src/main.cpp b/src/main.cpp
index 6cb6a11b5b..cb4db176f4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,6 +31,7 @@
#include <KDBusService>
#include <KLocalizedString>
#include <Kdelibs4ConfigMigrator>
+#include <KConfigGui>
#include <QApplication>
#include <QCommandLineParser>
@@ -173,7 +174,10 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
mainWindow->show();
- if (app.isSessionRestored()) {
+ if (!app.isSessionRestored()) {
+ KConfigGui::setSessionConfig(QStringLiteral("dolphin"), QStringLiteral("dolphin"));
+ }
+ if (true /**session restored || new restore flag*/ ) {
const QString className = KXmlGuiWindow::classNameOfToplevel(1);
if (className == QLatin1String("DolphinMainWindow")) {
mainWindow->restore(1);
davidedmundson edited the content of this paste. (Show Details)Nov 1 2019, 1:51 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.