Changeset View
Changeset View
Standalone View
Standalone View
kate/katemainwindow.cpp
Show First 20 Lines • Show All 1067 Lines • ▼ Show 20 Line(s) | 1067 | foreach(const KatePluginInfo & item, KateApp::self()->pluginManager()->pluginList()) { | |||
---|---|---|---|---|---|
1068 | if (item.plugin && pluginViews().contains(item.plugin)) { | 1068 | if (item.plugin && pluginViews().contains(item.plugin)) { | ||
1069 | if (auto interface = qobject_cast<KTextEditor::SessionConfigInterface *> (pluginViews().value(item.plugin))) { | 1069 | if (auto interface = qobject_cast<KTextEditor::SessionConfigInterface *> (pluginViews().value(item.plugin))) { | ||
1070 | KConfigGroup group(config.config(), QStringLiteral("Plugin:%1:MainWindow:%2").arg(item.saveName()).arg(id)); | 1070 | KConfigGroup group(config.config(), QStringLiteral("Plugin:%1:MainWindow:%2").arg(item.saveName()).arg(id)); | ||
1071 | interface->writeSessionConfig(group); | 1071 | interface->writeSessionConfig(group); | ||
1072 | } | 1072 | } | ||
1073 | } | 1073 | } | ||
1074 | } | 1074 | } | ||
1075 | 1075 | | |||
1076 | m_fileOpenRecent->saveEntries(KConfigGroup(config.config(), "Recent Files")); | 1076 | saveOpenRecent(config.config()); | ||
1077 | m_viewManager->saveViewConfiguration(config); | 1077 | m_viewManager->saveViewConfiguration(config); | ||
1078 | } | 1078 | } | ||
1079 | 1079 | | |||
1080 | void KateMainWindow::readProperties(const KConfigGroup &config) | 1080 | void KateMainWindow::readProperties(const KConfigGroup &config) | ||
1081 | { | 1081 | { | ||
1082 | // KDE5: TODO startRestore should take a const KConfigBase*, or even just a const KConfigGroup&, | 1082 | // KDE5: TODO startRestore should take a const KConfigBase*, or even just a const KConfigGroup&, | ||
1083 | // but this propagates down to interfaces/kate/plugin.h so all plugins have to be ported | 1083 | // but this propagates down to interfaces/kate/plugin.h so all plugins have to be ported | ||
1084 | KConfigBase *configBase = const_cast<KConfig *>(config.config()); | 1084 | KConfigBase *configBase = const_cast<KConfig *>(config.config()); | ||
1085 | startRestore(configBase, config.name()); | 1085 | startRestore(configBase, config.name()); | ||
1086 | 1086 | | |||
1087 | // perhaps enable plugin guis | 1087 | // perhaps enable plugin guis | ||
1088 | KateApp::self()->pluginManager()->enableAllPluginsGUI(this, configBase); | 1088 | KateApp::self()->pluginManager()->enableAllPluginsGUI(this, configBase); | ||
1089 | 1089 | | |||
1090 | finishRestore(); | 1090 | finishRestore(); | ||
1091 | 1091 | | |||
1092 | m_fileOpenRecent->loadEntries(KConfigGroup(config.config(), "Recent Files")); | 1092 | loadOpenRecent(config.config()); | ||
1093 | m_viewManager->restoreViewConfiguration(config); | 1093 | m_viewManager->restoreViewConfiguration(config); | ||
1094 | } | 1094 | } | ||
1095 | 1095 | | |||
1096 | void KateMainWindow::saveOpenRecent(KConfig *config) { | ||||
1097 | m_fileOpenRecent->saveEntries(KConfigGroup(config, "Recent Files")); | ||||
1098 | } | ||||
1099 | | ||||
1100 | void KateMainWindow::loadOpenRecent(const KConfig *config) { | ||||
1101 | m_fileOpenRecent->loadEntries(KConfigGroup(config, "Recent Files")); | ||||
1102 | } | ||||
1103 | | ||||
1096 | void KateMainWindow::saveGlobalProperties(KConfig *sessionConfig) | 1104 | void KateMainWindow::saveGlobalProperties(KConfig *sessionConfig) | ||
1097 | { | 1105 | { | ||
1098 | KateApp::self()->documentManager()->saveDocumentList(sessionConfig); | 1106 | KateApp::self()->documentManager()->saveDocumentList(sessionConfig); | ||
1099 | 1107 | | |||
1100 | KConfigGroup cg(sessionConfig, "General"); | 1108 | KConfigGroup cg(sessionConfig, "General"); | ||
1101 | cg.writeEntry("Last Session", KateApp::self()->sessionManager()->activeSession()->name()); | 1109 | cg.writeEntry("Last Session", KateApp::self()->sessionManager()->activeSession()->name()); | ||
1102 | 1110 | | |||
1103 | // save plugin config !! | 1111 | // save plugin config !! | ||
▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines |