2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2008-12-02 16:19:05 +01:00
|
|
|
|
|
|
|
|
#include "session.h"
|
|
|
|
|
|
2023-02-28 17:37:59 +01:00
|
|
|
#include "session_p.h"
|
2023-05-22 14:56:33 +02:00
|
|
|
#include "sessiondialog.h"
|
2023-02-28 17:37:59 +01:00
|
|
|
|
2023-05-15 10:31:33 +02:00
|
|
|
#include "projectexplorer.h"
|
2023-01-13 12:38:22 +01:00
|
|
|
#include "projectexplorertr.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2023-05-15 10:31:33 +02:00
|
|
|
#include <extensionsystem/pluginmanager.h>
|
|
|
|
|
#include <extensionsystem/pluginspec.h>
|
|
|
|
|
|
2023-05-23 12:25:47 +02:00
|
|
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
|
|
|
|
#include <coreplugin/actionmanager/actionmanager.h>
|
2017-12-04 10:41:46 +01:00
|
|
|
#include <coreplugin/coreconstants.h>
|
|
|
|
|
#include <coreplugin/editormanager/editormanager.h>
|
2021-10-21 15:39:28 +02:00
|
|
|
#include <coreplugin/foldernavigationwidget.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <coreplugin/icore.h>
|
2015-02-26 13:38:54 +01:00
|
|
|
#include <coreplugin/idocument.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <coreplugin/imode.h>
|
|
|
|
|
#include <coreplugin/modemanager.h>
|
2017-12-04 10:41:46 +01:00
|
|
|
#include <coreplugin/progressmanager/progressmanager.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-09-26 09:14:03 +02:00
|
|
|
#include <texteditor/texteditor.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-07-07 19:02:26 +02:00
|
|
|
#include <utils/algorithm.h>
|
2022-11-09 16:07:09 +01:00
|
|
|
#include <utils/filepath.h>
|
2022-07-27 14:18:48 +02:00
|
|
|
#include <utils/qtcassert.h>
|
2023-05-23 12:25:47 +02:00
|
|
|
#include <utils/stringutils.h>
|
2012-03-12 13:03:26 +01:00
|
|
|
#include <utils/stylehelper.h>
|
2022-07-27 12:27:41 +02:00
|
|
|
#include <utils/qtcassert.h>
|
2008-12-09 15:25:01 +01:00
|
|
|
|
2023-05-23 12:25:47 +02:00
|
|
|
#include <QAction>
|
|
|
|
|
#include <QActionGroup>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QDebug>
|
2023-05-23 12:25:47 +02:00
|
|
|
#include <QMenu>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QMessageBox>
|
|
|
|
|
#include <QPushButton>
|
2023-05-15 10:31:33 +02:00
|
|
|
#include <QTimer>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2011-09-02 17:15:18 +02:00
|
|
|
using namespace Core;
|
2023-05-22 13:45:27 +02:00
|
|
|
using namespace ExtensionSystem;
|
2013-09-05 11:46:07 +02:00
|
|
|
using namespace Utils;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-09-05 11:46:07 +02:00
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
|
2021-12-21 16:40:59 +01:00
|
|
|
const char DEFAULT_SESSION[] = "default";
|
2022-10-20 17:53:09 +02:00
|
|
|
const char LAST_ACTIVE_TIMES_KEY[] = "LastActiveTimes";
|
2023-05-12 15:25:28 +02:00
|
|
|
const char STARTUPSESSION_KEY[] = "ProjectExplorer/SessionToRestore";
|
|
|
|
|
const char LASTSESSION_KEY[] = "ProjectExplorer/StartupSession";
|
2023-05-15 10:31:33 +02:00
|
|
|
const char AUTO_RESTORE_SESSION_SETTINGS_KEY[] = "ProjectExplorer/Settings/AutoRestoreLastSession";
|
|
|
|
|
static bool kIsAutoRestoreLastSessionDefault = false;
|
2023-05-23 12:25:47 +02:00
|
|
|
const char M_SESSION[] = "ProjectExplorer.Menu.Session";
|
2021-12-21 16:40:59 +01:00
|
|
|
|
2011-04-14 12:58:14 +02:00
|
|
|
/*!
|
|
|
|
|
\class ProjectExplorer::SessionManager
|
|
|
|
|
|
2013-06-05 14:29:24 +02:00
|
|
|
\brief The SessionManager class manages sessions.
|
2011-04-14 12:58:14 +02:00
|
|
|
|
|
|
|
|
TODO the interface of this class is not really great.
|
2013-09-10 17:16:10 +02:00
|
|
|
The implementation suffers from that all the functions from the
|
|
|
|
|
public interface just wrap around functions which do the actual work.
|
2011-04-14 12:58:14 +02:00
|
|
|
This could be improved.
|
|
|
|
|
*/
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2023-02-28 17:37:59 +01:00
|
|
|
static SessionManager *m_instance = nullptr;
|
|
|
|
|
SessionManagerPrivate *sb_d = nullptr;
|
2017-09-26 17:19:00 +02:00
|
|
|
|
2023-02-14 15:47:22 +01:00
|
|
|
SessionManager::SessionManager()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2023-02-28 17:37:59 +01:00
|
|
|
m_instance = this;
|
2023-02-14 15:47:22 +01:00
|
|
|
sb_d = new SessionManagerPrivate;
|
2013-09-05 11:46:07 +02:00
|
|
|
|
2023-05-15 10:31:33 +02:00
|
|
|
connect(ICore::instance(), &ICore::coreOpened, this, [] { sb_d->restoreStartupSession(); });
|
|
|
|
|
|
2015-02-23 14:06:58 +01:00
|
|
|
connect(ModeManager::instance(), &ModeManager::currentModeChanged,
|
|
|
|
|
this, &SessionManager::saveActiveMode);
|
2010-03-03 15:54:32 +01:00
|
|
|
|
2023-05-22 13:45:27 +02:00
|
|
|
connect(ICore::instance(), &ICore::saveSettingsRequested, this, [] { sb_d->saveSettings(); });
|
2022-10-20 17:53:09 +02:00
|
|
|
|
2015-02-23 14:06:58 +01:00
|
|
|
connect(EditorManager::instance(), &EditorManager::editorOpened,
|
2018-05-25 17:06:42 +02:00
|
|
|
this, &SessionManager::markSessionFileDirty);
|
2015-02-23 14:06:58 +01:00
|
|
|
connect(EditorManager::instance(), &EditorManager::editorsClosed,
|
2018-05-25 17:06:42 +02:00
|
|
|
this, &SessionManager::markSessionFileDirty);
|
2023-05-22 13:45:27 +02:00
|
|
|
connect(EditorManager::instance(), &EditorManager::autoSaved, this, [] {
|
|
|
|
|
if (!PluginManager::isShuttingDown() && !SessionManager::loadingSession())
|
|
|
|
|
SessionManager::saveSession();
|
|
|
|
|
});
|
|
|
|
|
|
2023-05-23 12:25:47 +02:00
|
|
|
// session menu
|
|
|
|
|
ActionContainer *mfile = ActionManager::actionContainer(Core::Constants::M_FILE);
|
|
|
|
|
ActionContainer *msession = ActionManager::createMenu(M_SESSION);
|
|
|
|
|
msession->menu()->setTitle(Tr::tr("S&essions"));
|
|
|
|
|
msession->setOnAllDisabledBehavior(ActionContainer::Show);
|
|
|
|
|
mfile->addMenu(msession, Core::Constants::G_FILE_OPEN);
|
|
|
|
|
sb_d->m_sessionMenu = msession->menu();
|
|
|
|
|
connect(mfile->menu(), &QMenu::aboutToShow, this, [] { sb_d->updateSessionMenu(); });
|
|
|
|
|
|
|
|
|
|
// session manager action
|
|
|
|
|
sb_d->m_sessionManagerAction = new QAction(Tr::tr("&Manage..."), this);
|
|
|
|
|
sb_d->m_sessionMenu->addAction(sb_d->m_sessionManagerAction);
|
|
|
|
|
sb_d->m_sessionMenu->addSeparator();
|
|
|
|
|
Command *cmd = ActionManager::registerAction(sb_d->m_sessionManagerAction,
|
|
|
|
|
"ProjectExplorer.ManageSessions");
|
|
|
|
|
cmd->setDefaultKeySequence(QKeySequence());
|
|
|
|
|
connect(sb_d->m_sessionManagerAction,
|
|
|
|
|
&QAction::triggered,
|
|
|
|
|
SessionManager::instance(),
|
|
|
|
|
&SessionManager::showSessionManager);
|
|
|
|
|
|
2023-05-22 13:45:27 +02:00
|
|
|
sb_d->restoreSettings();
|
2009-01-20 17:14:00 +01:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
SessionManager::~SessionManager()
|
2023-02-14 15:47:22 +01:00
|
|
|
{
|
2023-02-28 17:37:59 +01:00
|
|
|
emit m_instance->aboutToUnloadSession(sb_d->m_sessionName);
|
2023-02-14 15:47:22 +01:00
|
|
|
delete sb_d->m_writer;
|
|
|
|
|
delete sb_d;
|
|
|
|
|
sb_d = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-09 16:46:13 +02:00
|
|
|
SessionManager *SessionManager::instance()
|
2013-09-05 11:46:07 +02:00
|
|
|
{
|
|
|
|
|
return m_instance;
|
|
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-09-05 11:46:07 +02:00
|
|
|
bool SessionManager::isDefaultVirgin()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2023-02-14 15:47:22 +01:00
|
|
|
return isDefaultSession(sb_d->m_sessionName) && sb_d->m_virginSession;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-09-05 11:46:07 +02:00
|
|
|
bool SessionManager::isDefaultSession(const QString &session)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2021-12-21 16:40:59 +01:00
|
|
|
return session == QLatin1String(DEFAULT_SESSION);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2016-03-25 20:00:19 +01:00
|
|
|
void SessionManager::saveActiveMode(Id mode)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2016-03-25 20:00:19 +01:00
|
|
|
if (mode != Core::Constants::MODE_WELCOME)
|
|
|
|
|
setValue(QLatin1String("ActiveMode"), mode.toString());
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2012-05-31 13:02:08 +02:00
|
|
|
bool SessionManager::loadingSession()
|
|
|
|
|
{
|
2023-02-14 15:47:22 +01:00
|
|
|
return sb_d->m_loadingSession;
|
2012-05-31 13:02:08 +02:00
|
|
|
}
|
|
|
|
|
|
2011-04-14 12:58:14 +02:00
|
|
|
/*!
|
2013-09-10 17:16:10 +02:00
|
|
|
Lets other plugins store persistent values within the session file.
|
2011-04-14 12:58:14 +02:00
|
|
|
*/
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
void SessionManager::setValue(const QString &name, const QVariant &value)
|
|
|
|
|
{
|
2023-02-14 15:47:22 +01:00
|
|
|
if (sb_d->m_values.value(name) == value)
|
2010-03-03 15:54:32 +01:00
|
|
|
return;
|
2023-02-14 15:47:22 +01:00
|
|
|
sb_d->m_values.insert(name, value);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVariant SessionManager::value(const QString &name)
|
|
|
|
|
{
|
2023-02-14 15:47:22 +01:00
|
|
|
auto it = sb_d->m_values.constFind(name);
|
|
|
|
|
return (it == sb_d->m_values.constEnd()) ? QVariant() : *it;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2023-05-15 15:19:01 +02:00
|
|
|
void SessionManager::setSessionValue(const QString &name, const QVariant &value)
|
|
|
|
|
{
|
|
|
|
|
sb_d->m_sessionValues.insert(name, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVariant SessionManager::sessionValue(const QString &name, const QVariant &defaultValue)
|
|
|
|
|
{
|
|
|
|
|
auto it = sb_d->m_sessionValues.constFind(name);
|
|
|
|
|
return (it == sb_d->m_sessionValues.constEnd()) ? defaultValue : *it;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-05 11:46:07 +02:00
|
|
|
QString SessionManager::activeSession()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2023-02-14 15:47:22 +01:00
|
|
|
return sb_d->m_sessionName;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-09-05 11:46:07 +02:00
|
|
|
QStringList SessionManager::sessions()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2023-02-14 15:47:22 +01:00
|
|
|
if (sb_d->m_sessions.isEmpty()) {
|
2010-01-11 10:22:55 +01:00
|
|
|
// We are not initialized yet, so do that now
|
2022-01-27 10:30:09 +01:00
|
|
|
const FilePaths sessionFiles =
|
|
|
|
|
ICore::userResourcePath().dirEntries({{"*qws"}}, QDir::Time | QDir::Reversed);
|
2022-10-20 17:53:09 +02:00
|
|
|
const QVariantMap lastActiveTimes = ICore::settings()->value(LAST_ACTIVE_TIMES_KEY).toMap();
|
2021-06-29 17:51:56 +02:00
|
|
|
for (const FilePath &file : sessionFiles) {
|
|
|
|
|
const QString &name = file.completeBaseName();
|
2023-02-14 15:47:22 +01:00
|
|
|
sb_d->m_sessionDateTimes.insert(name, file.lastModified());
|
2022-10-20 17:53:09 +02:00
|
|
|
const auto lastActiveTime = lastActiveTimes.find(name);
|
2023-02-14 15:47:22 +01:00
|
|
|
sb_d->m_lastActiveTimes.insert(name, lastActiveTime != lastActiveTimes.end()
|
2022-10-20 17:53:09 +02:00
|
|
|
? lastActiveTime->toDateTime()
|
|
|
|
|
: file.lastModified());
|
2021-12-21 16:40:59 +01:00
|
|
|
if (name != QLatin1String(DEFAULT_SESSION))
|
2023-02-14 15:47:22 +01:00
|
|
|
sb_d->m_sessions << name;
|
2009-06-18 11:36:39 +02:00
|
|
|
}
|
2023-02-14 15:47:22 +01:00
|
|
|
sb_d->m_sessions.prepend(QLatin1String(DEFAULT_SESSION));
|
2009-06-18 11:36:39 +02:00
|
|
|
}
|
2023-02-14 15:47:22 +01:00
|
|
|
return sb_d->m_sessions;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2016-09-23 19:14:50 +02:00
|
|
|
QDateTime SessionManager::sessionDateTime(const QString &session)
|
|
|
|
|
{
|
2023-02-14 15:47:22 +01:00
|
|
|
return sb_d->m_sessionDateTimes.value(session);
|
2016-09-23 19:14:50 +02:00
|
|
|
}
|
|
|
|
|
|
2022-10-20 17:53:09 +02:00
|
|
|
QDateTime SessionManager::lastActiveTime(const QString &session)
|
|
|
|
|
{
|
2023-02-14 15:47:22 +01:00
|
|
|
return sb_d->m_lastActiveTimes.value(session);
|
2022-10-20 17:53:09 +02:00
|
|
|
}
|
|
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
FilePath SessionManager::sessionNameToFileName(const QString &session)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2021-04-26 15:46:09 +02:00
|
|
|
return ICore::userResourcePath(session + ".qws");
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2011-04-14 12:58:14 +02:00
|
|
|
/*!
|
2013-09-10 17:16:10 +02:00
|
|
|
Creates \a session, but does not actually create the file.
|
2011-04-14 12:58:14 +02:00
|
|
|
*/
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
bool SessionManager::createSession(const QString &session)
|
|
|
|
|
{
|
|
|
|
|
if (sessions().contains(session))
|
|
|
|
|
return false;
|
2023-02-14 15:47:22 +01:00
|
|
|
Q_ASSERT(sb_d->m_sessions.size() > 0);
|
|
|
|
|
sb_d->m_sessions.insert(1, session);
|
|
|
|
|
sb_d->m_lastActiveTimes.insert(session, QDateTime::currentDateTime());
|
2023-05-22 14:56:33 +02:00
|
|
|
emit instance()->sessionCreated(session);
|
2008-12-02 12:01:29 +01:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2010-04-21 16:08:13 +02:00
|
|
|
bool SessionManager::renameSession(const QString &original, const QString &newName)
|
|
|
|
|
{
|
|
|
|
|
if (!cloneSession(original, newName))
|
|
|
|
|
return false;
|
|
|
|
|
if (original == activeSession())
|
2023-05-15 16:09:56 +02:00
|
|
|
loadSession(newName);
|
2021-11-23 17:04:13 +01:00
|
|
|
emit instance()->sessionRenamed(original, newName);
|
2010-04-21 16:08:13 +02:00
|
|
|
return deleteSession(original);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-22 14:56:33 +02:00
|
|
|
void SessionManager::showSessionManager()
|
|
|
|
|
{
|
|
|
|
|
saveSession();
|
|
|
|
|
Internal::SessionDialog sessionDialog(ICore::dialogParent());
|
|
|
|
|
sessionDialog.setAutoLoadSession(sb_d->isAutoRestoreLastSession());
|
|
|
|
|
sessionDialog.exec();
|
|
|
|
|
sb_d->setAutoRestoreLastSession(sessionDialog.autoLoadSession());
|
|
|
|
|
}
|
2013-05-23 15:51:50 +02:00
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
\brief Shows a dialog asking the user to confirm deleting the session \p session
|
|
|
|
|
*/
|
2019-05-09 16:21:42 +02:00
|
|
|
bool SessionManager::confirmSessionDelete(const QStringList &sessions)
|
2013-05-23 15:51:50 +02:00
|
|
|
{
|
2023-01-13 12:38:22 +01:00
|
|
|
const QString title = sessions.size() == 1 ? Tr::tr("Delete Session") : Tr::tr("Delete Sessions");
|
2019-05-09 16:21:42 +02:00
|
|
|
const QString question = sessions.size() == 1
|
2023-01-13 12:38:22 +01:00
|
|
|
? Tr::tr("Delete session %1?").arg(sessions.first())
|
|
|
|
|
: Tr::tr("Delete these sessions?\n %1").arg(sessions.join("\n "));
|
2020-06-02 09:10:40 +02:00
|
|
|
return QMessageBox::question(ICore::dialogParent(),
|
2019-05-09 16:21:42 +02:00
|
|
|
title,
|
|
|
|
|
question,
|
2013-05-23 15:51:50 +02:00
|
|
|
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes;
|
|
|
|
|
}
|
|
|
|
|
|
2011-04-14 12:58:14 +02:00
|
|
|
/*!
|
2013-09-10 17:16:10 +02:00
|
|
|
Deletes \a session name from session list and the file from disk.
|
2011-04-14 12:58:14 +02:00
|
|
|
*/
|
2008-12-02 12:01:29 +01:00
|
|
|
bool SessionManager::deleteSession(const QString &session)
|
|
|
|
|
{
|
2023-02-14 15:47:22 +01:00
|
|
|
if (!sb_d->m_sessions.contains(session))
|
2008-12-02 12:01:29 +01:00
|
|
|
return false;
|
2023-02-14 15:47:22 +01:00
|
|
|
sb_d->m_sessions.removeOne(session);
|
|
|
|
|
sb_d->m_lastActiveTimes.remove(session);
|
2021-11-23 17:04:13 +01:00
|
|
|
emit instance()->sessionRemoved(session);
|
2022-11-09 16:07:09 +01:00
|
|
|
FilePath sessionFile = sessionNameToFileName(session);
|
|
|
|
|
if (sessionFile.exists())
|
|
|
|
|
return sessionFile.removeFile();
|
2008-12-02 12:01:29 +01:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-09 16:21:42 +02:00
|
|
|
void SessionManager::deleteSessions(const QStringList &sessions)
|
|
|
|
|
{
|
|
|
|
|
for (const QString &session : sessions)
|
|
|
|
|
deleteSession(session);
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
bool SessionManager::cloneSession(const QString &original, const QString &clone)
|
|
|
|
|
{
|
2023-02-14 15:47:22 +01:00
|
|
|
if (!sb_d->m_sessions.contains(original))
|
2008-12-02 12:01:29 +01:00
|
|
|
return false;
|
|
|
|
|
|
2022-11-09 16:07:09 +01:00
|
|
|
FilePath sessionFile = sessionNameToFileName(original);
|
2008-12-02 12:01:29 +01:00
|
|
|
// If the file does not exist, we can still clone
|
2022-11-09 16:07:09 +01:00
|
|
|
if (!sessionFile.exists() || sessionFile.copyFile(sessionNameToFileName(clone))) {
|
2023-02-14 15:47:22 +01:00
|
|
|
sb_d->m_sessions.insert(1, clone);
|
|
|
|
|
sb_d->m_sessionDateTimes.insert(clone, sessionNameToFileName(clone).lastModified());
|
2023-05-22 14:56:33 +02:00
|
|
|
emit instance()->sessionCreated(clone);
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-15 10:31:33 +02:00
|
|
|
static QString determineSessionToRestoreAtStartup()
|
|
|
|
|
{
|
|
|
|
|
// TODO (session) move argument to core
|
|
|
|
|
// Process command line arguments first:
|
2023-05-22 13:45:27 +02:00
|
|
|
const bool lastSessionArg = PluginManager::specForPlugin(ProjectExplorerPlugin::instance())
|
2023-05-15 10:31:33 +02:00
|
|
|
->arguments()
|
|
|
|
|
.contains("-lastsession");
|
|
|
|
|
if (lastSessionArg && !SessionManager::startupSession().isEmpty())
|
|
|
|
|
return SessionManager::startupSession();
|
2023-05-22 13:45:27 +02:00
|
|
|
const QStringList arguments = PluginManager::arguments();
|
2023-05-15 10:31:33 +02:00
|
|
|
QStringList sessions = SessionManager::sessions();
|
|
|
|
|
// We have command line arguments, try to find a session in them
|
|
|
|
|
// Default to no session loading
|
|
|
|
|
for (const QString &arg : arguments) {
|
|
|
|
|
if (sessions.contains(arg)) {
|
|
|
|
|
// Session argument
|
|
|
|
|
return arg;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Handle settings only after command line arguments:
|
|
|
|
|
if (sb_d->m_isAutoRestoreLastSession)
|
|
|
|
|
return SessionManager::startupSession();
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SessionManagerPrivate::restoreStartupSession()
|
|
|
|
|
{
|
|
|
|
|
m_isStartupSessionRestored = true;
|
|
|
|
|
QString sessionToRestoreAtStartup = determineSessionToRestoreAtStartup();
|
|
|
|
|
if (!sessionToRestoreAtStartup.isEmpty())
|
|
|
|
|
ModeManager::activateMode(Core::Constants::MODE_EDIT);
|
|
|
|
|
|
|
|
|
|
// We have command line arguments, try to find a session in them
|
2023-05-22 13:45:27 +02:00
|
|
|
QStringList arguments = PluginManager::arguments();
|
2023-05-15 10:31:33 +02:00
|
|
|
if (!sessionToRestoreAtStartup.isEmpty() && !arguments.isEmpty())
|
|
|
|
|
arguments.removeOne(sessionToRestoreAtStartup);
|
|
|
|
|
|
|
|
|
|
// Massage the argument list.
|
|
|
|
|
// Be smart about directories: If there is a session of that name, load it.
|
|
|
|
|
// Other than that, look for project files in it. The idea is to achieve
|
|
|
|
|
// 'Do what I mean' functionality when starting Creator in a directory with
|
|
|
|
|
// the single command line argument '.' and avoid editor warnings about not
|
|
|
|
|
// being able to open directories.
|
|
|
|
|
// In addition, convert "filename" "+45" or "filename" ":23" into
|
|
|
|
|
// "filename+45" and "filename:23".
|
|
|
|
|
if (!arguments.isEmpty()) {
|
|
|
|
|
const QStringList sessions = SessionManager::sessions();
|
|
|
|
|
for (int a = 0; a < arguments.size();) {
|
|
|
|
|
const QString &arg = arguments.at(a);
|
|
|
|
|
const QFileInfo fi(arg);
|
|
|
|
|
if (fi.isDir()) {
|
|
|
|
|
const QDir dir(fi.absoluteFilePath());
|
|
|
|
|
// Does the directory name match a session?
|
|
|
|
|
if (sessionToRestoreAtStartup.isEmpty() && sessions.contains(dir.dirName())) {
|
|
|
|
|
sessionToRestoreAtStartup = dir.dirName();
|
|
|
|
|
arguments.removeAt(a);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
} // Done directories.
|
|
|
|
|
// Converts "filename" "+45" or "filename" ":23" into "filename+45" and "filename:23"
|
|
|
|
|
if (a && (arg.startsWith(QLatin1Char('+')) || arg.startsWith(QLatin1Char(':')))) {
|
|
|
|
|
arguments[a - 1].append(arguments.takeAt(a));
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
++a;
|
|
|
|
|
} // for arguments
|
|
|
|
|
} // !arguments.isEmpty()
|
|
|
|
|
|
|
|
|
|
// Restore latest session or what was passed on the command line
|
2023-05-15 16:09:56 +02:00
|
|
|
SessionManager::loadSession(!sessionToRestoreAtStartup.isEmpty() ? sessionToRestoreAtStartup
|
2023-05-15 10:31:33 +02:00
|
|
|
: QString(),
|
|
|
|
|
true);
|
|
|
|
|
|
|
|
|
|
// delay opening projects from the command line even more
|
|
|
|
|
QTimer::singleShot(0, m_instance, [arguments] {
|
|
|
|
|
ICore::openFiles(Utils::transform(arguments, &FilePath::fromUserInput),
|
|
|
|
|
ICore::OpenFilesFlags(ICore::CanContainLineAndColumnNumbers
|
|
|
|
|
| ICore::SwitchMode));
|
|
|
|
|
emit m_instance->startupSessionRestored();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SessionManagerPrivate::saveSettings()
|
|
|
|
|
{
|
2023-05-22 13:45:27 +02:00
|
|
|
QtcSettings *s = ICore::settings();
|
|
|
|
|
QVariantMap times;
|
|
|
|
|
for (auto it = sb_d->m_lastActiveTimes.cbegin(); it != sb_d->m_lastActiveTimes.cend(); ++it)
|
|
|
|
|
times.insert(it.key(), it.value());
|
|
|
|
|
s->setValue(LAST_ACTIVE_TIMES_KEY, times);
|
|
|
|
|
if (SessionManager::isDefaultVirgin()) {
|
|
|
|
|
s->remove(STARTUPSESSION_KEY);
|
|
|
|
|
} else {
|
|
|
|
|
s->setValue(STARTUPSESSION_KEY, SessionManager::activeSession());
|
|
|
|
|
s->setValue(LASTSESSION_KEY, SessionManager::activeSession());
|
|
|
|
|
}
|
|
|
|
|
s->setValueWithDefault(AUTO_RESTORE_SESSION_SETTINGS_KEY,
|
|
|
|
|
sb_d->m_isAutoRestoreLastSession,
|
|
|
|
|
kIsAutoRestoreLastSessionDefault);
|
2023-05-15 10:31:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SessionManagerPrivate::restoreSettings()
|
|
|
|
|
{
|
|
|
|
|
sb_d->m_isAutoRestoreLastSession = ICore::settings()
|
|
|
|
|
->value(AUTO_RESTORE_SESSION_SETTINGS_KEY,
|
|
|
|
|
kIsAutoRestoreLastSessionDefault)
|
|
|
|
|
.toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool SessionManagerPrivate::isAutoRestoreLastSession()
|
|
|
|
|
{
|
|
|
|
|
return sb_d->m_isAutoRestoreLastSession;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SessionManagerPrivate::setAutoRestoreLastSession(bool restore)
|
|
|
|
|
{
|
|
|
|
|
sb_d->m_isAutoRestoreLastSession = restore;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-23 12:25:47 +02:00
|
|
|
void SessionManagerPrivate::updateSessionMenu()
|
|
|
|
|
{
|
|
|
|
|
// Delete group of previous actions (the actions are owned by the group and are deleted with it)
|
|
|
|
|
auto oldGroup = m_sessionMenu->findChild<QActionGroup *>();
|
|
|
|
|
if (oldGroup)
|
|
|
|
|
delete oldGroup;
|
|
|
|
|
m_sessionMenu->clear();
|
|
|
|
|
|
|
|
|
|
m_sessionMenu->addAction(m_sessionManagerAction);
|
|
|
|
|
m_sessionMenu->addSeparator();
|
|
|
|
|
auto *ag = new QActionGroup(m_sessionMenu);
|
|
|
|
|
const QString activeSession = SessionManager::activeSession();
|
|
|
|
|
const bool isDefaultVirgin = SessionManager::isDefaultVirgin();
|
|
|
|
|
|
|
|
|
|
QStringList sessions = SessionManager::sessions();
|
|
|
|
|
std::sort(std::next(sessions.begin()), sessions.end(), [](const QString &s1, const QString &s2) {
|
|
|
|
|
return SessionManager::lastActiveTime(s1) > SessionManager::lastActiveTime(s2);
|
|
|
|
|
});
|
|
|
|
|
for (int i = 0; i < sessions.size(); ++i) {
|
|
|
|
|
const QString &session = sessions[i];
|
|
|
|
|
|
|
|
|
|
const QString actionText
|
|
|
|
|
= ActionManager::withNumberAccelerator(Utils::quoteAmpersands(session), i + 1);
|
|
|
|
|
QAction *act = ag->addAction(actionText);
|
|
|
|
|
act->setCheckable(true);
|
|
|
|
|
if (session == activeSession && !isDefaultVirgin)
|
|
|
|
|
act->setChecked(true);
|
|
|
|
|
QObject::connect(act, &QAction::triggered, SessionManager::instance(), [session] {
|
|
|
|
|
SessionManager::loadSession(session);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
m_sessionMenu->addActions(ag->actions());
|
|
|
|
|
m_sessionMenu->setEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-05 11:46:07 +02:00
|
|
|
void SessionManagerPrivate::restoreValues(const PersistentSettingsReader &reader)
|
2012-02-10 12:46:33 +01:00
|
|
|
{
|
2013-09-05 11:46:07 +02:00
|
|
|
const QStringList keys = reader.restoreValue(QLatin1String("valueKeys")).toStringList();
|
2022-05-03 16:48:36 +02:00
|
|
|
for (const QString &key : keys) {
|
2012-02-10 12:46:33 +01:00
|
|
|
QVariant value = reader.restoreValue(QLatin1String("value-") + key);
|
|
|
|
|
m_values.insert(key, value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-15 15:19:01 +02:00
|
|
|
void SessionManagerPrivate::restoreSessionValues(const PersistentSettingsReader &reader)
|
2012-02-10 12:46:33 +01:00
|
|
|
{
|
2023-05-15 15:19:01 +02:00
|
|
|
const QVariantMap values = reader.restoreValues();
|
|
|
|
|
// restore toplevel items that are not restored by restoreValues
|
|
|
|
|
const auto end = values.constEnd();
|
|
|
|
|
for (auto it = values.constBegin(); it != end; ++it) {
|
|
|
|
|
if (it.key() == "valueKeys" || it.key().startsWith("value-"))
|
|
|
|
|
continue;
|
|
|
|
|
m_sessionValues.insert(it.key(), it.value());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SessionManagerPrivate::restoreEditors()
|
|
|
|
|
{
|
|
|
|
|
const QVariant editorsettings = m_sessionValues.value("EditorSettings");
|
2012-02-10 12:46:33 +01:00
|
|
|
if (editorsettings.isValid()) {
|
2013-08-29 17:17:24 +02:00
|
|
|
EditorManager::restoreState(QByteArray::fromBase64(editorsettings.toByteArray()));
|
2023-05-15 15:19:01 +02:00
|
|
|
SessionManager::sessionLoadingProgress();
|
2012-02-10 12:46:33 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-08 10:51:06 +01:00
|
|
|
/*!
|
|
|
|
|
Returns the last session that was opened by the user.
|
|
|
|
|
*/
|
2013-09-05 11:46:07 +02:00
|
|
|
QString SessionManager::lastSession()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2023-05-12 15:25:28 +02:00
|
|
|
return ICore::settings()->value(LASTSESSION_KEY).toString();
|
2020-01-07 12:34:31 +01:00
|
|
|
}
|
|
|
|
|
|
2020-01-08 10:51:06 +01:00
|
|
|
/*!
|
|
|
|
|
Returns the session that was active when Qt Creator was last closed, if any.
|
|
|
|
|
*/
|
2020-01-07 12:34:31 +01:00
|
|
|
QString SessionManager::startupSession()
|
|
|
|
|
{
|
2023-05-12 15:25:28 +02:00
|
|
|
return ICore::settings()->value(STARTUPSESSION_KEY).toString();
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2018-05-25 17:06:42 +02:00
|
|
|
void SessionManager::markSessionFileDirty()
|
2010-03-03 15:54:32 +01:00
|
|
|
{
|
2023-02-14 15:47:22 +01:00
|
|
|
sb_d->m_virginSession = false;
|
2010-03-03 15:54:32 +01:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2023-05-15 15:19:01 +02:00
|
|
|
void SessionManager::sessionLoadingProgress()
|
2012-02-06 16:45:03 +01:00
|
|
|
{
|
2023-05-15 15:19:01 +02:00
|
|
|
sb_d->m_future.setProgressValue(sb_d->m_future.progressValue() + 1);
|
2012-02-06 16:45:03 +01:00
|
|
|
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
|
|
|
|
}
|
2012-02-23 17:50:30 +01:00
|
|
|
|
2023-05-15 15:19:01 +02:00
|
|
|
void SessionManager::addSessionLoadingSteps(int steps)
|
|
|
|
|
{
|
|
|
|
|
sb_d->m_future.setProgressRange(0, sb_d->m_future.progressMaximum() + steps);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-15 16:09:56 +02:00
|
|
|
/*
|
|
|
|
|
* ========== Notes on storing and loading the default session ==========
|
|
|
|
|
* The default session comes in two flavors: implicit and explicit. The implicit one,
|
|
|
|
|
* also referred to as "default virgin" in the code base, is the one that is active
|
|
|
|
|
* at start-up, if no session has been explicitly loaded due to command-line arguments
|
|
|
|
|
* or the "restore last session" setting in the session manager.
|
|
|
|
|
* The implicit default session silently turns into the explicit default session
|
|
|
|
|
* by loading a project or a file or changing settings in the Dependencies panel. The explicit
|
|
|
|
|
* default session can also be loaded by the user via the Welcome Screen.
|
|
|
|
|
* This mechanism somewhat complicates the handling of session-specific settings such as
|
|
|
|
|
* the ones in the task pane: Users expect that changes they make there become persistent, even
|
|
|
|
|
* when they are in the implicit default session. However, we can't just blindly store
|
|
|
|
|
* the implicit default session, because then we'd overwrite the project list of the explicit
|
|
|
|
|
* default session. Therefore, we use the following logic:
|
|
|
|
|
* - Upon start-up, if no session is to be explicitly loaded, we restore the parts of the
|
|
|
|
|
* explicit default session that are not related to projects, editors etc; the
|
|
|
|
|
* "general settings" of the session, so to speak.
|
|
|
|
|
* - When storing the implicit default session, we overwrite only these "general settings"
|
|
|
|
|
* of the explicit default session and keep the others as they are.
|
|
|
|
|
* - When switching from the implicit to the explicit default session, we keep the
|
|
|
|
|
* "general settings" and load everything else from the session file.
|
|
|
|
|
* This guarantees that user changes are properly transferred and nothing gets lost from
|
|
|
|
|
* either the implicit or the explicit default session.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
bool SessionManager::loadSession(const QString &session, bool initial)
|
|
|
|
|
{
|
|
|
|
|
const bool loadImplicitDefault = session.isEmpty();
|
|
|
|
|
const bool switchFromImplicitToExplicitDefault = session == DEFAULT_SESSION
|
|
|
|
|
&& sb_d->m_sessionName == DEFAULT_SESSION
|
|
|
|
|
&& !initial;
|
|
|
|
|
|
|
|
|
|
// Do nothing if we have that session already loaded,
|
|
|
|
|
// exception if the session is the default virgin session
|
|
|
|
|
// we still want to be able to load the default session
|
|
|
|
|
if (session == sb_d->m_sessionName && !SessionManager::isDefaultVirgin())
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
if (!loadImplicitDefault && !SessionManager::sessions().contains(session))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
// Try loading the file
|
|
|
|
|
FilePath fileName = SessionManager::sessionNameToFileName(loadImplicitDefault ? DEFAULT_SESSION
|
|
|
|
|
: session);
|
|
|
|
|
PersistentSettingsReader reader;
|
|
|
|
|
if (fileName.exists()) {
|
|
|
|
|
if (!reader.load(fileName)) {
|
|
|
|
|
QMessageBox::warning(ICore::dialogParent(),
|
|
|
|
|
Tr::tr("Error while restoring session"),
|
|
|
|
|
Tr::tr("Could not restore session %1").arg(fileName.toUserOutput()));
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (loadImplicitDefault) {
|
|
|
|
|
sb_d->restoreValues(reader);
|
|
|
|
|
emit SessionManager::instance()->sessionLoaded(DEFAULT_SESSION);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
} else if (loadImplicitDefault) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sb_d->m_loadingSession = true;
|
|
|
|
|
|
|
|
|
|
// Allow everyone to set something in the session and before saving
|
|
|
|
|
emit SessionManager::instance()->aboutToUnloadSession(sb_d->m_sessionName);
|
|
|
|
|
|
2023-05-22 12:07:18 +02:00
|
|
|
if (!saveSession()) {
|
2023-05-15 16:09:56 +02:00
|
|
|
sb_d->m_loadingSession = false;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clean up
|
|
|
|
|
if (!EditorManager::closeAllEditors()) {
|
|
|
|
|
sb_d->m_loadingSession = false;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!switchFromImplicitToExplicitDefault)
|
|
|
|
|
sb_d->m_values.clear();
|
|
|
|
|
sb_d->m_sessionValues.clear();
|
|
|
|
|
|
|
|
|
|
sb_d->m_sessionName = session;
|
|
|
|
|
delete sb_d->m_writer;
|
|
|
|
|
sb_d->m_writer = nullptr;
|
|
|
|
|
EditorManager::updateWindowTitles();
|
|
|
|
|
|
|
|
|
|
sb_d->m_virginSession = false;
|
|
|
|
|
|
|
|
|
|
ProgressManager::addTask(sb_d->m_future.future(),
|
|
|
|
|
Tr::tr("Loading Session"),
|
|
|
|
|
"ProjectExplorer.SessionFile.Load");
|
|
|
|
|
|
|
|
|
|
sb_d->m_future.setProgressRange(0, 1 /*initialization*/ + 1 /*editors*/);
|
|
|
|
|
sb_d->m_future.setProgressValue(0);
|
|
|
|
|
|
|
|
|
|
if (fileName.exists()) {
|
|
|
|
|
if (!switchFromImplicitToExplicitDefault)
|
|
|
|
|
sb_d->restoreValues(reader);
|
|
|
|
|
sb_d->restoreSessionValues(reader);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QColor c = QColor(SessionManager::sessionValue("Color").toString());
|
|
|
|
|
if (c.isValid())
|
|
|
|
|
StyleHelper::setBaseColor(c);
|
|
|
|
|
|
|
|
|
|
SessionManager::sessionLoadingProgress();
|
|
|
|
|
|
|
|
|
|
sb_d->restoreEditors();
|
|
|
|
|
|
|
|
|
|
// let other code restore the session
|
|
|
|
|
emit SessionManager::instance()->aboutToLoadSession(session);
|
|
|
|
|
|
|
|
|
|
sb_d->m_future.reportFinished();
|
|
|
|
|
sb_d->m_future = QFutureInterface<void>();
|
|
|
|
|
|
|
|
|
|
sb_d->m_lastActiveTimes.insert(session, QDateTime::currentDateTime());
|
|
|
|
|
|
|
|
|
|
emit SessionManager::instance()->sessionLoaded(session);
|
|
|
|
|
|
|
|
|
|
sb_d->m_loadingSession = false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-22 12:07:18 +02:00
|
|
|
bool SessionManager::saveSession()
|
|
|
|
|
{
|
|
|
|
|
emit SessionManager::instance()->aboutToSaveSession();
|
|
|
|
|
|
|
|
|
|
const FilePath filePath = SessionManager::sessionNameToFileName(sb_d->m_sessionName);
|
|
|
|
|
QVariantMap data;
|
|
|
|
|
|
|
|
|
|
// See the explanation at loadSession() for how we handle the implicit default session.
|
|
|
|
|
if (SessionManager::isDefaultVirgin()) {
|
|
|
|
|
if (filePath.exists()) {
|
|
|
|
|
PersistentSettingsReader reader;
|
|
|
|
|
if (!reader.load(filePath)) {
|
|
|
|
|
QMessageBox::warning(ICore::dialogParent(),
|
|
|
|
|
Tr::tr("Error while saving session"),
|
|
|
|
|
Tr::tr("Could not save session %1")
|
|
|
|
|
.arg(filePath.toUserOutput()));
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
data = reader.restoreValues();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
const QColor c = StyleHelper::requestedBaseColor();
|
|
|
|
|
if (c.isValid()) {
|
|
|
|
|
QString tmp = QString::fromLatin1("#%1%2%3")
|
|
|
|
|
.arg(c.red(), 2, 16, QLatin1Char('0'))
|
|
|
|
|
.arg(c.green(), 2, 16, QLatin1Char('0'))
|
|
|
|
|
.arg(c.blue(), 2, 16, QLatin1Char('0'));
|
|
|
|
|
setSessionValue("Color", tmp);
|
|
|
|
|
}
|
|
|
|
|
setSessionValue("EditorSettings", EditorManager::saveState().toBase64());
|
|
|
|
|
|
|
|
|
|
const auto end = sb_d->m_sessionValues.constEnd();
|
|
|
|
|
for (auto it = sb_d->m_sessionValues.constBegin(); it != end; ++it)
|
|
|
|
|
data.insert(it.key(), it.value());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const auto end = sb_d->m_values.constEnd();
|
|
|
|
|
QStringList keys;
|
|
|
|
|
for (auto it = sb_d->m_values.constBegin(); it != end; ++it) {
|
|
|
|
|
data.insert("value-" + it.key(), it.value());
|
|
|
|
|
keys << it.key();
|
|
|
|
|
}
|
|
|
|
|
data.insert("valueKeys", keys);
|
|
|
|
|
|
|
|
|
|
if (!sb_d->m_writer || sb_d->m_writer->fileName() != filePath) {
|
|
|
|
|
delete sb_d->m_writer;
|
|
|
|
|
sb_d->m_writer = new PersistentSettingsWriter(filePath, "QtCreatorSession");
|
|
|
|
|
}
|
|
|
|
|
const bool result = sb_d->m_writer->save(data, ICore::dialogParent());
|
|
|
|
|
if (result) {
|
|
|
|
|
if (!SessionManager::isDefaultVirgin())
|
|
|
|
|
sb_d->m_sessionDateTimes.insert(SessionManager::activeSession(),
|
|
|
|
|
QDateTime::currentDateTime());
|
|
|
|
|
} else {
|
|
|
|
|
QMessageBox::warning(ICore::dialogParent(),
|
|
|
|
|
Tr::tr("Error while saving session"),
|
|
|
|
|
Tr::tr("Could not save session to file %1")
|
|
|
|
|
.arg(sb_d->m_writer->fileName().toUserOutput()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-22 13:45:27 +02:00
|
|
|
bool SessionManager::isStartupSessionRestored()
|
|
|
|
|
{
|
|
|
|
|
return sb_d->m_isStartupSessionRestored;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-05 11:46:07 +02:00
|
|
|
} // namespace ProjectExplorer
|