Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/shell/workingsets/workingset.cpp
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Line(s) | 137 | foreach (Sublime::View* view, area->views()) { | |||
---|---|---|---|---|---|
142 | //otherwise we try to load kdev:// too early | 142 | //otherwise we try to load kdev:// too early | ||
143 | if (!KProtocolInfo::isKnownProtocol(QUrl(docSpec))) { | 143 | if (!KProtocolInfo::isKnownProtocol(QUrl(docSpec))) { | ||
144 | continue; | 144 | continue; | ||
145 | } | 145 | } | ||
146 | 146 | | |||
147 | setGroup.writeEntry(QStringLiteral("View %1").arg(index), docSpec); | 147 | setGroup.writeEntry(QStringLiteral("View %1").arg(index), docSpec); | ||
148 | //The area specific config stores the working set documents in order along with their state | 148 | //The area specific config stores the working set documents in order along with their state | ||
149 | areaGroup.writeEntry(QStringLiteral("View %1").arg(index), docSpec); | 149 | areaGroup.writeEntry(QStringLiteral("View %1").arg(index), docSpec); | ||
150 | areaGroup.writeEntry(QStringLiteral("View %1 State").arg(index), view->viewState()); | 150 | KConfigGroup viewGroup(&areaGroup, QStringLiteral("View %1 Config").arg(index)); | ||
151 | view->writeSessionConfig(viewGroup); | ||||
151 | ++index; | 152 | ++index; | ||
152 | } | 153 | } | ||
153 | } | 154 | } | ||
154 | } | 155 | } | ||
155 | 156 | | |||
156 | bool WorkingSet::isEmpty() const | 157 | bool WorkingSet::isEmpty() const | ||
157 | { | 158 | { | ||
158 | KConfigGroup setConfig(Core::self()->activeSession()->config(), "Working File Sets"); | 159 | KConfigGroup setConfig(Core::self()->activeSession()->config(), "Working File Sets"); | ||
▲ Show 20 Lines • Show All 175 Lines • ▼ Show 20 Line(s) | 314 | for (int i = 0; i < viewCount; ++i) { | |||
334 | } else { | 335 | } else { | ||
335 | qCWarning(SHELL) << "Unable to create view" << specifier; | 336 | qCWarning(SHELL) << "Unable to create view" << specifier; | ||
336 | } | 337 | } | ||
337 | } | 338 | } | ||
338 | 339 | | |||
339 | //Load state | 340 | //Load state | ||
340 | for (int i = 0; i < viewCount; ++i) | 341 | for (int i = 0; i < viewCount; ++i) | ||
341 | { | 342 | { | ||
342 | QString state = areaGroup.readEntry(QStringLiteral("View %1 State").arg(i)); | 343 | KConfigGroup viewGroup(&areaGroup, QStringLiteral("View %1 Config").arg(i)); | ||
343 | if (!state.isEmpty() && createdViews.contains(i)) | 344 | if (viewGroup.exists() && createdViews.contains(i)) | ||
344 | createdViews[i]->setState(state); | 345 | createdViews[i]->readSessionConfig(viewGroup); | ||
345 | } | 346 | } | ||
346 | } | 347 | } | ||
347 | } | 348 | } | ||
348 | 349 | | |||
349 | void deleteGroupRecursive(KConfigGroup group) { | 350 | void deleteGroupRecursive(KConfigGroup group) { | ||
350 | // qCDebug(SHELL) << "deleting" << group.name(); | 351 | // qCDebug(SHELL) << "deleting" << group.name(); | ||
351 | foreach(const QString& entry, group.entryMap().keys()) { | 352 | foreach(const QString& entry, group.entryMap().keys()) { | ||
352 | group.deleteEntry(entry); | 353 | group.deleteEntry(entry); | ||
▲ Show 20 Lines • Show All 212 Lines • Show Last 20 Lines |