Skip to content
Snippets Groups Projects
Commit 3e8ee920 authored by David Nolden's avatar David Nolden
Browse files

Fix a possible crash when working with split-views and when the working-set is...

Fix a possible crash when working with split-views and when the working-set is active in multiple areas.

It doesn't seem to be safe to clear one whole area while working on another one, so bring back the old updating code which only selectively closes views.
Clear the whole area on a higher level while switching working-sets, to make sure we sublime doesn't break while updating the views.
CCMAIL: kdevelop-devel@barney.cs.uni-potsdam.de
BUG: 277961
parent 502b7ec0
No related branches found
No related tags found
No related merge requests found
......@@ -303,11 +303,13 @@ void WorkingSetController::changedWorkingSet(Sublime::Area* area, const QString&
if (from == to)
return;
// We have to always clear the target area first, because else we cannot perform the switch safely
// (sublime doesn't accept all kinds of changes to the area structure)
area->clearViews(true);
if (!to.isEmpty()) {
WorkingSet* newSet = getWorkingSet(to);
newSet->loadToArea(area, area->rootIndex(), !from.isEmpty());
} else {
area->clearViews(true);
}
emit workingSetSwitched();
......
......@@ -179,14 +179,19 @@ void WorkingSet::loadToArea(Sublime::Area* area, Sublime::AreaIndex* areaIndex,
DisableMainWindowUpdatesFromArea updatesDisabler(area);
kDebug() << "loading working-set" << m_id << "into area" << area;
if(clear) {
kDebug() << "clearing area with working-set" << area->workingSet();
// We have to close all views, else we may get serious UI
// consistency problems when the documents intersect.
// Clear the views silently, because the user should be batch-asked
// before changing working sets.
area->clearViews(true);
QSet< QString > files = fileList().toSet();
foreach(Sublime::View* view, area->views()) {
Sublime::UrlDocument* doc = dynamic_cast<Sublime::UrlDocument*>(view->document());
if(!doc || !files.contains(doc->documentSpecifier()))
area->closeView(view);
}
}
KConfigGroup setConfig(Core::self()->activeSession()->config(), "Working File Sets");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment