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:
Daniel Teske
2015-05-18 16:57:29 +02:00
parent 2d12884f2e
commit edad1ba516
15 changed files with 59 additions and 47 deletions

View File

@@ -343,10 +343,11 @@ QStringList QmlProject::files(FilesMode) const
return files();
}
bool QmlProject::fromMap(const QVariantMap &map)
Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *errorMessage)
{
if (!Project::fromMap(map))
return false;
RestoreResult result = Project::fromMap(map, errorMessage);
if (result == RestoreResult::Ok)
return result;
// refresh first - project information is used e.g. to decide the default RC's
refresh(Everything);
@@ -407,7 +408,7 @@ bool QmlProject::fromMap(const QVariantMap &map)
onActiveTargetChanged(activeTarget());
return true;
return RestoreResult::Ok;
}
} // namespace QmlProjectManager