From 92a5402f657c40832db4efd95bddb88a4f1933d3 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Tue, 23 Jul 2013 14:13:26 +0300 Subject: [PATCH] Make QBS setings constants accessible for other plugins. Change-Id: I7e66136d2b75a932b981713ccc27e3e69fd44baa Reviewed-by: Tobias Hunger --- .../defaultpropertyprovider.cpp | 24 +------- src/plugins/qbsprojectmanager/qbsconstants.h | 61 +++++++++++++++++++ .../qbsprojectmanager/qbsprojectmanager.pro | 3 +- 3 files changed, 65 insertions(+), 23 deletions(-) create mode 100644 src/plugins/qbsprojectmanager/qbsconstants.h diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 201bd1af3f0..9557a997563 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -28,6 +28,7 @@ ****************************************************************************/ #include "defaultpropertyprovider.h" +#include "qbsconstants.h" #include #include @@ -38,29 +39,8 @@ #include -// Qt related settings: -const char QTCORE_BINPATH[] = "Qt.core.binPath"; -const char QTCORE_BUILDVARIANT[] = "Qt.core.buildVariant"; -const char QTCORE_DOCPATH[] = "Qt.core.docPath"; -const char QTCORE_INCPATH[] = "Qt.core.incPath"; -const char QTCORE_LIBPATH[] = "Qt.core.libPath"; -const char QTCORE_VERSION[] = "Qt.core.version"; -const char QTCORE_NAMESPACE[] = "Qt.core.namespace"; -const char QTCORE_LIBINFIX[] = "Qt.core.libInfix"; -const char QTCORE_MKSPEC[] = "Qt.core.mkspecPath"; -const char QTCORE_FRAMEWORKBUILD[] = "Qt.core.frameworkBuild"; - - -// Toolchain related settings: -const char QBS_TARGETOS[] = "qbs.targetOS"; -const char QBS_SYSROOT[] = "qbs.sysroot"; -const char QBS_ARCHITECTURE[] = "qbs.architecture"; -const char QBS_ENDIANNESS[] = "qbs.endianness"; -const char QBS_TOOLCHAIN[] = "qbs.toolchain"; -const char CPP_TOOLCHAINPATH[] = "cpp.toolchainInstallPath"; -const char CPP_COMPILERNAME[] = "cpp.compilerName"; - namespace QbsProjectManager { +using namespace Constants; QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, const QVariantMap &defaultData) const { diff --git a/src/plugins/qbsprojectmanager/qbsconstants.h b/src/plugins/qbsprojectmanager/qbsconstants.h new file mode 100644 index 00000000000..c5d08d0f1f0 --- /dev/null +++ b/src/plugins/qbsprojectmanager/qbsconstants.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#ifndef QBSCONSTANTS_H +#define QBSCONSTANTS_H + +namespace QbsProjectManager { +namespace Constants { + +// Qt related settings: +const char QTCORE_BINPATH[] = "Qt.core.binPath"; +const char QTCORE_BUILDVARIANT[] = "Qt.core.buildVariant"; +const char QTCORE_DOCPATH[] = "Qt.core.docPath"; +const char QTCORE_INCPATH[] = "Qt.core.incPath"; +const char QTCORE_LIBPATH[] = "Qt.core.libPath"; +const char QTCORE_VERSION[] = "Qt.core.version"; +const char QTCORE_NAMESPACE[] = "Qt.core.namespace"; +const char QTCORE_LIBINFIX[] = "Qt.core.libInfix"; +const char QTCORE_MKSPEC[] = "Qt.core.mkspecPath"; +const char QTCORE_FRAMEWORKBUILD[] = "Qt.core.frameworkBuild"; + + +// Toolchain related settings: +const char QBS_TARGETOS[] = "qbs.targetOS"; +const char QBS_SYSROOT[] = "qbs.sysroot"; +const char QBS_ARCHITECTURE[] = "qbs.architecture"; +const char QBS_ENDIANNESS[] = "qbs.endianness"; +const char QBS_TOOLCHAIN[] = "qbs.toolchain"; +const char CPP_TOOLCHAINPATH[] = "cpp.toolchainInstallPath"; +const char CPP_COMPILERNAME[] = "cpp.compilerName"; + +} // namespace Constants +} // namespace QbsProjectManager + +#endif // QBSCONSTANTS_H diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanager.pro b/src/plugins/qbsprojectmanager/qbsprojectmanager.pro index 1a907b1685e..b8e653a1df9 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanager.pro +++ b/src/plugins/qbsprojectmanager/qbsprojectmanager.pro @@ -33,7 +33,8 @@ HEADERS = \ qbsprojectmanagerplugin.h \ qbspropertylineedit.h \ qbsrunconfiguration.h \ - qbsstep.h + qbsstep.h \ + qbsconstants.h SOURCES = \ defaultpropertyprovider.cpp \