Commit 82524422 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Project: Do not lose project file path information



... when opening a project that is no longer found on disk.

Task-number: QTCREATORBUG-10703
Change-Id: I5163c85469d354d2cf48959dcae6303c69392b8f
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent ba54384a
......@@ -1355,10 +1355,12 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName
QTC_ASSERT(!fileName.isEmpty(), continue);
QFileInfo fi = QFileInfo(fileName);
QString canonicalFilePath = fi.canonicalFilePath();
QString filePath = fileName;
if (fi.exists()) // canonicalFilePath will be empty otherwise!
filePath = fi.canonicalFilePath();
bool found = false;
foreach (Project *pi, SessionManager::projects()) {
if (canonicalFilePath == pi->projectFilePath()) {
if (filePath == pi->projectFilePath()) {
found = true;
break;
}
......@@ -1374,7 +1376,7 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName
foreach (IProjectManager *manager, projectManagers) {
if (manager->mimeType() == mt.type()) {
QString tmp;
if (Project *pro = manager->openProject(canonicalFilePath, &tmp)) {
if (Project *pro = manager->openProject(filePath, &tmp)) {
if (pro->restoreSettings()) {
connect(pro, SIGNAL(fileListChanged()), this, SIGNAL(fileListChanged()));
SessionManager::addProject(pro);
......
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