Welcome: Do not open main.cpp when project loading was canceled

When choosing an example from the welcome screen and the user
cancels loading the project:
 * Do not switch to edit mode
 * Do not load main.cpp
 * Do not pop up help

Task-number: QTCREATORBUG-2774
Reviewed-by: Daniel Molkentin
This commit is contained in:
Tobias Hunger
2010-10-19 13:07:19 +02:00
parent a6cfa0ca45
commit 0a5094097d
3 changed files with 19 additions and 8 deletions

View File

@@ -33,6 +33,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/helpmanager.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/mainwindow.h>
#include <coreplugin/rssfetcher.h>
#include <projectexplorer/projectexplorer.h>
@@ -329,8 +330,8 @@ void GettingStartedWelcomePageWidget::slotOpenExample()
tryFile = proFileInfo.path() + '/' + proFileInfo.baseName() + ".qml";
if(QFile::exists(tryFile))
files << tryFile;
Core::ICore::instance()->openFiles(files, Core::ICore::SwitchMode);
if (!helpFile.isEmpty())
Core::ICore::instance()->openFiles(files, static_cast<Core::ICore::OpenFilesFlags>(Core::ICore::SwitchMode | Core::ICore::StopOnLoadFail));
if (!tryFile.isEmpty() && Core::EditorManager::instance()->hasEditor(tryFile) && !helpFile.isEmpty())
slotOpenContextHelpPage(helpFile);
}