diff --git a/src/plugins/qmakeprojectmanager/CMakeLists.txt b/src/plugins/qmakeprojectmanager/CMakeLists.txt index 45b309754bc..ad935f413cb 100644 --- a/src/plugins/qmakeprojectmanager/CMakeLists.txt +++ b/src/plugins/qmakeprojectmanager/CMakeLists.txt @@ -35,7 +35,7 @@ add_qtc_plugin(QmakeProjectManager qmakeprojectmanagerplugin.cpp qmakesettings.cpp qmakesettings.h qmakestep.cpp qmakestep.h - wizards/qtprojectparameters.cpp wizards/qtprojectparameters.h + wizards/qtprojectparameters.h wizards/qtwizard.cpp wizards/qtwizard.h wizards/subdirsprojectwizard.cpp wizards/subdirsprojectwizard.h wizards/subdirsprojectwizarddialog.cpp wizards/subdirsprojectwizarddialog.h diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs index 77d04140279..46e6bd9bf69 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.qbs @@ -61,7 +61,7 @@ QtcPlugin { name: "Wizards" prefix: "wizards/" files: [ - "qtprojectparameters.cpp", "qtprojectparameters.h", + "qtprojectparameters.h", "qtwizard.cpp", "qtwizard.h", "subdirsprojectwizard.cpp", "subdirsprojectwizard.h", "subdirsprojectwizarddialog.cpp", "subdirsprojectwizarddialog.h", diff --git a/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.cpp b/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.cpp deleted file mode 100644 index 1e2487223f3..00000000000 --- a/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include "qtprojectparameters.h" -#include - -#include -#include -#include -#include -#include - -using namespace Utils; - -namespace QmakeProjectManager { -namespace Internal { - -// ----------- QtProjectParameters -QtProjectParameters::QtProjectParameters() = default; - -FilePath QtProjectParameters::projectPath() const -{ - return path / fileName; -} - -// Write out a QT module line. -static inline void writeQtModulesList(QTextStream &str, - const QStringList &modules, - char op ='+') -{ - if (const int size = modules.size()) { - str << "QT " << op << "= "; - for (int i =0; i < size; ++i) { - if (i) - str << ' '; - str << modules.at(i); - } - str << "\n\n"; - } -} - -QString createMacro(const QString &name, const QString &suffix) -{ - QString rc = name.toUpper(); - const int extensionPosition = rc.indexOf(QLatin1Char('.')); - if (extensionPosition != -1) - rc.truncate(extensionPosition); - rc += suffix; - return Utils::fileNameToCppIdentifier(rc); -} - -QString QtProjectParameters::libraryMacro(const QString &projectName) -{ - return createMacro(projectName, QLatin1String("_LIBRARY")); -} - -} // namespace Internal -} // namespace QmakeProjectManager diff --git a/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.h b/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.h index 8bf6c345b1f..b58fd021fbd 100644 --- a/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.h +++ b/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.h @@ -7,35 +7,19 @@ #include -QT_BEGIN_NAMESPACE -class QTextStream; -QT_END_NAMESPACE - -namespace QmakeProjectManager { -namespace Internal { - -// Create a macro name by taking a file name, upper casing it and -// appending a suffix. -QString createMacro(const QString &name, const QString &suffix); +namespace QmakeProjectManager::Internal { // Base parameters for application project generation with functionality to // write a .pro-file section. - struct QtProjectParameters { enum Type { ConsoleApp, GuiApp, StaticLibrary, SharedLibrary, QtPlugin, EmptyProject }; enum QtVersionSupport { SupportQt4And5, SupportQt4Only, SupportQt5Only }; - enum Flags { WidgetsRequiredFlag = 0x1 }; - QtProjectParameters(); // Return project path as "path/name" - Utils::FilePath projectPath() const; - - // Shared library: name of #define indicating compilation within library - static QString libraryMacro(const QString &projectName); + Utils::FilePath projectPath() const { return path / fileName; } Type type = ConsoleApp; - unsigned flags = 0; QtVersionSupport qtVersionSupport = SupportQt4And5; QString fileName; QString target; @@ -45,5 +29,4 @@ struct QtProjectParameters QString targetDirectory; }; -} // namespace Internal -} // namespace QmakeProjectManager +} // namespace QmakeProjectManager::Internal