From f5e4b8e8cbe7e711cebb340f98fff4adfbf3ce0c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 4 May 2015 13:49:56 +0200 Subject: [PATCH] JsonWizard: Add default implementation Add default implementations for some generator methods Change-Id: Id7c2dc76bd3f96bc9f2560e835981fcdad167f92 Reviewed-by: Orgad Shaneh --- .../jsonwizard/jsonwizardfilegenerator.cpp | 24 -------------- .../jsonwizard/jsonwizardfilegenerator.h | 3 -- .../jsonwizard/jsonwizardgeneratorfactory.cpp | 32 +++++++++++++++++++ .../jsonwizard/jsonwizardgeneratorfactory.h | 8 ++--- 4 files changed, 36 insertions(+), 31 deletions(-) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp index bf56c3f3546..832b7d4a465 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp @@ -191,29 +191,5 @@ bool JsonWizardFileGenerator::writeFile(const JsonWizard *wizard, Core::Generate return true; } -bool JsonWizardFileGenerator::postWrite(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage) -{ - Q_UNUSED(wizard); - Q_UNUSED(file); - Q_UNUSED(errorMessage); - return true; -} - -bool JsonWizardFileGenerator::polish(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage) -{ - Q_UNUSED(wizard); - Q_UNUSED(file); - Q_UNUSED(errorMessage); - return true; -} - -bool JsonWizardFileGenerator::allDone(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage) -{ - Q_UNUSED(wizard); - Q_UNUSED(file); - Q_UNUSED(errorMessage); - return true; -} - } // namespace Internal } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.h b/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.h index 5ecabb19159..2a66f496230 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.h @@ -49,9 +49,6 @@ public: QString *errorMessage); bool writeFile(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage); - bool postWrite(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage); - bool polish(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage); - bool allDone(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage); private: class File { diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp index 781a1eedfa5..b3f487ae7ae 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp @@ -124,6 +124,38 @@ bool JsonWizardGenerator::formatFile(const JsonWizard *wizard, GeneratedFile *fi return true; } +bool JsonWizardGenerator::writeFile(const JsonWizard *wizard, GeneratedFile *file, QString *errorMessage) +{ + Q_UNUSED(wizard); + Q_UNUSED(file); + Q_UNUSED(errorMessage); + return true; +} + +bool JsonWizardGenerator::postWrite(const JsonWizard *wizard, GeneratedFile *file, QString *errorMessage) +{ + Q_UNUSED(wizard); + Q_UNUSED(file); + Q_UNUSED(errorMessage); + return true; +} + +bool JsonWizardGenerator::polish(const JsonWizard *wizard, GeneratedFile *file, QString *errorMessage) +{ + Q_UNUSED(wizard); + Q_UNUSED(file); + Q_UNUSED(errorMessage); + return true; +} + +bool JsonWizardGenerator::allDone(const JsonWizard *wizard, GeneratedFile *file, QString *errorMessage) +{ + Q_UNUSED(wizard); + Q_UNUSED(file); + Q_UNUSED(errorMessage); + return true; +} + JsonWizardGenerator::OverwriteResult JsonWizardGenerator::promptForOverwrite(JsonWizard::GeneratorFiles *files, QString *errorMessage) { diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.h b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.h index 2d0502df6e7..26e5a02e3ff 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.h @@ -53,10 +53,10 @@ public: const QString &baseDir, const QString &projectDir, QString *errorMessage) = 0; virtual bool formatFile(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage); - virtual bool writeFile(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage) = 0; - virtual bool postWrite(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage) = 0; - virtual bool polish(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage) = 0; - virtual bool allDone(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage) = 0; + virtual bool writeFile(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage); + virtual bool postWrite(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage); + virtual bool polish(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage); + virtual bool allDone(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage); virtual bool canKeepExistingFiles() const { return true; }