forked from qt-creator/qt-creator
Remove SessionFile
Finally one unecessary layer is gone Change-Id: I34ec37ab898884def075a86e7dfd978e3244d2e3 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -75,31 +75,9 @@ using namespace Core;
|
|||||||
using Utils::PersistentSettingsReader;
|
using Utils::PersistentSettingsReader;
|
||||||
using Utils::PersistentSettingsWriter;
|
using Utils::PersistentSettingsWriter;
|
||||||
|
|
||||||
/* SessionFile definitions */
|
|
||||||
namespace ProjectExplorer {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class SessionFile : QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
SessionFile();
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class ProjectExplorer::SessionManager;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace ProjectExplorer
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace ProjectExplorer::Internal;
|
using namespace ProjectExplorer::Internal;
|
||||||
|
|
||||||
SessionFile::SessionFile()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class ProjectExplorer::SessionManager
|
\class ProjectExplorer::SessionManager
|
||||||
|
|
||||||
@@ -113,7 +91,6 @@ SessionFile::SessionFile()
|
|||||||
|
|
||||||
SessionManager::SessionManager(QObject *parent)
|
SessionManager::SessionManager(QObject *parent)
|
||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
m_file(new SessionFile),
|
|
||||||
m_sessionNode(new SessionNode(this)),
|
m_sessionNode(new SessionNode(this)),
|
||||||
m_sessionName(QLatin1String("default")),
|
m_sessionName(QLatin1String("default")),
|
||||||
m_virginSession(true),
|
m_virginSession(true),
|
||||||
@@ -143,7 +120,6 @@ SessionManager::SessionManager(QObject *parent)
|
|||||||
SessionManager::~SessionManager()
|
SessionManager::~SessionManager()
|
||||||
{
|
{
|
||||||
emit aboutToUnloadSession();
|
emit aboutToUnloadSession();
|
||||||
delete m_file;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -343,8 +319,6 @@ bool SessionManager::createImpl(const QString &fileName)
|
|||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
emit aboutToUnloadSession();
|
emit aboutToUnloadSession();
|
||||||
delete m_file;
|
|
||||||
m_file = new SessionFile;
|
|
||||||
m_startupProject = 0;
|
m_startupProject = 0;
|
||||||
m_failedProjects.clear();
|
m_failedProjects.clear();
|
||||||
m_depMap.clear();
|
m_depMap.clear();
|
||||||
@@ -390,8 +364,6 @@ bool SessionManager::loadImpl(const QString &fileName)
|
|||||||
m_virginSession = false;
|
m_virginSession = false;
|
||||||
|
|
||||||
emit aboutToUnloadSession();
|
emit aboutToUnloadSession();
|
||||||
delete m_file;
|
|
||||||
m_file = new SessionFile;
|
|
||||||
m_startupProject = 0;
|
m_startupProject = 0;
|
||||||
m_failedProjects.clear();
|
m_failedProjects.clear();
|
||||||
m_depMap.clear();
|
m_depMap.clear();
|
||||||
@@ -484,8 +456,7 @@ bool SessionManager::loadImpl(const QString &fileName)
|
|||||||
m_future.reportFinished();
|
m_future.reportFinished();
|
||||||
m_future = QFutureInterface<void>();
|
m_future = QFutureInterface<void>();
|
||||||
|
|
||||||
// m_file->load() sets the m_file->startupProject
|
// we emit this signal here
|
||||||
// but doesn't emit this signal, so we do it here
|
|
||||||
emit startupProjectChanged(m_startupProject);
|
emit startupProjectChanged(m_startupProject);
|
||||||
|
|
||||||
QStringList failedProjects = m_failedProjects;
|
QStringList failedProjects = m_failedProjects;
|
||||||
@@ -999,5 +970,3 @@ void SessionManager::sessionLoadingProgress()
|
|||||||
m_future.setProgressValue(m_future.progressValue() + 1);
|
m_future.setProgressValue(m_future.progressValue() + 1);
|
||||||
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "session.moc"
|
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ class SessionNode;
|
|||||||
class SessionManager;
|
class SessionManager;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class SessionFile;
|
|
||||||
class SessionNodeImpl;
|
class SessionNodeImpl;
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
@@ -160,7 +159,6 @@ private:
|
|||||||
QStringList dependencies(const QString &proName) const;
|
QStringList dependencies(const QString &proName) const;
|
||||||
QStringList dependenciesOrder() const;
|
QStringList dependenciesOrder() const;
|
||||||
|
|
||||||
Internal::SessionFile *m_file;
|
|
||||||
SessionNode *m_sessionNode;
|
SessionNode *m_sessionNode;
|
||||||
QString m_sessionName;
|
QString m_sessionName;
|
||||||
bool m_virginSession;
|
bool m_virginSession;
|
||||||
@@ -175,7 +173,7 @@ private:
|
|||||||
QStringList m_failedProjects;
|
QStringList m_failedProjects;
|
||||||
QMap<QString, QStringList> m_depMap;
|
QMap<QString, QStringList> m_depMap;
|
||||||
QMap<QString, QVariant> m_values;
|
QMap<QString, QVariant> m_values;
|
||||||
QFutureInterface<void> future;
|
QFutureInterface<void> m_future;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
Reference in New Issue
Block a user