Commit 848d7d65 authored by Daniel Teske's avatar Daniel Teske
Browse files

ProjectManager: Report more errors



Task-number: QTCREATORBUG-10844
Change-Id: Ia89a17a5098fb1e2180b32d4c54a61f4ef5b0fbb
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 27f3702f
......@@ -1385,8 +1385,10 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName
}
if (const MimeType mt = MimeDatabase::findByFile(QFileInfo(fileName))) {
bool foundProjectManager = false;
foreach (IProjectManager *manager, projectManagers) {
if (manager->mimeType() == mt.type()) {
foundProjectManager = true;
QString tmp;
if (Project *pro = manager->openProject(filePath, &tmp)) {
if (pro->restoreSettings()) {
......@@ -1397,6 +1399,8 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName
setCurrentNode(pro->rootProjectNode());
openedPro += pro;
} else {
appendError(errorString, tr("Failed opening project '%1': Settings could not be restored")
.arg(QDir::toNativeSeparators(fileName)));
delete pro;
}
}
......@@ -1405,6 +1409,14 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName
break;
}
}
if (!foundProjectManager) {
appendError(errorString, tr("Failed opening project '%1': No plugin can open project type '%2'.")
.arg(QDir::toNativeSeparators(fileName))
.arg((mt.type())));
}
} else {
appendError(errorString, tr("Failed opening project '%1': Unknown project type.")
.arg(QDir::toNativeSeparators(fileName)));
}
SessionManager::reportProjectLoadingProgress();
}
......
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