Commit ade574cc authored by hjk's avatar hjk
Browse files

coreplugin: remove unused return value from virtual void runWizard

parent 9217ad97
......@@ -477,9 +477,9 @@ QString BaseFileWizard::displayCategory() const
return m_d->m_parameters.displayCategory();
}
QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent)
void BaseFileWizard::runWizard(const QString &path, QWidget *parent)
{
QTC_ASSERT(!path.isEmpty(), return QStringList())
QTC_ASSERT(!path.isEmpty(), return);
typedef QList<IFileWizardExtension*> ExtensionList;
......@@ -508,7 +508,7 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent)
// leaving the func, but not before the IFileWizardExtension::process
// has been called
const QScopedPointer<QWizard> wizard(createWizardDialog(parent, path, allExtensionPages));
QTC_ASSERT(!wizard.isNull(), return QStringList())
QTC_ASSERT(!wizard.isNull(), return);
GeneratedFiles files;
// Run the wizard: Call generate files on switching to the first extension
......@@ -538,7 +538,7 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent)
break;
}
if (files.empty())
return QStringList();
return;
// Compile result list and prompt for overwrite
QStringList result;
foreach (const GeneratedFile &generatedFile, files)
......@@ -546,10 +546,10 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent)
switch (promptOverwrite(result, &errorMessage)) {
case OverwriteCanceled:
return QStringList();
return;
case OverwriteError:
QMessageBox::critical(0, tr("Existing files"), errorMessage);
return QStringList();
return;
case OverwriteOk:
break;
}
......@@ -557,7 +557,7 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent)
// Write
if (!writeFiles(files, &errorMessage)) {
QMessageBox::critical(parent, tr("File Generation Failure"), errorMessage);
return QStringList();
return;
}
bool removeOpenProjectAttribute = false;
......@@ -566,7 +566,7 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent)
bool remove;
if (!ex->process(files, &remove, &errorMessage)) {
QMessageBox::critical(parent, tr("File Generation Failure"), errorMessage);
return QStringList();
return;
}
removeOpenProjectAttribute |= remove;
}
......@@ -579,12 +579,8 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent)
}
// Post generation handler
if (!postGenerateFiles(wizard.data(), files, &errorMessage)) {
if (!postGenerateFiles(wizard.data(), files, &errorMessage))
QMessageBox::critical(0, tr("File Generation Failure"), errorMessage);
return QStringList();
}
return result;
}
// Write
......
......@@ -181,7 +181,7 @@ public:
virtual QString category() const;
virtual QString displayCategory() const;
virtual QStringList runWizard(const QString &path, QWidget *parent);
virtual void runWizard(const QString &path, QWidget *parent);
// Build a file name, adding the extension unless baseName already has one
static QString buildFileName(const QString &path, const QString &baseName, const QString &extension);
......
......@@ -125,13 +125,12 @@
*/
/*!
\fn QStringList IWizard::runWizard(const QString &path, QWidget *parent)
\fn void IWizard::runWizard(const QString &path, QWidget *parent)
This method is executed when the wizard has been selected by the user
for execution. Any dialogs the wizard opens should use the given \a parent.
The \a path argument is a suggestion for the location where files should be
created. The wizard should fill this in its path selection elements as a
default path.
Returns a list of files (absolute paths) that have been created, if any.
*/
using namespace Core;
......
......@@ -63,7 +63,7 @@ public:
virtual QString category() const = 0;
virtual QString displayCategory() const = 0;
virtual QStringList runWizard(const QString &path, QWidget *parent) = 0;
virtual void runWizard(const QString &path, QWidget *parent) = 0;
// Utility to find all registered wizards
static QList<IWizard*> allWizards();
......
......@@ -95,7 +95,7 @@ void BaseCheckoutWizard::setId(const QString &id)
d->id = id;
}
QStringList BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent)
void BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent)
{
// Create dialog and launch
d->parameterPages = createParameterPages(path);
......@@ -104,7 +104,7 @@ QStringList BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent)
connect(&dialog, SIGNAL(progressPageShown()), this, SLOT(slotProgressPageShown()));
dialog.setWindowTitle(displayName());
if (dialog.exec() != QDialog::Accepted)
return QStringList();
return;
// Now try to find the project file and open
const QString checkoutPath = d->checkoutPath;
d->clear();
......@@ -115,9 +115,7 @@ QStringList BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent)
tr("Failed to open project in '%1'.").arg(QDir::toNativeSeparators(checkoutPath)));
msgBox.setDetailedText(errorMessage);
msgBox.exec();
return QStringList();
}
return QStringList(projectFile);
}
static inline QString msgNoProjectFiles(const QDir &dir, const QStringList &patterns)
......
......@@ -73,7 +73,7 @@ public:
virtual QString displayCategory() const;
virtual QString id() const;
virtual QStringList runWizard(const QString &path, QWidget *parent);
virtual void runWizard(const QString &path, QWidget *parent);
static QString openProject(const QString &path, QString *errorMessage);
......
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