forked from qt-creator/qt-creator
Wizards: Open a relevant file in editor after the wizard run
Remove all hacks/conventions of considering the last generated file as project file, etc. and instead add attributes flags to Core::GeneratedFile, giving fine-grained control of what to do with the file. Implement static utility functions in wizards that handle it. Add boolean XML-attributes "openeditor"/"openproject" to the file elements used by the CustomWizard XML-specification. Manually set the attributes in all wizards. Task-number: QTCREATORBUG-1166
This commit is contained in:
@@ -162,11 +162,13 @@ Core::GeneratedFiles TestWizard::generateFiles(const QWizard *w, QString *errorM
|
||||
const QFileInfo sourceFileInfo(sourceFilePath);
|
||||
|
||||
Core::GeneratedFile source(sourceFilePath);
|
||||
source.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
|
||||
source.setContents(generateTestCode(testParams, sourceFileInfo.baseName()));
|
||||
|
||||
// Create profile with define for base dir to find test data
|
||||
const QString profileName = Core::BaseFileWizard::buildFileName(projectPath, projectParams.fileName, profileSuffix());
|
||||
Core::GeneratedFile profile(profileName);
|
||||
profile.setAttributes(Core::GeneratedFile::OpenProjectAttribute);
|
||||
QString contents;
|
||||
{
|
||||
QTextStream proStr(&contents);
|
||||
|
||||
Reference in New Issue
Block a user