Commit c200a926 authored by Daniel Teske's avatar Daniel Teske
Browse files

Move SessionFile::future to SessionManager



Instead of reseting the variable at new SessionFile, I did it at the
right place, that is after reportingFinished().

Change-Id: Ia5b58734a646840ff645dad07dd87a2bffcef02b
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 9c57b100
......@@ -87,7 +87,6 @@ public:
SessionFile();
private:
QFutureInterface<void> future;
friend class ProjectExplorer::SessionManager;
};
......@@ -412,7 +411,7 @@ bool SessionManager::loadImpl(const QString &fileName)
return false;
}
ICore::progressManager()->addTask(m_file->future.future(), tr("Session"),
ICore::progressManager()->addTask(m_future.future(), tr("Session"),
QLatin1String("ProjectExplorer.SessionFile.Load"));
const QStringList &keys = reader.restoreValue(QLatin1String("valueKeys")).toStringList();
......@@ -425,8 +424,8 @@ bool SessionManager::loadImpl(const QString &fileName)
reader.restoreValue(QLatin1String("ProjectList")).toStringList();
int openEditorsCount = reader.restoreValue(QLatin1String("OpenEditors")).toInt();
m_file->future.setProgressRange(0, fileList.count() + openEditorsCount + 2);
m_file->future.setProgressValue(1);
m_future.setProgressRange(0, fileList.count() + openEditorsCount + 2);
m_future.setProgressValue(1);
// indirectly adds projects to session
// Keep projects that failed to load in the session!
......@@ -482,7 +481,8 @@ bool SessionManager::loadImpl(const QString &fileName)
this, SLOT(sessionLoadingProgress()));
}
m_file->future.reportFinished();
m_future.reportFinished();
m_future = QFutureInterface<void>();
// m_file->load() sets the m_file->startupProject
// but doesn't emit this signal, so we do it here
......@@ -996,7 +996,7 @@ void SessionManager::markSessionFileDirty(bool makeDefaultVirginDirty)
void SessionManager::sessionLoadingProgress()
{
m_file->future.setProgressValue(m_file->future.progressValue() + 1);
m_future.setProgressValue(m_future.progressValue() + 1);
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
}
......
......@@ -39,6 +39,7 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QMap>
#include <QtCore/QFutureInterface>
QT_BEGIN_NAMESPACE
class QAbstractItemModel;
......@@ -174,6 +175,7 @@ private:
QStringList m_failedProjects;
QMap<QString, QStringList> m_depMap;
QMap<QString, QVariant> m_values;
QFutureInterface<void> future;
};
} // namespace ProjectExplorer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment