diff --git a/doc/images/qtcreator-custom-wizard.png b/doc/images/qtcreator-custom-wizard.png new file mode 100644 index 00000000000..9155866e41a Binary files /dev/null and b/doc/images/qtcreator-custom-wizard.png differ diff --git a/doc/src/projects/creator-projects-creating.qdoc b/doc/src/projects/creator-projects-creating.qdoc index f02ec75d528..a84f625858a 100644 --- a/doc/src/projects/creator-projects-creating.qdoc +++ b/doc/src/projects/creator-projects-creating.qdoc @@ -120,7 +120,7 @@ \li Qt Quick Controls Application Create a Qt Quick application using - \l{http://doc-snapshots.qt.io/qt5-5.7/qtquickcontrols2-index.html} + \l{http://doc.qt.io/qt-5/qtquickcontrols2-index.html} {Qt Quick Controls 2} (requires Qt 5.7 or later), \l{http://doc.qt.io/qt-5/qtquickcontrols-index.html} {Qt Quick Controls}, or diff --git a/doc/src/projects/creator-projects-custom-wizards-json.qdoc b/doc/src/projects/creator-projects-custom-wizards-json.qdoc index 64e9eaadd50..04c6631ffac 100644 --- a/doc/src/projects/creator-projects-custom-wizards-json.qdoc +++ b/doc/src/projects/creator-projects-custom-wizards-json.qdoc @@ -37,27 +37,72 @@ \title Adding JSON-Based Wizards - \image qtcreator-new-qt-gui-application.png - - The JSON-based wizards are displayed in the \uicontrol New dialog. To - customize them, copy a directory that contains a \c {wizard.json} file in - \c {share/qtcreator/templates/wizards/} and modify it to fit your needs. - After you run qmake and restart \QC, the wizard name appears in the - selected or added category. For each wizard, an icon, a display name, and - a description are displayed. + \QC searches for wizards in the shared directory and in the local user's + settings directory, as described in \l{Locating Wizards}. JSON-based wizard template directories contain a JSON configuration file called \c {wizard.json} and any template files needed. The configuration file contains sections that specify information about the wizard, variables that you can use, wizard pages, and generators for creating files. + To create a customized wizard, copy a template directory to the shared + directory or the settings directory under a new name. If you want to use + qmake to build the wizard and integrate it into \QC, use the shared + directory. Otherwise, you can create a subdirectory in the settings + directory. The standard wizards are organized into subdirectories by type, + but you can add your wizard directory to any directory you like. The folder + hierarchy does not affect the order in which the wizards are displayed. + + To share the wizard with other users, you can create an archive of the + wizard directory and instruct the recipients to extract it into one of the + directories \QC searches wizards from. + + For wizard development, we recommend that you start \QC with the + \c {-customwizard-verbose} argument to receive confirmation that \QC was + able to find and parse the \c {wizard.json} file. The verbose mode displays + information about syntax errors, which are the most typical errors you might + run into while editing wizards. For more information, see + \l {Verbose Output}. + + In addition, set keyboard shortcuts for the \uicontrol Inspect and + \uicontrol {Factory.Reset} functions to be able to inspect the fields and + variables in the wizard and to have the wizard listed in \uicontrol File > + \uicontrol {New File or Project} without restarting \QC. For more + information, see \l {Tips for Wizard Development}. + + \QC displays the wizards that it finds in the + \uicontrol {New File or Project} dialog. For each wizard, an icon (1), a + display name (2), and a description (3) are displayed. + + \image qtcreator-custom-wizard.png + + \section1 Integrating Wizards into Qt Creator Builds + + To integrate the wizard into \QC and to deliver it as part of the \QC build, + place the wizard files in the \QC sources. Then select \uicontrol Build > + \uicontrol {Run qmake}, so that the new files you added for your wizard are + actually copied from the \QC source directory into the \QC build directory + as part of the next \QC build. + + If you do not run qmake, your new wizard will not show up, because it does + not exist in the build directory you run your newly built \QC from. It never + got copied there, because make did not know that the files exist in the + source tree, because qmake did not inform make that the files were added + recently. + + Basically, qmake generates a fixed list of files to copy from the source + directory to the sudirectory of the build directory that is checked for + wizards at runtime. Therefore, you need to run qmake or execute the + \uicontrol {Factory.Reset} function each time the names or locations of the + files change. + \section1 Using Variables in Wizards You can use variables (\c {%\{\}}) in the configuration and template source files. A set of variables is predefined by the wizards and their pages. You can introduce new variables as shortcuts to be used later. Define the variable key names and values in the \c options section in the - \c {.json} file. + \c {wizard.json} file. The variables always return strings. In places where a boolean value is expected and a string is given, an empty string as well as the string @@ -87,34 +132,45 @@ use them as basis for adding your own wizards. We use the C++ wizard to explain the process and the sections and settings in the .json file. + In this example, we create the wizard directory in the shared directory + and integrate it in the \QC build system, so that it can deployed along with + the \QC binaries as part of the build. + \image qtcreator-cpp-class-wizard.png - For more information about the pages and widgets that you can add, see - \l {Available Pages} and \l{Available Widgets}. + For more information about the pages and widgets that you can add and their + supported properties, see \l {Available Pages} and \l{Available Widgets}. To create a JSON-based C++ class wizard: \list 1 - \li Make a copy of \c {share/qtcreator/templates/wizards/classes/cpp} - and rename it. + \li Start \QC with the \c {-customwizard-verbose} argument to receive + feedback during wizard development. For more information, see + \l {Verbose Output}. - \li Right-click the project name in \uicontrol Projects view and - select \uicontrol {Run qmake} from the context menu to register the - new wizard. Basically, qmake generates a fixed list of files to - copy. Therefore, you need to run qmake each time the names or - locations of the files change. + \li Set keyboard shortcuts for the \uicontrol Inspect and + \uicontrol {Factory.Reset} actions, as described in + \l {Tips for Wizard Development}. + + \li Make a copy of \c {share/qtcreator/templates/wizards/classes/cpp} + and rename it. For example, + \c {share/qtcreator/templates/wizards/classes/mycpp} + + \li Use the \uicontrol {Factory.Reset} action to make the wizard appear + in \uicontrol File > \uicontrol {New File or Project} without + restarting \QC. \li Open the wizard configuration file, \c {wizard.json} for editing: \list \li The following settings determine the type of the wizard and - its place in the \uicontrol New dialog: + its place in the \uicontrol {New File or Project} dialog: \code "version": 1, - "kind": "file", + "supportedProjectTypes": [ ], "id": "A.Class", "category": "O.C++", \endcode @@ -124,15 +180,26 @@ \li \c version is the version of the file contents. Do not modify this value. - \li \c kind specifies the type of the wizard: \c file or - \c project. + \li \c supportedProjectTypes is an optional setting that + can be used to filter wizards when adding a new build + target to an existing project. For example, only wizards + that produce qmake projects should be provided when + adding a new target to an existing qmake project. - This information is available in the wizard as - \c {%\{kind\}} with values \c file or \c project. + Possible values are the build systems supported by \QC + or \c UNKNOWN_PROJECT if the build system is not + specified: \c AutotoolsProjectManager.AutotoolsProject, + \c CMakeProjectManager.CMakeProject, + \c GenericProjectManager.GenericProject, + \c PythonProject, \c Qbs.QbsProject, + \c Qt4ProjectManager.Qt4Project (qmake project), + \c QmlProjectManager.QmlProject - \li \c id is the unique identifier for your wizard. You can - use a leading letter to specify the position of the - wizard within the \c category. + \li \c id is the unique identifier for your wizard. Wizards + are sorted by the ID in alphabetic order within the + \c category. You can use a leading letter to specify the + position of the wizard. You must always change + this value. For example, \c B.MyClass. This information is available in the wizard as \c {%\{id\}}. @@ -140,20 +207,21 @@ \li \c category is the category in which to place the wizard in the list. You can use a leading letter to specify the position of the category in the list in the - \uicontrol New dialog. + \uicontrol {New File or Project} dialog. This information is available in the wizard as \c {%\{category\}}. \endlist \li The following settings specify the icon and text that appear in - the \uicontrol New dialog: + the \uicontrol {New File or Project} dialog: \code "trDescription": "Creates a C++ header and a source file for a new class that you can add to a C++ project.", "trDisplayName": "C++ Class", "trDisplayCategory": "C++", "icon": "../../global/genericfilewizard.png", + "enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}", \endcode \list @@ -170,8 +238,9 @@ This information is available in the wizard as \c {%\{trDisplayName\}}. - \li \c trDisplayCategory appears in the \uicontrol New dialog, - under \uicontrol Projects. + \li \c trDisplayCategory appears in the + \uicontrol {New File or Project} dialog, under + \uicontrol Projects. This information is available in the wizard as \c {%\{trDisplayCategory\}}. @@ -250,16 +319,16 @@ "trDisplayName": "Define Class", "trShortTitle": "Details", "typeId": "Fields", - "data" : - [ - { - "name": "Class", - "trDisplayName": "Class name:", - "mandatory": true, - "type": "LineEdit", - "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)+[a-zA-Z_][a-zA-Z_0-9]*|)" } - }, - ... + "data" : + [ + { + "name": "Class", + "trDisplayName": "Class name:", + "mandatory": true, + "type": "LineEdit", + "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)+[a-zA-Z_][a-zA-Z_0-9]*|)" } + }, + ... ] \endcode @@ -580,6 +649,9 @@ \li Text Edit \endlist + \note Only the the settings documented in the following sections are + supported in wizards. + Specify the following settings for each widget: \list diff --git a/doc/src/projects/creator-projects-custom-wizards.qdoc b/doc/src/projects/creator-projects-custom-wizards.qdoc index a2b204eeaaf..1b56471db40 100644 --- a/doc/src/projects/creator-projects-custom-wizards.qdoc +++ b/doc/src/projects/creator-projects-custom-wizards.qdoc @@ -78,7 +78,7 @@ \li the local user's configuration folder, \c {$HOME/.config/QtProject/qtcreator/templates/wizards} on Linux and OS X or \c {%APPDATA%\QtProject\qtcreator\templates\wizards} on - windows + Windows \endlist @@ -114,9 +114,34 @@ a wizard definition to become visible. \endtable - \note When developing custom wizards (both JSON as well as XML based), it is - recommended to start \QC with the \c {-customwizard-verbose} argument. See - \l{Using Command Line Options} for more information about command line - arguments. + \section2 Verbose Output + When developing custom wizards (both JSON as well as XML based), it is + recommended to start \QC with the \c {-customwizard-verbose} argument. It + causes each correctly set up wizard to produce output along the following + lines: + + \code + Checking "/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard" + for wizard.json. + * Configuration found and parsed. + \endcode + + The output includes the name of the directory that was checked for a + \c wizard.json file. If the file is not found, the message is not displayed. + + If the file contains errors, such as an invalid icon path, the following + types of messages are displayed: + + \code + Checking "/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard" + for wizard.json. + * Configuration found and parsed. + * Failed to create: Icon file + "/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard/../.. + /global/genericfilewizard.png" not found. + \endcode + + See \l{Using Command Line Options} for more information about command line + arguments. */ diff --git a/doc/src/qtquick/qtquick-creating.qdoc b/doc/src/qtquick/qtquick-creating.qdoc index 2b4d8c85cce..19c61dbd0b1 100644 --- a/doc/src/qtquick/qtquick-creating.qdoc +++ b/doc/src/qtquick/qtquick-creating.qdoc @@ -54,7 +54,7 @@ \uicontrol {Qt Quick Controls 2 Application}, and \uicontrol {Qt Labs Controls Application} are like \uicontrol {Qt Quick Application}, but using - \l{http://doc-snapshots.qt.io/qt5-5.7/qtquickcontrols2-index.html} + \l{http://doc.qt.io/qt-5/qtquickcontrols2-index.html} {Qt Quick Controls 2} (requires Qt 5.7 or later), \l{http://doc.qt.io/qt-5/qtquickcontrols-index.html} {Qt Quick Controls}, or diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index 4c406a363c9..9500035c5f0 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -207,9 +207,8 @@ bool FileUtils::isFileNewerThan(const FileName &filePath, const QDateTime &timeS } /*! - Recursively resolves possibly present symlinks in \a filePath. - Unlike QFileInfo::canonicalFilePath(), this function will still return the expected target file - even if the symlink is dangling. + Recursively resolves symlinks if \a filePath is a symlink. + To resolve symlinks anywhere in the path, see canonicalPath \note Maximum recursion depth == 16. @@ -226,6 +225,21 @@ FileName FileUtils::resolveSymlinks(const FileName &path) return FileName::fromString(f.filePath()); } +/*! + Recursively resolves possibly present symlinks in \a filePath. + Unlike QFileInfo::canonicalFilePath(), this function will not return an empty + string if path doesn't exist. + + Returns the canonical path. +*/ +FileName FileUtils::canonicalPath(const FileName &path) +{ + const QString result = QFileInfo(path.toString()).canonicalFilePath(); + if (result.isEmpty()) + return path; + return FileName::fromString(result); +} + /*! Like QDir::toNativeSeparators(), but use prefix '~' instead of $HOME on unix systems when an absolute path is given. diff --git a/src/libs/utils/fileutils.h b/src/libs/utils/fileutils.h index 79f5b9ddac6..e1c3b471287 100644 --- a/src/libs/utils/fileutils.h +++ b/src/libs/utils/fileutils.h @@ -108,6 +108,7 @@ public: QString *error = 0, const std::function ©Helper = std::function()); static bool isFileNewerThan(const FileName &filePath, const QDateTime &timeStamp); static FileName resolveSymlinks(const FileName &path); + static FileName canonicalPath(const FileName &path); static QString shortNativePath(const FileName &path); static QString fileSystemFriendlyName(const QString &name); static int indexOfQmakeUnfriendly(const QString &name, int startpos = 0); diff --git a/src/plugins/android/android.pro b/src/plugins/android/android.pro index 18b2c7543df..0df9a4a4ae0 100644 --- a/src/plugins/android/android.pro +++ b/src/plugins/android/android.pro @@ -87,7 +87,8 @@ SOURCES += \ avddialog.cpp \ androidbuildapkstep.cpp \ androidbuildapkwidget.cpp \ - androidqtsupport.cpp + androidqtsupport.cpp \ + androidrunnable.cpp FORMS += \ androidsettingswidget.ui \ diff --git a/src/plugins/android/android.qbs b/src/plugins/android/android.qbs index f326a88dd47..1bb3296453b 100644 --- a/src/plugins/android/android.qbs +++ b/src/plugins/android/android.qbs @@ -80,6 +80,7 @@ Project { "androidruncontrol.h", "androidrunfactories.cpp", "androidrunfactories.h", + "androidrunnable.cpp", "androidrunnable.h", "androidrunner.cpp", "androidrunner.h", diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index 6bad5d22827..c3717ed6fdc 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -28,6 +28,7 @@ #include "androidsignaloperation.h" #include +#include #include diff --git a/src/plugins/android/androidrunnable.cpp b/src/plugins/android/androidrunnable.cpp new file mode 100644 index 00000000000..f91d7cf63e1 --- /dev/null +++ b/src/plugins/android/androidrunnable.cpp @@ -0,0 +1,32 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#include "androidrunnable.h" + +namespace Android { + +void *AndroidRunnable::staticTypeId = &AndroidRunnable::staticTypeId; + +} // namespace Android diff --git a/src/plugins/android/androidrunnable.h b/src/plugins/android/androidrunnable.h index 5f09a503558..93daf8fc2d8 100644 --- a/src/plugins/android/androidrunnable.h +++ b/src/plugins/android/androidrunnable.h @@ -39,6 +39,8 @@ struct ANDROID_EXPORT AndroidRunnable QVector beforeStartADBCommands; QVector afterFinishADBCommands; QString deviceSerialNumber; + + static void *staticTypeId; }; inline bool operator==(const AndroidRunnable &r1, const AndroidRunnable &r2) diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.cpp b/src/plugins/cmakeprojectmanager/builddirmanager.cpp index f1e9b1d1077..38954807835 100644 --- a/src/plugins/cmakeprojectmanager/builddirmanager.cpp +++ b/src/plugins/cmakeprojectmanager/builddirmanager.cpp @@ -289,8 +289,12 @@ CMakeConfig BuildDirManager::parsedConfiguration() const emit errorOccured(errorMessage); const Utils::FileName sourceOfBuildDir = Utils::FileName::fromUtf8(CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", m_cmakeCache)); - if (sourceOfBuildDir != sourceDirectory()) // Use case-insensitive compare where appropriate - emit errorOccured(tr("The build directory is not for %1").arg(sourceDirectory().toUserOutput())); + const Utils::FileName canonicalSourceOfBuildDir = Utils::FileUtils::canonicalPath(sourceOfBuildDir); + const Utils::FileName canonicalSourceDirectory = Utils::FileUtils::canonicalPath(sourceDirectory()); + if (canonicalSourceOfBuildDir != canonicalSourceDirectory) // Uses case-insensitive compare where appropriate + emit errorOccured(tr("The build directory is not for %1 but for %2") + .arg(canonicalSourceOfBuildDir.toUserOutput(), + canonicalSourceDirectory.toUserOutput())); } return m_cmakeCache; } diff --git a/src/plugins/debugger/analyzer/analyzerstartparameters.h b/src/plugins/debugger/analyzer/analyzerstartparameters.h index f121d9683f9..75ff6afaf22 100644 --- a/src/plugins/debugger/analyzer/analyzerstartparameters.h +++ b/src/plugins/debugger/analyzer/analyzerstartparameters.h @@ -39,6 +39,8 @@ public: QString analyzerHost; QString analyzerSocket; Utils::Port analyzerPort; + + static void *staticTypeId; }; } // namespace Debugger diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index f20d4761651..2d41ec65dd4 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -3849,6 +3849,9 @@ QList DebuggerPlugin::createTestObjects() const #endif // if WITH_TESTS } // namespace Internal + +void *AnalyzerConnection::staticTypeId = &AnalyzerConnection::staticTypeId; + } // namespace Debugger #include "debuggerplugin.moc" diff --git a/src/plugins/projectexplorer/customwizard/customwizard.cpp b/src/plugins/projectexplorer/customwizard/customwizard.cpp index a4878f319e6..9db7e44d700 100644 --- a/src/plugins/projectexplorer/customwizard/customwizard.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizard.cpp @@ -28,8 +28,9 @@ #include "customwizardpage.h" #include "customwizardscriptgenerator.h" -#include #include +#include +#include #include #include diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 0b305b9818c..400548bd12b 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -32,6 +32,7 @@ #include #include +#include #include diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 691bfbfe2d4..f3a7b088634 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -31,6 +31,7 @@ #include "../kit.h" #include "../kitinformation.h" #include "../runconfiguration.h" +#include "../runnables.h" #include #include @@ -467,4 +468,6 @@ DeviceEnvironmentFetcher::DeviceEnvironmentFetcher() { } +void *HostName::staticTypeId = &HostName::staticTypeId; + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index c5043e8a3b3..d9874045d00 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -108,16 +108,6 @@ public: virtual QList usedPorts(const QByteArray &commandOutput) const = 0; }; -class PROJECTEXPLORER_EXPORT HostName -{ -public: - explicit HostName(const QString &host) : m_host(host) {} - QString host() const { return m_host; } - -private: - QString m_host; -}; - // See cpp file for documentation. class PROJECTEXPLORER_EXPORT IDevice { diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 4fb16419249..520d0284f39 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -161,6 +161,7 @@ class PROJECTEXPLORER_EXPORT Runnable virtual ~Concept() {} virtual Concept *clone() const = 0; virtual bool canReUseOutputPane(const std::unique_ptr &other) const = 0; + virtual void *typeId() const = 0; }; template @@ -172,10 +173,14 @@ class PROJECTEXPLORER_EXPORT Runnable bool canReUseOutputPane(const std::unique_ptr &other) const override { - auto that = dynamic_cast *>(other.get()); - return that && m_data == that->m_data; + if (other->typeId() != typeId()) + return false; + auto that = static_cast *>(other.get()); + return m_data == that->m_data; } + void *typeId() const { return T::staticTypeId; } + T m_data; }; @@ -187,8 +192,13 @@ public: void operator=(Runnable other) { d = std::move(other.d); } - template bool is() const { return dynamic_cast *>(d.get()) != 0; } - template const T &as() const { return static_cast *>(d.get())->m_data; } + template bool is() const { + return d.get()->typeId() == T::staticTypeId; + } + + template const T &as() const { + return static_cast *>(d.get())->m_data; + } bool canReUseOutputPane(const Runnable &other) const; @@ -202,6 +212,7 @@ class PROJECTEXPLORER_EXPORT Connection { virtual ~Concept() {} virtual Concept *clone() const = 0; + virtual void *typeId() const = 0; }; template @@ -209,6 +220,7 @@ class PROJECTEXPLORER_EXPORT Connection { Model(const T &data) : m_data(data) { } Concept *clone() const override { return new Model(*this); } + void *typeId() const { return T::staticTypeId; } T m_data; }; @@ -220,8 +232,13 @@ public: void operator=(Connection other) { d = std::move(other.d); } - template bool is() const { return dynamic_cast *>(d.get()) != 0; } - template const T &as() const { return static_cast *>(d.get())->m_data; } + template bool is() const { + return d.get()->typeId() == T::staticTypeId; + } + + template const T &as() const { + return static_cast *>(d.get())->m_data; + } private: std::unique_ptr d; diff --git a/src/plugins/projectexplorer/runnables.cpp b/src/plugins/projectexplorer/runnables.cpp index c05b0a4c12e..a8c9be4aad2 100644 --- a/src/plugins/projectexplorer/runnables.cpp +++ b/src/plugins/projectexplorer/runnables.cpp @@ -35,4 +35,6 @@ bool operator==(const StandardRunnable &r1, const StandardRunnable &r2) && r1.environment == r2.environment; } +void *StandardRunnable::staticTypeId = &StandardRunnable::staticTypeId; + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/runnables.h b/src/plugins/projectexplorer/runnables.h index 3949b80a0b5..258b45ea797 100644 --- a/src/plugins/projectexplorer/runnables.h +++ b/src/plugins/projectexplorer/runnables.h @@ -43,8 +43,22 @@ public: Utils::Environment environment; ApplicationLauncher::Mode runMode = ApplicationLauncher::Gui; IDevice::ConstPtr device; // Override the kit's device. Keep unset by default. + + static void *staticTypeId; }; PROJECTEXPLORER_EXPORT bool operator==(const StandardRunnable &r1, const StandardRunnable &r2); +class PROJECTEXPLORER_EXPORT HostName +{ +public: + explicit HostName(const QString &host) : m_host(host) {} + QString host() const { return m_host; } + + static void *staticTypeId; + +private: + QString m_host; +}; + } // namespace ProjectExplorer diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 6ff49324ec5..88273086bfb 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -89,7 +89,7 @@ static QStringList targetOSList(const ProjectExplorer::Abi &abi, const ProjectEx break; case ProjectExplorer::Abi::MacOS: if (device == DESKTOP_DEVICE_TYPE) - os << QLatin1String("osx"); + os << QLatin1String("macos") << QLatin1String("osx"); else if (device == IOS_DEVICE_TYPE) os << QLatin1String("ios"); else if (device == IOS_SIMULATOR_TYPE) diff --git a/tests/unit/unittest/clientserveroutsideprocess.cpp b/tests/unit/unittest/clientserveroutsideprocess.cpp index 40e7e9b35ab..bb242433de9 100644 --- a/tests/unit/unittest/clientserveroutsideprocess.cpp +++ b/tests/unit/unittest/clientserveroutsideprocess.cpp @@ -47,6 +47,8 @@ #include #include "gtest-qt-printing.h" +#include + #include #include #include @@ -55,12 +57,6 @@ #include -#ifdef Q_OS_WIN -#define QTC_HOST_EXE_SUFFIX L".exe" -#else -#define QTC_HOST_EXE_SUFFIX "" -#endif - using namespace ClangBackEnd; using ::testing::Eq; @@ -175,7 +171,7 @@ TEST_F(ClientServerOutsideProcess, SendUnregisterProjectPartsForEditorMessage) void ClientServerOutsideProcess::SetUpTestCase() { - client.setProcessPath(QStringLiteral(ECHOSERVER QTC_HOST_EXE_SUFFIX)); + client.setProcessPath(Utils::HostOsInfo::withExecutableSuffix(QStringLiteral(ECHOSERVER))); ASSERT_TRUE(client.connectToServer()); }