forked from qt-creator/qt-creator
Project: Improve fromMap() error reporting interface
Instead of just a bool, return a tristate of: Ok, Error and UserAbort. Also add a out parameter errorMessgge. Change-Id: Icb076de49998e9372839d0631c2776e905e4a0f6 Task-number: QTCREATORBUG-13223 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
This commit is contained in:
@@ -140,10 +140,11 @@ QStringList AutotoolsProject::files(FilesMode fileMode) const
|
||||
|
||||
// This function, is called at the very beginning, to
|
||||
// restore the settings if there are some stored.
|
||||
bool AutotoolsProject::fromMap(const QVariantMap &map)
|
||||
Project::RestoreResult AutotoolsProject::fromMap(const QVariantMap &map, QString *errorMessage)
|
||||
{
|
||||
if (!Project::fromMap(map))
|
||||
return false;
|
||||
RestoreResult result = Project::fromMap(map, errorMessage);
|
||||
if (result != RestoreResult::Ok)
|
||||
return result;
|
||||
|
||||
connect(m_fileWatcher, &Utils::FileSystemWatcher::fileChanged,
|
||||
this, &AutotoolsProject::onFileChanged);
|
||||
@@ -155,7 +156,7 @@ bool AutotoolsProject::fromMap(const QVariantMap &map)
|
||||
if (!activeTarget() && defaultKit)
|
||||
addTarget(createTarget(defaultKit));
|
||||
|
||||
return true;
|
||||
return RestoreResult::Ok;
|
||||
}
|
||||
|
||||
void AutotoolsProject::loadProjectTree()
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
QStringList buildTargets() const;
|
||||
|
||||
protected:
|
||||
bool fromMap(const QVariantMap &map);
|
||||
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage);
|
||||
|
||||
private slots:
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user