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

@@ -116,18 +116,15 @@ void MainWindowBase::setUniqueName(const QString &uniqueName)
}
}
bool MainWindowBase::fillFromDataStream(QDataStream &ds)
bool MainWindowBase::fillFromSaved(const LayoutSaver::MainWindow &mw)
{
int options;
ds >> options;
if (options != int(this->options())) {
if (mw.options != options()) {
qWarning() << Q_FUNC_INFO << "Refusing to restore MainWindow with different options"
<< "; expected=" << options << "; has=" << this->options();
<< "; expected=" << mw.options << "; has=" << options();
return false;
}
return dropArea()->multiSplitterLayout()->fillFromDataStream(ds);
return dropArea()->multiSplitterLayout()->fillFromSaved(mw.multiSplitterLayout);
}
QDataStream &KDDockWidgets::operator<<(QDataStream &ds, MainWindowBase *mainWindow)