EditorManager: Split reading the settings from actually doing anything

So we can add reading the settings just to retrieve a file list in a
second step.

Task-number: QTCREATORBUG-7660
Change-Id: I65856ab97bfe2ee69194d484926f83621fa85327
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Eike Ziller
2024-07-29 14:51:21 +02:00
parent 1b2493259c
commit 55615f63f7
2 changed files with 92 additions and 43 deletions

View File

@@ -22,6 +22,7 @@
#include <utils/fileutils.h>
#include <utils/icon.h>
#include <utils/layoutbuilder.h>
#include <utils/persistentsettings.h>
#include <utils/qtcassert.h>
#include <utils/stringutils.h>
#include <utils/stylehelper.h>
@@ -271,6 +272,18 @@ protected:
}
};
static FilePaths pathsForSessionName(const QString &session)
{
const FilePath fileName = SessionManager::sessionNameToFileName(session);
PersistentSettingsReader reader;
if (fileName.exists()) {
if (!reader.load(fileName))
return {};
}
// qDebug() << reader.restoreValue("EditorSettings").toByteArray();
return {};
}
class SessionDelegate : public BaseDelegate
{
protected:
@@ -479,6 +492,10 @@ public:
}
yy += s(VPaddingXxs);
}
if (projects.isEmpty()) {
// check if there are files to show instead
const FilePaths paths = pathsForSessionName(sessionName);
}
yy += s(VGapXs);
const QStringList actions = {