MCPcopy Create free account
hub / github.com/KDE/kdevelop / saveSessionConfig

Method saveSessionConfig

kdevplatform/shell/textdocument.cpp:122–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 }
121
122 void saveSessionConfig()
123 {
124 if(document && document->url().isValid()) {
125 // make sure only MAX_DOC_SETTINGS entries are stored
126 KConfigGroup katePartSettings = katePartSettingsGroup();
127 // ordered list of documents
128 QStringList documents = katePartSettings.readEntry("documents", QStringList());
129 // ensure this document is "new", i.e. at the end of the list
130 documents.removeOne(docConfigGroupName());
131 documents.append(docConfigGroupName());
132 // remove "old" documents + their group
133 while(documents.size() >= MAX_DOC_SETTINGS) {
134 katePartSettings.group(documents.takeFirst()).deleteGroup();
135 }
136 // update order
137 katePartSettings.writeEntry("documents", documents);
138
139 // actually save session config
140 KConfigGroup group = docConfigGroup();
141 document->writeSessionConfig(group);
142 }
143 }
144
145 void loadSessionConfig()
146 {

Callers 1

createViewWidgetMethod · 0.80

Calls 9

QStringListClass · 0.85
readEntryMethod · 0.80
removeOneMethod · 0.80
writeEntryMethod · 0.80
isValidMethod · 0.45
urlMethod · 0.45
appendMethod · 0.45
sizeMethod · 0.45
writeSessionConfigMethod · 0.45

Tested by

no test coverage detected