Restoring now reads from the intermediate representation

Only the intermediate representation is filled in from the stream
now. TODO: GUI->intermediate.
This commit is contained in:
Sergio Martins
2019-09-20 17:24:22 +01:00
parent 1ecc42433b
commit 65c9693a62
19 changed files with 148 additions and 250 deletions

View File

@@ -540,16 +540,13 @@ void DockWidgetBase::onClosed(QCloseEvent *e)
d->close();
}
DockWidgetBase *DockWidgetBase::createFromDataStream(QDataStream &ds)
DockWidgetBase *DockWidgetBase::createFromSaved(LayoutSaver::DockWidget::Ptr saved)
{
QString name;
ds >> name;
DockWidgetBase *dw = DockRegistry::self()->dockByName(name);
DockWidgetBase *dw = DockRegistry::self()->dockByName(saved->uniqueName);
if (!dw) {
if (auto factoryFunc = Config::self().dockWidgetFactoryFunc()) {
// DockWidget doesn't exist, ask to create it
dw = factoryFunc(name);
dw = factoryFunc(saved->uniqueName);
}
}
@@ -558,7 +555,7 @@ DockWidgetBase *DockWidgetBase::createFromDataStream(QDataStream &ds)
w->setVisible(true);
dw->setProperty("kddockwidget_was_restored", true);
} else {
qWarning() << Q_FUNC_INFO << "Couldn't find dock widget" << name;
qWarning() << Q_FUNC_INFO << "Couldn't find dock widget" << saved->uniqueName;
}
return dw;