forked from qt-creator/qt-creator
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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user