diff options
2689 files changed, 7759 insertions, 14009 deletions
diff --git a/.gitignore b/.gitignore index f100f3152c..92f7b6f6f5 100644 --- a/.gitignore +++ b/.gitignore @@ -187,6 +187,7 @@ tmp/ /tests/auto/ioutils/tst_ioutils /tests/auto/profilewriter/tst_profilewriter /tests/auto/qml/codemodel/check/tst_codemodel_check +/tests/auto/qml/codemodel/dependencies/tst_dependencies /tests/auto/qml/persistenttrie/tst_trie_check /tests/auto/qml/qmldesigner/bauhaustests/tst_bauhaus /tests/auto/qml/qmldesigner/coretests/tst_qmldesigner_core diff --git a/doc/api/examples/exampleplugin/example_global.h b/doc/api/examples/exampleplugin/example_global.h index 228343cdf0..00c77e6b16 100644 --- a/doc/api/examples/exampleplugin/example_global.h +++ b/doc/api/examples/exampleplugin/example_global.h @@ -1,5 +1,4 @@ -#ifndef EXAMPLE_GLOBAL_H -#define EXAMPLE_GLOBAL_H +#pragma once #include <QtGlobal> @@ -8,6 +7,3 @@ #else # define EXAMPLESHARED_EXPORT Q_DECL_IMPORT #endif - -#endif // EXAMPLE_GLOBAL_H - diff --git a/doc/api/examples/exampleplugin/exampleconstants.h b/doc/api/examples/exampleplugin/exampleconstants.h index 1fe6b83bc1..fced2e0429 100644 --- a/doc/api/examples/exampleplugin/exampleconstants.h +++ b/doc/api/examples/exampleplugin/exampleconstants.h @@ -1,5 +1,4 @@ -#ifndef EXAMPLECONSTANTS_H -#define EXAMPLECONSTANTS_H +#pragma once namespace Example { namespace Constants { @@ -9,6 +8,3 @@ const char MENU_ID[] = "Example.Menu"; } // namespace Example } // namespace Constants - -#endif // EXAMPLECONSTANTS_H - diff --git a/doc/api/examples/exampleplugin/exampleplugin.h b/doc/api/examples/exampleplugin/exampleplugin.h index 56f04ea746..e858e92180 100644 --- a/doc/api/examples/exampleplugin/exampleplugin.h +++ b/doc/api/examples/exampleplugin/exampleplugin.h @@ -1,5 +1,4 @@ -#ifndef EXAMPLE_H -#define EXAMPLE_H +#pragma once #include "example_global.h" @@ -35,6 +34,3 @@ private: } // namespace Internal } // namespace Example - -#endif // EXAMPLE_H - diff --git a/doc/examples/textfinder/textfinder.h b/doc/examples/textfinder/textfinder.h index 26182be9f4..8351a47377 100644 --- a/doc/examples/textfinder/textfinder.h +++ b/doc/examples/textfinder/textfinder.h @@ -48,8 +48,7 @@ ** ****************************************************************************/ -#ifndef TEXTFINDER_H -#define TEXTFINDER_H +#pragma once #include "ui_textfinder.h" @@ -77,5 +76,3 @@ private: void loadTextFile(); //! [0] }; - -#endif // TEXTFINDER_H diff --git a/doc/src/debugger/qtquick-debugging.qdoc b/doc/src/debugger/qtquick-debugging.qdoc index 3667582c03..ef04336563 100644 --- a/doc/src/debugger/qtquick-debugging.qdoc +++ b/doc/src/debugger/qtquick-debugging.qdoc @@ -219,6 +219,10 @@ application to jump to their definitions in the code. The properties of the selected item are displayed in the \uicontrol {Locals and Expressions} view. + The \uicontrol Select tool will be enabled either if your application is + using Qt 5.7 or later, or if your application is using an earlier version + of Qt and is based on the \c QQuickView class. + You can also view the item hierarchy in the running application: \list diff --git a/qbs/imports/QtcAutotest.qbs b/qbs/imports/QtcAutotest.qbs index 9eeebb9bc4..37e63e456d 100644 --- a/qbs/imports/QtcAutotest.qbs +++ b/qbs/imports/QtcAutotest.qbs @@ -16,7 +16,7 @@ QtcProduct { project.buildDirectory + '/' + project.ide_plugin_path ] cpp.minimumOsxVersion: "10.7" - cpp.defines: base.filter(function(d) { return d != "QT_NO_CAST_FROM_ASCII"; }) + cpp.defines: base.filter(function(d) { return d != "QT_RESTRICTED_CAST_FROM_ASCII"; }) Group { fileTagsFilter: product.type diff --git a/qbs/imports/QtcClangInstallation/functions.js b/qbs/imports/QtcClangInstallation/functions.js index 5a342b3bae..4c2019f149 100644 --- a/qbs/imports/QtcClangInstallation/functions.js +++ b/qbs/imports/QtcClangInstallation/functions.js @@ -1,3 +1,4 @@ +var Environment = loadExtension("qbs.Environment") var File = loadExtension("qbs.File") var MinimumLLVMVersion = "3.6.2" @@ -13,7 +14,7 @@ function isSuitableLLVMConfig(llvmConfigCandidate, qtcFunctions, processOutputRe function llvmConfig(qbs, qtcFunctions, processOutputReader) { - var llvmInstallDirFromEnv = qbs.getEnv("LLVM_INSTALL_DIR") + var llvmInstallDirFromEnv = Environment.getEnv("LLVM_INSTALL_DIR") var llvmConfigVariants = [ "llvm-config", "llvm-config-3.2", "llvm-config-3.3", "llvm-config-3.4", "llvm-config-3.5", "llvm-config-3.6", "llvm-config-4.0", "llvm-config-4.1" @@ -30,7 +31,7 @@ function llvmConfig(qbs, qtcFunctions, processOutputReader) } // Find llvm-config* in PATH - var pathListString = qbs.getEnv("PATH"); + var pathListString = Environment.getEnv("PATH"); var separator = qbs.hostOS.contains("windows") ? ";" : ":"; var pathList = pathListString.split(separator); for (var i = 0; i < llvmConfigVariants.length; ++i) { diff --git a/qtcreator.pri b/qtcreator.pri index 45b90c9f02..073c048278 100644 --- a/qtcreator.pri +++ b/qtcreator.pri @@ -1,9 +1,9 @@ !isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included") QTCREATOR_PRI_INCLUDED = 1 -QTCREATOR_VERSION = 3.6.83 -QTCREATOR_COMPAT_VERSION = 3.6.83 -BINARY_ARTIFACTS_BRANCH = 4.0 +QTCREATOR_VERSION = 4.0.82 +QTCREATOR_COMPAT_VERSION = 4.0.82 +BINARY_ARTIFACTS_BRANCH = master # enable c++11 CONFIG += c++11 @@ -150,7 +150,7 @@ exists($$IDE_LIBRARY_PATH): LIBS *= -L$$IDE_LIBRARY_PATH # library path from ou DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\" } -DEFINES += QT_CREATOR QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII +DEFINES += QT_CREATOR QT_NO_CAST_TO_ASCII QT_RESTRICTED_CAST_FROM_ASCII !macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION unix { diff --git a/qtcreator.qbs b/qtcreator.qbs index 3404784373..49227498d8 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -1,17 +1,18 @@ import qbs 1.0 +import qbs.Environment import qbs.FileInfo Project { name: "Qt Creator" - minimumQbsVersion: "1.4.3" + minimumQbsVersion: "1.5.0" property bool withAutotests: qbs.buildVariant === "debug" - property string ide_version_major: '3' - property string ide_version_minor: '6' - property string ide_version_release: '83' + property string ide_version_major: '4' + property string ide_version_minor: '0' + property string ide_version_release: '82' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release - property string ide_compat_version_major: '3' - property string ide_compat_version_minor: '6' - property string ide_compat_version_release: '83' + property string ide_compat_version_major: '4' + property string ide_compat_version_minor: '0' + property string ide_compat_version_release: '82' property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release property path ide_source_tree: path property string ide_app_path: qbs.targetOS.contains("osx") ? "" : "bin" @@ -51,12 +52,12 @@ Project { property string ide_bin_path: qbs.targetOS.contains("osx") ? ide_app_target + ".app/Contents/MacOS" : ide_app_path - property bool testsEnabled: qbs.getEnv("TEST") || qbs.buildVariant === "debug" + property bool testsEnabled: Environment.getEnv("TEST") || qbs.buildVariant === "debug" property stringList generalDefines: [ "QT_CREATOR", 'IDE_LIBRARY_BASENAME="' + libDirName + '"', "QT_NO_CAST_TO_ASCII", - "QT_NO_CAST_FROM_ASCII" + "QT_RESTRICTED_CAST_FROM_ASCII" ].concat(testsEnabled ? ["WITH_TESTS"] : []) qbsSearchPaths: "qbs" diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index cad3bed434..7e4ba8d979 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -30,6 +30,7 @@ import base64 import re import time import json +import inspect if sys.version_info[0] >= 3: xrange = range @@ -94,16 +95,6 @@ BreakpointOnQmlSignalEmit, \ BreakpointAtJavaScriptThrow, \ = range(0, 14) -# Display modes. Keep that synchronized with DebuggerDisplay in debuggerprotocol.h -StopDisplay, \ -DisplayImageData, \ -DisplayUtf16String, \ -DisplayImageFile, \ -DisplayLatin1String, \ -DisplayUtf8String, \ -DisplayPlotData \ - = range(7) - def arrayForms(): return [ArrayPlotFormat] @@ -372,7 +363,8 @@ class DumperBase: self.qqFormats = { "QVariant (QVariantMap)" : mapForms() } # This is a cache of all known dumpers. - self.qqDumpers = {} + self.qqDumpers = {} # Direct type match + self.qqDumpersEx = {} # Using regexp # This is a cache of all dumpers that support writing. self.qqEditable = {} @@ -536,23 +528,20 @@ class DumperBase: else: encodingType = "utf8" childType = "char" - displayType = DisplayLatin1String elif charSize == 2: encodingType = "utf16" childType = "short" - displayType = DisplayUtf16String else: encodingType = "ucs4" childType = "int" - displayType = DisplayUtf16String self.putValue(mem, encodingType, elided=elided) if displayFormat == SeparateLatin1StringFormat \ - or displayFormat == SeparateUtf8StringFormat: - self.putField("editformat", displayType) + or displayFormat == SeparateUtf8StringFormat \ + or displayFormat == SeparateFormat: elided, shown = self.computeLimit(bytelen, 100000) - self.putField("editvalue", self.readMemory(data, shown)) + self.putDisplay(encodingType + ':separate', self.readMemory(data, shown)) if makeExpandable: self.putNumChild(size) @@ -1027,6 +1016,12 @@ class DumperBase: dumper(self, value) return True + for pattern in self.qqDumpersEx.keys(): + dumper = self.qqDumpersEx[pattern] + if re.match(pattern, nsStrippedType): + dumper(self, value) + return True + return False def putSimpleCharArray(self, base, size = None): @@ -1071,7 +1066,7 @@ class DumperBase: self.putType(typeName) (elided, data) = self.encodeCArray(value, 1, limit) self.putValue(data, "latin1", elided=elided) - self.putDisplay(DisplayLatin1String, data) + self.putDisplay("latin1:separate", data) return True if displayFormat == Utf8StringFormat: @@ -1084,7 +1079,7 @@ class DumperBase: self.putType(typeName) (elided, data) = self.encodeCArray(value, 1, limit) self.putValue(data, "utf8", elided=elided) - self.putDisplay(DisplayUtf8String, data) + self.putDisplay("utf8:separate", data) return True if displayFormat == Local8BitStringFormat: @@ -1585,8 +1580,8 @@ class DumperBase: enc = self.simpleEncoding(innerType) if enc: self.putField("editencoding", enc) - self.putField("editvalue", self.readMemory(base, n * innerType.sizeof)) - self.putField("editformat", DisplayPlotData) + self.putDisplay("plotdata:separate", + self.readMemory(base, n * innerType.sizeof)) def putPlotData(self, base, n, innerType, maxNumChild = 1000*1000): self.putPlotDataHelper(base, n, innerType, maxNumChild=maxNumChild) @@ -1750,11 +1745,13 @@ class DumperBase: def registerDumper(self, funcname, function): try: - #warn("FUNCTION: %s " % funcname) - #funcname = function.func_name if funcname.startswith("qdump__"): typename = funcname[7:] - self.qqDumpers[typename] = function + spec = inspect.getargspec(function) + if len(spec.args) == 2: + self.qqDumpers[typename] = function + elif len(spec.args) == 3 and len(spec.defaults) == 1: + self.qqDumpersEx[spec.defaults[0]] = function self.qqFormats[typename] = self.qqFormats.get(typename, []) elif funcname.startswith("qform__"): typename = funcname[7:] diff --git a/share/qtcreator/debugger/misctypes.py b/share/qtcreator/debugger/misctypes.py index 75f0831013..0b8c877d09 100644 --- a/share/qtcreator/debugger/misctypes.py +++ b/share/qtcreator/debugger/misctypes.py @@ -231,28 +231,6 @@ if False: if False: - def qform__basic__Function(): - return "Normal,Displayed" - - def qdump__basic__Function(d, value): - min = value["min"] - max = value["max"] - data, size, alloc = d.byteArrayData(value["var"]) - var = extractCString(data, 0) - data, size, alloc = d.byteArrayData(value["f"]) - f = extractCString(data, 0) - d.putValue("%s, %s=%f..%f" % (f, var, min, max)) - d.putNumChild(0) - format = d.currentItemFormat() - if format == 1: - d.putDisplay(StopDisplay) - elif format == 2: - input = "plot [%s=%f:%f] %s" % (var, min, max, f) - d.putDisplay(DisplayProcess, input, "gnuplot") - - -if False: - def qdump__tree_entry(d, value): d.putValue("len: %s, offset: %s, type: %s" % (value["blocklength"], value["offset"], value["type"])) diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index ce475385a0..ef8778b649 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -61,14 +61,12 @@ def qdump__QByteArray(d, value): d.putValue(p, "latin1", elided=elided) elif displayFormat == SeparateLatin1StringFormat: d.putValue(p, "latin1", elided=elided) - d.putField("editformat", DisplayLatin1String) - d.putField("editvalue", d.encodeByteArray(value, limit=100000)) + d.putDisplay("latin1:separate", d.encodeByteArray(value, limit=100000)) elif displayFormat == Utf8StringFormat: d.putValue(p, "utf8", elided=elided) elif displayFormat == SeparateUtf8StringFormat: d.putValue(p, "utf8", elided=elided) - d.putField("editformat", DisplayUtf8String) - d.putField("editvalue", d.encodeByteArray(value, limit=100000)) + d.putDisplay("utf8:separate", d.encodeByteArray(value, limit=100000)) if d.isExpanded(): d.putArrayData(data, size, d.charType()) @@ -897,13 +895,12 @@ def qdump__QImage(d, value): # filename = file[1].replace("\\", "\\\\") # gdb.execute("dump binary memory %s %s %s" % # (filename, bits, bits + nbytes)) - # d.putDisplay(DisplayImageFile, " %d %d %d %d %s" + # d.putDisplay('imagefile:separate', " %d %d %d %d %s" # % (width, height, nbytes, iformat, filename)) - d.putField("editformat", DisplayImageData) - d.put('editvalue="') - d.put('%08x%08x%08x%08x' % (width, height, nbytes, iformat)) - d.put(d.readMemory(bits, nbytes)) - d.put('",') + d.putDisplay('imagedata:separate', + '%08x%08x%08x%08x' % (width, height, nbytes, iformat) + + d.readMemory(bits, nbytes)) + def qdump__QLinkedList(d, value): @@ -1788,8 +1785,7 @@ def qdump__QString(d, value): d.putNumChild(size) displayFormat = d.currentItemFormat() if displayFormat == SeparateFormat: - d.putField("editformat", DisplayUtf16String) - d.putField("editvalue", d.encodeString(value, limit=100000)) + d.putDisplay("utf16:separate", d.encodeString(value, limit=100000)) if d.isExpanded(): d.putArrayData(data, size, d.lookupType(d.qtNamespace() + "QChar")) @@ -1940,8 +1936,7 @@ def qdump__QUrl(d, value): displayFormat = d.currentItemFormat() if displayFormat == SeparateFormat: - d.putField("editformat", DisplayUtf16String) - d.putField("editvalue", url) + d.putDisplay("utf16:separate", url) d.putNumChild(8) if d.isExpanded(): diff --git a/share/qtcreator/qml/qmlpuppet/commands/changeauxiliarycommand.h b/share/qtcreator/qml/qmlpuppet/commands/changeauxiliarycommand.h index c0f366a7c6..669a747be8 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/changeauxiliarycommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/changeauxiliarycommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHANGEAUXILIARYCOMMAND_H -#define CHANGEAUXILIARYCOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -56,5 +55,3 @@ QDebug operator <<(QDebug debug, const ChangeAuxiliaryCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ChangeAuxiliaryCommand) - -#endif // CHANGEAUXILIARYCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/changebindingscommand.h b/share/qtcreator/qml/qmlpuppet/commands/changebindingscommand.h index 5a9696b9f5..b2df9e326c 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/changebindingscommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/changebindingscommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHANGEBINDINGSCOMMAND_H -#define CHANGEBINDINGSCOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -56,5 +55,3 @@ QDebug operator <<(QDebug debug, const ChangeBindingsCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ChangeBindingsCommand) - -#endif // CHANGEBINDINGSCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/changefileurlcommand.h b/share/qtcreator/qml/qmlpuppet/commands/changefileurlcommand.h index 6e20885cb4..5645274fc4 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/changefileurlcommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/changefileurlcommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHANGEFILEURLCOMMAND_H -#define CHANGEFILEURLCOMMAND_H +#pragma once #include <qmetatype.h> #include <QUrl> @@ -53,5 +52,3 @@ QDebug operator <<(QDebug debug, const ChangeFileUrlCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ChangeFileUrlCommand) - -#endif // CHANGEFILEURLCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/changeidscommand.h b/share/qtcreator/qml/qmlpuppet/commands/changeidscommand.h index 80e01c8f46..b92fb3b558 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/changeidscommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/changeidscommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHANGEIDSCOMMAND_H -#define CHANGEIDSCOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -57,5 +56,3 @@ QDebug operator <<(QDebug debug, const ChangeIdsCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ChangeIdsCommand) - -#endif // CHANGEIDSCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/changenodesourcecommand.h b/share/qtcreator/qml/qmlpuppet/commands/changenodesourcecommand.h index a11e2a8589..e5e2c48ac9 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/changenodesourcecommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/changenodesourcecommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHANGENODESOURCECOMMAND_H -#define CHANGENODESOURCECOMMAND_H +#pragma once #include <QMetaType> #include <QString> @@ -56,5 +55,3 @@ QDebug operator <<(QDebug debug, const ChangeNodeSourceCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ChangeNodeSourceCommand) - -#endif // CHANGENODESOURCECOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/changestatecommand.h b/share/qtcreator/qml/qmlpuppet/commands/changestatecommand.h index 91d74c9ebe..10ef832a32 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/changestatecommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/changestatecommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHANGESTATECOMMAND_H -#define CHANGESTATECOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -56,5 +55,3 @@ QDebug operator <<(QDebug debug, const ChangeStateCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ChangeStateCommand) - -#endif // CHANGESTATECOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/changevaluescommand.h b/share/qtcreator/qml/qmlpuppet/commands/changevaluescommand.h index 3272e54ef3..046e44ab62 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/changevaluescommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/changevaluescommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHANGEVALUESCOMMAND_H -#define CHANGEVALUESCOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -56,5 +55,3 @@ QDebug operator <<(QDebug debug, const ChangeValuesCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ChangeValuesCommand) - -#endif // CHANGEVALUESCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/childrenchangedcommand.h b/share/qtcreator/qml/qmlpuppet/commands/childrenchangedcommand.h index a597724f67..d2be1dca86 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/childrenchangedcommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/childrenchangedcommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHILDRENCHANGEDCOMMAND_H -#define CHILDRENCHANGEDCOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -62,5 +61,3 @@ QDebug operator <<(QDebug debug, const ChildrenChangedCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ChildrenChangedCommand) - -#endif // CHILDRENCHANGEDCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/clearscenecommand.h b/share/qtcreator/qml/qmlpuppet/commands/clearscenecommand.h index 45ef8e62fe..77c508ad4c 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/clearscenecommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/clearscenecommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLEARSCENECOMMAND_H -#define CLEARSCENECOMMAND_H +#pragma once #include <qmetatype.h> @@ -44,5 +43,3 @@ QDebug operator <<(QDebug debug, const ClearSceneCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ClearSceneCommand) - -#endif // CLEARSCENECOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/completecomponentcommand.h b/share/qtcreator/qml/qmlpuppet/commands/completecomponentcommand.h index af11ecc069..3eb86d9a13 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/completecomponentcommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/completecomponentcommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPLETECOMPONENT_H -#define COMPLETECOMPONENT_H +#pragma once #include <QMetaType> #include <QVector> @@ -55,5 +54,3 @@ QDebug operator <<(QDebug debug, const CompleteComponentCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::CompleteComponentCommand) - -#endif // COMPLETECOMPONENT_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/componentcompletedcommand.h b/share/qtcreator/qml/qmlpuppet/commands/componentcompletedcommand.h index 5117031d8e..b55434b71a 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/componentcompletedcommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/componentcompletedcommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPONENTCOMPLETEDCOMMAND_H -#define COMPONENTCOMPLETEDCOMMAND_H +#pragma once #include <QMetaType> #include <QVector> #include <QDataStream> @@ -57,5 +56,3 @@ QDebug operator <<(QDebug debug, const ComponentCompletedCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ComponentCompletedCommand) - -#endif // COMPONENTCOMPLETEDCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/createinstancescommand.h b/share/qtcreator/qml/qmlpuppet/commands/createinstancescommand.h index 4125ae08ca..d8ec9ba9f3 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/createinstancescommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/createinstancescommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CREATEINSTANCESCOMMAND_H -#define CREATEINSTANCESCOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -55,5 +54,3 @@ QDebug operator <<(QDebug debug, const CreateInstancesCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::CreateInstancesCommand) - -#endif // CREATEINSTANCESCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/createscenecommand.h b/share/qtcreator/qml/qmlpuppet/commands/createscenecommand.h index b11268f635..dc7130bd69 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/createscenecommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/createscenecommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CREATESCENECOMMAND_H -#define CREATESCENECOMMAND_H +#pragma once #include <qmetatype.h> #include <QUrl> @@ -81,5 +80,3 @@ QDebug operator <<(QDebug debug, const CreateSceneCommand &command); } Q_DECLARE_METATYPE(QmlDesigner::CreateSceneCommand) - -#endif // CREATESCENECOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/debugoutputcommand.h b/share/qtcreator/qml/qmlpuppet/commands/debugoutputcommand.h index e9ed4ff2f3..dbb386f23b 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/debugoutputcommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/debugoutputcommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_DEBUGOUTPUTCOMMAND_H -#define QMLDESIGNER_DEBUGOUTPUTCOMMAND_H +#pragma once #include <QMetaType> #include <QString> @@ -68,5 +67,3 @@ QDebug operator <<(QDebug debug, const DebugOutputCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::DebugOutputCommand) - -#endif // QMLDESIGNER_DEBUGOUTPUTCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.h b/share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.h index 9648d80cea..7ecee7acf7 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_ENDPUPPETCOMMAND_H -#define QMLDESIGNER_ENDPUPPETCOMMAND_H +#pragma once #include <qmetatype.h> @@ -44,5 +43,3 @@ QDebug operator <<(QDebug debug, const EndPuppetCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::EndPuppetCommand) - -#endif // QMLDESIGNER_ENDPUPPETCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/informationchangedcommand.h b/share/qtcreator/qml/qmlpuppet/commands/informationchangedcommand.h index b4af444f07..a21fae75cb 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/informationchangedcommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/informationchangedcommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INFORMATIONCHANGEDCOMMAND_H -#define INFORMATIONCHANGEDCOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -59,5 +58,3 @@ QDebug operator <<(QDebug debug, const InformationChangedCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::InformationChangedCommand) - -#endif // INFORMATIONCHANGEDCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/pixmapchangedcommand.h b/share/qtcreator/qml/qmlpuppet/commands/pixmapchangedcommand.h index 18fd7fec9e..23a246d431 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/pixmapchangedcommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/pixmapchangedcommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PIXMAPCHANGEDCOMMAND_H -#define PIXMAPCHANGEDCOMMAND_H +#pragma once #include <QMetaType> #include "imagecontainer.h" @@ -57,5 +56,3 @@ QDebug operator <<(QDebug debug, const PixmapChangedCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::PixmapChangedCommand) - -#endif // PIXMAPCHANGEDCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/puppetalivecommand.h b/share/qtcreator/qml/qmlpuppet/commands/puppetalivecommand.h index 2f5c471f81..eeb013de6b 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/puppetalivecommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/puppetalivecommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PUPPETALIVECOMMAND_H -#define PUPPETALIVECOMMAND_H +#pragma once #include <QMetaType> #include <QDebug> @@ -48,5 +47,3 @@ QDebug operator <<(QDebug debug, const PuppetAliveCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::PuppetAliveCommand) - -#endif // PUPPETALIVECOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/removeinstancescommand.h b/share/qtcreator/qml/qmlpuppet/commands/removeinstancescommand.h index 992a23237c..a92132ff40 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/removeinstancescommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/removeinstancescommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOVEINSTANCESCOMMAND_H -#define REMOVEINSTANCESCOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -57,5 +56,3 @@ QDebug operator <<(QDebug debug, const RemoveInstancesCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::RemoveInstancesCommand) - -#endif // REMOVEINSTANCESCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/removepropertiescommand.h b/share/qtcreator/qml/qmlpuppet/commands/removepropertiescommand.h index e950f392e9..911374c984 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/removepropertiescommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/removepropertiescommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOVEPROPERTIESCOMMAND_H -#define REMOVEPROPERTIESCOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -56,5 +55,3 @@ QDebug operator <<(QDebug debug, const RemovePropertiesCommand &command); } Q_DECLARE_METATYPE(QmlDesigner::RemovePropertiesCommand) - -#endif // REMOVEPROPERTIESCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/removesharedmemorycommand.h b/share/qtcreator/qml/qmlpuppet/commands/removesharedmemorycommand.h index b43eb56b57..44ab7b5a00 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/removesharedmemorycommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/removesharedmemorycommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_REMOVESHAREDMEMORYCOMMAND_H -#define QMLDESIGNER_REMOVESHAREDMEMORYCOMMAND_H +#pragma once #include <QMetaType> #include <QString> @@ -57,5 +56,3 @@ QDebug operator <<(QDebug debug, const RemoveSharedMemoryCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::RemoveSharedMemoryCommand) - -#endif // QMLDESIGNER_REMOVESHAREDMEMORYCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/reparentinstancescommand.h b/share/qtcreator/qml/qmlpuppet/commands/reparentinstancescommand.h index b94c362397..62659e2424 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/reparentinstancescommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/reparentinstancescommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REPARENTINSTANCESCOMMAND_H -#define REPARENTINSTANCESCOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -56,5 +55,3 @@ QDebug operator <<(QDebug debug, const ReparentInstancesCommand &command); } // Q_DECLARE_METATYPE(QmlDesigner::ReparentInstancesCommand) - -#endif // REPARENTINSTANCESCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/statepreviewimagechangedcommand.h b/share/qtcreator/qml/qmlpuppet/commands/statepreviewimagechangedcommand.h index 173aaf1fc2..a4d0f8f97b 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/statepreviewimagechangedcommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/statepreviewimagechangedcommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STATEPREVIEWIMAGECHANGEDCOMMAND_H -#define STATEPREVIEWIMAGECHANGEDCOMMAND_H +#pragma once #include <QMetaType> @@ -58,5 +57,3 @@ QDebug operator <<(QDebug debug, const StatePreviewImageChangedCommand &command) } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::StatePreviewImageChangedCommand) - -#endif // STATEPREVIEWIMAGECHANGEDCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.h b/share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.h index 3adc8e799b..6799ac5519 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/synchronizecommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SYNCHRONIZECOMMAND_H -#define SYNCHRONIZECOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -57,5 +56,3 @@ QDebug operator <<(QDebug debug, const SynchronizeCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::SynchronizeCommand) - -#endif // SYNCHRONIZECOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/tokencommand.h b/share/qtcreator/qml/qmlpuppet/commands/tokencommand.h index e4ff20b95d..5bde947908 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/tokencommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/tokencommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_TOKENCOMMAND_H -#define QMLDESIGNER_TOKENCOMMAND_H +#pragma once #include <QMetaType> @@ -64,6 +63,3 @@ QDebug operator <<(QDebug debug, const TokenCommand &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::TokenCommand) - - -#endif // QMLDESIGNER_TOKENCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.h b/share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.h index 97d0d00979..96050aee7f 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/valueschangedcommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef VALUESCHANGEDCOMMAND_H -#define VALUESCHANGEDCOMMAND_H +#pragma once #include <QMetaType> #include <QVector> @@ -63,6 +62,3 @@ QDebug operator <<(QDebug debug, const ValuesChangedCommand &instance); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ValuesChangedCommand) - - -#endif // VALUESCHANGEDCOMMAND_H diff --git a/share/qtcreator/qml/qmlpuppet/container/addimportcontainer.h b/share/qtcreator/qml/qmlpuppet/container/addimportcontainer.h index 6895104899..832b2afbb6 100644 --- a/share/qtcreator/qml/qmlpuppet/container/addimportcontainer.h +++ b/share/qtcreator/qml/qmlpuppet/container/addimportcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDIMPORTCONTAINER_H -#define ADDIMPORTCONTAINER_H +#pragma once #include <QMetaType> #include <QUrl> @@ -62,5 +61,3 @@ QDebug operator <<(QDebug debug, const AddImportContainer &container); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::AddImportContainer) - -#endif // ADDIMPORTCONTAINER_H diff --git a/share/qtcreator/qml/qmlpuppet/container/idcontainer.h b/share/qtcreator/qml/qmlpuppet/container/idcontainer.h index 1d682695c0..3e1e7c4088 100644 --- a/share/qtcreator/qml/qmlpuppet/container/idcontainer.h +++ b/share/qtcreator/qml/qmlpuppet/container/idcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IDCONTAINER_H -#define IDCONTAINER_H +#pragma once #include <QDataStream> #include <qmetatype.h> @@ -57,5 +56,3 @@ QDebug operator <<(QDebug debug, const IdContainer &container); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::IdContainer) - -#endif // IDCONTAINER_H diff --git a/share/qtcreator/qml/qmlpuppet/container/imagecontainer.h b/share/qtcreator/qml/qmlpuppet/container/imagecontainer.h index 7bc0ea5f17..b0bd3622a9 100644 --- a/share/qtcreator/qml/qmlpuppet/container/imagecontainer.h +++ b/share/qtcreator/qml/qmlpuppet/container/imagecontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IMAGECONTAINER_H -#define IMAGECONTAINER_H +#pragma once #include <QMetaType> #include <QImage> @@ -65,5 +64,3 @@ QDebug operator <<(QDebug debug, const ImageContainer &container); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ImageContainer) - -#endif // IMAGECONTAINER_H diff --git a/share/qtcreator/qml/qmlpuppet/container/informationcontainer.h b/share/qtcreator/qml/qmlpuppet/container/informationcontainer.h index 5340b00b6f..c624e4c5e4 100644 --- a/share/qtcreator/qml/qmlpuppet/container/informationcontainer.h +++ b/share/qtcreator/qml/qmlpuppet/container/informationcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INFORMATIONCONTAINER_H -#define INFORMATIONCONTAINER_H +#pragma once #include <QDataStream> #include <QMetaType> @@ -74,5 +73,3 @@ QDebug operator <<(QDebug debug, const InformationContainer &container); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::InformationContainer) - -#endif // INFORMATIONCONTAINER_H diff --git a/share/qtcreator/qml/qmlpuppet/container/instancecontainer.h b/share/qtcreator/qml/qmlpuppet/container/instancecontainer.h index 6ec57c6efc..f8b4d84680 100644 --- a/share/qtcreator/qml/qmlpuppet/container/instancecontainer.h +++ b/share/qtcreator/qml/qmlpuppet/container/instancecontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INSTANCECONTAINER_H -#define INSTANCECONTAINER_H +#pragma once #include <qmetatype.h> #include <QString> @@ -83,4 +82,3 @@ QDebug operator <<(QDebug debug, const InstanceContainer &command); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::InstanceContainer) -#endif // INSTANCECONTAINER_H diff --git a/share/qtcreator/qml/qmlpuppet/container/propertyabstractcontainer.h b/share/qtcreator/qml/qmlpuppet/container/propertyabstractcontainer.h index 3889cb8319..df51c3306b 100644 --- a/share/qtcreator/qml/qmlpuppet/container/propertyabstractcontainer.h +++ b/share/qtcreator/qml/qmlpuppet/container/propertyabstractcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYABSTRACTCONTAINER_H -#define PROPERTYABSTRACTCONTAINER_H +#pragma once #include <QDataStream> #include <qmetatype.h> @@ -65,4 +64,3 @@ QDebug operator <<(QDebug debug, const PropertyAbstractContainer &container); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::PropertyAbstractContainer) -#endif // PROPERTYABSTRACTCONTAINER_H diff --git a/share/qtcreator/qml/qmlpuppet/container/propertybindingcontainer.h b/share/qtcreator/qml/qmlpuppet/container/propertybindingcontainer.h index 84bf5f4d8c..fb4a245bdc 100644 --- a/share/qtcreator/qml/qmlpuppet/container/propertybindingcontainer.h +++ b/share/qtcreator/qml/qmlpuppet/container/propertybindingcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYBINDINGCONTAINER_H -#define PROPERTYBINDINGCONTAINER_H +#pragma once #include <QDataStream> #include <qmetatype.h> @@ -63,4 +62,3 @@ QDebug operator <<(QDebug debug, const PropertyBindingContainer &container); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::PropertyBindingContainer) -#endif // PROPERTYBINDINGCONTAINER_H diff --git a/share/qtcreator/qml/qmlpuppet/container/propertyvaluecontainer.h b/share/qtcreator/qml/qmlpuppet/container/propertyvaluecontainer.h index e3f8bcf216..3423066bc1 100644 --- a/share/qtcreator/qml/qmlpuppet/container/propertyvaluecontainer.h +++ b/share/qtcreator/qml/qmlpuppet/container/propertyvaluecontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYVALUECONTAINER_H -#define PROPERTYVALUECONTAINER_H +#pragma once #include <QDataStream> #include <QMetaType> @@ -68,5 +67,3 @@ QDebug operator <<(QDebug debug, const PropertyValueContainer &container); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::PropertyValueContainer) - -#endif // PROPERTYVALUECONTAINER_H diff --git a/share/qtcreator/qml/qmlpuppet/container/reparentcontainer.h b/share/qtcreator/qml/qmlpuppet/container/reparentcontainer.h index 2751937485..76d57b577a 100644 --- a/share/qtcreator/qml/qmlpuppet/container/reparentcontainer.h +++ b/share/qtcreator/qml/qmlpuppet/container/reparentcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REPARENTCONTAINER_H -#define REPARENTCONTAINER_H +#pragma once #include <qmetatype.h> #include <QString> @@ -65,5 +64,3 @@ QDataStream &operator>>(QDataStream &in, ReparentContainer &container); QDebug operator <<(QDebug debug, const ReparentContainer &container); } // namespace QmlDesigner - -#endif // REPARENTCONTAINER_H diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory.h b/share/qtcreator/qml/qmlpuppet/container/sharedmemory.h index 482d3d86af..9e6dc794e8 100644 --- a/share/qtcreator/qml/qmlpuppet/container/sharedmemory.h +++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_SHAREDMEMORY_H -#define QMLDESIGNER_SHAREDMEMORY_H +#pragma once #include <QSharedMemory> #include <QSystemSemaphore> @@ -88,5 +87,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_SHAREDMEMORY_H diff --git a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp index 577374b8c5..11ea5721b9 100644 --- a/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp +++ b/share/qtcreator/qml/qmlpuppet/container/sharedmemory_unix.cpp @@ -295,7 +295,8 @@ void SharedMemory::setErrorString(const QString &function) m_error = QSharedMemory::OutOfResources; break; default: - m_errorString = QStringLiteral("%1: unknown error %2").arg(function).arg(strerror(errno)); + m_errorString = QStringLiteral("%1: unknown error %2") + .arg(function).arg(QString::fromLocal8Bit(strerror(errno))); m_error = QSharedMemory::UnknownError; } } diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h index ba55f0cea3..2b75ca3a4b 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h +++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEINSTANCECLIENTPROXY_H -#define NODEINSTANCECLIENTPROXY_H +#pragma once #include "nodeinstanceclientinterface.h" @@ -123,5 +122,3 @@ private: }; } // namespace QmlDesigner - -#endif // NODEINSTANCECLIENTPROXY_H diff --git a/share/qtcreator/qml/qmlpuppet/interfaces/commondefines.h b/share/qtcreator/qml/qmlpuppet/interfaces/commondefines.h index 37e0b027e8..51010c9a53 100644 --- a/share/qtcreator/qml/qmlpuppet/interfaces/commondefines.h +++ b/share/qtcreator/qml/qmlpuppet/interfaces/commondefines.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMMONDEFINES_H -#define COMMONDEFINES_H +#pragma once #include <QMetaType> #include <QPair> @@ -57,5 +56,3 @@ enum InformationName }; } - -#endif // COMMONDEFINES_H diff --git a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceclientinterface.h b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceclientinterface.h index 34600fd174..43c50b510c 100644 --- a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceclientinterface.h +++ b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceclientinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEINSTANCECLIENTINTERFACE_H -#define NODEINSTANCECLIENTINTERFACE_H +#pragma once #include <QtGlobal> @@ -59,5 +58,3 @@ public: }; } - -#endif // NODEINSTANCECLIENTINTERFACE_H diff --git a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceglobal.h b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceglobal.h index ab06fdda33..c7ceef01b2 100644 --- a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceglobal.h +++ b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceglobal.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEINSTANCEGLOBAL_H -#define NODEINSTANCEGLOBAL_H +#pragma once #include <QByteArray> #include <QList> @@ -36,5 +35,3 @@ typedef QList<PropertyName> PropertyNameList; typedef QByteArray TypeName; } - -#endif // NODEINSTANCEGLOBAL_H diff --git a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceserverinterface.h b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceserverinterface.h index 30b779ff7e..e3ac6cd111 100644 --- a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceserverinterface.h +++ b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceserverinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEINSTANCESERVERINTERFACE_H -#define NODEINSTANCESERVERINTERFACE_H +#pragma once #include <QObject> @@ -83,4 +82,3 @@ public: }; } -#endif // NODEINSTANCESERVERINTERFACE_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/anchorchangesnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/anchorchangesnodeinstance.h index 5b7a204067..a9072b6058 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/anchorchangesnodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/anchorchangesnodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_ANCHORCHANGESNODEINSTANCE_H -#define QMLDESIGNER_ANCHORCHANGESNODEINSTANCE_H +#pragma once #include "objectnodeinstance.h" @@ -64,5 +63,3 @@ protected: } // namespace Internal } // namespace QmlDesigner - -#endif // QMLDESIGNER_ANCHORCHANGESNODEINSTANCE_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/behaviornodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/behaviornodeinstance.h index 6f040db877..b18f4882cb 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/behaviornodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/behaviornodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEHAVIORNODEINSTANCE_H -#define BEHAVIORNODEINSTANCE_H +#pragma once #include "objectnodeinstance.h" @@ -52,5 +51,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // BEHAVIORNODEINSTANCE_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/childrenchangeeventfilter.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/childrenchangeeventfilter.h index 51df307dd0..659ccf58f3 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/childrenchangeeventfilter.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/childrenchangeeventfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHILDRENCHANGEEVENTFILTER_H -#define CHILDRENCHANGEEVENTFILTER_H +#pragma once #include <QObject> @@ -48,5 +47,3 @@ protected: } // namespace Internal } // namespace QmlDesigner - -#endif // CHILDRENCHANGEEVENTFILTER_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/componentnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/componentnodeinstance.h index 02ec457fc8..24ae2dd5d2 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/componentnodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/componentnodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPONENTNODEINSTANCE_H -#define COMPONENTNODEINSTANCE_H +#pragma once #include "objectnodeinstance.h" @@ -54,5 +53,3 @@ private: //function } // Internal } // QmlDesigner - -#endif // COMPONENTNODEINSTANCE_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummycontextobject.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummycontextobject.h index 4048d1ff4a..73320dfcf6 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummycontextobject.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummycontextobject.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DUMMYCONTEXTOBJECT_H -#define DUMMYCONTEXTOBJECT_H +#pragma once #include <QObject> #include <QPointer> @@ -53,4 +52,3 @@ private: } // namespace QmlDesigner QML_DECLARE_TYPE(QmlDesigner::DummyContextObject) -#endif // DUMMYCONTEXTOBJECT_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummynodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummynodeinstance.h index 2e35f841c6..6a1711399e 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummynodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/dummynodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DUMMYNODEINSTANCE_H -#define DUMMYNODEINSTANCE_H +#pragma once #include <QWeakPointer> @@ -61,4 +60,3 @@ protected: } } -#endif // DUMMYNODEINSTANCE_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/layoutnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/layoutnodeinstance.h index 58d7ec9f90..f7d0d3e3a6 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/layoutnodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/layoutnodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LAYOUTNODEINSTANCE_H -#define LAYOUTNODEINSTANCE_H +#pragma once #include "quickitemnodeinstance.h" @@ -54,5 +53,3 @@ protected: } // namespace Internal } // namespace QmlDesigner - -#endif // LAYOUTNODEINSTANCE_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp index 8507d27eb0..7179596200 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp @@ -821,7 +821,7 @@ void NodeInstanceServer::resetInstanceProperty(const PropertyAbstractContainer & } if (propertyContainer.isDynamic() && propertyContainer.instanceId() == 0 && engine()) - rootContext()->setContextProperty(name, QVariant()); + rootContext()->setContextProperty(QString::fromUtf8(name), QVariant()); } } @@ -839,12 +839,14 @@ void NodeInstanceServer::setInstancePropertyBinding(const PropertyBindingContain bool stateBindingWasUpdated = activeStateInstance().updateStateBinding(instance, name, expression); if (!stateBindingWasUpdated) { if (bindingContainer.isDynamic()) - Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), name); + Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), + QString::fromUtf8(name)); instance.setPropertyBinding(name, expression); } } else { if (bindingContainer.isDynamic()) - Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), name); + Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), + QString::fromUtf8(name)); instance.setPropertyBinding(name, expression); } } @@ -871,17 +873,17 @@ void NodeInstanceServer::setInstancePropertyVariant(const PropertyValueContainer bool stateValueWasUpdated = activeStateInstance().updateStateVariant(instance, name, value); if (!stateValueWasUpdated) { if (valueContainer.isDynamic()) - Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), name); + Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), QString::fromUtf8(name)); instance.setPropertyVariant(name, value); } } else { //base state if (valueContainer.isDynamic()) - Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), name); + Internal::QmlPrivateGate::createNewDynamicProperty(instance.internalInstance()->object(), engine(), QString::fromUtf8(name)); instance.setPropertyVariant(name, value); } if (valueContainer.isDynamic() && valueContainer.instanceId() == 0 && engine()) - rootContext()->setContextProperty(name, Internal::QmlPrivateGate::fixResourcePaths(value)); + rootContext()->setContextProperty(QString::fromUtf8(name), Internal::QmlPrivateGate::fixResourcePaths(value)); } } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.h index 00f882deab..6ac34eecf5 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEINSTANCESERVER_H -#define NODEINSTANCESERVER_H +#pragma once #include <QUrl> #include <QVector> @@ -225,5 +224,3 @@ private: }; } - -#endif // NODEINSTANCESERVER_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstancesignalspy.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstancesignalspy.h index c5ebc58687..066c74f6a3 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstancesignalspy.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstancesignalspy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEINSTANCESIGNALSPY_H -#define NODEINSTANCESIGNALSPY_H +#pragma once #include <QObject> #include <QHash> @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // NODEINSTANCESIGNALSPY_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp index d0f60103ae..1695e6e55f 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp @@ -301,7 +301,7 @@ static void removeObjectFromList(const QQmlProperty &property, QObject *objectTo void ObjectNodeInstance::removeFromOldProperty(QObject *object, QObject *oldParent, const PropertyName &oldParentProperty) { - QQmlProperty property(oldParent, oldParentProperty, context()); + QQmlProperty property(oldParent, QString::fromUtf8(oldParentProperty), context()); if (!property.isValid()) return; @@ -320,7 +320,7 @@ void ObjectNodeInstance::removeFromOldProperty(QObject *object, QObject *oldPare void ObjectNodeInstance::addToNewProperty(QObject *object, QObject *newParent, const PropertyName &newParentProperty) { - QQmlProperty property(newParent, newParentProperty, context()); + QQmlProperty property(newParent, QString::fromUtf8(newParentProperty), context()); if (object) object->setParent(newParent); @@ -400,7 +400,7 @@ void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVar if (ignoredProperties().contains(name)) return; - QQmlProperty property(object(), name, context()); + QQmlProperty property(object(), QString::fromUtf8(name), context()); if (!property.isValid()) return; @@ -482,7 +482,7 @@ void ObjectNodeInstance::resetProperty(const PropertyName &name) void ObjectNodeInstance::refreshProperty(const PropertyName &name) { - QQmlProperty property(object(), name, context()); + QQmlProperty property(object(), QString::fromUtf8(name), context()); if (!property.isValid()) return; @@ -523,7 +523,7 @@ QVariant ObjectNodeInstance::property(const PropertyName &name) const if (QmlPrivateGate::isPropertyBlackListed(name)) return QVariant(); - QQmlProperty property(object(), name, context()); + QQmlProperty property(object(), QString::fromUtf8(name), context()); if (property.property().isEnumType()) { QVariant value = property.read(); return property.property().enumerator().valueToKey(value.toInt()); @@ -555,10 +555,10 @@ QString ObjectNodeInstance::instanceType(const PropertyName &name) const if (QmlPrivateGate::isPropertyBlackListed(name)) return QLatin1String("undefined"); - QQmlProperty property(object(), name, context()); + QQmlProperty property(object(), QString::fromUtf8(name), context()); if (!property.isValid()) return QLatin1String("undefined"); - return property.propertyTypeName(); + return QString::fromUtf8(property.propertyTypeName()); } QList<ServerNodeInstance> ObjectNodeInstance::childItems() const diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h index 200993a80f..cecc9c8ee3 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OBJECTNODEINSTANCE_H -#define OBJECTNODEINSTANCE_H +#pragma once #include "nodeinstanceserver.h" #include "nodeinstancesignalspy.h" @@ -221,5 +220,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // OBJECTNODEINSTANCE_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/positionernodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/positionernodeinstance.h index a2ac190148..7575014ea8 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/positionernodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/positionernodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef POSITIONERNODEINSTANCE_H -#define POSITIONERNODEINSTANCE_H +#pragma once #include "quickitemnodeinstance.h" @@ -58,5 +57,3 @@ protected: } // namespace Internal } // namespace QmlDesigner - -#endif // POSITIONERNODEINSTANCE_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlpropertychangesnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlpropertychangesnodeinstance.h index 72fe51de62..4ea6c896ec 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlpropertychangesnodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlpropertychangesnodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROPERTYCHANGESNODEINSTANCE_H -#define QMLPROPERTYCHANGESNODEINSTANCE_H +#pragma once #include "objectnodeinstance.h" @@ -60,5 +59,3 @@ protected: } // namespace QmlDesigner //QML_DECLARE_TYPE(QmlDesigner::Internal::QmlPropertyChangesObject) - -#endif // QMLPROPERTYCHANGESNODEINSTANCE_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.h index 12bbf25349..5c09bb7ab7 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLSTATENODEINSTANCE_H -#define QMLSTATENODEINSTANCE_H +#pragma once #include "objectnodeinstance.h" @@ -57,5 +56,3 @@ protected: } // namespace Internal } // namespace QmlDesigner - -#endif // QMLSTATENODEINSTANCE_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.h index e297e5db35..dc1f01dec4 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmltransitionnodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLTRANSITIONNODEINSTANCE_H -#define QMLTRANSITIONNODEINSTANCE_H +#pragma once #include "objectnodeinstance.h" @@ -48,4 +47,3 @@ private: }; } } -#endif // QMLTRANSITIONNODEINSTANCE_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index ae53e1f4d3..9e0461ba29 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -152,10 +152,8 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands() foreach (const InstancePropertyPair& property, changedPropertyList()) { const ServerNodeInstance instance = property.first; - const QString propertyName = property.second; - if (instance.isValid()) { - if (propertyName.contains("anchors")) + if (property.second.contains("anchors")) informationChangedInstanceSet.insert(instance); propertyChangedList.append(property); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h index 2800806638..3f6ecdd94d 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_QT5INFORMATIONNODEINSTANCESERVER_H -#define QMLDESIGNER_QT5INFORMATIONNODEINSTANCESERVER_H +#pragma once #include "qt5nodeinstanceserver.h" #include "tokencommand.h" @@ -58,5 +57,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_QT5INFORMATIONNODEINSTANCESERVER_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.h index 2a7a272d44..b8efccc7ec 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_QT5NODEINSTANCECLIENTPROXY_H -#define QMLDESIGNER_QT5NODEINSTANCECLIENTPROXY_H +#pragma once #include "nodeinstanceclientproxy.h" @@ -38,5 +37,3 @@ public: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_QT5NODEINSTANCECLIENTPROXY_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.h index 5dcbd1cd7d..d4aaa91ddf 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QT5NODEINSTANCESERVER_H -#define QT5NODEINSTANCESERVER_H +#pragma once #include <QtGlobal> @@ -68,5 +67,3 @@ private: }; } // QmlDesigner - -#endif // QT5NODEINSTANCESERVER_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5previewnodeinstanceserver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5previewnodeinstanceserver.h index 187617cc9f..c47681ec21 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5previewnodeinstanceserver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5previewnodeinstanceserver.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_QT5PREVIEWNODEINSTANCESERVER_H -#define QMLDESIGNER_QT5PREVIEWNODEINSTANCESERVER_H +#pragma once #include "qt5nodeinstanceserver.h" @@ -51,5 +50,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_QT5PREVIEWNODEINSTANCESERVER_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.h index 5f885f8b66..1a9fcf624e 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_QT5RENDERNODEINSTANCESERVER_H -#define QMLDESIGNER_QT5RENDERNODEINSTANCESERVER_H +#pragma once #include "qt5nodeinstanceserver.h" @@ -50,5 +49,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_QT5RENDERNODEINSTANCESERVER_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.cpp index 44d361f8f8..ec90f0ce63 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.cpp @@ -276,10 +276,8 @@ void QmlDesigner::Qt5TestNodeInstanceServer::collectItemChangesAndSendChangeComm foreach (const InstancePropertyPair& property, changedPropertyList()) { const ServerNodeInstance instance = property.first; - const QString propertyName = property.second; - if (instance.isValid()) { - if (propertyName.contains("anchors")) + if (property.second.contains("anchors")) informationChangedInstanceSet.insert(instance); propertyChangedList.append(property); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.h index 8a8aec7b8b..af30c423d6 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5testnodeinstanceserver.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_QT5TESTNODEINSTANCESERVER_H -#define QMLDESIGNER_QT5TESTNODEINSTANCESERVER_H +#pragma once #include "qt5nodeinstanceserver.h" @@ -61,5 +60,3 @@ protected: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_QT5TESTNODEINSTANCESERVER_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp index 2a3420a3da..0014def3b0 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp @@ -690,7 +690,7 @@ void QuickItemNodeInstance::resetProperty(const PropertyName &name) if (name == "y") m_y = 0.0; - DesignerSupport::resetAnchor(quickItem(), name); + DesignerSupport::resetAnchor(quickItem(), QString::fromUtf8(name)); if (name == "anchors.fill") { resetHorizontal(); @@ -727,7 +727,7 @@ bool QuickItemNodeInstance::isAnchoredByChildren() const bool QuickItemNodeInstance::hasAnchor(const PropertyName &name) const { - return DesignerSupport::hasAnchor(quickItem(), name); + return DesignerSupport::hasAnchor(quickItem(), QString::fromUtf8(name)); } static bool isValidAnchorName(const PropertyName &name) @@ -747,10 +747,11 @@ static bool isValidAnchorName(const PropertyName &name) QPair<PropertyName, ServerNodeInstance> QuickItemNodeInstance::anchor(const PropertyName &name) const { - if (!isValidAnchorName(name) || !DesignerSupport::hasAnchor(quickItem(), name)) + if (!isValidAnchorName(name) || !DesignerSupport::hasAnchor(quickItem(), QString::fromUtf8(name))) return ObjectNodeInstance::anchor(name); - QPair<QString, QObject*> nameObjectPair = DesignerSupport::anchorLineTarget(quickItem(), name, context()); + QPair<QString, QObject*> nameObjectPair = + DesignerSupport::anchorLineTarget(quickItem(), QString::fromUtf8(name), context()); QObject *targetObject = nameObjectPair.second; PropertyName targetName = nameObjectPair.first.toUtf8(); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.h index 8936927ab9..d655a9a103 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QuickITEMNODEINSTANCE_H -#define QuickITEMNODEINSTANCE_H +#pragma once #include <QtGlobal> @@ -134,6 +133,3 @@ private: //variables } // namespace Internal } // namespace QmlDesigner - -#endif // QuickITEMNODEINSTANCE_H - diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp index 898170ad93..58b17e2451 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp @@ -205,7 +205,7 @@ ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceSe if (object == 0) nodeInstanceServer->sendDebugOutput(DebugOutputCommand::ErrorType, QString("Component with path %1 could not be created.").arg(instanceContainer.componentPath()), instanceContainer.instanceId()); } else { - object = Internal::ObjectNodeInstance::createPrimitive(instanceContainer.type(), instanceContainer.majorNumber(), instanceContainer.minorNumber(), nodeInstanceServer->context()); + object = Internal::ObjectNodeInstance::createPrimitive(QString::fromUtf8(instanceContainer.type()), instanceContainer.majorNumber(), instanceContainer.minorNumber(), nodeInstanceServer->context()); if (object == 0) nodeInstanceServer->sendDebugOutput(DebugOutputCommand::ErrorType, QLatin1String("Item could not be created."), instanceContainer.instanceId()); } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h index 424cd6dbac..c0c3f87608 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SERVERNODEINSTANCE_H -#define SERVERNODEINSTANCE_H +#pragma once #include <QSharedPointer> #include <QHash> @@ -214,5 +213,3 @@ QDebug operator <<(QDebug debug, const ServerNodeInstance &instance); } Q_DECLARE_METATYPE(QmlDesigner::ServerNodeInstance) - -#endif // SERVERNODEINSTANCE_H diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri index 1c50bc3770..954596d16e 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri @@ -20,7 +20,6 @@ QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH) SOURCES += $$PWD/qml2puppetmain.cpp RESOURCES += $$PWD/../qmlpuppet.qrc -DEFINES -= QT_NO_CAST_FROM_ASCII DISTFILES += Info.plist diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/designercustomobjectdata.h b/share/qtcreator/qml/qmlpuppet/qmlprivategate/designercustomobjectdata.h index e8601e42ef..c7030fe400 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/designercustomobjectdata.h +++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/designercustomobjectdata.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNERCUSTOMOBJECTDATA_H -#define DESIGNERCUSTOMOBJECTDATA_H +#pragma once #include "nodeinstanceglobal.h" @@ -81,5 +80,3 @@ private: } // namespace QmlPrivateGate } // namespace Internal } // namespace QmlDesigner - -#endif // DESIGNERCUSTOMOBJECTDATA_H diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/metaobject.h b/share/qtcreator/qml/qmlpuppet/qmlprivategate/metaobject.h index 800091c777..fc61657c07 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/metaobject.h +++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/metaobject.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEINSTANCEMETAOBJECT_H -#define NODEINSTANCEMETAOBJECT_H +#pragma once #include <QQmlContext> #include <QScopedPointer> @@ -94,5 +93,3 @@ private: } // namespace QmlPrivateGate } // namespace Internal } // namespace QmlDesigner - -#endif // NODEINSTANCEMETAOBJECT_H diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h index 467659a2c2..bd17a68a1e 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h +++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPRIVATEGATE_H -#define QMLPRIVATEGATE_H +#pragma once #include "nodeinstanceglobal.h" @@ -131,5 +130,3 @@ public: } // namespace QmlPrivateGate } // namespace Internal } // namespace QmlDesigner - -#endif // QMLPRIVATEGATE_H diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp index b255fb77c8..8edf669365 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp +++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp @@ -94,7 +94,7 @@ QVariant fixResourcePaths(const QVariant &value) const QUrl url = value.toUrl(); if (url.scheme() == QLatin1String("qrc")) { const QString path = QLatin1String("qrc:") + url.path(); - QString qrcSearchPath = qgetenv("QMLDESIGNER_RC_PATHS"); + QString qrcSearchPath = QString::fromLocal8Bit(qgetenv("QMLDESIGNER_RC_PATHS")); if (!qrcSearchPath.isEmpty()) { const QStringList searchPaths = qrcSearchPath.split(QLatin1Char(';')); foreach (const QString &qrcPath, searchPaths) { @@ -115,7 +115,7 @@ QVariant fixResourcePaths(const QVariant &value) if (value.type() == QVariant::String) { const QString str = value.toString(); if (str.contains(QLatin1String("qrc:"))) { - QString qrcSearchPath = qgetenv("QMLDESIGNER_RC_PATHS"); + QString qrcSearchPath = QString::fromLocal8Bit(qgetenv("QMLDESIGNER_RC_PATHS")); if (!qrcSearchPath.isEmpty()) { const QStringList searchPaths = qrcSearchPath.split(QLatin1Char(';')); foreach (const QString &qrcPath, searchPaths) { @@ -168,7 +168,7 @@ QVariant getResetValue(QObject *object, const PropertyName &propertyName) static void setProperty(QObject *object, QQmlContext *context, const PropertyName &propertyName, const QVariant &value) { - QQmlProperty property(object, propertyName, context); + QQmlProperty property(object, QString::fromUtf8(propertyName), context); property.write(value); } diff --git a/share/qtcreator/qml/qmlpuppet/types/enumeration.h b/share/qtcreator/qml/qmlpuppet/types/enumeration.h index 537a391b9e..84028dd24a 100644 --- a/share/qtcreator/qml/qmlpuppet/types/enumeration.h +++ b/share/qtcreator/qml/qmlpuppet/types/enumeration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_ENUMERATION_H -#define QMLDESIGNER_ENUMERATION_H +#pragma once #include <QByteArray> #include <QDataStream> @@ -69,5 +68,3 @@ QDebug operator <<(QDebug debug, const Enumeration &enumeration); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::Enumeration) - -#endif // QMLDESIGNER_ENUMERATION_H diff --git a/share/qtcreator/styles/dark.xml b/share/qtcreator/styles/dark.xml index e8719c1079..4a605d3f02 100644 --- a/share/qtcreator/styles/dark.xml +++ b/share/qtcreator/styles/dark.xml @@ -15,6 +15,7 @@ <style name="Doxygen.Tag" foreground="#00a0a0"/> <style name="Field"/> <style name="Function"/> + <style name="Global"/> <style name="Keyword" foreground="#ffff55"/> <style name="PrimitiveType" foreground="#ffff55"/> <style name="Label" foreground="#ffff55"/> diff --git a/share/qtcreator/styles/inkpot.xml b/share/qtcreator/styles/inkpot.xml index 6253ec6774..65336e86bf 100644 --- a/share/qtcreator/styles/inkpot.xml +++ b/share/qtcreator/styles/inkpot.xml @@ -20,6 +20,7 @@ <style name="Doxygen.Tag" foreground="#4e5ab3"/> <style name="Field" bold="true"/> <style name="Function"/> + <style name="Global"/> <style name="Keyword" foreground="#808bed"/> <style name="PrimitiveType" foreground="#808bed"/> <style name="Label" foreground="#e76000"/> diff --git a/share/qtcreator/templates/wizards/qtquick1-extension/plugin.h b/share/qtcreator/templates/wizards/qtquick1-extension/plugin.h index d487a8339d..bb4976b12e 100644 --- a/share/qtcreator/templates/wizards/qtquick1-extension/plugin.h +++ b/share/qtcreator/templates/wizards/qtquick1-extension/plugin.h @@ -1,5 +1,4 @@ -#ifndef %ProjectName:h%_PLUGIN_H -#define %ProjectName:h%_PLUGIN_H +#pragma once #include <QDeclarativeExtensionPlugin> @@ -13,5 +12,3 @@ class %ProjectName:s%Plugin : public QDeclarativeExtensionPlugin public: void registerTypes(const char *uri); }; - -#endif // %ProjectName:h%_PLUGIN_H diff --git a/share/qtcreator/templates/wizards/qtquick2-extension/plugin.h b/share/qtcreator/templates/wizards/qtquick2-extension/plugin.h index 3b0bc2a355..da01f59d04 100644 --- a/share/qtcreator/templates/wizards/qtquick2-extension/plugin.h +++ b/share/qtcreator/templates/wizards/qtquick2-extension/plugin.h @@ -1,5 +1,4 @@ -#ifndef %ProjectName:h%_PLUGIN_H -#define %ProjectName:h%_PLUGIN_H +#pragma once #include <QQmlExtensionPlugin> @@ -11,5 +10,3 @@ class %ProjectName:s%Plugin : public QQmlExtensionPlugin public: void registerTypes(const char *uri); }; - -#endif // %ProjectName:h%_PLUGIN_H diff --git a/src/app/app_version.h.in b/src/app/app_version.h.in index 9aed843da3..b48d6bee4c 100644 --- a/src/app/app_version.h.in +++ b/src/app/app_version.h.in @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef APP_VERSION_H -#define APP_VERSION_H +#pragma once namespace Core { namespace Constants { @@ -76,5 +75,3 @@ const char * const IDE_COPY_SETTINGS_FROM_VARIANT_STR = \"Nokia\"; } // Constants } // Core - -#endif //APP_VERSION_H diff --git a/src/libs/3rdparty/cplusplus/AST.h b/src/libs/3rdparty/cplusplus/AST.h index bcdf043362..fc6750320b 100644 --- a/src/libs/3rdparty/cplusplus/AST.h +++ b/src/libs/3rdparty/cplusplus/AST.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_AST_H -#define CPLUSPLUS_AST_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "ASTfwd.h" @@ -4688,5 +4687,3 @@ protected: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_AST_H diff --git a/src/libs/3rdparty/cplusplus/ASTMatcher.h b/src/libs/3rdparty/cplusplus/ASTMatcher.h index ad622316da..f6f3eae8d9 100644 --- a/src/libs/3rdparty/cplusplus/ASTMatcher.h +++ b/src/libs/3rdparty/cplusplus/ASTMatcher.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef ASTMATCHER_H -#define ASTMATCHER_H +#pragma once #include "ASTfwd.h" @@ -184,5 +183,3 @@ public: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_ASTMATCHER_H diff --git a/src/libs/3rdparty/cplusplus/ASTVisitor.h b/src/libs/3rdparty/cplusplus/ASTVisitor.h index 699694e9f9..46bfde340b 100644 --- a/src/libs/3rdparty/cplusplus/ASTVisitor.h +++ b/src/libs/3rdparty/cplusplus/ASTVisitor.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_ASTVISITOR_H -#define CPLUSPLUS_ASTVISITOR_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "ASTfwd.h" @@ -380,5 +379,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_ASTVISITOR_H diff --git a/src/libs/3rdparty/cplusplus/ASTfwd.h b/src/libs/3rdparty/cplusplus/ASTfwd.h index 0dd8d04037..2c55fd27d6 100644 --- a/src/libs/3rdparty/cplusplus/ASTfwd.h +++ b/src/libs/3rdparty/cplusplus/ASTfwd.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_ASTFWD_H -#define CPLUSPLUS_ASTFWD_H +#pragma once #include "CPlusPlusForwardDeclarations.h" @@ -225,6 +224,3 @@ typedef List<ObjCSynthesizedPropertyAST *> ObjCSynthesizedPropertyListAST; typedef List<DesignatorAST *> DesignatorListAST; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_ASTFWD_H diff --git a/src/libs/3rdparty/cplusplus/Bind.h b/src/libs/3rdparty/cplusplus/Bind.h index 2eb58d8f2e..54e88e95a8 100644 --- a/src/libs/3rdparty/cplusplus/Bind.h +++ b/src/libs/3rdparty/cplusplus/Bind.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_BIND_H -#define CPLUSPLUS_BIND_H +#pragma once #include "ASTVisitor.h" #include "FullySpecifiedType.h" @@ -291,5 +290,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_BIND_H diff --git a/src/libs/3rdparty/cplusplus/CPlusPlus.h b/src/libs/3rdparty/cplusplus/CPlusPlus.h index 5fedc986a8..0dbf0f1ed3 100644 --- a/src/libs/3rdparty/cplusplus/CPlusPlus.h +++ b/src/libs/3rdparty/cplusplus/CPlusPlus.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_CPLUSPLUS_H -#define CPLUSPLUS_CPLUSPLUS_H +#pragma once #include "AST.h" #include "ASTMatcher.h" @@ -52,5 +51,3 @@ #include "Matcher.h" #include "TypeVisitor.h" #include "Templates.h" - -#endif // CPLUSPLUS_CPLUSPLUS_H diff --git a/src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h b/src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h index 9b1c5a30cf..bec7e77a5c 100644 --- a/src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h +++ b/src/libs/3rdparty/cplusplus/CPlusPlusForwardDeclarations.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_CPLUSPLUSFORWARDDECLARATIONS_H -#define CPLUSPLUS_CPLUSPLUSFORWARDDECLARATIONS_H +#pragma once #include <cstdlib> #include <cstddef> @@ -136,5 +135,3 @@ class ObjCMethod; class ObjCPropertyDeclaration; } // namespace CPlusPlus - -#endif // CPLUSPLUS_CPLUSPLUSFORWARDDECLARATIONS_H diff --git a/src/libs/3rdparty/cplusplus/Control.h b/src/libs/3rdparty/cplusplus/Control.h index 85b8c3d3d7..97c1503833 100644 --- a/src/libs/3rdparty/cplusplus/Control.h +++ b/src/libs/3rdparty/cplusplus/Control.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_CONTROL_H -#define CPLUSPLUS_CONTROL_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "ASTfwd.h" @@ -227,6 +226,3 @@ private: }; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_CONTROL_H diff --git a/src/libs/3rdparty/cplusplus/CoreTypes.h b/src/libs/3rdparty/cplusplus/CoreTypes.h index 04eee89498..c0d799c4f2 100644 --- a/src/libs/3rdparty/cplusplus/CoreTypes.h +++ b/src/libs/3rdparty/cplusplus/CoreTypes.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_CORETYPES_H -#define CPLUSPLUS_CORETYPES_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "Type.h" @@ -242,5 +241,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_CORETYPES_H diff --git a/src/libs/3rdparty/cplusplus/DiagnosticClient.h b/src/libs/3rdparty/cplusplus/DiagnosticClient.h index 98543de96b..108133b97e 100644 --- a/src/libs/3rdparty/cplusplus/DiagnosticClient.h +++ b/src/libs/3rdparty/cplusplus/DiagnosticClient.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_DIAGNOSTICCLIENT_H -#define CPLUSPLUS_DIAGNOSTICCLIENT_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include <cstdarg> @@ -48,6 +47,3 @@ public: }; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_DIAGNOSTICCLIENT_H diff --git a/src/libs/3rdparty/cplusplus/FullySpecifiedType.h b/src/libs/3rdparty/cplusplus/FullySpecifiedType.h index 8f20018465..5a7e33a2db 100644 --- a/src/libs/3rdparty/cplusplus/FullySpecifiedType.h +++ b/src/libs/3rdparty/cplusplus/FullySpecifiedType.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_FULLYSPECIFIEDTYPE_H -#define CPLUSPLUS_FULLYSPECIFIEDTYPE_H +#pragma once #include "CPlusPlusForwardDeclarations.h" @@ -149,5 +148,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_FULLYSPECIFIEDTYPE_H diff --git a/src/libs/3rdparty/cplusplus/Lexer.h b/src/libs/3rdparty/cplusplus/Lexer.h index 8e862ea54c..1acfcf31b0 100644 --- a/src/libs/3rdparty/cplusplus/Lexer.h +++ b/src/libs/3rdparty/cplusplus/Lexer.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_LEXER_H -#define CPLUSPLUS_LEXER_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "Token.h" @@ -158,5 +157,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_LEXER_H diff --git a/src/libs/3rdparty/cplusplus/LiteralTable.h b/src/libs/3rdparty/cplusplus/LiteralTable.h index 517e5d1539..5a3f1e9042 100644 --- a/src/libs/3rdparty/cplusplus/LiteralTable.h +++ b/src/libs/3rdparty/cplusplus/LiteralTable.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_LITERALTABLE_H -#define CPLUSPLUS_LITERALTABLE_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include <cstring> @@ -164,6 +163,3 @@ protected: }; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_LITERALTABLE_H diff --git a/src/libs/3rdparty/cplusplus/Literals.h b/src/libs/3rdparty/cplusplus/Literals.h index 0dfb7a1c04..19255b619b 100644 --- a/src/libs/3rdparty/cplusplus/Literals.h +++ b/src/libs/3rdparty/cplusplus/Literals.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_LITERALS_H -#define CPLUSPLUS_LITERALS_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "Token.h" @@ -124,6 +123,3 @@ protected: }; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_LITERALS_H diff --git a/src/libs/3rdparty/cplusplus/Matcher.h b/src/libs/3rdparty/cplusplus/Matcher.h index f63ea7ef5b..6a8da9a7b7 100644 --- a/src/libs/3rdparty/cplusplus/Matcher.h +++ b/src/libs/3rdparty/cplusplus/Matcher.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TYPEMATCHER_H -#define TYPEMATCHER_H +#pragma once #include "CPlusPlusForwardDeclarations.h" @@ -75,5 +74,3 @@ public: }; } // namespace CPlusPlus - -#endif // TYPEMATCHER_H diff --git a/src/libs/3rdparty/cplusplus/MemoryPool.h b/src/libs/3rdparty/cplusplus/MemoryPool.h index ee56aaf9de..ec97d8fd03 100644 --- a/src/libs/3rdparty/cplusplus/MemoryPool.h +++ b/src/libs/3rdparty/cplusplus/MemoryPool.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_MEMORYPOOL_H -#define CPLUSPLUS_MEMORYPOOL_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include <new> @@ -82,5 +81,3 @@ public: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_MEMORYPOOL_H diff --git a/src/libs/3rdparty/cplusplus/Name.h b/src/libs/3rdparty/cplusplus/Name.h index 507195bead..200ccac75d 100644 --- a/src/libs/3rdparty/cplusplus/Name.h +++ b/src/libs/3rdparty/cplusplus/Name.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_NAME_H -#define CPLUSPLUS_NAME_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "Matcher.h" @@ -73,6 +72,3 @@ protected: // for Matcher }; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_NAME_H diff --git a/src/libs/3rdparty/cplusplus/NameVisitor.h b/src/libs/3rdparty/cplusplus/NameVisitor.h index c2a5f89da6..b0b737446d 100644 --- a/src/libs/3rdparty/cplusplus/NameVisitor.h +++ b/src/libs/3rdparty/cplusplus/NameVisitor.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_NAMEVISITOR_H -#define CPLUSPLUS_NAMEVISITOR_H +#pragma once #include "CPlusPlusForwardDeclarations.h" @@ -51,6 +50,3 @@ public: }; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_NAMEVISITOR_H diff --git a/src/libs/3rdparty/cplusplus/Names.h b/src/libs/3rdparty/cplusplus/Names.h index 33f40d523d..eaf8e956d4 100644 --- a/src/libs/3rdparty/cplusplus/Names.h +++ b/src/libs/3rdparty/cplusplus/Names.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_NAMES_H -#define CPLUSPLUS_NAMES_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "Name.h" @@ -273,5 +272,3 @@ private: } // namespace CPlusPlus - -#endif // CPLUSPLUS_NAMES_H diff --git a/src/libs/3rdparty/cplusplus/Parser.h b/src/libs/3rdparty/cplusplus/Parser.h index 1c69c21896..004d533109 100644 --- a/src/libs/3rdparty/cplusplus/Parser.h +++ b/src/libs/3rdparty/cplusplus/Parser.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_PARSER_H -#define CPLUSPLUS_PARSER_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "ASTfwd.h" @@ -336,6 +335,3 @@ private: }; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_PARSER_H diff --git a/src/libs/3rdparty/cplusplus/QtContextKeywords.h b/src/libs/3rdparty/cplusplus/QtContextKeywords.h index a7a1f1c3f8..edef73a7ee 100644 --- a/src/libs/3rdparty/cplusplus/QtContextKeywords.h +++ b/src/libs/3rdparty/cplusplus/QtContextKeywords.h @@ -1,6 +1,5 @@ -#ifndef QTCONTEXTKEYWORDS_H -#define QTCONTEXTKEYWORDS_H +#pragma once #include "CPlusPlusForwardDeclarations.h" @@ -24,5 +23,3 @@ enum { CPLUSPLUS_EXPORT int classifyQtContextKeyword(const char *s, int n); } // namespace CPlusPlus; - -#endif // QTCONTEXTKEYWORDS_H diff --git a/src/libs/3rdparty/cplusplus/Scope.h b/src/libs/3rdparty/cplusplus/Scope.h index 142138698e..01a5b7450d 100644 --- a/src/libs/3rdparty/cplusplus/Scope.h +++ b/src/libs/3rdparty/cplusplus/Scope.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_SCOPE_H -#define CPLUSPLUS_SCOPE_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "Symbol.h" @@ -78,6 +77,3 @@ private: }; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_SCOPE_H diff --git a/src/libs/3rdparty/cplusplus/Symbol.h b/src/libs/3rdparty/cplusplus/Symbol.h index 919268b14b..417217e469 100644 --- a/src/libs/3rdparty/cplusplus/Symbol.h +++ b/src/libs/3rdparty/cplusplus/Symbol.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_SYMBOL_H -#define CPLUSPLUS_SYMBOL_H +#pragma once #include "CPlusPlusForwardDeclarations.h" @@ -325,6 +324,3 @@ private: }; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_SYMBOL_H diff --git a/src/libs/3rdparty/cplusplus/SymbolVisitor.h b/src/libs/3rdparty/cplusplus/SymbolVisitor.h index 4311672eca..4ed81c657c 100644 --- a/src/libs/3rdparty/cplusplus/SymbolVisitor.h +++ b/src/libs/3rdparty/cplusplus/SymbolVisitor.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef SYMBOLVISITOR_H -#define SYMBOLVISITOR_H +#pragma once #include "Symbol.h" @@ -71,6 +70,3 @@ public: }; } // namespace CPlusPlus - - -#endif // SYMBOLVISITOR_H diff --git a/src/libs/3rdparty/cplusplus/Symbols.h b/src/libs/3rdparty/cplusplus/Symbols.h index 257bdb8682..826c816b69 100644 --- a/src/libs/3rdparty/cplusplus/Symbols.h +++ b/src/libs/3rdparty/cplusplus/Symbols.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_SYMBOLS_H -#define CPLUSPLUS_SYMBOLS_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "Symbol.h" @@ -911,6 +910,3 @@ private: }; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_SYMBOLS_H diff --git a/src/libs/3rdparty/cplusplus/Templates.h b/src/libs/3rdparty/cplusplus/Templates.h index 9db69084f7..67b57a6296 100644 --- a/src/libs/3rdparty/cplusplus/Templates.h +++ b/src/libs/3rdparty/cplusplus/Templates.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_TEMPLATES_H -#define CPLUSPLUS_TEMPLATES_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "TypeVisitor.h" @@ -207,5 +206,3 @@ private: }; } // end of namespace CPlusPlus - -#endif // CPLUSPLUS_TEMPLATES_H diff --git a/src/libs/3rdparty/cplusplus/Token.h b/src/libs/3rdparty/cplusplus/Token.h index afe732d493..358587366e 100644 --- a/src/libs/3rdparty/cplusplus/Token.h +++ b/src/libs/3rdparty/cplusplus/Token.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_TOKEN_H -#define CPLUSPLUS_TOKEN_H +#pragma once #include "CPlusPlusForwardDeclarations.h" @@ -422,5 +421,3 @@ struct LanguageFeatures }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_TOKEN_H diff --git a/src/libs/3rdparty/cplusplus/TranslationUnit.h b/src/libs/3rdparty/cplusplus/TranslationUnit.h index 94eb81666b..5b28cbd6e2 100644 --- a/src/libs/3rdparty/cplusplus/TranslationUnit.h +++ b/src/libs/3rdparty/cplusplus/TranslationUnit.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_TRANSLATIONUNIT_H -#define CPLUSPLUS_TRANSLATIONUNIT_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "ASTfwd.h" @@ -213,6 +212,3 @@ private: }; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_TRANSLATIONUNIT_H diff --git a/src/libs/3rdparty/cplusplus/Type.h b/src/libs/3rdparty/cplusplus/Type.h index 958ba15efd..25f260c2cd 100644 --- a/src/libs/3rdparty/cplusplus/Type.h +++ b/src/libs/3rdparty/cplusplus/Type.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_TYPE_H -#define CPLUSPLUS_TYPE_H +#pragma once #include "CPlusPlusForwardDeclarations.h" @@ -108,5 +107,3 @@ protected: // for Matcher }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_TYPE_H diff --git a/src/libs/3rdparty/cplusplus/TypeVisitor.h b/src/libs/3rdparty/cplusplus/TypeVisitor.h index b3a24b1572..bf69a8b8be 100644 --- a/src/libs/3rdparty/cplusplus/TypeVisitor.h +++ b/src/libs/3rdparty/cplusplus/TypeVisitor.h @@ -18,8 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef CPLUSPLUS_TYPEVISITOR_H -#define CPLUSPLUS_TYPEVISITOR_H +#pragma once #include "CPlusPlusForwardDeclarations.h" @@ -62,6 +61,3 @@ public: }; } // namespace CPlusPlus - - -#endif // CPLUSPLUS_TYPEVISITOR_H diff --git a/src/libs/3rdparty/cplusplus/cppassert.h b/src/libs/3rdparty/cplusplus/cppassert.h index 7f8c225f30..828b5bc695 100644 --- a/src/libs/3rdparty/cplusplus/cppassert.h +++ b/src/libs/3rdparty/cplusplus/cppassert.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SOFT_ASSERT_H -#define SOFT_ASSERT_H +#pragma once #include <iostream> @@ -36,7 +35,3 @@ #define CPP_ASSERT(cond, action) if (cond) {} else { CPP_ASSERT_STRING(#cond); action; } do {} while (0) #define CPP_CHECK(cond) if (cond) {} else { CPP_ASSERT_STRING(#cond); } do {} while (0) - -#endif // SOFT_ASSERT_H - - diff --git a/src/libs/aggregation/aggregate.h b/src/libs/aggregation/aggregate.h index 47243846c4..8404e96d30 100644 --- a/src/libs/aggregation/aggregate.h +++ b/src/libs/aggregation/aggregate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef AGGREGATE_H -#define AGGREGATE_H +#pragma once #include "aggregation_global.h" @@ -126,5 +125,3 @@ template <typename T> QList<T *> query_all(QObject *obj) } } // namespace Aggregation - -#endif // AGGREGATE_H diff --git a/src/libs/aggregation/aggregation_global.h b/src/libs/aggregation/aggregation_global.h index 3b1d7140c6..e91129202a 100644 --- a/src/libs/aggregation/aggregation_global.h +++ b/src/libs/aggregation/aggregation_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef AGGREGATION_GLOBAL_H -#define AGGREGATION_GLOBAL_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define AGGREGATION_EXPORT Q_DECL_IMPORT #endif - -#endif // AGGREGATION_GLOBAL_H diff --git a/src/libs/aggregation/examples/text/main.h b/src/libs/aggregation/examples/text/main.h index 53482ea894..76d0ec0191 100644 --- a/src/libs/aggregation/examples/text/main.h +++ b/src/libs/aggregation/examples/text/main.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MAIN_H -#define MAIN_H +#pragma once #include "myinterfaces.h" #include "ui_main.h" @@ -51,5 +50,3 @@ private: QList<IComboEntry *> m_entries; }; - -#endif // MAIN_H diff --git a/src/libs/aggregation/examples/text/myinterfaces.h b/src/libs/aggregation/examples/text/myinterfaces.h index 696c49bc9d..3dcdc6f0c3 100644 --- a/src/libs/aggregation/examples/text/myinterfaces.h +++ b/src/libs/aggregation/examples/text/myinterfaces.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MYINTERFACES_H -#define MYINTERFACES_H +#pragma once #include <aggregate.h> @@ -80,5 +79,3 @@ public: private: QString m_text; }; - -#endif // MYINTERFACES_H diff --git a/src/libs/clangbackendipc/clangbackendipc.qbs b/src/libs/clangbackendipc/clangbackendipc.qbs index 2f0f94e1f6..27a344e82e 100644 --- a/src/libs/clangbackendipc/clangbackendipc.qbs +++ b/src/libs/clangbackendipc/clangbackendipc.qbs @@ -5,6 +5,7 @@ QtcLibrary { Depends { name: "Qt.network" } Depends { name: "Sqlite" } + Depends { name: "Utils" } cpp.defines: base.concat("CLANGBACKENDIPC_BUILD_LIB") cpp.includePaths: base.concat(".") @@ -18,6 +19,7 @@ QtcLibrary { Export { Depends { name: "Sqlite" } + Depends { name: "Utils" } Depends { name: "Qt.network" } cpp.includePaths: [ "." diff --git a/src/libs/clangbackendipc/clangbackendipc_dependencies.pri b/src/libs/clangbackendipc/clangbackendipc_dependencies.pri index 4813d6ce77..3b52d130c3 100644 --- a/src/libs/clangbackendipc/clangbackendipc_dependencies.pri +++ b/src/libs/clangbackendipc/clangbackendipc_dependencies.pri @@ -1,3 +1,3 @@ QTC_LIB_NAME = Clangbackendipc -QTC_LIB_DEPENDS += sqlite +QTC_LIB_DEPENDS += sqlite utils INCLUDEPATH *= $$IDE_SOURCE_TREE/src/libs/clangbackendipc diff --git a/src/libs/clangbackendipc/clangbackendipc_global.h b/src/libs/clangbackendipc/clangbackendipc_global.h index 28e0af9da7..03b3493d70 100644 --- a/src/libs/clangbackendipc/clangbackendipc_global.h +++ b/src/libs/clangbackendipc/clangbackendipc_global.h @@ -23,8 +23,9 @@ ** ****************************************************************************/ -#ifndef CLANGBACKENDIPC_GLOBAL_H -#define CLANGBACKENDIPC_GLOBAL_H +#pragma once + +#include <utils/sizedarray.h> #include <QtCore/qglobal.h> @@ -51,7 +52,7 @@ enum class DiagnosticSeverity // one to one mapping of the clang enum numbers Fatal = 4 }; -enum class HighlightingType +enum class HighlightingType : quint8 { Invalid, Keyword, @@ -70,7 +71,8 @@ enum class HighlightingType PreprocessorDefinition, PreprocessorExpansion, Label, - OutputArgument + OutputArgument, + Declaration }; enum class CompletionCorrection @@ -123,5 +125,11 @@ struct MessageTrait<Message> \ static const MessageType enumeration = MessageType::Message; \ }; +using MixinHighlightingTypes = Utils::SizedArray<HighlightingType, 6>; + +struct HighlightingTypes { + HighlightingType mainHighlightingType; + MixinHighlightingTypes mixinHighlightingTypes; +}; + } -#endif // CLANGBACKENDIPC_GLOBAL_H diff --git a/src/libs/clangbackendipc/clangbackendipcdebugutils.h b/src/libs/clangbackendipc/clangbackendipcdebugutils.h index 3a81b4ea0b..df2ff3194f 100644 --- a/src/libs/clangbackendipc/clangbackendipcdebugutils.h +++ b/src/libs/clangbackendipc/clangbackendipcdebugutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKENDIPCDEBUGUTILS_H -#define CLANGBACKENDIPCDEBUGUTILS_H +#pragma once #include "clangbackendipc_global.h" @@ -52,5 +51,3 @@ private: } // namespace ClangBackEnd #define TIME_SCOPE_DURATION(id) ClangBackEnd::VerboseScopeDurationTimer scopeDurationTimer(id) - -#endif // CLANGBACKENDIPCDEBUGUTILS_H diff --git a/src/libs/clangbackendipc/cmbalivemessage.h b/src/libs/clangbackendipc/cmbalivemessage.h index a28aa986d3..a198f44be3 100644 --- a/src/libs/clangbackendipc/cmbalivemessage.h +++ b/src/libs/clangbackendipc/cmbalivemessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CMBALIVEMESSAGE_H -#define CMBALIVEMESSAGE_H +#pragma once #include "clangbackendipc_global.h" @@ -42,5 +41,3 @@ CMBIPC_EXPORT QDebug operator<<(QDebug debug, const AliveMessage &message); DECLARE_MESSAGE(AliveMessage) } - -#endif // CMBALIVEMESSAGE_H diff --git a/src/libs/clangbackendipc/cmbcodecompletedmessage.h b/src/libs/clangbackendipc/cmbcodecompletedmessage.h index e0e8109222..8fe9c5dbea 100644 --- a/src/libs/clangbackendipc/cmbcodecompletedmessage.h +++ b/src/libs/clangbackendipc/cmbcodecompletedmessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_CODECOMPLETEDMESSAGE_H -#define CLANGBACKEND_CODECOMPLETEDMESSAGE_H +#pragma once #include "codecompletion.h" @@ -68,5 +67,3 @@ void PrintTo(const CodeCompletedMessage &message, ::std::ostream* os); DECLARE_MESSAGE(CodeCompletedMessage) } // namespace ClangBackEnd - -#endif // CLANGBACKEND_CODECOMPLETEDMESSAGE_H diff --git a/src/libs/clangbackendipc/cmbcompletecodemessage.h b/src/libs/clangbackendipc/cmbcompletecodemessage.h index cd9aec2075..28356259ad 100644 --- a/src/libs/clangbackendipc/cmbcompletecodemessage.h +++ b/src/libs/clangbackendipc/cmbcompletecodemessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_COMPLETECODEMESSAGE_H -#define CLANGBACKEND_COMPLETECODEMESSAGE_H +#pragma once #include "clangbackendipc_global.h" @@ -72,6 +71,5 @@ CMBIPC_EXPORT QDebug operator<<(QDebug debug, const CompleteCodeMessage &message void PrintTo(const CompleteCodeMessage &message, ::std::ostream* os); DECLARE_MESSAGE(CompleteCodeMessage); -} // namespace ClangBackEnd -#endif // CLANGBACKEND_COMPLETECODEMESSAGE_H +} // namespace ClangBackEnd diff --git a/src/libs/clangbackendipc/cmbechomessage.h b/src/libs/clangbackendipc/cmbechomessage.h index b1bc061d55..9cf29b4611 100644 --- a/src/libs/clangbackendipc/cmbechomessage.h +++ b/src/libs/clangbackendipc/cmbechomessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_ECHOMESSAGE_H -#define CLANGBACKEND_ECHOMESSAGE_H +#pragma once #include "clangbackendipc_global.h" @@ -55,5 +54,3 @@ void PrintTo(const EchoMessage &message, ::std::ostream* os); DECLARE_MESSAGE(EchoMessage) } // namespace ClangBackEnd - -#endif // CLANGBACKEND_ECHOMESSAGE_H diff --git a/src/libs/clangbackendipc/cmbendmessage.h b/src/libs/clangbackendipc/cmbendmessage.h index 91029d52b4..d5163a7be8 100644 --- a/src/libs/clangbackendipc/cmbendmessage.h +++ b/src/libs/clangbackendipc/cmbendmessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CMBENDMESSAGE_H -#define CMBENDMESSAGE_H +#pragma once #include "clangbackendipc_global.h" @@ -43,5 +42,3 @@ void PrintTo(const EndMessage &message, ::std::ostream* os); DECLARE_MESSAGE(EndMessage) } - -#endif // CMBENDMESSAGE_H diff --git a/src/libs/clangbackendipc/cmbregisterprojectsforeditormessage.h b/src/libs/clangbackendipc/cmbregisterprojectsforeditormessage.h index 253167e119..8701b01681 100644 --- a/src/libs/clangbackendipc/cmbregisterprojectsforeditormessage.h +++ b/src/libs/clangbackendipc/cmbregisterprojectsforeditormessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_REGISTERPROJECTSFOREDITORMESSAGE_H -#define CLANGBACKEND_REGISTERPROJECTSFOREDITORMESSAGE_H +#pragma once #include "projectpartcontainer.h" @@ -57,5 +56,3 @@ void PrintTo(const RegisterProjectPartsForEditorMessage &message, ::std::ostream DECLARE_MESSAGE(RegisterProjectPartsForEditorMessage); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_REGISTERPROJECTSFOREDITORMESSAGE_H diff --git a/src/libs/clangbackendipc/cmbregistertranslationunitsforeditormessage.h b/src/libs/clangbackendipc/cmbregistertranslationunitsforeditormessage.h index 5295b130fb..c2956bcd1c 100644 --- a/src/libs/clangbackendipc/cmbregistertranslationunitsforeditormessage.h +++ b/src/libs/clangbackendipc/cmbregistertranslationunitsforeditormessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_REGISTERFILEFOREDITOR_H -#define CLANGBACKEND_REGISTERFILEFOREDITOR_H +#pragma once #include "filecontainer.h" @@ -63,5 +62,3 @@ void PrintTo(const RegisterTranslationUnitForEditorMessage &message, ::std::ostr DECLARE_MESSAGE(RegisterTranslationUnitForEditorMessage); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_REGISTERFILEFORCODECOMPLITION_H diff --git a/src/libs/clangbackendipc/cmbunregisterprojectsforeditormessage.h b/src/libs/clangbackendipc/cmbunregisterprojectsforeditormessage.h index 142c914f8e..60ee689649 100644 --- a/src/libs/clangbackendipc/cmbunregisterprojectsforeditormessage.h +++ b/src/libs/clangbackendipc/cmbunregisterprojectsforeditormessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_UNREGISTERPROJECTSFOREDITOR_H -#define CLANGBACKEND_UNREGISTERPROJECTSFOREDITOR_H +#pragma once #include "clangbackendipc_global.h" @@ -58,5 +57,3 @@ void PrintTo(const UnregisterProjectPartsForEditorMessage &message, ::std::ostre DECLARE_MESSAGE(UnregisterProjectPartsForEditorMessage); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_UNREGISTERPROJECTSFOREDITOR_H diff --git a/src/libs/clangbackendipc/cmbunregistertranslationunitsforeditormessage.h b/src/libs/clangbackendipc/cmbunregistertranslationunitsforeditormessage.h index a40bc33e74..c4bc778a6b 100644 --- a/src/libs/clangbackendipc/cmbunregistertranslationunitsforeditormessage.h +++ b/src/libs/clangbackendipc/cmbunregistertranslationunitsforeditormessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_UNRegisterTranslationUnitForEditorMessage_H -#define CLANGBACKEND_UNRegisterTranslationUnitForEditorMessage_H +#pragma once #include "clangbackendipc_global.h" @@ -62,5 +61,3 @@ void PrintTo(const UnregisterTranslationUnitsForEditorMessage &message, ::std::o DECLARE_MESSAGE(UnregisterTranslationUnitsForEditorMessage); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_UNRegisterTranslationUnitForEditorMessage_H diff --git a/src/libs/clangbackendipc/codecompletion.h b/src/libs/clangbackendipc/codecompletion.h index 83d4babbb8..ec8984a89a 100644 --- a/src/libs/clangbackendipc/codecompletion.h +++ b/src/libs/clangbackendipc/codecompletion.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_CODECOMPLETION_H -#define CLANGBACKEND_CODECOMPLETION_H +#pragma once #include "clangbackendipc_global.h" #include "codecompletionchunk.h" @@ -129,5 +128,3 @@ void PrintTo(const CodeCompletion &message, ::std::ostream* os); void PrintTo(CodeCompletion::Kind kind, ::std::ostream *os); void PrintTo(CodeCompletion::Availability availability, ::std::ostream *os); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_CODECOMPLETION_H diff --git a/src/libs/clangbackendipc/codecompletionchunk.h b/src/libs/clangbackendipc/codecompletionchunk.h index 74480c70e2..897e9f222a 100644 --- a/src/libs/clangbackendipc/codecompletionchunk.h +++ b/src/libs/clangbackendipc/codecompletionchunk.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_CODECOMPLETIONCHUNK_H -#define CLANGBACKEND_CODECOMPLETIONCHUNK_H +#pragma once #include "clangbackendipc_global.h" @@ -99,5 +98,3 @@ void PrintTo(const CodeCompletionChunk::Kind &kind, ::std::ostream* os); } // namespace ClangBackEnd Q_DECLARE_METATYPE(ClangBackEnd::CodeCompletionChunk) - -#endif // CLANGBACKEND_CODECOMPLETIONCHUNK_H diff --git a/src/libs/clangbackendipc/connectionclient.h b/src/libs/clangbackendipc/connectionclient.h index 001cbd2d3a..628a543019 100644 --- a/src/libs/clangbackendipc/connectionclient.h +++ b/src/libs/clangbackendipc/connectionclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_CONNECTIONCLIENT_H -#define CLANGBACKEND_CONNECTIONCLIENT_H +#pragma once #include "ipcserverproxy.h" #include "lineprefixer.h" @@ -111,5 +110,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_CONNECTIONCLIENT_H diff --git a/src/libs/clangbackendipc/connectionserver.h b/src/libs/clangbackendipc/connectionserver.h index ed0b7388c9..6eedf1b231 100644 --- a/src/libs/clangbackendipc/connectionserver.h +++ b/src/libs/clangbackendipc/connectionserver.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_CONNECTIONSERVER_H -#define CLANGBACKEND_CONNECTIONSERVER_H +#pragma once #include <ipcclientproxy.h> @@ -76,5 +75,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_CONNECTIONSERVER_H diff --git a/src/libs/clangbackendipc/diagnosticcontainer.h b/src/libs/clangbackendipc/diagnosticcontainer.h index d71bd4b87e..b1192f393b 100644 --- a/src/libs/clangbackendipc/diagnosticcontainer.h +++ b/src/libs/clangbackendipc/diagnosticcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_DIAGNOSTICCONTAINER_H -#define CLANGBACKEND_DIAGNOSTICCONTAINER_H +#pragma once #include "sourcerangecontainer.h" #include "fixitcontainer.h" @@ -85,5 +84,3 @@ CMBIPC_EXPORT QDebug operator<<(QDebug debug, const DiagnosticContainer &contain void PrintTo(const DiagnosticContainer &container, ::std::ostream* os); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_DIAGNOSTICCONTAINER_H diff --git a/src/libs/clangbackendipc/diagnosticschangedmessage.h b/src/libs/clangbackendipc/diagnosticschangedmessage.h index 8654b3c32d..fe9a1e61c3 100644 --- a/src/libs/clangbackendipc/diagnosticschangedmessage.h +++ b/src/libs/clangbackendipc/diagnosticschangedmessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_DIAGNOSTICSCHANGEDMESSAGE_H -#define CLANGBACKEND_DIAGNOSTICSCHANGEDMESSAGE_H +#pragma once #include "clangbackendipc_global.h" #include "diagnosticcontainer.h" @@ -64,5 +63,3 @@ void PrintTo(const DiagnosticsChangedMessage &message, ::std::ostream* os); DECLARE_MESSAGE(DiagnosticsChangedMessage) } // namespace ClangBackEnd - -#endif // CLANGBACKEND_DIAGNOSTICSCHANGEDMESSAGE_H diff --git a/src/libs/clangbackendipc/filecontainer.h b/src/libs/clangbackendipc/filecontainer.h index 205b0803d6..ab1a0ac3f4 100644 --- a/src/libs/clangbackendipc/filecontainer.h +++ b/src/libs/clangbackendipc/filecontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_FILECONTAINER_H -#define CLANGBACKEND_FILECONTAINER_H +#pragma once #include <clangbackendipc_global.h> @@ -74,5 +73,3 @@ CMBIPC_EXPORT QDebug operator<<(QDebug debug, const FileContainer &container); void PrintTo(const FileContainer &container, ::std::ostream* os); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_FILECONTAINER_H diff --git a/src/libs/clangbackendipc/fixitcontainer.h b/src/libs/clangbackendipc/fixitcontainer.h index 7e4d89890e..e67daa034e 100644 --- a/src/libs/clangbackendipc/fixitcontainer.h +++ b/src/libs/clangbackendipc/fixitcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_FIXITCONTAINER_H -#define CLANGBACKEND_FIXITCONTAINER_H +#pragma once #include "sourcerangecontainer.h" @@ -58,5 +57,3 @@ void PrintTo(const FixItContainer &container, ::std::ostream* os); } // namespace ClangBackEnd Q_DECLARE_METATYPE(ClangBackEnd::FixItContainer) - -#endif // CLANGBACKEND_FIXITCONTAINER_H diff --git a/src/libs/clangbackendipc/highlightingchangedmessage.h b/src/libs/clangbackendipc/highlightingchangedmessage.h index b4ae93b001..b9909daa4f 100644 --- a/src/libs/clangbackendipc/highlightingchangedmessage.h +++ b/src/libs/clangbackendipc/highlightingchangedmessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_HIGHLIGHTINGCHANGEDMESSAGE_H -#define CLANGBACKEND_HIGHLIGHTINGCHANGEDMESSAGE_H +#pragma once #include "clangbackendipc_global.h" #include "filecontainer.h" @@ -68,5 +67,3 @@ void PrintTo(const HighlightingChangedMessage &message, ::std::ostream* os); DECLARE_MESSAGE(HighlightingChangedMessage) } // namespace ClangBackEnd - -#endif // CLANGBACKEND_HIGHLIGHTINGCHANGEDMESSAGE_H diff --git a/src/libs/clangbackendipc/highlightingmarkcontainer.cpp b/src/libs/clangbackendipc/highlightingmarkcontainer.cpp index d8ca90f31c..441bc5203d 100644 --- a/src/libs/clangbackendipc/highlightingmarkcontainer.cpp +++ b/src/libs/clangbackendipc/highlightingmarkcontainer.cpp @@ -35,14 +35,25 @@ namespace ClangBackEnd { HighlightingMarkContainer::HighlightingMarkContainer(uint line, uint column, uint length, - HighlightingType type) + HighlightingTypes types) : line_(line), column_(column), length_(length), - type_(type) + types_(types) { } +HighlightingMarkContainer::HighlightingMarkContainer(uint line, + uint column, + uint length, + HighlightingType type) + : line_(line), + column_(column), + length_(length) +{ + types_.mainHighlightingType = type; +} + uint HighlightingMarkContainer::line() const { return line_; @@ -58,14 +69,21 @@ uint HighlightingMarkContainer::length() const return length_; } -HighlightingType HighlightingMarkContainer::type() const +HighlightingTypes HighlightingMarkContainer::types() const { - return type_; + return types_; } -quint32 &HighlightingMarkContainer::typeAsInt() +QDataStream &operator<<(QDataStream &out, HighlightingTypes highlightingTypes) { - return reinterpret_cast<quint32&>(type_); + out << reinterpret_cast<const quint8&>(highlightingTypes.mainHighlightingType); + + out << highlightingTypes.mixinHighlightingTypes.size(); + + for (HighlightingType type : highlightingTypes.mixinHighlightingTypes) + out << reinterpret_cast<const quint8&>(type); + + return out; } QDataStream &operator<<(QDataStream &out, const HighlightingMarkContainer &container) @@ -73,27 +91,55 @@ QDataStream &operator<<(QDataStream &out, const HighlightingMarkContainer &conta out << container.line_; out << container.column_; out << container.length_; - out << quint32(container.type_); + out << container.types_; return out; } +QDataStream &operator>>(QDataStream &in, HighlightingTypes &highlightingTypes) +{ + in >> reinterpret_cast<quint8&>(highlightingTypes.mainHighlightingType); + + quint8 size; + in >> size; + + for (int counter = 0; counter < size; ++counter) { + HighlightingType type; + in >> reinterpret_cast<quint8&>(type); + highlightingTypes.mixinHighlightingTypes.push_back(type); + } + + return in; +} + QDataStream &operator>>(QDataStream &in, HighlightingMarkContainer &container) { in >> container.line_; in >> container.column_; in >> container.length_; - in >> container.typeAsInt(); + in >> container.types_; return in; } +bool operator==(const MixinHighlightingTypes &first, const MixinHighlightingTypes &second) +{ + return first.size() == second.size() + && std::equal(first.begin(), first.end(), second.begin()); +} + +bool operator==(const HighlightingTypes &first, const HighlightingTypes &second) +{ + return first.mainHighlightingType == second.mainHighlightingType + && first.mixinHighlightingTypes == second.mixinHighlightingTypes; +} + bool operator==(const HighlightingMarkContainer &first, const HighlightingMarkContainer &second) { return first.line_ == second.line_ && first.column_ == second.column_ && first.length_ == second.length_ - && first.type_ == second.type_; + && first.types_ == second.types_; } #define RETURN_TEXT_FOR_CASE(enumValue) case HighlightingType::enumValue: return #enumValue @@ -129,7 +175,7 @@ QDebug operator<<(QDebug debug, const HighlightingMarkContainer &container) << container.line() << ", " << container.column() << ", " << container.length() << ", " - << highlightingTypeToCStringLiteral(container.type()) << ", " + << highlightingTypeToCStringLiteral(container.types().mainHighlightingType) << ", " << ")"; return debug; @@ -140,13 +186,25 @@ void PrintTo(HighlightingType highlightingType, std::ostream *os) *os << highlightingTypeToCStringLiteral(highlightingType); } +void PrintTo(const HighlightingTypes &types, std::ostream *os) +{ + PrintTo(types.mainHighlightingType, os); + + *os << "["; + + for (HighlightingType type : types.mixinHighlightingTypes) + PrintTo(type, os); + + *os << "]"; +} + void PrintTo(const HighlightingMarkContainer& container, ::std::ostream *os) { *os << "HighlightingMarkContainer(" << container.line() << ", " << container.column() << ", " << container.length() << ", "; - PrintTo(container.type(), os); + PrintTo(container.types(), os); *os << ")"; } diff --git a/src/libs/clangbackendipc/highlightingmarkcontainer.h b/src/libs/clangbackendipc/highlightingmarkcontainer.h index b4a89dd1fe..6018381b1f 100644 --- a/src/libs/clangbackendipc/highlightingmarkcontainer.h +++ b/src/libs/clangbackendipc/highlightingmarkcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_HIGHLIGHTINGMARKCONTAINER_H -#define CLANGBACKEND_HIGHLIGHTINGMARKCONTAINER_H +#pragma once #include "clangbackendipc_global.h" @@ -37,31 +36,29 @@ class CMBIPC_EXPORT HighlightingMarkContainer friend CMBIPC_EXPORT bool operator==(const HighlightingMarkContainer &first, const HighlightingMarkContainer &second); public: HighlightingMarkContainer() = default; + HighlightingMarkContainer(uint line, uint column, uint length, HighlightingTypes types); HighlightingMarkContainer(uint line, uint column, uint length, HighlightingType type); uint line() const; uint column() const; uint length() const; - HighlightingType type() const; - -private: - quint32 &typeAsInt(); + HighlightingTypes types() const; private: uint line_; uint column_; uint length_; - HighlightingType type_; + HighlightingTypes types_; }; CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const HighlightingMarkContainer &container); CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, HighlightingMarkContainer &container); +CMBIPC_EXPORT bool operator==(const HighlightingTypes &first, const HighlightingTypes &second); CMBIPC_EXPORT bool operator==(const HighlightingMarkContainer &first, const HighlightingMarkContainer &second); CMBIPC_EXPORT QDebug operator<<(QDebug debug, const HighlightingMarkContainer &container); CMBIPC_EXPORT void PrintTo(HighlightingType highlightingType, ::std::ostream *os); +CMBIPC_EXPORT void PrintTo(const HighlightingTypes &types, ::std::ostream *os); void PrintTo(const HighlightingMarkContainer &container, ::std::ostream *os); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_HIGHLIGHTINGMARKCONTAINER_H diff --git a/src/libs/clangbackendipc/ipcclientdispatcher.h b/src/libs/clangbackendipc/ipcclientdispatcher.h index 74b32c3019..dd6f683534 100644 --- a/src/libs/clangbackendipc/ipcclientdispatcher.h +++ b/src/libs/clangbackendipc/ipcclientdispatcher.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_IPCCLIENTDISPATCHER_H -#define CLANGBACKEND_IPCCLIENTDISPATCHER_H +#pragma once #include "ipcclientinterface.h" @@ -51,5 +50,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_IPCCLIENTDISPATCHER_H diff --git a/src/libs/clangbackendipc/ipcclientinterface.h b/src/libs/clangbackendipc/ipcclientinterface.h index def01ac5e1..3c4ac6eb82 100644 --- a/src/libs/clangbackendipc/ipcclientinterface.h +++ b/src/libs/clangbackendipc/ipcclientinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_IPCCLIENTINTERFACE_H -#define CLANGBACKEND_IPCCLIENTINTERFACE_H +#pragma once #include "ipcinterface.h" @@ -64,5 +63,3 @@ public: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_IPCCLIENTINTERFACE_H diff --git a/src/libs/clangbackendipc/ipcclientproxy.h b/src/libs/clangbackendipc/ipcclientproxy.h index ffac833e7b..3142ae1913 100644 --- a/src/libs/clangbackendipc/ipcclientproxy.h +++ b/src/libs/clangbackendipc/ipcclientproxy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CODELMODELBACKEND_IPCCLIENTPROXY_H -#define CODELMODELBACKEND_IPCCLIENTPROXY_H +#pragma once #include "clangbackendipc_global.h" #include "ipcclientinterface.h" @@ -72,5 +71,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CODELMODELBACKEND_IPCCLIENTPROXY_H diff --git a/src/libs/clangbackendipc/ipcinterface.h b/src/libs/clangbackendipc/ipcinterface.h index f868d6db3a..f58a7e2a5c 100644 --- a/src/libs/clangbackendipc/ipcinterface.h +++ b/src/libs/clangbackendipc/ipcinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_IPCINTERFACE_H -#define CLANGBACKEND_IPCINTERFACE_H +#pragma once #include "clangbackendipc_global.h" @@ -42,5 +41,3 @@ public: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_IPCINTERFACE_H diff --git a/src/libs/clangbackendipc/ipcserverinterface.h b/src/libs/clangbackendipc/ipcserverinterface.h index dd9886d58c..5d702fbc72 100644 --- a/src/libs/clangbackendipc/ipcserverinterface.h +++ b/src/libs/clangbackendipc/ipcserverinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_IPCSERVERINTERFACE_H -#define CLANGBACKEND_IPCSERVERINTERFACE_H +#pragma once #include "ipcinterface.h" @@ -62,5 +61,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_IPCSERVERINTERFACE_H diff --git a/src/libs/clangbackendipc/ipcserverproxy.h b/src/libs/clangbackendipc/ipcserverproxy.h index 5cecabeef3..c36db5d14c 100644 --- a/src/libs/clangbackendipc/ipcserverproxy.h +++ b/src/libs/clangbackendipc/ipcserverproxy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_IPCSERVERPROXY_H -#define CLANGBACKEND_IPCSERVERPROXY_H +#pragma once #include "ipcserverinterface.h" #include "readmessageblock.h" #include "writemessageblock.h" @@ -74,5 +73,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_IPCSERVERPROXY_H diff --git a/src/libs/clangbackendipc/lineprefixer.h b/src/libs/clangbackendipc/lineprefixer.h index 99b1be3125..b2607720fe 100644 --- a/src/libs/clangbackendipc/lineprefixer.h +++ b/src/libs/clangbackendipc/lineprefixer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PRINTLINESWITHPREFIX_H -#define PRINTLINESWITHPREFIX_H +#pragma once #include <QString> #include <QTextStream> @@ -45,5 +44,3 @@ private: }; } // namespace ClangBackEnd - -#endif // PRINTLINESWITHPREFIX_H diff --git a/src/libs/clangbackendipc/messageenvelop.h b/src/libs/clangbackendipc/messageenvelop.h index 93dd2a0f24..008a4c0037 100644 --- a/src/libs/clangbackendipc/messageenvelop.h +++ b/src/libs/clangbackendipc/messageenvelop.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_MESSAGEENVELOP_H -#define CLANGBACKEND_MESSAGEENVELOP_H +#pragma once #include "clangbackendipc_global.h" @@ -108,5 +107,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_MESSAGEENVELOP_H diff --git a/src/libs/clangbackendipc/projectpartcontainer.h b/src/libs/clangbackendipc/projectpartcontainer.h index 75a6b5142a..8439949293 100644 --- a/src/libs/clangbackendipc/projectpartcontainer.h +++ b/src/libs/clangbackendipc/projectpartcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_PROJECTCONTAINER_H -#define CLANGBACKEND_PROJECTCONTAINER_H +#pragma once #include <clangbackendipc_global.h> @@ -58,5 +57,3 @@ QDebug operator<<(QDebug debug, const ProjectPartContainer &container); void PrintTo(const ProjectPartContainer &container, ::std::ostream* os); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_PROJECTCONTAINER_H diff --git a/src/libs/clangbackendipc/projectpartsdonotexistmessage.h b/src/libs/clangbackendipc/projectpartsdonotexistmessage.h index f79e658ff5..e896675ee5 100644 --- a/src/libs/clangbackendipc/projectpartsdonotexistmessage.h +++ b/src/libs/clangbackendipc/projectpartsdonotexistmessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_PROJECTPARTSDONOTEXISTMESSAGE_H -#define CLANGBACKEND_PROJECTPARTSDONOTEXISTMESSAGE_H +#pragma once #include "clangbackendipc_global.h" @@ -58,5 +57,3 @@ void PrintTo(const ProjectPartsDoNotExistMessage &message, ::std::ostream* os); DECLARE_MESSAGE(ProjectPartsDoNotExistMessage) } // namespace ClangBackEnd - -#endif // CLANGBACKEND_PROJECTPARTSDONOTEXISTMESSAGE_H diff --git a/src/libs/clangbackendipc/readmessageblock.h b/src/libs/clangbackendipc/readmessageblock.h index 1b5ddf2fb5..0dfd5d21d7 100644 --- a/src/libs/clangbackendipc/readmessageblock.h +++ b/src/libs/clangbackendipc/readmessageblock.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_READMESSAGEBLOCK_H -#define CLANGBACKEND_READMESSAGEBLOCK_H +#pragma once #include <QtGlobal> @@ -58,5 +57,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_READMESSAGEBLOCK_H diff --git a/src/libs/clangbackendipc/registerunsavedfilesforeditormessage.h b/src/libs/clangbackendipc/registerunsavedfilesforeditormessage.h index f5ff373004..0fd28da182 100644 --- a/src/libs/clangbackendipc/registerunsavedfilesforeditormessage.h +++ b/src/libs/clangbackendipc/registerunsavedfilesforeditormessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_REGISTERUNSAVEDFILESFOREDITORMESSAGE_H -#define CLANGBACKEND_REGISTERUNSAVEDFILESFOREDITORMESSAGE_H +#pragma once #include "filecontainer.h" @@ -57,5 +56,3 @@ void PrintTo(const RegisterUnsavedFilesForEditorMessage &message, ::std::ostream DECLARE_MESSAGE(RegisterUnsavedFilesForEditorMessage); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_REGISTERUNSAVEDFILESFOREDITORMESSAGE_H diff --git a/src/libs/clangbackendipc/requestdiagnosticsmessage.h b/src/libs/clangbackendipc/requestdiagnosticsmessage.h index 3f5fceebb6..a92cabf205 100644 --- a/src/libs/clangbackendipc/requestdiagnosticsmessage.h +++ b/src/libs/clangbackendipc/requestdiagnosticsmessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_REQUESTDIAGNOSTICSMESSAGE_H -#define CLANGBACKEND_REQUESTDIAGNOSTICSMESSAGE_H +#pragma once #include "filecontainer.h" @@ -57,5 +56,3 @@ void PrintTo(const RequestDiagnosticsMessage &message, ::std::ostream* os); DECLARE_MESSAGE(RequestDiagnosticsMessage); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_REQUESTDIAGNOSTICSMESSAGE_H diff --git a/src/libs/clangbackendipc/requesthighlightingmessage.h b/src/libs/clangbackendipc/requesthighlightingmessage.h index f135f35bb8..9b5e0cb4ed 100644 --- a/src/libs/clangbackendipc/requesthighlightingmessage.h +++ b/src/libs/clangbackendipc/requesthighlightingmessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_REQUESTHIGHLIGHTING_H -#define CLANGBACKEND_REQUESTHIGHLIGHTING_H +#pragma once #include "filecontainer.h" @@ -57,5 +56,3 @@ void PrintTo(const RequestHighlightingMessage &message, ::std::ostream* os); DECLARE_MESSAGE(RequestHighlightingMessage) } // namespace ClangBackEnd - -#endif // CLANGBACKEND_REQUESTHIGHLIGHTING_H diff --git a/src/libs/clangbackendipc/sourcelocationcontainer.h b/src/libs/clangbackendipc/sourcelocationcontainer.h index 954c675384..e670cd3299 100644 --- a/src/libs/clangbackendipc/sourcelocationcontainer.h +++ b/src/libs/clangbackendipc/sourcelocationcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_SOURCELOCATIONCONTAINER_H -#define CLANGBACKEND_SOURCELOCATIONCONTAINER_H +#pragma once #include <clangbackendipc_global.h> @@ -63,5 +62,3 @@ CMBIPC_EXPORT QDebug operator<<(QDebug debug, const SourceLocationContainer &con void PrintTo(const SourceLocationContainer &container, ::std::ostream* os); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_SOURCELOCATIONCONTAINER_H diff --git a/src/libs/clangbackendipc/sourcerangecontainer.h b/src/libs/clangbackendipc/sourcerangecontainer.h index 63dccbd2ad..b8198effd1 100644 --- a/src/libs/clangbackendipc/sourcerangecontainer.h +++ b/src/libs/clangbackendipc/sourcerangecontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_SOURCERANGECONTAINER_H -#define CLANGBACKEND_SOURCERANGECONTAINER_H +#pragma once #include "sourcelocationcontainer.h" @@ -57,5 +56,3 @@ CMBIPC_EXPORT QDebug operator<<(QDebug debug, const SourceRangeContainer &contai void PrintTo(const SourceRangeContainer &container, ::std::ostream* os); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_SOURCERANGECONTAINER_H diff --git a/src/libs/clangbackendipc/translationunitdoesnotexistmessage.h b/src/libs/clangbackendipc/translationunitdoesnotexistmessage.h index 08f2a54fc1..e4b7a547ab 100644 --- a/src/libs/clangbackendipc/translationunitdoesnotexistmessage.h +++ b/src/libs/clangbackendipc/translationunitdoesnotexistmessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_TRANSLATIONUNITDOESNOTEXISTSMESSAGE_H -#define CLANGBACKEND_TRANSLATIONUNITDOESNOTEXISTSMESSAGE_H +#pragma once #include "filecontainer.h" @@ -59,5 +58,3 @@ void PrintTo(const TranslationUnitDoesNotExistMessage &message, ::std::ostream* DECLARE_MESSAGE(TranslationUnitDoesNotExistMessage) } // namespace ClangBackEnd - -#endif // CLANGBACKEND_TRANSLATIONUNITDOESNOTEXISTSMESSAGE_H diff --git a/src/libs/clangbackendipc/unregisterunsavedfilesforeditormessage.h b/src/libs/clangbackendipc/unregisterunsavedfilesforeditormessage.h index a993c0a97d..4704e7e5b7 100644 --- a/src/libs/clangbackendipc/unregisterunsavedfilesforeditormessage.h +++ b/src/libs/clangbackendipc/unregisterunsavedfilesforeditormessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_UNREGISTERTRANSLATIONUNITSFOREDITORMESSAGE_H -#define CLANGBACKEND_UNREGISTERTRANSLATIONUNITSFOREDITORMESSAGE_H +#pragma once #include "filecontainer.h" @@ -57,5 +56,3 @@ void PrintTo(const UnregisterUnsavedFilesForEditorMessage &message, ::std::ostre DECLARE_MESSAGE(UnregisterUnsavedFilesForEditorMessage) } // namespace ClangBackEnd - -#endif // CLANGBACKEND_UNREGISTERTRANSLATIONUNITSFOREDITORMESSAGE_H diff --git a/src/libs/clangbackendipc/updatetranslationunitsforeditormessage.h b/src/libs/clangbackendipc/updatetranslationunitsforeditormessage.h index ea99fe43a2..dcd5701013 100644 --- a/src/libs/clangbackendipc/updatetranslationunitsforeditormessage.h +++ b/src/libs/clangbackendipc/updatetranslationunitsforeditormessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_UPDATEFILEFOREDITOR_H -#define CLANGBACKEND_UPDATEFILEFOREDITOR_H +#pragma once #include "filecontainer.h" @@ -57,5 +56,3 @@ void PrintTo(const UpdateTranslationUnitsForEditorMessage &message, ::std::ostre DECLARE_MESSAGE(UpdateTranslationUnitsForEditorMessage) } // namespace ClangBackEnd - -#endif // CLANGBACKEND_UPDATEFILEFOREDITOR_H diff --git a/src/libs/clangbackendipc/updatevisibletranslationunitsmessage.h b/src/libs/clangbackendipc/updatevisibletranslationunitsmessage.h index f43b905ec2..241455f310 100644 --- a/src/libs/clangbackendipc/updatevisibletranslationunitsmessage.h +++ b/src/libs/clangbackendipc/updatevisibletranslationunitsmessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_UPDATEVISIBLETRANSLATIONUNITSMESSAGE_H -#define CLANGBACKEND_UPDATEVISIBLETRANSLATIONUNITSMESSAGE_H +#pragma once #include <clangbackendipc_global.h> @@ -59,5 +58,3 @@ void PrintTo(const UpdateVisibleTranslationUnitsMessage &message, ::std::ostream DECLARE_MESSAGE(UpdateVisibleTranslationUnitsMessage) } // namespace ClangBackEnd - -#endif // CLANGBACKEND_UPDATEVISIBLETRANSLATIONUNITSMESSAGE_H diff --git a/src/libs/clangbackendipc/writemessageblock.h b/src/libs/clangbackendipc/writemessageblock.h index 4b611a2475..0fa8d03dd3 100644 --- a/src/libs/clangbackendipc/writemessageblock.h +++ b/src/libs/clangbackendipc/writemessageblock.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_WRITEMESSAGEBLOCK_H -#define CLANGBACKEND_WRITEMESSAGEBLOCK_H +#pragma once #include <QtGlobal> @@ -55,5 +54,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_WRITEMESSAGEBLOCK_H diff --git a/src/libs/cplusplus/ASTParent.h b/src/libs/cplusplus/ASTParent.h index b208476818..8369265bc2 100644 --- a/src/libs/cplusplus/ASTParent.h +++ b/src/libs/cplusplus/ASTParent.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_ASTPARENT_H -#define CPLUSPLUS_ASTPARENT_H +#pragma once #include <cplusplus/ASTVisitor.h> @@ -56,5 +55,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_ASTPARENT_H diff --git a/src/libs/cplusplus/ASTPath.h b/src/libs/cplusplus/ASTPath.h index 8a34acbe58..e7dfab7fad 100644 --- a/src/libs/cplusplus/ASTPath.h +++ b/src/libs/cplusplus/ASTPath.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_ASTPATH_H -#define CPLUSPLUS_ASTPATH_H +#pragma once #include <cplusplus/ASTfwd.h> #include <cplusplus/ASTVisitor.h> @@ -71,5 +70,3 @@ private: }; } // namespace CppTools - -#endif // CPLUSPLUS_ASTPATH_H diff --git a/src/libs/cplusplus/AlreadyConsideredClassContainer.h b/src/libs/cplusplus/AlreadyConsideredClassContainer.h index 01c5588c17..fd35291c2a 100644 --- a/src/libs/cplusplus/AlreadyConsideredClassContainer.h +++ b/src/libs/cplusplus/AlreadyConsideredClassContainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_ALREADYCONSIDEREDCLASSCONTAINER_H -#define CPLUSPLUS_ALREADYCONSIDEREDCLASSCONTAINER_H +#pragma once #include <cplusplus/SafeMatcher.h> @@ -69,5 +68,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_ALREADYCONSIDEREDCLASSCONTAINER_H diff --git a/src/libs/cplusplus/BackwardsScanner.h b/src/libs/cplusplus/BackwardsScanner.h index 039993ae23..2ac7a17a36 100644 --- a/src/libs/cplusplus/BackwardsScanner.h +++ b/src/libs/cplusplus/BackwardsScanner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_BACKWARDSSCANNER_H -#define CPLUSPLUS_BACKWARDSSCANNER_H +#pragma once #include "SimpleLexer.h" @@ -85,5 +84,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_BACKWARDSSCANNER_H diff --git a/src/libs/cplusplus/CppDocument.h b/src/libs/cplusplus/CppDocument.h index 42a5275476..bac2fb2a47 100644 --- a/src/libs/cplusplus/CppDocument.h +++ b/src/libs/cplusplus/CppDocument.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_CPPDOCUMENT_H -#define CPLUSPLUS_CPPDOCUMENT_H +#pragma once #include "Macro.h" @@ -457,5 +456,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_CPPDOCUMENT_H diff --git a/src/libs/cplusplus/CppRewriter.h b/src/libs/cplusplus/CppRewriter.h index b507182b9a..66ff57344a 100644 --- a/src/libs/cplusplus/CppRewriter.h +++ b/src/libs/cplusplus/CppRewriter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPREWRITER_H -#define CPPREWRITER_H +#pragma once #include "CppDocument.h" #include "LookupContext.h" @@ -110,5 +109,3 @@ CPLUSPLUS_EXPORT const Name *rewriteName(const Name *name, Control *control); } // namespace CPlusPlus - -#endif // CPPREWRITER_H diff --git a/src/libs/cplusplus/DependencyTable.h b/src/libs/cplusplus/DependencyTable.h index b152f00f44..508ae297c5 100644 --- a/src/libs/cplusplus/DependencyTable.h +++ b/src/libs/cplusplus/DependencyTable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_DEPENDENCYTABLE_H -#define CPLUSPLUS_DEPENDENCYTABLE_H +#pragma once #include <cplusplus/CPlusPlusForwardDeclarations.h> @@ -54,5 +53,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_DEPENDENCYTABLE_H diff --git a/src/libs/cplusplus/DeprecatedGenTemplateInstance.h b/src/libs/cplusplus/DeprecatedGenTemplateInstance.h index 37453c9d40..d612706a17 100644 --- a/src/libs/cplusplus/DeprecatedGenTemplateInstance.h +++ b/src/libs/cplusplus/DeprecatedGenTemplateInstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_DEPRECATEDGENTEMPLATEINSTANCE_H -#define CPLUSPLUS_DEPRECATEDGENTEMPLATEINSTANCE_H +#pragma once #include <cplusplus/TypeVisitor.h> #include <cplusplus/NameVisitor.h> @@ -54,5 +53,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_DEPRECATEDGENTEMPLATEINSTANCE_H diff --git a/src/libs/cplusplus/ExpressionUnderCursor.h b/src/libs/cplusplus/ExpressionUnderCursor.h index 79c0ed052d..230e196777 100644 --- a/src/libs/cplusplus/ExpressionUnderCursor.h +++ b/src/libs/cplusplus/ExpressionUnderCursor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_EXPRESSIONUNDERCURSOR_H -#define CPLUSPLUS_EXPRESSIONUNDERCURSOR_H +#pragma once #include <cplusplus/CPlusPlusForwardDeclarations.h> #include <cplusplus/Token.h> @@ -59,5 +58,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_EXPRESSIONUNDERCURSOR_H diff --git a/src/libs/cplusplus/FastPreprocessor.h b/src/libs/cplusplus/FastPreprocessor.h index 04d7320115..da63bdd59b 100644 --- a/src/libs/cplusplus/FastPreprocessor.h +++ b/src/libs/cplusplus/FastPreprocessor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_FASTPREPROCESSOR_H -#define CPLUSPLUS_FASTPREPROCESSOR_H +#pragma once #include "PreprocessorClient.h" #include "CppDocument.h" @@ -79,5 +78,3 @@ public: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_FASTPREPROCESSOR_H diff --git a/src/libs/cplusplus/FindUsages.h b/src/libs/cplusplus/FindUsages.h index 38d109062f..3d1e7a942e 100644 --- a/src/libs/cplusplus/FindUsages.h +++ b/src/libs/cplusplus/FindUsages.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_FINDUSAGES_H -#define CPLUSPLUS_FINDUSAGES_H +#pragma once #include "LookupContext.h" #include "CppDocument.h" @@ -304,6 +303,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_FINDUSAGES_H - diff --git a/src/libs/cplusplus/Icons.h b/src/libs/cplusplus/Icons.h index f5b168b30f..2b8ce0beee 100644 --- a/src/libs/cplusplus/Icons.h +++ b/src/libs/cplusplus/Icons.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_ICONS_H -#define CPLUSPLUS_ICONS_H +#pragma once #include <cplusplus/CPlusPlusForwardDeclarations.h> @@ -77,5 +76,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_ICONS_H diff --git a/src/libs/cplusplus/LookupContext.h b/src/libs/cplusplus/LookupContext.h index 398571aea8..7273fe57d0 100644 --- a/src/libs/cplusplus/LookupContext.h +++ b/src/libs/cplusplus/LookupContext.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_LOOKUPCONTEXT_H -#define CPLUSPLUS_LOOKUPCONTEXT_H +#pragma once #include "CppDocument.h" #include "LookupItem.h" @@ -349,5 +348,3 @@ bool CPLUSPLUS_EXPORT compareFullyQualifiedName(const QList<const Name *> &path, } // namespace CPlusPlus - -#endif // CPLUSPLUS_LOOKUPCONTEXT_H diff --git a/src/libs/cplusplus/LookupItem.h b/src/libs/cplusplus/LookupItem.h index f61c50fa77..1007635f6a 100644 --- a/src/libs/cplusplus/LookupItem.h +++ b/src/libs/cplusplus/LookupItem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_LOOKUPITEM_H -#define CPLUSPLUS_LOOKUPITEM_H +#pragma once #include <cplusplus/FullySpecifiedType.h> @@ -80,5 +79,3 @@ uint qHash(const CPlusPlus::LookupItem &result); //it also a workaround for some compilers inline uint qHash(const CPlusPlus::LookupItem &item) { return CPlusPlus::qHash(item); } #endif - -#endif // CPLUSPLUS_LOOKUPITEM_H diff --git a/src/libs/cplusplus/Macro.h b/src/libs/cplusplus/Macro.h index a441578ffe..f54df57458 100644 --- a/src/libs/cplusplus/Macro.h +++ b/src/libs/cplusplus/Macro.h @@ -43,8 +43,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef CPLUSPLUS_PP_MACRO_H -#define CPLUSPLUS_PP_MACRO_H +#pragma once #include "PPToken.h" @@ -179,5 +178,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_PP_MACRO_H diff --git a/src/libs/cplusplus/MatchingText.h b/src/libs/cplusplus/MatchingText.h index dfe111a337..f2d27c4ea8 100644 --- a/src/libs/cplusplus/MatchingText.h +++ b/src/libs/cplusplus/MatchingText.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_MATCHINGTEXT_H -#define CPLUSPLUS_MATCHINGTEXT_H +#pragma once #include <QtGlobal> #include <cplusplus/CPlusPlusForwardDeclarations.h> @@ -46,5 +45,3 @@ public: }; } // namespace CPlusPlus - -#endif // MATCHINGTEXT_H diff --git a/src/libs/cplusplus/NamePrettyPrinter.h b/src/libs/cplusplus/NamePrettyPrinter.h index 1f7816a133..13d378b25e 100644 --- a/src/libs/cplusplus/NamePrettyPrinter.h +++ b/src/libs/cplusplus/NamePrettyPrinter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_NAMEPRETTYPRINTER_H -#define CPLUSPLUS_NAMEPRETTYPRINTER_H +#pragma once #include <cplusplus/NameVisitor.h> @@ -61,5 +60,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_NAMEPRETTYPRINTER_H diff --git a/src/libs/cplusplus/Overview.h b/src/libs/cplusplus/Overview.h index b3fc0d0477..612ea79662 100644 --- a/src/libs/cplusplus/Overview.h +++ b/src/libs/cplusplus/Overview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_OVERVIEW_H -#define CPLUSPLUS_OVERVIEW_H +#pragma once #include <cplusplus/CPlusPlusForwardDeclarations.h> @@ -76,5 +75,3 @@ public: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_OVERVIEW_H diff --git a/src/libs/cplusplus/OverviewModel.h b/src/libs/cplusplus/OverviewModel.h index 04589e07cd..5b958e0ef5 100644 --- a/src/libs/cplusplus/OverviewModel.h +++ b/src/libs/cplusplus/OverviewModel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_OVERVIEWMODEL_H -#define CPLUSPLUS_OVERVIEWMODEL_H +#pragma once #include "CppDocument.h" #include "Overview.h" @@ -75,5 +74,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_OVERVIEWMODEL_H diff --git a/src/libs/cplusplus/PPToken.h b/src/libs/cplusplus/PPToken.h index 7fff4f2bfc..8eb8b26ab6 100644 --- a/src/libs/cplusplus/PPToken.h +++ b/src/libs/cplusplus/PPToken.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_INTERNAL_PPTOKEN_H -#define CPLUSPLUS_INTERNAL_PPTOKEN_H +#pragma once #include <cplusplus/CPlusPlus.h> #include <cplusplus/Token.h> @@ -136,5 +135,3 @@ private: } // namespace Internal } // namespace CPlusPlus - -#endif // CPLUSPLUS_INTERNAL_PPTOKEN_H diff --git a/src/libs/cplusplus/PreprocessorClient.h b/src/libs/cplusplus/PreprocessorClient.h index d9877a2199..accccdab1f 100644 --- a/src/libs/cplusplus/PreprocessorClient.h +++ b/src/libs/cplusplus/PreprocessorClient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PREPROCESSORCLIENT_H -#define PREPROCESSORCLIENT_H +#pragma once #include <cplusplus/CPlusPlusForwardDeclarations.h> @@ -118,5 +117,3 @@ public: }; } // namespace CPlusPlus - -#endif // PREPROCESSORCLIENT_H diff --git a/src/libs/cplusplus/PreprocessorEnvironment.h b/src/libs/cplusplus/PreprocessorEnvironment.h index fe0a643606..a6db2d0c7f 100644 --- a/src/libs/cplusplus/PreprocessorEnvironment.h +++ b/src/libs/cplusplus/PreprocessorEnvironment.h @@ -43,8 +43,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef PREPROCESSORENVIRONMENT_H -#define PREPROCESSORENVIRONMENT_H +#pragma once #include "PPToken.h" @@ -101,5 +100,3 @@ private: }; } // namespace CPlusPlus - -#endif // PREPROCESSORENVIRONMENT_H diff --git a/src/libs/cplusplus/ResolveExpression.h b/src/libs/cplusplus/ResolveExpression.h index d9043e720f..f53caf26aa 100644 --- a/src/libs/cplusplus/ResolveExpression.h +++ b/src/libs/cplusplus/ResolveExpression.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_RESOLVEEXPRESSION_H -#define CPLUSPLUS_RESOLVEEXPRESSION_H +#pragma once #include "LookupContext.h" @@ -134,5 +133,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_RESOLVEEXPRESSION_H diff --git a/src/libs/cplusplus/SimpleLexer.h b/src/libs/cplusplus/SimpleLexer.h index 1bb9a3d08d..2bd794933d 100644 --- a/src/libs/cplusplus/SimpleLexer.h +++ b/src/libs/cplusplus/SimpleLexer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_SIMPLELEXER_H -#define CPLUSPLUS_SIMPLELEXER_H +#pragma once #include <cplusplus/CPlusPlusForwardDeclarations.h> #include <cplusplus/Token.h> @@ -77,5 +76,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_SIMPLELEXER_H diff --git a/src/libs/cplusplus/SnapshotSymbolVisitor.h b/src/libs/cplusplus/SnapshotSymbolVisitor.h index 2fb78e352a..c0eab1bbbb 100644 --- a/src/libs/cplusplus/SnapshotSymbolVisitor.h +++ b/src/libs/cplusplus/SnapshotSymbolVisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_SNAPSHOTSYMBOLVISITOR_H -#define CPLUSPLUS_SNAPSHOTSYMBOLVISITOR_H +#pragma once #include "CppDocument.h" @@ -51,5 +50,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_SNAPSHOTSYMBOLVISITOR_H diff --git a/src/libs/cplusplus/SymbolNameVisitor.h b/src/libs/cplusplus/SymbolNameVisitor.h index 5123c717d1..0d48265db7 100644 --- a/src/libs/cplusplus/SymbolNameVisitor.h +++ b/src/libs/cplusplus/SymbolNameVisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_SYMBOLNAMEVISITOR_H -#define CPLUSPLUS_SYMBOLNAMEVISITOR_H +#pragma once #include <cplusplus/NameVisitor.h> @@ -44,5 +43,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_SYMBOLNAMEVISITOR_H diff --git a/src/libs/cplusplus/TypeOfExpression.h b/src/libs/cplusplus/TypeOfExpression.h index b200d78ead..1d13059b8c 100644 --- a/src/libs/cplusplus/TypeOfExpression.h +++ b/src/libs/cplusplus/TypeOfExpression.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_TYPEOFEXPRESSION_H -#define CPLUSPLUS_TYPEOFEXPRESSION_H +#pragma once #include "CppDocument.h" #include "LookupContext.h" @@ -159,5 +158,3 @@ ExpressionAST CPLUSPLUS_EXPORT *extractExpressionAST(Document::Ptr doc); Document::Ptr CPLUSPLUS_EXPORT documentForExpression(const QByteArray &utf8code); } // namespace CPlusPlus - -#endif // CPLUSPLUS_TYPEOFEXPRESSION_H diff --git a/src/libs/cplusplus/TypePrettyPrinter.h b/src/libs/cplusplus/TypePrettyPrinter.h index eef06b1503..15498784c3 100644 --- a/src/libs/cplusplus/TypePrettyPrinter.h +++ b/src/libs/cplusplus/TypePrettyPrinter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_TYPEPRETTYPRINTER_H -#define CPLUSPLUS_TYPEPRETTYPRINTER_H +#pragma once #include <cplusplus/TypeVisitor.h> #include <cplusplus/FullySpecifiedType.h> @@ -93,5 +92,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_TYPEPRETTYPRINTER_H diff --git a/src/libs/cplusplus/cppmodelmanagerbase.h b/src/libs/cplusplus/cppmodelmanagerbase.h index 3086d50cfd..680e7e2d06 100644 --- a/src/libs/cplusplus/cppmodelmanagerbase.h +++ b/src/libs/cplusplus/cppmodelmanagerbase.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPMODELMANAGERBASE_H -#define CPPMODELMANAGERBASE_H +#pragma once #include <cplusplus/CppDocument.h> @@ -54,5 +53,3 @@ public: }; } // namespace CPlusPlus - -#endif // CPPMODELMANAGERBASE_H diff --git a/src/libs/cplusplus/findcdbbreakpoint.h b/src/libs/cplusplus/findcdbbreakpoint.h index 57bf0f3dfc..6fb61030e7 100644 --- a/src/libs/cplusplus/findcdbbreakpoint.h +++ b/src/libs/cplusplus/findcdbbreakpoint.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDCDBBREAKPOINT_H -#define FINDCDBBREAKPOINT_H +#pragma once #include <cplusplus/CPlusPlusForwardDeclarations.h> #include <cplusplus/ASTVisitor.h> @@ -93,5 +92,3 @@ private: }; } // namespace CPlusPlus - -#endif // FINDCDBBREAKPOINT_H diff --git a/src/libs/cplusplus/pp-cctype.h b/src/libs/cplusplus/pp-cctype.h index 1376119151..91c39604f1 100644 --- a/src/libs/cplusplus/pp-cctype.h +++ b/src/libs/cplusplus/pp-cctype.h @@ -43,8 +43,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef CPLUSPLUS_PP_CCTYPE_H -#define CPLUSPLUS_PP_CCTYPE_H +#pragma once #include <cplusplus/CPlusPlusForwardDeclarations.h> @@ -65,5 +64,3 @@ inline bool CPLUSPLUS_EXPORT pp_isspace (int ch) { return std::isspace ((unsigned char) ch) != 0; } } // namespace CPlusPlus - -#endif // CPLUSPLUS_PP_CCTYPE_H diff --git a/src/libs/cplusplus/pp-engine.h b/src/libs/cplusplus/pp-engine.h index 6b24fd8d9f..b265de6d46 100644 --- a/src/libs/cplusplus/pp-engine.h +++ b/src/libs/cplusplus/pp-engine.h @@ -43,8 +43,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef CPLUSPLUS_PP_ENGINE_H -#define CPLUSPLUS_PP_ENGINE_H +#pragma once #include "PPToken.h" #include "PreprocessorClient.h" @@ -262,5 +261,3 @@ private: }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_PP_ENGINE_H diff --git a/src/libs/cplusplus/pp-scanner.h b/src/libs/cplusplus/pp-scanner.h index 13209ea6c3..1c493761b9 100644 --- a/src/libs/cplusplus/pp-scanner.h +++ b/src/libs/cplusplus/pp-scanner.h @@ -43,8 +43,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef CPLUSPLUS_PP_SCANNER_H -#define CPLUSPLUS_PP_SCANNER_H +#pragma once namespace CPlusPlus { @@ -118,5 +117,3 @@ struct pp_skip_argument }; } // namespace CPlusPlus - -#endif // CPLUSPLUS_PP_SCANNER_H diff --git a/src/libs/cplusplus/pp.h b/src/libs/cplusplus/pp.h index e703f6c9a8..b4b75297e4 100644 --- a/src/libs/cplusplus/pp.h +++ b/src/libs/cplusplus/pp.h @@ -43,13 +43,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef CPLUSPLUS_PREPROCESSOR_H -#define CPLUSPLUS_PREPROCESSOR_H +#pragma once #include "Macro.h" #include "PreprocessorClient.h" #include "PreprocessorEnvironment.h" #include "pp-scanner.h" #include "pp-engine.h" - -#endif // CPLUSPLUS_PREPROCESSOR_H diff --git a/src/libs/extensionsystem/extensionsystem_global.h b/src/libs/extensionsystem/extensionsystem_global.h index 5239e814cb..2cc8add8c5 100644 --- a/src/libs/extensionsystem/extensionsystem_global.h +++ b/src/libs/extensionsystem/extensionsystem_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXTENSIONSYSTEM_GLOBAL_H -#define EXTENSIONSYSTEM_GLOBAL_H +#pragma once #include <QLoggingCategory> #include <qglobal.h> @@ -36,5 +35,3 @@ #endif Q_DECLARE_LOGGING_CATEGORY(pluginLog) - -#endif // EXTENSIONSYSTEM_GLOBAL_H diff --git a/src/libs/extensionsystem/invoker.h b/src/libs/extensionsystem/invoker.h index 6574392a3b..1286e07aaa 100644 --- a/src/libs/extensionsystem/invoker.h +++ b/src/libs/extensionsystem/invoker.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXTENSIONSYSTEM_INVOKER_H -#define EXTENSIONSYSTEM_INVOKER_H +#pragma once #include "extensionsystem_global.h" @@ -202,5 +201,3 @@ Result invoke(QObject *target, const char *slot, } } // namespace ExtensionSystem - -#endif // EXTENSIONSYSTEM_INVOKER_H diff --git a/src/libs/extensionsystem/iplugin.h b/src/libs/extensionsystem/iplugin.h index 1910f00c36..42b4a564c7 100644 --- a/src/libs/extensionsystem/iplugin.h +++ b/src/libs/extensionsystem/iplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IPLUGIN_H -#define IPLUGIN_H +#pragma once #include "extensionsystem_global.h" @@ -79,5 +78,3 @@ private: }; } // namespace ExtensionSystem - -#endif // IPLUGIN_H diff --git a/src/libs/extensionsystem/iplugin_p.h b/src/libs/extensionsystem/iplugin_p.h index 17e5a70aa1..0c3824dd39 100644 --- a/src/libs/extensionsystem/iplugin_p.h +++ b/src/libs/extensionsystem/iplugin_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IPLUGIN_P_H -#define IPLUGIN_P_H +#pragma once #include "iplugin.h" @@ -47,5 +46,3 @@ public: } // namespace Internal } // namespace ExtensionSystem - -#endif // IPLUGIN_P_H diff --git a/src/libs/extensionsystem/optionsparser.h b/src/libs/extensionsystem/optionsparser.h index 12095f062b..7b85d9e62a 100644 --- a/src/libs/extensionsystem/optionsparser.h +++ b/src/libs/extensionsystem/optionsparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OPTIONSPARSER_H -#define OPTIONSPARSER_H +#pragma once #include <QStringList> #include <QMap> @@ -81,5 +80,3 @@ private: } // namespace Internal } // namespace ExtensionSystem - -#endif // OPTIONSPARSER_H diff --git a/src/libs/extensionsystem/plugincollection.h b/src/libs/extensionsystem/plugincollection.h index 8415dd0afe..fd38bcedff 100644 --- a/src/libs/extensionsystem/plugincollection.h +++ b/src/libs/extensionsystem/plugincollection.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINCOLLECTION_H -#define PLUGINCOLLECTION_H +#pragma once #include "extensionsystem_global.h" @@ -52,5 +51,3 @@ private: }; } // namespace ExtensionSystem - -#endif // PLUGINCOLLECTION_H diff --git a/src/libs/extensionsystem/plugindetailsview.h b/src/libs/extensionsystem/plugindetailsview.h index 38b5ba5f15..b6990e2960 100644 --- a/src/libs/extensionsystem/plugindetailsview.h +++ b/src/libs/extensionsystem/plugindetailsview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINDETAILSVIEW_H_ -#define PLUGINDETAILSVIEW_H_ +#pragma once #include "extensionsystem_global.h" @@ -54,5 +53,3 @@ private: }; } // namespace ExtensionSystem - -#endif diff --git a/src/libs/extensionsystem/pluginerroroverview.h b/src/libs/extensionsystem/pluginerroroverview.h index dd2ac7352a..174efeee20 100644 --- a/src/libs/extensionsystem/pluginerroroverview.h +++ b/src/libs/extensionsystem/pluginerroroverview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINERROROVERVIEW_H -#define PLUGINERROROVERVIEW_H +#pragma once #include "extensionsystem_global.h" @@ -56,5 +55,3 @@ private: }; } // ExtensionSystem - -#endif // PLUGINERROROVERVIEW_H diff --git a/src/libs/extensionsystem/pluginerrorview.h b/src/libs/extensionsystem/pluginerrorview.h index b35f83c59b..1655f4adcf 100644 --- a/src/libs/extensionsystem/pluginerrorview.h +++ b/src/libs/extensionsystem/pluginerrorview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINERRORVIEW_H -#define PLUGINERRORVIEW_H +#pragma once #include "extensionsystem_global.h" @@ -52,5 +51,3 @@ private: }; } // namespace ExtensionSystem - -#endif // PLUGINERRORVIEW_H diff --git a/src/libs/extensionsystem/pluginmanager.h b/src/libs/extensionsystem/pluginmanager.h index 49ed9ae7ef..c2be55551f 100644 --- a/src/libs/extensionsystem/pluginmanager.h +++ b/src/libs/extensionsystem/pluginmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXTENSIONSYSTEM_PLUGINMANAGER_H -#define EXTENSIONSYSTEM_PLUGINMANAGER_H +#pragma once #include "extensionsystem_global.h" #include <aggregation/aggregate.h> @@ -163,5 +162,3 @@ public slots: }; } // namespace ExtensionSystem - -#endif // EXTENSIONSYSTEM_PLUGINMANAGER_H diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index 968fa1d08e..e0342d401c 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINMANAGER_P_H -#define PLUGINMANAGER_P_H +#pragma once #include "pluginspec.h" @@ -154,5 +153,3 @@ private: } // namespace Internal } // namespace ExtensionSystem - -#endif // PLUGINMANAGER_P_H diff --git a/src/libs/extensionsystem/pluginspec.h b/src/libs/extensionsystem/pluginspec.h index bab1bd2371..7d41c91158 100644 --- a/src/libs/extensionsystem/pluginspec.h +++ b/src/libs/extensionsystem/pluginspec.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINSPEC_H -#define PLUGINSPEC_H +#pragma once #include "extensionsystem_global.h" @@ -139,6 +138,3 @@ private: }; } // namespace ExtensionSystem - -#endif // PLUGINSPEC_H - diff --git a/src/libs/extensionsystem/pluginspec_p.h b/src/libs/extensionsystem/pluginspec_p.h index 62feba4496..bd172fef19 100644 --- a/src/libs/extensionsystem/pluginspec_p.h +++ b/src/libs/extensionsystem/pluginspec_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINSPEC_P_H -#define PLUGINSPEC_P_H +#pragma once #include "pluginspec.h" #include "iplugin.h" @@ -115,5 +114,3 @@ private: } // namespace Internal } // namespace ExtensionSystem - -#endif // PLUGINSPEC_P_H diff --git a/src/libs/extensionsystem/pluginview.h b/src/libs/extensionsystem/pluginview.h index c65d8cc9f5..3b4da885fe 100644 --- a/src/libs/extensionsystem/pluginview.h +++ b/src/libs/extensionsystem/pluginview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINVIEW_H -#define PLUGINVIEW_H +#pragma once #include "extensionsystem_global.h" @@ -82,5 +81,3 @@ private: }; } // namespae ExtensionSystem - -#endif // PLUGIN_VIEW_H diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugindialog.h b/src/libs/extensionsystem/test/manual/pluginview/plugindialog.h index f073e5c4ca..bc666c0cbc 100644 --- a/src/libs/extensionsystem/test/manual/pluginview/plugindialog.h +++ b/src/libs/extensionsystem/test/manual/pluginview/plugindialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINDIALOG_H -#define PLUGINDIALOG_H +#pragma once #include <extensionsystem/pluginview.h> #include <extensionsystem/pluginmanager.h> @@ -51,5 +50,3 @@ private: QPushButton *m_detailsButton; QPushButton *m_errorDetailsButton; }; - -#endif // PLUGINDIALOG_H diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.h b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.h index 02e85d090d..07c6c7d9bb 100644 --- a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.h +++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin1/plugin1.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGIN1_H -#define PLUGIN1_H +#pragma once #include <extensionsystem/iplugin.h> @@ -48,5 +47,3 @@ private: }; } // namespace Plugin1 - -#endif // PLUGIN1_H diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin2/plugin2.h b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin2/plugin2.h index 7f4b00bcbd..0b43ef0f2f 100644 --- a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin2/plugin2.h +++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin2/plugin2.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGIN2_H -#define PLUGIN2_H +#pragma once #include <extensionsystem/iplugin.h> @@ -48,5 +47,3 @@ private: }; } // namespace Plugin2 - -#endif // PLUGIN2_H diff --git a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin3/plugin3.h b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin3/plugin3.h index ed8765f023..478d753053 100644 --- a/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin3/plugin3.h +++ b/src/libs/extensionsystem/test/manual/pluginview/plugins/plugin3/plugin3.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGIN3_H -#define PLUGIN3_H +#pragma once #include <extensionsystem/iplugin.h> @@ -48,5 +47,3 @@ private: }; } // namespace Plugin3 - -#endif // PLUGIN3_H diff --git a/src/libs/glsl/glsl.h b/src/libs/glsl/glsl.h index 868d3c9271..bc5515ab05 100644 --- a/src/libs/glsl/glsl.h +++ b/src/libs/glsl/glsl.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSL_H -#define GLSL_H +#pragma once #include <qglobal.h> #include <cstdlib> @@ -75,5 +74,3 @@ class AST; class TranslationUnitAST; template <typename T> class List; } - -#endif // GLSL_H diff --git a/src/libs/glsl/glslast.h b/src/libs/glsl/glslast.h index 988e4b88a8..3711b30bdf 100644 --- a/src/libs/glsl/glslast.h +++ b/src/libs/glsl/glslast.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLAST_H -#define GLSLAST_H +#pragma once #include "glsl.h" #include "glslmemorypool.h" @@ -992,5 +991,3 @@ public: // attributes }; } // namespace GLSL - -#endif // GLSLAST_H diff --git a/src/libs/glsl/glslastdump.h b/src/libs/glsl/glslastdump.h index 086d158f0b..8213b913f1 100644 --- a/src/libs/glsl/glslastdump.h +++ b/src/libs/glsl/glslastdump.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLASTDUMP_H -#define GLSLASTDUMP_H +#pragma once #include "glslastvisitor.h" @@ -49,5 +48,3 @@ private: }; } // namespace GLSL - -#endif // GLSLASTDUMP_H diff --git a/src/libs/glsl/glslastvisitor.h b/src/libs/glsl/glslastvisitor.h index 65816d8703..4cd3530de8 100644 --- a/src/libs/glsl/glslastvisitor.h +++ b/src/libs/glsl/glslastvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLASTVISITOR_H -#define GLSLASTVISITOR_H +#pragma once #include "glslast.h" @@ -154,5 +153,3 @@ public: }; } // namespace GLSL - -#endif // GLSLASTVISITOR_H diff --git a/src/libs/glsl/glslengine.h b/src/libs/glsl/glslengine.h index eeb6697585..6b126111f6 100644 --- a/src/libs/glsl/glslengine.h +++ b/src/libs/glsl/glslengine.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLENGINE_H -#define GLSLENGINE_H +#pragma once #include "glsl.h" #include "glslmemorypool.h" @@ -142,5 +141,3 @@ private: }; } // namespace GLSL - -#endif // GLSLENGINE_H diff --git a/src/libs/glsl/glsllexer.h b/src/libs/glsl/glsllexer.h index 384688042d..2b0ad83fed 100644 --- a/src/libs/glsl/glsllexer.h +++ b/src/libs/glsl/glsllexer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLLEXER_H -#define GLSLLEXER_H +#pragma once #include "glsl.h" #include <qstring.h> @@ -129,5 +128,3 @@ private: }; } // namespace GLSL - -#endif // GLSLLEXER_H diff --git a/src/libs/glsl/glslmemorypool.h b/src/libs/glsl/glslmemorypool.h index fd55187c96..b33728b115 100644 --- a/src/libs/glsl/glslmemorypool.h +++ b/src/libs/glsl/glslmemorypool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLMEMORYPOOL_H -#define GLSLMEMORYPOOL_H +#pragma once #include "glsl.h" #include <new> @@ -87,6 +86,3 @@ public: }; } // namespace GLSL - - -#endif // GLSLMEMORYPOOL_H diff --git a/src/libs/glsl/glslparsertable_p.h b/src/libs/glsl/glslparsertable_p.h index 667b85b836..b046b5df7a 100644 --- a/src/libs/glsl/glslparsertable_p.h +++ b/src/libs/glsl/glslparsertable_p.h @@ -35,8 +35,7 @@ // // This file was generated by qlalr - DO NOT EDIT! -#ifndef GLSLPARSERTABLE_P_H -#define GLSLPARSERTABLE_P_H +#pragma once #include <qglobal.h> @@ -264,5 +263,3 @@ public: QT_END_NAMESPACE -#endif // GLSLPARSERTABLE_P_H - diff --git a/src/libs/glsl/glslsemantic.h b/src/libs/glsl/glslsemantic.h index 8347604995..9c21a7a4be 100644 --- a/src/libs/glsl/glslsemantic.h +++ b/src/libs/glsl/glslsemantic.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLSEMANTIC_H -#define GLSLSEMANTIC_H +#pragma once #include "glslastvisitor.h" #include "glsltype.h" @@ -127,5 +126,3 @@ private: }; } // namespace GLSL - -#endif // GLSLSEMANTIC_H diff --git a/src/libs/glsl/glslsymbol.h b/src/libs/glsl/glslsymbol.h index cc91525646..db5c0dab9b 100644 --- a/src/libs/glsl/glslsymbol.h +++ b/src/libs/glsl/glslsymbol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLSYMBOL_H -#define GLSLSYMBOL_H +#pragma once #include "glsl.h" #include <QString> @@ -77,5 +76,3 @@ public: }; } // namespace GLSL - -#endif // GLSLSYMBOL_H diff --git a/src/libs/glsl/glslsymbols.h b/src/libs/glsl/glslsymbols.h index 1a381c4495..32fde05bbb 100644 --- a/src/libs/glsl/glslsymbols.h +++ b/src/libs/glsl/glslsymbols.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLSYMBOLS_H -#define GLSLSYMBOLS_H +#pragma once #include "glsltype.h" #include "glslsymbol.h" @@ -103,5 +102,3 @@ private: }; } // namespace GLSL - -#endif // GLSLSYMBOLS_H diff --git a/src/libs/glsl/glsltype.h b/src/libs/glsl/glsltype.h index 265959c1aa..94aa422937 100644 --- a/src/libs/glsl/glsltype.h +++ b/src/libs/glsl/glsltype.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLTYPE_H -#define GLSLTYPE_H +#pragma once #include "glsl.h" @@ -60,5 +59,3 @@ public: }; } // namespace GLSL - -#endif // GLSLTYPE_H diff --git a/src/libs/glsl/glsltypes.h b/src/libs/glsl/glsltypes.h index 2b53ebfe37..5e89b0c3a4 100644 --- a/src/libs/glsl/glsltypes.h +++ b/src/libs/glsl/glsltypes.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLTYPES_H -#define GLSLTYPES_H +#pragma once #include "glsltype.h" #include "glslsymbol.h" @@ -290,5 +289,3 @@ private: }; } // namespace GLSL - -#endif // GLSLTYPES_H diff --git a/src/libs/languageutils/componentversion.h b/src/libs/languageutils/componentversion.h index 7bdbc26b5e..8e271bccab 100644 --- a/src/libs/languageutils/componentversion.h +++ b/src/libs/languageutils/componentversion.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPONENTVERSION_H -#define COMPONENTVERSION_H +#pragma once #include "languageutils_global.h" @@ -66,5 +65,3 @@ bool LANGUAGEUTILS_EXPORT operator==(const ComponentVersion &lhs, const Componen bool LANGUAGEUTILS_EXPORT operator!=(const ComponentVersion &lhs, const ComponentVersion &rhs); } // namespace LanguageUtils - -#endif // COMPONENTVERSION_H diff --git a/src/libs/languageutils/fakemetaobject.h b/src/libs/languageutils/fakemetaobject.h index 8ea96eeb37..543d80b45c 100644 --- a/src/libs/languageutils/fakemetaobject.h +++ b/src/libs/languageutils/fakemetaobject.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FAKEMETAOBJECT_H -#define FAKEMETAOBJECT_H +#pragma once #include "languageutils_global.h" #include "componentversion.h" @@ -230,5 +229,3 @@ public: }; } // namespace LanguageUtils - -#endif // FAKEMETAOBJECT_H diff --git a/src/libs/languageutils/languageutils_global.h b/src/libs/languageutils/languageutils_global.h index a74345fc81..9de119ef98 100644 --- a/src/libs/languageutils/languageutils_global.h +++ b/src/libs/languageutils/languageutils_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LANGUAGEUTILS_GLOBAL_H -#define LANGUAGEUTILS_GLOBAL_H +#pragma once #include <qglobal.h> @@ -35,5 +34,3 @@ #else # define LANGUAGEUTILS_EXPORT Q_DECL_IMPORT #endif - -#endif // LANGUAGEUTILS_GLOBAL_H diff --git a/src/libs/modelinglib/qmt/config/configcontroller.h b/src/libs/modelinglib/qmt/config/configcontroller.h index 0fb6a8a3a7..34135bb4af 100644 --- a/src/libs/modelinglib/qmt/config/configcontroller.h +++ b/src/libs/modelinglib/qmt/config/configcontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_CONFIGCONTROLLER_H -#define QMT_CONFIGCONTROLLER_H +#pragma once #include <QObject> #include "qmt/infrastructure/qmt_global.h" @@ -56,5 +55,3 @@ private: }; } // namespace qmt - -#endif // QMT_CONFIGCONTROLLER_H diff --git a/src/libs/modelinglib/qmt/config/sourcepos.h b/src/libs/modelinglib/qmt/config/sourcepos.h index ee31261ca9..2d86eca92d 100644 --- a/src/libs/modelinglib/qmt/config/sourcepos.h +++ b/src/libs/modelinglib/qmt/config/sourcepos.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_SOURCEPOS_H -#define QMT_SOURCEPOS_H +#pragma once #include "qmt/infrastructure/qmt_global.h" @@ -49,5 +48,3 @@ private: }; } // namespace qmt - -#endif // QMT_SOURCEPOS_H diff --git a/src/libs/modelinglib/qmt/config/stereotypedefinitionparser.h b/src/libs/modelinglib/qmt/config/stereotypedefinitionparser.h index 465c3c5eb3..390ab4424e 100644 --- a/src/libs/modelinglib/qmt/config/stereotypedefinitionparser.h +++ b/src/libs/modelinglib/qmt/config/stereotypedefinitionparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_STEREOTYPEDEFINITIONPARSER_H -#define QMT_STEREOTYPEDEFINITIONPARSER_H +#pragma once #include <QObject> #include "qmt/infrastructure/exceptions.h" @@ -119,5 +118,3 @@ private: }; } // namespace qmt - -#endif // QMT_STEREOTYPEDEFINITIONPARSER_H diff --git a/src/libs/modelinglib/qmt/config/stringtextsource.h b/src/libs/modelinglib/qmt/config/stringtextsource.h index 5fbd53e694..01301ca6cd 100644 --- a/src/libs/modelinglib/qmt/config/stringtextsource.h +++ b/src/libs/modelinglib/qmt/config/stringtextsource.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_STRINGTEXTSOURCE_H -#define QMT_STRINGTEXTSOURCE_H +#pragma once #include "textsource.h" @@ -54,5 +53,3 @@ private: }; } // namespace qmt - -#endif // QMT_STRINGTEXTSOURCE_H diff --git a/src/libs/modelinglib/qmt/config/textscanner.h b/src/libs/modelinglib/qmt/config/textscanner.h index bd46ba9339..de682a65c4 100644 --- a/src/libs/modelinglib/qmt/config/textscanner.h +++ b/src/libs/modelinglib/qmt/config/textscanner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_TEXTSCANNER_H -#define QMT_TEXTSCANNER_H +#pragma once #include <QObject> @@ -82,5 +81,3 @@ private: }; } // namespace qmt - -#endif // QMT_TEXTSCANNER_H diff --git a/src/libs/modelinglib/qmt/config/textsource.h b/src/libs/modelinglib/qmt/config/textsource.h index 211f2f522d..dd9a7edc65 100644 --- a/src/libs/modelinglib/qmt/config/textsource.h +++ b/src/libs/modelinglib/qmt/config/textsource.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_TEXTSOURCE_H -#define QMT_TEXTSOURCE_H +#pragma once #include "sourcepos.h" @@ -55,5 +54,3 @@ public: }; } // namespace qmt - -#endif // QMT_TEXTSOURCE_H diff --git a/src/libs/modelinglib/qmt/config/token.h b/src/libs/modelinglib/qmt/config/token.h index 12381f8a16..8672c0ea1d 100644 --- a/src/libs/modelinglib/qmt/config/token.h +++ b/src/libs/modelinglib/qmt/config/token.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_TOKEN_H -#define QMT_TOKEN_H +#pragma once #include "sourcepos.h" @@ -70,5 +69,3 @@ private: }; } // namespace qmt - -#endif // QMT_TOKEN_H diff --git a/src/libs/modelinglib/qmt/controller/container.h b/src/libs/modelinglib/qmt/controller/container.h index fa2056e6da..5750cecb84 100644 --- a/src/libs/modelinglib/qmt/controller/container.h +++ b/src/libs/modelinglib/qmt/controller/container.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_CONTAINER_H -#define QMT_CONTAINER_H +#pragma once #include <QList> @@ -90,5 +89,3 @@ private: }; } // namespace qmt - -#endif // QMT_CONTAINER_H diff --git a/src/libs/modelinglib/qmt/controller/namecontroller.h b/src/libs/modelinglib/qmt/controller/namecontroller.h index 6326301177..ec77165695 100644 --- a/src/libs/modelinglib/qmt/controller/namecontroller.h +++ b/src/libs/modelinglib/qmt/controller/namecontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_NAMECONTROLLER_H -#define QMT_NAMECONTROLLER_H +#pragma once #include <QObject> #include "qmt/infrastructure/qmt_global.h" @@ -53,5 +52,3 @@ public: }; } // namespace qmt - -#endif // QMT_NAMECONTROLLER_H diff --git a/src/libs/modelinglib/qmt/controller/references.h b/src/libs/modelinglib/qmt/controller/references.h index f9711c0159..c6fbbd3849 100644 --- a/src/libs/modelinglib/qmt/controller/references.h +++ b/src/libs/modelinglib/qmt/controller/references.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_REFERENCES_H -#define QMT_REFERENCES_H +#pragma once #include <QList> @@ -51,5 +50,3 @@ private: }; } // namespace qmt - -#endif // QMT_REFERENCES_H diff --git a/src/libs/modelinglib/qmt/controller/selection.h b/src/libs/modelinglib/qmt/controller/selection.h index 4a8cb2969a..bca36c802b 100644 --- a/src/libs/modelinglib/qmt/controller/selection.h +++ b/src/libs/modelinglib/qmt/controller/selection.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_SELECTION_H -#define QMT_SELECTION_H +#pragma once #include "qmt/infrastructure/uid.h" @@ -71,5 +70,3 @@ private: }; } // namespace qmt - -#endif // QMT_SELECTION_H diff --git a/src/libs/modelinglib/qmt/controller/undocommand.h b/src/libs/modelinglib/qmt/controller/undocommand.h index 56d4b6aee2..52cd00b707 100644 --- a/src/libs/modelinglib/qmt/controller/undocommand.h +++ b/src/libs/modelinglib/qmt/controller/undocommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_UNDOCOMMAND_H -#define QMT_UNDOCOMMAND_H +#pragma once #include <QUndoCommand> #include "qmt/infrastructure/qmt_global.h" @@ -53,5 +52,3 @@ private: }; } // namespace qmt - -#endif // QMT_UNDOCOMMAND_H diff --git a/src/libs/modelinglib/qmt/controller/undocontroller.h b/src/libs/modelinglib/qmt/controller/undocontroller.h index a18b00894c..7a3e162d1b 100644 --- a/src/libs/modelinglib/qmt/controller/undocontroller.h +++ b/src/libs/modelinglib/qmt/controller/undocontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_UNDOCONTROLLER_H -#define QMT_UNDOCONTROLLER_H +#pragma once #include <QObject> #include "qmt/infrastructure/qmt_global.h" @@ -60,5 +59,3 @@ private: }; } // namespace qmt - -#endif // QMT_UNDOCONTROLLER_H diff --git a/src/libs/modelinglib/qmt/diagram/dannotation.h b/src/libs/modelinglib/qmt/diagram/dannotation.h index a6ec215147..fe1e57d37d 100644 --- a/src/libs/modelinglib/qmt/diagram/dannotation.h +++ b/src/libs/modelinglib/qmt/diagram/dannotation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DANNOTATION_H -#define QMT_DANNOTATION_H +#pragma once #include "delement.h" @@ -75,5 +74,3 @@ private: }; } // namespace qmt - -#endif // QMT_DANNOTATION_H diff --git a/src/libs/modelinglib/qmt/diagram/dassociation.h b/src/libs/modelinglib/qmt/diagram/dassociation.h index 65b48bed77..1da72c36b5 100644 --- a/src/libs/modelinglib/qmt/diagram/dassociation.h +++ b/src/libs/modelinglib/qmt/diagram/dassociation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DASSOCIATION_H -#define QMT_DASSOCIATION_H +#pragma once #include "drelation.h" @@ -81,5 +80,3 @@ private: }; } // namespace qmt - -#endif // QMT_DASSOCIATION_H diff --git a/src/libs/modelinglib/qmt/diagram/dboundary.h b/src/libs/modelinglib/qmt/diagram/dboundary.h index f475eb654f..cb617f7c6c 100644 --- a/src/libs/modelinglib/qmt/diagram/dboundary.h +++ b/src/libs/modelinglib/qmt/diagram/dboundary.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DBOUNDARY_H -#define QMT_DBOUNDARY_H +#pragma once #include "delement.h" @@ -60,5 +59,3 @@ private: }; } // namespace qmt - -#endif // QMT_DBOUNDARY_H diff --git a/src/libs/modelinglib/qmt/diagram/dclass.h b/src/libs/modelinglib/qmt/diagram/dclass.h index 3a56f6ad98..c86d8b335c 100644 --- a/src/libs/modelinglib/qmt/diagram/dclass.h +++ b/src/libs/modelinglib/qmt/diagram/dclass.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DCLASS_H -#define QMT_DCLASS_H +#pragma once #include "dobject.h" #include "qmt/model/mclassmember.h" @@ -71,5 +70,3 @@ private: }; } // namespace qmt - -#endif // QMT_DCLASS_H diff --git a/src/libs/modelinglib/qmt/diagram/dcomponent.h b/src/libs/modelinglib/qmt/diagram/dcomponent.h index 448b4f1585..03ef43ecdb 100644 --- a/src/libs/modelinglib/qmt/diagram/dcomponent.h +++ b/src/libs/modelinglib/qmt/diagram/dcomponent.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DCOMPONENT_H -#define QMT_DCOMPONENT_H +#pragma once #include "dobject.h" @@ -47,5 +46,3 @@ private: }; } // namespace qmt - -#endif // QMT_DCOMPONENT_H diff --git a/src/libs/modelinglib/qmt/diagram/dconstvisitor.h b/src/libs/modelinglib/qmt/diagram/dconstvisitor.h index 9b3a1b2e45..23bdb91d58 100644 --- a/src/libs/modelinglib/qmt/diagram/dconstvisitor.h +++ b/src/libs/modelinglib/qmt/diagram/dconstvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DCONSTVISITOR_H -#define QMT_DCONSTVISITOR_H +#pragma once namespace qmt { @@ -63,5 +62,3 @@ public: }; } // namespace qmt - -#endif // QMT_DCONSTVISITOR_H diff --git a/src/libs/modelinglib/qmt/diagram/ddependency.h b/src/libs/modelinglib/qmt/diagram/ddependency.h index ad8ec69620..7c3c712452 100644 --- a/src/libs/modelinglib/qmt/diagram/ddependency.h +++ b/src/libs/modelinglib/qmt/diagram/ddependency.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DDEPENDENCY_H -#define QMT_DDEPENDENCY_H +#pragma once #include "drelation.h" @@ -55,5 +54,3 @@ private: }; } // namespace qmt - -#endif // QMT_DDEPENDENCY_H diff --git a/src/libs/modelinglib/qmt/diagram/ddiagram.h b/src/libs/modelinglib/qmt/diagram/ddiagram.h index 50378dde17..59dfd88f83 100644 --- a/src/libs/modelinglib/qmt/diagram/ddiagram.h +++ b/src/libs/modelinglib/qmt/diagram/ddiagram.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DDIAGRAM_H -#define QMT_DDIAGRAM_H +#pragma once #include "dobject.h" @@ -41,5 +40,3 @@ public: }; } // namespace qmt - -#endif // QMT_DDIAGRAM_H diff --git a/src/libs/modelinglib/qmt/diagram/delement.h b/src/libs/modelinglib/qmt/diagram/delement.h index 5d33b6cac8..bd454408cb 100644 --- a/src/libs/modelinglib/qmt/diagram/delement.h +++ b/src/libs/modelinglib/qmt/diagram/delement.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DELEMENT_H -#define QMT_DELEMENT_H +#pragma once #include "qmt/infrastructure/uid.h" @@ -54,5 +53,3 @@ private: }; } // namespace qmt - -#endif // QMT_DELEMENT_H diff --git a/src/libs/modelinglib/qmt/diagram/dinheritance.h b/src/libs/modelinglib/qmt/diagram/dinheritance.h index 5869f0fc73..82d6785377 100644 --- a/src/libs/modelinglib/qmt/diagram/dinheritance.h +++ b/src/libs/modelinglib/qmt/diagram/dinheritance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DINHERITANCE_H -#define QMT_DINHERITANCE_H +#pragma once #include "drelation.h" @@ -48,5 +47,3 @@ public: }; } // namespace qmt - -#endif // QMT_DINHERITANCE_H diff --git a/src/libs/modelinglib/qmt/diagram/ditem.h b/src/libs/modelinglib/qmt/diagram/ditem.h index 8539f784f4..7782e9497d 100644 --- a/src/libs/modelinglib/qmt/diagram/ditem.h +++ b/src/libs/modelinglib/qmt/diagram/ditem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DITEM_H -#define QMT_DITEM_H +#pragma once #include "dobject.h" @@ -53,5 +52,3 @@ private: }; } // namespace qmt - -#endif // QMT_DITEM_H diff --git a/src/libs/modelinglib/qmt/diagram/dobject.h b/src/libs/modelinglib/qmt/diagram/dobject.h index b31ce24392..6e5f85358a 100644 --- a/src/libs/modelinglib/qmt/diagram/dobject.h +++ b/src/libs/modelinglib/qmt/diagram/dobject.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DOBJECT_H -#define QMT_DOBJECT_H +#pragma once #include "delement.h" @@ -120,5 +119,3 @@ private: }; } // namespace qmt - -#endif // QMT_DOBJECT_H diff --git a/src/libs/modelinglib/qmt/diagram/dpackage.h b/src/libs/modelinglib/qmt/diagram/dpackage.h index bcb2f68aec..c1ca291c7b 100644 --- a/src/libs/modelinglib/qmt/diagram/dpackage.h +++ b/src/libs/modelinglib/qmt/diagram/dpackage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DPACKAGE_H -#define QMT_DPACKAGE_H +#pragma once #include "dobject.h" @@ -41,5 +40,3 @@ public: }; } // namespace qmt - -#endif // QMT_DPACKAGE_H diff --git a/src/libs/modelinglib/qmt/diagram/drelation.h b/src/libs/modelinglib/qmt/diagram/drelation.h index 59c426b41e..18aaed94a4 100644 --- a/src/libs/modelinglib/qmt/diagram/drelation.h +++ b/src/libs/modelinglib/qmt/diagram/drelation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DRELATION_H -#define QMT_DRELATION_H +#pragma once #include "delement.h" @@ -86,5 +85,3 @@ inline bool operator!=(const DRelation::IntermediatePoint &lhs, } } // namespace qmt - -#endif // QMT_DRELATION_H diff --git a/src/libs/modelinglib/qmt/diagram/dvisitor.h b/src/libs/modelinglib/qmt/diagram/dvisitor.h index 00a0ffee25..bb9e7873ee 100644 --- a/src/libs/modelinglib/qmt/diagram/dvisitor.h +++ b/src/libs/modelinglib/qmt/diagram/dvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DVISITOR_H -#define QMT_DVISITOR_H +#pragma once namespace qmt { @@ -63,5 +62,3 @@ public: }; } // namespace qmt - -#endif // QMT_DVISITOR_H diff --git a/src/libs/modelinglib/qmt/diagram_controller/dclonevisitor.h b/src/libs/modelinglib/qmt/diagram_controller/dclonevisitor.h index 01c83628c3..c69534b542 100644 --- a/src/libs/modelinglib/qmt/diagram_controller/dclonevisitor.h +++ b/src/libs/modelinglib/qmt/diagram_controller/dclonevisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DCLONEVISITOR_H -#define QMT_DCLONEVISITOR_H +#pragma once #include "qmt/diagram/dconstvisitor.h" #include "qmt/infrastructure/qmt_global.h" @@ -82,5 +81,3 @@ private: }; } // namespace qmt - -#endif // QMT_DCLONEVISITOR_H diff --git a/src/libs/modelinglib/qmt/diagram_controller/dcontainer.h b/src/libs/modelinglib/qmt/diagram_controller/dcontainer.h index 59684efc5d..b6ccd86756 100644 --- a/src/libs/modelinglib/qmt/diagram_controller/dcontainer.h +++ b/src/libs/modelinglib/qmt/diagram_controller/dcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DCONTAINER_H -#define QMT_DCONTAINER_H +#pragma once #include "qmt/controller/container.h" #include "qmt/diagram/delement.h" @@ -36,5 +35,3 @@ class QMT_EXPORT DContainer : public Container<DElement> }; } // namespace qmt - -#endif // QMT_DCONTAINER_H diff --git a/src/libs/modelinglib/qmt/diagram_controller/dfactory.h b/src/libs/modelinglib/qmt/diagram_controller/dfactory.h index 46b91599c4..5d5e48ded8 100644 --- a/src/libs/modelinglib/qmt/diagram_controller/dfactory.h +++ b/src/libs/modelinglib/qmt/diagram_controller/dfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DFACTORY_H -#define QMT_DFACTORY_H +#pragma once #include "qmt/model/mconstvisitor.h" #include "qmt/infrastructure/qmt_global.h" @@ -58,5 +57,3 @@ private: }; } // namespace qmt - -#endif // QMT_DFACTORY_H diff --git a/src/libs/modelinglib/qmt/diagram_controller/dflatassignmentvisitor.h b/src/libs/modelinglib/qmt/diagram_controller/dflatassignmentvisitor.h index 59a30dc4bb..8c2537ab05 100644 --- a/src/libs/modelinglib/qmt/diagram_controller/dflatassignmentvisitor.h +++ b/src/libs/modelinglib/qmt/diagram_controller/dflatassignmentvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DFLATASSIGNMENTVISITOR_H -#define QMT_DFLATASSIGNMENTVISITOR_H +#pragma once #include "qmt/diagram/dconstvisitor.h" #include "qmt/infrastructure/qmt_global.h" @@ -55,5 +54,3 @@ private: }; } // namespace qmt - -#endif // QMT_DFLATASSIGNMENTVISITOR_H diff --git a/src/libs/modelinglib/qmt/diagram_controller/diagramcontroller.h b/src/libs/modelinglib/qmt/diagram_controller/diagramcontroller.h index 074f0f7d0a..4199208e53 100644 --- a/src/libs/modelinglib/qmt/diagram_controller/diagramcontroller.h +++ b/src/libs/modelinglib/qmt/diagram_controller/diagramcontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DIAGRAMCONTROLLER_H -#define QMT_DIAGRAMCONTROLLER_H +#pragma once #include "qmt/infrastructure/uid.h" @@ -170,5 +169,3 @@ private: }; } // namespace qmt - -#endif // DIAGRAMCONTROLLER_H diff --git a/src/libs/modelinglib/qmt/diagram_controller/dreferences.h b/src/libs/modelinglib/qmt/diagram_controller/dreferences.h index 13a492783f..325cbef306 100644 --- a/src/libs/modelinglib/qmt/diagram_controller/dreferences.h +++ b/src/libs/modelinglib/qmt/diagram_controller/dreferences.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DREFERENCES_H -#define QMT_DREFERENCES_H +#pragma once #include "qmt/controller/references.h" #include "qmt/infrastructure/qmt_global.h" @@ -38,5 +37,3 @@ class QMT_EXPORT DReferences : public References<DElement> }; } // namespace qmt - -#endif // QMT_DREFERENCES_H diff --git a/src/libs/modelinglib/qmt/diagram_controller/dselection.h b/src/libs/modelinglib/qmt/diagram_controller/dselection.h index f653777d69..030c19dfa5 100644 --- a/src/libs/modelinglib/qmt/diagram_controller/dselection.h +++ b/src/libs/modelinglib/qmt/diagram_controller/dselection.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DSELECTION_H -#define QMT_DSELECTION_H +#pragma once #include "qmt/controller/selection.h" #include "qmt/infrastructure/qmt_global.h" @@ -36,5 +35,3 @@ class QMT_EXPORT DSelection : public Selection }; } // namespace qmt - -#endif // QMT_DSELECTION_H diff --git a/src/libs/modelinglib/qmt/diagram_controller/dupdatevisitor.h b/src/libs/modelinglib/qmt/diagram_controller/dupdatevisitor.h index ade9391b01..e88e9eed4b 100644 --- a/src/libs/modelinglib/qmt/diagram_controller/dupdatevisitor.h +++ b/src/libs/modelinglib/qmt/diagram_controller/dupdatevisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DUPDATEVISITOR_H -#define QMT_DUPDATEVISITOR_H +#pragma once #include "qmt/model/mconstvisitor.h" #include "qmt/infrastructure/qmt_global.h" @@ -64,5 +63,3 @@ private: }; } // namespace qmt - -#endif // QMT_DUPDATEVISITOR_H diff --git a/src/libs/modelinglib/qmt/diagram_controller/dvoidvisitor.h b/src/libs/modelinglib/qmt/diagram_controller/dvoidvisitor.h index 4f4328694e..4519c1a943 100644 --- a/src/libs/modelinglib/qmt/diagram_controller/dvoidvisitor.h +++ b/src/libs/modelinglib/qmt/diagram_controller/dvoidvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DVOIDVISITOR_H -#define QMT_DVOIDVISITOR_H +#pragma once #include "qmt/diagram/dvisitor.h" #include "qmt/diagram/dconstvisitor.h" @@ -73,5 +72,3 @@ public: }; } // namespace qmt - -#endif // DVOIDVISITOR_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/capabilities/alignable.h b/src/libs/modelinglib/qmt/diagram_scene/capabilities/alignable.h index e78755e305..2b569ecce8 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/capabilities/alignable.h +++ b/src/libs/modelinglib/qmt/diagram_scene/capabilities/alignable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_ALIGNABLE_H -#define QMT_ALIGNABLE_H +#pragma once #include <QString> @@ -51,5 +50,3 @@ public: }; } // namespace qmt - -#endif // QMT_ALIGNABLE_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/capabilities/editable.h b/src/libs/modelinglib/qmt/diagram_scene/capabilities/editable.h index eab027ab56..de0e70edd5 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/capabilities/editable.h +++ b/src/libs/modelinglib/qmt/diagram_scene/capabilities/editable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_EDITABLE_H -#define QMT_EDITABLE_H +#pragma once namespace qmt { @@ -39,5 +38,3 @@ public: }; } // namespace qmt - -#endif // QMT_EDITABLE_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/capabilities/intersectionable.h b/src/libs/modelinglib/qmt/diagram_scene/capabilities/intersectionable.h index 4e697d19e0..bb7b0ec81c 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/capabilities/intersectionable.h +++ b/src/libs/modelinglib/qmt/diagram_scene/capabilities/intersectionable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_INTERSECTIONABLE_H -#define QMT_INTERSECTIONABLE_H +#pragma once #include <QtGlobal> @@ -45,5 +44,3 @@ public: }; } // namespace qmt - -#endif // QMT_INTERSECTIONABLE_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/capabilities/latchable.h b/src/libs/modelinglib/qmt/diagram_scene/capabilities/latchable.h index fb9c0ae324..3f720cdec2 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/capabilities/latchable.h +++ b/src/libs/modelinglib/qmt/diagram_scene/capabilities/latchable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_LATCHABLE_H -#define QMT_LATCHABLE_H +#pragma once #include <QList> @@ -82,5 +81,3 @@ public: }; } // namespace qmt - -#endif // QMT_LATCHABLE_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/capabilities/moveable.h b/src/libs/modelinglib/qmt/diagram_scene/capabilities/moveable.h index a5e25b5534..0588fad2bc 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/capabilities/moveable.h +++ b/src/libs/modelinglib/qmt/diagram_scene/capabilities/moveable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MOVEABLE_H -#define QMT_MOVEABLE_H +#pragma once #include <QtGlobal> @@ -44,5 +43,3 @@ public: }; } // namespace qmt - -#endif // QMT_MOVEABLE_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/capabilities/relationable.h b/src/libs/modelinglib/qmt/diagram_scene/capabilities/relationable.h index ac4bd952ac..793bb3f796 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/capabilities/relationable.h +++ b/src/libs/modelinglib/qmt/diagram_scene/capabilities/relationable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_RELATIONABLE_H -#define QMT_RELATIONABLE_H +#pragma once #include <QList> @@ -46,5 +45,3 @@ public: }; } // namespace qmt - -#endif // QMT_RELATIONABLE_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/capabilities/resizable.h b/src/libs/modelinglib/qmt/diagram_scene/capabilities/resizable.h index 0bcf587c34..5fbda477e7 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/capabilities/resizable.h +++ b/src/libs/modelinglib/qmt/diagram_scene/capabilities/resizable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_RESIZABLE_H -#define QMT_RESIZABLE_H +#pragma once #include <QtGlobal> @@ -58,5 +57,3 @@ public: }; } // namespace qmt - -#endif // QMT_RESIZABLE_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/capabilities/selectable.h b/src/libs/modelinglib/qmt/diagram_scene/capabilities/selectable.h index c600d986de..5afcf64efd 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/capabilities/selectable.h +++ b/src/libs/modelinglib/qmt/diagram_scene/capabilities/selectable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_SELECTABLE_H -#define QMT_SELECTABLE_H +#pragma once namespace qmt { @@ -40,5 +39,3 @@ public: }; } // namespace qmt - -#endif // QMT_SELECTABLE_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/capabilities/windable.h b/src/libs/modelinglib/qmt/diagram_scene/capabilities/windable.h index 16228de48b..8d7afa63c0 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/capabilities/windable.h +++ b/src/libs/modelinglib/qmt/diagram_scene/capabilities/windable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_WINDABLE_H -#define QMT_WINDABLE_H +#pragma once #include <QtGlobal> @@ -47,5 +46,3 @@ public: }; } // namespace qmt - -#endif // QMT_WINDABLE_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/diagramgraphicsscene.h b/src/libs/modelinglib/qmt/diagram_scene/diagramgraphicsscene.h index cadc04aa29..3be43fa397 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/diagramgraphicsscene.h +++ b/src/libs/modelinglib/qmt/diagram_scene/diagramgraphicsscene.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DIAGRAMGRAPHICSSCENE_H -#define QMT_DIAGRAMGRAPHICSSCENE_H +#pragma once #include <QGraphicsScene> #include "qmt/infrastructure/qmt_global.h" @@ -69,5 +68,3 @@ private: }; } // namespace qmt - -#endif // QMT_DIAGRAMGRAPHICSSCENE_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/diagramsceneconstants.h b/src/libs/modelinglib/qmt/diagram_scene/diagramsceneconstants.h index 01d6256110..6f7d0a89e2 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/diagramsceneconstants.h +++ b/src/libs/modelinglib/qmt/diagram_scene/diagramsceneconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DIAGRAMSCENECONSTANTS_H -#define QMT_DIAGRAMSCENECONSTANTS_H +#pragma once namespace qmt { @@ -45,5 +44,3 @@ const double CUSTOM_ICON_MINIMUM_AUTO_WIDTH = 40.0; // must be n * 2 * RASTER_WI const double CUSTOM_ICON_MINIMUM_AUTO_HEIGHT = 40.0; // must be n * 2 * RASTER_HEIGHT } // namespace qmt - -#endif // QMT_DIAGRAMSCENECONSTANTS_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/diagramscenemodel.h b/src/libs/modelinglib/qmt/diagram_scene/diagramscenemodel.h index 16b6ecdda9..1b616710cf 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/diagramscenemodel.h +++ b/src/libs/modelinglib/qmt/diagram_scene/diagramscenemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DIAGRAMSCENEMODEL_H -#define QMT_DIAGRAMSCENEMODEL_H +#pragma once #include <QObject> #include "qmt/infrastructure/qmt_global.h" @@ -184,5 +183,3 @@ private: }; } // namespace qmt - -#endif // QMT_DIAGRAMSCENEMODEL_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/diagramscenemodelitemvisitors.h b/src/libs/modelinglib/qmt/diagram_scene/diagramscenemodelitemvisitors.h index 40c460e447..138f087481 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/diagramscenemodelitemvisitors.h +++ b/src/libs/modelinglib/qmt/diagram_scene/diagramscenemodelitemvisitors.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DIAGRAMSCENEMODELITEMVISITORS_H -#define QMT_DIAGRAMSCENEMODELITEMVISITORS_H +#pragma once #include "diagramscenemodel.h" @@ -85,5 +84,3 @@ private: }; } // namespace qmt - -#endif // QMT_DIAGRAMSCENEMODELITEMVISITORS_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/items/annotationitem.h b/src/libs/modelinglib/qmt/diagram_scene/items/annotationitem.h index 12bff51a35..29e16224ec 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/items/annotationitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/items/annotationitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_ANNOTATIONITEM_H -#define QMT_ANNOTATIONITEM_H +#pragma once #include <QGraphicsItem> @@ -111,5 +110,3 @@ private: }; } // namespace qmt - -#endif // QMT_ANNOTATIONITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/items/associationitem.h b/src/libs/modelinglib/qmt/diagram_scene/items/associationitem.h index 9b2966d74f..ad076eee59 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/items/associationitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/items/associationitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_GRAPHICSASSOCIATIONITEM_H -#define QMT_GRAPHICSASSOCIATIONITEM_H +#pragma once #include "relationitem.h" @@ -63,5 +62,3 @@ private: }; } // namespace qmt - -#endif // QMT_GRAPHICSASSOCIATIONITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/items/boundaryitem.h b/src/libs/modelinglib/qmt/diagram_scene/items/boundaryitem.h index f00ddfba9b..b6b3380beb 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/items/boundaryitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/items/boundaryitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_BOUNDARYITEM_H -#define QMT_BOUNDARYITEM_H +#pragma once #include <QGraphicsItem> @@ -110,5 +109,3 @@ private: }; } // namespace qmt - -#endif // QMT_BOUNDARYITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/items/classitem.h b/src/libs/modelinglib/qmt/diagram_scene/items/classitem.h index 1e0df2a451..c4312a313c 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/items/classitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/items/classitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_GRAPHICSCLASSITEM_H -#define QMT_GRAPHICSCLASSITEM_H +#pragma once #include "objectitem.h" @@ -93,5 +92,3 @@ private: }; } // namespace qmt - -#endif // QMT_GRAPHICSCLASSITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/items/componentitem.h b/src/libs/modelinglib/qmt/diagram_scene/items/componentitem.h index d0b294ba3b..1b524247f3 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/items/componentitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/items/componentitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_GRAPHICSCOMPONENTITEM_H -#define QMT_GRAPHICSCOMPONENTITEM_H +#pragma once #include "objectitem.h" @@ -79,5 +78,3 @@ private: }; } // namespace qmt - -#endif // QMT_GRAPHICSCOMPONENTITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/items/diagramitem.h b/src/libs/modelinglib/qmt/diagram_scene/items/diagramitem.h index 0d3596b9ef..33919920a6 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/items/diagramitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/items/diagramitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_GRAPHICSDIAGRAMITEM_H -#define QMT_GRAPHICSDIAGRAMITEM_H +#pragma once #include "objectitem.h" @@ -58,5 +57,3 @@ private: }; } // namespace qmt - -#endif // QMT_GRAPHICSDIAGRAMITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/items/itemitem.h b/src/libs/modelinglib/qmt/diagram_scene/items/itemitem.h index 0c64c1d333..49a3c2fc58 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/items/itemitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/items/itemitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_ITEMITEM_H -#define QMT_ITEMITEM_H +#pragma once #include "objectitem.h" @@ -75,5 +74,3 @@ private: }; } // namespace qmt - -#endif // QMT_ITEMITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/items/objectitem.h b/src/libs/modelinglib/qmt/diagram_scene/items/objectitem.h index 6d8901b4c8..4560a6fbbb 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/items/objectitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/items/objectitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_OBJECTITEM_H -#define QMT_OBJECTITEM_H +#pragma once #include <QGraphicsItem> @@ -175,5 +174,3 @@ private: }; } // namespace qmt - -#endif // QMT_OBJECTITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/items/packageitem.h b/src/libs/modelinglib/qmt/diagram_scene/items/packageitem.h index 99f6587cba..c08add8368 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/items/packageitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/items/packageitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_GRAPHICSPACKAGEITEM_H -#define QMT_GRAPHICSPACKAGEITEM_H +#pragma once #include "objectitem.h" @@ -76,5 +75,3 @@ private: }; } // namespace qmt - -#endif // QMT_GRAPHICSPACKAGEITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/items/relationitem.h b/src/libs/modelinglib/qmt/diagram_scene/items/relationitem.h index d81470a759..983d480fbc 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/items/relationitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/items/relationitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_GRAPHICSRELATIONITEM_H -#define QMT_GRAPHICSRELATIONITEM_H +#pragma once #include <QGraphicsItem> #include "qmt/diagram_scene/capabilities/moveable.h" @@ -109,5 +108,3 @@ protected: }; } // namespace qmt - -#endif // QMT_GRAPHICSRELATIONITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/items/stereotypedisplayvisitor.h b/src/libs/modelinglib/qmt/diagram_scene/items/stereotypedisplayvisitor.h index 4d01efddfe..cac65534d2 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/items/stereotypedisplayvisitor.h +++ b/src/libs/modelinglib/qmt/diagram_scene/items/stereotypedisplayvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_STEREOTYPEDISPLAYVISITOR_H -#define QMT_STEREOTYPEDISPLAYVISITOR_H +#pragma once #include "qmt/diagram_controller/dvoidvisitor.h" @@ -67,5 +66,3 @@ private: }; } // namespace qmt - -#endif // QMT_STEREOTYPEDISPLAYVISITOR_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/latchcontroller.h b/src/libs/modelinglib/qmt/diagram_scene/latchcontroller.h index c478ce0faa..fc91764d2f 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/latchcontroller.h +++ b/src/libs/modelinglib/qmt/diagram_scene/latchcontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_LATCHCONTROLLER_H -#define QMT_LATCHCONTROLLER_H +#pragma once #include <QObject> #include "qmt/infrastructure/qmt_global.h" @@ -80,5 +79,3 @@ private: }; } // namespace qmt - -#endif // QMT_LATCHCONTROLLER_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/parts/alignbuttonsitem.h b/src/libs/modelinglib/qmt/diagram_scene/parts/alignbuttonsitem.h index 14144170b0..96a48f3d8a 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/parts/alignbuttonsitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/parts/alignbuttonsitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_ALIGNBUTTONSITEM_H -#define QMT_ALIGNBUTTONSITEM_H +#pragma once #include "qmt/diagram_scene/capabilities/alignable.h" @@ -64,5 +63,3 @@ private: }; } // namespace qmt - -#endif // QMT_ALIGNBUTTONSITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/parts/alignlineitem.h b/src/libs/modelinglib/qmt/diagram_scene/parts/alignlineitem.h index 1d8c240ea3..a630efc2b7 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/parts/alignlineitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/parts/alignlineitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_ALIGNLINEITEM_H -#define QMT_ALIGNLINEITEM_H +#pragma once #include <QGraphicsItem> @@ -54,5 +53,3 @@ public: }; } // namespace qmt - -#endif // QMT_ALIGNLINEITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/parts/arrowitem.h b/src/libs/modelinglib/qmt/diagram_scene/parts/arrowitem.h index c10b2817a3..1db2c532cd 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/parts/arrowitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/parts/arrowitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_GRAPHICSARROWITEM_H -#define QMT_GRAPHICSARROWITEM_H +#pragma once #include <QGraphicsItem> @@ -101,5 +100,3 @@ private: }; } // namespace qmt - -#endif // QMT_GRAPHICSARROWITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/parts/contextlabelitem.h b/src/libs/modelinglib/qmt/diagram_scene/parts/contextlabelitem.h index 3f85103642..3bbce88073 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/parts/contextlabelitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/parts/contextlabelitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_CONTEXTLABELITEM_H -#define QMT_CONTEXTLABELITEM_H +#pragma once #include <QGraphicsSimpleTextItem> @@ -49,5 +48,3 @@ private: }; } // namespace qmt - -#endif // QMT_CONTEXTLABELITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/parts/customiconitem.h b/src/libs/modelinglib/qmt/diagram_scene/parts/customiconitem.h index ebdbbaea97..a1280f45e6 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/parts/customiconitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/parts/customiconitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_CUSTOMICONITEM_H -#define QMT_CUSTOMICONITEM_H +#pragma once #include <QGraphicsItem> @@ -67,5 +66,3 @@ private: }; } // namespace qmt - -#endif // QMT_CUSTOMICONITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/parts/editabletextitem.h b/src/libs/modelinglib/qmt/diagram_scene/parts/editabletextitem.h index 488058e9f1..b3e93ecd1b 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/parts/editabletextitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/parts/editabletextitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_EDITABLETEXTITEM_H -#define QMT_EDITABLETEXTITEM_H +#pragma once #include <QGraphicsTextItem> @@ -63,5 +62,3 @@ private: }; } // namespace qmt - -#endif // QMT_EDITABLETEXTITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/parts/pathselectionitem.h b/src/libs/modelinglib/qmt/diagram_scene/parts/pathselectionitem.h index 04e112949d..b38688e2a0 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/parts/pathselectionitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/parts/pathselectionitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_GRAPHICSPATHSELECTIONITEM_H -#define QMT_GRAPHICSPATHSELECTIONITEM_H +#pragma once #include <QGraphicsItem> @@ -82,5 +81,3 @@ private: }; } // namespace qmt - -#endif // QMT_GRAPHICSPATHSELECTIONITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/parts/rectangularselectionitem.h b/src/libs/modelinglib/qmt/diagram_scene/parts/rectangularselectionitem.h index b07e886de8..bb82cc4460 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/parts/rectangularselectionitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/parts/rectangularselectionitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_RECTENGULARSELECTIONITEM_H -#define QMT_RECTENGULARSELECTIONITEM_H +#pragma once #include <QGraphicsItem> #include <QVector> @@ -114,5 +113,3 @@ private: }; } // namespace qmt - -#endif // QMT_RECTENGULARSELECTIONITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/parts/relationstarter.h b/src/libs/modelinglib/qmt/diagram_scene/parts/relationstarter.h index d345108b1d..cbf69e9244 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/parts/relationstarter.h +++ b/src/libs/modelinglib/qmt/diagram_scene/parts/relationstarter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_GRAPHICSRELATIONSTARTER_H -#define QMT_GRAPHICSRELATIONSTARTER_H +#pragma once #include <QGraphicsRectItem> @@ -71,5 +70,3 @@ private: }; } // namespace qmt - -#endif // QMT_GRAPHICSRELATIONSTARTER_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/parts/stereotypesitem.h b/src/libs/modelinglib/qmt/diagram_scene/parts/stereotypesitem.h index 2e4868024f..bfb5808261 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/parts/stereotypesitem.h +++ b/src/libs/modelinglib/qmt/diagram_scene/parts/stereotypesitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_GRAPHICSSTEREOTYPESITEM_H -#define QMT_GRAPHICSSTEREOTYPESITEM_H +#pragma once #include <QGraphicsSimpleTextItem> #include <QList> @@ -43,5 +42,3 @@ public: }; } // namespace qmt - -#endif // QMT_GRAPHICSSTEREOTYPESITEM_H diff --git a/src/libs/modelinglib/qmt/diagram_scene/parts/templateparameterbox.h b/src/libs/modelinglib/qmt/diagram_scene/parts/templateparameterbox.h index b22009193c..63349f8ab8 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/parts/templateparameterbox.h +++ b/src/libs/modelinglib/qmt/diagram_scene/parts/templateparameterbox.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_TEMPLATEPARAMETERBOX_H -#define QMT_TEMPLATEPARAMETERBOX_H +#pragma once #include <QGraphicsRectItem> @@ -51,5 +50,3 @@ private: }; } // namespace qmt - -#endif // QMT_TEMPLATEPARAMETERBOX_H diff --git a/src/libs/modelinglib/qmt/diagram_ui/diagram_mime_types.h b/src/libs/modelinglib/qmt/diagram_ui/diagram_mime_types.h index b8df13c86d..5926f07ba1 100644 --- a/src/libs/modelinglib/qmt/diagram_ui/diagram_mime_types.h +++ b/src/libs/modelinglib/qmt/diagram_ui/diagram_mime_types.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DIAGRAM_MIME_TYPES_H -#define QMT_DIAGRAM_MIME_TYPES_H +#pragma once namespace qmt { @@ -41,5 +40,3 @@ static const char ELEMENT_TYPE_ANNOTATION[] = "annotation"; static const char ELEMENT_TYPE_BOUNDARY[] = "boundary"; } // namespace qmt - -#endif // QMT_DIAGRAM_MIME_TYPES_H diff --git a/src/libs/modelinglib/qmt/diagram_ui/diagramsmanager.h b/src/libs/modelinglib/qmt/diagram_ui/diagramsmanager.h index df7a57fbd9..f9af7636a0 100644 --- a/src/libs/modelinglib/qmt/diagram_ui/diagramsmanager.h +++ b/src/libs/modelinglib/qmt/diagram_ui/diagramsmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DIAGRAMSMANAGER_H -#define QMT_DIAGRAMSMANAGER_H +#pragma once #include <QObject> @@ -94,5 +93,3 @@ private: }; } // namespace qmt - -#endif // QMT_DIAGRAMSMANAGER_H diff --git a/src/libs/modelinglib/qmt/diagram_ui/diagramsviewinterface.h b/src/libs/modelinglib/qmt/diagram_ui/diagramsviewinterface.h index afa95b5d8f..9aacb765d5 100644 --- a/src/libs/modelinglib/qmt/diagram_ui/diagramsviewinterface.h +++ b/src/libs/modelinglib/qmt/diagram_ui/diagramsviewinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DIAGRAMSVIEWINTERFACE_H -#define QMT_DIAGRAMSVIEWINTERFACE_H +#pragma once namespace qmt { @@ -43,5 +42,3 @@ public: }; } // namespace qmt - -#endif // QMT_DIAGRAMSVIEWINTERFACE_H diff --git a/src/libs/modelinglib/qmt/diagram_ui/sceneinspector.h b/src/libs/modelinglib/qmt/diagram_ui/sceneinspector.h index f42969b5a0..9cd964a6d9 100644 --- a/src/libs/modelinglib/qmt/diagram_ui/sceneinspector.h +++ b/src/libs/modelinglib/qmt/diagram_ui/sceneinspector.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_SCENEINSPECTOR_H -#define QMT_SCENEINSPECTOR_H +#pragma once #include <QObject> #include "qmt/tasks/isceneinspector.h" @@ -52,5 +51,3 @@ private: }; } // namespace qmt - -#endif // QMT_SCENEINSPECTOR_H diff --git a/src/libs/modelinglib/qmt/diagram_widgets_ui/diagramsview.h b/src/libs/modelinglib/qmt/diagram_widgets_ui/diagramsview.h index e797150dcc..6913957b66 100644 --- a/src/libs/modelinglib/qmt/diagram_widgets_ui/diagramsview.h +++ b/src/libs/modelinglib/qmt/diagram_widgets_ui/diagramsview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DIAGRAMSVIEW_H -#define QMT_DIAGRAMSVIEW_H +#pragma once #include <QTabWidget> @@ -75,5 +74,3 @@ private: }; } // namespace qmt - -#endif // DIAGRAMSVIEW_H diff --git a/src/libs/modelinglib/qmt/diagram_widgets_ui/diagramview.h b/src/libs/modelinglib/qmt/diagram_widgets_ui/diagramview.h index ee0eb2dfc1..3ddc1951b1 100644 --- a/src/libs/modelinglib/qmt/diagram_widgets_ui/diagramview.h +++ b/src/libs/modelinglib/qmt/diagram_widgets_ui/diagramview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DIAGRAMVIEW_H -#define QMT_DIAGRAMVIEW_H +#pragma once #include <QGraphicsView> #include "qmt/infrastructure/qmt_global.h" @@ -56,5 +55,3 @@ private: }; } // namespace qmt - -#endif // QMT_DIAGRAMVIEW_H diff --git a/src/libs/modelinglib/qmt/diagram_widgets_ui/stackeddiagramsview.h b/src/libs/modelinglib/qmt/diagram_widgets_ui/stackeddiagramsview.h index 2b66884f08..d4b9eb1b3f 100644 --- a/src/libs/modelinglib/qmt/diagram_widgets_ui/stackeddiagramsview.h +++ b/src/libs/modelinglib/qmt/diagram_widgets_ui/stackeddiagramsview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_STACKEDDIAGRAMSVIEW_H -#define QMT_STACKEDDIAGRAMSVIEW_H +#pragma once #include <QStackedWidget> @@ -73,5 +72,3 @@ private: }; } // namespace qmt - -#endif // QMT_STACKEDDIAGRAMSVIEW_H diff --git a/src/libs/modelinglib/qmt/document_controller/documentcontroller.h b/src/libs/modelinglib/qmt/document_controller/documentcontroller.h index 2c04e1ae50..d9a253773f 100644 --- a/src/libs/modelinglib/qmt/document_controller/documentcontroller.h +++ b/src/libs/modelinglib/qmt/document_controller/documentcontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DOCUMENTCONTROLLER_H -#define QMT_DOCUMENTCONTROLLER_H +#pragma once #include <QObject> #include "qmt/infrastructure/qmt_global.h" @@ -124,5 +123,3 @@ private: }; } // namespace qmt - -#endif // QMT_DOCUMENTCONTROLLER_H diff --git a/src/libs/modelinglib/qmt/infrastructure/contextmenuaction.h b/src/libs/modelinglib/qmt/infrastructure/contextmenuaction.h index de056f8b30..ea6f2cd504 100644 --- a/src/libs/modelinglib/qmt/infrastructure/contextmenuaction.h +++ b/src/libs/modelinglib/qmt/infrastructure/contextmenuaction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_CONTEXTMENUACTION_H -#define QMT_CONTEXTMENUACTION_H +#pragma once #include <QAction> @@ -45,5 +44,3 @@ private: }; } // namespace qmt - -#endif // QMT_CONTEXTMENUACTION_H diff --git a/src/libs/modelinglib/qmt/infrastructure/exceptions.h b/src/libs/modelinglib/qmt/infrastructure/exceptions.h index 16824f10de..cbf4b86856 100644 --- a/src/libs/modelinglib/qmt/infrastructure/exceptions.h +++ b/src/libs/modelinglib/qmt/infrastructure/exceptions.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_EXCEPTIONS_H -#define QMT_EXCEPTIONS_H +#pragma once #include "qmt_global.h" @@ -55,5 +54,3 @@ public: }; } // namespace qmt - -#endif // QMT_EXCEPTIONS_H diff --git a/src/libs/modelinglib/qmt/infrastructure/geometryutilities.h b/src/libs/modelinglib/qmt/infrastructure/geometryutilities.h index 003556a791..c0062aa297 100644 --- a/src/libs/modelinglib/qmt/infrastructure/geometryutilities.h +++ b/src/libs/modelinglib/qmt/infrastructure/geometryutilities.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_GEOMETRYUTILITIES_H -#define QMT_GEOMETRYUTILITIES_H +#pragma once #include <QtGlobal> @@ -69,5 +68,3 @@ public: }; } // namespace qmt - -#endif // QMT_GEOMETRYUTILITIES_H diff --git a/src/libs/modelinglib/qmt/infrastructure/handle.h b/src/libs/modelinglib/qmt/infrastructure/handle.h index d94fa160af..261f8c7460 100644 --- a/src/libs/modelinglib/qmt/infrastructure/handle.h +++ b/src/libs/modelinglib/qmt/infrastructure/handle.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_HANDLE_H -#define QMT_HANDLE_H +#pragma once #include "uid.h" #include "qmtassert.h" @@ -99,5 +98,3 @@ Handle<T> handle_dynamic_cast(const Handle<U> &handle) } } // namespace qmt - -#endif // QMT_HANDLE_H diff --git a/src/libs/modelinglib/qmt/infrastructure/handles.h b/src/libs/modelinglib/qmt/infrastructure/handles.h index b7dd70f25c..d0e4c83ea5 100644 --- a/src/libs/modelinglib/qmt/infrastructure/handles.h +++ b/src/libs/modelinglib/qmt/infrastructure/handles.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_HANDLES_H -#define QMT_HANDLES_H +#pragma once #include "handle.h" #include "qmt/infrastructure/qmtassert.h" @@ -240,5 +239,3 @@ template<typename T> bool operator!=(const Handles<T> &lhs, const Handles<T> &rhs) { return !(lhs == rhs); } } // namespace qmt - -#endif // QMT_HANDLES_H diff --git a/src/libs/modelinglib/qmt/infrastructure/ioexceptions.h b/src/libs/modelinglib/qmt/infrastructure/ioexceptions.h index 2a5d56e5e9..cba138b056 100644 --- a/src/libs/modelinglib/qmt/infrastructure/ioexceptions.h +++ b/src/libs/modelinglib/qmt/infrastructure/ioexceptions.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_IOEXCEPTIONS_H -#define QMT_IOEXCEPTIONS_H +#pragma once #include "exceptions.h" @@ -87,5 +86,3 @@ public: }; } // namespace qmt - -#endif // QMT_IOEXCEPTIONS_H diff --git a/src/libs/modelinglib/qmt/infrastructure/qcompressedfile.h b/src/libs/modelinglib/qmt/infrastructure/qcompressedfile.h index 94007e7a5c..dad4f9a596 100644 --- a/src/libs/modelinglib/qmt/infrastructure/qcompressedfile.h +++ b/src/libs/modelinglib/qmt/infrastructure/qcompressedfile.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QCOMPRESSEDDEVICE_H -#define QCOMPRESSEDDEVICE_H +#pragma once #include <QIODevice> #include <QByteArray> @@ -60,5 +59,3 @@ private: }; } // namespace qmt - -#endif // QCOMPRESSEDDEVICE_H diff --git a/src/libs/modelinglib/qmt/infrastructure/qmt_global.h b/src/libs/modelinglib/qmt/infrastructure/qmt_global.h index 3899eed807..d96df8d624 100644 --- a/src/libs/modelinglib/qmt/infrastructure/qmt_global.h +++ b/src/libs/modelinglib/qmt/infrastructure/qmt_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_GLOBAL_H -#define QMT_GLOBAL_H +#pragma once #include <QtCore/QtGlobal> @@ -33,6 +32,3 @@ #else # define QMT_EXPORT Q_DECL_IMPORT #endif - -#endif // QMT_GLOBAL_H - diff --git a/src/libs/modelinglib/qmt/infrastructure/qmtassert.h b/src/libs/modelinglib/qmt/infrastructure/qmtassert.h index 7580a044fb..c87076be25 100644 --- a/src/libs/modelinglib/qmt/infrastructure/qmtassert.h +++ b/src/libs/modelinglib/qmt/infrastructure/qmtassert.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_QMTASSERT_H -#define QMT_QMTASSERT_H +#pragma once #include "utils/qtcassert.h" @@ -32,5 +31,3 @@ #define QMT_CHECK(condition) QTC_CHECK(condition) // TODO implement logging of where and what #define QMT_CHECK_X(condition, where, what) QTC_CHECK(condition) - -#endif // QMT_QMTASSERT_H diff --git a/src/libs/modelinglib/qmt/infrastructure/uid.h b/src/libs/modelinglib/qmt/infrastructure/uid.h index 30b99a83a2..757f5c11b0 100644 --- a/src/libs/modelinglib/qmt/infrastructure/uid.h +++ b/src/libs/modelinglib/qmt/infrastructure/uid.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_UID_H -#define QMT_UID_H +#pragma once #include "qmt_global.h" @@ -87,5 +86,3 @@ inline QDataStream &operator>>(QDataStream &stream, Uid &uid) } // namespace qmt Q_DECLARE_METATYPE(qmt::Uid) - -#endif // QMT_UID_H diff --git a/src/libs/modelinglib/qmt/model/massociation.h b/src/libs/modelinglib/qmt/model/massociation.h index 1d4ebc8a21..82f6bdf0c6 100644 --- a/src/libs/modelinglib/qmt/model/massociation.h +++ b/src/libs/modelinglib/qmt/model/massociation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MASSOCIATION_H -#define QMT_MASSOCIATION_H +#pragma once #include "mrelation.h" #include "qmt/infrastructure/handle.h" @@ -95,5 +94,3 @@ private: }; } // namespace qmt - -#endif // QMT_MASSOCIATION_H diff --git a/src/libs/modelinglib/qmt/model/mcanvasdiagram.h b/src/libs/modelinglib/qmt/model/mcanvasdiagram.h index 7f54c9d2c8..303be48144 100644 --- a/src/libs/modelinglib/qmt/model/mcanvasdiagram.h +++ b/src/libs/modelinglib/qmt/model/mcanvasdiagram.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MCANVASDIAGRAM_H -#define QMT_MCANVASDIAGRAM_H +#pragma once #include "mdiagram.h" @@ -41,5 +40,3 @@ public: }; } // namespace qmt - -#endif // QMT_MCANVASDIAGRAM_H diff --git a/src/libs/modelinglib/qmt/model/mclass.h b/src/libs/modelinglib/qmt/model/mclass.h index a37b30b516..d026172685 100644 --- a/src/libs/modelinglib/qmt/model/mclass.h +++ b/src/libs/modelinglib/qmt/model/mclass.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MCLASS_H -#define QMT_MCLASS_H +#pragma once #include "mobject.h" #include "mclassmember.h" @@ -64,5 +63,3 @@ private: }; } // namespace qmt - -#endif // QMT_MCLASS_H diff --git a/src/libs/modelinglib/qmt/model/mclassmember.h b/src/libs/modelinglib/qmt/model/mclassmember.h index cdba8f5a5a..99acb8d2ae 100644 --- a/src/libs/modelinglib/qmt/model/mclassmember.h +++ b/src/libs/modelinglib/qmt/model/mclassmember.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MCLASSMEMBER_H -#define QMT_MCLASSMEMBER_H +#pragma once #include "qmt/infrastructure/uid.h" @@ -104,5 +103,3 @@ private: bool operator==(const MClassMember &lhs, const MClassMember &rhs); } // namespace qmt - -#endif // QMT_MCLASSMEMBER_H diff --git a/src/libs/modelinglib/qmt/model/mcomponent.h b/src/libs/modelinglib/qmt/model/mcomponent.h index 4fde25a218..b0580dde70 100644 --- a/src/libs/modelinglib/qmt/model/mcomponent.h +++ b/src/libs/modelinglib/qmt/model/mcomponent.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MCOMPONENT_H -#define QMT_MCOMPONENT_H +#pragma once #include "mobject.h" @@ -41,5 +40,3 @@ public: }; } // namespace qmt - -#endif // QMT_MCOMPONENT_H diff --git a/src/libs/modelinglib/qmt/model/mconstvisitor.h b/src/libs/modelinglib/qmt/model/mconstvisitor.h index 8bfd9c39fb..fcfa9665fc 100644 --- a/src/libs/modelinglib/qmt/model/mconstvisitor.h +++ b/src/libs/modelinglib/qmt/model/mconstvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MCONSTVISITOR_H -#define QMT_MCONSTVISITOR_H +#pragma once namespace qmt { @@ -63,5 +62,3 @@ public: }; } // namespace qmt - -#endif // QMT_MCONSTVISITOR_H diff --git a/src/libs/modelinglib/qmt/model/mdependency.h b/src/libs/modelinglib/qmt/model/mdependency.h index 27acfe696d..f2754c4f9c 100644 --- a/src/libs/modelinglib/qmt/model/mdependency.h +++ b/src/libs/modelinglib/qmt/model/mdependency.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MDEPENDENCY_H -#define QMT_MDEPENDENCY_H +#pragma once #include "mrelation.h" @@ -62,5 +61,3 @@ private: }; } // namespace qmt - -#endif // QMT_MDEPENDENCY_H diff --git a/src/libs/modelinglib/qmt/model/mdiagram.h b/src/libs/modelinglib/qmt/model/mdiagram.h index 47ea04abf9..41f54cfec2 100644 --- a/src/libs/modelinglib/qmt/model/mdiagram.h +++ b/src/libs/modelinglib/qmt/model/mdiagram.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MDIAGRAM_H -#define QMT_MDIAGRAM_H +#pragma once #include "mobject.h" @@ -69,5 +68,3 @@ private: }; } // namespace qmt - -#endif // QMT_MDIAGRAM_H diff --git a/src/libs/modelinglib/qmt/model/melement.h b/src/libs/modelinglib/qmt/model/melement.h index 864bf3464e..b83b5bd980 100644 --- a/src/libs/modelinglib/qmt/model/melement.h +++ b/src/libs/modelinglib/qmt/model/melement.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MELEMENT_H -#define QMT_MELEMENT_H +#pragma once #include "qmt/infrastructure/uid.h" @@ -91,5 +90,3 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(MElement::Flags) } // namespace qmt - -#endif // QMT_MELEMENT_H diff --git a/src/libs/modelinglib/qmt/model/minheritance.h b/src/libs/modelinglib/qmt/model/minheritance.h index e1be05e557..2154d4f4de 100644 --- a/src/libs/modelinglib/qmt/model/minheritance.h +++ b/src/libs/modelinglib/qmt/model/minheritance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MINHERITANCE_H -#define QMT_MINHERITANCE_H +#pragma once #include "mrelation.h" #include "qmt/infrastructure/handle.h" @@ -50,5 +49,3 @@ public: }; } // namespace qmt - -#endif // QMT_MINHERITANCE_H diff --git a/src/libs/modelinglib/qmt/model/mitem.h b/src/libs/modelinglib/qmt/model/mitem.h index 940c4fadfb..ebedea5efe 100644 --- a/src/libs/modelinglib/qmt/model/mitem.h +++ b/src/libs/modelinglib/qmt/model/mitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MITEM_H -#define QMT_MITEM_H +#pragma once #include "mobject.h" @@ -53,5 +52,3 @@ private: }; } // namespace qmt - -#endif // QMT_MITEM_H diff --git a/src/libs/modelinglib/qmt/model/mobject.h b/src/libs/modelinglib/qmt/model/mobject.h index e3478b9e7b..62e3d8b569 100644 --- a/src/libs/modelinglib/qmt/model/mobject.h +++ b/src/libs/modelinglib/qmt/model/mobject.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MOBJECT_H -#define QMT_MOBJECT_H +#pragma once #include "melement.h" #include "qmt/infrastructure/handles.h" @@ -76,5 +75,3 @@ private: }; } // namespace qmt - -#endif // QMT_MOBJECT_H diff --git a/src/libs/modelinglib/qmt/model/mpackage.h b/src/libs/modelinglib/qmt/model/mpackage.h index 721231a6de..78bf459936 100644 --- a/src/libs/modelinglib/qmt/model/mpackage.h +++ b/src/libs/modelinglib/qmt/model/mpackage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MPACKAGE_H -#define QMT_MPACKAGE_H +#pragma once #include "mobject.h" #include "qmt/infrastructure/handles.h" @@ -42,5 +41,3 @@ public: }; } // namespace qmt - -#endif // QMT_MPACKAGE_H diff --git a/src/libs/modelinglib/qmt/model/mrelation.h b/src/libs/modelinglib/qmt/model/mrelation.h index 3d7fc504ee..85f6cee6df 100644 --- a/src/libs/modelinglib/qmt/model/mrelation.h +++ b/src/libs/modelinglib/qmt/model/mrelation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MRELATION_H -#define QMT_MRELATION_H +#pragma once #include "melement.h" @@ -60,5 +59,3 @@ private: }; } // namespace qmt - -#endif // QMT_MRELATION_H diff --git a/src/libs/modelinglib/qmt/model/msourceexpansion.h b/src/libs/modelinglib/qmt/model/msourceexpansion.h index 049da96ef7..eb7c1bc3a5 100644 --- a/src/libs/modelinglib/qmt/model/msourceexpansion.h +++ b/src/libs/modelinglib/qmt/model/msourceexpansion.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MSOURCEEXPANSION_H -#define QMT_MSOURCEEXPANSION_H +#pragma once #include "melement.h" @@ -52,5 +51,3 @@ private: }; } // namespace qmt - -#endif // QMT_MSOURCEEXPANSION_H diff --git a/src/libs/modelinglib/qmt/model/mvisitor.h b/src/libs/modelinglib/qmt/model/mvisitor.h index 4b034bef38..bce52be8d0 100644 --- a/src/libs/modelinglib/qmt/model/mvisitor.h +++ b/src/libs/modelinglib/qmt/model/mvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MVISITOR_H -#define QMT_MVISITOR_H +#pragma once namespace qmt { @@ -63,5 +62,3 @@ public: }; } // namespace qmt - -#endif // QMT_MVISITOR_H diff --git a/src/libs/modelinglib/qmt/model_controller/mchildrenvisitor.h b/src/libs/modelinglib/qmt/model_controller/mchildrenvisitor.h index 79430540fa..406febde8e 100644 --- a/src/libs/modelinglib/qmt/model_controller/mchildrenvisitor.h +++ b/src/libs/modelinglib/qmt/model_controller/mchildrenvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MCHILDRENVISITOR_H -#define QMT_MCHILDRENVISITOR_H +#pragma once #include "qmt/model/mvisitor.h" #include "qmt/infrastructure/qmt_global.h" @@ -49,5 +48,3 @@ public: }; } // namespace qmt - -#endif // QMT_MCHILDRENVISITOR_H diff --git a/src/libs/modelinglib/qmt/model_controller/mclonevisitor.h b/src/libs/modelinglib/qmt/model_controller/mclonevisitor.h index 20b916f5a7..4d97acdd4f 100644 --- a/src/libs/modelinglib/qmt/model_controller/mclonevisitor.h +++ b/src/libs/modelinglib/qmt/model_controller/mclonevisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_CLONEVISITOR_H -#define QMT_CLONEVISITOR_H +#pragma once #include "qmt/model/mconstvisitor.h" #include "qmt/infrastructure/qmt_global.h" @@ -82,5 +81,3 @@ private: }; } // namespace qmt - -#endif // QMT_CLONEVISITOR_H diff --git a/src/libs/modelinglib/qmt/model_controller/mcontainer.h b/src/libs/modelinglib/qmt/model_controller/mcontainer.h index 1d70ba9980..22131f84d4 100644 --- a/src/libs/modelinglib/qmt/model_controller/mcontainer.h +++ b/src/libs/modelinglib/qmt/model_controller/mcontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MCONTAINER_H -#define QMT_MCONTAINER_H +#pragma once #include "qmt/controller/container.h" #include "qmt/model/melement.h" @@ -36,5 +35,3 @@ class QMT_EXPORT MContainer : public Container<MElement> }; } // namespace qmt - -#endif // QMT_MCONTAINER_H diff --git a/src/libs/modelinglib/qmt/model_controller/mflatassignmentvisitor.h b/src/libs/modelinglib/qmt/model_controller/mflatassignmentvisitor.h index 660d7cdd7f..49d696fd92 100644 --- a/src/libs/modelinglib/qmt/model_controller/mflatassignmentvisitor.h +++ b/src/libs/modelinglib/qmt/model_controller/mflatassignmentvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MFLATASSIGNMENTVISITOR_H -#define QMT_MFLATASSIGNMENTVISITOR_H +#pragma once #include "qmt/model/mconstvisitor.h" #include "qmt/infrastructure/qmt_global.h" @@ -56,5 +55,3 @@ private: }; } // namespace qmt - -#endif // QMT_MFLATASSIGNMENTVISITOR_H diff --git a/src/libs/modelinglib/qmt/model_controller/modelcontroller.h b/src/libs/modelinglib/qmt/model_controller/modelcontroller.h index 8b9f0fdf86..ccc53078a5 100644 --- a/src/libs/modelinglib/qmt/model_controller/modelcontroller.h +++ b/src/libs/modelinglib/qmt/model_controller/modelcontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MODELCONTROLLER_H -#define QMT_MODELCONTROLLER_H +#pragma once #include "qmt/infrastructure/uid.h" @@ -162,5 +161,3 @@ private: }; } // namespace qmt - -#endif // QMT_MODELCONTROLLER_H diff --git a/src/libs/modelinglib/qmt/model_controller/mreferences.h b/src/libs/modelinglib/qmt/model_controller/mreferences.h index 9a3e8e4986..ad61d1e181 100644 --- a/src/libs/modelinglib/qmt/model_controller/mreferences.h +++ b/src/libs/modelinglib/qmt/model_controller/mreferences.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MREFERENCES_H -#define QMT_MREFERENCES_H +#pragma once #include "qmt/controller/references.h" #include "qmt/infrastructure/qmt_global.h" @@ -38,5 +37,3 @@ class QMT_EXPORT MReferences : public References<MElement> }; } // namespace qmt - -#endif // QMT_MREFERENCES_H diff --git a/src/libs/modelinglib/qmt/model_controller/mselection.h b/src/libs/modelinglib/qmt/model_controller/mselection.h index f827023d10..3d0ea069f2 100644 --- a/src/libs/modelinglib/qmt/model_controller/mselection.h +++ b/src/libs/modelinglib/qmt/model_controller/mselection.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MSELECTION_H -#define QMT_MSELECTION_H +#pragma once #include "qmt/controller/selection.h" @@ -35,5 +34,3 @@ class QMT_EXPORT MSelection : public Selection }; } // namespace qmt - -#endif // QMT_MSELECTION_H diff --git a/src/libs/modelinglib/qmt/model_controller/mvoidvisitor.h b/src/libs/modelinglib/qmt/model_controller/mvoidvisitor.h index a7e75d5329..34404adbb2 100644 --- a/src/libs/modelinglib/qmt/model_controller/mvoidvisitor.h +++ b/src/libs/modelinglib/qmt/model_controller/mvoidvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MVOIDVISITOR_H -#define QMT_MVOIDVISITOR_H +#pragma once #include "qmt/model/mvisitor.h" #include "qmt/model/mconstvisitor.h" @@ -67,5 +66,3 @@ public: }; } // namespace qmt - -#endif // QMT_MVOIDVISITOR_H diff --git a/src/libs/modelinglib/qmt/model_ui/modeltreeviewinterface.h b/src/libs/modelinglib/qmt/model_ui/modeltreeviewinterface.h index 9bbf44d8dd..8e781f64db 100644 --- a/src/libs/modelinglib/qmt/model_ui/modeltreeviewinterface.h +++ b/src/libs/modelinglib/qmt/model_ui/modeltreeviewinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MODELTREEVIEWINTERFACE_H -#define QMT_MODELTREEVIEWINTERFACE_H +#pragma once #include <QList> @@ -44,5 +43,3 @@ public: }; } // namespace qmt - -#endif // QMT_MODELTREEVIEWINTERFACE_H diff --git a/src/libs/modelinglib/qmt/model_ui/sortedtreemodel.h b/src/libs/modelinglib/qmt/model_ui/sortedtreemodel.h index ddef6d11e2..fed3721768 100644 --- a/src/libs/modelinglib/qmt/model_ui/sortedtreemodel.h +++ b/src/libs/modelinglib/qmt/model_ui/sortedtreemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_SORTEDTREEMODEL_H -#define QMT_SORTEDTREEMODEL_H +#pragma once #include <QSortFilterProxyModel> #include "qmt/infrastructure/qmt_global.h" @@ -61,5 +60,3 @@ private: }; } // namespace qmt - -#endif // QMT_SORTEDTREEMODEL_H diff --git a/src/libs/modelinglib/qmt/model_ui/stereotypescontroller.h b/src/libs/modelinglib/qmt/model_ui/stereotypescontroller.h index 51e47ee7bc..e7034640df 100644 --- a/src/libs/modelinglib/qmt/model_ui/stereotypescontroller.h +++ b/src/libs/modelinglib/qmt/model_ui/stereotypescontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_STEREOTYPESCONTROLLER_H -#define QMT_STEREOTYPESCONTROLLER_H +#pragma once #include <QObject> #include "qmt/infrastructure/qmt_global.h" @@ -51,5 +50,3 @@ public: }; } // namespace qmt - -#endif // QMT_STEREOTYPESCONTROLLER_H diff --git a/src/libs/modelinglib/qmt/model_ui/treemodel.h b/src/libs/modelinglib/qmt/model_ui/treemodel.h index 0c987424e1..877a4a0fd5 100644 --- a/src/libs/modelinglib/qmt/model_ui/treemodel.h +++ b/src/libs/modelinglib/qmt/model_ui/treemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_TREEMODEL_H -#define QMT_TREEMODEL_H +#pragma once #include <QStandardItemModel> #include "qmt/infrastructure/qmt_global.h" @@ -145,5 +144,3 @@ private: }; } // namespace qmt - -#endif // QMT_TREEMODEL_H diff --git a/src/libs/modelinglib/qmt/model_ui/treemodelmanager.h b/src/libs/modelinglib/qmt/model_ui/treemodelmanager.h index aefa738366..dfb604cd98 100644 --- a/src/libs/modelinglib/qmt/model_ui/treemodelmanager.h +++ b/src/libs/modelinglib/qmt/model_ui/treemodelmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_TREEMODELMANAGER_H -#define QMT_TREEMODELMANAGER_H +#pragma once #include <QObject> #include "qmt/infrastructure/qmt_global.h" @@ -61,5 +60,3 @@ private: }; } // namespace qmt - -#endif // QMT_TREEMODELMANAGER_H diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/classmembersedit.h b/src/libs/modelinglib/qmt/model_widgets_ui/classmembersedit.h index 2fe340e72f..ca23702742 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/classmembersedit.h +++ b/src/libs/modelinglib/qmt/model_widgets_ui/classmembersedit.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_CLASSMEMBERSEDIT_H -#define QMT_CLASSMEMBERSEDIT_H +#pragma once #include <QPlainTextEdit> #include "qmt/infrastructure/qmt_global.h" @@ -63,5 +62,3 @@ private: }; } // namespace qmt - -#endif // QMT_CLASSMEMBERSEDIT_H diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.h b/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.h index 094b6a1118..bb910bd635 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.h +++ b/src/libs/modelinglib/qmt/model_widgets_ui/modeltreeview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MODELTREEVIEW_H -#define QMT_MODELTREEVIEW_H +#pragma once #include <QTreeView> #include "qmt/infrastructure/qmt_global.h" @@ -75,5 +74,3 @@ private: }; } // namespace qmt - -#endif // QMT_MODELTREEVIEW_H diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/palettebox.h b/src/libs/modelinglib/qmt/model_widgets_ui/palettebox.h index b0fe0ed8a0..501b7ea758 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/palettebox.h +++ b/src/libs/modelinglib/qmt/model_widgets_ui/palettebox.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_PALETTEBOX_H -#define QMT_PALETTEBOX_H +#pragma once #include <QWidget> #include "qmt/infrastructure/qmt_global.h" @@ -67,5 +66,3 @@ private: }; } // namespace qmt - -#endif // QMT_PALETTEBOX_H diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesview.h b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesview.h index a4ea9b4d07..39c1f817a1 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesview.h +++ b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_PROPERTIESVIEW_H -#define QMT_PROPERTIESVIEW_H +#pragma once #include <QObject> @@ -130,5 +129,3 @@ private: }; } // namespace qmt - -#endif // QMT_PROPERTIESVIEW_H diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.h b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.h index b5daf798de..a3fa23fb0d 100644 --- a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.h +++ b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_PROPERTIESVIEWMVIEW_H -#define QMT_PROPERTIESVIEWMVIEW_H +#pragma once #include <QObject> @@ -248,5 +247,3 @@ protected: }; } // namespace qmt - -#endif // QMT_PROPERTIESVIEWMVIEW_H diff --git a/src/libs/modelinglib/qmt/project/project.h b/src/libs/modelinglib/qmt/project/project.h index 70dd4f6c4a..b135769d87 100644 --- a/src/libs/modelinglib/qmt/project/project.h +++ b/src/libs/modelinglib/qmt/project/project.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_PROJECT_H -#define QMT_PROJECT_H +#pragma once #include "qmt/infrastructure/uid.h" @@ -58,5 +57,3 @@ private: }; } // namespace qmt - -#endif // QMT_PROJECT_H diff --git a/src/libs/modelinglib/qmt/project_controller/projectcontroller.h b/src/libs/modelinglib/qmt/project_controller/projectcontroller.h index 26db1db74f..73daf2a2ac 100644 --- a/src/libs/modelinglib/qmt/project_controller/projectcontroller.h +++ b/src/libs/modelinglib/qmt/project_controller/projectcontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_PROJECTCONTROLLER_H -#define QMT_PROJECTCONTROLLER_H +#pragma once #include "qmt/infrastructure/exceptions.h" #include "qmt/infrastructure/qmt_global.h" @@ -78,5 +77,3 @@ private: }; } // namespace qmt - -#endif // PROJECTCONTROLLER_H diff --git a/src/libs/modelinglib/qmt/serializer/diagramserializer.h b/src/libs/modelinglib/qmt/serializer/diagramserializer.h index 60ac5619a6..85deb24ea2 100644 --- a/src/libs/modelinglib/qmt/serializer/diagramserializer.h +++ b/src/libs/modelinglib/qmt/serializer/diagramserializer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DIAGRAMSERIALIZER_H -#define QMT_DIAGRAMSERIALIZER_H +#pragma once #include "qmt/diagram/dannotation.h" #include "qmt/diagram/dobject.h" @@ -41,5 +40,3 @@ QARK_SERIALIZE_ENUM(qmt::DClass::TemplateDisplay) QARK_SERIALIZE_ENUM(qmt::DAnnotation::VisualRole) } // namespace qark - -#endif // QMT_DIAGRAMSERIALIZER_H diff --git a/src/libs/modelinglib/qmt/serializer/infrastructureserializer.h b/src/libs/modelinglib/qmt/serializer/infrastructureserializer.h index ff20644f26..1814fb6a9d 100644 --- a/src/libs/modelinglib/qmt/serializer/infrastructureserializer.h +++ b/src/libs/modelinglib/qmt/serializer/infrastructureserializer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_INFRASTRUCTURESERIALIZER_H -#define QMT_INFRASTRUCTURESERIALIZER_H +#pragma once #include "qmt/infrastructure/handle.h" #include "qmt/infrastructure/handles.h" @@ -75,5 +74,3 @@ inline void serialize(Archive &archive, qmt::Handles<T> &handles) } } // namespace qark - -#endif // QMT_INFRASTRUCTURESERIALIZER_H diff --git a/src/libs/modelinglib/qmt/serializer/modelserializer.h b/src/libs/modelinglib/qmt/serializer/modelserializer.h index 8d7d9524c4..58e96768a9 100644 --- a/src/libs/modelinglib/qmt/serializer/modelserializer.h +++ b/src/libs/modelinglib/qmt/serializer/modelserializer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_MODELSERIALIZER_H -#define QMT_MODELSERIALIZER_H +#pragma once #include "qmt/model/melement.h" #include "qmt/model/mclassmember.h" @@ -42,5 +41,3 @@ QARK_SERIALIZE_ENUM(qmt::MDependency::Direction) QARK_SERIALIZE_ENUM(qmt::MAssociationEnd::Kind) } // namespace qark - -#endif // QMT_MODELSERIALIZER_H diff --git a/src/libs/modelinglib/qmt/serializer/projectserializer.h b/src/libs/modelinglib/qmt/serializer/projectserializer.h index b20180af98..4229b776bf 100644 --- a/src/libs/modelinglib/qmt/serializer/projectserializer.h +++ b/src/libs/modelinglib/qmt/serializer/projectserializer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_PROJECTSERIALIZER_H -#define QMT_PROJECTSERIALIZER_H +#pragma once #include "qmt/infrastructure/qmt_global.h" @@ -54,5 +53,3 @@ private: }; } // namespace qmt - -#endif // QMT_PROJECTSERIALIZER_H diff --git a/src/libs/modelinglib/qmt/stereotype/iconshape.h b/src/libs/modelinglib/qmt/stereotype/iconshape.h index 49b7a27bba..0efea797ff 100644 --- a/src/libs/modelinglib/qmt/stereotype/iconshape.h +++ b/src/libs/modelinglib/qmt/stereotype/iconshape.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_ICONSHAPE_H -#define QMT_ICONSHAPE_H +#pragma once #include "qmt/infrastructure/qmt_global.h" #include <QSizeF> @@ -72,5 +71,3 @@ private: }; } // namespace qmt - -#endif // QMT_ICONSHAPE_H diff --git a/src/libs/modelinglib/qmt/stereotype/shape.h b/src/libs/modelinglib/qmt/stereotype/shape.h index 9cca553a33..467266b961 100644 --- a/src/libs/modelinglib/qmt/stereotype/shape.h +++ b/src/libs/modelinglib/qmt/stereotype/shape.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_SHAPE_H -#define QMT_SHAPE_H +#pragma once namespace qmt { @@ -42,5 +41,3 @@ public: }; } // namespace qmt - -#endif // QMT_SHAPE_H diff --git a/src/libs/modelinglib/qmt/stereotype/shapepaintvisitor.h b/src/libs/modelinglib/qmt/stereotype/shapepaintvisitor.h index 18552d85ae..67a90ee6ac 100644 --- a/src/libs/modelinglib/qmt/stereotype/shapepaintvisitor.h +++ b/src/libs/modelinglib/qmt/stereotype/shapepaintvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_SHAPEPAINTVISITOR_H -#define QMT_SHAPEPAINTVISITOR_H +#pragma once #include "shapevisitor.h" #include "qmt/infrastructure/qmt_global.h" @@ -82,5 +81,3 @@ private: }; } // namespace qmt - -#endif // QMT_SHAPEPAINTVISITOR_H diff --git a/src/libs/modelinglib/qmt/stereotype/shapes.h b/src/libs/modelinglib/qmt/stereotype/shapes.h index c35bf95b27..88f4c6e392 100644 --- a/src/libs/modelinglib/qmt/stereotype/shapes.h +++ b/src/libs/modelinglib/qmt/stereotype/shapes.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_SHAPES_H -#define QMT_SHAPES_H +#pragma once #include "shape.h" #include "qmt/infrastructure/qmt_global.h" @@ -231,5 +230,3 @@ private: }; } // namespace qmt - -#endif // QMT_SHAPES_H diff --git a/src/libs/modelinglib/qmt/stereotype/shapevalue.h b/src/libs/modelinglib/qmt/stereotype/shapevalue.h index cb3f283a7c..4b2f09a1dc 100644 --- a/src/libs/modelinglib/qmt/stereotype/shapevalue.h +++ b/src/libs/modelinglib/qmt/stereotype/shapevalue.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_SHAPEVALUE_H -#define QMT_SHAPEVALUE_H +#pragma once #include "qmt/infrastructure/qmt_global.h" @@ -141,5 +140,3 @@ private: }; } // namespace qmt - -#endif // QMT_SHAPEVALUE_H diff --git a/src/libs/modelinglib/qmt/stereotype/shapevisitor.h b/src/libs/modelinglib/qmt/stereotype/shapevisitor.h index f068ddeb5b..6adbba12ba 100644 --- a/src/libs/modelinglib/qmt/stereotype/shapevisitor.h +++ b/src/libs/modelinglib/qmt/stereotype/shapevisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_SHAPEVISITOR_H -#define QMT_SHAPEVISITOR_H +#pragma once namespace qmt { @@ -65,5 +64,3 @@ public: }; } // namespace qmt - -#endif // QMT_SHAPEVISITOR_H diff --git a/src/libs/modelinglib/qmt/stereotype/stereotypecontroller.h b/src/libs/modelinglib/qmt/stereotype/stereotypecontroller.h index f833499e2b..990c2ae8b4 100644 --- a/src/libs/modelinglib/qmt/stereotype/stereotypecontroller.h +++ b/src/libs/modelinglib/qmt/stereotype/stereotypecontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_STEREOTYPECONTROLLER_H -#define QMT_STEREOTYPECONTROLLER_H +#pragma once #include <QObject> @@ -67,5 +66,3 @@ private: }; } // namespace qmt - -#endif // QMT_STEREOTYPECONTROLLER_H diff --git a/src/libs/modelinglib/qmt/stereotype/stereotypeicon.h b/src/libs/modelinglib/qmt/stereotype/stereotypeicon.h index 4b0eb0d0e1..354bd6f9ce 100644 --- a/src/libs/modelinglib/qmt/stereotype/stereotypeicon.h +++ b/src/libs/modelinglib/qmt/stereotype/stereotypeicon.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_STEREOTYPEICON_H -#define QMT_STEREOTYPEICON_H +#pragma once #include "iconshape.h" @@ -117,5 +116,3 @@ private: }; } // namespace qmt - -#endif // QMT_STEREOTYPEICON_H diff --git a/src/libs/modelinglib/qmt/stereotype/toolbar.h b/src/libs/modelinglib/qmt/stereotype/toolbar.h index f5af53b31b..b7422f408d 100644 --- a/src/libs/modelinglib/qmt/stereotype/toolbar.h +++ b/src/libs/modelinglib/qmt/stereotype/toolbar.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_TOOLBAR_H -#define QMT_TOOLBAR_H +#pragma once #include "qmt/infrastructure/qmt_global.h" @@ -80,5 +79,3 @@ private: }; } // namespace qmt - -#endif // QMT_TOOLBAR_H diff --git a/src/libs/modelinglib/qmt/style/defaultstyle.h b/src/libs/modelinglib/qmt/style/defaultstyle.h index 851a0c4191..89ec15fdaf 100644 --- a/src/libs/modelinglib/qmt/style/defaultstyle.h +++ b/src/libs/modelinglib/qmt/style/defaultstyle.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DEFAULTSTYLE_H -#define QMT_DEFAULTSTYLE_H +#pragma once #include "style.h" @@ -38,5 +37,3 @@ public: }; } // namespace qmt - -#endif // QMT_DEFAULTSTYLE_H diff --git a/src/libs/modelinglib/qmt/style/defaultstyleengine.h b/src/libs/modelinglib/qmt/style/defaultstyleengine.h index 3fe0933edc..792b9247a0 100644 --- a/src/libs/modelinglib/qmt/style/defaultstyleengine.h +++ b/src/libs/modelinglib/qmt/style/defaultstyleengine.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DEFAULTSTYLEENGINE_H -#define QMT_DEFAULTSTYLEENGINE_H +#pragma once #include "styleengine.h" @@ -91,5 +90,3 @@ private: }; } // namespace qmt - -#endif // QMT_DEFAULTSTYLEENGINE_H diff --git a/src/libs/modelinglib/qmt/style/objectvisuals.h b/src/libs/modelinglib/qmt/style/objectvisuals.h index b53e570675..715252befc 100644 --- a/src/libs/modelinglib/qmt/style/objectvisuals.h +++ b/src/libs/modelinglib/qmt/style/objectvisuals.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_OBJECTVISUALS_H -#define QMT_OBJECTVISUALS_H +#pragma once #include "qmt/diagram/dobject.h" @@ -64,5 +63,3 @@ bool operator==(const ObjectVisuals &lhs, const ObjectVisuals &rhs); uint qHash(const ObjectVisuals &objectVisuals); } // namespace qmt - -#endif // QMT_OBJECTVISUALS_H diff --git a/src/libs/modelinglib/qmt/style/relationstarterstyle.h b/src/libs/modelinglib/qmt/style/relationstarterstyle.h index fb39eda285..ed745c5776 100644 --- a/src/libs/modelinglib/qmt/style/relationstarterstyle.h +++ b/src/libs/modelinglib/qmt/style/relationstarterstyle.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_RELATIONSTARTERSTYLE_H -#define QMT_RELATIONSTARTERSTYLE_H +#pragma once #include "style.h" @@ -38,5 +37,3 @@ public: }; } // namespace qmt - -#endif // QMT_RELATIONSTARTERSTYLE_H diff --git a/src/libs/modelinglib/qmt/style/style.h b/src/libs/modelinglib/qmt/style/style.h index 8d67d8751e..9add43d26e 100644 --- a/src/libs/modelinglib/qmt/style/style.h +++ b/src/libs/modelinglib/qmt/style/style.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_STYLE_H -#define QMT_STYLE_H +#pragma once #include "qmt/infrastructure/qmt_global.h" @@ -83,5 +82,3 @@ private: }; } // namespace qmt - -#endif // QMT_STYLE_H diff --git a/src/libs/modelinglib/qmt/style/stylecontroller.h b/src/libs/modelinglib/qmt/style/stylecontroller.h index d8525374e8..344409e941 100644 --- a/src/libs/modelinglib/qmt/style/stylecontroller.h +++ b/src/libs/modelinglib/qmt/style/stylecontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_STYLECONTROLLER_H -#define QMT_STYLECONTROLLER_H +#pragma once #include <QObject> @@ -71,5 +70,3 @@ private: }; } // namespace qmt - -#endif // QMT_STYLECONTROLLER_H diff --git a/src/libs/modelinglib/qmt/style/styledobject.h b/src/libs/modelinglib/qmt/style/styledobject.h index 510729a3a3..26687065b7 100644 --- a/src/libs/modelinglib/qmt/style/styledobject.h +++ b/src/libs/modelinglib/qmt/style/styledobject.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_STYLEDOBJECT_H -#define QMT_STYLEDOBJECT_H +#pragma once #include "objectvisuals.h" @@ -52,5 +51,3 @@ private: }; } // namespace qmt - -#endif // QMT_ STYLEDOBJECT_H diff --git a/src/libs/modelinglib/qmt/style/styledrelation.h b/src/libs/modelinglib/qmt/style/styledrelation.h index 53a28d98ab..6811f3e3da 100644 --- a/src/libs/modelinglib/qmt/style/styledrelation.h +++ b/src/libs/modelinglib/qmt/style/styledrelation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_STYLEDRELATION_H -#define QMT_STYLEDRELATION_H +#pragma once #include "qmt/infrastructure/qmt_global.h" @@ -50,5 +49,3 @@ private: }; } // namespace qmt - -#endif // QMT_STYLEDRELATION_H diff --git a/src/libs/modelinglib/qmt/style/styleengine.h b/src/libs/modelinglib/qmt/style/styleengine.h index cbd70f14d6..2da52b429a 100644 --- a/src/libs/modelinglib/qmt/style/styleengine.h +++ b/src/libs/modelinglib/qmt/style/styleengine.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_STYLEENGINE_H -#define QMT_STYLEENGINE_H +#pragma once #include "qmt/infrastructure/qmt_global.h" @@ -81,5 +80,3 @@ public: }; } // namespace qmt - -#endif // QMT_STYLEENGINE_H diff --git a/src/libs/modelinglib/qmt/tasks/alignonrastervisitor.h b/src/libs/modelinglib/qmt/tasks/alignonrastervisitor.h index b7e760e2f0..994cab48c3 100644 --- a/src/libs/modelinglib/qmt/tasks/alignonrastervisitor.h +++ b/src/libs/modelinglib/qmt/tasks/alignonrastervisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_ALIGNONRASTERVISITOR_H -#define QMT_ALIGNONRASTERVISITOR_H +#pragma once #include "qmt/diagram/dvisitor.h" #include "qmt/infrastructure/qmt_global.h" @@ -66,5 +65,3 @@ private: }; } // namespace qmt - -#endif // QMT_ALIGNONRASTERVISITOR_H diff --git a/src/libs/modelinglib/qmt/tasks/diagramscenecontroller.h b/src/libs/modelinglib/qmt/tasks/diagramscenecontroller.h index cc678738a2..967e02f51c 100644 --- a/src/libs/modelinglib/qmt/tasks/diagramscenecontroller.h +++ b/src/libs/modelinglib/qmt/tasks/diagramscenecontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_DIAGRAMSCENECONTROLLER_H -#define QMT_DIAGRAMSCENECONTROLLER_H +#pragma once #include <QObject> #include "qmt/infrastructure/qmt_global.h" @@ -133,5 +132,3 @@ private: }; } // namespace qmt - -#endif // QMT_DIAGRAMSCENECONTROLLER_H diff --git a/src/libs/modelinglib/qmt/tasks/finddiagramvisitor.h b/src/libs/modelinglib/qmt/tasks/finddiagramvisitor.h index 1b14b29015..bd664629f1 100644 --- a/src/libs/modelinglib/qmt/tasks/finddiagramvisitor.h +++ b/src/libs/modelinglib/qmt/tasks/finddiagramvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_FINDDIAGRAMVISITOR_H -#define QMT_FINDDIAGRAMVISITOR_H +#pragma once #include "qmt/model_controller/mvoidvisitor.h" @@ -46,5 +45,3 @@ private: }; } // namespace qmt - -#endif // QMT_FINDDIAGRAMVISITOR_H diff --git a/src/libs/modelinglib/qmt/tasks/findrootdiagramvisitor.h b/src/libs/modelinglib/qmt/tasks/findrootdiagramvisitor.h index 422376d27f..a520ef6e34 100644 --- a/src/libs/modelinglib/qmt/tasks/findrootdiagramvisitor.h +++ b/src/libs/modelinglib/qmt/tasks/findrootdiagramvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_FINDROOTDIAGRAMVISITOR_H -#define QMT_FINDROOTDIAGRAMVISITOR_H +#pragma once #include "qmt/model_controller/mvoidvisitor.h" @@ -47,5 +46,3 @@ private: }; } // namespace qmt - -#endif // QMT_FINDROOTDIAGRAMVISITOR_H diff --git a/src/libs/modelinglib/qmt/tasks/ielementtasks.h b/src/libs/modelinglib/qmt/tasks/ielementtasks.h index f7837b7df8..3120474ea6 100644 --- a/src/libs/modelinglib/qmt/tasks/ielementtasks.h +++ b/src/libs/modelinglib/qmt/tasks/ielementtasks.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_IELEMENTTASKS_H -#define QMT_IELEMENTTASKS_H +#pragma once namespace qmt { @@ -77,5 +76,3 @@ public: }; } // namespace qmt - -#endif // QMT_IELEMENTTASKS_H diff --git a/src/libs/modelinglib/qmt/tasks/isceneinspector.h b/src/libs/modelinglib/qmt/tasks/isceneinspector.h index d830f1ee7e..626bf06f66 100644 --- a/src/libs/modelinglib/qmt/tasks/isceneinspector.h +++ b/src/libs/modelinglib/qmt/tasks/isceneinspector.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_ISCENEINSPECTOR_H -#define QMT_ISCENEINSPECTOR_H +#pragma once #include <QtGlobal> @@ -51,5 +50,3 @@ public: }; } // namespace qmt - -#endif // QMT_ISCENEINSPECTOR_H diff --git a/src/libs/modelinglib/qmt/tasks/voidelementtasks.h b/src/libs/modelinglib/qmt/tasks/voidelementtasks.h index 92a576edec..4ed1dd19b6 100644 --- a/src/libs/modelinglib/qmt/tasks/voidelementtasks.h +++ b/src/libs/modelinglib/qmt/tasks/voidelementtasks.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMT_VOIDELEMENTTASKS_H -#define QMT_VOIDELEMENTTASKS_H +#pragma once #include "ielementtasks.h" #include "qmt/infrastructure/qmt_global.h" @@ -76,5 +75,3 @@ public: }; } // namespace qmt - -#endif // QMT_VOIDELEMENTTASKS_H diff --git a/src/libs/modelinglib/qstringparser/qstringparser.h b/src/libs/modelinglib/qstringparser/qstringparser.h index 43dae740ec..8735e9b60b 100644 --- a/src/libs/modelinglib/qstringparser/qstringparser.h +++ b/src/libs/modelinglib/qstringparser/qstringparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QSTRINGPARSER_H -#define QSTRINGPARSER_H +#pragma once #include <QString> #include <QList> @@ -138,5 +137,3 @@ public: private: const QString m_source; }; - -#endif // QSTRINGPARSER_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/access.h b/src/libs/modelinglib/qtserialization/inc/qark/access.h index bc12e32af8..276e6a275e 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/access.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/access.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_ACCESS_H -#define QARK_ACCESS_H +#pragma once namespace qark { @@ -106,5 +105,3 @@ void serializeHelper(Archive &archive, T &t) #define QARK_ACCESS_SPECIALIZE(INARCHIVE, OUTARCHIVE, TYPE) \ template class Access<INARCHIVE, TYPE>; \ template class Access<OUTARCHIVE, TYPE>; - -#endif // QARK_ACCESS_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/archivebasics.h b/src/libs/modelinglib/qtserialization/inc/qark/archivebasics.h index 4f9ad079d9..591954d20f 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/archivebasics.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/archivebasics.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_ARCHIVEBASICS_H -#define QARK_ARCHIVEBASICS_H +#pragma once #include "flag.h" @@ -84,5 +83,3 @@ private: }; } // namespace qark - -#endif // QARK_ARCHIVEBASICS_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/attribute.h b/src/libs/modelinglib/qtserialization/inc/qark/attribute.h index da1203ad53..7070964d6f 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/attribute.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/attribute.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_ATTRIBUTE_H -#define QARK_ATTRIBUTE_H +#pragma once #include "parameters.h" @@ -368,5 +367,3 @@ GetSetFuncAttr<U, T, V> attr(const QString &qualifiedName, U &u, T (*func)(const } } // namespace qark - -#endif // QARK_ATTRIBUTE_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/baseclass.h b/src/libs/modelinglib/qtserialization/inc/qark/baseclass.h index 99776515a3..4fae0f2e7a 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/baseclass.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/baseclass.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_BASECLASS_H -#define QARK_BASECLASS_H +#pragma once #include "typeregistry.h" #include "parameters.h" @@ -99,5 +98,3 @@ Base<BASE, DERIVED> base(DERIVED &obj, const Parameters ¶meters) } } // namespace qark - -#endif // QARK_BASECLASS_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/flag.h b/src/libs/modelinglib/qtserialization/inc/qark/flag.h index 932c6b4083..e1ac63c484 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/flag.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/flag.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_FLAG_H -#define QARK_FLAG_H +#pragma once namespace qark { @@ -43,5 +42,3 @@ private: }; } // namespace qark - -#endif // QARK_FLAG_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/friend_access.h b/src/libs/modelinglib/qtserialization/inc/qark/friend_access.h index 5c39a37aba..37b5fd35d0 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/friend_access.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/friend_access.h @@ -23,11 +23,8 @@ ** ****************************************************************************/ -#ifndef QARK_FRIEND_ACCESS_H -#define QARK_FRIEND_ACCESS_H +#pragma once #define QARK_FRIEND_ACCESS \ template<class Archive, class T> \ friend class qark::Access; - -#endif // QMT_FRIEND_ACCESS_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/impl/loadingrefmap.h b/src/libs/modelinglib/qtserialization/inc/qark/impl/loadingrefmap.h index 1e44d169cf..6e290bd927 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/impl/loadingrefmap.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/impl/loadingrefmap.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_LOADINGREFMAP_H -#define QARK_LOADINGREFMAP_H +#pragma once #include "objectid.h" @@ -63,5 +62,3 @@ private: } // namespace impl } // namespace qark - -#endif // QARK_LOADINGREFMAP_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/impl/objectid.h b/src/libs/modelinglib/qtserialization/inc/qark/impl/objectid.h index 142f2975b2..98c9b71343 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/impl/objectid.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/impl/objectid.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_OBJECTID_H -#define QARK_OBJECTID_H +#pragma once namespace qark { namespace impl { @@ -51,5 +50,3 @@ inline bool operator<(const ObjectId &lhs, const ObjectId &rhs) } // namespace impl } // namespace qark - -#endif // QARK_OBJECTID_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/impl/savingrefmap.h b/src/libs/modelinglib/qtserialization/inc/qark/impl/savingrefmap.h index f80f432ff5..b87fa6c3ed 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/impl/savingrefmap.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/impl/savingrefmap.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_SAVINGREFMAP_H -#define QARK_SAVINGREFMAP_H +#pragma once #include "objectid.h" @@ -73,5 +72,3 @@ private: } // namespace impl } // namespace qark - -#endif // QARK_SAVINGREFMAP_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/parameters.h b/src/libs/modelinglib/qtserialization/inc/qark/parameters.h index 37f38aa74f..c583ff183b 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/parameters.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/parameters.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_PARAMETER_H -#define QARK_PARAMETER_H +#pragma once #include "flag.h" @@ -56,5 +55,3 @@ private: }; } // namespace qark - -#endif // QARK_PARAMETER_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/qxmlinarchive.h b/src/libs/modelinglib/qtserialization/inc/qark/qxmlinarchive.h index b6f1ef077e..b11a4db04b 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/qxmlinarchive.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/qxmlinarchive.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_QXMLINARCHIVE_H -#define QARK_QXMLINARCHIVE_H +#pragma once #include "archivebasics.h" #include "tag.h" @@ -925,5 +924,3 @@ void QXmlInArchive::skipUntilEndOfTag(const XmlTag &xmlTag) } } // namespace qark - -#endif // QARK_XMLINARCHIVE_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/qxmloutarchive.h b/src/libs/modelinglib/qtserialization/inc/qark/qxmloutarchive.h index 651d7458e2..91525173cb 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/qxmloutarchive.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/qxmloutarchive.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_QXMLOUTARCHIVE_H -#define QARK_QXMLOUTARCHIVE_H +#pragma once #include "archivebasics.h" #include "tag.h" @@ -327,5 +326,3 @@ private: }; } // namespace qark - -#endif // QARK_QXMLOUTARCHIVE_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/reference.h b/src/libs/modelinglib/qtserialization/inc/qark/reference.h index cd2f8ac93b..c00c6b6664 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/reference.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/reference.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_REFERENCE_H -#define QARK_REFERENCE_H +#pragma once #include "parameters.h" @@ -422,5 +421,3 @@ GetSetFuncRef<U, T *, V * const &> ref(const QString &qualifiedName, U &u, T *(* } } // namespace qark - -#endif // QARK_REFERENCE_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/serialize.h b/src/libs/modelinglib/qtserialization/inc/qark/serialize.h index bff84bbc62..57a3a19e08 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/serialize.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/serialize.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_SERIALIZE_H -#define QARK_SERIALIZE_H +#pragma once #include "tag.h" #include "baseclass.h" @@ -494,5 +493,3 @@ typename std::enable_if<Archive::inArchive, Archive &>::type operator||( } } // namespace qark - -#endif // QARK_SERIALIZE_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/serialize_basic.h b/src/libs/modelinglib/qtserialization/inc/qark/serialize_basic.h index 06e69d143c..695c53031d 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/serialize_basic.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/serialize_basic.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_SERIALIZE_BASIC_H -#define QARK_SERIALIZE_BASIC_H +#pragma once #include "parameters.h" #include "qstringparser/qstringparser.h" @@ -126,5 +125,3 @@ inline void load(Archive &archive, QDateTime &dateTime, const Parameters &) } } // namespace qark - -#endif // QARK_SERIALIZE_BASIC_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/serialize_container.h b/src/libs/modelinglib/qtserialization/inc/qark/serialize_container.h index 85865398b2..a9d8e2a922 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/serialize_container.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/serialize_container.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_SERIALIZE_CONTAINER_H -#define QARK_SERIALIZE_CONTAINER_H +#pragma once #include "parameters.h" @@ -201,5 +200,3 @@ inline void load(Archive &archive, QHash<KEY, VALUE> &hash, const Parameters &) } } // namespace qark - -#endif // QARK_SERIALIZE_CONTAINER_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/serialize_enum.h b/src/libs/modelinglib/qtserialization/inc/qark/serialize_enum.h index c4dcf219c6..f8c20f2896 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/serialize_enum.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/serialize_enum.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_SERIALIZE_ENUM_H -#define QARK_SERIALIZE_ENUM_H +#pragma once #include "parameters.h" @@ -81,5 +80,3 @@ inline void load(Archive &archive, QFlags<T> &flags, const Parameters &) } } // namespace qark - -#endif // QARK_SERIALIZE_ENUM_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/serialize_pointer.h b/src/libs/modelinglib/qtserialization/inc/qark/serialize_pointer.h index 2338676b24..876609643d 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/serialize_pointer.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/serialize_pointer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_SERIALIZE_POINTER_H -#define QARK_SERIALIZE_POINTER_H +#pragma once #include "typeregistry.h" @@ -86,6 +85,3 @@ void load(Archive &archive, T *&p, const Parameters &) } } // namespace qark - -#endif // QARK_SERIALIZE_POINTER_H - diff --git a/src/libs/modelinglib/qtserialization/inc/qark/tag.h b/src/libs/modelinglib/qtserialization/inc/qark/tag.h index 5f6615bd36..24f81e5d92 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/tag.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/tag.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_TAG_H -#define QARK_TAG_H +#pragma once #include "typeregistry.h" #include "parameters.h" @@ -150,5 +149,3 @@ inline End end(const Parameters ¶meters) } } // namespace qark - -#endif // QARK_TAG_H diff --git a/src/libs/modelinglib/qtserialization/inc/qark/typeregistry.h b/src/libs/modelinglib/qtserialization/inc/qark/typeregistry.h index 50090e1826..aa0750cfdb 100644 --- a/src/libs/modelinglib/qtserialization/inc/qark/typeregistry.h +++ b/src/libs/modelinglib/qtserialization/inc/qark/typeregistry.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QARK_TYPEREGISTRY_H -#define QARK_TYPEREGISTRY_H +#pragma once #include "parameters.h" @@ -308,5 +307,3 @@ typename registry::TypeRegistry<Archive,T>::TypeInfo typeInfo(const QString &uid int qark::registry::DerivedTypeRegistry<OUTARCHIVE, typename std::add_const<BASE>::type, typename std::add_const<DERIVED>::type>::staticInit = \ qark::registry::DerivedTypeRegistry<OUTARCHIVE, typename std::add_const<BASE>::type, typename std::add_const<DERIVED>::type>:: \ init(qark::registry::savePointer<OUTARCHIVE, typename std::add_const<BASE>::type, typename std::add_const<DERIVED>::type>, 0); - -#endif // QARK_TYPEREGISTRY_H diff --git a/src/libs/qmldebug/baseenginedebugclient.h b/src/libs/qmldebug/baseenginedebugclient.h index d490d05b24..b74397cf9d 100644 --- a/src/libs/qmldebug/baseenginedebugclient.h +++ b/src/libs/qmldebug/baseenginedebugclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASEENGINEDEBUGCLIENT_H -#define BASEENGINEDEBUGCLIENT_H +#pragma once #include "qmldebug_global.h" #include "qmldebugclient.h" @@ -259,5 +258,3 @@ inline QDebug operator<<(QDebug dbg, const QmlDebug::ObjectReference &ref) { return dbg.space(); } QT_END_NAMESPACE - -#endif // BASEENGINEDEBUGCLIENT_H diff --git a/src/libs/qmldebug/basetoolsclient.h b/src/libs/qmldebug/basetoolsclient.h index 7f2da7b167..d84e02066e 100644 --- a/src/libs/qmldebug/basetoolsclient.h +++ b/src/libs/qmldebug/basetoolsclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASETOOLSCLIENT_H -#define BASETOOLSCLIENT_H +#pragma once #include "qmldebugclient.h" #include "baseenginedebugclient.h" @@ -72,5 +71,3 @@ protected: }; } // namespace QmlDebug - -#endif // BASETOOLSCLIENT_H diff --git a/src/libs/qmldebug/declarativeenginedebugclient.h b/src/libs/qmldebug/declarativeenginedebugclient.h index 5ef02c9395..793347e9c7 100644 --- a/src/libs/qmldebug/declarativeenginedebugclient.h +++ b/src/libs/qmldebug/declarativeenginedebugclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DECLARATIVEENGINEDEBUGCLIENT_H -#define DECLARATIVEENGINEDEBUGCLIENT_H +#pragma once #include "baseenginedebugclient.h" @@ -51,5 +50,3 @@ protected: }; } // namespace QmlDebug - -#endif // DECLARATIVEENGINEDEBUGCLIENT_H diff --git a/src/libs/qmldebug/declarativeenginedebugclientv2.h b/src/libs/qmldebug/declarativeenginedebugclientv2.h index 286d95460b..00af9d5424 100644 --- a/src/libs/qmldebug/declarativeenginedebugclientv2.h +++ b/src/libs/qmldebug/declarativeenginedebugclientv2.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DECLARATIVEENGINEDEBUGCLIENTV2_H -#define DECLARATIVEENGINEDEBUGCLIENTV2_H +#pragma once #include "baseenginedebugclient.h" @@ -43,5 +42,3 @@ public: }; } // namespace QmlDebug - -#endif // DECLARATIVEENGINEDEBUGCLIENTV2_H diff --git a/src/libs/qmldebug/declarativetoolsclient.h b/src/libs/qmldebug/declarativetoolsclient.h index 6e8d6e5378..83698b4037 100644 --- a/src/libs/qmldebug/declarativetoolsclient.h +++ b/src/libs/qmldebug/declarativetoolsclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DECLARATIVETOOLSCLIENT_H -#define DECLARATIVETOOLSCLIENT_H +#pragma once #include "basetoolsclient.h" @@ -58,5 +57,3 @@ private: }; } // namespace QmlDebug - -#endif // DECLARATIVETOOLSCLIENT_H diff --git a/src/libs/qmldebug/qdebugmessageclient.h b/src/libs/qmldebug/qdebugmessageclient.h index c185e3ddfb..5a4e45bbac 100644 --- a/src/libs/qmldebug/qdebugmessageclient.h +++ b/src/libs/qmldebug/qdebugmessageclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QDEBUGMESSAGECLIENT_H -#define QDEBUGMESSAGECLIENT_H +#pragma once #include "qmldebugclient.h" #include "qmldebug_global.h" @@ -64,5 +63,3 @@ private: }; } // namespace QmlDebug - -#endif // QDEBUGMESSAGECLIENT_H diff --git a/src/libs/qmldebug/qmldebug_global.h b/src/libs/qmldebug/qmldebug_global.h index b765adc477..3f6bc8ee30 100644 --- a/src/libs/qmldebug/qmldebug_global.h +++ b/src/libs/qmldebug/qmldebug_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDEBUG_GLOBAL_H -#define QMLDEBUG_GLOBAL_H +#pragma once #if defined(QMLDEBUG_LIB) # define QMLDEBUG_EXPORT Q_DECL_EXPORT @@ -33,5 +32,3 @@ #else # define QMLDEBUG_EXPORT Q_DECL_IMPORT #endif - -#endif // QMLDEBUG_GLOBAL_H diff --git a/src/libs/qmldebug/qmldebugclient.h b/src/libs/qmldebug/qmldebugclient.h index 95853f92a7..3ea50acae5 100644 --- a/src/libs/qmldebug/qmldebugclient.h +++ b/src/libs/qmldebug/qmldebugclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDEBUGCLIENT_H -#define QMLDEBUGCLIENT_H +#pragma once #include "qmldebug_global.h" #include <qtcpsocket.h> @@ -111,5 +110,3 @@ private: }; } // namespace QmlDebug - -#endif // QMLDEBUGCLIENT_H diff --git a/src/libs/qmldebug/qmldebugcommandlinearguments.h b/src/libs/qmldebug/qmldebugcommandlinearguments.h index 3c060ea4db..f1d3d8933e 100644 --- a/src/libs/qmldebug/qmldebugcommandlinearguments.h +++ b/src/libs/qmldebug/qmldebugcommandlinearguments.h @@ -23,9 +23,9 @@ ** ****************************************************************************/ -#ifndef QMLDEBUGCOMMANDLINEARGUMENTS_H -#define QMLDEBUGCOMMANDLINEARGUMENTS_H +#pragma once +#include <utils/port.h> #include <QString> namespace QmlDebug { @@ -64,11 +64,13 @@ static inline QString qmlDebugCommandLineArguments(QmlDebugServicesPreset servic .arg(QLatin1String(block ? ",block" : "")).arg(qmlDebugServices(services)); } -static inline QString qmlDebugTcpArguments(QmlDebugServicesPreset services, quint16 port = 0, +static inline QString qmlDebugTcpArguments(QmlDebugServicesPreset services, + Utils::Port port = Utils::Port(), bool block = true) { - return qmlDebugCommandLineArguments(services, port ? QString::fromLatin1("port:%1").arg(port) : - QStringLiteral("port:%qml_port%"), block); + return qmlDebugCommandLineArguments(services, port.isValid() ? + QString::fromLatin1("port:%1").arg(port.number()) : + QStringLiteral("port:%qml_port%"), block); } static inline QString qmlDebugNativeArguments(QmlDebugServicesPreset services, bool block = true) @@ -83,6 +85,3 @@ static inline QString qmlDebugLocalArguments(QmlDebugServicesPreset services, co } } // namespace QmlDebug - -#endif // QMLDEBUGCOMMANDLINEARGUMENTS_H - diff --git a/src/libs/qmldebug/qmldebugconstants.h b/src/libs/qmldebug/qmldebugconstants.h index 9b3d9ae431..74299b393f 100644 --- a/src/libs/qmldebug/qmldebugconstants.h +++ b/src/libs/qmldebug/qmldebugconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDEBUGCONSTANTS_H -#define QMLDEBUGCONSTANTS_H +#pragma once namespace QmlDebug { namespace Constants { @@ -40,5 +39,3 @@ const char QDECLARATIVE_ENGINE[] = "QDeclarativeEngine"; } // namespace Constants } // namespace QmlDebug - -#endif // QMLDEBUGCONSTANTS_H diff --git a/src/libs/qmldebug/qmlenginecontrolclient.h b/src/libs/qmldebug/qmlenginecontrolclient.h index 5c57220bc2..c5da7a7130 100644 --- a/src/libs/qmldebug/qmlenginecontrolclient.h +++ b/src/libs/qmldebug/qmlenginecontrolclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLENGINECONTROLCLIENT_H -#define QMLENGINECONTROLCLIENT_H +#pragma once #include "qmldebugclient.h" @@ -73,5 +72,3 @@ protected: }; } - -#endif // QMLENGINECONTROLCLIENT_H diff --git a/src/libs/qmldebug/qmlenginedebugclient.h b/src/libs/qmldebug/qmlenginedebugclient.h index fd7f7a30bc..706cbabe6b 100644 --- a/src/libs/qmldebug/qmlenginedebugclient.h +++ b/src/libs/qmldebug/qmlenginedebugclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLENGINEDEBUGCLIENT_H -#define QMLENGINEDEBUGCLIENT_H +#pragma once #include "baseenginedebugclient.h" @@ -43,5 +42,3 @@ public: }; } // namespace QmlDebug - -#endif // QMLENGINEDEBUGCLIENT_H diff --git a/src/libs/qmldebug/qmloutputparser.cpp b/src/libs/qmldebug/qmloutputparser.cpp index 03773aa57f..9e6102598b 100644 --- a/src/libs/qmldebug/qmloutputparser.cpp +++ b/src/libs/qmldebug/qmloutputparser.cpp @@ -84,7 +84,7 @@ void QmlOutputParser::processOutput(const QString &output) bool canConvert; quint16 port = waitingTcp.cap(1).toUShort(&canConvert); if (canConvert) - emit waitingForConnectionOnPort(port); + emit waitingForConnectionOnPort(Utils::Port(port)); continue; } } else if (status.startsWith(unableToListen)) { diff --git a/src/libs/qmldebug/qmloutputparser.h b/src/libs/qmldebug/qmloutputparser.h index bcfe5a9120..60db2e4d52 100644 --- a/src/libs/qmldebug/qmloutputparser.h +++ b/src/libs/qmldebug/qmloutputparser.h @@ -23,11 +23,11 @@ ** ****************************************************************************/ -#ifndef QMLOUTPUTPARSER_H -#define QMLOUTPUTPARSER_H +#pragma once #include "qmldebug_global.h" +#include <utils/port.h> #include <QObject> namespace QmlDebug { @@ -42,7 +42,7 @@ public: void processOutput(const QString &output); signals: - void waitingForConnectionOnPort(quint16 port); + void waitingForConnectionOnPort(Utils::Port port); void connectionEstablishedMessage(); void connectingToSocketMessage(); void errorMessage(const QString &detailedError); @@ -55,5 +55,3 @@ private: }; } // namespace QmlDebug - -#endif // QMLOUTPUTPARSER_H diff --git a/src/libs/qmldebug/qmlprofilereventlocation.h b/src/libs/qmldebug/qmlprofilereventlocation.h index 725463698a..21de6d9305 100644 --- a/src/libs/qmldebug/qmlprofilereventlocation.h +++ b/src/libs/qmldebug/qmlprofilereventlocation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILEREVENTLOCATION_H -#define QMLPROFILEREVENTLOCATION_H +#pragma once #include "qmldebug_global.h" @@ -42,5 +41,3 @@ struct QMLDEBUG_EXPORT QmlEventLocation }; } - -#endif // QMLPROFILEREVENTLOCATION_H diff --git a/src/libs/qmldebug/qmlprofilereventtypes.h b/src/libs/qmldebug/qmlprofilereventtypes.h index 82dd1a4357..7a9eefe179 100644 --- a/src/libs/qmldebug/qmlprofilereventtypes.h +++ b/src/libs/qmldebug/qmlprofilereventtypes.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILEREVENTTYPES_H -#define QMLPROFILEREVENTTYPES_H +#pragma once #include <QtGlobal> @@ -181,5 +180,3 @@ const quint64 QML_JS_RANGE_FEATURES = (1 << ProfileCompiling) | } } // namespace QmlDebug - -#endif //QMLPROFILEREVENTTYPES_H diff --git a/src/libs/qmldebug/qmlprofilertraceclient.h b/src/libs/qmldebug/qmlprofilertraceclient.h index 4c7bfcdfa1..adaf93971c 100644 --- a/src/libs/qmldebug/qmlprofilertraceclient.h +++ b/src/libs/qmldebug/qmlprofilertraceclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERTRACECLIENT_H -#define QMLPROFILERTRACECLIENT_H +#pragma once #include "qmldebugclient.h" #include "qmlprofilereventtypes.h" @@ -86,5 +85,3 @@ private: }; } // namespace QmlDebug - -#endif // QMLPROFILERTRACECLIENT_H diff --git a/src/libs/qmldebug/qmltoolsclient.h b/src/libs/qmldebug/qmltoolsclient.h index ea4a0b7189..51dc6730af 100644 --- a/src/libs/qmldebug/qmltoolsclient.h +++ b/src/libs/qmldebug/qmltoolsclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLTOOLSCLIENT_H -#define QMLTOOLSCLIENT_H +#pragma once #include "basetoolsclient.h" @@ -59,5 +58,3 @@ private: }; } // namespace QmlDebug - -#endif // QMLTOOLSCLIENT_H diff --git a/src/libs/qmldebug/qpacketprotocol.h b/src/libs/qmldebug/qpacketprotocol.h index d3ad42ff15..33d1ecdbf6 100644 --- a/src/libs/qmldebug/qpacketprotocol.h +++ b/src/libs/qmldebug/qpacketprotocol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QPACKETPROTOCOL_H -#define QPACKETPROTOCOL_H +#pragma once #include "qmldebug_global.h" @@ -72,5 +71,3 @@ private: }; } // QmlDebug - -#endif diff --git a/src/libs/qmleditorwidgets/colorbox.h b/src/libs/qmleditorwidgets/colorbox.h index 91b5451fd8..dd576f61f2 100644 --- a/src/libs/qmleditorwidgets/colorbox.h +++ b/src/libs/qmleditorwidgets/colorbox.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COLORBOX_H -#define COLORBOX_H +#pragma once #include "qmleditorwidgets_global.h" #include <QWidget> @@ -86,5 +85,3 @@ private: }; } //QmlEditorWidgets - -#endif //COLORBOX_H diff --git a/src/libs/qmleditorwidgets/colorbutton.h b/src/libs/qmleditorwidgets/colorbutton.h index 65f35c934d..c70fd2b309 100644 --- a/src/libs/qmleditorwidgets/colorbutton.h +++ b/src/libs/qmleditorwidgets/colorbutton.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COLORBUTTON_H -#define COLORBUTTON_H +#pragma once #include "qmleditorwidgets_global.h" #include <QToolButton> @@ -68,5 +67,3 @@ private: }; } //QmlEditorWidgets - -#endif //COLORBUTTON_H diff --git a/src/libs/qmleditorwidgets/contextpanetextwidget.h b/src/libs/qmleditorwidgets/contextpanetextwidget.h index 02a6103965..4a15d85838 100644 --- a/src/libs/qmleditorwidgets/contextpanetextwidget.h +++ b/src/libs/qmleditorwidgets/contextpanetextwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONTEXTPANETEXTWIDGET_H -#define CONTEXTPANETEXTWIDGET_H +#pragma once #include "qmleditorwidgets_global.h" #include <QWidget> @@ -84,5 +83,3 @@ private: }; } //QmlDesigner - -#endif // CONTEXTPANETEXTWIDGET_H diff --git a/src/libs/qmleditorwidgets/contextpanewidget.h b/src/libs/qmleditorwidgets/contextpanewidget.h index 63794a8f98..f7cd9684ad 100644 --- a/src/libs/qmleditorwidgets/contextpanewidget.h +++ b/src/libs/qmleditorwidgets/contextpanewidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONTEXTPANEWIDGET_H -#define CONTEXTPANEWIDGET_H +#pragma once #include "qmleditorwidgets_global.h" #include <QFrame> @@ -141,5 +140,3 @@ private: }; } //QmlDesigner - -#endif // CONTEXTPANEWIDGET_H diff --git a/src/libs/qmleditorwidgets/contextpanewidgetimage.h b/src/libs/qmleditorwidgets/contextpanewidgetimage.h index 4990a93c09..50788b8562 100644 --- a/src/libs/qmleditorwidgets/contextpanewidgetimage.h +++ b/src/libs/qmleditorwidgets/contextpanewidgetimage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONTEXTPANEWIDGETIMAGE_H -#define CONTEXTPANEWIDGETIMAGE_H +#pragma once #include "qmleditorwidgets_global.h" #include "contextpanewidget.h" @@ -186,5 +185,3 @@ protected: } //QmlDesigner - -#endif // CONTEXTPANEWIDGETIMAGE_H diff --git a/src/libs/qmleditorwidgets/contextpanewidgetrectangle.h b/src/libs/qmleditorwidgets/contextpanewidgetrectangle.h index 8c57bd59f1..95221276d9 100644 --- a/src/libs/qmleditorwidgets/contextpanewidgetrectangle.h +++ b/src/libs/qmleditorwidgets/contextpanewidgetrectangle.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONTEXTPANEWIDGETRECTANGLE_H -#define CONTEXTPANEWIDGETRECTANGLE_H +#pragma once #include "qmleditorwidgets_global.h" #include <QWidget> @@ -82,5 +81,3 @@ private: }; } //QmlDesigner - -#endif // CONTEXTPANEWIDGETRECTANGLE_H diff --git a/src/libs/qmleditorwidgets/customcolordialog.h b/src/libs/qmleditorwidgets/customcolordialog.h index 0431b695c0..a3753edc31 100644 --- a/src/libs/qmleditorwidgets/customcolordialog.h +++ b/src/libs/qmleditorwidgets/customcolordialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMCOLORDIALOG_H -#define CUSTOMCOLORDIALOG_H +#pragma once #include "qmleditorwidgets_global.h" #include <QFrame> @@ -103,5 +102,3 @@ private: }; } //QmlEditorWidgets - -#endif //CUSTOMCOLORDIALOG_H diff --git a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.h b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.h index 243bde11f5..8609f843b8 100644 --- a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.h +++ b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EASINGCONTEXTPANE_H -#define EASINGCONTEXTPANE_H +#pragma once #include "easinggraph.h" @@ -86,4 +85,3 @@ private slots: }; } -#endif // EASINGCONTEXTPANE_H diff --git a/src/libs/qmleditorwidgets/easingpane/easinggraph.h b/src/libs/qmleditorwidgets/easingpane/easinggraph.h index 03d72dca1b..37236caded 100644 --- a/src/libs/qmleditorwidgets/easingpane/easinggraph.h +++ b/src/libs/qmleditorwidgets/easingpane/easinggraph.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EASINGGRAPH_H -#define EASINGGRAPH_H +#pragma once #include <QWidget> #include <QEasingCurve> @@ -105,5 +104,3 @@ private: QT_END_NAMESPACE //QML_DECLARE_TYPE(EasingGraph) - -#endif // EASINGGRAPH_H diff --git a/src/libs/qmleditorwidgets/filewidget.h b/src/libs/qmleditorwidgets/filewidget.h index c130d53b18..ef445b0668 100644 --- a/src/libs/qmleditorwidgets/filewidget.h +++ b/src/libs/qmleditorwidgets/filewidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILEWIDGET_H -#define FILEWIDGET_H +#pragma once #include "qmleditorwidgets_global.h" @@ -117,6 +116,3 @@ private: }; } //QmlEditorWidgets - -#endif - diff --git a/src/libs/qmleditorwidgets/fontsizespinbox.h b/src/libs/qmleditorwidgets/fontsizespinbox.h index c288a984c4..2f86000fef 100644 --- a/src/libs/qmleditorwidgets/fontsizespinbox.h +++ b/src/libs/qmleditorwidgets/fontsizespinbox.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FONTSIZESPINBOX_H -#define FONTSIZESPINBOX_H +#pragma once #include "qmleditorwidgets_global.h" #include <QAbstractSpinBox> @@ -92,5 +91,3 @@ private: }; } //QmlDesigner - -#endif // FONTSIZESPINBOX_H diff --git a/src/libs/qmleditorwidgets/gradientline.h b/src/libs/qmleditorwidgets/gradientline.h index 493a59684f..99c101f2a4 100644 --- a/src/libs/qmleditorwidgets/gradientline.h +++ b/src/libs/qmleditorwidgets/gradientline.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GRADIENTLINE_H -#define GRADIENTLINE_H +#pragma once #include "qmleditorwidgets_global.h" #include <QWidget> @@ -90,5 +89,3 @@ private: }; } //QmlEditorWidgets - -#endif //GRADIENTLINE_H diff --git a/src/libs/qmleditorwidgets/huecontrol.h b/src/libs/qmleditorwidgets/huecontrol.h index ee88836441..f9db8790ed 100644 --- a/src/libs/qmleditorwidgets/huecontrol.h +++ b/src/libs/qmleditorwidgets/huecontrol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HUECONTROL_H -#define HUECONTROL_H +#pragma once #include "qmleditorwidgets_global.h" #include <QWidget> @@ -63,5 +62,3 @@ private: }; } //QmlEditorWidgets - -#endif //HUECONTROL_H diff --git a/src/libs/qmleditorwidgets/qmleditorwidgets_global.h b/src/libs/qmleditorwidgets/qmleditorwidgets_global.h index 1c46500395..1b611c894a 100644 --- a/src/libs/qmleditorwidgets/qmleditorwidgets_global.h +++ b/src/libs/qmleditorwidgets/qmleditorwidgets_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLEDITORWIDGETS_GLOBAL_H -#define QMLEDITORWIDGETS_GLOBAL_H +#pragma once #include <qglobal.h> @@ -35,5 +34,3 @@ # else # define QMLEDITORWIDGETS_EXPORT Q_DECL_IMPORT #endif - -#endif // QMLEDITORWIDGETS_GLOBAL_H diff --git a/src/libs/qmljs/jsoncheck.h b/src/libs/qmljs/jsoncheck.h index 6558c13d08..53246045ff 100644 --- a/src/libs/qmljs/jsoncheck.h +++ b/src/libs/qmljs/jsoncheck.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONCHECK_H -#define JSONCHECK_H +#pragma once #include "qmljs_global.h" @@ -83,5 +82,3 @@ private: }; } // QmlJs - -#endif // JSONCHECK_H diff --git a/src/libs/qmljs/parser/qmldirparser_p.h b/src/libs/qmljs/parser/qmldirparser_p.h index be9e126f75..72a2cf9922 100644 --- a/src/libs/qmljs/parser/qmldirparser_p.h +++ b/src/libs/qmljs/parser/qmldirparser_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QQMLDIRPARSER_P_H -#define QQMLDIRPARSER_P_H +#pragma once // // W A R N I N G @@ -146,5 +145,3 @@ QDebug &operator<< (QDebug &, const QmlDirParser::Component &); QDebug &operator<< (QDebug &, const QmlDirParser::Script &); QT_END_NAMESPACE - -#endif // QQMLDIRPARSER_P_H diff --git a/src/libs/qmljs/parser/qmlerror.h b/src/libs/qmljs/parser/qmlerror.h index 3d4ebde73d..6219a7c8b5 100644 --- a/src/libs/qmljs/parser/qmlerror.h +++ b/src/libs/qmljs/parser/qmlerror.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QQMLERROR_H -#define QQMLERROR_H +#pragma once @@ -66,5 +65,3 @@ QDebug operator<<(QDebug debug, const QmlError &error); Q_DECLARE_TYPEINFO(QmlError, Q_MOVABLE_TYPE); QT_END_NAMESPACE - -#endif // QQMLERROR_H diff --git a/src/libs/qmljs/parser/qmljs.g b/src/libs/qmljs/parser/qmljs.g index 0a20e9e367..f0c1722dc6 100644 --- a/src/libs/qmljs/parser/qmljs.g +++ b/src/libs/qmljs/parser/qmljs.g @@ -201,8 +201,7 @@ // qlalr --no-debug --no-lines --qt qmljs.g // -#ifndef QMLJSPARSER_P_H -#define QMLJSPARSER_P_H +#prama once #include "qmljsglobal_p.h" #include "qmljsgrammar_p.h" @@ -3114,6 +3113,4 @@ QT_QML_END_NAMESPACE QT_QML_END_NAMESPACE - -#endif // QMLJSPARSER_P_H :/ diff --git a/src/libs/qmljs/parser/qmljsast_p.h b/src/libs/qmljs/parser/qmljsast_p.h index 80f36c96b8..42c0046d4c 100644 --- a/src/libs/qmljs/parser/qmljsast_p.h +++ b/src/libs/qmljs/parser/qmljsast_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSAST_P_H -#define QMLJSAST_P_H +#pragma once // // W A R N I N G @@ -2759,5 +2758,3 @@ public: QT_QML_END_NAMESPACE - -#endif diff --git a/src/libs/qmljs/parser/qmljsastfwd_p.h b/src/libs/qmljs/parser/qmljsastfwd_p.h index e9ea732acd..4a818602bb 100644 --- a/src/libs/qmljs/parser/qmljsastfwd_p.h +++ b/src/libs/qmljs/parser/qmljsastfwd_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSAST_FWD_P_H -#define QMLJSAST_FWD_P_H +#pragma once #include "qmljsglobal_p.h" @@ -171,5 +170,3 @@ class UiHeaderItemList; } } // namespace AST QT_QML_END_NAMESPACE - -#endif diff --git a/src/libs/qmljs/parser/qmljsastvisitor_p.h b/src/libs/qmljs/parser/qmljsastvisitor_p.h index 036e34b4ba..769cb644a4 100644 --- a/src/libs/qmljs/parser/qmljsastvisitor_p.h +++ b/src/libs/qmljs/parser/qmljsastvisitor_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSASTVISITOR_P_H -#define QMLJSASTVISITOR_P_H +#pragma once // // W A R N I N G @@ -321,5 +320,3 @@ public: } } // namespace AST QT_QML_END_NAMESPACE - -#endif // QMLJSASTVISITOR_P_H diff --git a/src/libs/qmljs/parser/qmljsengine_p.h b/src/libs/qmljs/parser/qmljsengine_p.h index e9a72f6269..7078f3c6b4 100644 --- a/src/libs/qmljs/parser/qmljsengine_p.h +++ b/src/libs/qmljs/parser/qmljsengine_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSENGINE_P_H -#define QMLJSENGINE_P_H +#pragma once // // W A R N I N G @@ -111,5 +110,3 @@ double integerFromString(const char *buf, int size, int radix); } // end of namespace QmlJS QT_QML_END_NAMESPACE - -#endif // QMLJSENGINE_P_H diff --git a/src/libs/qmljs/parser/qmljsglobal_p.h b/src/libs/qmljs/parser/qmljsglobal_p.h index 8cdf617f66..f7810e6a43 100644 --- a/src/libs/qmljs/parser/qmljsglobal_p.h +++ b/src/libs/qmljs/parser/qmljsglobal_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSGLOBAL_P_H -#define QMLJSGLOBAL_P_H +#pragma once #include <QtCore/qglobal.h> @@ -52,5 +51,3 @@ # define QML_PARSER_EXPORT # endif #endif // QT_CREATOR - -#endif // QMLJSGLOBAL_P_H diff --git a/src/libs/qmljs/parser/qmljsgrammar_p.h b/src/libs/qmljs/parser/qmljsgrammar_p.h index 9a84aa86f6..b36219f474 100644 --- a/src/libs/qmljs/parser/qmljsgrammar_p.h +++ b/src/libs/qmljs/parser/qmljsgrammar_p.h @@ -35,8 +35,7 @@ // // This file was generated by qlalr - DO NOT EDIT! -#ifndef QMLJSGRAMMAR_P_H -#define QMLJSGRAMMAR_P_H +#pragma once #include "qmljsglobal_p.h" #include <QtCore/qglobal.h> @@ -196,5 +195,3 @@ public: QT_END_NAMESPACE -#endif // QMLJSGRAMMAR_P_H - diff --git a/src/libs/qmljs/parser/qmljskeywords_p.h b/src/libs/qmljs/parser/qmljskeywords_p.h index 36e04a732f..df0030d6dd 100644 --- a/src/libs/qmljs/parser/qmljskeywords_p.h +++ b/src/libs/qmljs/parser/qmljskeywords_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSKEYWORDS_P_H -#define QMLJSKEYWORDS_P_H +#pragma once // // W A R N I N G @@ -875,5 +874,3 @@ int Lexer::classify(const QChar *s, int n, bool qmlMode) { } // namespace QmlJS QT_QML_END_NAMESPACE - -#endif // QMLJSKEYWORDS_P_H diff --git a/src/libs/qmljs/parser/qmljslexer_p.h b/src/libs/qmljs/parser/qmljslexer_p.h index 463c551ee6..067161fb3f 100644 --- a/src/libs/qmljs/parser/qmljslexer_p.h +++ b/src/libs/qmljs/parser/qmljslexer_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSLEXER_P_H -#define QMLJSLEXER_P_H +#pragma once // // W A R N I N G @@ -233,5 +232,3 @@ private: } // end of namespace QmlJS QT_QML_END_NAMESPACE - -#endif // LEXER_H diff --git a/src/libs/qmljs/parser/qmljsmemorypool_p.h b/src/libs/qmljs/parser/qmljsmemorypool_p.h index bfa7ad6f9e..199f9dbbbd 100644 --- a/src/libs/qmljs/parser/qmljsmemorypool_p.h +++ b/src/libs/qmljs/parser/qmljsmemorypool_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSMEMORYPOOL_P_H -#define QMLJSMEMORYPOOL_P_H +#pragma once // // W A R N I N G @@ -153,5 +152,3 @@ public: } // namespace QmlJS QT_QML_END_NAMESPACE - -#endif diff --git a/src/libs/qmljs/parser/qmljsparser_p.h b/src/libs/qmljs/parser/qmljsparser_p.h index 0f00561d94..281c7bc6a3 100644 --- a/src/libs/qmljs/parser/qmljsparser_p.h +++ b/src/libs/qmljs/parser/qmljsparser_p.h @@ -46,8 +46,7 @@ // qlalr --no-debug --no-lines --qt qmljs.g // -#ifndef QMLJSPARSER_P_H -#define QMLJSPARSER_P_H +#pragma once #include "qmljsglobal_p.h" #include "qmljsgrammar_p.h" @@ -236,7 +235,3 @@ protected: #define J_SCRIPT_REGEXPLITERAL_RULE2 88 QT_QML_END_NAMESPACE - - - -#endif // QMLJSPARSER_P_H diff --git a/src/libs/qmljs/persistenttrie.h b/src/libs/qmljs/persistenttrie.h index 65639bc4a3..35ab652967 100644 --- a/src/libs/qmljs/persistenttrie.h +++ b/src/libs/qmljs/persistenttrie.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PERSISTENTTRIE_H -#define PERSISTENTTRIE_H +#pragma once #include <qmljs/qmljs_global.h> @@ -128,5 +127,3 @@ QMLJS_EXPORT QDebug &operator<<(QDebug &dbg, const Trie &trie); } // end namespace PersistentTrie } // end namespace QmlJS - -#endif // PERSISTENTTRIE_H diff --git a/src/libs/qmljs/qmljs_global.h b/src/libs/qmljs/qmljs_global.h index 3c9c4cc266..e34d6e5220 100644 --- a/src/libs/qmljs/qmljs_global.h +++ b/src/libs/qmljs/qmljs_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJS_GLOBAL_H -#define QMLJS_GLOBAL_H +#pragma once #include <qglobal.h> @@ -35,5 +34,3 @@ #else # define QMLJS_EXPORT Q_DECL_IMPORT #endif - -#endif // QMLJS_GLOBAL_H diff --git a/src/libs/qmljs/qmljsbind.h b/src/libs/qmljs/qmljsbind.h index 15e23303e8..81da23b6fa 100644 --- a/src/libs/qmljs/qmljsbind.h +++ b/src/libs/qmljs/qmljsbind.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSBIND_H -#define QMLJSBIND_H +#pragma once #include <qmljs/parser/qmljsastvisitor_p.h> #include <qmljs/qmljsvalueowner.h> @@ -104,5 +103,3 @@ private: }; } // namespace Qml - -#endif // QMLJSBIND_H diff --git a/src/libs/qmljs/qmljsbundle.h b/src/libs/qmljs/qmljsbundle.h index 8138b7315f..0bf00ab755 100644 --- a/src/libs/qmljs/qmljsbundle.h +++ b/src/libs/qmljs/qmljsbundle.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSBUNDLE_H -#define QMLJSBUNDLE_H +#pragma once #include <qmljs/qmljs_global.h> #include <qmljs/persistenttrie.h> @@ -104,5 +103,3 @@ private: QHash<Dialect,QmlBundle> m_bundles; }; } // namespace QmlJS - -#endif // QMLJSBUNDLE_H diff --git a/src/libs/qmljs/qmljscheck.h b/src/libs/qmljs/qmljscheck.h index f449e331b3..810bdb8d26 100644 --- a/src/libs/qmljs/qmljscheck.h +++ b/src/libs/qmljs/qmljscheck.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSCHECK_H -#define QMLJSCHECK_H +#pragma once #include <qmljs/qmljsscopebuilder.h> #include <qmljs/qmljsscopechain.h> @@ -155,5 +154,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSCHECK_H diff --git a/src/libs/qmljs/qmljscodeformatter.h b/src/libs/qmljs/qmljscodeformatter.h index 86540ece9a..990ec080ce 100644 --- a/src/libs/qmljs/qmljscodeformatter.h +++ b/src/libs/qmljs/qmljscodeformatter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSCODEFORMATTER_H -#define QMLJSCODEFORMATTER_H +#pragma once #include "qmljs_global.h" @@ -328,5 +327,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSCODEFORMATTER_H diff --git a/src/libs/qmljs/qmljscompletioncontextfinder.h b/src/libs/qmljs/qmljscompletioncontextfinder.h index e3770bd1bc..34632807e7 100644 --- a/src/libs/qmljs/qmljscompletioncontextfinder.h +++ b/src/libs/qmljs/qmljscompletioncontextfinder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSCOMPLETIONCONTEXTFINDER_H -#define QMLJSCOMPLETIONCONTEXTFINDER_H +#pragma once #include "qmljs_global.h" #include <qmljs/qmljslineinfo.h> @@ -70,5 +69,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSCOMPLETIONCONTEXTFINDER_H diff --git a/src/libs/qmljs/qmljsconstants.h b/src/libs/qmljs/qmljsconstants.h index 5d34c8f286..532b74697d 100644 --- a/src/libs/qmljs/qmljsconstants.h +++ b/src/libs/qmljs/qmljsconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSCONSTANTS_H -#define QMLJSCONSTANTS_H +#pragma once #include "qmljs_global.h" @@ -91,4 +90,3 @@ const char TASK_IMPORT_SCAN[] = "QmlJSEditor.TaskImportScan"; QMLJS_EXPORT Q_DECLARE_LOGGING_CATEGORY(qmljsLog) } // namespace QmlJS -#endif // QMLJSCONSTANTS_H diff --git a/src/libs/qmljs/qmljscontext.h b/src/libs/qmljs/qmljscontext.h index 7aeb4500ac..fd7f0569eb 100644 --- a/src/libs/qmljs/qmljscontext.h +++ b/src/libs/qmljs/qmljscontext.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJS_CONTEXT_H -#define QMLJS_CONTEXT_H +#pragma once #include "qmljs_global.h" #include "qmljsdocument.h" @@ -97,5 +96,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJS_CONTEXT_H diff --git a/src/libs/qmljs/qmljsdescribevalue.h b/src/libs/qmljs/qmljsdescribevalue.h index d378c02434..3c27c320e5 100644 --- a/src/libs/qmljs/qmljsdescribevalue.h +++ b/src/libs/qmljs/qmljsdescribevalue.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSDESCRIBEVALUE_H -#define QMLJSDESCRIBEVALUE_H +#pragma once #include "qmljs_global.h" #include "qmljsinterpreter.h" @@ -73,4 +72,3 @@ private: }; } // namespace QmlJS -#endif // QMLJSDESCRIBEVALUE_H diff --git a/src/libs/qmljs/qmljsdialect.h b/src/libs/qmljs/qmljsdialect.h index 7f2e87466f..5f63b51066 100644 --- a/src/libs/qmljs/qmljsdialect.h +++ b/src/libs/qmljs/qmljsdialect.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSDIALECT_H -#define QMLJSDIALECT_H +#pragma once #include "qmljs_global.h" @@ -168,4 +167,3 @@ private: }; } // namespace QmlJS -#endif // QMLJSDIALECT_H diff --git a/src/libs/qmljs/qmljsdocument.cpp b/src/libs/qmljs/qmljsdocument.cpp index b61f44ca08..82cf503666 100644 --- a/src/libs/qmljs/qmljsdocument.cpp +++ b/src/libs/qmljs/qmljsdocument.cpp @@ -519,6 +519,7 @@ void Snapshot::insertLibraryInfo(const QString &path, const LibraryInfo &info) foreach (const Export &e, cImport.possibleExports) _dependencies.addExport(component.fileName, e.exportName, e.pathRequired, e.typeName); } + cImport.fingerprint = info.fingerprint(); _dependencies.addCoreImport(cImport); } diff --git a/src/libs/qmljs/qmljsdocument.h b/src/libs/qmljs/qmljsdocument.h index ab04375f8e..5328fbe609 100644 --- a/src/libs/qmljs/qmljsdocument.h +++ b/src/libs/qmljs/qmljsdocument.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSDOCUMENT_H -#define QMLJSDOCUMENT_H +#pragma once #include <QList> #include <QSharedPointer> @@ -155,6 +154,7 @@ private: typedef QList<LanguageUtils::FakeMetaObject::ConstPtr> FakeMetaObjectList; FakeMetaObjectList _metaObjects; QList<ModuleApiInfo> _moduleApis; + QStringList _dependencies; QByteArray _fingerprint; PluginTypeInfoStatus _dumpStatus; @@ -191,6 +191,12 @@ public: void setModuleApis(const QList<ModuleApiInfo> &apis) { _moduleApis = apis; } + QStringList dependencies() const + { return _dependencies; } + + void setDependencies(const QStringList &deps) + { _dependencies = deps; } + bool isValid() const { return _status == Found; } @@ -246,5 +252,3 @@ public: }; } // namespace QmlJS - -#endif // QMLJSDOCUMENT_H diff --git a/src/libs/qmljs/qmljsevaluate.h b/src/libs/qmljs/qmljsevaluate.h index 24b00967f2..0246bc453a 100644 --- a/src/libs/qmljs/qmljsevaluate.h +++ b/src/libs/qmljs/qmljsevaluate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSEVALUATE_H -#define QMLJSEVALUATE_H +#pragma once #include "parser/qmljsastvisitor_p.h" #include "qmljsdocument.h" @@ -164,5 +163,3 @@ private: }; } // namespace Qml - -#endif // QMLJSEVALUATE_H diff --git a/src/libs/qmljs/qmljsfindexportedcpptypes.h b/src/libs/qmljs/qmljsfindexportedcpptypes.h index 03d2b42840..fbc9126880 100644 --- a/src/libs/qmljs/qmljsfindexportedcpptypes.h +++ b/src/libs/qmljs/qmljsfindexportedcpptypes.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJS_QMLJSFINDEXPORTEDCPPTYPES_H -#define QMLJS_QMLJSFINDEXPORTEDCPPTYPES_H +#pragma once #include "qmljs_global.h" #include <cplusplus/CppDocument.h> @@ -56,5 +55,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJS_QMLJSFINDEXPORTEDCPPTYPES_H diff --git a/src/libs/qmljs/qmljsicons.h b/src/libs/qmljs/qmljsicons.h index 76664917a1..1ff4cadf9d 100644 --- a/src/libs/qmljs/qmljsicons.h +++ b/src/libs/qmljs/qmljsicons.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSICONS_H -#define QMLJSICONS_H +#pragma once #include <qmljs/qmljs_global.h> #include <qmljs/parser/qmljsast_p.h> @@ -59,5 +58,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSICONS_H diff --git a/src/libs/qmljs/qmljsicontextpane.h b/src/libs/qmljs/qmljsicontextpane.h index 6578b49868..3a36a104ef 100644 --- a/src/libs/qmljs/qmljsicontextpane.h +++ b/src/libs/qmljs/qmljsicontextpane.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSICONTEXTPANE_H -#define QMLJSICONTEXTPANE_H +#pragma once #include <QObject> @@ -55,5 +54,3 @@ signals: }; } // namespace QmlJS - -#endif // QMLJSICONTEXTPANE_H diff --git a/src/libs/qmljs/qmljsimportdependencies.h b/src/libs/qmljs/qmljsimportdependencies.h index c2885e27b0..f529629465 100644 --- a/src/libs/qmljs/qmljsimportdependencies.h +++ b/src/libs/qmljs/qmljsimportdependencies.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSIMPORTCACHE_H -#define QMLJSIMPORTCACHE_H +#pragma once #include "qmljsconstants.h" #include "qmljsdialect.h" @@ -232,5 +231,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSIMPORTCACHE_H diff --git a/src/libs/qmljs/qmljsindenter.h b/src/libs/qmljs/qmljsindenter.h index a140326406..97cf1eb6ab 100644 --- a/src/libs/qmljs/qmljsindenter.h +++ b/src/libs/qmljs/qmljsindenter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSINDENTER_H -#define QMLJSINDENTER_H +#pragma once #include <qmljs/qmljs_global.h> #include <qmljs/qmljslineinfo.h> @@ -72,6 +71,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSINDENTER_H - diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp index 078ee96ad8..b0d097beb4 100644 --- a/src/libs/qmljs/qmljsinterpreter.cpp +++ b/src/libs/qmljs/qmljsinterpreter.cpp @@ -1117,11 +1117,13 @@ const Value *ObjectValue::lookupMember(const QString &name, const Context *conte } } + const ObjectValue *prototypeObject = 0; + if (examinePrototypes && context) { PrototypeIterator iter(this, context); iter.next(); // skip this while (iter.hasNext()) { - const ObjectValue *prototypeObject = iter.next(); + prototypeObject = iter.next(); if (const Value *m = prototypeObject->lookupMember(name, context, foundInObject, false)) return m; } @@ -1129,6 +1131,7 @@ const Value *ObjectValue::lookupMember(const QString &name, const Context *conte if (foundInObject) *foundInObject = 0; + return 0; } @@ -1346,6 +1349,7 @@ CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::defaultQtObjects; CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::loadQmlTypes(const QFileInfoList &qmlTypeFiles, QStringList *errors, QStringList *warnings) { QHash<QString, FakeMetaObject::ConstPtr> newObjects; + QStringList newDependencies; foreach (const QFileInfo &qmlTypeFile, qmlTypeFiles) { QString error, warning; @@ -1355,7 +1359,8 @@ CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::loadQmlTypes(const QFileInf file.close(); - parseQmlTypeDescriptions(contents, &newObjects, 0, &error, &warning, qmlTypeFile.absoluteFilePath()); + parseQmlTypeDescriptions(contents, &newObjects, 0, &newDependencies, &error, &warning, + qmlTypeFile.absoluteFilePath()); } else { error = file.errorString(); } @@ -1377,6 +1382,7 @@ CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::loadQmlTypes(const QFileInf void CppQmlTypesLoader::parseQmlTypeDescriptions(const QByteArray &contents, BuiltinObjects *newObjects, QList<ModuleApiInfo> *newModuleApis, + QStringList *newDependencies, QString *errorMessage, QString *warningMessage, const QString &fileName) { @@ -1396,7 +1402,7 @@ void CppQmlTypesLoader::parseQmlTypeDescriptions(const QByteArray &contents, errorMessage->clear(); warningMessage->clear(); TypeDescriptionReader reader(fileName, QString::fromUtf8(contents)); - if (!reader(newObjects, newModuleApis)) { + if (!reader(newObjects, newModuleApis, newDependencies)) { if (reader.errorMessage().isEmpty()) *errorMessage = QLatin1String("unknown error"); else diff --git a/src/libs/qmljs/qmljsinterpreter.h b/src/libs/qmljs/qmljsinterpreter.h index 02e22e2f4c..806b858f39 100644 --- a/src/libs/qmljs/qmljsinterpreter.h +++ b/src/libs/qmljs/qmljsinterpreter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJS_INTERPRETER_H -#define QMLJS_INTERPRETER_H +#pragma once #include <qmljs/qmljs_global.h> #include <qmljs/qmljsconstants.h> @@ -721,8 +720,12 @@ public: // parses the contents of a qmltypes file and fills the newObjects map static void parseQmlTypeDescriptions(const QByteArray &contents, - BuiltinObjects *newObjects, - QList<ModuleApiInfo> *newModuleApis, QString *errorMessage, QString *warningMessage, const QString &fileName); + BuiltinObjects *newObjects, + QList<ModuleApiInfo> *newModuleApis, + QStringList *newDependencies, + QString *errorMessage, + QString *warningMessage, + const QString &fileName); }; class QMLJS_EXPORT FakeMetaObjectWithOrigin @@ -1130,5 +1133,3 @@ public: }; } // namespace QmlJS - -#endif // QMLJS_INTERPRETER_H diff --git a/src/libs/qmljs/qmljslineinfo.h b/src/libs/qmljs/qmljslineinfo.h index eac9eeba51..d687a1e18b 100644 --- a/src/libs/qmljs/qmljslineinfo.h +++ b/src/libs/qmljs/qmljslineinfo.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSLINEINFO_H -#define QMLJSLINEINFO_H +#pragma once #include <qmljs/qmljs_global.h> @@ -117,6 +116,3 @@ protected: }; } // namespace QmlJS - -#endif // QMLJSLINEINFO_H - diff --git a/src/libs/qmljs/qmljslink.h b/src/libs/qmljs/qmljslink.h index 0735f62bf9..59e5e3f85a 100644 --- a/src/libs/qmljs/qmljslink.h +++ b/src/libs/qmljs/qmljslink.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSLINK_H -#define QMLJSLINK_H +#pragma once #include <qmljs/qmljscontext.h> @@ -61,5 +60,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSLINK_H diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.h b/src/libs/qmljs/qmljsmodelmanagerinterface.h index ceeacc94f2..142fc54c17 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.h +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSMODELMANAGERINTERFACE_H -#define QMLJSMODELMANAGERINTERFACE_H +#pragma once #include "qmljs_global.h" #include "qmljsbundle.h" @@ -290,5 +289,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSMODELMANAGERINTERFACE_H diff --git a/src/libs/qmljs/qmljsplugindumper.cpp b/src/libs/qmljs/qmljsplugindumper.cpp index aa08ec044d..555b77671a 100644 --- a/src/libs/qmljs/qmljsplugindumper.cpp +++ b/src/libs/qmljs/qmljsplugindumper.cpp @@ -27,6 +27,7 @@ #include "qmljsmodelmanagerinterface.h" #include <qmljs/qmljsinterpreter.h> +#include <qmljs/qmljsviewercontext.h> //#include <projectexplorer/session.h> //#include <coreplugin/messagemanager.h> #include <utils/filesystemwatcher.h> @@ -309,7 +310,9 @@ void PluginDumper::qmlPluginTypeDumpDone(int exitCode) QString warning; CppQmlTypesLoader::BuiltinObjects objectsList; QList<ModuleApiInfo> moduleApis; - CppQmlTypesLoader::parseQmlTypeDescriptions(output, &objectsList, &moduleApis, &error, &warning, + QStringList dependencies; + CppQmlTypesLoader::parseQmlTypeDescriptions(output, &objectsList, &moduleApis, &dependencies, + &error, &warning, QLatin1String("<dump of ") + libraryPath + QLatin1Char('>')); if (exitCode == 0) { if (!error.isEmpty()) { @@ -361,39 +364,131 @@ void PluginDumper::pluginChanged(const QString &pluginLibrary) dump(plugin); } -void PluginDumper::loadQmltypesFile(const QStringList &qmltypesFilePaths, - const QString &libraryPath, - QmlJS::LibraryInfo libraryInfo) -{ - QStringList errors; - QStringList warnings; - QList<FakeMetaObject::ConstPtr> objects; - QList<ModuleApiInfo> moduleApis; - - foreach (const QString &qmltypesFilePath, qmltypesFilePaths) { +void PluginDumper::loadQmlTypeDescription(const QStringList &paths, + QStringList &errors, + QStringList &warnings, + QList<FakeMetaObject::ConstPtr> &objects, + QList<ModuleApiInfo> *moduleApi, + QStringList *dependencies) const { + for (const QString &p: paths) { Utils::FileReader reader; - if (!reader.fetch(qmltypesFilePath, QFile::Text)) { + if (!reader.fetch(p, QFile::Text)) { errors += reader.errorString(); continue; } - QString error; QString warning; - CppQmlTypesLoader::BuiltinObjects newObjects; - QList<ModuleApiInfo> newModuleApis; - CppQmlTypesLoader::parseQmlTypeDescriptions(reader.data(), &newObjects, &newModuleApis, &error, &warning, qmltypesFilePath); + CppQmlTypesLoader::BuiltinObjects objs; + QList<ModuleApiInfo> apis; + QStringList deps; + CppQmlTypesLoader::parseQmlTypeDescriptions(reader.data(), &objs, &apis, &deps, + &error, &warning, p); if (!error.isEmpty()) { - errors += tr("Failed to parse \"%1\".\nError: %2").arg(qmltypesFilePath, error); + errors += tr("Failed to parse \"%1\".\nError: %2").arg(p, error); } else { - objects += newObjects.values(); - moduleApis += newModuleApis; + objects += objs.values(); + if (moduleApi) + *moduleApi += apis; + if (!deps.isEmpty()) + *dependencies += deps; } if (!warning.isEmpty()) warnings += warning; } +} +/*! + * \brief Build the path of an existing qmltypes file from a module name. + * \param name + * \return the module's qmltypes file path + * + * Look for \a name qmltypes file in model manager's import paths. + * For each import path the following files are searched, in this order: + * + * - <name>.<major>.<minor>/plugins.qmltypes + * - <name>.<major>/plugins.qmltypes + * - <name>/plugins.qmltypes + * + * That means that a more qualified directory name has precedence over a + * less qualified one. Be aware that the import paths order has a stronger + * precedence, so a less qualified name could shadow a more qualified one if + * it resides in a different import path. + * + * \sa LinkPrivate::importNonFile + */ +QString PluginDumper::buildQmltypesPath(const QString &name) const +{ + QStringList importName = name.split(QLatin1Char(' ')); + QString qualifiedName = importName[0]; + QString majorVersion; + QString minorVersion; + if (importName.length() == 2) { + QString versionString = importName[1]; + QStringList version = versionString.split(QLatin1Char('.')); + if (version.length() == 2) { + majorVersion = version[0]; + minorVersion = version[1]; + } + } + + for (const PathAndLanguage &p: m_modelManager->importPaths()) { + QString moduleName(qualifiedName.replace(QLatin1Char('.'), QLatin1Char('/'))); + QString moduleNameMajor(moduleName + QLatin1Char('.') + majorVersion); + QString moduleNameMajorMinor(moduleNameMajor + QLatin1Char('.') + minorVersion); + + for (const auto n: QStringList{moduleNameMajorMinor, moduleNameMajor, moduleName}) { + QString filename(p.path().toString() + QLatin1Char('/') + n + + QLatin1String("/plugins.qmltypes")); + if (QFile::exists(filename)) + return filename; + } + } + return QString(); +} + +/*! + * \brief Recursively load dependencies. + * \param dependencies + * \param errors + * \param warnings + * \param objects + * + * Recursively load type descriptions of dependencies, collecting results + * in \a objects. + */ +void PluginDumper::loadDependencies(const QStringList &dependencies, + QStringList &errors, + QStringList &warnings, + QList<FakeMetaObject::ConstPtr> &objects) const +{ + QStringList dependenciesPaths; + QString path; + for (const QString &name: dependencies) { + path = buildQmltypesPath(name); + if (!path.isNull()) + dependenciesPaths << path; + } + QStringList newDependencies; + loadQmlTypeDescription(dependenciesPaths, errors, warnings, objects, 0, &newDependencies); + if (!newDependencies.isEmpty()) + loadDependencies(newDependencies, errors, warnings, objects); +} + +void PluginDumper::loadQmltypesFile(const QStringList &qmltypesFilePaths, + const QString &libraryPath, + QmlJS::LibraryInfo libraryInfo) +{ + QStringList errors; + QStringList warnings; + QList<FakeMetaObject::ConstPtr> objects; + QList<ModuleApiInfo> moduleApis; + QStringList dependencies; + + loadQmlTypeDescription(qmltypesFilePaths, errors, warnings, objects, &moduleApis, &dependencies); + loadDependencies(dependencies, errors, warnings, objects); libraryInfo.setMetaObjects(objects); libraryInfo.setModuleApis(moduleApis); + libraryInfo.setDependencies(dependencies); if (errors.isEmpty()) { libraryInfo.setPluginTypeInfoStatus(LibraryInfo::TypeInfoFileDone); } else { diff --git a/src/libs/qmljs/qmljsplugindumper.h b/src/libs/qmljs/qmljsplugindumper.h index 7a93631751..31c9b5e019 100644 --- a/src/libs/qmljs/qmljsplugindumper.h +++ b/src/libs/qmljs/qmljsplugindumper.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSPLUGINDUMPER_H -#define QMLJSPLUGINDUMPER_H +#pragma once #include <qmljs/qmljsmodelmanagerinterface.h> @@ -76,6 +75,15 @@ private: void runQmlDump(const QmlJS::ModelManagerInterface::ProjectInfo &info, const QStringList &arguments, const QString &importPath); void dump(const Plugin &plugin); + void loadQmlTypeDescription(const QStringList &path, QStringList &errors, QStringList &warnings, + QList<LanguageUtils::FakeMetaObject::ConstPtr> &objects, + QList<ModuleApiInfo> *moduleApi, + QStringList *dependencies) const; + QString buildQmltypesPath(const QString &name) const; + void loadDependencies(const QStringList &dependencies, + QStringList &errors, + QStringList &warnings, + QList<LanguageUtils::FakeMetaObject::ConstPtr> &objects) const; void loadQmltypesFile(const QStringList &qmltypesFilePaths, const QString &libraryPath, QmlJS::LibraryInfo libraryInfo); @@ -97,5 +105,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSPLUGINDUMPER_H diff --git a/src/libs/qmljs/qmljspropertyreader.h b/src/libs/qmljs/qmljspropertyreader.h index 79721f54be..650b3d075d 100644 --- a/src/libs/qmljs/qmljspropertyreader.h +++ b/src/libs/qmljs/qmljspropertyreader.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSPROPERTYREADER_H -#define QMLJSPROPERTYREADER_H +#pragma once #include <qmljs/qmljsdocument.h> @@ -71,5 +70,3 @@ private: }; } //QmlJS - -#endif // QMLJSPROPERTYREADER_H diff --git a/src/libs/qmljs/qmljsqrcparser.h b/src/libs/qmljs/qmljsqrcparser.h index 653cf4c0cf..0d9e98fc2a 100644 --- a/src/libs/qmljs/qmljsqrcparser.h +++ b/src/libs/qmljs/qmljsqrcparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSQRCPARSER_H -#define QMLJSQRCPARSER_H +#pragma once #include "qmljs_global.h" #include <QMap> @@ -84,4 +83,3 @@ private: Internal::QrcCachePrivate *d; }; } -#endif // QMLJSQRCPARSER_H diff --git a/src/libs/qmljs/qmljsreformatter.h b/src/libs/qmljs/qmljsreformatter.h index 4d210463c0..18d5c6fd85 100644 --- a/src/libs/qmljs/qmljsreformatter.h +++ b/src/libs/qmljs/qmljsreformatter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSREFORMATTER_H -#define QMLJSREFORMATTER_H +#pragma once #include "qmljs_global.h" @@ -33,5 +32,3 @@ namespace QmlJS { QMLJS_EXPORT QString reformat(const Document::Ptr &doc); } - -#endif // QMLJSREFORMATTER_H diff --git a/src/libs/qmljs/qmljsrewriter.h b/src/libs/qmljs/qmljsrewriter.h index d8dea16541..1bb68a01c1 100644 --- a/src/libs/qmljs/qmljsrewriter.h +++ b/src/libs/qmljs/qmljsrewriter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSREWRITER_H -#define QMLJSREWRITER_H +#pragma once #include <qmljs/qmljs_global.h> #include <qmljs/parser/qmljsastfwd_p.h> @@ -112,5 +111,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSREWRITER_H diff --git a/src/libs/qmljs/qmljsscanner.h b/src/libs/qmljs/qmljsscanner.h index 9f038daf82..0cd8c69d7d 100644 --- a/src/libs/qmljs/qmljsscanner.h +++ b/src/libs/qmljs/qmljsscanner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSSCANNER_H -#define QMLJSSCANNER_H +#pragma once #include <qmljs/qmljs_global.h> @@ -100,5 +99,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSSCANNER_H diff --git a/src/libs/qmljs/qmljsscopeastpath.h b/src/libs/qmljs/qmljsscopeastpath.h index d298e15e00..f06db11c5c 100644 --- a/src/libs/qmljs/qmljsscopeastpath.h +++ b/src/libs/qmljs/qmljsscopeastpath.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSSCOPEASTPATH_H -#define QMLJSSCOPEASTPATH_H +#pragma once #include "qmljs_global.h" #include "parser/qmljsastvisitor_p.h" @@ -61,5 +60,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSSCOPEASTPATH_H diff --git a/src/libs/qmljs/qmljsscopebuilder.h b/src/libs/qmljs/qmljsscopebuilder.h index 19b33b5a33..472a409105 100644 --- a/src/libs/qmljs/qmljsscopebuilder.h +++ b/src/libs/qmljs/qmljsscopebuilder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSSCOPEBUILDER_H -#define QMLJSSCOPEBUILDER_H +#pragma once #include <qmljs/qmljsdocument.h> @@ -64,5 +63,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJSSCOPEBUILDER_H diff --git a/src/libs/qmljs/qmljsscopechain.h b/src/libs/qmljs/qmljsscopechain.h index f8e2913e9c..a08d686248 100644 --- a/src/libs/qmljs/qmljsscopechain.h +++ b/src/libs/qmljs/qmljsscopechain.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJS_SCOPECHAIN_H -#define QMLJS_SCOPECHAIN_H +#pragma once #include "qmljs_global.h" #include "qmljsdocument.h" @@ -123,5 +122,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJS_SCOPECHAIN_H diff --git a/src/libs/qmljs/qmljssimplereader.h b/src/libs/qmljs/qmljssimplereader.h index dc55042c96..a0ff03f455 100644 --- a/src/libs/qmljs/qmljssimplereader.h +++ b/src/libs/qmljs/qmljssimplereader.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJS_SIMPLEREADER_H -#define QMLJS_SIMPLEREADER_H +#pragma once #include <qmljs/qmljs_global.h> #include <qmljs/parser/qmljsastfwd_p.h> @@ -127,5 +126,3 @@ private: }; } // namespace QmlJS - -#endif // QMLJS_SIMPLEREADER_H diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.h b/src/libs/qmljs/qmljsstaticanalysismessage.h index e479b9adbb..e5b8f8d882 100644 --- a/src/libs/qmljs/qmljsstaticanalysismessage.h +++ b/src/libs/qmljs/qmljsstaticanalysismessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJS_STATICANALYSIS_QMLJSSTATICANALYSISMESSAGE_H -#define QMLJS_STATICANALYSIS_QMLJSSTATICANALYSISMESSAGE_H +#pragma once #include "qmljs_global.h" #include "qmljsconstants.h" @@ -166,5 +165,3 @@ public: } // namespace StaticAnalysis } // namespace QmlJS - -#endif // QMLJS_STATICANALYSIS_QMLJSSTATICANALYSISMESSAGE_H diff --git a/src/libs/qmljs/qmljstypedescriptionreader.cpp b/src/libs/qmljs/qmljstypedescriptionreader.cpp index 5ada19fe12..ea660cd2ee 100644 --- a/src/libs/qmljs/qmljstypedescriptionreader.cpp +++ b/src/libs/qmljs/qmljstypedescriptionreader.cpp @@ -52,7 +52,8 @@ TypeDescriptionReader::~TypeDescriptionReader() bool TypeDescriptionReader::operator()( QHash<QString, FakeMetaObject::ConstPtr> *objects, - QList<ModuleApiInfo> *moduleApis) + QList<ModuleApiInfo> *moduleApis, + QStringList *dependencies) { Engine engine; @@ -71,6 +72,7 @@ bool TypeDescriptionReader::operator()( _objects = objects; _moduleApis = moduleApis; + _dependencies = dependencies; readDocument(parser.ast()); return _errorMessage.isEmpty(); @@ -141,6 +143,12 @@ void TypeDescriptionReader::readModule(UiObjectDefinition *ast) UiObjectMember *member = it->member; UiObjectDefinition *component = dynamic_cast<UiObjectDefinition *>(member); + UiScriptBinding *script = dynamic_cast<UiScriptBinding *>(member); + if (script && (toString(script->qualifiedId) == QStringLiteral("dependencies"))) { + readDependencies(script); + continue; + } + QString typeName; if (component) typeName = toString(component->qualifiedTypeNameId); @@ -174,6 +182,27 @@ void TypeDescriptionReader::addWarning(const SourceLocation &loc, const QString message); } +void TypeDescriptionReader::readDependencies(UiScriptBinding *ast) { + ExpressionStatement *stmt = dynamic_cast<ExpressionStatement*>(ast->statement); + if (!stmt) { + addError(ast->statement->firstSourceLocation(), tr("Expected dependency definitions")); + return; + } + ArrayLiteral *exp = dynamic_cast<ArrayLiteral *>(stmt->expression); + if (!exp) { + addError(stmt->expression->firstSourceLocation(), tr("Expected dependency definitions")); + return; + } + for (ElementList *l = exp->elements; l; l = l->next) { + StringLiteral *str = dynamic_cast<StringLiteral *>(l->expression); + if (!exp) { + addWarning(l->expression->firstSourceLocation(), + tr("Cannot read dependency: skipping.")); + } + *_dependencies << str->value.toString(); + } +} + void TypeDescriptionReader::readComponent(UiObjectDefinition *ast) { FakeMetaObject::Ptr fmo(new FakeMetaObject); diff --git a/src/libs/qmljs/qmljstypedescriptionreader.h b/src/libs/qmljs/qmljstypedescriptionreader.h index 826aa7dec0..900ec38304 100644 --- a/src/libs/qmljs/qmljstypedescriptionreader.h +++ b/src/libs/qmljs/qmljstypedescriptionreader.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSTYPEDESCRIPTIONREADER_H -#define QMLJSTYPEDESCRIPTIONREADER_H +#pragma once #include "qmljs_global.h" #include <qmljs/parser/qmljsastfwd_p.h> @@ -59,13 +58,15 @@ public: bool operator()( QHash<QString, LanguageUtils::FakeMetaObject::ConstPtr> *objects, - QList<ModuleApiInfo> *moduleApis); + QList<ModuleApiInfo> *moduleApis, + QStringList *dependencies); QString errorMessage() const; QString warningMessage() const; private: void readDocument(AST::UiProgram *ast); void readModule(AST::UiObjectDefinition *ast); + void readDependencies(AST::UiScriptBinding *ast); void readComponent(AST::UiObjectDefinition *ast); void readModuleApi(AST::UiObjectDefinition *ast); void readSignalOrMethod(AST::UiObjectDefinition *ast, bool isMethod, LanguageUtils::FakeMetaObject::Ptr fmo); @@ -91,8 +92,7 @@ private: QString _warningMessage; QHash<QString, LanguageUtils::FakeMetaObject::ConstPtr> *_objects; QList<ModuleApiInfo> *_moduleApis; + QStringList *_dependencies; }; } // namespace QmlJS - -#endif // QMLJSTYPEDESCRIPTIONREADER_H diff --git a/src/libs/qmljs/qmljsutils.h b/src/libs/qmljs/qmljsutils.h index 41d89a9352..dbbfbd3995 100644 --- a/src/libs/qmljs/qmljsutils.h +++ b/src/libs/qmljs/qmljsutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJS_QMLJSUTILS_H -#define QMLJS_QMLJSUTILS_H +#pragma once #include "qmljs_global.h" #include "qmljsconstants.h" @@ -70,5 +69,3 @@ DiagnosticMessage errorMessage(const T *node, const QString &message) } } // namespace QmlJS - -#endif // QMLJS_QMLJSUTILS_H diff --git a/src/libs/qmljs/qmljsvalueowner.h b/src/libs/qmljs/qmljsvalueowner.h index 88d58fe5cc..9fad48a235 100644 --- a/src/libs/qmljs/qmljsvalueowner.h +++ b/src/libs/qmljs/qmljsvalueowner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJS_VALUEOWNER_H -#define QMLJS_VALUEOWNER_H +#pragma once #include "qmljs_global.h" #include "qmljsinterpreter.h" @@ -155,5 +154,3 @@ protected: }; } // namespace QmlJS - -#endif // QMLJS_VALUEOWNER_H diff --git a/src/libs/qmljs/qmljsviewercontext.h b/src/libs/qmljs/qmljsviewercontext.h index 9d2db50807..7724d872d0 100644 --- a/src/libs/qmljs/qmljsviewercontext.h +++ b/src/libs/qmljs/qmljsviewercontext.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef VIEWERCONTEXT_H -#define VIEWERCONTEXT_H +#pragma once #include "qmljs_global.h" #include "qmljsdialect.h" @@ -59,4 +58,3 @@ public: }; } // namespace QmlJS -#endif // VIEWERCONTEXT_H diff --git a/src/libs/qtcreatorcdbext/common.h b/src/libs/qtcreatorcdbext/common.h index a33ec01ebb..e41a71df12 100644 --- a/src/libs/qtcreatorcdbext/common.h +++ b/src/libs/qtcreatorcdbext/common.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMMON_H -#define COMMON_H +#pragma once // Define KDEXT_64BIT to make all wdbgexts APIs recognize 64 bit addresses // It is recommended for extensions to use 64 bit headers from wdbgexts so @@ -76,5 +75,3 @@ std::string sourceFileNameByOffset(CIDebugSymbols *symbols, ULONG64 offset, PULO # define QTC_TRACE_IN # define QTC_TRACE_OUT #endif - -#endif // COMMON_H diff --git a/src/libs/qtcreatorcdbext/containers.h b/src/libs/qtcreatorcdbext/containers.h index 9113a56fd9..ee991df439 100644 --- a/src/libs/qtcreatorcdbext/containers.h +++ b/src/libs/qtcreatorcdbext/containers.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONTAINERS_H -#define CONTAINERS_H +#pragma once struct SymbolGroupValueContext; class AbstractSymbolGroupNode; @@ -45,5 +44,3 @@ std::vector<AbstractSymbolGroupNode *> containerChildren(SymbolGroupNode *node, int type, unsigned size, const SymbolGroupValueContext &ctx); - -#endif // CONTAINERS_H diff --git a/src/libs/qtcreatorcdbext/eventcallback.h b/src/libs/qtcreatorcdbext/eventcallback.h index 07e124ecd1..d92f3e97f5 100644 --- a/src/libs/qtcreatorcdbext/eventcallback.h +++ b/src/libs/qtcreatorcdbext/eventcallback.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EVENTCALLBACK_H -#define EVENTCALLBACK_H +#pragma once #include "common.h" #include "extensioncontext.h" @@ -148,4 +147,3 @@ public: private: IDebugEventCallbacks *m_wrapped; }; -#endif // EVENTCALLBACK_H diff --git a/src/libs/qtcreatorcdbext/extensioncontext.h b/src/libs/qtcreatorcdbext/extensioncontext.h index 02066d69dd..428a5275f6 100644 --- a/src/libs/qtcreatorcdbext/extensioncontext.h +++ b/src/libs/qtcreatorcdbext/extensioncontext.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXTENSIONCONTEXT_H -#define EXTENSIONCONTEXT_H +#pragma once #include "common.h" #include "iinterfacepointer.h" @@ -187,5 +186,3 @@ private: IInterfacePointer<CIDebugRegisters> m_registers; IInterfacePointer<CIDebugDataSpaces> m_dataSpaces; }; - -#endif // EXTENSIONCONTEXT_H diff --git a/src/libs/qtcreatorcdbext/gdbmihelpers.h b/src/libs/qtcreatorcdbext/gdbmihelpers.h index 6821e79596..4bf113d329 100644 --- a/src/libs/qtcreatorcdbext/gdbmihelpers.h +++ b/src/libs/qtcreatorcdbext/gdbmihelpers.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GDBMIHELPERS_H -#define GDBMIHELPERS_H +#pragma once #include "common.h" #include <vector> @@ -177,5 +176,3 @@ bool evaluateExpression(CIDebugControl *control, const std::string expression, bool evaluateInt64Expression(CIDebugControl *control, const std::string expression, LONG64 *, std::string *errorMessage); - -#endif // GDBMIHELPERS_H diff --git a/src/libs/qtcreatorcdbext/iinterfacepointer.h b/src/libs/qtcreatorcdbext/iinterfacepointer.h index bd0b457ec7..64e7e56448 100644 --- a/src/libs/qtcreatorcdbext/iinterfacepointer.h +++ b/src/libs/qtcreatorcdbext/iinterfacepointer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IINTERFACEPOINTER_H -#define IINTERFACEPOINTER_H +#pragma once #include "common.h" @@ -80,5 +79,3 @@ private: IInterface *m_instance; HRESULT m_hr; }; - -#endif // IINTERFACEPOINTER_H diff --git a/src/libs/qtcreatorcdbext/knowntype.h b/src/libs/qtcreatorcdbext/knowntype.h index 7e432fb8e5..4b9f00099e 100644 --- a/src/libs/qtcreatorcdbext/knowntype.h +++ b/src/libs/qtcreatorcdbext/knowntype.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef KNOWNTYPE_H -#define KNOWNTYPE_H +#pragma once // Enumeration describing a type. enum KnownType @@ -179,5 +178,3 @@ enum KnownType KT_StdArray = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 8, KT_StdValArray = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 9 }; - -#endif // KNOWNTYPE_H diff --git a/src/libs/qtcreatorcdbext/outputcallback.h b/src/libs/qtcreatorcdbext/outputcallback.h index 2a5cd1f807..846e4a74c1 100644 --- a/src/libs/qtcreatorcdbext/outputcallback.h +++ b/src/libs/qtcreatorcdbext/outputcallback.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OUTPUTCALLBACK_H -#define OUTPUTCALLBACK_H +#pragma once #include "common.h" @@ -63,5 +62,3 @@ private: bool m_recording; std::wstring m_recorded; }; - -#endif // OUTPUTCALLBACK_H diff --git a/src/libs/qtcreatorcdbext/qtcreatorcdbext.qbs b/src/libs/qtcreatorcdbext/qtcreatorcdbext.qbs index ea4a7cdf60..9bdb41f45e 100644 --- a/src/libs/qtcreatorcdbext/qtcreatorcdbext.qbs +++ b/src/libs/qtcreatorcdbext/qtcreatorcdbext.qbs @@ -1,4 +1,5 @@ import qbs +import qbs.Environment import qbs.File import qbs.FileInfo @@ -8,18 +9,18 @@ QtcLibrary { targetName: name property string cdbPath: { var paths = [ - qbs.getEnv("CDB_PATH"), - qbs.getEnv("ProgramFiles") + "/Debugging Tools For Windows/sdk", - qbs.getEnv("ProgramFiles") + "/Debugging Tools For Windows (x86)/sdk", - qbs.getEnv("ProgramFiles") + "/Debugging Tools For Windows (x64)/sdk", - qbs.getEnv("ProgramFiles") + "/Debugging Tools For Windows 64-bit/sdk", - qbs.getEnv("ProgramW6432") + "/Debugging Tools For Windows (x86)/sdk", - qbs.getEnv("ProgramW6432") + "/Debugging Tools For Windows (x64)/sdk", - qbs.getEnv("ProgramW6432") + "/Debugging Tools For Windows 64-bit/sdk", - qbs.getEnv("ProgramFiles") + "/Windows Kits/8.0/Debuggers", - qbs.getEnv("ProgramFiles") + "/Windows Kits/8.1/Debuggers", - qbs.getEnv("ProgramFiles(x86)") + "/Windows Kits/8.0/Debuggers/inc", - qbs.getEnv("ProgramFiles(x86)") + "/Windows Kits/8.1/Debuggers/inc" + Environment.getEnv("CDB_PATH"), + Environment.getEnv("ProgramFiles") + "/Debugging Tools For Windows/sdk", + Environment.getEnv("ProgramFiles") + "/Debugging Tools For Windows (x86)/sdk", + Environment.getEnv("ProgramFiles") + "/Debugging Tools For Windows (x64)/sdk", + Environment.getEnv("ProgramFiles") + "/Debugging Tools For Windows 64-bit/sdk", + Environment.getEnv("ProgramW6432") + "/Debugging Tools For Windows (x86)/sdk", + Environment.getEnv("ProgramW6432") + "/Debugging Tools For Windows (x64)/sdk", + Environment.getEnv("ProgramW6432") + "/Debugging Tools For Windows 64-bit/sdk", + Environment.getEnv("ProgramFiles") + "/Windows Kits/8.0/Debuggers", + Environment.getEnv("ProgramFiles") + "/Windows Kits/8.1/Debuggers", + Environment.getEnv("ProgramFiles(x86)") + "/Windows Kits/8.0/Debuggers/inc", + Environment.getEnv("ProgramFiles(x86)") + "/Windows Kits/8.1/Debuggers/inc" ]; var c = paths.length; for (var i = 0; i < c; ++i) { diff --git a/src/libs/qtcreatorcdbext/stringutils.h b/src/libs/qtcreatorcdbext/stringutils.h index 5e8f422ad1..89316d7e9a 100644 --- a/src/libs/qtcreatorcdbext/stringutils.h +++ b/src/libs/qtcreatorcdbext/stringutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STRINGUTILS_H -#define STRINGUTILS_H +#pragma once #include <string> #include <sstream> @@ -222,5 +221,3 @@ void formatGdbmiHash(std::ostream &os, const std::map<std::string, std::string> // Hex encoding helpers void hexEncode(std::ostream &str, const unsigned char *source, size_t sourcelen); - -#endif // STRINGUTILS_H diff --git a/src/libs/qtcreatorcdbext/symbolgroup.h b/src/libs/qtcreatorcdbext/symbolgroup.h index 5da31d52df..20281a500b 100644 --- a/src/libs/qtcreatorcdbext/symbolgroup.h +++ b/src/libs/qtcreatorcdbext/symbolgroup.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SYMBOLGROUP_H -#define SYMBOLGROUP_H +#pragma once #include "common.h" #include "symbolgroupnode.h" @@ -170,5 +169,3 @@ private: static inline std::string fixWatchExpressionI(CIDebugSymbols *s, const std::string &ex); bool collapsePointerItems(std::string *errorMessage); }; - -#endif // SYMBOLGROUP_H diff --git a/src/libs/qtcreatorcdbext/symbolgroupnode.cpp b/src/libs/qtcreatorcdbext/symbolgroupnode.cpp index 637029cb4a..19726dd14e 100644 --- a/src/libs/qtcreatorcdbext/symbolgroupnode.cpp +++ b/src/libs/qtcreatorcdbext/symbolgroupnode.cpp @@ -319,9 +319,7 @@ DumpParameters::FormatMap DumpParameters::decodeFormatArgument(const std::string std::string::size_type nextPos = f.find(',', numberPos); if (nextPos == std::string::npos) nextPos = size; - int format; - if (!integerFromString(f.substr(numberPos, nextPos - numberPos), &format)) - return rc; + std::string format = f.substr(numberPos, nextPos - numberPos); if (name == "std::basic_string") { // Python dumper naming convention for types rc.insert(FormatMap::value_type(stdStringTypeC, format)); rc.insert(FormatMap::value_type(stdWStringTypeC, format)); @@ -334,7 +332,7 @@ DumpParameters::FormatMap DumpParameters::decodeFormatArgument(const std::string return rc; } -int DumpParameters::format(const std::string &type, const std::string &iname) const +std::string DumpParameters::format(const std::string &type, const std::string &iname) const { if (!individualFormats.empty()) { const FormatMap::const_iterator iit = individualFormats.find(iname); @@ -351,20 +349,9 @@ int DumpParameters::format(const std::string &type, const std::string &iname) co if (tit != typeFormats.end()) return tit->second; } - return -1; + return std::string(); } -// Watch data pointer format requests. This should match the values -// in DisplayFormat in watchhandler.h. -enum PointerFormats -{ - FormatAuto = 0, - FormatLatin1String = 101, - FormatUtf8String = 102, - FormatUtf16String = 104, - FormatUcs4String = 105 -}; - /* Recode arrays/pointers of char*, wchar_t according to users * specification. Handles char formats for 'char *', '0x834478 "hallo.."' * and 'wchar_t *', '0x834478 "hallo.."', 'wchar_t[56] "hallo"', etc. @@ -440,19 +427,13 @@ DumpParameters::checkRecode(const std::string &type, if (!length) return result; // Choose format - result.recommendedFormat = dp ? dp->format(type, iname) : FormatAuto; + if (dp) + result.recommendedFormat = dp->format(type, iname); // The user did not specify any format, still, there are '?'/'.' // (indicating non-printable) in what the debugger prints. // Reformat in this case. If there are no '?'-> all happy. - if (result.recommendedFormat < FormatLatin1String) { - const bool hasNonPrintable = value.find(L'?', quote1 + 1) != std::wstring::npos - || value.find(L'.', quote1 + 1) != std::wstring::npos; - if (!hasNonPrintable) - return result; // All happy, no need to re-encode - // Pass as on 8-bit such that Watchmodel's reformatting can trigger. - result.recommendedFormat = result.isWide ? - FormatUtf16String : FormatLatin1String; - } + if (result.recommendedFormat.empty()) + result.recommendedFormat = "latin1"; // Get address from value if it is a pointer. if (reformatType == ReformatPointer) { address = 0; @@ -468,16 +449,6 @@ DumpParameters::checkRecode(const std::string &type, if (!elementSize) return result; result.size = length * elementSize; - switch (result.recommendedFormat) { - case FormatUtf16String: // Paranoia: make sure buffer is terminated at 2 byte borders - if (result.size % 2) - result.size &= ~1; - break; - case FormatUcs4String: // Paranoia: make sure buffer is terminated at 4 byte borders - if (result.size % 4) - result.size &= ~3; - break; - } result.buffer = new unsigned char[result.size]; std::fill(result.buffer, result.buffer + result.size, 0); ULONG obtained = 0; @@ -506,25 +477,8 @@ bool DumpParameters::recode(const std::string &type, = checkRecode(type, iname, *value, ctx, address, this); if (!check.buffer) return false; - // Recode raw memory - switch (check.recommendedFormat) { - case FormatLatin1String: - *value = dataToHexW(check.buffer, check.buffer + check.size); // Latin1 + 0 - *encoding = "latin1"; - break; - case FormatUtf8String: - *value = dataToHexW(check.buffer, check.buffer + check.size); // UTF8 + 0 - *encoding = "utf8"; - break; - case FormatUtf16String: // Paranoia: make sure buffer is terminated at 2 byte borders - *value = dataToHexW(check.buffer, check.buffer + check.size); - *encoding = "utf16"; - break; - case FormatUcs4String: // Paranoia: make sure buffer is terminated at 4 byte borders - *value = dataToHexW(check.buffer, check.buffer + check.size); // UTF16 + 0 - *encoding = "ucs4"; - break; - } + *value = dataToHexW(check.buffer, check.buffer + check.size); + *encoding = check.recommendedFormat; delete [] check.buffer; return true; } @@ -1138,8 +1092,8 @@ int SymbolGroupNode::dumpNode(std::ostream &str, str << ",valueencoded=\"utf16:2:0\",value=\""; hexEncode(str, reinterpret_cast<const unsigned char *>(value.c_str()), value.size() * sizeof(wchar_t)); str << '"'; - const int format = dumpParameters.format(t, aFullIName); - if (format > 0) + const std::string &format = dumpParameters.format(t, aFullIName); + if (!format.empty()) dumpEditValue(this, ctx, format, str); } // Children: Dump all known non-obscured or subelements diff --git a/src/libs/qtcreatorcdbext/symbolgroupnode.h b/src/libs/qtcreatorcdbext/symbolgroupnode.h index c46a491528..a33ed89135 100644 --- a/src/libs/qtcreatorcdbext/symbolgroupnode.h +++ b/src/libs/qtcreatorcdbext/symbolgroupnode.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SYMBOLGROUPNODE_H -#define SYMBOLGROUPNODE_H +#pragma once #include "common.h" @@ -46,17 +45,15 @@ class MemoryHandle; // Helper struct used for check results when recoding CDB char pointer output. struct DumpParameterRecodeResult { - DumpParameterRecodeResult() : buffer(0), size(0), recommendedFormat(0),isWide(false) {} - - unsigned char *buffer; - size_t size; - int recommendedFormat; - bool isWide; + unsigned char *buffer = 0; + size_t size = 0; + std::string recommendedFormat; + bool isWide = false; }; struct DumpParameters { - typedef std::map<std::string, int> FormatMap; // type or iname to format + typedef std::map<std::string, std::string> FormatMap; // type or iname to format enum DumpFlags { DumpHumanReadable = 0x1, @@ -81,7 +78,7 @@ struct DumpParameters const SymbolGroupValueContext &ctx, ULONG64 address, std::wstring *value, std::string *encoding) const; - int format(const std::string &type, const std::string &iname) const; + std::string format(const std::string &type, const std::string &iname) const; unsigned dumpFlags; FormatMap typeFormats; @@ -432,5 +429,3 @@ private: const DumpParameters &m_parameters; unsigned m_lastDepth; }; - -#endif // SYMBOLGROUPNODE_H diff --git a/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp b/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp index 657babb7c0..db9d42a48f 100644 --- a/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp +++ b/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp @@ -3047,55 +3047,27 @@ unsigned dumpSimpleType(SymbolGroupNode *n, const SymbolGroupValueContext &ctx, return rc; } -static inline void formatEditValue(int displayFormat, const MemoryHandle *mh, std::ostream &str) +static inline void formatEditValue(const std::string &displayFormat, const MemoryHandle *mh, std::ostream &str) { str << "editformat=\"" << displayFormat << "\",editvalue=\"" << mh->toHex() << "\","; } -bool dumpEditValue(const SymbolGroupNode *n, const SymbolGroupValueContext &, - int desiredFormat, std::ostream &str) +void dumpEditValue(const SymbolGroupNode *n, const SymbolGroupValueContext &, + const std::string &desiredFormat, std::ostream &str) { - // Keep in sync watchhandler.cpp/showEditValue(), dumper.py. - enum DebuggerEditFormats { - DisplayImageData = 1, - DisplayUtf16String = 2, - DisplayImageFile = 3, - DisplayLatin1String = 4, - DisplayUtf8String = 5 - }; - - enum Formats { - NormalFormat = 0, - StringSeparateWindow = 1 // corresponds to menu index. - }; - - if (desiredFormat <= 0) - return true; - if (SymbolGroupValue::verbose) DebugPrint() << __FUNCTION__ << ' ' << n->name() << '/' << desiredFormat; - switch (n->dumperType()) { - case KT_QString: - case KT_StdWString: - if (desiredFormat == StringSeparateWindow) - if (const MemoryHandle *mh = n->memory()) - formatEditValue(DisplayUtf16String, mh, str); - break; - case KT_QByteArray: - case KT_StdString: - if (desiredFormat == StringSeparateWindow) - if (const MemoryHandle *mh = n->memory()) - formatEditValue(DisplayLatin1String, mh, str); - break; - case KT_QImage: - if (desiredFormat == 1) // Image. - if (const MemoryHandle *mh = n->memory()) - formatEditValue(DisplayImageData, mh, str); - break; - } - return true; + auto separatorPos = desiredFormat.find(':'); + if (separatorPos == std::string::npos) + return; + + if (desiredFormat.substr(separatorPos) != "separate") + return; + + if (const MemoryHandle *mh = n->memory()) + formatEditValue(desiredFormat, mh, str); } // Dump of QByteArray: Display as an array of unsigned chars. diff --git a/src/libs/qtcreatorcdbext/symbolgroupvalue.h b/src/libs/qtcreatorcdbext/symbolgroupvalue.h index 7a8edf8d42..529f937e3b 100644 --- a/src/libs/qtcreatorcdbext/symbolgroupvalue.h +++ b/src/libs/qtcreatorcdbext/symbolgroupvalue.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SYMBOLGROUPVALUE_H -#define SYMBOLGROUPVALUE_H +#pragma once #include "common.h" #include "knowntype.h" @@ -256,8 +255,8 @@ unsigned dumpSimpleType(SymbolGroupNode *n, const SymbolGroupValueContext &ctx, void **specialInfoIn = 0, MemoryHandle **memoryHandleIn = 0); -bool dumpEditValue(const SymbolGroupNode *n, const SymbolGroupValueContext &, - int desiredFormat, std::ostream &str); +void dumpEditValue(const SymbolGroupNode *n, const SymbolGroupValueContext &, + const std::string &desiredFormat, std::ostream &str); enum AssignEncoding { @@ -274,5 +273,3 @@ bool assignType(SymbolGroupNode *n, int valueEncoding, const std::string &value std::vector<AbstractSymbolGroupNode *> dumpComplexType(SymbolGroupNode *node, int type, void *specialInfo, const SymbolGroupValueContext &ctx); - -#endif // SYMBOLGROUPVALUE_H diff --git a/src/libs/sqlite/columndefinition.h b/src/libs/sqlite/columndefinition.h index cf1715a33f..91f64cb24c 100644 --- a/src/libs/sqlite/columndefinition.h +++ b/src/libs/sqlite/columndefinition.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COLUMNDEFINITION_H -#define COLUMNDEFINITION_H +#pragma once #include "sqliteglobal.h" #include "utf8string.h" @@ -51,5 +50,3 @@ private: }; } - -#endif // COLUMNDEFINITION_H diff --git a/src/libs/sqlite/createtablecommand.h b/src/libs/sqlite/createtablecommand.h index 70b2146394..b4387e7ab7 100644 --- a/src/libs/sqlite/createtablecommand.h +++ b/src/libs/sqlite/createtablecommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INTERNAL_CREATETABLECOMMAND_H -#define INTERNAL_CREATETABLECOMMAND_H +#pragma once #include "columndefinition.h" #include "utf8string.h" @@ -48,5 +47,3 @@ public: } // namespace Internal Q_DECLARE_METATYPE(Internal::CreateTableCommand) - -#endif // INTERNAL_CREATETABLECOMMAND_H diff --git a/src/libs/sqlite/createtablesqlstatementbuilder.h b/src/libs/sqlite/createtablesqlstatementbuilder.h index 25caf3ccda..3445d4946f 100644 --- a/src/libs/sqlite/createtablesqlstatementbuilder.h +++ b/src/libs/sqlite/createtablesqlstatementbuilder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CREATETABLESQLSTATEMENTBUILDER_H -#define CREATETABLESQLSTATEMENTBUILDER_H +#pragma once #include "columndefinition.h" #include "sqlstatementbuilder.h" @@ -62,5 +61,3 @@ private: }; } - -#endif // CREATETABLESQLSTATEMENTBUILDER_H diff --git a/src/libs/sqlite/sqlitecolumn.h b/src/libs/sqlite/sqlitecolumn.h index c16ec3f212..136691e36d 100644 --- a/src/libs/sqlite/sqlitecolumn.h +++ b/src/libs/sqlite/sqlitecolumn.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITECOLUMN_H -#define SQLITECOLUMN_H +#pragma once #include "columndefinition.h" #include "utf8string.h" @@ -55,5 +54,3 @@ private: ColumnType type_; bool isPrimaryKey_; }; - -#endif // SQLITECOLUMN_H diff --git a/src/libs/sqlite/sqlitedatabase.h b/src/libs/sqlite/sqlitedatabase.h index ec77d78f84..91454329ee 100644 --- a/src/libs/sqlite/sqlitedatabase.h +++ b/src/libs/sqlite/sqlitedatabase.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITEDATABASE_H -#define SQLITEDATABASE_H +#pragma once #include "sqlitedatabaseconnectionproxy.h" #include "sqliteglobal.h" @@ -78,5 +77,3 @@ private: QString databaseFilePath_; JournalMode journalMode_; }; - -#endif // SQLITEDATABASE_H diff --git a/src/libs/sqlite/sqlitedatabasebackend.h b/src/libs/sqlite/sqlitedatabasebackend.h index 674e0324d7..7d86519922 100644 --- a/src/libs/sqlite/sqlitedatabasebackend.h +++ b/src/libs/sqlite/sqlitedatabasebackend.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITEDATABASEBACKEND_H -#define SQLITEDATABASEBACKEND_H +#pragma once #include "sqliteglobal.h" @@ -107,5 +106,3 @@ private: TextEncoding cachedTextEncoding; }; - -#endif // SQLITEDATABASEBACKEND_H diff --git a/src/libs/sqlite/sqlitedatabaseconnection.h b/src/libs/sqlite/sqlitedatabaseconnection.h index 154cf250d9..bbf813ffe6 100644 --- a/src/libs/sqlite/sqlitedatabaseconnection.h +++ b/src/libs/sqlite/sqlitedatabaseconnection.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITEDATABASECONNECTIONCONTROLLER_H -#define SQLITEDATABASECONNECTIONCONTROLLER_H +#pragma once #include "sqlitedatabasebackend.h" @@ -56,5 +55,3 @@ signals: private: SqliteDatabaseBackend databaseBackend; }; - -#endif // SQLITEDATABASECONNECTIONCONTROLLER_H diff --git a/src/libs/sqlite/sqlitedatabaseconnectionproxy.h b/src/libs/sqlite/sqlitedatabaseconnectionproxy.h index 2e3f1e7e96..ddc25f18b9 100644 --- a/src/libs/sqlite/sqlitedatabaseconnectionproxy.h +++ b/src/libs/sqlite/sqlitedatabaseconnectionproxy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITEDATABASECONNECTION_H -#define SQLITEDATABASECONNECTION_H +#pragma once #include <sqliteglobal.h> @@ -62,5 +61,3 @@ private: QPointer<SqliteWorkerThread> databaseConnectionThread; bool databaseConnectionIsOpen; }; - -#endif // SQLITEDATABASECONNECTION_H diff --git a/src/libs/sqlite/sqliteexception.h b/src/libs/sqlite/sqliteexception.h index 54d9084584..b778d39b58 100644 --- a/src/libs/sqlite/sqliteexception.h +++ b/src/libs/sqlite/sqliteexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITEEXCEPTION_H -#define SQLITEEXCEPTION_H +#pragma once #include "sqliteglobal.h" @@ -41,5 +40,3 @@ private: const char *whatErrorHasHappen; QByteArray sqliteErrorMessage_; }; - -#endif // SQLITEEXCEPTION_H diff --git a/src/libs/sqlite/sqliteglobal.h b/src/libs/sqlite/sqliteglobal.h index 5d75871b86..9349230fab 100644 --- a/src/libs/sqlite/sqliteglobal.h +++ b/src/libs/sqlite/sqliteglobal.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITEGLOBAL_H -#define SQLITEGLOBAL_H +#pragma once #include <QtGlobal> @@ -86,6 +85,3 @@ class Utf8StringVector; typedef QMap<Utf8String, QVariant> RowDictionary; typedef QVector<RowDictionary> RowDictionaries; - - -#endif // SQLITEGLOBAL_H diff --git a/src/libs/sqlite/sqlitereadstatement.h b/src/libs/sqlite/sqlitereadstatement.h index 932c36af31..4f27c8657b 100644 --- a/src/libs/sqlite/sqlitereadstatement.h +++ b/src/libs/sqlite/sqlitereadstatement.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITEREADSTATEMENT_H -#define SQLITEREADSTATEMENT_H +#pragma once #include "sqlitestatement.h" @@ -50,5 +49,3 @@ public: protected: void checkIsReadOnlyStatement(); }; - -#endif // SQLITEREADSTATEMENT_H diff --git a/src/libs/sqlite/sqlitereadwritestatement.h b/src/libs/sqlite/sqlitereadwritestatement.h index 1b7e4e8431..cb3c0707d4 100644 --- a/src/libs/sqlite/sqlitereadwritestatement.h +++ b/src/libs/sqlite/sqlitereadwritestatement.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITEREADWRITESTATEMENT_H -#define SQLITEREADWRITESTATEMENT_H +#pragma once #include "sqlitestatement.h" @@ -49,5 +48,3 @@ public: using SqliteStatement::toValue; using SqliteStatement::execute; }; - -#endif // SQLITEREADWRITESTATEMENT_H diff --git a/src/libs/sqlite/sqlitestatement.h b/src/libs/sqlite/sqlitestatement.h index 76762ef284..4cdf5ac262 100644 --- a/src/libs/sqlite/sqlitestatement.h +++ b/src/libs/sqlite/sqlitestatement.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITESTATEMENT_H -#define SQLITESTATEMENT_H +#pragma once #include "sqliteglobal.h" @@ -127,5 +126,3 @@ private: int columnCount_; mutable bool isReadyToFetchValues; }; - -#endif // SQLITESTATEMENT_H diff --git a/src/libs/sqlite/sqlitetable.h b/src/libs/sqlite/sqlitetable.h index c945b96781..16a0661909 100644 --- a/src/libs/sqlite/sqlitetable.h +++ b/src/libs/sqlite/sqlitetable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITETABLE_H -#define SQLITETABLE_H +#pragma once #include "sqliteglobal.h" #include "tablewriteworkerproxy.h" @@ -75,5 +74,3 @@ private: SqliteDatabase *sqliteDatabase; bool withoutRowId; }; - -#endif // SQLITETABLE_H diff --git a/src/libs/sqlite/sqlitetransaction.h b/src/libs/sqlite/sqlitetransaction.h index 90f83360ea..3ff6c8c739 100644 --- a/src/libs/sqlite/sqlitetransaction.h +++ b/src/libs/sqlite/sqlitetransaction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITETRANSACTION_H -#define SQLITETRANSACTION_H +#pragma once #include "sqliteglobal.h" @@ -60,6 +59,3 @@ public: SqliteExclusiveTransaction(); }; - - -#endif // SQLITETRANSACTION_H diff --git a/src/libs/sqlite/sqliteworkerthread.h b/src/libs/sqlite/sqliteworkerthread.h index 9f0d640483..b76852434a 100644 --- a/src/libs/sqlite/sqliteworkerthread.h +++ b/src/libs/sqlite/sqliteworkerthread.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITEWORKERTHREAD_H -#define SQLITEWORKERTHREAD_H +#pragma once #include <QMutex> #include <QPointer> @@ -48,5 +47,3 @@ private: mutable QWaitCondition connectionChanged; QPointer<SqliteDatabaseConnection> connection; }; - -#endif // SQLITEWORKERTHREAD_H diff --git a/src/libs/sqlite/sqlitewritestatement.h b/src/libs/sqlite/sqlitewritestatement.h index cf623afb76..abfb27d741 100644 --- a/src/libs/sqlite/sqlitewritestatement.h +++ b/src/libs/sqlite/sqlitewritestatement.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLITEWRITESTATEMENT_H -#define SQLITEWRITESTATEMENT_H +#pragma once #include "sqlitestatement.h" @@ -47,5 +46,3 @@ public: protected: void checkIsWritableStatement(); }; - -#endif // SQLITEWRITESTATEMENT_H diff --git a/src/libs/sqlite/sqlstatementbuilder.h b/src/libs/sqlite/sqlstatementbuilder.h index 674089d19b..6bc092900e 100644 --- a/src/libs/sqlite/sqlstatementbuilder.h +++ b/src/libs/sqlite/sqlstatementbuilder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLSTATEMENTBUILDER_H -#define SQLSTATEMENTBUILDER_H +#pragma once #include "utf8string.h" @@ -77,5 +76,3 @@ private: mutable Utf8String sqlStatement_; mutable std::vector<BindingPair> bindings; }; - -#endif // SQLSTATEMENTBUILDER_H diff --git a/src/libs/sqlite/sqlstatementbuilderexception.h b/src/libs/sqlite/sqlstatementbuilderexception.h index 104e12d3e5..17e215ad4f 100644 --- a/src/libs/sqlite/sqlstatementbuilderexception.h +++ b/src/libs/sqlite/sqlstatementbuilderexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SQLSTATEMENTBUILDEREXCEPTION_H -#define SQLSTATEMENTBUILDEREXCEPTION_H +#pragma once #include "sqliteexception.h" @@ -33,5 +32,3 @@ class SQLITE_EXPORT SqlStatementBuilderException : public SqliteException public: SqlStatementBuilderException(const char *whatErrorHasHappen, const char *errorMessage = 0); }; - -#endif // SQLSTATEMENTBUILDEREXCEPTION_H diff --git a/src/libs/sqlite/tablewriteworker.h b/src/libs/sqlite/tablewriteworker.h index 26f541a987..8ae95c44c3 100644 --- a/src/libs/sqlite/tablewriteworker.h +++ b/src/libs/sqlite/tablewriteworker.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INTERNAL_TABLEWRITEWORKER_H -#define INTERNAL_TABLEWRITEWORKER_H +#pragma once #include "createtablecommand.h" @@ -47,5 +46,3 @@ signals: }; } // namespace Internal - -#endif // INTERNAL_TABLEWRITEWORKER_H diff --git a/src/libs/sqlite/tablewriteworkerproxy.h b/src/libs/sqlite/tablewriteworkerproxy.h index cff996b70e..0bf481e69d 100644 --- a/src/libs/sqlite/tablewriteworkerproxy.h +++ b/src/libs/sqlite/tablewriteworkerproxy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INTERNAL_TABLEWRITEWORKERPROXY_H -#define INTERNAL_TABLEWRITEWORKERPROXY_H +#pragma once #include "createtablecommand.h" @@ -62,5 +61,3 @@ private: }; } // namespace Internal - -#endif // INTERNAL_TABLEWRITEWORKERPROXY_H diff --git a/src/libs/sqlite/utf8string.h b/src/libs/sqlite/utf8string.h index 15129c255c..26bf354e24 100644 --- a/src/libs/sqlite/utf8string.h +++ b/src/libs/sqlite/utf8string.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTF8STRING_H -#define UTF8STRING_H +#pragma once #include "sqliteglobal.h" @@ -127,5 +126,3 @@ SQLITE_EXPORT uint qHash(const Utf8String &utf8String); #define Utf8StringLiteral(str) Utf8String::fromByteArray(QByteArrayLiteral(str)) Q_DECLARE_METATYPE(Utf8String) - -#endif // UTF8STRING_H diff --git a/src/libs/sqlite/utf8stringvector.h b/src/libs/sqlite/utf8stringvector.h index d68f68b811..7d77e283d0 100644 --- a/src/libs/sqlite/utf8stringvector.h +++ b/src/libs/sqlite/utf8stringvector.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTF8STRINGVECTOR_H -#define UTF8STRINGVECTOR_H +#pragma once #include "sqliteglobal.h" #include "utf8string.h" @@ -69,5 +68,3 @@ SQLITE_EXPORT QDebug operator<<(QDebug debug, const Utf8StringVector &textVector SQLITE_EXPORT void PrintTo(const Utf8StringVector &textVector, ::std::ostream* os); Q_DECLARE_METATYPE(Utf8StringVector) - -#endif // UTF8STRINGVECTOR_H diff --git a/src/libs/ssh/sftpchannel.h b/src/libs/ssh/sftpchannel.h index 0cc5579f0d..78857459ee 100644 --- a/src/libs/ssh/sftpchannel.h +++ b/src/libs/ssh/sftpchannel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SFTPCHANNEL_H -#define SFTPCHANNEL_H +#pragma once #include "sftpdefs.h" #include "sftpincomingpacket_p.h" @@ -102,5 +101,3 @@ private: }; } // namespace QSsh - -#endif // SFTPCHANNEL_H diff --git a/src/libs/ssh/sftpchannel_p.h b/src/libs/ssh/sftpchannel_p.h index a5769abba0..6ab1c3a2db 100644 --- a/src/libs/ssh/sftpchannel_p.h +++ b/src/libs/ssh/sftpchannel_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SFTPCHANNEL_P_H -#define SFTPCHANNEL_P_H +#pragma once #include "sftpdefs.h" #include "sftpincomingpacket_p.h" @@ -123,5 +122,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SFTPCHANNEL_P_H diff --git a/src/libs/ssh/sftpdefs.h b/src/libs/ssh/sftpdefs.h index 08813fa750..71d2d6dd30 100644 --- a/src/libs/ssh/sftpdefs.h +++ b/src/libs/ssh/sftpdefs.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SFTPDEFS_H -#define SFTPDEFS_H +#pragma once #include "ssh_global.h" @@ -58,5 +57,3 @@ public: }; } // namespace QSsh - -#endif // SFTPDEFS_H diff --git a/src/libs/ssh/sftpfilesystemmodel.h b/src/libs/ssh/sftpfilesystemmodel.h index 344a4b0989..0dc1401fe6 100644 --- a/src/libs/ssh/sftpfilesystemmodel.h +++ b/src/libs/ssh/sftpfilesystemmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SFTPFILESYSTEMMODEL_H -#define SFTPFILESYSTEMMODEL_H +#pragma once #include "sftpdefs.h" @@ -100,5 +99,3 @@ private: }; } // namespace QSsh; - -#endif // SFTPFILESYSTEMMODEL_H diff --git a/src/libs/ssh/sftpincomingpacket_p.h b/src/libs/ssh/sftpincomingpacket_p.h index da56f5ffd9..fe372e30fb 100644 --- a/src/libs/ssh/sftpincomingpacket_p.h +++ b/src/libs/ssh/sftpincomingpacket_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SFTPINCOMINGPACKET_P_H -#define SFTPINCOMINGPACKET_P_H +#pragma once #include "sftppacket_p.h" @@ -103,5 +102,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SFTPINCOMINGPACKET_P_H diff --git a/src/libs/ssh/sftpoperation_p.h b/src/libs/ssh/sftpoperation_p.h index bf3831e111..3ee703f666 100644 --- a/src/libs/ssh/sftpoperation_p.h +++ b/src/libs/ssh/sftpoperation_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SFTPOPERATION_P_H -#define SFTPOPERATION_P_H +#pragma once #include "sftpdefs.h" @@ -243,5 +242,3 @@ struct SftpUploadDir } // namespace Internal } // namespace QSsh - -#endif // SFTPOPERATION_P_H diff --git a/src/libs/ssh/sftpoutgoingpacket_p.h b/src/libs/ssh/sftpoutgoingpacket_p.h index fb0e1a145e..0fcc67c151 100644 --- a/src/libs/ssh/sftpoutgoingpacket_p.h +++ b/src/libs/ssh/sftpoutgoingpacket_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SFTPOUTGOINGPACKET_P_H -#define SFTPOUTGOINGPACKET_P_H +#pragma once #include "sftppacket_p.h" #include "sftpdefs.h" @@ -83,5 +82,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SFTPOUTGOINGPACKET_P_H diff --git a/src/libs/ssh/sftppacket_p.h b/src/libs/ssh/sftppacket_p.h index 63e26a279e..b99f7b36d6 100644 --- a/src/libs/ssh/sftppacket_p.h +++ b/src/libs/ssh/sftppacket_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SFTPPACKET_P_H -#define SFTPPACKET_P_H +#pragma once #include <QByteArray> #include <QList> @@ -108,5 +107,3 @@ protected: } // namespace Internal } // namespace QSsh - -#endif // SFTPPACKET_P_H diff --git a/src/libs/ssh/ssh.qbs b/src/libs/ssh/ssh.qbs index 185f397b61..8998d6823c 100644 --- a/src/libs/ssh/ssh.qbs +++ b/src/libs/ssh/ssh.qbs @@ -1,4 +1,5 @@ import qbs 1.0 +import qbs.Environment QtcLibrary { name: "QtcSsh" @@ -46,7 +47,7 @@ QtcLibrary { "sshsendfacility.cpp", "sshsendfacility_p.h", ].concat(botanFiles) - property var useSystemBotan: qbs.getEnv("USE_SYSTEM_BOTAN") === "1" + property var useSystemBotan: Environment.getEnv("USE_SYSTEM_BOTAN") === "1" property var botanIncludes: { var result = ["../3rdparty"]; if (useSystemBotan) diff --git a/src/libs/ssh/ssh_global.h b/src/libs/ssh/ssh_global.h index 4ac4fedaa3..63cfeeaf8c 100644 --- a/src/libs/ssh/ssh_global.h +++ b/src/libs/ssh/ssh_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSH_GLOBAL_H -#define SSH_GLOBAL_H +#pragma once #include <QtGlobal> @@ -38,5 +37,3 @@ #define QSSH_ASSERT(cond) do { if (!(cond)) { QSSH_PRINT_WARNING; } } while (false) #define QSSH_ASSERT_AND_RETURN(cond) do { if (!(cond)) { QSSH_PRINT_WARNING; return; } } while (false) #define QSSH_ASSERT_AND_RETURN_VALUE(cond, value) do { if (!(cond)) { QSSH_PRINT_WARNING; return value; } } while (false) - -#endif // SSH_GLOBAL_H diff --git a/src/libs/ssh/sshbotanconversions_p.h b/src/libs/ssh/sshbotanconversions_p.h index 6213c19881..30849ad25c 100644 --- a/src/libs/ssh/sshbotanconversions_p.h +++ b/src/libs/ssh/sshbotanconversions_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHBOTANCONVERSIONS_P_H -#define SSHBOTANCONVERSIONS_P_H +#pragma once #include "sshcapabilities_p.h" #include "sshexception_p.h" @@ -131,5 +130,3 @@ inline quint32 botanHMacKeyLen(const QByteArray &rfcAlgoName) } // namespace Internal } // namespace QSsh - -#endif // SSHBOTANCONVERSIONS_P_H diff --git a/src/libs/ssh/sshcapabilities_p.h b/src/libs/ssh/sshcapabilities_p.h index 60e043e3ee..46341681b1 100644 --- a/src/libs/ssh/sshcapabilities_p.h +++ b/src/libs/ssh/sshcapabilities_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CAPABILITIES_P_H -#define CAPABILITIES_P_H +#pragma once #include <QByteArray> #include <QList> @@ -82,5 +81,3 @@ public: } // namespace Internal } // namespace QSsh - -#endif // CAPABILITIES_P_H diff --git a/src/libs/ssh/sshchannel_p.h b/src/libs/ssh/sshchannel_p.h index d1b92dc83e..a55567708f 100644 --- a/src/libs/ssh/sshchannel_p.h +++ b/src/libs/ssh/sshchannel_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHCHANNEL_P_H -#define SSHCHANNEL_P_H +#pragma once #include <QByteArray> #include <QObject> @@ -116,5 +115,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SSHCHANNEL_P_H diff --git a/src/libs/ssh/sshchannelmanager_p.h b/src/libs/ssh/sshchannelmanager_p.h index f36b3a7cf1..9f2865e4f3 100644 --- a/src/libs/ssh/sshchannelmanager_p.h +++ b/src/libs/ssh/sshchannelmanager_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHCHANNELMANAGER_P_H -#define SSHCHANNELMANAGER_P_H +#pragma once #include <QHash> #include <QObject> @@ -91,5 +90,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SSHCHANNELMANAGER_P_H diff --git a/src/libs/ssh/sshconnection.h b/src/libs/ssh/sshconnection.h index 6b72c524ef..136c91c199 100644 --- a/src/libs/ssh/sshconnection.h +++ b/src/libs/ssh/sshconnection.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHCONNECTION_H -#define SSHCONNECTION_H +#pragma once #include "ssherrors.h" #include "sshhostkeydatabase.h" @@ -141,5 +140,3 @@ private: }; } // namespace QSsh - -#endif // SSHCONNECTION_H diff --git a/src/libs/ssh/sshconnection_p.h b/src/libs/ssh/sshconnection_p.h index a137276092..06eb959294 100644 --- a/src/libs/ssh/sshconnection_p.h +++ b/src/libs/ssh/sshconnection_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHCONNECTION_P_H -#define SSHCONNECTION_P_H +#pragma once #include "sshconnection.h" #include "sshexception_p.h" @@ -172,5 +171,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SSHCONNECTION_P_H diff --git a/src/libs/ssh/sshconnectionmanager.h b/src/libs/ssh/sshconnectionmanager.h index e3e0c93451..87d6c50145 100644 --- a/src/libs/ssh/sshconnectionmanager.h +++ b/src/libs/ssh/sshconnectionmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHCONNECTIONMANAGER_H -#define SSHCONNECTIONMANAGER_H +#pragma once #include "ssh_global.h" @@ -40,5 +39,3 @@ QSSH_EXPORT void releaseConnection(SshConnection *connection); QSSH_EXPORT void forceNewConnection(const SshConnectionParameters &sshParams); } // namespace QSsh - -#endif // SSHCONNECTIONMANAGER_H diff --git a/src/libs/ssh/sshcryptofacility_p.h b/src/libs/ssh/sshcryptofacility_p.h index ac5e85d3fb..db008207d1 100644 --- a/src/libs/ssh/sshcryptofacility_p.h +++ b/src/libs/ssh/sshcryptofacility_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHCRYPTOFACILITY_P_H -#define SSHCRYPTOFACILITY_P_H +#pragma once #include <botan/botan.h> @@ -137,5 +136,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SSHCRYPTOFACILITY_P_H diff --git a/src/libs/ssh/sshdirecttcpiptunnel.h b/src/libs/ssh/sshdirecttcpiptunnel.h index 9f831ee26a..e242629d6c 100644 --- a/src/libs/ssh/sshdirecttcpiptunnel.h +++ b/src/libs/ssh/sshdirecttcpiptunnel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHDIRECTTCPIPTUNNEL_H -#define SSHDIRECTTCPIPTUNNEL_H +#pragma once #include "ssh_global.h" @@ -79,5 +78,3 @@ private: }; } // namespace QSsh - -#endif // SSHDIRECTTCPIPTUNNEL_H diff --git a/src/libs/ssh/sshdirecttcpiptunnel_p.h b/src/libs/ssh/sshdirecttcpiptunnel_p.h index 438eb71ed0..3d665c0711 100644 --- a/src/libs/ssh/sshdirecttcpiptunnel_p.h +++ b/src/libs/ssh/sshdirecttcpiptunnel_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHDIRECTTCPIPTUNNEL_P_H -#define SSHDIRECTTCPIPTUNNEL_P_H +#pragma once #include "sshchannel_p.h" @@ -75,5 +74,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SSHDIRECTTCPIPTUNNEL_P_H diff --git a/src/libs/ssh/ssherrors.h b/src/libs/ssh/ssherrors.h index a178f92ea8..4c85e071cf 100644 --- a/src/libs/ssh/ssherrors.h +++ b/src/libs/ssh/ssherrors.h @@ -23,7 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHERRORS_P_H +#pragma once #define SSHERRORS_P_H namespace QSsh { @@ -35,5 +35,3 @@ enum SshError { }; } // namespace QSsh - -#endif // SSHERRORS_P_H diff --git a/src/libs/ssh/sshexception_p.h b/src/libs/ssh/sshexception_p.h index 9becda115c..b51ce4b04c 100644 --- a/src/libs/ssh/sshexception_p.h +++ b/src/libs/ssh/sshexception_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHEXCEPTION_P_H -#define SSHEXCEPTION_P_H +#pragma once #include "ssherrors.h" @@ -81,5 +80,3 @@ struct SshClientException } // namespace Internal } // namespace QSsh - -#endif // SSHEXCEPTION_P_H diff --git a/src/libs/ssh/sshhostkeydatabase.h b/src/libs/ssh/sshhostkeydatabase.h index 258087f39f..bd58ab86b5 100644 --- a/src/libs/ssh/sshhostkeydatabase.h +++ b/src/libs/ssh/sshhostkeydatabase.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHHOSTKEYDATABASE_H -#define SSHHOSTKEYDATABASE_H +#pragma once #include "ssh_global.h" @@ -65,5 +64,3 @@ private: }; } // namespace QSsh - -#endif // Include guard. diff --git a/src/libs/ssh/sshincomingpacket_p.h b/src/libs/ssh/sshincomingpacket_p.h index 1bea9369f6..5729108fea 100644 --- a/src/libs/ssh/sshincomingpacket_p.h +++ b/src/libs/ssh/sshincomingpacket_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHINCOMINGPACKET_P_H -#define SSHINCOMINGPACKET_P_H +#pragma once #include "sshpacket_p.h" @@ -196,5 +195,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SSHINCOMINGPACKET_P_H diff --git a/src/libs/ssh/sshkeycreationdialog.h b/src/libs/ssh/sshkeycreationdialog.h index 5d5957ef9f..adeaae0396 100644 --- a/src/libs/ssh/sshkeycreationdialog.h +++ b/src/libs/ssh/sshkeycreationdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHKEYCREATIONDIALOG_H -#define SSHKEYCREATIONDIALOG_H +#pragma once #include "ssh_global.h" @@ -61,5 +60,3 @@ private: }; } // namespace QSsh - -#endif // SSHKEYCREATIONDIALOG_H diff --git a/src/libs/ssh/sshkeyexchange_p.h b/src/libs/ssh/sshkeyexchange_p.h index e4fca79cfa..b56597b6df 100644 --- a/src/libs/ssh/sshkeyexchange_p.h +++ b/src/libs/ssh/sshkeyexchange_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHKEYEXCHANGE_P_H -#define SSHKEYEXCHANGE_P_H +#pragma once #include "sshconnection.h" @@ -92,5 +91,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SSHKEYEXCHANGE_P_H diff --git a/src/libs/ssh/sshkeygenerator.h b/src/libs/ssh/sshkeygenerator.h index c82b2401f8..483614429e 100644 --- a/src/libs/ssh/sshkeygenerator.h +++ b/src/libs/ssh/sshkeygenerator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHKEYGENERATOR_H -#define SSHKEYGENERATOR_H +#pragma once #include "ssh_global.h" @@ -74,5 +73,3 @@ private: }; } // namespace QSsh - -#endif // SSHKEYGENERATOR_H diff --git a/src/libs/ssh/sshkeypasswordretriever_p.h b/src/libs/ssh/sshkeypasswordretriever_p.h index 084e62594b..15301feb67 100644 --- a/src/libs/ssh/sshkeypasswordretriever_p.h +++ b/src/libs/ssh/sshkeypasswordretriever_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef KEYPASSWORDRETRIEVER_H -#define KEYPASSWORDRETRIEVER_H +#pragma once #include <botan/botan.h> @@ -42,5 +41,3 @@ public: } // namespace Internal } // namespace QSsh - -#endif // KEYPASSWORDRETRIEVER_H diff --git a/src/libs/ssh/sshlogging_p.h b/src/libs/ssh/sshlogging_p.h index 7955efe982..07815313e5 100644 --- a/src/libs/ssh/sshlogging_p.h +++ b/src/libs/ssh/sshlogging_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHLOGGING_P_H -#define SSHLOGGING_P_H +#pragma once #include <QLoggingCategory> @@ -33,5 +32,3 @@ namespace Internal { Q_DECLARE_LOGGING_CATEGORY(sshLog) } // namespace Internal } // namespace QSsh - -#endif // Include guard diff --git a/src/libs/ssh/sshoutgoingpacket_p.h b/src/libs/ssh/sshoutgoingpacket_p.h index 8b892038c3..e68b213260 100644 --- a/src/libs/ssh/sshoutgoingpacket_p.h +++ b/src/libs/ssh/sshoutgoingpacket_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHOUTGOINGPACKET_P_H -#define SSHOUTGOINGPACKET_P_H +#pragma once #include "sshpacket_p.h" @@ -106,5 +105,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SSHOUTGOINGPACKET_P_H diff --git a/src/libs/ssh/sshpacket_p.h b/src/libs/ssh/sshpacket_p.h index 6171a12618..64fb65f7ab 100644 --- a/src/libs/ssh/sshpacket_p.h +++ b/src/libs/ssh/sshpacket_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHPACKET_P_H -#define SSHPACKET_P_H +#pragma once #include "sshexception_p.h" @@ -139,5 +138,3 @@ protected: } // namespace Internal } // namespace QSsh - -#endif // SSHPACKET_P_H diff --git a/src/libs/ssh/sshpacketparser_p.h b/src/libs/ssh/sshpacketparser_p.h index 2e41418aec..8dd70511d2 100644 --- a/src/libs/ssh/sshpacketparser_p.h +++ b/src/libs/ssh/sshpacketparser_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHPACKETPARSER_P_H -#define SSHPACKETPARSER_P_H +#pragma once #include <botan/botan.h> @@ -73,5 +72,3 @@ public: } // namespace Internal } // namespace QSsh - -#endif // SSHPACKETPARSER_P_H diff --git a/src/libs/ssh/sshpseudoterminal.h b/src/libs/ssh/sshpseudoterminal.h index 3838e53f91..827d6449e2 100644 --- a/src/libs/ssh/sshpseudoterminal.h +++ b/src/libs/ssh/sshpseudoterminal.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHPSEUDOTERMINAL_H -#define SSHPSEUDOTERMINAL_H +#pragma once #include "ssh_global.h" @@ -109,5 +108,3 @@ class QSSH_EXPORT SshPseudoTerminal }; } // namespace QSsh - -#endif // SSHPSEUDOTERMINAL_H diff --git a/src/libs/ssh/sshremoteprocess.h b/src/libs/ssh/sshremoteprocess.h index b65338bbd8..cd54a03ede 100644 --- a/src/libs/ssh/sshremoteprocess.h +++ b/src/libs/ssh/sshremoteprocess.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHREMOTEPROCESS_H -#define SSHREMOTEPROCESS_H +#pragma once #include "ssh_global.h" @@ -120,5 +119,3 @@ private: }; } // namespace QSsh - -#endif // SSHREMOTEPROCESS_H diff --git a/src/libs/ssh/sshremoteprocess_p.h b/src/libs/ssh/sshremoteprocess_p.h index e4eacea415..edf0648329 100644 --- a/src/libs/ssh/sshremoteprocess_p.h +++ b/src/libs/ssh/sshremoteprocess_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHREMOTEPROCESS_P_H -#define SSHREMOTEPROCESS_P_H +#pragma once #include "sshpseudoterminal.h" @@ -102,5 +101,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SSHREMOTEPROCESS_P_H diff --git a/src/libs/ssh/sshremoteprocessrunner.h b/src/libs/ssh/sshremoteprocessrunner.h index 1d6075560c..a217d0c94c 100644 --- a/src/libs/ssh/sshremoteprocessrunner.h +++ b/src/libs/ssh/sshremoteprocessrunner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHREMOTEPROCESSRUNNER_H -#define SSHREMOTEPROCESSRUNNER_H +#pragma once #include "sshconnection.h" #include "sshremoteprocess.h" @@ -83,5 +82,3 @@ private: }; } // namespace QSsh - -#endif // SSHREMOTEPROCESSRUNNER_H diff --git a/src/libs/ssh/sshsendfacility_p.h b/src/libs/ssh/sshsendfacility_p.h index 4921efb380..ba67464476 100644 --- a/src/libs/ssh/sshsendfacility_p.h +++ b/src/libs/ssh/sshsendfacility_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHSENDFACILITY_P_H -#define SSHSENDFACILITY_P_H +#pragma once #include "sshcryptofacility_p.h" #include "sshoutgoingpacket_p.h" @@ -99,5 +98,3 @@ private: } // namespace Internal } // namespace QSsh - -#endif // SSHSENDFACILITY_P_H diff --git a/src/libs/timeline/timeline_global.h b/src/libs/timeline/timeline_global.h index 82ac552d92..1b2a560fb4 100644 --- a/src/libs/timeline/timeline_global.h +++ b/src/libs/timeline/timeline_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINE_GLOBAL_H -#define TIMELINE_GLOBAL_H +#pragma once #include <QtGlobal> @@ -33,6 +32,3 @@ #else # define TIMELINE_EXPORT Q_DECL_IMPORT #endif - -#endif // TIMELINE_GLOBAL_H - diff --git a/src/libs/timeline/timelineabstractrenderer.h b/src/libs/timeline/timelineabstractrenderer.h index 41df720c42..8ba388e116 100644 --- a/src/libs/timeline/timelineabstractrenderer.h +++ b/src/libs/timeline/timelineabstractrenderer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINEABSTRACTRENDERER_H -#define TIMELINEABSTRACTRENDERER_H +#pragma once #include "timelinezoomcontrol.h" #include "timelinemodel.h" @@ -93,6 +92,3 @@ protected: }; } // namespace Timeline - - -#endif // TIMELINEABSTRACTRENDERER_H diff --git a/src/libs/timeline/timelineabstractrenderer_p.h b/src/libs/timeline/timelineabstractrenderer_p.h index 7beaa7262b..d2c3917e9d 100644 --- a/src/libs/timeline/timelineabstractrenderer_p.h +++ b/src/libs/timeline/timelineabstractrenderer_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINEABSTRACTRENDERER_P_H -#define TIMELINEABSTRACTRENDERER_P_H +#pragma once #include "timelineabstractrenderer.h" @@ -49,6 +48,3 @@ public: }; } - -#endif // TIMELINEABSTRACTRENDERER_P_H - diff --git a/src/libs/timeline/timelineitemsrenderpass.h b/src/libs/timeline/timelineitemsrenderpass.h index 7d4044850f..720f1cd9d5 100644 --- a/src/libs/timeline/timelineitemsrenderpass.h +++ b/src/libs/timeline/timelineitemsrenderpass.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINEITEMSRENDERPASS_H -#define TIMELINEITEMSRENDERPASS_H +#pragma once #include "timelineabstractrenderer.h" #include "timelinerenderpass.h" @@ -81,5 +80,3 @@ protected: }; } // namespace Timeline - -#endif // TIMELINEITEMSRENDERPASS_H diff --git a/src/libs/timeline/timelinemodel.h b/src/libs/timeline/timelinemodel.h index 83ad4012cc..dd9b6701a7 100644 --- a/src/libs/timeline/timelinemodel.h +++ b/src/libs/timeline/timelinemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINEMODEL_H -#define TIMELINEMODEL_H +#pragma once #include "timeline_global.h" #include "timelinerenderpass.h" @@ -149,5 +148,3 @@ private: }; } // namespace Timeline - -#endif // TIMELINEMODEL_H diff --git a/src/libs/timeline/timelinemodel_p.h b/src/libs/timeline/timelinemodel_p.h index 0d775e9eda..dce63be8ed 100644 --- a/src/libs/timeline/timelinemodel_p.h +++ b/src/libs/timeline/timelinemodel_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINEMODEL_P_H -#define TIMELINEMODEL_P_H +#pragma once #include "timelinemodel.h" @@ -146,5 +145,3 @@ private: }; } // namespace Timeline - -#endif // TIMELINEMODEL_P_H diff --git a/src/libs/timeline/timelinemodelaggregator.h b/src/libs/timeline/timelinemodelaggregator.h index 6e27dfde60..17e5d78f1a 100644 --- a/src/libs/timeline/timelinemodelaggregator.h +++ b/src/libs/timeline/timelinemodelaggregator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINEMODELAGGREGATOR_H -#define TIMELINEMODELAGGREGATOR_H +#pragma once #include "timelinemodel.h" #include "timelinenotesmodel.h" @@ -68,5 +67,3 @@ private: }; } // namespace Timeline - -#endif // TIMELINEMODELAGGREGATOR_H diff --git a/src/libs/timeline/timelinenotesmodel.h b/src/libs/timeline/timelinenotesmodel.h index 9f4039df58..2a83136704 100644 --- a/src/libs/timeline/timelinenotesmodel.h +++ b/src/libs/timeline/timelinenotesmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINENOTESMODEL_H -#define TIMELINENOTESMODEL_H +#pragma once #include "timelinemodel.h" @@ -78,5 +77,3 @@ private: }; } // namespace Timeline - -#endif // TIMELINENOTESMODEL_H diff --git a/src/libs/timeline/timelinenotesmodel_p.h b/src/libs/timeline/timelinenotesmodel_p.h index ec02a19be1..455ee8af69 100644 --- a/src/libs/timeline/timelinenotesmodel_p.h +++ b/src/libs/timeline/timelinenotesmodel_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINENOTESMODEL_P_H -#define TIMELINENOTESMODEL_P_H +#pragma once #include "timelinenotesmodel.h" @@ -55,6 +54,3 @@ private: }; } // namespace Timeline - -#endif // TIMELINENOTESMODEL_P_H - diff --git a/src/libs/timeline/timelinenotesrenderpass.h b/src/libs/timeline/timelinenotesrenderpass.h index 75f40ddc4f..4eaa341863 100644 --- a/src/libs/timeline/timelinenotesrenderpass.h +++ b/src/libs/timeline/timelinenotesrenderpass.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINENOTESRENDERPASS_H -#define TIMELINENOTESRENDERPASS_H +#pragma once #include "timelineabstractrenderer.h" #include <QSGMaterial> @@ -45,6 +44,3 @@ private: }; } // namespace Timeline - -#endif // TIMELINENOTESRENDERPASS_H - diff --git a/src/libs/timeline/timelineoverviewrenderer.h b/src/libs/timeline/timelineoverviewrenderer.h index 54548db0eb..d5c946dde7 100644 --- a/src/libs/timeline/timelineoverviewrenderer.h +++ b/src/libs/timeline/timelineoverviewrenderer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINEOVERVIEWRENDERER_H -#define TIMELINEOVERVIEWRENDERER_H +#pragma once #include "timelineabstractrenderer.h" @@ -45,5 +44,3 @@ protected: } // namespace Timeline QML_DECLARE_TYPE(Timeline::TimelineOverviewRenderer) - -#endif // TIMELINEOVERVIEWRENDERER_H diff --git a/src/libs/timeline/timelineoverviewrenderer_p.h b/src/libs/timeline/timelineoverviewrenderer_p.h index bbc79e336e..d45d4d716b 100644 --- a/src/libs/timeline/timelineoverviewrenderer_p.h +++ b/src/libs/timeline/timelineoverviewrenderer_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINEOVERVIEWRENDERER_P_H -#define TIMELINEOVERVIEWRENDERER_P_H +#pragma once #include "timelineoverviewrenderer.h" #include "timelineabstractrenderer_p.h" @@ -42,6 +41,3 @@ public: }; } // namespace Timeline - -#endif // TIMELINEOVERVIEWRENDERER_P_H - diff --git a/src/libs/timeline/timelinerenderer.h b/src/libs/timeline/timelinerenderer.h index 0c6d877329..bd23b30321 100644 --- a/src/libs/timeline/timelinerenderer.h +++ b/src/libs/timeline/timelinerenderer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINERENDERER_H -#define TIMELINERENDERER_H +#pragma once #include "timelinezoomcontrol.h" #include "timelinemodel.h" @@ -71,5 +70,3 @@ private: } // namespace Timeline QML_DECLARE_TYPE(Timeline::TimelineRenderer) - -#endif // TIMELINERENDERER_H diff --git a/src/libs/timeline/timelinerenderer_p.h b/src/libs/timeline/timelinerenderer_p.h index 7ba5dcc685..eccab59f4d 100644 --- a/src/libs/timeline/timelinerenderer_p.h +++ b/src/libs/timeline/timelinerenderer_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINERENDERER_P_H -#define TIMELINERENDERER_P_H +#pragma once #include "timelinerenderer.h" #include "timelineabstractrenderer_p.h" @@ -66,6 +65,3 @@ private: }; } // namespace Timeline - -#endif // TIMELINERENDERER_P_H - diff --git a/src/libs/timeline/timelinerenderpass.h b/src/libs/timeline/timelinerenderpass.h index 60a77744e4..54dbe34388 100644 --- a/src/libs/timeline/timelinerenderpass.h +++ b/src/libs/timeline/timelinerenderpass.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINERENDERPASS_H -#define TIMELINERENDERPASS_H +#pragma once #include "timeline_global.h" #include <QVector> @@ -54,5 +53,3 @@ public: }; } // namespace Timeline - -#endif // TIMELINERENDERPASS_H diff --git a/src/libs/timeline/timelinerenderstate.h b/src/libs/timeline/timelinerenderstate.h index 7cc0a2313c..c4e44da018 100644 --- a/src/libs/timeline/timelinerenderstate.h +++ b/src/libs/timeline/timelinerenderstate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINERENDERSTATE_H -#define TIMELINERENDERSTATE_H +#pragma once #include <QSGNode> #include "timelinerenderpass.h" @@ -68,5 +67,3 @@ private: }; } // namespace Timeline - -#endif // TIMELINERENDERSTATE_H diff --git a/src/libs/timeline/timelinerenderstate_p.h b/src/libs/timeline/timelinerenderstate_p.h index e7967a9ac1..d76dd6b3de 100644 --- a/src/libs/timeline/timelinerenderstate_p.h +++ b/src/libs/timeline/timelinerenderstate_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINERENDERSTATE_P_H -#define TIMELINERENDERSTATE_P_H +#pragma once #include "timelinerenderstate.h" @@ -46,6 +45,3 @@ public: }; } // namespace Timeline - -#endif // TIMELINERENDERSTATE_P_H - diff --git a/src/libs/timeline/timelineselectionrenderpass.h b/src/libs/timeline/timelineselectionrenderpass.h index 15f43f3284..b66328259b 100644 --- a/src/libs/timeline/timelineselectionrenderpass.h +++ b/src/libs/timeline/timelineselectionrenderpass.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINESELECTIONRENDERPASS_H -#define TIMELINESELECTIONRENDERPASS_H +#pragma once #include "timelineabstractrenderer.h" #include "timelinerenderpass.h" @@ -46,6 +45,3 @@ protected: }; } // namespace Timeline - -#endif // TIMELINESELECTIONRENDERPASS_H - diff --git a/src/libs/timeline/timelinezoomcontrol.h b/src/libs/timeline/timelinezoomcontrol.h index 57ef9ae511..2236e754f3 100644 --- a/src/libs/timeline/timelinezoomcontrol.h +++ b/src/libs/timeline/timelinezoomcontrol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIMELINEZOOMCONTROL_H -#define TIMELINEZOOMCONTROL_H +#pragma once #include "timeline_global.h" #include <QTimer> @@ -117,5 +116,3 @@ protected: }; } // namespace Timeline - -#endif // TIMELINEZOOMCONTROL_H diff --git a/src/libs/utils/algorithm.h b/src/libs/utils/algorithm.h index fbb9eda5be..61a0a5d10f 100644 --- a/src/libs/utils/algorithm.h +++ b/src/libs/utils/algorithm.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ALGORITHM_H -#define ALGORITHM_H +#pragma once #include <qcompilerdetection.h> // for Q_REQUIRED_RESULT @@ -430,5 +429,3 @@ inline void sort(Container &c, Predicate p) } } - -#endif // ALGORITHM_H diff --git a/src/libs/utils/annotateditemdelegate.h b/src/libs/utils/annotateditemdelegate.h index 4e054fe25d..c14b1d49d4 100644 --- a/src/libs/utils/annotateditemdelegate.h +++ b/src/libs/utils/annotateditemdelegate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANNOTATEDITEMDELEGATE_H -#define ANNOTATEDITEMDELEGATE_H +#pragma once #include "utils_global.h" @@ -56,5 +55,3 @@ private: }; } // Utils - -#endif // ANNOTATEDITEMDELEGATE_H diff --git a/src/libs/utils/ansiescapecodehandler.h b/src/libs/utils/ansiescapecodehandler.h index 50e3e341bb..0451297621 100644 --- a/src/libs/utils/ansiescapecodehandler.h +++ b/src/libs/utils/ansiescapecodehandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTILS_ANSIESCAPECODEHANDLER_H -#define UTILS_ANSIESCAPECODEHANDLER_H +#pragma once #include "utils_global.h" @@ -60,5 +59,3 @@ private: }; } // namespace Utils - -#endif // UTILS_ANSIESCAPECODEHANDLER_H diff --git a/src/libs/utils/appmainwindow.h b/src/libs/utils/appmainwindow.h index 51e1b72e3c..c93695550d 100644 --- a/src/libs/utils/appmainwindow.h +++ b/src/libs/utils/appmainwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef APPMAINWINDOW_H -#define APPMAINWINDOW_H +#pragma once #include "utils_global.h" #include <QMainWindow> @@ -54,5 +53,3 @@ private: }; } // Utils - -#endif // APPMAINWINDOW_H diff --git a/src/libs/utils/basetreeview.h b/src/libs/utils/basetreeview.h index ec696ba2d8..390fdba321 100644 --- a/src/libs/utils/basetreeview.h +++ b/src/libs/utils/basetreeview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASETREEVIEW_H -#define BASETREEVIEW_H +#pragma once #include "utils_global.h" @@ -72,5 +71,3 @@ private: }; } // namespace Utils - -#endif // BASETREEVIEW_H diff --git a/src/libs/utils/bracematcher.h b/src/libs/utils/bracematcher.h index 910c3549ff..e2fa0928d3 100644 --- a/src/libs/utils/bracematcher.h +++ b/src/libs/utils/bracematcher.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BRACEMATCHER_H -#define BRACEMATCHER_H +#pragma once #include "utils_global.h" @@ -65,5 +64,3 @@ private: }; } // namespace Utils - -#endif // BRACEMATCHER_H diff --git a/src/libs/utils/buildablehelperlibrary.h b/src/libs/utils/buildablehelperlibrary.h index ab5c99bcdf..c818749f2b 100644 --- a/src/libs/utils/buildablehelperlibrary.h +++ b/src/libs/utils/buildablehelperlibrary.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BUILDABLEHELPERLIBRARY_H -#define BUILDABLEHELPERLIBRARY_H +#pragma once #include "environment.h" #include "fileutils.h" @@ -79,5 +78,3 @@ public: }; } - -#endif // BUILDABLEHELPERLIBRARY_H diff --git a/src/libs/utils/categorysortfiltermodel.h b/src/libs/utils/categorysortfiltermodel.h index 9956f69149..a0ae25ff69 100644 --- a/src/libs/utils/categorysortfiltermodel.h +++ b/src/libs/utils/categorysortfiltermodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CATEGORYSORTFILTERMODEL_H -#define CATEGORYSORTFILTERMODEL_H +#pragma once #include "utils_global.h" @@ -42,5 +41,3 @@ protected: }; } // Utils - -#endif // CATEGORYSORTFILTERMODEL_H diff --git a/src/libs/utils/changeset.h b/src/libs/utils/changeset.h index ef2cc559f5..d445237b44 100644 --- a/src/libs/utils/changeset.h +++ b/src/libs/utils/changeset.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHANGESET_H -#define CHANGESET_H +#pragma once #include "utils_global.h" @@ -124,5 +123,3 @@ private: }; } // namespace Utils - -#endif // CHANGESET_H diff --git a/src/libs/utils/checkablemessagebox.cpp b/src/libs/utils/checkablemessagebox.cpp index 3654425133..8813db0bea 100644 --- a/src/libs/utils/checkablemessagebox.cpp +++ b/src/libs/utils/checkablemessagebox.cpp @@ -280,8 +280,7 @@ QMessageBox::StandardButton CheckableMessageBox::dialogButtonBoxToMessageBoxButt bool askAgain(QSettings *settings, const QString &settingsSubKey) { - QTC_CHECK(settings); - if (settings) { + if (QTC_GUARD(settings)) { settings->beginGroup(QLatin1String(kDoNotAskAgainKey)); bool shouldNotAsk = settings->value(settingsSubKey, false).toBool(); settings->endGroup(); diff --git a/src/libs/utils/checkablemessagebox.h b/src/libs/utils/checkablemessagebox.h index 7975da1864..c120098e00 100644 --- a/src/libs/utils/checkablemessagebox.h +++ b/src/libs/utils/checkablemessagebox.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHECKABLEMESSAGEBOX_H -#define CHECKABLEMESSAGEBOX_H +#pragma once #include "utils_global.h" @@ -130,5 +129,3 @@ private: }; } // namespace Utils - -#endif // CHECKABLEMESSAGEBOX_H diff --git a/src/libs/utils/classnamevalidatinglineedit.h b/src/libs/utils/classnamevalidatinglineedit.h index f707008a71..f3ba7acc0c 100644 --- a/src/libs/utils/classnamevalidatinglineedit.h +++ b/src/libs/utils/classnamevalidatinglineedit.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSNAMEVALIDATINGLINEEDIT_H -#define CLASSNAMEVALIDATINGLINEEDIT_H +#pragma once #include "fancylineedit.h" @@ -74,5 +73,3 @@ private: }; } // namespace Utils - -#endif // CLASSNAMEVALIDATINGLINEEDIT_H diff --git a/src/libs/utils/codegeneration.h b/src/libs/utils/codegeneration.h index 41dadf350c..2738d7b27a 100644 --- a/src/libs/utils/codegeneration.h +++ b/src/libs/utils/codegeneration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CODEGENERATION_H -#define CODEGENERATION_H +#pragma once #include "utils_global.h" @@ -69,5 +68,3 @@ void writeClosingNameSpaces(const QStringList &namespaces, QTextStream &str); } // namespace Utils - -#endif // CODEGENERATION_H diff --git a/src/libs/utils/completinglineedit.h b/src/libs/utils/completinglineedit.h index 875262f393..abcced4de3 100644 --- a/src/libs/utils/completinglineedit.h +++ b/src/libs/utils/completinglineedit.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPLETINGLINEEDIT_H -#define COMPLETINGLINEEDIT_H +#pragma once #include "utils_global.h" #include <QLineEdit> @@ -44,5 +43,3 @@ protected: }; } // namespace Utils - -#endif // COMPLETINGLINEEDIT_H diff --git a/src/libs/utils/completingtextedit.h b/src/libs/utils/completingtextedit.h index 6d5e937ccf..666e2f21dd 100644 --- a/src/libs/utils/completingtextedit.h +++ b/src/libs/utils/completingtextedit.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPLETINGTEXTEDIT_H -#define COMPLETINGTEXTEDIT_H +#pragma once #include "utils_global.h" @@ -63,5 +62,3 @@ private: }; } // namespace Utils - -#endif // COMPLETINGTEXTEDIT_H diff --git a/src/libs/utils/consoleprocess.h b/src/libs/utils/consoleprocess.h index d81cdbecff..59a51d98cf 100644 --- a/src/libs/utils/consoleprocess.h +++ b/src/libs/utils/consoleprocess.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONSOLEPROCESS_H -#define CONSOLEPROCESS_H +#pragma once #include "utils_global.h" @@ -135,5 +134,3 @@ private: }; } //namespace Utils - -#endif diff --git a/src/libs/utils/consoleprocess_p.h b/src/libs/utils/consoleprocess_p.h index 8b4e76c850..8fa610a709 100644 --- a/src/libs/utils/consoleprocess_p.h +++ b/src/libs/utils/consoleprocess_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONSOLEPROCESS_P_H -#define CONSOLEPROCESS_P_H +#pragma once #include "consoleprocess.h" #include "environment.h" @@ -79,5 +78,3 @@ struct ConsoleProcessPrivate { }; } //namespace Utils - -#endif diff --git a/src/libs/utils/crumblepath.h b/src/libs/utils/crumblepath.h index 4bc43e2597..d3d1962535 100644 --- a/src/libs/utils/crumblepath.h +++ b/src/libs/utils/crumblepath.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CRUMBLEPATH_H -#define CRUMBLEPATH_H +#pragma once #include "utils_global.h" @@ -73,5 +72,3 @@ private: }; } // namespace Utils - -#endif // CRUMBLEPATH_H diff --git a/src/libs/utils/declarationmacros.h b/src/libs/utils/declarationmacros.h index 24baaee135..4b7b894544 100644 --- a/src/libs/utils/declarationmacros.h +++ b/src/libs/utils/declarationmacros.h @@ -30,4 +30,3 @@ Class &operator=(const Class&) = delete; \ Class(Class&&) = delete; \ Class &operator=(Class&&) = delete; - diff --git a/src/libs/utils/detailsbutton.h b/src/libs/utils/detailsbutton.h index f5754f5d28..3540d8d116 100644 --- a/src/libs/utils/detailsbutton.h +++ b/src/libs/utils/detailsbutton.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DETAILSBUTTON_H -#define DETAILSBUTTON_H +#pragma once #include "utils_global.h" @@ -80,4 +79,3 @@ private: float m_fader; }; } // namespace Utils -#endif // DETAILSBUTTON_H diff --git a/src/libs/utils/detailswidget.h b/src/libs/utils/detailswidget.h index 7170324d7a..5ce8c04f5d 100644 --- a/src/libs/utils/detailswidget.h +++ b/src/libs/utils/detailswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DETAILSWIDGET_H -#define DETAILSWIDGET_H +#pragma once #include "utils_global.h" @@ -101,5 +100,3 @@ private: }; } // namespace Utils - -#endif // DETAILSWIDGET_H diff --git a/src/libs/utils/dropsupport.h b/src/libs/utils/dropsupport.h index 77ec885450..c91f2c5c8a 100644 --- a/src/libs/utils/dropsupport.h +++ b/src/libs/utils/dropsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTILS_DROPSUPPORT_H -#define UTILS_DROPSUPPORT_H +#pragma once #include "utils_global.h" @@ -105,5 +104,3 @@ private: }; } // namespace Utils - -#endif // UTILS_DROPSUPPORT_H diff --git a/src/libs/utils/elfreader.h b/src/libs/utils/elfreader.h index 3df707c920..fe965a0fc8 100644 --- a/src/libs/utils/elfreader.h +++ b/src/libs/utils/elfreader.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTILS_ELFREADER_H -#define UTILS_ELFREADER_H +#pragma once #include "utils_global.h" @@ -189,5 +188,3 @@ public: }; } // namespace Utils - -#endif // UTILS_ELFREADER_H diff --git a/src/libs/utils/elidinglabel.h b/src/libs/utils/elidinglabel.h index 8d7daf5546..fa7bab29d2 100644 --- a/src/libs/utils/elidinglabel.h +++ b/src/libs/utils/elidinglabel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ELIDINGLABEL_H -#define ELIDINGLABEL_H +#pragma once #include "utils_global.h" #include <QLabel> @@ -51,5 +50,3 @@ private: }; } // namespace Utils - -#endif // ELIDINGLABEL_H diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index eeb7f75925..50c32f9a07 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -212,6 +212,26 @@ Environment Environment::systemEnvironment() return *staticSystemEnvironment(); } +const char lcMessages[] = "LC_MESSAGES"; +const char englishLocale[] = "en_US.utf8"; + +void Environment::setupEnglishOutput(Environment *environment) +{ + environment->set(QLatin1String(lcMessages), QLatin1String(englishLocale)); +} + +void Environment::setupEnglishOutput(QProcessEnvironment *environment) +{ + environment->insert(QLatin1String(lcMessages), QLatin1String(englishLocale)); +} + +void Environment::setupEnglishOutput(QStringList *environment) +{ + Environment env(*environment); + setupEnglishOutput(&env); + *environment = env.toStringList(); +} + void Environment::clear() { m_values.clear(); diff --git a/src/libs/utils/environment.h b/src/libs/utils/environment.h index 7e01a877a2..78f51bb7f4 100644 --- a/src/libs/utils/environment.h +++ b/src/libs/utils/environment.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTILS_ENVIRONMENT_H -#define UTILS_ENVIRONMENT_H +#pragma once #include "fileutils.h" #include "hostosinfo.h" @@ -66,6 +65,9 @@ public: explicit Environment(OsType osType = HostOsInfo::hostOs()) : m_osType(osType) {} explicit Environment(const QStringList &env, OsType osType = HostOsInfo::hostOs()); static Environment systemEnvironment(); + static void setupEnglishOutput(Environment *environment); + static void setupEnglishOutput(QProcessEnvironment *environment); + static void setupEnglishOutput(QStringList *environment); QStringList toStringList() const; QProcessEnvironment toProcessEnvironment() const; @@ -115,5 +117,3 @@ private: }; } // namespace Utils - -#endif // UTILS_ENVIRONMENT_H diff --git a/src/libs/utils/environmentmodel.h b/src/libs/utils/environmentmodel.h index 0e658e4f02..171c19b8f2 100644 --- a/src/libs/utils/environmentmodel.h +++ b/src/libs/utils/environmentmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTILS_ENVIRONMENTMODEL_H -#define UTILS_ENVIRONMENTMODEL_H +#pragma once #include "utils_global.h" @@ -76,5 +75,3 @@ private: }; } // namespace Utils - -#endif // UTILS_ENVIRONMENTMODEL_H diff --git a/src/libs/utils/execmenu.h b/src/libs/utils/execmenu.h index 7d5b34bd19..90c3c35673 100644 --- a/src/libs/utils/execmenu.h +++ b/src/libs/utils/execmenu.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXECMENU_H -#define EXECMENU_H +#pragma once #include "utils_global.h" @@ -39,5 +38,3 @@ namespace Utils { QTCREATOR_UTILS_EXPORT QAction *execMenuAtWidget(QMenu *menu, QWidget *widget); } // namespace Utils - -#endif // EXECMENU_H diff --git a/src/libs/utils/executeondestruction.h b/src/libs/utils/executeondestruction.h index 71b69c1aa5..1e95af297d 100644 --- a/src/libs/utils/executeondestruction.h +++ b/src/libs/utils/executeondestruction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXECUTEONDESTRUCTION_H -#define EXECUTEONDESTRUCTION_H +#pragma once #include <functional> @@ -41,5 +40,3 @@ private: }; } // Utils - -#endif // EXECUTEONDESTRUCTION_H diff --git a/src/libs/utils/fadingindicator.h b/src/libs/utils/fadingindicator.h index 31e52ad920..5f4e96436c 100644 --- a/src/libs/utils/fadingindicator.h +++ b/src/libs/utils/fadingindicator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FADINGINDICATOR_H -#define FADINGINDICATOR_H +#pragma once #include "utils_global.h" @@ -45,6 +44,3 @@ QTCREATOR_UTILS_EXPORT void showPixmap(QWidget *parent, const QString &pixmap); } // FadingIndicator } // Utils - -#endif // FADINGINDICATOR_H - diff --git a/src/libs/utils/faketooltip.h b/src/libs/utils/faketooltip.h index ff9cfc3541..3cb5cbeb47 100644 --- a/src/libs/utils/faketooltip.h +++ b/src/libs/utils/faketooltip.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FAKETOOLTIP_H -#define FAKETOOLTIP_H +#pragma once #include "utils_global.h" @@ -45,5 +44,3 @@ protected: }; } // namespace Utils - -#endif // FAKETOOLTIP_H diff --git a/src/libs/utils/fancylineedit.h b/src/libs/utils/fancylineedit.h index fdc85b273a..9df78961bb 100644 --- a/src/libs/utils/fancylineedit.h +++ b/src/libs/utils/fancylineedit.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FANCYLINEEDIT_H -#define FANCYLINEEDIT_H +#pragma once #include "utils_global.h" #include "completinglineedit.h" @@ -182,5 +181,3 @@ private: }; } // namespace Utils - -#endif // FANCYLINEEDIT_H diff --git a/src/libs/utils/fancymainwindow.h b/src/libs/utils/fancymainwindow.h index 1b1cbde4a1..1960bea384 100644 --- a/src/libs/utils/fancymainwindow.h +++ b/src/libs/utils/fancymainwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FANCYMAINWINDOW_H -#define FANCYMAINWINDOW_H +#pragma once #include "utils_global.h" @@ -90,5 +89,3 @@ private: }; } // namespace Utils - -#endif // FANCYMAINWINDOW_H diff --git a/src/libs/utils/fileinprojectfinder.h b/src/libs/utils/fileinprojectfinder.h index d47261939f..4fc3af8ece 100644 --- a/src/libs/utils/fileinprojectfinder.h +++ b/src/libs/utils/fileinprojectfinder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILEINPROJECTFINDER_H -#define FILEINPROJECTFINDER_H +#pragma once #include <utils/utils_global.h> @@ -66,5 +65,3 @@ private: }; } // namespace Utils - -#endif // FILEINPROJECTFINDER_H diff --git a/src/libs/utils/filenamevalidatinglineedit.h b/src/libs/utils/filenamevalidatinglineedit.h index 4fc63a1620..1185723fdf 100644 --- a/src/libs/utils/filenamevalidatinglineedit.h +++ b/src/libs/utils/filenamevalidatinglineedit.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILENAMEVALIDATINGLINEEDIT_H -#define FILENAMEVALIDATINGLINEEDIT_H +#pragma once #include "fancylineedit.h" @@ -79,5 +78,3 @@ private: }; } // namespace Utils - -#endif // FILENAMEVALIDATINGLINEEDIT_H diff --git a/src/libs/utils/filesearch.h b/src/libs/utils/filesearch.h index 39a8fa0661..05cadc261d 100644 --- a/src/libs/utils/filesearch.h +++ b/src/libs/utils/filesearch.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILESEARCH_H -#define FILESEARCH_H +#pragma once #include "utils_global.h" @@ -178,5 +177,3 @@ QTCREATOR_UTILS_EXPORT QString expandRegExpReplacement(const QString &replaceTex QTCREATOR_UTILS_EXPORT QString matchCaseReplacement(const QString &originalText, const QString &replaceText); } // namespace Utils - -#endif // FILESEARCH_H diff --git a/src/libs/utils/filesystemwatcher.h b/src/libs/utils/filesystemwatcher.h index 71c5ab64ce..59f5938204 100644 --- a/src/libs/utils/filesystemwatcher.h +++ b/src/libs/utils/filesystemwatcher.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILESYSTEMWATCHER_H -#define FILESYSTEMWATCHER_H +#pragma once #include "utils_global.h" @@ -82,5 +81,3 @@ private: }; } // namespace Utils - -#endif // FILESYSTEMWATCHER_H diff --git a/src/libs/utils/fileutils.h b/src/libs/utils/fileutils.h index 286ffd02f7..79f5b9ddac 100644 --- a/src/libs/utils/fileutils.h +++ b/src/libs/utils/fileutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILEUTILS_H -#define FILEUTILS_H +#pragma once #include "utils_global.h" @@ -207,5 +206,3 @@ QTCREATOR_UTILS_EXPORT uint qHash(const Utils::FileName &a); QT_END_NAMESPACE Q_DECLARE_METATYPE(Utils::FileName) - -#endif // FILEUTILS_H diff --git a/src/libs/utils/fileutils_mac.h b/src/libs/utils/fileutils_mac.h index 640a8f8a3f..5b66130274 100644 --- a/src/libs/utils/fileutils_mac.h +++ b/src/libs/utils/fileutils_mac.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILEUTILS_MAC_H -#define FILEUTILS_MAC_H +#pragma once #include <QUrl> @@ -36,6 +35,3 @@ QString normalizePathName(const QString &filePath); } // Internal } // Utils - -#endif // FILEUTILS_MAC_H - diff --git a/src/libs/utils/filewizardpage.h b/src/libs/utils/filewizardpage.h index ffcc7dad7e..e0f19d03db 100644 --- a/src/libs/utils/filewizardpage.h +++ b/src/libs/utils/filewizardpage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILEWIZARDPAGE_H -#define FILEWIZARDPAGE_H +#pragma once #include "utils_global.h" @@ -75,5 +74,3 @@ private: }; } // namespace Utils - -#endif // FILEWIZARDPAGE_H diff --git a/src/libs/utils/flowlayout.h b/src/libs/utils/flowlayout.h index fe727107a9..c76472fafb 100644 --- a/src/libs/utils/flowlayout.h +++ b/src/libs/utils/flowlayout.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FLOWLAYOUT_H -#define FLOWLAYOUT_H +#pragma once #include "utils_global.h" @@ -63,5 +62,3 @@ private: }; } // namespace Utils - -#endif // FLOWLAYOUT_H diff --git a/src/libs/utils/functiontraits.h b/src/libs/utils/functiontraits.h index 7b0d44d25a..2544b525d9 100644 --- a/src/libs/utils/functiontraits.h +++ b/src/libs/utils/functiontraits.h @@ -29,6 +29,26 @@ namespace Utils { +/* + struct functionTraits<Function> + { + using ResultType; // Return type of Function + struct argument<unsigned index> + { + using type; // type of Function argument at index (starting with 0) + } + } + + struct functionTakesArgument<Function, unsigned index, ArgumentType>; + + Is derived from std::true_type if Function takes an argument of type ArgumentType at index. + Otherwise derived from std::false_type. +*/ + +//////////////////// +// functionTraits +//////////////////// + // for callables. defined below. template <typename Callable> struct functionTraits; @@ -135,4 +155,34 @@ struct functionTraits<Callable&&> : public functionTraits<Callable> { }; +//////////////////// +// functionTakesArgument +//////////////////// +namespace Internal { + +template <typename HasArity/*true_type or false_type*/, + typename Function, unsigned index, typename T> +struct functionTakesArgumentArityDispatch; + +template <typename Function, unsigned index, typename T> +struct functionTakesArgumentArityDispatch<std::false_type, Function, index, T> + : public std::false_type +{ +}; + +template <typename Function, unsigned index, typename T> +struct functionTakesArgumentArityDispatch<std::true_type, Function, index, T> + : public std::is_same<T, typename functionTraits<Function>::template argument<index>::type> +{ +}; + +} // Internal + +template <typename Function, unsigned index, typename T> +struct functionTakesArgument : public Internal::functionTakesArgumentArityDispatch< + std::integral_constant<bool, (functionTraits<Function>::arity > index)>, + Function, index, T> +{ +}; + } // Utils diff --git a/src/libs/utils/headerviewstretcher.h b/src/libs/utils/headerviewstretcher.h index 2e9190ddeb..e360ff58b1 100644 --- a/src/libs/utils/headerviewstretcher.h +++ b/src/libs/utils/headerviewstretcher.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HEADERVIEWSTRETCHER_H -#define HEADERVIEWSTRETCHER_H +#pragma once #include "utils_global.h" #include <QObject> @@ -46,5 +45,3 @@ public: }; } // namespace Utils - -#endif // HEADERVIEWSTRETCHER_H diff --git a/src/libs/utils/historycompleter.h b/src/libs/utils/historycompleter.h index eaaca115a1..4ab08f8700 100644 --- a/src/libs/utils/historycompleter.h +++ b/src/libs/utils/historycompleter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HISTORYCOMPLETER_H -#define HISTORYCOMPLETER_H +#pragma once #include "utils_global.h" @@ -64,5 +63,3 @@ private: }; } // namespace Utils - -#endif // HISTORYCOMPLETER_H diff --git a/src/libs/utils/hostosinfo.h b/src/libs/utils/hostosinfo.h index 9991c6605b..72327a5c40 100644 --- a/src/libs/utils/hostosinfo.h +++ b/src/libs/utils/hostosinfo.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HOSTOSINFO_H -#define HOSTOSINFO_H +#pragma once #include "utils_global.h" @@ -114,5 +113,3 @@ bool HostOsInfo::isAnyUnixHost() } } // namespace Utils - -#endif // HOSTOSINFO_H diff --git a/src/libs/utils/htmldocextractor.h b/src/libs/utils/htmldocextractor.h index 5b975666d3..f7c82f54a1 100644 --- a/src/libs/utils/htmldocextractor.h +++ b/src/libs/utils/htmldocextractor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HTMLDOCEXTRACTOR_H -#define HTMLDOCEXTRACTOR_H +#pragma once #include "utils_global.h" @@ -87,5 +86,3 @@ private: }; } // namespace Utils - -#endif // HTMLDOCEXTRACTOR_H diff --git a/src/libs/utils/icon.h b/src/libs/utils/icon.h index be012d3fea..8041b838e6 100644 --- a/src/libs/utils/icon.h +++ b/src/libs/utils/icon.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef THEMEHELPER_H -#define THEMEHELPER_H +#pragma once #include "utils_global.h" #include "theme/theme.h" @@ -86,5 +85,3 @@ private: } // namespace Utils Q_DECLARE_OPERATORS_FOR_FLAGS(Utils::Icon::IconStyleOptions) - -#endif // THEMEHELPER_H diff --git a/src/libs/utils/itemviews.h b/src/libs/utils/itemviews.h index 7604bc59bd..5708c6dc4d 100644 --- a/src/libs/utils/itemviews.h +++ b/src/libs/utils/itemviews.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TREEVIEW_H -#define TREEVIEW_H +#pragma once #include "utils_global.h" @@ -122,7 +121,4 @@ public: {} }; - -} - -#endif // TREEVIEW_H +} // Utils diff --git a/src/libs/utils/json.h b/src/libs/utils/json.h index fe4918230f..09b74d8950 100644 --- a/src/libs/utils/json.h +++ b/src/libs/utils/json.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSON_H -#define JSON_H +#pragma once #include "utils_global.h" @@ -417,5 +416,3 @@ private: }; } // namespace Utils - -#endif // JSON_H diff --git a/src/libs/utils/linecolumnlabel.h b/src/libs/utils/linecolumnlabel.h index 1ae57ad292..4eeb55f257 100644 --- a/src/libs/utils/linecolumnlabel.h +++ b/src/libs/utils/linecolumnlabel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LINECOLUMNLABEL_H -#define LINECOLUMNLABEL_H +#pragma once #include "utils_global.h" #include <QLabel> @@ -58,5 +57,3 @@ private: }; } // namespace Utils - -#endif // LINECOLUMNLABEL_H diff --git a/src/libs/utils/listutils.h b/src/libs/utils/listutils.h index 2b32073547..a116801176 100644 --- a/src/libs/utils/listutils.h +++ b/src/libs/utils/listutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LISTUTILS_H -#define LISTUTILS_H +#pragma once #include <QList> @@ -41,5 +40,3 @@ QList<T1> qwConvertList(const QList<T2> &list) } } // namespace Utils - -#endif // LISTUTILS_H diff --git a/src/libs/utils/macroexpander.h b/src/libs/utils/macroexpander.h index eebb315549..a8fd1afdab 100644 --- a/src/libs/utils/macroexpander.h +++ b/src/libs/utils/macroexpander.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTILS_MACROEXPANDER_H -#define UTILS_MACROEXPANDER_H +#pragma once #include "utils_global.h" @@ -103,5 +102,3 @@ private: QTCREATOR_UTILS_EXPORT MacroExpander *globalMacroExpander(); } // namespace Utils - -#endif // UTILS_MACROEXPANDER_H diff --git a/src/libs/utils/mapreduce.h b/src/libs/utils/mapreduce.h index 4258dc4d86..8df540aa0d 100644 --- a/src/libs/utils/mapreduce.h +++ b/src/libs/utils/mapreduce.h @@ -26,11 +26,19 @@ #pragma once #include "utils_global.h" +#include "algorithm.h" #include "runextensions.h" #include <QFutureWatcher> namespace Utils { + +enum class MapReduceOption +{ + Ordered, + Unordered +}; + namespace Internal { class QTCREATOR_UTILS_EXPORT MapReduceObject : public QObject @@ -38,23 +46,27 @@ class QTCREATOR_UTILS_EXPORT MapReduceObject : public QObject Q_OBJECT }; -template <typename Iterator, typename MapResult, typename MapFunction, typename State, typename ReduceResult, typename ReduceFunction> +template <typename ForwardIterator, typename MapResult, typename MapFunction, typename State, typename ReduceResult, typename ReduceFunction> class MapReduceBase : public MapReduceObject { protected: static const int MAX_PROGRESS = 1000000; + // either const or non-const reference wrapper for items from the iterator + using ItemReferenceWrapper = std::reference_wrapper<typename std::remove_reference<typename ForwardIterator::reference>::type>; public: - MapReduceBase(QFutureInterface<ReduceResult> futureInterface, Iterator begin, Iterator end, - const MapFunction &map, State &state, const ReduceFunction &reduce, int size) + MapReduceBase(QFutureInterface<ReduceResult> futureInterface, ForwardIterator begin, ForwardIterator end, + MapFunction &&map, State &state, ReduceFunction &&reduce, + MapReduceOption option, int size) : m_futureInterface(futureInterface), m_iterator(begin), m_end(end), - m_map(map), + m_map(std::forward<MapFunction>(map)), m_state(state), - m_reduce(reduce), + m_reduce(std::forward<ReduceFunction>(reduce)), m_handleProgress(size >= 0), - m_size(size) + m_size(size), + m_option(option) { if (m_handleProgress) // progress is handled by us m_futureInterface.setProgressRange(0, MAX_PROGRESS); @@ -70,7 +82,7 @@ public: } protected: - virtual void reduce(QFutureWatcher<MapResult> *watcher) = 0; + virtual void reduce(QFutureWatcher<MapResult> *watcher, int index) = 0; bool schedule() { @@ -88,7 +100,10 @@ protected: this, &MapReduceBase::updateProgress); } m_mapWatcher.append(watcher); - watcher->setFuture(runAsync(&m_threadPool, m_map, *m_iterator)); + m_watcherIndex.append(m_currentIndex); + ++m_currentIndex; + watcher->setFuture(runAsync(&m_threadPool, std::cref(m_map), + ItemReferenceWrapper(*m_iterator))); ++m_iterator; } return didSchedule; @@ -96,7 +111,10 @@ protected: void mapFinished(QFutureWatcher<MapResult> *watcher) { - m_mapWatcher.removeOne(watcher); // remove so we can schedule next one + int index = m_mapWatcher.indexOf(watcher); + int watcherIndex = m_watcherIndex.at(index); + m_mapWatcher.removeAt(index); // remove so we can schedule next one + m_watcherIndex.removeAt(index); bool didSchedule = false; if (!m_futureInterface.isCanceled()) { // first schedule the next map... @@ -104,7 +122,7 @@ protected: ++m_successfullyFinishedMapCount; updateProgress(); // ...then reduce - reduce(watcher); + reduce(watcher, watcherIndex); } delete watcher; if (!didSchedule && m_mapWatcher.isEmpty()) @@ -140,87 +158,190 @@ protected: QFutureWatcher<void> m_selfWatcher; QFutureInterface<ReduceResult> m_futureInterface; - Iterator m_iterator; - const Iterator m_end; - const MapFunction &m_map; + ForwardIterator m_iterator; + const ForwardIterator m_end; + MapFunction m_map; State &m_state; - const ReduceFunction &m_reduce; + ReduceFunction m_reduce; QEventLoop m_loop; QThreadPool m_threadPool; // for reusing threads QList<QFutureWatcher<MapResult> *> m_mapWatcher; + QList<int> m_watcherIndex; + int m_currentIndex = 0; const bool m_handleProgress; const int m_size; int m_successfullyFinishedMapCount = 0; + MapReduceOption m_option; }; // non-void result of map function. -template <typename Iterator, typename MapResult, typename MapFunction, typename State, typename ReduceResult, typename ReduceFunction> -class MapReduce : public MapReduceBase<Iterator, MapResult, MapFunction, State, ReduceResult, ReduceFunction> +template <typename ForwardIterator, typename MapResult, typename MapFunction, typename State, typename ReduceResult, typename ReduceFunction> +class MapReduce : public MapReduceBase<ForwardIterator, MapResult, MapFunction, State, ReduceResult, ReduceFunction> { - using BaseType = MapReduceBase<Iterator, MapResult, MapFunction, State, ReduceResult, ReduceFunction>; + using BaseType = MapReduceBase<ForwardIterator, MapResult, MapFunction, State, ReduceResult, ReduceFunction>; public: - MapReduce(QFutureInterface<ReduceResult> futureInterface, Iterator begin, Iterator end, - const MapFunction &map, State &state, const ReduceFunction &reduce, int size) - : BaseType(futureInterface, begin, end, map, state, reduce, size) + MapReduce(QFutureInterface<ReduceResult> futureInterface, ForwardIterator begin, ForwardIterator end, + MapFunction &&map, State &state, ReduceFunction &&reduce, MapReduceOption option, int size) + : BaseType(futureInterface, begin, end, std::forward<MapFunction>(map), state, + std::forward<ReduceFunction>(reduce), option, size) { } protected: - void reduce(QFutureWatcher<MapResult> *watcher) override + void reduce(QFutureWatcher<MapResult> *watcher, int index) override + { + if (BaseType::m_option == MapReduceOption::Unordered) { + reduceOne(watcher->future().results()); + } else { + if (m_nextIndex == index) { + // handle this result and all directly following + reduceOne(watcher->future().results()); + ++m_nextIndex; + while (!m_pendingResults.isEmpty() && m_pendingResults.firstKey() == m_nextIndex) { + reduceOne(m_pendingResults.take(m_nextIndex)); + ++m_nextIndex; + } + } else { + // add result to pending results + m_pendingResults.insert(index, watcher->future().results()); + } + } + } + +private: + void reduceOne(const QList<MapResult> &results) { - const int resultCount = watcher->future().resultCount(); + const int resultCount = results.size(); for (int i = 0; i < resultCount; ++i) { Internal::runAsyncImpl(BaseType::m_futureInterface, BaseType::m_reduce, - BaseType::m_state, watcher->future().resultAt(i)); + BaseType::m_state, results.at(i)); } } + QMap<int, QList<MapResult>> m_pendingResults; + int m_nextIndex = 0; }; // specialization for void result of map function. Reducing is a no-op. -template <typename Iterator, typename MapFunction, typename State, typename ReduceResult, typename ReduceFunction> -class MapReduce<Iterator, void, MapFunction, State, ReduceResult, ReduceFunction> : public MapReduceBase<Iterator, void, MapFunction, State, ReduceResult, ReduceFunction> +template <typename ForwardIterator, typename MapFunction, typename State, typename ReduceResult, typename ReduceFunction> +class MapReduce<ForwardIterator, void, MapFunction, State, ReduceResult, ReduceFunction> : public MapReduceBase<ForwardIterator, void, MapFunction, State, ReduceResult, ReduceFunction> { - using BaseType = MapReduceBase<Iterator, void, MapFunction, State, ReduceResult, ReduceFunction>; + using BaseType = MapReduceBase<ForwardIterator, void, MapFunction, State, ReduceResult, ReduceFunction>; public: - MapReduce(QFutureInterface<ReduceResult> futureInterface, Iterator begin, Iterator end, - const MapFunction &map, State &state, const ReduceFunction &reduce, int size) - : BaseType(futureInterface, begin, end, map, state, reduce, size) + MapReduce(QFutureInterface<ReduceResult> futureInterface, ForwardIterator begin, ForwardIterator end, + MapFunction &&map, State &state, ReduceFunction &&reduce, MapReduceOption option, int size) + : BaseType(futureInterface, begin, end, std::forward<MapFunction>(map), state, + std::forward<ReduceFunction>(reduce), option, size) { } protected: - void reduce(QFutureWatcher<void> *) override + void reduce(QFutureWatcher<void> *, int) override { } }; -template <typename Iterator, typename InitFunction, typename MapFunction, typename ReduceResult, +template <typename ResultType, typename Function, typename... Args> +typename functionTraits<Function>::ResultType +callWithMaybeFutureInterfaceDispatch(std::false_type, QFutureInterface<ResultType> &, + Function &&function, Args&&... args) +{ + return function(std::forward<Args>(args)...); +} + +template <typename ResultType, typename Function, typename... Args> +typename functionTraits<Function>::ResultType +callWithMaybeFutureInterfaceDispatch(std::true_type, QFutureInterface<ResultType> &futureInterface, + Function &&function, Args&&... args) +{ + return function(futureInterface, std::forward<Args>(args)...); +} + +template <typename ResultType, typename Function, typename... Args> +typename functionTraits<Function>::ResultType +callWithMaybeFutureInterface(QFutureInterface<ResultType> &futureInterface, + Function &&function, Args&&... args) +{ + return callWithMaybeFutureInterfaceDispatch( + functionTakesArgument<Function, 0, QFutureInterface<ResultType>&>(), + futureInterface, std::forward<Function>(function), std::forward<Args>(args)...); +} + +template <typename ForwardIterator, typename InitFunction, typename MapFunction, typename ReduceResult, typename ReduceFunction, typename CleanUpFunction> -void blockingIteratorMapReduce(QFutureInterface<ReduceResult> &futureInterface, Iterator begin, Iterator end, - const InitFunction &init, const MapFunction &map, - const ReduceFunction &reduce, const CleanUpFunction &cleanup, int size) +void blockingIteratorMapReduce(QFutureInterface<ReduceResult> &futureInterface, ForwardIterator begin, ForwardIterator end, + InitFunction &&init, MapFunction &&map, + ReduceFunction &&reduce, CleanUpFunction &&cleanup, + MapReduceOption option, int size) { - auto state = init(futureInterface); - MapReduce<Iterator, typename Internal::resultType<MapFunction>::type, MapFunction, decltype(state), ReduceResult, ReduceFunction> - mr(futureInterface, begin, end, map, state, reduce, size); + auto state = callWithMaybeFutureInterface<ReduceResult, InitFunction> + (futureInterface, std::forward<InitFunction>(init)); + MapReduce<ForwardIterator, typename Internal::resultType<MapFunction>::type, MapFunction, decltype(state), ReduceResult, ReduceFunction> + mr(futureInterface, begin, end, std::forward<MapFunction>(map), state, + std::forward<ReduceFunction>(reduce), option, size); mr.exec(); - cleanup(futureInterface, state); + callWithMaybeFutureInterface<ReduceResult, CleanUpFunction, typename std::remove_reference<decltype(state)>::type&> + (futureInterface, std::forward<CleanUpFunction>(cleanup), state); } template <typename Container, typename InitFunction, typename MapFunction, typename ReduceResult, typename ReduceFunction, typename CleanUpFunction> -void blockingContainerMapReduce(QFutureInterface<ReduceResult> &futureInterface, const Container &container, - const InitFunction &init, const MapFunction &map, - const ReduceFunction &reduce, const CleanUpFunction &cleanup) +void blockingContainerMapReduce(QFutureInterface<ReduceResult> &futureInterface, Container &&container, + InitFunction &&init, MapFunction &&map, + ReduceFunction &&reduce, CleanUpFunction &&cleanup, + MapReduceOption option) { blockingIteratorMapReduce(futureInterface, std::begin(container), std::end(container), - init, map, reduce, cleanup, container.size()); + std::forward<InitFunction>(init), std::forward<MapFunction>(map), + std::forward<ReduceFunction>(reduce), + std::forward<CleanUpFunction>(cleanup), + option, container.size()); +} + +template <typename Container, typename InitFunction, typename MapFunction, typename ReduceResult, + typename ReduceFunction, typename CleanUpFunction> +void blockingContainerRefMapReduce(QFutureInterface<ReduceResult> &futureInterface, + std::reference_wrapper<Container> containerWrapper, + InitFunction &&init, MapFunction &&map, + ReduceFunction &&reduce, CleanUpFunction &&cleanup, + MapReduceOption option) +{ + blockingContainerMapReduce(futureInterface, containerWrapper.get(), + std::forward<InitFunction>(init), std::forward<MapFunction>(map), + std::forward<ReduceFunction>(reduce), + std::forward<CleanUpFunction>(cleanup), + option); } template <typename ReduceResult> -static void *dummyInit(QFutureInterface<ReduceResult> &) { return nullptr; } +static void *dummyInit() { return nullptr; } + +// copies or moves state to member, and then moves it to the result of the call operator +template <typename State> +struct StateWrapper { + using StateResult = typename std::decay<State>::type; // State is const& or & for lvalues + StateWrapper(State &&state) : m_state(std::forward<State>(state)) { } + StateResult operator()() + { + return std::move(m_state); // invalidates m_state + } + + StateResult m_state; +}; + +// copies or moves reduce function to member, calls the reduce function with state and mapped value +template <typename StateResult, typename MapResult, typename ReduceFunction> +struct ReduceWrapper { + using Reduce = typename std::decay<ReduceFunction>::type; + ReduceWrapper(ReduceFunction &&reduce) : m_reduce(std::forward<ReduceFunction>(reduce)) { } + void operator()(QFutureInterface<StateResult> &, StateResult &state, const MapResult &mapResult) + { + m_reduce(state, mapResult); + } + + Reduce m_reduce; +}; template <typename MapResult> struct DummyReduce { @@ -232,25 +353,34 @@ struct DummyReduce<void> { }; template <typename ReduceResult> -static void dummyCleanup(QFutureInterface<ReduceResult> &, void *) { } +static void dummyCleanup(void *) { } + +template <typename StateResult> +static void cleanupReportingState(QFutureInterface<StateResult> &fi, StateResult &state) +{ + fi.reportResult(state); +} } // Internal -template <typename Iterator, typename InitFunction, typename MapFunction, +template <typename ForwardIterator, typename InitFunction, typename MapFunction, typename ReduceFunction, typename CleanUpFunction, typename ReduceResult = typename Internal::resultType<ReduceFunction>::type> QFuture<ReduceResult> -mapReduce(Iterator begin, Iterator end, const InitFunction &init, const MapFunction &map, - const ReduceFunction &reduce, const CleanUpFunction &cleanup, int size = -1) +mapReduce(ForwardIterator begin, ForwardIterator end, InitFunction &&init, MapFunction &&map, + ReduceFunction &&reduce, CleanUpFunction &&cleanup, + MapReduceOption option = MapReduceOption::Unordered, int size = -1) { return runAsync(Internal::blockingIteratorMapReduce< - Iterator, - typename std::decay<InitFunction>::type, - typename std::decay<MapFunction>::type, - typename std::decay<ReduceResult>::type, - typename std::decay<ReduceFunction>::type, - typename std::decay<CleanUpFunction>::type>, - begin, end, init, map, reduce, cleanup, size); + ForwardIterator, + typename std::decay<InitFunction>::type, + typename std::decay<MapFunction>::type, + typename std::decay<ReduceResult>::type, + typename std::decay<ReduceFunction>::type, + typename std::decay<CleanUpFunction>::type>, + begin, end, std::forward<InitFunction>(init), std::forward<MapFunction>(map), + std::forward<ReduceFunction>(reduce), std::forward<CleanUpFunction>(cleanup), + option, size); } /*! @@ -273,7 +403,10 @@ mapReduce(Iterator begin, Iterator end, const InitFunction &init, const MapFunct mapReduce. Container<ItemType> + StateType InitFunction(QFutureInterface<ReduceResultType>&) + or + StateType InitFunction() void MapFunction(QFutureInterface<MapResultType>&, const ItemType&) or @@ -284,35 +417,169 @@ mapReduce(Iterator begin, Iterator end, const InitFunction &init, const MapFunct ReduceResultType ReduceFunction(StateType&, const ItemType&) void CleanUpFunction(QFutureInterface<ReduceResultType>&, StateType&) + or + void CleanUpFunction(StateType&) + + Notes: + \list + \li Container can be a move-only type or a temporary. If it is a lvalue reference, it will + be copied to the mapReduce thread. You can avoid that by using + the version that takes iterators, or by using std::ref/cref to pass a reference_wrapper. + \li ItemType can be a move-only type, if the map function takes (const) references to ItemType. + \li StateType can be a move-only type. + \li The init, map, reduce and cleanup functions can be move-only types and are moved to the + mapReduce thread if they are rvalues. + \endlist + */ template <typename Container, typename InitFunction, typename MapFunction, typename ReduceFunction, typename CleanUpFunction, typename ReduceResult = typename Internal::resultType<ReduceFunction>::type> QFuture<ReduceResult> -mapReduce(const Container &container, const InitFunction &init, const MapFunction &map, - const ReduceFunction &reduce, const CleanUpFunction &cleanup) +mapReduce(Container &&container, InitFunction &&init, MapFunction &&map, + ReduceFunction &&reduce, CleanUpFunction &&cleanup, + MapReduceOption option = MapReduceOption::Unordered) { return runAsync(Internal::blockingContainerMapReduce< - typename std::decay<Container>::type, - typename std::decay<InitFunction>::type, - typename std::decay<MapFunction>::type, - typename std::decay<ReduceResult>::type, - typename std::decay<ReduceFunction>::type, - typename std::decay<CleanUpFunction>::type>, - container, init, map, reduce, cleanup); + typename std::decay<Container>::type, + typename std::decay<InitFunction>::type, + typename std::decay<MapFunction>::type, + typename std::decay<ReduceResult>::type, typename std::decay<ReduceFunction>::type, + typename std::decay<CleanUpFunction>::type>, + std::forward<Container>(container), + std::forward<InitFunction>(init), std::forward<MapFunction>(map), + std::forward<ReduceFunction>(reduce), std::forward<CleanUpFunction>(cleanup), + option); +} + +template <typename Container, typename InitFunction, typename MapFunction, + typename ReduceFunction, typename CleanUpFunction, + typename ReduceResult = typename Internal::resultType<ReduceFunction>::type> +QFuture<ReduceResult> +mapReduce(std::reference_wrapper<Container> containerWrapper, InitFunction &&init, MapFunction &&map, + ReduceFunction &&reduce, CleanUpFunction &&cleanup, + MapReduceOption option = MapReduceOption::Unordered) +{ + return runAsync(Internal::blockingContainerRefMapReduce< + Container, + typename std::decay<InitFunction>::type, + typename std::decay<MapFunction>::type, + typename std::decay<ReduceResult>::type, + typename std::decay<ReduceFunction>::type, + typename std::decay<CleanUpFunction>::type>, + containerWrapper, + std::forward<InitFunction>(init), std::forward<MapFunction>(map), + std::forward<ReduceFunction>(reduce), std::forward<CleanUpFunction>(cleanup), + option); +} + +template <typename ForwardIterator, typename MapFunction, typename State, typename ReduceFunction, + typename StateResult = typename std::decay<State>::type, // State = T& or const T& for lvalues, so decay that away + typename MapResult = typename Internal::resultType<MapFunction>::type> +QFuture<StateResult> +mapReduce(ForwardIterator begin, ForwardIterator end, MapFunction &&map, State &&initialState, + ReduceFunction &&reduce, MapReduceOption option = MapReduceOption::Unordered, int size = -1) +{ + return mapReduce(begin, end, + Internal::StateWrapper<State>(std::forward<State>(initialState)), + std::forward<MapFunction>(map), + Internal::ReduceWrapper<StateResult, MapResult, ReduceFunction>(std::forward<ReduceFunction>(reduce)), + &Internal::cleanupReportingState<StateResult>, + option, size); +} + +template <typename Container, typename MapFunction, typename State, typename ReduceFunction, + typename StateResult = typename std::decay<State>::type, // State = T& or const T& for lvalues, so decay that away + typename MapResult = typename Internal::resultType<MapFunction>::type> +QFuture<StateResult> +mapReduce(Container &&container, MapFunction &&map, State &&initialState, ReduceFunction &&reduce, + MapReduceOption option = MapReduceOption::Unordered) +{ + return mapReduce(std::forward<Container>(container), + Internal::StateWrapper<State>(std::forward<State>(initialState)), + std::forward<MapFunction>(map), + Internal::ReduceWrapper<StateResult, MapResult, ReduceFunction>(std::forward<ReduceFunction>(reduce)), + &Internal::cleanupReportingState<StateResult>, + option); +} + +template <typename ForwardIterator, typename MapFunction, typename State, typename ReduceFunction, + typename StateResult = typename std::decay<State>::type, // State = T& or const T& for lvalues, so decay that away + typename MapResult = typename Internal::resultType<MapFunction>::type> +Q_REQUIRED_RESULT +StateResult +mappedReduced(ForwardIterator begin, ForwardIterator end, MapFunction &&map, State &&initialState, + ReduceFunction &&reduce, MapReduceOption option = MapReduceOption::Unordered, int size = -1) +{ + return mapReduce(begin, end, + std::forward<MapFunction>(map), std::forward<State>(initialState), + std::forward<ReduceFunction>(reduce), + option, size).result(); +} + +template <typename Container, typename MapFunction, typename State, typename ReduceFunction, + typename StateResult = typename std::decay<State>::type, // State = T& or const T& for lvalues, so decay that away + typename MapResult = typename Internal::resultType<MapFunction>::type> +Q_REQUIRED_RESULT +StateResult +mappedReduced(Container &&container, MapFunction &&map, State &&initialState, ReduceFunction &&reduce, + MapReduceOption option = MapReduceOption::Unordered) +{ + return mapReduce(std::forward<Container>(container), std::forward<MapFunction>(map), + std::forward<State>(initialState), std::forward<ReduceFunction>(reduce), + option).result(); +} + +template <typename ForwardIterator, typename MapFunction, + typename MapResult = typename Internal::resultType<MapFunction>::type> +QFuture<MapResult> +map(ForwardIterator begin, ForwardIterator end, MapFunction &&map, + MapReduceOption option = MapReduceOption::Ordered, int size = -1) +{ + return mapReduce(begin, end, + &Internal::dummyInit<MapResult>, + std::forward<MapFunction>(map), + Internal::DummyReduce<MapResult>(), + &Internal::dummyCleanup<MapResult>, + option, size); } -// TODO: Currently does not order its map results. template <typename Container, typename MapFunction, typename MapResult = typename Internal::resultType<MapFunction>::type> QFuture<MapResult> -map(const Container &container, const MapFunction &map) +map(Container &&container, MapFunction &&map, MapReduceOption option = MapReduceOption::Ordered) { - return mapReduce(container, + return mapReduce(std::forward<Container>(container), Internal::dummyInit<MapResult>, - map, + std::forward<MapFunction>(map), Internal::DummyReduce<MapResult>(), - Internal::dummyCleanup<MapResult>); + Internal::dummyCleanup<MapResult>, + option); +} + +template <template<typename> class ResultContainer, typename ForwardIterator, typename MapFunction, + typename MapResult = typename Internal::resultType<MapFunction>::type> +Q_REQUIRED_RESULT +ResultContainer<MapResult> +mapped(ForwardIterator begin, ForwardIterator end, MapFunction &&mapFun, + MapReduceOption option = MapReduceOption::Ordered, int size = -1) +{ + return Utils::transform<ResultContainer>(map(begin, end, + std::forward<MapFunction>(mapFun), + option, size).results(), + [](const MapResult &r) { return r; }); +} + +template <template<typename> class ResultContainer, typename Container, typename MapFunction, + typename MapResult = typename Internal::resultType<MapFunction>::type> +Q_REQUIRED_RESULT +ResultContainer<MapResult> +mapped(Container &&container, MapFunction &&mapFun, MapReduceOption option = MapReduceOption::Ordered) +{ + return Utils::transform<ResultContainer>(map(container, + std::forward<MapFunction>(mapFun), + option).results(), + [](const MapResult &r) { return r; }); } } // Utils diff --git a/src/libs/utils/mimetypes/mimedatabase.h b/src/libs/utils/mimetypes/mimedatabase.h index 884d5a7552..7d69cde501 100644 --- a/src/libs/utils/mimetypes/mimedatabase.h +++ b/src/libs/utils/mimetypes/mimedatabase.h @@ -37,8 +37,7 @@ ** ****************************************************************************/ -#ifndef XMIMEDATABASE_H -#define XMIMEDATABASE_H +#pragma once #include "mimetype.h" #include "mimemagicrule_p.h" @@ -103,5 +102,3 @@ private: }; } // Utils - -#endif // MIMEDATABASE_H diff --git a/src/libs/utils/mimetypes/mimedatabase_p.h b/src/libs/utils/mimetypes/mimedatabase_p.h index a1cc7c3769..b576cada8f 100644 --- a/src/libs/utils/mimetypes/mimedatabase_p.h +++ b/src/libs/utils/mimetypes/mimedatabase_p.h @@ -37,8 +37,7 @@ ** ****************************************************************************/ -#ifndef MIMEDATABASE_P_H -#define MIMEDATABASE_P_H +#pragma once // // W A R N I N G @@ -101,5 +100,3 @@ public: } // Internal } // Utils - -#endif // MIMEDATABASE_P_H diff --git a/src/libs/utils/mimetypes/mimeglobpattern_p.h b/src/libs/utils/mimetypes/mimeglobpattern_p.h index 5816a634e6..863c432653 100644 --- a/src/libs/utils/mimetypes/mimeglobpattern_p.h +++ b/src/libs/utils/mimetypes/mimeglobpattern_p.h @@ -37,8 +37,7 @@ ** ****************************************************************************/ -#ifndef MIMEGLOBPATTERN_P_H -#define MIMEGLOBPATTERN_P_H +#pragma once // // W A R N I N G @@ -153,5 +152,3 @@ public: } // Internal } // Utils - -#endif // MIMEGLOBPATTERN_P_H diff --git a/src/libs/utils/mimetypes/mimemagicrule_p.h b/src/libs/utils/mimetypes/mimemagicrule_p.h index 2d55619e46..e1c8017903 100644 --- a/src/libs/utils/mimetypes/mimemagicrule_p.h +++ b/src/libs/utils/mimetypes/mimemagicrule_p.h @@ -37,8 +37,7 @@ ** ****************************************************************************/ -#ifndef MIMEMAGICRULE_P_H -#define MIMEMAGICRULE_P_H +#pragma once // // W A R N I N G @@ -107,5 +106,3 @@ private: QT_BEGIN_NAMESPACE Q_DECLARE_TYPEINFO(Utils::Internal::MimeMagicRule, Q_MOVABLE_TYPE); QT_END_NAMESPACE - -#endif // MIMEMAGICRULE_H diff --git a/src/libs/utils/mimetypes/mimemagicrulematcher_p.h b/src/libs/utils/mimetypes/mimemagicrulematcher_p.h index f57cfd5a62..dd54f515d9 100644 --- a/src/libs/utils/mimetypes/mimemagicrulematcher_p.h +++ b/src/libs/utils/mimetypes/mimemagicrulematcher_p.h @@ -37,8 +37,7 @@ ** ****************************************************************************/ -#ifndef MIMEMAGICRULEMATCHER_P_H -#define MIMEMAGICRULEMATCHER_P_H +#pragma once // // W A R N I N G @@ -86,5 +85,3 @@ private: } // Internal } // Utils - -#endif // MIMEMAGICRULEMATCHER_P_H diff --git a/src/libs/utils/mimetypes/mimeprovider_p.h b/src/libs/utils/mimetypes/mimeprovider_p.h index 44a7bbdd52..267a54fbaf 100644 --- a/src/libs/utils/mimetypes/mimeprovider_p.h +++ b/src/libs/utils/mimetypes/mimeprovider_p.h @@ -37,8 +37,7 @@ ** ****************************************************************************/ -#ifndef MIMEPROVIDER_P_H -#define MIMEPROVIDER_P_H +#pragma once // // W A R N I N G @@ -191,5 +190,3 @@ private: } // Internal } // Utils - -#endif // MIMEPROVIDER_P_H diff --git a/src/libs/utils/mimetypes/mimetype.h b/src/libs/utils/mimetypes/mimetype.h index 39ce6a7753..8b47696d7d 100644 --- a/src/libs/utils/mimetypes/mimetype.h +++ b/src/libs/utils/mimetypes/mimetype.h @@ -37,8 +37,7 @@ ** ****************************************************************************/ -#ifndef MIMETYPE_H -#define MIMETYPE_H +#pragma once #include <utils/utils_global.h> @@ -132,5 +131,3 @@ class QDebug; QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug debug, const Utils::MimeType &mime); QT_END_NAMESPACE #endif - -#endif // MIMETYPE_H diff --git a/src/libs/utils/mimetypes/mimetype_p.h b/src/libs/utils/mimetypes/mimetype_p.h index 5e2260a7f4..c143a0d01b 100644 --- a/src/libs/utils/mimetypes/mimetype_p.h +++ b/src/libs/utils/mimetypes/mimetype_p.h @@ -37,8 +37,7 @@ ** ****************************************************************************/ -#ifndef MIMETYPE_P_H -#define MIMETYPE_P_H +#pragma once // // W A R N I N G @@ -119,5 +118,3 @@ public: } \ QT_END_NAMESPACE #endif - -#endif // MIMETYPE_P_H diff --git a/src/libs/utils/mimetypes/mimetypeparser_p.h b/src/libs/utils/mimetypes/mimetypeparser_p.h index 1cae1fc9d9..2cc47fd30c 100644 --- a/src/libs/utils/mimetypes/mimetypeparser_p.h +++ b/src/libs/utils/mimetypes/mimetypeparser_p.h @@ -37,8 +37,7 @@ ** ****************************************************************************/ -#ifndef MIMETYPEPARSER_P_H -#define MIMETYPEPARSER_P_H +#pragma once // // W A R N I N G @@ -130,5 +129,3 @@ private: } // Internal } // Utils - -#endif // MIMETYPEPARSER_P_H diff --git a/src/libs/utils/navigationtreeview.h b/src/libs/utils/navigationtreeview.h index 6222dd7bed..4718a96b3e 100644 --- a/src/libs/utils/navigationtreeview.h +++ b/src/libs/utils/navigationtreeview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NAVIGATIONTREEVIEW_H -#define NAVIGATIONTREEVIEW_H +#pragma once #include "utils_global.h" @@ -45,5 +44,3 @@ protected: }; } // Utils - -#endif // NAVIGATIONTREEVIEW_H diff --git a/src/libs/utils/networkaccessmanager.h b/src/libs/utils/networkaccessmanager.h index a258e1c4e8..d1f92379c5 100644 --- a/src/libs/utils/networkaccessmanager.h +++ b/src/libs/utils/networkaccessmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NETWORKACCESSMANAGER_H -#define NETWORKACCESSMANAGER_H +#pragma once #include "utils_global.h" @@ -48,5 +47,3 @@ protected: } // namespace utils - -#endif // NETWORKACCESSMANAGER_H diff --git a/src/libs/utils/newclasswidget.h b/src/libs/utils/newclasswidget.h index cbda607b5e..18a5029f5b 100644 --- a/src/libs/utils/newclasswidget.h +++ b/src/libs/utils/newclasswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NEWCLASSWIDGET_H -#define NEWCLASSWIDGET_H +#pragma once #include "utils_global.h" @@ -166,5 +165,3 @@ private: }; } // namespace Utils - -#endif // NEWCLASSWIDGET_H diff --git a/src/libs/utils/osspecificaspects.h b/src/libs/utils/osspecificaspects.h index 04fba72223..15609794c9 100644 --- a/src/libs/utils/osspecificaspects.h +++ b/src/libs/utils/osspecificaspects.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTC_OSSPECIFICASPECTS_H -#define QTC_OSSPECIFICASPECTS_H +#pragma once #include "utils_global.h" @@ -66,5 +65,3 @@ private: }; } // namespace Utils - -#endif // Include guard. diff --git a/src/libs/utils/outputformat.h b/src/libs/utils/outputformat.h index a3ce484323..6a5f495de0 100644 --- a/src/libs/utils/outputformat.h +++ b/src/libs/utils/outputformat.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OUTPUTFORMAT_H -#define OUTPUTFORMAT_H +#pragma once namespace Utils { @@ -41,5 +40,3 @@ enum OutputFormat }; } // namespace Utils - -#endif // OUTPUTFORMATR_H diff --git a/src/libs/utils/outputformatter.h b/src/libs/utils/outputformatter.h index ecb6ba9580..def0172f42 100644 --- a/src/libs/utils/outputformatter.h +++ b/src/libs/utils/outputformatter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OUTPUTFORMATTER_H -#define OUTPUTFORMATTER_H +#pragma once #include "utils_global.h" #include "outputformat.h" @@ -73,5 +72,3 @@ private: }; } // namespace Utils - -#endif // OUTPUTFORMATTER_H diff --git a/src/libs/utils/overridecursor.h b/src/libs/utils/overridecursor.h index b29350a9c4..5ca2bb5800 100644 --- a/src/libs/utils/overridecursor.h +++ b/src/libs/utils/overridecursor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OVERRIDECURSOR_H -#define OVERRIDECURSOR_H +#pragma once #include "utils_global.h" @@ -45,5 +44,3 @@ private: }; } - -#endif // OVERRIDECURSOR_H diff --git a/src/libs/utils/parameteraction.h b/src/libs/utils/parameteraction.h index f5743b383c..a402844987 100644 --- a/src/libs/utils/parameteraction.h +++ b/src/libs/utils/parameteraction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PARAMETERACTION_H -#define PARAMETERACTION_H +#pragma once #include "utils_global.h" @@ -66,5 +65,3 @@ private: }; } // namespace Utils - -#endif // PARAMETERACTION_H diff --git a/src/libs/utils/pathchooser.h b/src/libs/utils/pathchooser.h index 1e9ab523ce..17b572310d 100644 --- a/src/libs/utils/pathchooser.h +++ b/src/libs/utils/pathchooser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PATHCHOOSER_H -#define PATHCHOOSER_H +#pragma once #include "fancylineedit.h" #include "fileutils.h" @@ -178,6 +177,3 @@ private: }; } // namespace Utils - - -#endif // PATHCHOOSER_H diff --git a/src/libs/utils/pathlisteditor.h b/src/libs/utils/pathlisteditor.h index e95fc1e4f9..8636450406 100644 --- a/src/libs/utils/pathlisteditor.h +++ b/src/libs/utils/pathlisteditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PATHLISTEDITOR_H -#define PATHLISTEDITOR_H +#pragma once #include "utils_global.h" @@ -78,5 +77,3 @@ private: }; } // namespace Utils - -#endif // PATHLISTEDITOR_H diff --git a/src/libs/utils/persistentsettings.h b/src/libs/utils/persistentsettings.h index 6e5fd5c598..e424a5fbc1 100644 --- a/src/libs/utils/persistentsettings.h +++ b/src/libs/utils/persistentsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PERSISTENTSETTINGS_H -#define PERSISTENTSETTINGS_H +#pragma once #include "fileutils.h" @@ -67,5 +66,3 @@ private: }; } // namespace Utils - -#endif // PERSISTENTSETTINGS_H diff --git a/src/libs/utils/port.h b/src/libs/utils/port.h index 1fe429aa11..c5faad5834 100644 --- a/src/libs/utils/port.h +++ b/src/libs/utils/port.h @@ -23,10 +23,10 @@ ** ****************************************************************************/ -#ifndef UTILS_PORT_H -#define UTILS_PORT_H +#pragma once #include "utils_global.h" +#include "qtcassert.h" namespace Utils { @@ -35,14 +35,28 @@ class QTCREATOR_UTILS_EXPORT Port public: Port() : m_port(-1) {} explicit Port(quint16 port) : m_port(port) {} + explicit Port(int port) : + m_port((port < 0 || port > std::numeric_limits<quint16>::max()) ? -1 : port) + { + } - quint16 number() const { return quint16(m_port); } + explicit Port(uint port) : + m_port(port > std::numeric_limits<quint16>::max() ? -1 : port) + { + } + + quint16 number() const { QTC_ASSERT(isValid(), return 0); return quint16(m_port); } bool isValid() const { return m_port != -1; } private: int m_port; }; -} // Utils +inline bool operator<(const Port &p1, const Port &p2) { return p1.number() < p2.number(); } +inline bool operator<=(const Port &p1, const Port &p2) { return p1.number() <= p2.number(); } +inline bool operator>(const Port &p1, const Port &p2) { return p1.number() > p2.number(); } +inline bool operator>=(const Port &p1, const Port &p2) { return p1.number() >= p2.number(); } +inline bool operator==(const Port &p1, const Port &p2) { return p1.number() == p2.number(); } +inline bool operator!=(const Port &p1, const Port &p2) { return p1.number() != p2.number(); } -#endif // UTILS_PORT_H +} // Utils diff --git a/src/libs/utils/portlist.cpp b/src/libs/utils/portlist.cpp index 63033b675e..d78cd24b23 100644 --- a/src/libs/utils/portlist.cpp +++ b/src/libs/utils/portlist.cpp @@ -35,7 +35,7 @@ namespace Utils { namespace Internal { namespace { -typedef QPair<int, int> Range; +typedef QPair<Port, Port> Range; class PortsSpecParser { @@ -82,19 +82,19 @@ private: void parseElem() { - const int startPort = parsePort(); + const Port startPort = parsePort(); if (atEnd() || nextChar() != '-') { m_portList.addPort(startPort); return; } ++m_pos; - const int endPort = parsePort(); + const Port endPort = parsePort(); if (endPort < startPort) throw ParseException("Invalid range (end < start)."); m_portList.addRange(startPort, endPort); } - int parsePort() + Port parsePort() { if (atEnd()) throw ParseException("Empty port string."); @@ -108,7 +108,7 @@ private: } while (!atEnd()); if (port == 0 || port >= 2 << 16) throw ParseException("Invalid port value."); - return port; + return Port(port); } bool atEnd() const { return m_pos == m_portsSpec.length(); } @@ -153,16 +153,16 @@ PortList PortList::fromString(const QString &portsSpec) return Internal::PortsSpecParser(portsSpec).parse(); } -void PortList::addPort(int port) { addRange(port, port); } +void PortList::addPort(Port port) { addRange(port, port); } -void PortList::addRange(int startPort, int endPort) +void PortList::addRange(Port startPort, Port endPort) { d->ranges << Internal::Range(startPort, endPort); } bool PortList::hasMore() const { return !d->ranges.isEmpty(); } -bool PortList::contains(int port) const +bool PortList::contains(Port port) const { foreach (const Internal::Range &r, d->ranges) { if (port >= r.first && port <= r.second) @@ -175,16 +175,17 @@ int PortList::count() const { int n = 0; foreach (const Internal::Range &r, d->ranges) - n += r.second - r.first + 1; + n += r.second.number() - r.first.number() + 1; return n; } -int PortList::getNext() +Port PortList::getNext() { Q_ASSERT(!d->ranges.isEmpty()); Internal::Range &firstRange = d->ranges.first(); - const int next = firstRange.first++; + const Port next = firstRange.first; + firstRange.first = Port(firstRange.first.number() + 1); if (firstRange.first > firstRange.second) d->ranges.removeFirst(); return next; @@ -194,9 +195,9 @@ QString PortList::toString() const { QString stringRep; foreach (const Internal::Range &range, d->ranges) { - stringRep += QString::number(range.first); + stringRep += QString::number(range.first.number()); if (range.second != range.first) - stringRep += QLatin1Char('-') + QString::number(range.second); + stringRep += QLatin1Char('-') + QString::number(range.second.number()); stringRep += QLatin1Char(','); } if (!stringRep.isEmpty()) diff --git a/src/libs/utils/portlist.h b/src/libs/utils/portlist.h index 289a280ca7..49adf3ae0b 100644 --- a/src/libs/utils/portlist.h +++ b/src/libs/utils/portlist.h @@ -23,10 +23,10 @@ ** ****************************************************************************/ -#ifndef PORTLIST_H -#define PORTLIST_H +#pragma once #include "utils_global.h" +#include "port.h" QT_FORWARD_DECLARE_CLASS(QString) @@ -41,12 +41,12 @@ public: PortList &operator=(const PortList &other); ~PortList(); - void addPort(int port); - void addRange(int startPort, int endPort); + void addPort(Port port); + void addRange(Port startPort, Port endPort); bool hasMore() const; - bool contains(int port) const; + bool contains(Port port) const; int count() const; - int getNext(); + Port getNext(); QString toString() const; static PortList fromString(const QString &portsSpec); @@ -57,5 +57,3 @@ private: }; } // namespace Utils - -#endif // PORTLIST_H diff --git a/src/libs/utils/progressindicator.h b/src/libs/utils/progressindicator.h index 98c63fde8c..4fee8b1956 100644 --- a/src/libs/utils/progressindicator.h +++ b/src/libs/utils/progressindicator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROGRESSINDICATOR_H -#define PROGRESSINDICATOR_H +#pragma once #include "utils_global.h" @@ -72,5 +71,3 @@ private: }; } // Utils - -#endif // PROGRESSINDICATOR_H diff --git a/src/libs/utils/projectintropage.h b/src/libs/utils/projectintropage.h index 4a6798f624..eb26a839c2 100644 --- a/src/libs/utils/projectintropage.h +++ b/src/libs/utils/projectintropage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROJECTINTROPAGE_H -#define PROJECTINTROPAGE_H +#pragma once #include "utils_global.h" #include "wizardpage.h" @@ -89,5 +88,3 @@ private: }; } // namespace Utils - -#endif // PROJECTINTROPAGE_H diff --git a/src/libs/utils/proxyaction.h b/src/libs/utils/proxyaction.h index e2eea9908d..d6187d047e 100644 --- a/src/libs/utils/proxyaction.h +++ b/src/libs/utils/proxyaction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROXYACTION_H -#define PROXYACTION_H +#pragma once #include "utils_global.h" @@ -80,5 +79,3 @@ private: } // namespace Utils Q_DECLARE_OPERATORS_FOR_FLAGS(Utils::ProxyAction::Attributes) - -#endif // PROXYACTION_H diff --git a/src/libs/utils/proxycredentialsdialog.h b/src/libs/utils/proxycredentialsdialog.h index 76b11ce5b4..d18af5b2d5 100644 --- a/src/libs/utils/proxycredentialsdialog.h +++ b/src/libs/utils/proxycredentialsdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROXYCREDENTIALSDIALOG_H -#define PROXYCREDENTIALSDIALOG_H +#pragma once #include "utils_global.h" #include <QDialog> @@ -55,5 +54,3 @@ private: }; } // namespace Utils - -#endif // PROXYCREDENTIALSDIALOG_H diff --git a/src/libs/utils/qtcassert.h b/src/libs/utils/qtcassert.h index 004c4e0439..bf4b28ba4d 100644 --- a/src/libs/utils/qtcassert.h +++ b/src/libs/utils/qtcassert.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTC_ASSERT_H -#define QTC_ASSERT_H +#pragma once #include "utils_global.h" @@ -40,6 +39,4 @@ namespace Utils { QTCREATOR_UTILS_EXPORT void writeAssertLocation(const char *ms #define QTC_ASSERT(cond, action) if (cond) {} else { QTC_ASSERT_STRING(#cond); action; } do {} while (0) #define QTC_CHECK(cond) if (cond) {} else { QTC_ASSERT_STRING(#cond); } do {} while (0) - -#endif // QTC_ASSERT_H - +#define QTC_GUARD(cond) ((cond) ? true : (QTC_ASSERT_STRING(#cond), false)) diff --git a/src/libs/utils/qtcolorbutton.h b/src/libs/utils/qtcolorbutton.h index d22421497e..07b3c63a22 100644 --- a/src/libs/utils/qtcolorbutton.h +++ b/src/libs/utils/qtcolorbutton.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTCOLORBUTTON_H -#define QTCOLORBUTTON_H +#pragma once #include "utils_global.h" @@ -70,5 +69,3 @@ private: }; } // namespace Utils - -#endif // QTCOLORBUTTON_H diff --git a/src/libs/utils/qtcprocess.h b/src/libs/utils/qtcprocess.h index 3a3ba788e9..fed5ad484d 100644 --- a/src/libs/utils/qtcprocess.h +++ b/src/libs/utils/qtcprocess.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTCPROCESS_H -#define QTCPROCESS_H +#pragma once #include "environment.h" @@ -153,5 +152,3 @@ private: }; } // namespace Utils - -#endif // QTCPROCESS_H diff --git a/src/libs/utils/reloadpromptutils.h b/src/libs/utils/reloadpromptutils.h index a5105bc6cb..b01bd25b53 100644 --- a/src/libs/utils/reloadpromptutils.h +++ b/src/libs/utils/reloadpromptutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RELOADPROMPTUTILS_H -#define RELOADPROMPTUTILS_H +#pragma once #include "utils_global.h" @@ -63,5 +62,3 @@ QTCREATOR_UTILS_EXPORT FileDeletedPromptAnswer fileDeletedPrompt(const QString & QWidget *parent); } // namespace Utils - -#endif // RELOADPROMPTUTILS_H diff --git a/src/libs/utils/runextensions.h b/src/libs/utils/runextensions.h index c40899eb90..e08cc02bd6 100644 --- a/src/libs/utils/runextensions.h +++ b/src/libs/utils/runextensions.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RUNEXTENSIONS_H -#define RUNEXTENSIONS_H +#pragma once #include "functiontraits.h" #include "utils_global.h" @@ -261,23 +260,6 @@ void runAsyncQFutureInterfaceDispatch(std::false_type, QFutureInterface<ResultTy futureInterface, std::forward<Function>(function), std::forward<Args>(args)...); } -// function that takes at least one argument which could be QFutureInterface -template <typename ResultType, typename Function, typename... Args> -void runAsyncArityDispatch(std::true_type, QFutureInterface<ResultType> futureInterface, Function &&function, Args&&... args) -{ - runAsyncQFutureInterfaceDispatch(std::is_same<QFutureInterface<ResultType>&, - typename functionTraits<Function>::template argument<0>::type>(), - futureInterface, std::forward<Function>(function), std::forward<Args>(args)...); -} - -// function that does not take an argument, so it does not take a QFutureInterface -template <typename ResultType, typename Function, typename... Args> -void runAsyncArityDispatch(std::false_type, QFutureInterface<ResultType> futureInterface, Function &&function, Args&&... args) -{ - runAsyncQFutureInterfaceDispatch(std::false_type(), - futureInterface, std::forward<Function>(function), std::forward<Args>(args)...); -} - // function, function pointer, or other callable object that is no member pointer template <typename ResultType, typename Function, typename... Args, typename = typename std::enable_if< @@ -285,8 +267,8 @@ template <typename ResultType, typename Function, typename... Args, >::type> void runAsyncMemberDispatch(QFutureInterface<ResultType> futureInterface, Function &&function, Args&&... args) { - runAsyncArityDispatch(std::integral_constant<bool, (functionTraits<Function>::arity > 0)>(), - futureInterface, std::forward<Function>(function), std::forward<Args>(args)...); + runAsyncQFutureInterfaceDispatch(functionTakesArgument<Function, 0, QFutureInterface<ResultType>&>(), + futureInterface, std::forward<Function>(function), std::forward<Args>(args)...); } // Function = member function @@ -512,5 +494,3 @@ runAsync(QThreadPool *pool, Function &&function, Args&&... args) } } // Utils - -#endif // RUNEXTENSIONS_H diff --git a/src/libs/utils/savedaction.h b/src/libs/utils/savedaction.h index f03150d637..4fb98496b4 100644 --- a/src/libs/utils/savedaction.h +++ b/src/libs/utils/savedaction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SAVED_ACTION_H -#define SAVED_ACTION_H +#pragma once #include "utils_global.h" @@ -103,5 +102,3 @@ private: }; } // namespace Utils - -#endif // SAVED_ACTION_H diff --git a/src/libs/utils/savefile.h b/src/libs/utils/savefile.h index 4584d56b05..0be71967fd 100644 --- a/src/libs/utils/savefile.h +++ b/src/libs/utils/savefile.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SAVEFILE_H -#define SAVEFILE_H +#pragma once #include "utils_global.h" @@ -55,5 +54,3 @@ private: }; } // namespace Utils - -#endif // SAVEFILE_H diff --git a/src/libs/utils/scopedswap.h b/src/libs/utils/scopedswap.h index 0af542a126..6e996c11f2 100644 --- a/src/libs/utils/scopedswap.h +++ b/src/libs/utils/scopedswap.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SCOPEDSWAP_H -#define SCOPEDSWAP_H +#pragma once #if !(__cplusplus > 199711L || __GXX_EXPERIMENTAL_CXX0X__ || _MSC_VER >= 1600 || defined( _LIBCPP_VERSION )) || \ (defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)) @@ -59,5 +58,3 @@ public: typedef ScopedSwap<bool> ScopedBoolSwap; } // Utils namespace - -#endif // SCOPEDSWAP_H diff --git a/src/libs/utils/settingsselector.h b/src/libs/utils/settingsselector.h index 06ca19b924..6df875a6e4 100644 --- a/src/libs/utils/settingsselector.h +++ b/src/libs/utils/settingsselector.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SETTINGSSELECTORWIDGET_H -#define SETTINGSSELECTORWIDGET_H +#pragma once #include "utils_global.h" @@ -82,5 +81,3 @@ private: }; } // namespace Utils - -#endif // SETTINGSSELECTORWIDGET_H diff --git a/src/libs/utils/settingsutils.h b/src/libs/utils/settingsutils.h index 965293dee8..c693dc7442 100644 --- a/src/libs/utils/settingsutils.h +++ b/src/libs/utils/settingsutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SETTINGSUTILS_H -#define SETTINGSUTILS_H +#pragma once #include <QSettings> #include <QString> @@ -70,5 +69,3 @@ void toSettings(const QString &postFix, } } // Utils - -#endif // SETTINGSUTILS_H diff --git a/src/libs/utils/shellcommand.cpp b/src/libs/utils/shellcommand.cpp index b9366adb5c..99a09e7e14 100644 --- a/src/libs/utils/shellcommand.cpp +++ b/src/libs/utils/shellcommand.cpp @@ -85,34 +85,25 @@ public: const QString m_defaultWorkingDirectory; const QProcessEnvironment m_environment; QVariant m_cookie; - int m_defaultTimeoutS; - unsigned m_flags; - QTextCodec *m_codec; - ProgressParser *m_progressParser; - bool m_progressiveOutput; - bool m_hadOutput; - bool m_aborted; + QTextCodec *m_codec = nullptr; + ProgressParser *m_progressParser = nullptr; QFutureWatcher<void> m_watcher; - QList<Job> m_jobs; - bool m_lastExecSuccess; - int m_lastExecExitCode; + unsigned m_flags = 0; + int m_defaultTimeoutS = 10; + int m_lastExecExitCode = -1; + + bool m_lastExecSuccess = false; + bool m_progressiveOutput = false; + bool m_hadOutput = false; + bool m_aborted = false; }; ShellCommandPrivate::ShellCommandPrivate(const QString &defaultWorkingDirectory, const QProcessEnvironment &environment) : m_defaultWorkingDirectory(defaultWorkingDirectory), - m_environment(environment), - m_defaultTimeoutS(10), - m_flags(0), - m_codec(0), - m_progressParser(0), - m_progressiveOutput(false), - m_hadOutput(false), - m_aborted(false), - m_lastExecSuccess(false), - m_lastExecExitCode(-1) + m_environment(environment) { } ShellCommandPrivate::~ShellCommandPrivate() diff --git a/src/libs/utils/shellcommand.h b/src/libs/utils/shellcommand.h index d139842d0f..f6024fb4b3 100644 --- a/src/libs/utils/shellcommand.h +++ b/src/libs/utils/shellcommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTILS_SHELLCOMMAND_H -#define UTILS_SHELLCOMMAND_H +#pragma once #include "utils_global.h" @@ -179,5 +178,3 @@ private: }; } // namespace Utils - -#endif // UTILS_SHELLCOMMAND_H diff --git a/src/libs/utils/shellcommandpage.h b/src/libs/utils/shellcommandpage.h index f716ab913b..63cb3aed78 100644 --- a/src/libs/utils/shellcommandpage.h +++ b/src/libs/utils/shellcommandpage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SHELLCOMMANDPAGE_H -#define SHELLCOMMANDPAGE_H +#pragma once #include "utils_global.h" @@ -77,5 +76,3 @@ private: }; } // namespace Utils - -#endif // SHELLCOMMANDPAGE_H diff --git a/src/libs/utils/sleep.h b/src/libs/utils/sleep.h index 4f2c43f6e1..c7df10f8f7 100644 --- a/src/libs/utils/sleep.h +++ b/src/libs/utils/sleep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SLEEP_H -#define SLEEP_H +#pragma once #include "utils_global.h" @@ -33,5 +32,3 @@ namespace Utils { void QTCREATOR_UTILS_EXPORT sleep(int msec); } - -#endif // SLEEP_H diff --git a/src/libs/utils/smallstring.h b/src/libs/utils/smallstring.h index fedb2846a5..6c815c7ebf 100644 --- a/src/libs/utils/smallstring.h +++ b/src/libs/utils/smallstring.h @@ -114,6 +114,15 @@ public: { } + template<typename Type, + typename = typename std::enable_if<std::is_pointer<Type>::value>::type + > + SmallString(Type characterPointer) noexcept + : SmallString(characterPointer, std::strlen(characterPointer)) + { + static_assert(!std::is_array<Type>::value, "Input type is array and not char pointer!"); + } + SmallString(const QString &qString) : SmallString(SmallString::fromQString(qString)) {} diff --git a/src/libs/utils/smallstringlayout.h b/src/libs/utils/smallstringlayout.h index 726f035eed..e04b6d3b19 100644 --- a/src/libs/utils/smallstringlayout.h +++ b/src/libs/utils/smallstringlayout.h @@ -124,12 +124,10 @@ struct ALIGNAS_16 StringDataLayout { #endif } - - union { AllocatedLayout allocated; ReferenceLayout reference; - ShortStringLayout shortString = {}; + ShortStringLayout shortString = ShortStringLayout(); }; }; diff --git a/src/libs/utils/smallstringliteral.h b/src/libs/utils/smallstringliteral.h index 5b5a03a265..0f631d03e6 100644 --- a/src/libs/utils/smallstringliteral.h +++ b/src/libs/utils/smallstringliteral.h @@ -134,4 +134,3 @@ private: #pragma pop_macro("noexcept") #pragma pop_macro("constexpr") - diff --git a/src/libs/utils/statuslabel.h b/src/libs/utils/statuslabel.h index 53395adee0..8531a66d1b 100644 --- a/src/libs/utils/statuslabel.h +++ b/src/libs/utils/statuslabel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTILS_STATUSLABEL_H -#define UTILS_STATUSLABEL_H +#pragma once #include "utils_global.h" @@ -55,5 +54,3 @@ private: }; } // namespace Utils - -#endif // UTILS_STATUSLABEL_H diff --git a/src/libs/utils/stringutils.h b/src/libs/utils/stringutils.h index 94e1e28d50..8e0c78f028 100644 --- a/src/libs/utils/stringutils.h +++ b/src/libs/utils/stringutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STRINGUTILS_H -#define STRINGUTILS_H +#pragma once #include "utils_global.h" @@ -75,5 +74,3 @@ QTCREATOR_UTILS_EXPORT void expandMacros(QString *str, AbstractMacroExpander *mx QTCREATOR_UTILS_EXPORT QString expandMacros(const QString &str, AbstractMacroExpander *mx); } // namespace Utils - -#endif // STRINGUTILS_H diff --git a/src/libs/utils/styledbar.h b/src/libs/utils/styledbar.h index 39c3e02761..4b76c13e30 100644 --- a/src/libs/utils/styledbar.h +++ b/src/libs/utils/styledbar.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STYLEDBAR_H -#define STYLEDBAR_H +#pragma once #include "utils_global.h" @@ -57,5 +56,3 @@ protected: }; } // Utils - -#endif // STYLEDBAR_H diff --git a/src/libs/utils/stylehelper.h b/src/libs/utils/stylehelper.h index 18dd8d95ba..0f99e4bf97 100644 --- a/src/libs/utils/stylehelper.h +++ b/src/libs/utils/stylehelper.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STYLEHELPER_H -#define STYLEHELPER_H +#pragma once #include "utils_global.h" @@ -102,4 +101,3 @@ private: }; } // namespace Utils -#endif // STYLEHELPER_H diff --git a/src/libs/utils/synchronousprocess.cpp b/src/libs/utils/synchronousprocess.cpp index 8e381d117c..52dd90cbd0 100644 --- a/src/libs/utils/synchronousprocess.cpp +++ b/src/libs/utils/synchronousprocess.cpp @@ -152,26 +152,26 @@ SynchronousProcessResponse::Result ExitCodeInterpreter::interpretExitCode(int co } // Data for one channel buffer (stderr/stdout) -struct ChannelBuffer { - ChannelBuffer(); +class ChannelBuffer : public QObject +{ + Q_OBJECT + +public: void clearForRun(); QString linesRead(); + void append(const QString &text, bool emitSignals); QString data; - bool firstData; - bool bufferedSignalsEnabled; - bool firstBuffer; - int bufferPos; + int bufferPos = 0; + bool firstData = true; + bool bufferedSignalsEnabled = false; + bool firstBuffer = true; + +signals: + void output(const QString &text, bool firstTime); + void outputBuffered(const QString &text, bool firstTime); }; -ChannelBuffer::ChannelBuffer() : - firstData(true), - bufferedSignalsEnabled(false), - firstBuffer(true), - bufferPos(0) -{ -} - void ChannelBuffer::clearForRun() { firstData = true; @@ -194,38 +194,52 @@ QString ChannelBuffer::linesRead() return lines; } +void ChannelBuffer::append(const QString &text, bool emitSignals) +{ + if (text.isEmpty()) + return; + data += text; + if (!emitSignals) + return; + // Emit binary signals + emit output(text, firstData); + firstData = false; + // Buffered. Emit complete lines? + if (bufferedSignalsEnabled) { + const QString lines = linesRead(); + if (!lines.isEmpty()) { + emit outputBuffered(lines, firstBuffer); + firstBuffer = false; + } + } +} + // ----------- SynchronousProcessPrivate struct SynchronousProcessPrivate { SynchronousProcessPrivate(); void clearForRun(); QTextCodec *m_codec; - ExitCodeInterpreter *m_exitCodeInterpreter; + ExitCodeInterpreter *m_exitCodeInterpreter = nullptr; QTextCodec::ConverterState m_stdOutState; QTextCodec::ConverterState m_stdErrState; TerminalControllingProcess m_process; QTimer m_timer; QEventLoop m_eventLoop; SynchronousProcessResponse m_result; - int m_hangTimerCount; - int m_maxHangTimerCount; - bool m_startFailure; - bool m_timeOutMessageBoxEnabled; - bool m_waitingForUser; QString m_binary; - ChannelBuffer m_stdOut; ChannelBuffer m_stdErr; + + int m_hangTimerCount = 0; + int m_maxHangTimerCount = defaultMaxHangTimerCount; + bool m_startFailure = false; + bool m_timeOutMessageBoxEnabled = false; + bool m_waitingForUser = false; }; SynchronousProcessPrivate::SynchronousProcessPrivate() : - m_codec(QTextCodec::codecForLocale()), - m_exitCodeInterpreter(0), - m_hangTimerCount(0), - m_maxHangTimerCount(defaultMaxHangTimerCount), - m_startFailure(false), - m_timeOutMessageBoxEnabled(false), - m_waitingForUser(false) + m_codec(QTextCodec::codecForLocale()) { } @@ -254,6 +268,10 @@ SynchronousProcess::SynchronousProcess() : this, &SynchronousProcess::stdOutReady); connect(&d->m_process, &QProcess::readyReadStandardError, this, &SynchronousProcess::stdErrReady); + connect(&d->m_stdOut, &ChannelBuffer::output, this, &SynchronousProcess::stdOut); + connect(&d->m_stdOut, &ChannelBuffer::outputBuffered, this, &SynchronousProcess::stdOutBuffered); + connect(&d->m_stdErr, &ChannelBuffer::output, this, &SynchronousProcess::stdErr); + connect(&d->m_stdErr, &ChannelBuffer::outputBuffered, this, &SynchronousProcess::stdErrBuffered); } SynchronousProcess::~SynchronousProcess() @@ -526,22 +544,7 @@ void SynchronousProcess::processStdOut(bool emitSignals) &d->m_stdOutState); if (debug > 1) qDebug() << Q_FUNC_INFO << emitSignals << stdOutput; - if (!stdOutput.isEmpty()) { - d->m_stdOut.data += stdOutput; - if (emitSignals) { - // Emit binary signals - emit stdOut(stdOutput, d->m_stdOut.firstData); - d->m_stdOut.firstData = false; - // Buffered. Emit complete lines? - if (d->m_stdOut.bufferedSignalsEnabled) { - const QString lines = d->m_stdOut.linesRead(); - if (!lines.isEmpty()) { - emit stdOutBuffered(lines, d->m_stdOut.firstBuffer); - d->m_stdOut.firstBuffer = false; - } - } - } - } + d->m_stdOut.append(stdOutput, emitSignals); } void SynchronousProcess::processStdErr(bool emitSignals) @@ -551,22 +554,7 @@ void SynchronousProcess::processStdErr(bool emitSignals) &d->m_stdErrState); if (debug > 1) qDebug() << Q_FUNC_INFO << emitSignals << stdError; - if (!stdError.isEmpty()) { - d->m_stdErr.data += stdError; - if (emitSignals) { - // Emit binary signals - emit stdErr(stdError, d->m_stdErr.firstData); - d->m_stdErr.firstData = false; - if (d->m_stdErr.bufferedSignalsEnabled) { - // Buffered. Emit complete lines? - const QString lines = d->m_stdErr.linesRead(); - if (!lines.isEmpty()) { - emit stdErrBuffered(lines, d->m_stdErr.firstBuffer); - d->m_stdErr.firstBuffer = false; - } - } - } - } + d->m_stdErr.append(stdError, emitSignals); } QSharedPointer<QProcess> SynchronousProcess::createProcess(unsigned flags) @@ -725,3 +713,5 @@ QString SynchronousProcess::locateBinary(const QString &binary) } } // namespace Utils + +#include "synchronousprocess.moc" diff --git a/src/libs/utils/synchronousprocess.h b/src/libs/utils/synchronousprocess.h index cb19aeea3d..c8891122cf 100644 --- a/src/libs/utils/synchronousprocess.h +++ b/src/libs/utils/synchronousprocess.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SYNCHRONOUSPROCESS_H -#define SYNCHRONOUSPROCESS_H +#pragma once #include "utils_global.h" @@ -171,5 +170,3 @@ private: }; } // namespace Utils - -#endif diff --git a/src/libs/utils/templateengine.h b/src/libs/utils/templateengine.h index c3e3d354e8..5073992347 100644 --- a/src/libs/utils/templateengine.h +++ b/src/libs/utils/templateengine.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEMPLATEENGINE_H -#define TEMPLATEENGINE_H +#pragma once #include "utils_global.h" @@ -48,5 +47,3 @@ public: }; } // namespace Utils - -#endif // TEMPLATEENGINE_H diff --git a/src/libs/utils/textfieldcheckbox.h b/src/libs/utils/textfieldcheckbox.h index 3d37c0bc8c..456e156370 100644 --- a/src/libs/utils/textfieldcheckbox.h +++ b/src/libs/utils/textfieldcheckbox.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTFIELDCHECKBOX_H -#define TEXTFIELDCHECKBOX_H +#pragma once #include "utils_global.h" @@ -61,5 +60,3 @@ private: }; } // namespace Utils - -#endif // TEXTFIELDCHECKBOX_H diff --git a/src/libs/utils/textfieldcombobox.h b/src/libs/utils/textfieldcombobox.h index a3fca807e1..943e7a677c 100644 --- a/src/libs/utils/textfieldcombobox.h +++ b/src/libs/utils/textfieldcombobox.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTFIELDCOMBOBOX_H -#define TEXTFIELDCOMBOBOX_H +#pragma once #include "utils_global.h" @@ -55,5 +54,3 @@ private: }; } // namespace Utils - -#endif // TEXTFIELDCOMBOBOX_H diff --git a/src/libs/utils/textfileformat.h b/src/libs/utils/textfileformat.h index 07398fb09d..6cb6c7ede8 100644 --- a/src/libs/utils/textfileformat.h +++ b/src/libs/utils/textfileformat.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTFILEFORMAT_H -#define TEXTFILEFORMAT_H +#pragma once #include "utils_global.h" @@ -85,5 +84,3 @@ public: }; } // namespace Utils - -#endif // TEXTFILEFORMAT_H diff --git a/src/libs/utils/theme/theme.h b/src/libs/utils/theme/theme.h index a3a9861d56..e25e2e7db6 100644 --- a/src/libs/utils/theme/theme.h +++ b/src/libs/utils/theme/theme.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef THEME_H -#define THEME_H +#pragma once #include "../utils_global.h" @@ -308,5 +307,3 @@ private: QTCREATOR_UTILS_EXPORT Theme *creatorTheme(); } // namespace Utils - -#endif // THEME_H diff --git a/src/libs/utils/theme/theme_p.h b/src/libs/utils/theme/theme_p.h index 7382905a6a..8dafe9db57 100644 --- a/src/libs/utils/theme/theme_p.h +++ b/src/libs/utils/theme/theme_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef THEME_P_H -#define THEME_P_H +#pragma once #include "theme.h" #include "../utils_global.h" @@ -55,5 +54,3 @@ public: QTCREATOR_UTILS_EXPORT void setCreatorTheme(Theme *theme); } // namespace Utils - -#endif // THEME_P_H diff --git a/src/libs/utils/tooltip/effects.h b/src/libs/utils/tooltip/effects.h index 02afec45a8..9e6b571e89 100644 --- a/src/libs/utils/tooltip/effects.h +++ b/src/libs/utils/tooltip/effects.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EFFECTS_H -#define EFFECTS_H +#pragma once #include <QtGlobal> @@ -50,5 +49,3 @@ extern void Q_GUI_EXPORT qScrollEffect(QWidget*, QEffects::DirFlags dir = QEffec extern void Q_GUI_EXPORT qFadeEffect(QWidget*, int time = -1); QT_END_NAMESPACE - -#endif // EFFECTS_H diff --git a/src/libs/utils/tooltip/reuse.h b/src/libs/utils/tooltip/reuse.h index 8f8519b37a..ee2fca72de 100644 --- a/src/libs/utils/tooltip/reuse.h +++ b/src/libs/utils/tooltip/reuse.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TOOLTIPREUSE_H -#define TOOLTIPREUSE_H +#pragma once #include <utils/hostosinfo.h> @@ -54,5 +53,3 @@ inline QRect screenGeometry(const QPoint &pos, QWidget *w) } // namespace Internal } // namespace Utils - -#endif // TOOLTIPREUSE_H diff --git a/src/libs/utils/tooltip/tips.h b/src/libs/utils/tooltip/tips.h index f0389e404c..e2d467f6db 100644 --- a/src/libs/utils/tooltip/tips.h +++ b/src/libs/utils/tooltip/tips.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TIPS_H -#define TIPS_H +#pragma once #include "../utils_global.h" @@ -117,5 +116,3 @@ private: } // namespace Internal } // namespace Utils #endif - -#endif // TIPS_H diff --git a/src/libs/utils/tooltip/tooltip.h b/src/libs/utils/tooltip/tooltip.h index d6ad642ece..2d6d197528 100644 --- a/src/libs/utils/tooltip/tooltip.h +++ b/src/libs/utils/tooltip/tooltip.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TOOLTIP_H -#define TOOLTIP_H +#pragma once #include "../utils_global.h" @@ -116,5 +115,3 @@ private: }; } // namespace Utils - -#endif // TOOLTIP_H diff --git a/src/libs/utils/treemodel.h b/src/libs/utils/treemodel.h index 62a17ecda7..0fcabcf85c 100644 --- a/src/libs/utils/treemodel.h +++ b/src/libs/utils/treemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTILS_TREEMODEL_H -#define UTILS_TREEMODEL_H +#pragma once #include "utils_global.h" @@ -300,5 +299,3 @@ private: }; } // namespace Utils - -#endif // UTILS_TREEMODEL_H diff --git a/src/libs/utils/treeviewcombobox.h b/src/libs/utils/treeviewcombobox.h index b904a641e3..e32d64d4ae 100644 --- a/src/libs/utils/treeviewcombobox.h +++ b/src/libs/utils/treeviewcombobox.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TREEVIEWCOMBOBOX_H -#define TREEVIEWCOMBOBOX_H +#pragma once #include "utils_global.h" @@ -65,5 +64,3 @@ private: bool m_skipNextHide; }; } - -#endif // TREEVIEWCOMBOBOX_H diff --git a/src/libs/utils/uncommentselection.h b/src/libs/utils/uncommentselection.h index bba6798c9a..46efe8da97 100644 --- a/src/libs/utils/uncommentselection.h +++ b/src/libs/utils/uncommentselection.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UNCOMMENTSELECTION_H -#define UNCOMMENTSELECTION_H +#pragma once #include "utils_global.h" @@ -60,5 +59,3 @@ void unCommentSelection(QPlainTextEdit *edit, const CommentDefinition &definiton = CommentDefinition()); } // namespace Utils - -#endif // UNCOMMENTSELECTION_H diff --git a/src/libs/utils/unixutils.h b/src/libs/utils/unixutils.h index 5e6bbeecaf..b43cb09142 100644 --- a/src/libs/utils/unixutils.h +++ b/src/libs/utils/unixutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UNIXUTILS_H -#define UNIXUTILS_H +#pragma once #include "utils_global.h" @@ -46,5 +45,3 @@ public: }; } - -#endif // UNIXUTILS_H diff --git a/src/libs/utils/utils_global.h b/src/libs/utils/utils_global.h index 2313d16b2c..76ed9c6445 100644 --- a/src/libs/utils/utils_global.h +++ b/src/libs/utils/utils_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTILS_GLOBAL_H -#define UTILS_GLOBAL_H +#pragma once #include <qglobal.h> @@ -35,5 +34,3 @@ #else # define QTCREATOR_UTILS_EXPORT Q_DECL_IMPORT #endif - -#endif // UTILS_GLOBAL_H diff --git a/src/libs/utils/utilsicons.h b/src/libs/utils/utilsicons.h index 51da2999c4..bf481e9b4f 100644 --- a/src/libs/utils/utilsicons.h +++ b/src/libs/utils/utilsicons.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTILSICONS_H -#define UTILSICONS_H +#pragma once #include "icon.h" @@ -36,5 +35,3 @@ const Utils::Icon EDIT_CLEAR({ } // namespace Icons } // namespace Utils - -#endif // UTILSICONS_H diff --git a/src/libs/utils/winutils.h b/src/libs/utils/winutils.h index 28a1b5c113..6bb75f97d6 100644 --- a/src/libs/utils/winutils.h +++ b/src/libs/utils/winutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINUTILS_H -#define WINUTILS_H +#pragma once #include "utils_global.h" @@ -63,5 +62,3 @@ private: }; } // namespace Utils - -#endif // WINUTILS_H diff --git a/src/libs/utils/wizard.h b/src/libs/utils/wizard.h index 587ac48356..070b6ff4a2 100644 --- a/src/libs/utils/wizard.h +++ b/src/libs/utils/wizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WIZARD_H -#define WIZARD_H +#pragma once #include "utils_global.h" @@ -170,5 +169,3 @@ private: }; } // namespace Utils - -#endif // WIZARD_H diff --git a/src/libs/utils/wizardpage.h b/src/libs/utils/wizardpage.h index 2570da5d75..c9f9a462ec 100644 --- a/src/libs/utils/wizardpage.h +++ b/src/libs/utils/wizardpage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WIZARDPAGE_H -#define WIZARDPAGE_H +#pragma once #include "utils_global.h" @@ -59,5 +58,3 @@ private: }; } // namespace Utils - -#endif // WIZARDPAGE_H diff --git a/src/plugins/android/android.pro b/src/plugins/android/android.pro index 6fffdcc081..18b2c7543d 100644 --- a/src/plugins/android/android.pro +++ b/src/plugins/android/android.pro @@ -42,7 +42,6 @@ HEADERS += \ androidsignaloperation.h \ javaeditor.h \ javaindenter.h \ - javaautocompleter.h \ javacompletionassistprovider.h \ avddialog.h \ android_global.h \ @@ -84,7 +83,6 @@ SOURCES += \ androidsignaloperation.cpp \ javaeditor.cpp \ javaindenter.cpp \ - javaautocompleter.cpp \ javacompletionassistprovider.cpp \ avddialog.cpp \ androidbuildapkstep.cpp \ diff --git a/src/plugins/android/android.qbs b/src/plugins/android/android.qbs index 4251bd023b..fd7636c5f3 100644 --- a/src/plugins/android/android.qbs +++ b/src/plugins/android/android.qbs @@ -92,8 +92,6 @@ QtcPlugin { "avddialog.h", "certificatesmodel.cpp", "certificatesmodel.h", - "javaautocompleter.cpp", - "javaautocompleter.h", "javacompletionassistprovider.cpp", "javacompletionassistprovider.h", "javaeditor.cpp", diff --git a/src/plugins/android/android_global.h b/src/plugins/android/android_global.h index 3be55983cd..1f79d86ebc 100644 --- a/src/plugins/android/android_global.h +++ b/src/plugins/android/android_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROID_GLOBAL_H -#define ANDROID_GLOBAL_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define ANDROID_EXPORT Q_DECL_IMPORT #endif - -#endif // ANDROID_GLOBAL_H diff --git a/src/plugins/android/androidanalyzesupport.cpp b/src/plugins/android/androidanalyzesupport.cpp index 820e9ab00d..06581745ed 100644 --- a/src/plugins/android/androidanalyzesupport.cpp +++ b/src/plugins/android/androidanalyzesupport.cpp @@ -79,12 +79,12 @@ AndroidAnalyzeSupport::AndroidAnalyzeSupport(AndroidRunConfiguration *runConfig, [runner]() { runner->start(); }); connect(&m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort, - [this, runControl](quint16) { + [this, runControl](Utils::Port) { runControl->notifyRemoteSetupDone(m_qmlPort); }); connect(runner, &AndroidRunner::remoteProcessStarted, - [this](int, int qmlPort) { + [this](Utils::Port, Utils::Port qmlPort) { m_qmlPort = qmlPort; }); diff --git a/src/plugins/android/androidanalyzesupport.h b/src/plugins/android/androidanalyzesupport.h index e272688a27..83055c5236 100644 --- a/src/plugins/android/androidanalyzesupport.h +++ b/src/plugins/android/androidanalyzesupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDANALYZESUPPORT_H -#define ANDROIDANALYZESUPPORT_H +#pragma once #include "androidrunconfiguration.h" #include <qmldebug/qmloutputparser.h> @@ -50,10 +49,8 @@ public: private: QmlDebug::QmlOutputParser m_outputParser; - int m_qmlPort; + Utils::Port m_qmlPort; }; } // namespace Internal } // namespace Android - -#endif // ANDROIDANALYZESUPPORT_H diff --git a/src/plugins/android/androidbuildapkstep.h b/src/plugins/android/androidbuildapkstep.h index 42d446bd7c..302a5c714d 100644 --- a/src/plugins/android/androidbuildapkstep.h +++ b/src/plugins/android/androidbuildapkstep.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDBUILDAPKSTEP_H -#define ANDROIDBUILDAPKSTEP_H +#pragma once #include "android_global.h" #include <projectexplorer/abstractprocessstep.h> @@ -114,5 +113,3 @@ protected: }; } // namespace Android - -#endif // ANDROIDBUILDAPKSTEP_H diff --git a/src/plugins/android/androidbuildapkwidget.h b/src/plugins/android/androidbuildapkwidget.h index 52d765275e..42e3dc3c79 100644 --- a/src/plugins/android/androidbuildapkwidget.h +++ b/src/plugins/android/androidbuildapkwidget.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDBUILDAPKWIDGET_H -#define ANDROIDBUILDAPKWIDGET_H +#pragma once #include "android_global.h" @@ -76,5 +75,3 @@ private: }; } - -#endif // ANDROIDBUILDAPKWIDGET_H diff --git a/src/plugins/android/androidconfigurations.h b/src/plugins/android/androidconfigurations.h index 740dafc9bd..85a1e15f8d 100644 --- a/src/plugins/android/androidconfigurations.h +++ b/src/plugins/android/androidconfigurations.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDCONFIGURATIONS_H -#define ANDROIDCONFIGURATIONS_H +#pragma once #include "android_global.h" @@ -248,5 +247,3 @@ private: }; } // namespace Android - -#endif // ANDROIDCONFIGURATIONS_H diff --git a/src/plugins/android/androidconstants.h b/src/plugins/android/androidconstants.h index e9002b5e88..d51c40b13f 100644 --- a/src/plugins/android/androidconstants.h +++ b/src/plugins/android/androidconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDCONSTANTS_H -#define ANDROIDCONSTANTS_H +#pragma once #include <QtGlobal> @@ -71,5 +70,3 @@ const char ANDROID_EXTRA_LIBS[] = "AndroidExtraLibs"; } // namespace Constants; } // namespace Android - -#endif // ANDROIDCONSTANTS_H diff --git a/src/plugins/android/androidcreatekeystorecertificate.h b/src/plugins/android/androidcreatekeystorecertificate.h index eba9b73ea9..22030d2c24 100644 --- a/src/plugins/android/androidcreatekeystorecertificate.h +++ b/src/plugins/android/androidcreatekeystorecertificate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDCREATEKEYSTORECERTIFICATE_H -#define ANDROIDCREATEKEYSTORECERTIFICATE_H +#pragma once #include <utils/fileutils.h> @@ -73,5 +72,3 @@ private: } // namespace Internal } // namespace Android - -#endif // ANDROIDCREATEKEYSTORECERTIFICATE_H diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp index 7482d9e138..0cb13ee45c 100644 --- a/src/plugins/android/androiddebugsupport.cpp +++ b/src/plugins/android/androiddebugsupport.cpp @@ -132,13 +132,8 @@ AndroidDebugSupport::AndroidDebugSupport(AndroidRunConfiguration *runConfig, { QTC_ASSERT(runControl, return); - connect(m_runControl, SIGNAL(finished()), - m_runner, SLOT(stop())); - - DebuggerRunConfigurationAspect *aspect - = runConfig->extraAspect<DebuggerRunConfigurationAspect>(); - Q_ASSERT(aspect->useCppDebugger() || aspect->useQmlDebugger()); - Q_UNUSED(aspect) + connect(m_runControl, &RunControl::finished, + m_runner, &AndroidRunner::stop); connect(m_runControl, &DebuggerRunControl::requestRemoteSetup, m_runner, &AndroidRunner::start); @@ -176,7 +171,7 @@ AndroidDebugSupport::AndroidDebugSupport(AndroidRunConfiguration *runConfig, }); } -void AndroidDebugSupport::handleRemoteProcessStarted(int gdbServerPort, int qmlPort) +void AndroidDebugSupport::handleRemoteProcessStarted(Utils::Port gdbServerPort, Utils::Port qmlPort) { disconnect(m_runner, &AndroidRunner::remoteProcessStarted, this, &AndroidDebugSupport::handleRemoteProcessStarted); diff --git a/src/plugins/android/androiddebugsupport.h b/src/plugins/android/androiddebugsupport.h index cf46aa8069..1b55002a86 100644 --- a/src/plugins/android/androiddebugsupport.h +++ b/src/plugins/android/androiddebugsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDDEBUGSUPPORT_H -#define ANDROIDDEBUGSUPPORT_H +#pragma once #include "androidrunconfiguration.h" @@ -50,7 +49,7 @@ public: QString *errorMessage); private: - void handleRemoteProcessStarted(int gdbServerPort, int qmlPort); + void handleRemoteProcessStarted(Utils::Port gdbServerPort, Utils::Port qmlPort); Debugger::DebuggerRunControl *m_runControl; AndroidRunner * const m_runner; @@ -58,5 +57,3 @@ private: } // namespace Internal } // namespace Android - -#endif // ANDROIDDEBUGSUPPORT_H diff --git a/src/plugins/android/androiddeployconfiguration.h b/src/plugins/android/androiddeployconfiguration.h index d1cd85b054..8ce9191e6d 100644 --- a/src/plugins/android/androiddeployconfiguration.h +++ b/src/plugins/android/androiddeployconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDDEPLOYCONFIGURATION_H -#define ANDROIDDEPLOYCONFIGURATION_H +#pragma once #include <projectexplorer/deployconfiguration.h> @@ -65,5 +64,3 @@ public: } // namespace Internal } // namespace Android - -#endif // ANDROIDDEPLOYCONFIGURATION_H diff --git a/src/plugins/android/androiddeployqtstep.h b/src/plugins/android/androiddeployqtstep.h index acd0b9aa96..470b8a4115 100644 --- a/src/plugins/android/androiddeployqtstep.h +++ b/src/plugins/android/androiddeployqtstep.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDDEPLOYQTSTEP_H -#define ANDROIDDEPLOYQTSTEP_H +#pragma once #include "androidbuildapkstep.h" #include "androidconfigurations.h" @@ -143,5 +142,3 @@ private: } } // namespace Android - -#endif // ANDROIDDEPLOYQTSTEP_H diff --git a/src/plugins/android/androiddeployqtwidget.h b/src/plugins/android/androiddeployqtwidget.h index b8cc586e0b..81ae354676 100644 --- a/src/plugins/android/androiddeployqtwidget.h +++ b/src/plugins/android/androiddeployqtwidget.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDDEPLOYQTWIDGET_H -#define ANDROIDDEPLOYQTWIDGET_H +#pragma once #include <projectexplorer/buildstep.h> @@ -62,4 +61,3 @@ private: } } -#endif // ANDROIDDEPLOYQTWIDGET_H diff --git a/src/plugins/android/androiddevice.h b/src/plugins/android/androiddevice.h index 5ed6fb5804..b9dfe6ea70 100644 --- a/src/plugins/android/androiddevice.h +++ b/src/plugins/android/androiddevice.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDDEVICE_H -#define ANDROIDDEVICE_H +#pragma once #include <projectexplorer/devicesupport/idevice.h> @@ -36,18 +35,18 @@ namespace Internal { class AndroidDevice : public ProjectExplorer::IDevice { public: - ProjectExplorer::IDevice::DeviceInfo deviceInformation() const; + ProjectExplorer::IDevice::DeviceInfo deviceInformation() const override; - QString displayType() const; - ProjectExplorer::IDeviceWidget *createWidget(); - QList<Core::Id> actionIds() const; - QString displayNameForActionId(Core::Id actionId) const; - void executeAction(Core::Id actionId, QWidget *parent = 0); - bool canAutoDetectPorts() const; - ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const; + QString displayType() const override; + ProjectExplorer::IDeviceWidget *createWidget() override; + QList<Core::Id> actionIds() const override; + QString displayNameForActionId(Core::Id actionId) const override; + void executeAction(Core::Id actionId, QWidget *parent = 0) override; + bool canAutoDetectPorts() const override; + ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override; - ProjectExplorer::IDevice::Ptr clone() const; - QString qmlProfilerHost() const; + ProjectExplorer::IDevice::Ptr clone() const override; + QString qmlProfilerHost() const override; protected: friend class AndroidDeviceFactory; @@ -58,5 +57,3 @@ protected: } // namespace Internal } // namespace Android - -#endif // ANDROIDDEVICE_H diff --git a/src/plugins/android/androiddevicedialog.h b/src/plugins/android/androiddevicedialog.h index fa17aa5d56..39b9abcc7d 100644 --- a/src/plugins/android/androiddevicedialog.h +++ b/src/plugins/android/androiddevicedialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDDEVICEDIALOG_H -#define ANDROIDDEVICEDIALOG_H +#pragma once #include "androidconfigurations.h" @@ -83,5 +82,3 @@ private: } } - -#endif // ANDROIDDEVICEDIALOG_H diff --git a/src/plugins/android/androiddevicefactory.h b/src/plugins/android/androiddevicefactory.h index d57109615e..8d6dc109b8 100644 --- a/src/plugins/android/androiddevicefactory.h +++ b/src/plugins/android/androiddevicefactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDDEVICEFACTORY_H -#define ANDROIDDEVICEFACTORY_H +#pragma once #include <projectexplorer/devicesupport/idevicefactory.h> @@ -48,5 +47,3 @@ public: } // namespace Internal } // namespace Android - -#endif // ANDROIDDEVICEFACTORY_H diff --git a/src/plugins/android/androiderrormessage.h b/src/plugins/android/androiderrormessage.h index 133cc562bf..add3807b88 100644 --- a/src/plugins/android/androiderrormessage.h +++ b/src/plugins/android/androiderrormessage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDERRORMESSAGE_H -#define ANDROIDERRORMESSAGE_H +#pragma once #include <QVariantList> #include <QCoreApplication> @@ -53,5 +52,3 @@ public: } // namespace Internal } // namespace Android - -#endif // ANDROIDERRORMESSAGE_H diff --git a/src/plugins/android/androidgdbserverkitinformation.cpp b/src/plugins/android/androidgdbserverkitinformation.cpp index d5f7b1591b..b35c551076 100644 --- a/src/plugins/android/androidgdbserverkitinformation.cpp +++ b/src/plugins/android/androidgdbserverkitinformation.cpp @@ -105,7 +105,7 @@ FileName AndroidGdbServerKitInformation::autoDetect(const Kit *kit) ToolChain *tc = ToolChainKitInformation::toolChain(kit); if (!tc || tc->typeId() != Constants::ANDROID_TOOLCHAIN_ID) return FileName(); - AndroidToolChain *atc = static_cast<AndroidToolChain *>(tc); + auto atc = static_cast<AndroidToolChain *>(tc); return atc->suggestedGdbServer(); } @@ -114,13 +114,13 @@ FileName AndroidGdbServerKitInformation::autoDetect(const Kit *kit) /////////////// -AndroidGdbServerKitInformationWidget::AndroidGdbServerKitInformationWidget(Kit *kit, const KitInformation *ki) - : KitConfigWidget(kit, ki), - m_label(new ElidingLabel), - m_button(new QPushButton(tr("Manage..."))) +AndroidGdbServerKitInformationWidget::AndroidGdbServerKitInformationWidget(Kit *kit, const KitInformation *ki) : + KitConfigWidget(kit, ki), + m_label(new ElidingLabel), + m_button(new QPushButton(tr("Manage..."))) { // ToolButton with Menu, defaulting to 'Autodetect'. - QMenu *buttonMenu = new QMenu(m_button); + auto buttonMenu = new QMenu(m_button); QAction *autoDetectAction = buttonMenu->addAction(tr("Auto-detect")); connect(autoDetectAction, SIGNAL(triggered()), this, SLOT(autoDetectDebugger())); QAction *changeAction = buttonMenu->addAction(tr("Edit...")); @@ -179,19 +179,19 @@ void AndroidGdbServerKitInformationWidget::autoDetectDebugger() void AndroidGdbServerKitInformationWidget::showDialog() { QDialog dialog; - QVBoxLayout *layout = new QVBoxLayout(&dialog); - QFormLayout *formLayout = new QFormLayout; + auto layout = new QVBoxLayout(&dialog); + auto formLayout = new QFormLayout; formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); - QLabel *binaryLabel = new QLabel(tr("&Binary:")); - PathChooser *chooser = new PathChooser; + auto binaryLabel = new QLabel(tr("&Binary:")); + auto chooser = new PathChooser; chooser->setExpectedKind(PathChooser::ExistingCommand); chooser->setPath(AndroidGdbServerKitInformation::gdbServer(m_kit).toString()); binaryLabel->setBuddy(chooser); formLayout->addRow(binaryLabel, chooser); layout->addLayout(formLayout); - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog); + auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog); connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); layout->addWidget(buttonBox); diff --git a/src/plugins/android/androidgdbserverkitinformation.h b/src/plugins/android/androidgdbserverkitinformation.h index 5a0122e8de..1aaadd4e3b 100644 --- a/src/plugins/android/androidgdbserverkitinformation.h +++ b/src/plugins/android/androidgdbserverkitinformation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDGDBSERVERKITINFORMATION_H -#define ANDROIDGDBSERVERKITINFORMATION_H +#pragma once #include <projectexplorer/kitinformation.h> #include <projectexplorer/kitconfigwidget.h> @@ -85,5 +84,3 @@ public: } // namespace Internal } // namespace Android - -#endif // ANDROIDGDBSERVERKITINFORMATION_H diff --git a/src/plugins/android/androidglobal.h b/src/plugins/android/androidglobal.h index c2de68148a..b9cdb4bcc3 100644 --- a/src/plugins/android/androidglobal.h +++ b/src/plugins/android/androidglobal.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDGLOBAL_H -#define ANDROIDGLOBAL_H +#pragma once #include <utils/environment.h> @@ -43,18 +42,13 @@ public: template<class T> static T *buildStep(const ProjectExplorer::BuildConfiguration *dc) { if (!dc) - return 0; + return nullptr; foreach (const Core::Id &id, dc->knownStepLists()) { - ProjectExplorer::BuildStepList *bsl = dc->stepList(id); - if (!bsl) - return 0; - const QList<ProjectExplorer::BuildStep *> &buildSteps = bsl->steps(); - for (int i = buildSteps.count() - 1; i >= 0; --i) { - if (T * const step = qobject_cast<T *>(buildSteps.at(i))) - return step; - } + T *const step = dc->stepList(id)->firstOfType<T>(); + if (step) + return step; } - return 0; + return nullptr; } template<typename State> static void assertState(State expected, @@ -74,5 +68,3 @@ public: }; } // namespace Android - -#endif // ANDROIDGLOBAL_H diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index d2f03531c8..344a4330de 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDMANAGER_H -#define ANDROIDMANAGER_H +#pragma once #include "android_global.h" @@ -90,5 +89,3 @@ public: }; } // namespace Android - -#endif // ANDROIDMANAGER_H diff --git a/src/plugins/android/androidmanifestdocument.h b/src/plugins/android/androidmanifestdocument.h index aad62b8f9a..169047f051 100644 --- a/src/plugins/android/androidmanifestdocument.h +++ b/src/plugins/android/androidmanifestdocument.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDMANIFESTDOCUMENT_H -#define ANDROIDMANIFESTDOCUMENT_H +#pragma once #include <texteditor/textdocument.h> @@ -49,5 +48,3 @@ private: } // namespace Internal } // namespace Android - -#endif // ANDROIDMANIFESTDOCUMENT_H diff --git a/src/plugins/android/androidmanifesteditor.h b/src/plugins/android/androidmanifesteditor.h index a2c2956e32..32ed8476f0 100644 --- a/src/plugins/android/androidmanifesteditor.h +++ b/src/plugins/android/androidmanifesteditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDMANIFESTEDITOR_H -#define ANDROIDMANIFESTEDITOR_H +#pragma once #include "androidmanifestdocument.h" #include "androidmanifesteditorwidget.h" @@ -69,5 +68,3 @@ private: } // namespace Internal } // namespace Android - -#endif // ANDROIDMANIFESTEDITOR_H diff --git a/src/plugins/android/androidmanifesteditorfactory.h b/src/plugins/android/androidmanifesteditorfactory.h index 6ab7289877..a25e02cef5 100644 --- a/src/plugins/android/androidmanifesteditorfactory.h +++ b/src/plugins/android/androidmanifesteditorfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDMANIFESTEDITORFACTORY_H -#define ANDROIDMANIFESTEDITORFACTORY_H +#pragma once #include <coreplugin/editormanager/ieditorfactory.h> @@ -43,5 +42,3 @@ public: } // namespace Internal } // namespace Android - -#endif // ANDROIDMANIFESTEDITORFACTORY_H diff --git a/src/plugins/android/androidmanifesteditorwidget.h b/src/plugins/android/androidmanifesteditorwidget.h index 7581ca0939..8a0afa166f 100644 --- a/src/plugins/android/androidmanifesteditorwidget.h +++ b/src/plugins/android/androidmanifesteditorwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDMANIFESTEDITORWIDGET_H -#define ANDROIDMANIFESTEDITORWIDGET_H +#pragma once #include <texteditor/texteditor.h> @@ -191,6 +190,3 @@ private: }; } // namespace Internal } // namespace Android - - -#endif // ANDROIDMANIFESTEDITORWIDGET_H diff --git a/src/plugins/android/androidplugin.h b/src/plugins/android/androidplugin.h index afde90ccc9..6f2bbd7544 100644 --- a/src/plugins/android/androidplugin.h +++ b/src/plugins/android/androidplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDPLUGIN_H -#define ANDROIDPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -47,5 +46,3 @@ private slots: }; } // namespace Android - -#endif // ANDROIDPLUGIN_H diff --git a/src/plugins/android/androidpotentialkit.cpp b/src/plugins/android/androidpotentialkit.cpp index 0f72930dfb..f323feecad 100644 --- a/src/plugins/android/androidpotentialkit.cpp +++ b/src/plugins/android/androidpotentialkit.cpp @@ -56,7 +56,7 @@ void AndroidPotentialKit::executeFromMenu() QWidget *AndroidPotentialKit::createWidget(QWidget *parent) const { if (!isEnabled()) - return 0; + return nullptr; return new AndroidPotentialKitWidget(parent); } @@ -89,18 +89,18 @@ AndroidPotentialKitWidget::AndroidPotentialKitWidget(QWidget *parent) setSummaryText(QLatin1String("<b>Android has not been configured. Create Android kits.</b>")); setIcon(Core::Icons::WARNING.icon()); //detailsWidget->setState(Utils::DetailsWidget::NoSummary); - QWidget *mainWidget = new QWidget(this); + auto mainWidget = new QWidget(this); setWidget(mainWidget); - QGridLayout *layout = new QGridLayout(mainWidget); + auto layout = new QGridLayout(mainWidget); layout->setMargin(0); - QLabel *label = new QLabel; + auto label = new QLabel; label->setText(tr("Qt Creator needs additional settings to enable Android support." " You can configure those settings in the Options dialog.")); label->setWordWrap(true); layout->addWidget(label, 0, 0, 1, 2); - QPushButton *openOptions = new QPushButton; + auto openOptions = new QPushButton; openOptions->setText(Core::ICore::msgShowOptionsDialog()); openOptions->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); layout->addWidget(openOptions, 1, 1); diff --git a/src/plugins/android/androidpotentialkit.h b/src/plugins/android/androidpotentialkit.h index dbffe2c782..54341de033 100644 --- a/src/plugins/android/androidpotentialkit.h +++ b/src/plugins/android/androidpotentialkit.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDPOTENTIALKIT_H -#define ANDROIDPOTENTIALKIT_H +#pragma once #include <projectexplorer/ipotentialkit.h> #include <utils/detailswidget.h> @@ -36,10 +35,10 @@ class AndroidPotentialKit : public ProjectExplorer::IPotentialKit { Q_OBJECT public: - QString displayName() const; - void executeFromMenu(); - QWidget *createWidget(QWidget *parent) const; - bool isEnabled() const; + QString displayName() const override; + void executeFromMenu() override; + QWidget *createWidget(QWidget *parent) const override; + bool isEnabled() const override; }; class AndroidPotentialKitWidget : public Utils::DetailsWidget @@ -56,5 +55,3 @@ private slots: } } - -#endif // ANDROIDPOTENTIALKIT_H diff --git a/src/plugins/android/androidqtsupport.h b/src/plugins/android/androidqtsupport.h index b4c1e9d7d7..021e5d7cff 100644 --- a/src/plugins/android/androidqtsupport.h +++ b/src/plugins/android/androidqtsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDSUPPORT_H -#define ANDROIDSUPPORT_H +#pragma once #include "android_global.h" @@ -66,6 +65,3 @@ public: }; } // namespace Android - - -#endif // ANDROIDSUPPORT_H diff --git a/src/plugins/android/androidqtversion.h b/src/plugins/android/androidqtversion.h index 05df491ed2..865c31e65c 100644 --- a/src/plugins/android/androidqtversion.h +++ b/src/plugins/android/androidqtversion.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDQTVERSION_H -#define ANDROIDQTVERSION_H +#pragma once #include <qtsupport/baseqtversion.h> @@ -64,5 +63,3 @@ private: } // namespace Internal } // namespace Android - -#endif // ANDROIDQTVERSION_H diff --git a/src/plugins/android/androidqtversionfactory.h b/src/plugins/android/androidqtversionfactory.h index e75fa9b580..8f551b9b86 100644 --- a/src/plugins/android/androidqtversionfactory.h +++ b/src/plugins/android/androidqtversionfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDQTVERSIONFACTORY_H -#define ANDROIDQTVERSIONFACTORY_H +#pragma once #include <qtsupport/qtversionfactory.h> @@ -46,5 +45,3 @@ public: } // namespace Internal } // namespace Android - -#endif // ANDROIDQTVERSIONFACTORY_H diff --git a/src/plugins/android/androidrunconfiguration.h b/src/plugins/android/androidrunconfiguration.h index ca895e2c0b..cfa54312d9 100644 --- a/src/plugins/android/androidrunconfiguration.h +++ b/src/plugins/android/androidrunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDRUNCONFIGURATION_H -#define ANDROIDRUNCONFIGURATION_H +#pragma once #include "android_global.h" @@ -47,5 +46,3 @@ protected: }; } // namespace Android - -#endif // ANDROIDRUNCONFIGURATION_H diff --git a/src/plugins/android/androidruncontrol.h b/src/plugins/android/androidruncontrol.h index 2ee21c3bcb..343164de49 100644 --- a/src/plugins/android/androidruncontrol.h +++ b/src/plugins/android/androidruncontrol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDRUNCONTROL_H -#define ANDROIDRUNCONTROL_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -59,5 +58,3 @@ private: } // namespace Internal } // namespace Android - -#endif // ANDROIDRUNCONTROL_H diff --git a/src/plugins/android/androidrunfactories.h b/src/plugins/android/androidrunfactories.h index 58362cf8c8..5556b44f48 100644 --- a/src/plugins/android/androidrunfactories.h +++ b/src/plugins/android/androidrunfactories.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDRUNFACTORIES_H -#define ANDROIDRUNFACTORIES_H +#pragma once #include "android_global.h" #include <projectexplorer/runconfiguration.h> @@ -55,5 +54,3 @@ public: } // namespace Internal } // namespace Android - -#endif // ANDROIDRUNFACTORIES_H diff --git a/src/plugins/android/androidrunnable.h b/src/plugins/android/androidrunnable.h index 453807c359..5f09a50355 100644 --- a/src/plugins/android/androidrunnable.h +++ b/src/plugins/android/androidrunnable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDRUNNABLE_H -#define ANDROIDRUNNABLE_H +#pragma once #include "android_global.h" #include <projectexplorer/runnables.h> @@ -54,5 +53,3 @@ inline bool operator==(const AndroidRunnable &r1, const AndroidRunnable &r2) } } // namespace Android - -#endif // ANDROIDRUNNABLE_H diff --git a/src/plugins/android/androidrunner.cpp b/src/plugins/android/androidrunner.cpp index 80c49b5564..03e8d6851d 100644 --- a/src/plugins/android/androidrunner.cpp +++ b/src/plugins/android/androidrunner.cpp @@ -137,16 +137,16 @@ AndroidRunner::AndroidRunner(QObject *parent, m_qmlDebugServices = QmlDebug::NoQmlDebugServices; QString channel = runConfig->remoteChannel(); QTC_CHECK(channel.startsWith(QLatin1Char(':'))); - m_localGdbServerPort = channel.mid(1).toUShort(); - QTC_CHECK(m_localGdbServerPort); + m_localGdbServerPort = Utils::Port(channel.mid(1).toUShort()); + QTC_CHECK(m_localGdbServerPort.isValid()); if (m_qmlDebugServices != QmlDebug::NoQmlDebugServices) { QTcpServer server; QTC_ASSERT(server.listen(QHostAddress::LocalHost) || server.listen(QHostAddress::LocalHostIPv6), qDebug() << tr("No free ports available on host for QML debugging.")); - m_qmlPort = server.serverPort(); + m_qmlPort = Utils::Port(server.serverPort()); } else { - m_qmlPort = 0; + m_qmlPort = Utils::Port(); } ProjectExplorer::Target *target = runConfig->target(); m_androidRunnable.intentName = AndroidManager::intentName(target); @@ -276,18 +276,18 @@ void AndroidRunner::checkPID() if (m_useCppDebugger) { // This will be funneled to the engine to actually start and attach // gdb. Afterwards this ends up in handleRemoteDebuggerRunning() below. - QByteArray serverChannel = ':' + QByteArray::number(m_localGdbServerPort); + QByteArray serverChannel = ':' + QByteArray::number(m_localGdbServerPort.number()); emit remoteServerRunning(serverChannel, m_processPID); } else if (m_qmlDebugServices == QmlDebug::QmlDebuggerServices) { // This will be funneled to the engine to actually start and attach // gdb. Afterwards this ends up in handleRemoteDebuggerRunning() below. - QByteArray serverChannel = QByteArray::number(m_qmlPort); + QByteArray serverChannel = QByteArray::number(m_qmlPort.number()); emit remoteServerRunning(serverChannel, m_processPID); } else if (m_qmlDebugServices == QmlDebug::QmlProfilerServices) { - emit remoteProcessStarted(-1, m_qmlPort); + emit remoteProcessStarted(Utils::Port(), m_qmlPort); } else { // Start without debugging. - emit remoteProcessStarted(-1, -1); + emit remoteProcessStarted(Utils::Port(), Utils::Port()); } m_wasStarted = true; logcatReadStandardOutput(); @@ -348,7 +348,7 @@ void AndroidRunner::asyncStart() if (m_useCppDebugger) { QProcess adb; adb.start(m_adb, selector() << _("forward") - << QString::fromLatin1("tcp:%1").arg(m_localGdbServerPort) + << QString::fromLatin1("tcp:%1").arg(m_localGdbServerPort.number()) << _("localfilesystem:") + m_gdbserverSocket); if (!adb.waitForStarted()) { emit remoteProcessFinished(tr("Failed to forward C++ debugging ports. Reason: %1.").arg(adb.errorString())); @@ -390,7 +390,7 @@ void AndroidRunner::asyncStart() if (m_qmlDebugServices != QmlDebug::NoQmlDebugServices) { // currently forward to same port on device and host - const QString port = QString::fromLatin1("tcp:%1").arg(m_qmlPort); + const QString port = QString::fromLatin1("tcp:%1").arg(m_qmlPort.number()); QProcess adb; adb.start(m_adb, selector() << _("forward") << port << port); if (!adb.waitForStarted()) { @@ -405,7 +405,7 @@ void AndroidRunner::asyncStart() args << _("-e") << _("qml_debug") << _("true") << _("-e") << _("qmljsdebugger") << QString::fromLatin1("port:%1,block,services:%2") - .arg(m_qmlPort).arg(QmlDebug::qmlDebugServices(m_qmlDebugServices)); + .arg(m_qmlPort.number()).arg(QmlDebug::qmlDebugServices(m_qmlDebugServices)); } QProcess adb; diff --git a/src/plugins/android/androidrunner.h b/src/plugins/android/androidrunner.h index 32f7418ad9..c9a87f3579 100644 --- a/src/plugins/android/androidrunner.h +++ b/src/plugins/android/androidrunner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDRUNNER_H -#define ANDROIDRUNNER_H +#pragma once #include "androidconfigurations.h" #include "androidrunnable.h" @@ -69,7 +68,7 @@ public slots: signals: void remoteServerRunning(const QByteArray &serverChannel, int pid); - void remoteProcessStarted(int gdbServerPort, int qmlPort); + void remoteProcessStarted(Utils::Port gdbServerPort, Utils::Port qmlPort); void remoteProcessFinished(const QString &errString = QString()); void remoteOutput(const QString &output); @@ -102,8 +101,8 @@ private: qint64 m_processPID; bool m_useCppDebugger; QmlDebug::QmlDebugServicesPreset m_qmlDebugServices; - ushort m_localGdbServerPort; // Local end of forwarded debug socket. - quint16 m_qmlPort; + Utils::Port m_localGdbServerPort; // Local end of forwarded debug socket. + Utils::Port m_qmlPort; QString m_pingFile; QString m_pongFile; QString m_gdbserverPath; @@ -120,5 +119,3 @@ private: } // namespace Internal } // namespace Android - -#endif // ANDROIDRUNNER_H diff --git a/src/plugins/android/androidsettingspage.h b/src/plugins/android/androidsettingspage.h index 2f45863c71..1330721dbf 100644 --- a/src/plugins/android/androidsettingspage.h +++ b/src/plugins/android/androidsettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDSETTINGSPAGE_H -#define ANDROIDSETTINGSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -52,5 +51,3 @@ private: } // namespace Internal } // namespace Android - -#endif // ANDROIDSETTINGSPAGE_H diff --git a/src/plugins/android/androidsettingswidget.h b/src/plugins/android/androidsettingswidget.h index 4e68c596ff..f39c7eaf52 100644 --- a/src/plugins/android/androidsettingswidget.h +++ b/src/plugins/android/androidsettingswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDSETTINGSWIDGET_H -#define ANDROIDSETTINGSWIDGET_H +#pragma once #include "androidconfigurations.h" @@ -124,5 +123,3 @@ private: } // namespace Internal } // namespace Android - -#endif // ANDROIDSETTINGSWIDGET_H diff --git a/src/plugins/android/androidsignaloperation.h b/src/plugins/android/androidsignaloperation.h index ae35d6cc6e..f31972e3fa 100644 --- a/src/plugins/android/androidsignaloperation.h +++ b/src/plugins/android/androidsignaloperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDSIGNALOPERATION_H -#define ANDROIDSIGNALOPERATION_H +#pragma once #include <projectexplorer/devicesupport/idevice.h> @@ -74,5 +73,3 @@ private: } // namespace Internal } // namespace Android - -#endif // ANDROIDSIGNALOPERATION_H diff --git a/src/plugins/android/androidtoolchain.h b/src/plugins/android/androidtoolchain.h index 97bf8dffac..06d0944956 100644 --- a/src/plugins/android/androidtoolchain.h +++ b/src/plugins/android/androidtoolchain.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDTOOLCHAIN_H -#define ANDROIDTOOLCHAIN_H +#pragma once #include <projectexplorer/gcctoolchain.h> #include <projectexplorer/toolchainconfigwidget.h> @@ -124,5 +123,3 @@ private: } // namespace Internal } // namespace Android - -#endif // ANDROIDTOOLCHAIN_H diff --git a/src/plugins/android/avddialog.h b/src/plugins/android/avddialog.h index d4e6c355ac..6d98aa0124 100644 --- a/src/plugins/android/avddialog.h +++ b/src/plugins/android/avddialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef AVDDIALOG_H -#define AVDDIALOG_H +#pragma once #include "ui_addnewavddialog.h" @@ -62,5 +61,3 @@ private: }; } } - -#endif // AVDDIALOG_H diff --git a/src/plugins/android/certificatesmodel.h b/src/plugins/android/certificatesmodel.h index e77bc06c8d..57c0a6ab43 100644 --- a/src/plugins/android/certificatesmodel.h +++ b/src/plugins/android/certificatesmodel.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef CERTIFICATESMODEL_H -#define CERTIFICATESMODEL_H +#pragma once #include <QAbstractListModel> #include <QVector> @@ -50,5 +49,3 @@ private: } } - -#endif // CERTIFICATESMODEL_H diff --git a/src/plugins/android/javacompletionassistprovider.h b/src/plugins/android/javacompletionassistprovider.h index 5e90bcf2fe..f58685250f 100644 --- a/src/plugins/android/javacompletionassistprovider.h +++ b/src/plugins/android/javacompletionassistprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JAVACOMPLETIONASSISTPROVIDER_H -#define JAVACOMPLETIONASSISTPROVIDER_H +#pragma once #include <texteditor/codeassist/completionassistprovider.h> @@ -52,5 +51,3 @@ private: } // namespace Internal } // namespace Android - -#endif // JAVACOMPLETIONASSISTPROVIDER_H diff --git a/src/plugins/android/javaeditor.cpp b/src/plugins/android/javaeditor.cpp index 0aef948f43..7398140922 100644 --- a/src/plugins/android/javaeditor.cpp +++ b/src/plugins/android/javaeditor.cpp @@ -25,7 +25,6 @@ #include "javaeditor.h" #include "javaindenter.h" -#include "javaautocompleter.h" #include "androidconstants.h" #include "javacompletionassistprovider.h" @@ -74,7 +73,6 @@ JavaEditorFactory::JavaEditorFactory() addMimeType(Constants::JAVA_MIMETYPE); setDocumentCreator([]() { return new JavaDocument; }); - setAutoCompleterCreator([]() { return new JavaAutoCompleter; }); setUseGenericHighlighter(true); setCommentStyle(Utils::CommentDefinition::CppStyle); setEditorActionHandlers(TextEditor::TextEditorActionHandler::UnCommentSelection); diff --git a/src/plugins/android/javaeditor.h b/src/plugins/android/javaeditor.h index 6f176b784c..c442484daf 100644 --- a/src/plugins/android/javaeditor.h +++ b/src/plugins/android/javaeditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JAVAEDITOR_H -#define JAVAEDITOR_H +#pragma once #include <texteditor/texteditor.h> @@ -41,5 +40,3 @@ public: } // namespace Internal } // namespace Android - -#endif // JAVAEDITOR_H diff --git a/src/plugins/android/javaindenter.h b/src/plugins/android/javaindenter.h index 9be0b47a95..2b40851fd4 100644 --- a/src/plugins/android/javaindenter.h +++ b/src/plugins/android/javaindenter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JAVAINDENTER_H -#define JAVAINDENTER_H +#pragma once #include <texteditor/indenter.h> @@ -47,5 +46,3 @@ public: }; } // namespace Internal } // namespace Android - -#endif // JAVAINDENTER_H diff --git a/src/plugins/android/javaparser.h b/src/plugins/android/javaparser.h index 6a5d237985..642db44e23 100644 --- a/src/plugins/android/javaparser.h +++ b/src/plugins/android/javaparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JAVAPARSER_H -#define JAVAPARSER_H +#pragma once #include <projectexplorer/ioutputparser.h> #include <utils/fileutils.h> @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace Android - -#endif // JAVAPARSER_H diff --git a/src/plugins/autotest/autotest_global.h b/src/plugins/autotest/autotest_global.h index 03822d4131..c485ad2185 100644 --- a/src/plugins/autotest/autotest_global.h +++ b/src/plugins/autotest/autotest_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef AUTOTEST_GLOBAL_H -#define AUTOTEST_GLOBAL_H +#pragma once #include <QtGlobal> @@ -33,6 +32,3 @@ #else # define AUTOTESTSHARED_EXPORT Q_DECL_IMPORT #endif - -#endif // AUTOTEST_GLOBAL_H - diff --git a/src/plugins/autotest/autotest_utils.h b/src/plugins/autotest/autotest_utils.h index c9447d3bbd..db3decf6c0 100644 --- a/src/plugins/autotest/autotest_utils.h +++ b/src/plugins/autotest/autotest_utils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef AUTOTEST_UTILS_H -#define AUTOTEST_UTILS_H +#pragma once #include <QStringList> @@ -68,5 +67,3 @@ public: } // namespace Internal } // namespace Autotest - -#endif // AUTOTEST_UTILS_H diff --git a/src/plugins/autotest/autotestconstants.h b/src/plugins/autotest/autotestconstants.h index 5e9f3c56c4..9b1f1a2adb 100644 --- a/src/plugins/autotest/autotestconstants.h +++ b/src/plugins/autotest/autotestconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef AUTOTESTCONSTANTS_H -#define AUTOTESTCONSTANTS_H +#pragma once #include <QtGlobal> @@ -54,6 +53,3 @@ enum TestType } // namespace Internal } // namespace Autotest - -#endif // AUTOTESTCONSTANTS_H - diff --git a/src/plugins/autotest/autotesticons.h b/src/plugins/autotest/autotesticons.h index 88c929dc97..35a9614a5f 100644 --- a/src/plugins/autotest/autotesticons.h +++ b/src/plugins/autotest/autotesticons.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef AUTOTESTICONS_H -#define AUTOTESTICONS_H +#pragma once #include <utils/icon.h> @@ -45,5 +44,3 @@ const Utils::Icon RUN_SELECTED_OVERLAY({ } // namespace Icons } // namespace Autotest - -#endif // AUTOTESTICONS_H diff --git a/src/plugins/autotest/autotestplugin.h b/src/plugins/autotest/autotestplugin.h index 18ffbaf4ed..5cef24fd10 100644 --- a/src/plugins/autotest/autotestplugin.h +++ b/src/plugins/autotest/autotestplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef AUTOTESTPLUGIN_H -#define AUTOTESTPLUGIN_H +#pragma once #include "autotest_global.h" @@ -64,6 +63,3 @@ private: } // namespace Internal } // namespace Autotest - -#endif // AUTOTESTPLUGIN_H - diff --git a/src/plugins/autotest/autotestunittests.h b/src/plugins/autotest/autotestunittests.h index 6eab3749d4..e57d265a40 100644 --- a/src/plugins/autotest/autotestunittests.h +++ b/src/plugins/autotest/autotestunittests.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef AUTOTESTUNITTESTS_H -#define AUTOTESTUNITTESTS_H +#pragma once #include <QObject> #include <QTemporaryDir> @@ -62,5 +61,3 @@ private: } // namespace Internal } // namespace Autotest - -#endif // AUTOTESTUNITTESTS_H diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index da95b7273e..8753b02b29 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -430,14 +430,14 @@ static QMap<QString, TestCodeLocationList> checkForDataTags(const QString &fileN /****** end of helpers ******/ -static void checkQmlDocumentForTestCode(QFutureInterface<TestParseResult> futureInterface, +static bool checkQmlDocumentForTestCode(QFutureInterface<TestParseResult> futureInterface, const QmlJS::Document::Ptr &qmlJSDoc, const QString &proFile = QString()) { if (qmlJSDoc.isNull()) - return; + return false; QmlJS::AST::Node *ast = qmlJSDoc->ast(); - QTC_ASSERT(ast, return); + QTC_ASSERT(ast, return false); TestQmlVisitor qmlVisitor(qmlJSDoc); QmlJS::AST::Node::accept(ast, &qmlVisitor); @@ -455,31 +455,79 @@ static void checkQmlDocumentForTestCode(QFutureInterface<TestParseResult> future parseResult.column = tcLocationAndType.m_column; } futureInterface.reportResult(parseResult); + return true; +} + +static bool handleQtTest(QFutureInterface<TestParseResult> futureInterface, + CPlusPlus::Document::Ptr document, const QString &oldTestCaseName) +{ + const QString &fileName = document->fileName(); + const CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance(); + QString testCaseName(testClass(modelManager, fileName)); + // we might be in a reparse without the original entry point with the QTest::qExec() + if (testCaseName.isEmpty()) + testCaseName = oldTestCaseName; + if (!testCaseName.isEmpty()) { + unsigned line = 0; + unsigned column = 0; + CPlusPlus::Document::Ptr declaringDoc = declaringDocument(document, testCaseName, + &line, &column); + if (declaringDoc.isNull()) + return false; + + TestVisitor visitor(testCaseName); + visitor.accept(declaringDoc->globalNamespace()); + if (!visitor.resultValid()) + return false; + + const QMap<QString, TestCodeLocationAndType> testFunctions = visitor.privateSlots(); + + QMap<QString, TestCodeLocationList> dataTags = + checkForDataTags(declaringDoc->fileName(), testFunctions); + + if (declaringDoc->fileName() != fileName) + dataTags.unite(checkForDataTags(fileName, testFunctions)); + + TestParseResult parseResult(TestTreeModel::AutoTest); + parseResult.fileName = declaringDoc->fileName(); + parseResult.testCaseName = testCaseName; + parseResult.line = line; + parseResult.column = column; + parseResult.functions = testFunctions; + parseResult.dataTagsOrTestSets = dataTags; + parseResult.proFile = modelManager->projectPart(fileName).first()->projectFile; + + futureInterface.reportResult(parseResult); + return true; + } + return false; } -static void handleQtQuickTest(QFutureInterface<TestParseResult> futureInterface, +static bool handleQtQuickTest(QFutureInterface<TestParseResult> futureInterface, CPlusPlus::Document::Ptr document) { const CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance(); if (quickTestName(document).isEmpty()) - return; + return false; const QString cppFileName = document->fileName(); QList<CppTools::ProjectPart::Ptr> ppList = modelManager->projectPart(cppFileName); - QTC_ASSERT(!ppList.isEmpty(), return); + QTC_ASSERT(!ppList.isEmpty(), return false); const QString &proFile = ppList.at(0)->projectFile; const QString srcDir = quickTestSrcDir(modelManager, cppFileName); if (srcDir.isEmpty()) - return; + return false; const QList<QmlJS::Document::Ptr> qmlDocs = scanDirectoryForQuickTestQmlFiles(srcDir); + bool result = false; foreach (const QmlJS::Document::Ptr &qmlJSDoc, qmlDocs) - checkQmlDocumentForTestCode(futureInterface, qmlJSDoc, proFile); + result |= checkQmlDocumentForTestCode(futureInterface, qmlJSDoc, proFile); + return result; } -static void handleGTest(QFutureInterface<TestParseResult> futureInterface, const QString &filePath) +static bool handleGTest(QFutureInterface<TestParseResult> futureInterface, const QString &filePath) { const QByteArray &fileContent = getFileContent(filePath); const CPlusPlus::Snapshot snapshot = CPlusPlus::CppModelManagerBase::instance()->snapshot(); @@ -507,6 +555,7 @@ static void handleGTest(QFutureInterface<TestParseResult> futureInterface, const parseResult.dataTagsOrTestSets.insert(QString(), result.value(testSpec)); futureInterface.reportResult(parseResult); } + return !result.keys().isEmpty(); } static void checkDocumentForTestCode(QFutureInterface<TestParseResult> futureInterface, @@ -522,51 +571,21 @@ static void checkDocumentForTestCode(QFutureInterface<TestParseResult> futureInt return; } + const QString &oldTestCaseName = testCaseNames.value(fileName); + if (includesQtQuickTest(document, modelManager)) { - handleQtQuickTest(futureInterface, document); - } else if (testCaseNames.contains(fileName) // if we do a reparse + if (handleQtQuickTest(futureInterface, document)) + return; + } + if (!oldTestCaseName.isEmpty() // if we do a reparse || (includesQtTest(document, modelManager) && qtTestLibDefined(modelManager, fileName))) { - QString testCaseName(testClass(modelManager, fileName)); - // we might be in a reparse without the original entry point with the QTest::qExec() - if (testCaseName.isEmpty()) - testCaseName = testCaseNames.value(fileName); - if (!testCaseName.isEmpty()) { - unsigned line = 0; - unsigned column = 0; - CPlusPlus::Document::Ptr declaringDoc = declaringDocument(document, testCaseName, - &line, &column); - if (declaringDoc.isNull()) - return; - - TestVisitor visitor(testCaseName); - visitor.accept(declaringDoc->globalNamespace()); - - if (!visitor.resultValid()) - return; - - const QMap<QString, TestCodeLocationAndType> testFunctions = visitor.privateSlots(); - - QMap<QString, TestCodeLocationList> dataTags = - checkForDataTags(declaringDoc->fileName(), testFunctions); - - if (declaringDoc->fileName() != document->fileName()) - dataTags.unite(checkForDataTags(document->fileName(), testFunctions)); - - TestParseResult parseResult(TestTreeModel::AutoTest); - parseResult.fileName = declaringDoc->fileName(); - parseResult.testCaseName = testCaseName; - parseResult.line = line; - parseResult.column = column; - parseResult.functions = testFunctions; - parseResult.dataTagsOrTestSets = dataTags; - parseResult.proFile = projParts.first()->projectFile; - - futureInterface.reportResult(parseResult); - } - } else if (includesGTest(document, modelManager)) { - if (hasGTestNames(document)) - handleGTest(futureInterface, document->fileName()); + if (handleQtTest(futureInterface, document, oldTestCaseName)) + return; + } + if (includesGTest(document, modelManager) && hasGTestNames(document)) { + if (handleGTest(futureInterface, document->fileName())) + return; } } diff --git a/src/plugins/autotest/testcodeparser.h b/src/plugins/autotest/testcodeparser.h index 2755d33dd6..1ae34ffa33 100644 --- a/src/plugins/autotest/testcodeparser.h +++ b/src/plugins/autotest/testcodeparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTCODEPARSER_H -#define TESTCODEPARSER_H +#pragma once #include "testtreeitem.h" #include "testtreemodel.h" @@ -107,5 +106,3 @@ private: } // namespace Internal } // Autotest - -#endif // TESTCODEPARSER_H diff --git a/src/plugins/autotest/testconfiguration.h b/src/plugins/autotest/testconfiguration.h index f3bcbbd161..ff00ad0d9f 100644 --- a/src/plugins/autotest/testconfiguration.h +++ b/src/plugins/autotest/testconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTCONFIGURATION_H -#define TESTCONFIGURATION_H +#pragma once #include "autotestconstants.h" @@ -98,5 +97,3 @@ private: } // namespace Internal } // namespace Autotest - -#endif // TESTCONFIGURATION_H diff --git a/src/plugins/autotest/testnavigationwidget.h b/src/plugins/autotest/testnavigationwidget.h index 5f92909b93..02a709162c 100644 --- a/src/plugins/autotest/testnavigationwidget.h +++ b/src/plugins/autotest/testnavigationwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTNAVIGATIONWIDGETTREEVIEW_H -#define TESTNAVIGATIONWIDGETTREEVIEW_H +#pragma once #include <coreplugin/inavigationwidgetfactory.h> @@ -102,5 +101,3 @@ private: } // namespace Internal } // namespace Autotest - -#endif // TESTNAVIGATIONWIDGETTREEVIEW_H diff --git a/src/plugins/autotest/testoutputreader.h b/src/plugins/autotest/testoutputreader.h index facb69b601..aed50b1b96 100644 --- a/src/plugins/autotest/testoutputreader.h +++ b/src/plugins/autotest/testoutputreader.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTXMLOUTPUTREADER_H -#define TESTXMLOUTPUTREADER_H +#pragma once #include "testresult.h" @@ -107,5 +106,3 @@ private: } // namespace Internal } // namespace Autotest - -#endif // TESTOUTPUTREADER_H diff --git a/src/plugins/autotest/testresult.h b/src/plugins/autotest/testresult.h index 66073f0ca4..86439b4640 100644 --- a/src/plugins/autotest/testresult.h +++ b/src/plugins/autotest/testresult.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTRESULT_H -#define TESTRESULT_H +#pragma once #include "autotestconstants.h" @@ -132,5 +131,3 @@ bool operator==(const TestResult &t1, const TestResult &t2); Q_DECLARE_METATYPE(Autotest::Internal::TestResult) Q_DECLARE_METATYPE(Autotest::Internal::Result::Type) - -#endif // TESTRESULT_H diff --git a/src/plugins/autotest/testresultdelegate.h b/src/plugins/autotest/testresultdelegate.h index 521ac0505d..9e87df63b9 100644 --- a/src/plugins/autotest/testresultdelegate.h +++ b/src/plugins/autotest/testresultdelegate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTRESULTDELEGATE_H -#define TESTRESULTDELEGATE_H +#pragma once #include "testresultmodel.h" @@ -127,5 +126,3 @@ private: } // namespace Internal } // namespace Autotest - -#endif // TESTRESULTDELEGATE_H diff --git a/src/plugins/autotest/testresultmodel.h b/src/plugins/autotest/testresultmodel.h index 2fe124178b..9f32a71450 100644 --- a/src/plugins/autotest/testresultmodel.h +++ b/src/plugins/autotest/testresultmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTRESULTMODEL_H -#define TESTRESULTMODEL_H +#pragma once #include "testresult.h" @@ -101,5 +100,3 @@ private: } // namespace Internal } // namespace Autotest - -#endif // TESTRESULTMODEL_H diff --git a/src/plugins/autotest/testresultspane.h b/src/plugins/autotest/testresultspane.h index 86b9bbd4a9..4955783f89 100644 --- a/src/plugins/autotest/testresultspane.h +++ b/src/plugins/autotest/testresultspane.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTRESULTSPANE_H -#define TESTRESULTSPANE_H +#pragma once #include "testresult.h" @@ -136,5 +135,3 @@ private: } // namespace Internal } // namespace Autotest - -#endif // TESTRESULTSPANE_H diff --git a/src/plugins/autotest/testrunner.h b/src/plugins/autotest/testrunner.h index 63b8eaccbc..aca76ac5ce 100644 --- a/src/plugins/autotest/testrunner.h +++ b/src/plugins/autotest/testrunner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTRUNNER_H -#define TESTRUNNER_H +#pragma once #include "testconfiguration.h" #include "testresult.h" @@ -79,5 +78,3 @@ private: } // namespace Internal } // namespace Autotest - -#endif // TESTRUNNER_H diff --git a/src/plugins/autotest/testsettings.h b/src/plugins/autotest/testsettings.h index 7a9aa1d97d..e34ab202fa 100644 --- a/src/plugins/autotest/testsettings.h +++ b/src/plugins/autotest/testsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTSETTINGS_H -#define TESTSETTINGS_H +#pragma once #include <QtGlobal> @@ -70,5 +69,3 @@ inline bool operator!=(const TestSettings &s1, const TestSettings &s2) { return } // namespace Internal } // namespace Autotest - -#endif // TESTSETTINGS_H diff --git a/src/plugins/autotest/testsettingspage.h b/src/plugins/autotest/testsettingspage.h index c41929c667..5ae3b98b3a 100644 --- a/src/plugins/autotest/testsettingspage.h +++ b/src/plugins/autotest/testsettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTSETTINGSPAGE_H -#define TESTSETTINGSPAGE_H +#pragma once #include "ui_testsettingspage.h" @@ -69,5 +68,3 @@ private: } // namespace Internal } // namespace Autotest - -#endif // TESTSETTINGSPAGE_H diff --git a/src/plugins/autotest/testtreeitem.h b/src/plugins/autotest/testtreeitem.h index 5f45a723ef..c38a7ae4fe 100644 --- a/src/plugins/autotest/testtreeitem.h +++ b/src/plugins/autotest/testtreeitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTTREEITEM_H -#define TESTTREEITEM_H +#pragma once #include <utils/treemodel.h> @@ -228,5 +227,3 @@ struct GTestCaseSpec Q_DECLARE_METATYPE(Autotest::Internal::TestTreeItem *) Q_DECLARE_METATYPE(Autotest::Internal::TestCodeLocationAndType) - -#endif // TESTTREEITEM_H diff --git a/src/plugins/autotest/testtreeitemdelegate.h b/src/plugins/autotest/testtreeitemdelegate.h index 0391ea28d3..7c6f0ef67e 100644 --- a/src/plugins/autotest/testtreeitemdelegate.h +++ b/src/plugins/autotest/testtreeitemdelegate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTTREEITEMDELEGATE_H -#define TESTTREEITEMDELEGATE_H +#pragma once #include <QStyledItemDelegate> @@ -44,5 +43,3 @@ public: } // namespace Internal } // namespace Autotest - -#endif // TESTTREEITEMDELEGATE_H diff --git a/src/plugins/autotest/testtreemodel.h b/src/plugins/autotest/testtreemodel.h index dae8d34ba3..5770393779 100644 --- a/src/plugins/autotest/testtreemodel.h +++ b/src/plugins/autotest/testtreemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTTREEMODEL_H -#define TESTTREEMODEL_H +#pragma once #include "testconfiguration.h" #include "testtreeitem.h" @@ -170,5 +169,3 @@ struct TestParseResult Q_DECLARE_METATYPE(Autotest::Internal::TestTreeModel::Type) Q_DECLARE_METATYPE(Autotest::Internal::TestParseResult) - -#endif // TESTTREEMODEL_H diff --git a/src/plugins/autotest/testtreeview.h b/src/plugins/autotest/testtreeview.h index a75c2fdaa7..dffc3be835 100644 --- a/src/plugins/autotest/testtreeview.h +++ b/src/plugins/autotest/testtreeview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTTREEVIEW_H -#define TESTTREEVIEW_H +#pragma once #include <utils/navigationtreeview.h> @@ -52,5 +51,3 @@ private: } // namespace Internal } // namespace Autotest - -#endif // TESTTREEVIEW_H diff --git a/src/plugins/autotest/testvisitor.h b/src/plugins/autotest/testvisitor.h index b849a1d8c5..fa2869a44c 100644 --- a/src/plugins/autotest/testvisitor.h +++ b/src/plugins/autotest/testvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTVISITOR_H -#define TESTVISITOR_H +#pragma once #include "testtreeitem.h" @@ -166,5 +165,3 @@ private: } // namespace Internal } // namespace Autotest - -#endif // TESTVISITOR_H diff --git a/src/plugins/autotest/unit_test/plain/test_plain/tst_simple.h b/src/plugins/autotest/unit_test/plain/test_plain/tst_simple.h index 25523237cb..4c30299624 100644 --- a/src/plugins/autotest/unit_test/plain/test_plain/tst_simple.h +++ b/src/plugins/autotest/unit_test/plain/test_plain/tst_simple.h @@ -1,4 +1,2 @@ -#ifndef TST_SIMPLE_H -#define TST_SIMPLE_H +#pragma once #include <QTest> -#endif // TST_SIMPLE_H diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp index db67732357..efbb388018 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp @@ -229,11 +229,6 @@ void AutotoolsBuildConfiguration::setBuildDirectory(const Utils::FileName &direc if (directory == buildDirectory()) return; BuildConfiguration::setBuildDirectory(directory); - BuildStepList *bsl = stepList(BUILDSTEPS_BUILD); - foreach (BuildStep *bs, bsl->steps()) { - ConfigureStep *cs = qobject_cast<ConfigureStep *>(bs); - if (cs) { - cs->notifyBuildDirectoryChanged(); - } - } + foreach (auto bs, stepList(BUILDSTEPS_BUILD)->allOfType<ConfigureStep>()) + bs->notifyBuildDirectoryChanged(); } diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectfile.h b/src/plugins/autotoolsprojectmanager/autotoolsprojectfile.h index 58cdfa08c9..2e1d9b54e9 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectfile.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectfile.h @@ -44,7 +44,6 @@ namespace Internal { */ class AutotoolsProjectFile : public Core::IDocument { - Q_OBJECT public: AutotoolsProjectFile(const QString &fileName); }; diff --git a/src/plugins/autotoolsprojectmanager/makestep.cpp b/src/plugins/autotoolsprojectmanager/makestep.cpp index 7759ece867..ba02a2d440 100644 --- a/src/plugins/autotoolsprojectmanager/makestep.cpp +++ b/src/plugins/autotoolsprojectmanager/makestep.cpp @@ -174,9 +174,7 @@ bool MakeStep::init(QList<const BuildStep *> &earlierSteps) ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); Utils::Environment env = bc->environment(); - // Force output to english for the parsers. Do this here and not in the toolchain's - // addToEnvironment() to not screw up the users run environment. - env.set(QLatin1String("LC_ALL"), QLatin1String("C")); + Utils::Environment::setupEnglishOutput(&env); pp->setEnvironment(env); pp->setWorkingDirectory(bc->buildDirectory().toString()); pp->setCommand(tc ? tc->makeCommand(bc->environment()) : QLatin1String("make")); diff --git a/src/plugins/baremetal/baremetalconstants.h b/src/plugins/baremetal/baremetalconstants.h index efca7cd688..7b1358cc33 100644 --- a/src/plugins/baremetal/baremetalconstants.h +++ b/src/plugins/baremetal/baremetalconstants.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef BAREMETALCONSTANTS_H -#define BAREMETALCONSTANTS_H +#pragma once namespace BareMetal { namespace Constants { @@ -48,5 +47,3 @@ const char STLINK_UTIL_PROVIDER_ID[] = "BareMetal.GdbServerProvider.STLinkUtil"; } // namespace BareMetal } // namespace Constants - -#endif // BAREMETALCONSTANTS_H diff --git a/src/plugins/baremetal/baremetalcustomrunconfiguration.h b/src/plugins/baremetal/baremetalcustomrunconfiguration.h index a52c58eabb..9c9118033a 100644 --- a/src/plugins/baremetal/baremetalcustomrunconfiguration.h +++ b/src/plugins/baremetal/baremetalcustomrunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BAREMETALCUSTOMRUNCONFIGURATION_H -#define BAREMETALCUSTOMRUNCONFIGURATION_H +#pragma once #include "baremetalrunconfiguration.h" @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // Include guard. diff --git a/src/plugins/baremetal/baremetaldebugsupport.cpp b/src/plugins/baremetal/baremetaldebugsupport.cpp index 56f6b1e226..3bbf232311 100644 --- a/src/plugins/baremetal/baremetaldebugsupport.cpp +++ b/src/plugins/baremetal/baremetaldebugsupport.cpp @@ -43,13 +43,10 @@ using namespace ProjectExplorer; namespace BareMetal { namespace Internal { -BareMetalDebugSupport::BareMetalDebugSupport( - const ProjectExplorer::IDevice::ConstPtr device, - Debugger::DebuggerRunControl *runControl) +BareMetalDebugSupport::BareMetalDebugSupport(Debugger::DebuggerRunControl *runControl) : QObject(runControl) , m_appRunner(new ProjectExplorer::DeviceApplicationRunner(this)) , m_runControl(runControl) - , m_device(device) , m_state(BareMetalDebugSupport::Inactive) { Q_ASSERT(runControl); @@ -149,7 +146,7 @@ void BareMetalDebugSupport::adapterSetupFailed(const QString &error) void BareMetalDebugSupport::startExecution() { - auto dev = qSharedPointerCast<const BareMetalDevice>(m_device); + auto dev = qSharedPointerCast<const BareMetalDevice>(m_runControl->device()); QTC_ASSERT(dev, return); const GdbServerProvider *p = GdbServerProviderManager::instance()->findProvider( @@ -175,7 +172,7 @@ void BareMetalDebugSupport::startExecution() StandardRunnable r; r.executable = p->executable(); r.commandLineArguments = Utils::QtcProcess::joinArgs(p->arguments(), Utils::OsTypeLinux); - m_appRunner->start(m_device, r); + m_appRunner->start(dev, r); } void BareMetalDebugSupport::setFinished() diff --git a/src/plugins/baremetal/baremetaldebugsupport.h b/src/plugins/baremetal/baremetaldebugsupport.h index 502833cd31..31aa1b5935 100644 --- a/src/plugins/baremetal/baremetaldebugsupport.h +++ b/src/plugins/baremetal/baremetaldebugsupport.h @@ -23,34 +23,24 @@ ** ****************************************************************************/ -#ifndef BAREMETALDEBUGSUPPORT_H -#define BAREMETALDEBUGSUPPORT_H +#pragma once #include <QObject> #include <QPointer> -#include <projectexplorer/devicesupport/idevice.h> - namespace Debugger { class DebuggerRunControl; } -namespace ProjectExplorer { -class DeviceApplicationRunner; -class IDevice; -} +namespace ProjectExplorer { class DeviceApplicationRunner; } namespace BareMetal { namespace Internal { -class GdbServerProvider; -class BareMetalRunConfiguration; - class BareMetalDebugSupport : public QObject { Q_OBJECT public: - explicit BareMetalDebugSupport(const ProjectExplorer::IDevice::ConstPtr device, - Debugger::DebuggerRunControl *runControl); + explicit BareMetalDebugSupport(Debugger::DebuggerRunControl *runControl); ~BareMetalDebugSupport(); private slots: @@ -76,11 +66,8 @@ private: ProjectExplorer::DeviceApplicationRunner *m_appRunner; const QPointer<Debugger::DebuggerRunControl> m_runControl; - const ProjectExplorer::IDevice::ConstPtr m_device; BareMetalDebugSupport::State m_state; }; } // namespace Internal } // namespace BareMetal - -#endif // BAREMETALDEBUGSUPPORT_H diff --git a/src/plugins/baremetal/baremetaldevice.h b/src/plugins/baremetal/baremetaldevice.h index 6707040038..c62c83e609 100644 --- a/src/plugins/baremetal/baremetaldevice.h +++ b/src/plugins/baremetal/baremetaldevice.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef BAREMETALDEVICE_H -#define BAREMETALDEVICE_H +#pragma once #include <projectexplorer/devicesupport/idevice.h> @@ -43,23 +42,23 @@ public: Origin origin = ManuallyAdded, Core::Id id = Core::Id()); static Ptr create(const BareMetalDevice &other); - QString displayType() const; - ProjectExplorer::IDeviceWidget *createWidget(); - QList<Core::Id> actionIds() const; - QString displayNameForActionId(Core::Id actionId) const; - void executeAction(Core::Id actionId, QWidget *parent); - ProjectExplorer::IDevice::Ptr clone() const; + QString displayType() const override; + ProjectExplorer::IDeviceWidget *createWidget() override; + QList<Core::Id> actionIds() const override; + QString displayNameForActionId(Core::Id actionId) const override; + void executeAction(Core::Id actionId, QWidget *parent) override; + ProjectExplorer::IDevice::Ptr clone() const override; - ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const; + ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override; - bool canCreateProcess() const { return true; } - ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const; + bool canCreateProcess() const override { return true; } + ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const override; QString gdbServerProviderId() const; void setGdbServerProviderId(const QString &id); - virtual void fromMap(const QVariantMap &map); - virtual QVariantMap toMap() const; + virtual void fromMap(const QVariantMap &map) override; + virtual QVariantMap toMap() const override; protected: BareMetalDevice() {} @@ -74,5 +73,3 @@ private: } //namespace Internal } //namespace BareMetal - -#endif // BAREMETALDEVICE_H diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationfactory.h b/src/plugins/baremetal/baremetaldeviceconfigurationfactory.h index ee55c7dc22..c05b9afa78 100644 --- a/src/plugins/baremetal/baremetaldeviceconfigurationfactory.h +++ b/src/plugins/baremetal/baremetaldeviceconfigurationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BAREMETALDEVICECONFIGURATIONFACTORY_H -#define BAREMETALDEVICECONFIGURATIONFACTORY_H +#pragma once #include <projectexplorer/devicesupport/idevicefactory.h> @@ -49,5 +48,3 @@ public: } // namespace Internal } // namespace BareMetal - -#endif // BAREMETALDEVICECONFIGURATIONFACTORY_H diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwidget.h b/src/plugins/baremetal/baremetaldeviceconfigurationwidget.h index 660e85c565..520eeb81d8 100644 --- a/src/plugins/baremetal/baremetaldeviceconfigurationwidget.h +++ b/src/plugins/baremetal/baremetaldeviceconfigurationwidget.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef BAREMETALDEVICECONFIGURATIONWIDGET_H -#define BAREMETALDEVICECONFIGURATIONWIDGET_H +#pragma once #include <projectexplorer/devicesupport/idevicewidget.h> @@ -54,5 +53,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // BAREMETALDEVICECONFIGURATIONWIDGET_H diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwizard.h b/src/plugins/baremetal/baremetaldeviceconfigurationwizard.h index 1e99ec890d..dd49659021 100644 --- a/src/plugins/baremetal/baremetaldeviceconfigurationwizard.h +++ b/src/plugins/baremetal/baremetaldeviceconfigurationwizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BAREMETALDEVICECONFIGURATIONWIZARD_H -#define BAREMETALDEVICECONFIGURATIONWIZARD_H +#pragma once #include <projectexplorer/devicesupport/idevice.h> #include <utils/wizard.h> @@ -49,5 +48,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // BAREMETALDEVICECONFIGURATIONWIZARD_H diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h b/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h index 71a5cac00f..af61c11d65 100644 --- a/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h +++ b/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef BAREMETALDEVICECONFIGURATIONWIZARDPAGES_H -#define BAREMETALDEVICECONFIGURATIONWIZARDPAGES_H +#pragma once #include <QWizardPage> @@ -59,5 +58,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // BAREMETALDEVICECONFIGURATIONWIZARDPAGES_H diff --git a/src/plugins/baremetal/baremetalgdbcommandsdeploystep.h b/src/plugins/baremetal/baremetalgdbcommandsdeploystep.h index 8ef99da7ba..0c0b610f7d 100644 --- a/src/plugins/baremetal/baremetalgdbcommandsdeploystep.h +++ b/src/plugins/baremetal/baremetalgdbcommandsdeploystep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BAREMETALGDBCOMMANDSDEPLOYSTEP_H -#define BAREMETALGDBCOMMANDSDEPLOYSTEP_H +#pragma once #include <projectexplorer/buildstep.h> @@ -83,5 +82,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // BAREMETALGDBCOMMANDSDEPLOYSTEP_H diff --git a/src/plugins/baremetal/baremetalplugin.h b/src/plugins/baremetal/baremetalplugin.h index 69ca47fe79..92cb604a82 100644 --- a/src/plugins/baremetal/baremetalplugin.h +++ b/src/plugins/baremetal/baremetalplugin.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef BAREMETAL_H -#define BAREMETAL_H +#pragma once #include <extensionsystem/iplugin.h> @@ -47,5 +46,3 @@ public: } // namespace Internal } // namespace BareMetal - -#endif // BAREMETAL_H diff --git a/src/plugins/baremetal/baremetalrunconfiguration.h b/src/plugins/baremetal/baremetalrunconfiguration.h index b000f31b0b..d69287059b 100644 --- a/src/plugins/baremetal/baremetalrunconfiguration.h +++ b/src/plugins/baremetal/baremetalrunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BAREMETALRUNCONFIGURATION_H -#define BAREMETALRUNCONFIGURATION_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -87,5 +86,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // BAREMETALRUNCONFIGURATION_H diff --git a/src/plugins/baremetal/baremetalrunconfigurationfactory.h b/src/plugins/baremetal/baremetalrunconfigurationfactory.h index c83fd163a0..eff00764e5 100644 --- a/src/plugins/baremetal/baremetalrunconfigurationfactory.h +++ b/src/plugins/baremetal/baremetalrunconfigurationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BAREMETALRUNCONFIGURATIONFACTORY_H -#define BAREMETALRUNCONFIGURATIONFACTORY_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -58,5 +57,3 @@ private: } // namespace Internal } // namespace RemoteLinux - -#endif // BAREMETALRUNCONFIGURATIONFACTORY_H diff --git a/src/plugins/baremetal/baremetalrunconfigurationwidget.h b/src/plugins/baremetal/baremetalrunconfigurationwidget.h index a4e4060dbd..d6c0d5347c 100644 --- a/src/plugins/baremetal/baremetalrunconfigurationwidget.h +++ b/src/plugins/baremetal/baremetalrunconfigurationwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BAREMETALRUNCONFIGURATIONWIDGET_H -#define BAREMETALRUNCONFIGURATIONWIDGET_H +#pragma once #include <QWidget> @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // BAREMETALRUNCONFIGURATIONWIDGET_H diff --git a/src/plugins/baremetal/baremetalruncontrolfactory.cpp b/src/plugins/baremetal/baremetalruncontrolfactory.cpp index b9b49286db..a31917f15e 100644 --- a/src/plugins/baremetal/baremetalruncontrolfactory.cpp +++ b/src/plugins/baremetal/baremetalruncontrolfactory.cpp @@ -113,13 +113,11 @@ RunControl *BareMetalRunControlFactory::create( DebuggerStartParameters sp; if (const BuildConfiguration *bc = target->activeBuildConfiguration()) { - if (const BuildStepList *bsl = bc->stepList(BareMetalGdbCommandsDeployStep::stepId())) { - foreach (const BuildStep *bs, bsl->steps()) { - if (auto ds = qobject_cast<const BareMetalGdbCommandsDeployStep *>(bs)) { - if (!sp.commandsAfterConnect.endsWith("\n")) - sp.commandsAfterConnect.append("\n"); - sp.commandsAfterConnect.append(ds->gdbCommands().toLatin1()); - } + if (BuildStepList *bsl = bc->stepList(BareMetalGdbCommandsDeployStep::stepId())) { + foreach (const BareMetalGdbCommandsDeployStep *bs, bsl->allOfType<BareMetalGdbCommandsDeployStep>()) { + if (!sp.commandsAfterConnect.endsWith("\n")) + sp.commandsAfterConnect.append("\n"); + sp.commandsAfterConnect.append(bs->gdbCommands().toLatin1()); } } } @@ -137,8 +135,7 @@ RunControl *BareMetalRunControlFactory::create( DebuggerRunControl *runControl = createDebuggerRunControl(sp, rc, errorMessage, mode); if (runControl && sp.remoteSetupNeeded) { - const auto debugSupport = new BareMetalDebugSupport(dev, runControl); - Q_UNUSED(debugSupport); + (void) BareMetalDebugSupport(runControl); } return runControl; diff --git a/src/plugins/baremetal/baremetalruncontrolfactory.h b/src/plugins/baremetal/baremetalruncontrolfactory.h index 740d7138c5..1cab1af9ee 100644 --- a/src/plugins/baremetal/baremetalruncontrolfactory.h +++ b/src/plugins/baremetal/baremetalruncontrolfactory.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef BAREMETALRUNCONTROLFACTORY_H -#define BAREMETALRUNCONTROLFACTORY_H +#pragma once #include "baremetalrunconfiguration.h" @@ -49,5 +48,3 @@ public: } // namespace Internal } // namespace BareMetal - -#endif // BAREMETALRUNCONTROLFACTORY_H diff --git a/src/plugins/baremetal/defaultgdbserverprovider.h b/src/plugins/baremetal/defaultgdbserverprovider.h index de672f2f68..2c114ec63f 100644 --- a/src/plugins/baremetal/defaultgdbserverprovider.h +++ b/src/plugins/baremetal/defaultgdbserverprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEFAULTGDBSERVERPROVIDER_H -#define DEFAULTGDBSERVERPROVIDER_H +#pragma once #include "gdbserverprovider.h" @@ -104,5 +103,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // DEFAULTGDBSERVERPROVIDER_H diff --git a/src/plugins/baremetal/gdbserverprovider.h b/src/plugins/baremetal/gdbserverprovider.h index 6718a45bfa..a206f5acb5 100644 --- a/src/plugins/baremetal/gdbserverprovider.h +++ b/src/plugins/baremetal/gdbserverprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GDBSERVERPROVIDER_H -#define GDBSERVERPROVIDER_H +#pragma once #include <QObject> #include <QVariantMap> @@ -197,5 +196,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // GDBSERVERPROVIDER_H diff --git a/src/plugins/baremetal/gdbserverproviderchooser.h b/src/plugins/baremetal/gdbserverproviderchooser.h index 9f26f7a2d4..a5e090516a 100644 --- a/src/plugins/baremetal/gdbserverproviderchooser.h +++ b/src/plugins/baremetal/gdbserverproviderchooser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GDBSERVERPROVIDERCHOOSER_H -#define GDBSERVERPROVIDERCHOOSER_H +#pragma once #include <QWidget> @@ -72,5 +71,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // GDBSERVERPROVIDERCHOOSER_H diff --git a/src/plugins/baremetal/gdbserverprovidermanager.h b/src/plugins/baremetal/gdbserverprovidermanager.h index 2d5097de32..33cbbcea44 100644 --- a/src/plugins/baremetal/gdbserverprovidermanager.h +++ b/src/plugins/baremetal/gdbserverprovidermanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GDBSERVERPROVIDERMANAGER_H -#define GDBSERVERPROVIDERMANAGER_H +#pragma once #include <QObject> #include <QList> @@ -80,5 +79,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // GDBSERVERPROVIDERMANAGER_H diff --git a/src/plugins/baremetal/gdbserverproviderprocess.h b/src/plugins/baremetal/gdbserverproviderprocess.h index af69851780..fde68ab59d 100644 --- a/src/plugins/baremetal/gdbserverproviderprocess.h +++ b/src/plugins/baremetal/gdbserverproviderprocess.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GDBSERVERPROVIDERPROCESS_H -#define GDBSERVERPROVIDERPROCESS_H +#pragma once #include <projectexplorer/devicesupport/deviceprocess.h> @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // GDBSERVERPROVIDERPROCESS_H diff --git a/src/plugins/baremetal/gdbserverproviderssettingspage.h b/src/plugins/baremetal/gdbserverproviderssettingspage.h index 800bdce621..be8e00c422 100644 --- a/src/plugins/baremetal/gdbserverproviderssettingspage.h +++ b/src/plugins/baremetal/gdbserverproviderssettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GDBSERVERPROVIDERSSETTINGSPAGE_H -#define GDBSERVERPROVIDERSSETTINGSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -95,5 +94,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // GDBSERVERPROVIDERSSETTINGSPAGE_H diff --git a/src/plugins/baremetal/openocdgdbserverprovider.h b/src/plugins/baremetal/openocdgdbserverprovider.h index 29db9ebbc3..68ef66bc25 100644 --- a/src/plugins/baremetal/openocdgdbserverprovider.h +++ b/src/plugins/baremetal/openocdgdbserverprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OPENOCDGDBSERVERPROVIDER_H -#define OPENOCDGDBSERVERPROVIDER_H +#pragma once #include "gdbserverprovider.h" @@ -116,5 +115,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // OPENOCDGDBSERVERPROVIDER_H diff --git a/src/plugins/baremetal/stlinkutilgdbserverprovider.h b/src/plugins/baremetal/stlinkutilgdbserverprovider.h index 0b9c5b43fc..288bb3177b 100644 --- a/src/plugins/baremetal/stlinkutilgdbserverprovider.h +++ b/src/plugins/baremetal/stlinkutilgdbserverprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STLINKUTILGDBSERVERPROVIDER_H -#define STLINKUTILGDBSERVERPROVIDER_H +#pragma once #include "gdbserverprovider.h" @@ -128,5 +127,3 @@ private: } // namespace Internal } // namespace BareMetal - -#endif // STLINKUTILGDBSERVERPROVIDER_H diff --git a/src/plugins/beautifier/abstractsettings.h b/src/plugins/beautifier/abstractsettings.h index 186adf7522..239741b571 100644 --- a/src/plugins/beautifier/abstractsettings.h +++ b/src/plugins/beautifier/abstractsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_ABSTRACTSETTINGS_H -#define BEAUTIFIER_ABSTRACTSETTINGS_H +#pragma once #include <QCoreApplication> #include <QDir> @@ -90,5 +89,3 @@ private: } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_ABSTRACTSETTINGS_H diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.h b/src/plugins/beautifier/artisticstyle/artisticstyle.h index 29bc1cce72..1bf00d0c77 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.h +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_ARTISTICSTYLE_H -#define BEAUTIFIER_ARTISTICSTYLE_H +#pragma once #include "../beautifierabstracttool.h" #include "../command.h" @@ -65,5 +64,3 @@ private: } // namespace ArtisticStyle } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_ARTISTICSTYLE_H diff --git a/src/plugins/beautifier/artisticstyle/artisticstyleconstants.h b/src/plugins/beautifier/artisticstyle/artisticstyleconstants.h index 743c21d4f6..88a98ec457 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyleconstants.h +++ b/src/plugins/beautifier/artisticstyle/artisticstyleconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_ARTISTICSTYLECONSTANTS_H -#define BEAUTIFIER_ARTISTICSTYLECONSTANTS_H +#pragma once namespace Beautifier { namespace Constants { @@ -39,5 +38,3 @@ const char SETTINGS_NAME[] = "artisticstyle"; } // namespace ArtisticStyle } // namespace Constants } // namespace Beautifier - -#endif // BEAUTIFIER_ARTISTICSTYLECONSTANTS_H diff --git a/src/plugins/beautifier/artisticstyle/artisticstyleoptionspage.h b/src/plugins/beautifier/artisticstyle/artisticstyleoptionspage.h index 470d0e6054..d31b8f80f1 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyleoptionspage.h +++ b/src/plugins/beautifier/artisticstyle/artisticstyleoptionspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_ARTISTICSTYLEOPTIONSPAGE_H -#define BEAUTIFIER_ARTISTICSTYLEOPTIONSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -72,6 +71,3 @@ private: } // namespace ArtisticStyle } // namespace Internal } // namespace Beautifier - - -#endif // BEAUTIFIER_ARTISTICSTYLEOPTIONSPAGE_H diff --git a/src/plugins/beautifier/artisticstyle/artisticstylesettings.h b/src/plugins/beautifier/artisticstyle/artisticstylesettings.h index 9085d90165..e1094743c7 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstylesettings.h +++ b/src/plugins/beautifier/artisticstyle/artisticstylesettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_ARTISTICSTYLESETTINGS_H -#define BEAUTIFIER_ARTISTICSTYLESETTINGS_H +#pragma once #include "../abstractsettings.h" @@ -75,5 +74,3 @@ private: } // namespace ArtisticStyle } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_ARTISTICSTYLESETTINGS_H diff --git a/src/plugins/beautifier/beautifierabstracttool.h b/src/plugins/beautifier/beautifierabstracttool.h index 080183c140..3d12980bfa 100644 --- a/src/plugins/beautifier/beautifierabstracttool.h +++ b/src/plugins/beautifier/beautifierabstracttool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_BEAUTIFIERABSTRACTTOOL_H -#define BEAUTIFIER_BEAUTIFIERABSTRACTTOOL_H +#pragma once #include <QList> #include <QObject> @@ -49,5 +48,3 @@ public: } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_BEAUTIFIERABSTRACTTOOL_H diff --git a/src/plugins/beautifier/beautifierconstants.h b/src/plugins/beautifier/beautifierconstants.h index deb0502b31..3bfa94b39f 100644 --- a/src/plugins/beautifier/beautifierconstants.h +++ b/src/plugins/beautifier/beautifierconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_BEAUTIFIERCONSTANTS_H -#define BEAUTIFIER_BEAUTIFIERCONSTANTS_H +#pragma once #include <QtGlobal> @@ -47,6 +46,3 @@ const char DOCUMENTATION_XMLDOC[] = "doc"; } // namespace Constants } // namespace Beautifier - -#endif // BEAUTIFIER_BEAUTIFIERCONSTANTS_H - diff --git a/src/plugins/beautifier/beautifierplugin.cpp b/src/plugins/beautifier/beautifierplugin.cpp index 2483ecc9d6..b859e3851b 100644 --- a/src/plugins/beautifier/beautifierplugin.cpp +++ b/src/plugins/beautifier/beautifierplugin.cpp @@ -96,7 +96,7 @@ FormatTask format(FormatTask task) process.start(executable, options); if (!process.waitForFinished(5000)) { process.kill(); - task.error = QObject::tr("Cannot call %1 or some other error occurred. Time out " + task.error = QObject::tr("Cannot call %1 or some other error occurred. Timeout " "reached while formatting file %2.") .arg(executable).arg(task.filePath); return task; @@ -131,7 +131,7 @@ FormatTask format(FormatTask task) process.closeWriteChannel(); if (!process.waitForFinished(5000)) { process.kill(); - task.error = QObject::tr("Cannot call %1 or some other error occurred. Time out " + task.error = QObject::tr("Cannot call %1 or some other error occurred. Timeout " "reached while formatting file %2.") .arg(executable).arg(task.filePath); return task; diff --git a/src/plugins/beautifier/beautifierplugin.h b/src/plugins/beautifier/beautifierplugin.h index 49dfd06690..6e310eb818 100644 --- a/src/plugins/beautifier/beautifierplugin.h +++ b/src/plugins/beautifier/beautifierplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_BEAUTIFIER_H -#define BEAUTIFIER_BEAUTIFIER_H +#pragma once #include "command.h" @@ -102,6 +101,3 @@ private: } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_BEAUTIFIER_H - diff --git a/src/plugins/beautifier/clangformat/clangformat.h b/src/plugins/beautifier/clangformat/clangformat.h index 3a71b3ba93..83f2f5ec5b 100644 --- a/src/plugins/beautifier/clangformat/clangformat.h +++ b/src/plugins/beautifier/clangformat/clangformat.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_CLANGFORMAT_H -#define BEAUTIFIER_CLANGFORMAT_H +#pragma once #include "../beautifierabstracttool.h" #include "../command.h" @@ -67,5 +66,3 @@ private: } // namespace ClangFormat } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_CLANGFORMAT_H diff --git a/src/plugins/beautifier/clangformat/clangformatconstants.h b/src/plugins/beautifier/clangformat/clangformatconstants.h index fb0218cc65..51f6fa1bf8 100644 --- a/src/plugins/beautifier/clangformat/clangformatconstants.h +++ b/src/plugins/beautifier/clangformat/clangformatconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_CLANGFORMATCONSTANTS_H -#define BEAUTIFIER_CLANGFORMATCONSTANTS_H +#pragma once namespace Beautifier { namespace Constants { @@ -40,5 +39,3 @@ const char SETTINGS_NAME[] = "clangformat"; } // namespace ClangFormat } // namespace Constants } // namespace Beautifier - -#endif // BEAUTIFIER_CLANGFORMATCONSTANTS_H diff --git a/src/plugins/beautifier/clangformat/clangformatoptionspage.h b/src/plugins/beautifier/clangformat/clangformatoptionspage.h index 5947fab240..60f9f77b46 100644 --- a/src/plugins/beautifier/clangformat/clangformatoptionspage.h +++ b/src/plugins/beautifier/clangformat/clangformatoptionspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_CLANGFORMATOPTIONSPAGE_H -#define BEAUTIFIER_CLANGFORMATOPTIONSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -72,5 +71,3 @@ private: } // namespace ClangFormat } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_CLANGFORMATOPTIONSPAGE_H diff --git a/src/plugins/beautifier/clangformat/clangformatsettings.h b/src/plugins/beautifier/clangformat/clangformatsettings.h index 0211f1e524..4d1b326390 100644 --- a/src/plugins/beautifier/clangformat/clangformatsettings.h +++ b/src/plugins/beautifier/clangformat/clangformatsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_CLANGFORMATSETTINGS_H -#define BEAUTIFIER_CLANGFORMATSETTINGS_H +#pragma once #include "../abstractsettings.h" @@ -67,5 +66,3 @@ private: } // namespace ClangFormat } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_CLANGFORMATSETTINGS_H diff --git a/src/plugins/beautifier/command.h b/src/plugins/beautifier/command.h index e204db17f2..b374debaf1 100644 --- a/src/plugins/beautifier/command.h +++ b/src/plugins/beautifier/command.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_COMMAND_H -#define BEAUTIFIER_COMMAND_H +#pragma once #include <QString> #include <QStringList> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_COMMAND_H diff --git a/src/plugins/beautifier/configurationdialog.h b/src/plugins/beautifier/configurationdialog.h index 13e1a9825e..cc81096c14 100644 --- a/src/plugins/beautifier/configurationdialog.h +++ b/src/plugins/beautifier/configurationdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_CONFIGURATIONDIALOG_H -#define BEAUTIFIER_CONFIGURATIONDIALOG_H +#pragma once #include <QDialog> #include <QString> @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_CONFIGURATIONDIALOG_H diff --git a/src/plugins/beautifier/configurationeditor.h b/src/plugins/beautifier/configurationeditor.h index 27ed01a03b..9c72c79fc4 100644 --- a/src/plugins/beautifier/configurationeditor.h +++ b/src/plugins/beautifier/configurationeditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_CONFIGURATIONEDITOR_H -#define BEAUTIFIER_CONFIGURATIONEDITOR_H +#pragma once #include <QPlainTextEdit> @@ -97,5 +96,3 @@ private: } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_CONFIGURATIONEDITOR_H diff --git a/src/plugins/beautifier/configurationpanel.h b/src/plugins/beautifier/configurationpanel.h index 670cdc7a18..226f1bcc32 100644 --- a/src/plugins/beautifier/configurationpanel.h +++ b/src/plugins/beautifier/configurationpanel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_CONFIGURATIONPANEL_H -#define BEAUTIFIER_CONFIGURATIONPANEL_H +#pragma once #include <QWidget> @@ -62,5 +61,3 @@ private: } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_CONFIGURATIONPANEL_H diff --git a/src/plugins/beautifier/uncrustify/uncrustify.cpp b/src/plugins/beautifier/uncrustify/uncrustify.cpp index 4445ad1706..ab2c027f07 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustify.cpp @@ -178,8 +178,13 @@ Command Uncrustify::command(const QString &cfgFile, bool fragment) const Command command; command.setExecutable(m_settings->command()); command.setProcessing(Command::PipeProcessing); - command.addOption(QLatin1String("-l")); - command.addOption(QLatin1String("cpp")); + if (m_settings->version() >= 62) { + command.addOption(QLatin1String("--assume")); + command.addOption(QLatin1String("%file")); + } else { + command.addOption(QLatin1String("-l")); + command.addOption(QLatin1String("cpp")); + } command.addOption(QLatin1String("-L")); command.addOption(QLatin1String("1-2")); if (fragment) diff --git a/src/plugins/beautifier/uncrustify/uncrustify.h b/src/plugins/beautifier/uncrustify/uncrustify.h index 8861910dc5..495111b38f 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.h +++ b/src/plugins/beautifier/uncrustify/uncrustify.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_UNCRUSTIFY_H -#define BEAUTIFIER_UNCRUSTIFY_H +#pragma once #include "../beautifierabstracttool.h" #include "../command.h" @@ -67,5 +66,3 @@ private: } // namespace Uncrustify } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_UNCRUSTIFY_H diff --git a/src/plugins/beautifier/uncrustify/uncrustifyconstants.h b/src/plugins/beautifier/uncrustify/uncrustifyconstants.h index 4b8dd0de29..9936689c3f 100644 --- a/src/plugins/beautifier/uncrustify/uncrustifyconstants.h +++ b/src/plugins/beautifier/uncrustify/uncrustifyconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_UNCRUSTIFYCONSTANTS_H -#define BEAUTIFIER_UNCRUSTIFYCONSTANTS_H +#pragma once namespace Beautifier { namespace Constants { @@ -40,5 +39,3 @@ const char SETTINGS_NAME[] = "uncrustify"; } // namespace Uncrustify } // namespace Constants } // namespace Beautifier - -#endif // BEAUTIFIER_UNCRUSTIFYCONSTANTS_H diff --git a/src/plugins/beautifier/uncrustify/uncrustifyoptionspage.h b/src/plugins/beautifier/uncrustify/uncrustifyoptionspage.h index 2f833d48fa..656edce2d9 100644 --- a/src/plugins/beautifier/uncrustify/uncrustifyoptionspage.h +++ b/src/plugins/beautifier/uncrustify/uncrustifyoptionspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_UNCRUSTIFYOPTIONSPAGE_H -#define BEAUTIFIER_UNCRUSTIFYOPTIONSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -72,6 +71,3 @@ private: } // namespace Uncrustify } // namespace Internal } // namespace Beautifier - - -#endif // BEAUTIFIER_UNCRUSTIFYOPTIONSPAGE_H diff --git a/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp b/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp index 6a5a4ae59f..1cd8569939 100644 --- a/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp @@ -35,6 +35,7 @@ #include <QFile> #include <QFileInfo> #include <QProcess> +#include <QRegularExpression> #include <QXmlStreamWriter> namespace Beautifier { @@ -52,6 +53,10 @@ const QString kFormatEntireFileFallback = QLatin1String("formatEntireFileFallbac UncrustifySettings::UncrustifySettings() : AbstractSettings(QLatin1String(Constants::Uncrustify::SETTINGS_NAME), QLatin1String(".cfg")) { + connect(&m_versionProcess, + static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), + this, &UncrustifySettings::parseVersionProcessResult); + setCommand(QLatin1String("uncrustify")); m_settings.insert(kUseOtherFiles, QVariant(true)); m_settings.insert(kUseHomeFile, QVariant(false)); @@ -184,6 +189,39 @@ void UncrustifySettings::createDocumentationFile() const } } +static bool parseVersion(const QString &text, int &version) +{ + // The version in Uncrustify is printed like "uncrustify 0.62" + const QRegularExpression rx(QLatin1String("([0-9]{1})\\.([0-9]{2})")); + const QRegularExpressionMatch match = rx.match(text); + if (!match.hasMatch()) + return false; + + const int major = match.captured(1).toInt() * 100; + const int minor = match.captured(2).toInt(); + version = major + minor; + return true; +} + +void UncrustifySettings::updateVersion() +{ + if (m_versionProcess.state() != QProcess::NotRunning) { + m_versionProcess.kill(); + m_versionProcess.waitForFinished(); + } + m_versionProcess.start(command(), QStringList() << QLatin1String("--version")); +} + +void UncrustifySettings::parseVersionProcessResult(int exitCode, QProcess::ExitStatus exitStatus) +{ + Q_UNUSED(exitCode) + if (exitStatus != QProcess::NormalExit) + return; + + if (!parseVersion(QString::fromUtf8(m_versionProcess.readAllStandardOutput()), m_version)) + parseVersion(QString::fromUtf8(m_versionProcess.readAllStandardError()), m_version); +} + } // namespace Uncrustify } // namespace Internal } // namespace Beautifier diff --git a/src/plugins/beautifier/uncrustify/uncrustifysettings.h b/src/plugins/beautifier/uncrustify/uncrustifysettings.h index 3306177faf..55076186be 100644 --- a/src/plugins/beautifier/uncrustify/uncrustifysettings.h +++ b/src/plugins/beautifier/uncrustify/uncrustifysettings.h @@ -23,18 +23,20 @@ ** ****************************************************************************/ -#ifndef BEAUTIFIER_UNCRUSTIFYSETTINGS_H -#define BEAUTIFIER_UNCRUSTIFYSETTINGS_H +#pragma once #include "../abstractsettings.h" +#include <QProcess> namespace Beautifier { namespace Internal { namespace Uncrustify { -class UncrustifySettings : public AbstractSettings +class UncrustifySettings : public QObject, public AbstractSettings { + Q_OBJECT + public: UncrustifySettings(); @@ -55,10 +57,14 @@ public: QString documentationFilePath() const override; void createDocumentationFile() const override; + + void updateVersion() override; + +private: + QProcess m_versionProcess; + void parseVersionProcessResult(int exitCode, QProcess::ExitStatus exitStatus); }; } // namespace Uncrustify } // namespace Internal } // namespace Beautifier - -#endif // BEAUTIFIER_UNCRUSTIFYSETTINGS_H diff --git a/src/plugins/bineditor/bineditor.h b/src/plugins/bineditor/bineditor.h index f8e7433125..a742e9e07d 100644 --- a/src/plugins/bineditor/bineditor.h +++ b/src/plugins/bineditor/bineditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BINEDITOR_H -#define BINEDITOR_H +#pragma once #include "markup.h" @@ -244,5 +243,3 @@ private: }; } // namespace BinEditor - -#endif // BINEDITOR_H diff --git a/src/plugins/bineditor/bineditorconstants.h b/src/plugins/bineditor/bineditorconstants.h index fbade116e5..940f0a0606 100644 --- a/src/plugins/bineditor/bineditorconstants.h +++ b/src/plugins/bineditor/bineditorconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BINEDITORCONSTANTS_H -#define BINEDITORCONSTANTS_H +#pragma once namespace BinEditor { namespace Constants { @@ -35,5 +34,3 @@ const char C_BINEDITOR_MIMETYPE[] = "application/octet-stream"; } // namespace Constants } // namespace BinEditor - -#endif // BINEDITORCONSTANTS_H diff --git a/src/plugins/bineditor/bineditorplugin.h b/src/plugins/bineditor/bineditorplugin.h index eb0b72ad46..2dba62e5e9 100644 --- a/src/plugins/bineditor/bineditorplugin.h +++ b/src/plugins/bineditor/bineditorplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BINEDITORPLUGIN_H -#define BINEDITORPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> #include <coreplugin/editormanager/ieditorfactory.h> @@ -92,5 +91,3 @@ private: } // namespace Internal } // namespace BinEditor - -#endif // BINEDITORPLUGIN_H diff --git a/src/plugins/bineditor/markup.h b/src/plugins/bineditor/markup.h index c024fbd247..3a976ab1d4 100644 --- a/src/plugins/bineditor/markup.h +++ b/src/plugins/bineditor/markup.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MARKUP_H -#define MARKUP_H +#pragma once #include <QColor> #include <QString> @@ -49,5 +48,3 @@ public: } // namespace BinEditor Q_DECLARE_METATYPE(BinEditor::Markup) - -#endif // MARKUP_H diff --git a/src/plugins/bookmarks/bookmark.h b/src/plugins/bookmarks/bookmark.h index e1cb8b6b51..af9c219b9c 100644 --- a/src/plugins/bookmarks/bookmark.h +++ b/src/plugins/bookmarks/bookmark.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BOOKMARK_H -#define BOOKMARK_H +#pragma once #include <texteditor/textmark.h> @@ -57,5 +56,3 @@ private: } // namespace Internal } // namespace Bookmarks - -#endif // BOOKMARK_H diff --git a/src/plugins/bookmarks/bookmarkmanager.h b/src/plugins/bookmarks/bookmarkmanager.h index d136225362..0bc81ad135 100644 --- a/src/plugins/bookmarks/bookmarkmanager.h +++ b/src/plugins/bookmarks/bookmarkmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BOOKMARKMANAGER_H -#define BOOKMARKMANAGER_H +#pragma once #include <utils/itemviews.h> #include <coreplugin/editormanager/ieditor.h> @@ -188,5 +187,3 @@ private: } // namespace Internal } // namespace Bookmarks - -#endif // BOOKMARKMANAGER_H diff --git a/src/plugins/bookmarks/bookmarks_global.h b/src/plugins/bookmarks/bookmarks_global.h index b1cab45207..6f22b7eb09 100644 --- a/src/plugins/bookmarks/bookmarks_global.h +++ b/src/plugins/bookmarks/bookmarks_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BOOKMARKS_GLOBAL_H -#define BOOKMARKS_GLOBAL_H +#pragma once namespace Bookmarks { namespace Constants { @@ -46,6 +45,3 @@ const char BOOKMARKS_CONTEXT[] = "Bookmarks"; } // namespace Constants } // namespace Bookmarks - -#endif // BOOKMARKS_GLOBAL_H - diff --git a/src/plugins/bookmarks/bookmarksplugin.h b/src/plugins/bookmarks/bookmarksplugin.h index 58bbc5e3f2..4cb16b2218 100644 --- a/src/plugins/bookmarks/bookmarksplugin.h +++ b/src/plugins/bookmarks/bookmarksplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BOOKMARKSPLUGIN_H -#define BOOKMARKSPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -81,5 +80,3 @@ private: } // namespace Internal } // namespace Bookmarks - -#endif // BOOKMARKS_H diff --git a/src/plugins/clangcodemodel/clangactivationsequencecontextprocessor.h b/src/plugins/clangcodemodel/clangactivationsequencecontextprocessor.h index 0e0bd55f84..6bb25da086 100644 --- a/src/plugins/clangcodemodel/clangactivationsequencecontextprocessor.h +++ b/src/plugins/clangcodemodel/clangactivationsequencecontextprocessor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_ACTIVATIONSEQUENCECONTEXTPROCESSOR_H -#define CLANGCODEMODEL_INTERNAL_ACTIVATIONSEQUENCECONTEXTPROCESSOR_H +#pragma once #include <clangcodemodel/clangcompletionassistinterface.h> @@ -87,5 +86,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_ACTIVATIONSEQUENCECONTEXTPROCESSOR_H diff --git a/src/plugins/clangcodemodel/clangactivationsequenceprocessor.h b/src/plugins/clangcodemodel/clangactivationsequenceprocessor.h index cb674fbf19..d8d4d77ed2 100644 --- a/src/plugins/clangcodemodel/clangactivationsequenceprocessor.h +++ b/src/plugins/clangcodemodel/clangactivationsequenceprocessor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_ACTIVATIONSEQUENCEPROCESSOR_H -#define CLANGCODEMODEL_INTERNAL_ACTIVATIONSEQUENCEPROCESSOR_H +#pragma once #include <cplusplus/Token.h> @@ -72,5 +71,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_ACTIVATIONSEQUENCEPROCESSOR_H diff --git a/src/plugins/clangcodemodel/clangassistproposal.h b/src/plugins/clangcodemodel/clangassistproposal.h index 9c201c2cc0..8fc29b8374 100644 --- a/src/plugins/clangcodemodel/clangassistproposal.h +++ b/src/plugins/clangcodemodel/clangassistproposal.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_CLANGASSISTPROPOSAL_H -#define CLANGCODEMODEL_INTERNAL_CLANGASSISTPROPOSAL_H +#pragma once #include "clangassistproposalmodel.h" @@ -44,5 +43,3 @@ public: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_CLANGASSISTPROPOSAL_H diff --git a/src/plugins/clangcodemodel/clangassistproposalitem.h b/src/plugins/clangcodemodel/clangassistproposalitem.h index 5e7ec8fefa..442764bdbf 100644 --- a/src/plugins/clangcodemodel/clangassistproposalitem.h +++ b/src/plugins/clangcodemodel/clangassistproposalitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_CLANGASSISTPROPOSALITEM_H -#define CLANGCODEMODEL_INTERNAL_CLANGASSISTPROPOSALITEM_H +#pragma once #include <codecompletion.h> @@ -70,5 +69,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_CLANGASSISTPROPOSALITEM_H diff --git a/src/plugins/clangcodemodel/clangassistproposalmodel.h b/src/plugins/clangcodemodel/clangassistproposalmodel.h index e722daf03d..32b25bf9d0 100644 --- a/src/plugins/clangcodemodel/clangassistproposalmodel.h +++ b/src/plugins/clangcodemodel/clangassistproposalmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_CLANGASSISTPROPOSALMODEL_H -#define CLANGCODEMODEL_INTERNAL_CLANGASSISTPROPOSALMODEL_H +#pragma once #include <cplusplus/Token.h> @@ -51,5 +50,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_CLANGASSISTPROPOSALMODEL_H diff --git a/src/plugins/clangcodemodel/clangbackendipcintegration.h b/src/plugins/clangcodemodel/clangbackendipcintegration.h index 2871ec3062..66b9c05111 100644 --- a/src/plugins/clangcodemodel/clangbackendipcintegration.h +++ b/src/plugins/clangcodemodel/clangbackendipcintegration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_CLANGBACKENDIPCINTEGRATION_H -#define CLANGCODEMODEL_INTERNAL_CLANGBACKENDIPCINTEGRATION_H +#pragma once #include <cpptools/projectpart.h> @@ -187,5 +186,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_CLANGBACKENDIPCINTEGRATION_H diff --git a/src/plugins/clangcodemodel/clangcodemodelplugin.h b/src/plugins/clangcodemodel/clangcodemodelplugin.h index fb6be15ad0..0b94c93c2c 100644 --- a/src/plugins/clangcodemodel/clangcodemodelplugin.h +++ b/src/plugins/clangcodemodel/clangcodemodelplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODELPLUGIN_H -#define CLANGCODEMODELPLUGIN_H +#pragma once #include "clangmodelmanagersupport.h" @@ -52,5 +51,3 @@ private: } // namespace Internal } // namespace Clang - -#endif // CLANGCODEMODELPLUGIN_H diff --git a/src/plugins/clangcodemodel/clangcompletionassistinterface.h b/src/plugins/clangcodemodel/clangcompletionassistinterface.h index 6012cf6508..fc0724777e 100644 --- a/src/plugins/clangcodemodel/clangcompletionassistinterface.h +++ b/src/plugins/clangcodemodel/clangcompletionassistinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_CLANGCOMPLETIONASSISTINTERFACE_H -#define CLANGCODEMODEL_INTERNAL_CLANGCOMPLETIONASSISTINTERFACE_H +#pragma once #include "clangbackendipcintegration.h" #include "clangutils.h" @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_CLANGCOMPLETIONASSISTINTERFACE_H diff --git a/src/plugins/clangcodemodel/clangcompletionassistprocessor.h b/src/plugins/clangcodemodel/clangcompletionassistprocessor.h index cfc1604b86..56779a4b01 100644 --- a/src/plugins/clangcodemodel/clangcompletionassistprocessor.h +++ b/src/plugins/clangcodemodel/clangcompletionassistprocessor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_CLANGCOMPLETIONASSISTPROCESSOR_H -#define CLANGCODEMODEL_INTERNAL_CLANGCOMPLETIONASSISTPROCESSOR_H +#pragma once #include "clangcompletionassistinterface.h" @@ -96,5 +95,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_CLANGCOMPLETIONASSISTPROCESSOR_H diff --git a/src/plugins/clangcodemodel/clangcompletionassistprovider.h b/src/plugins/clangcodemodel/clangcompletionassistprovider.h index 8e752f289f..7c1ac168be 100644 --- a/src/plugins/clangcodemodel/clangcompletionassistprovider.h +++ b/src/plugins/clangcodemodel/clangcompletionassistprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_CLANGCOMPLETIONASSISTPROVIDER_H -#define CLANGCODEMODEL_INTERNAL_CLANGCOMPLETIONASSISTPROVIDER_H +#pragma once #include "clangbackendipcintegration.h" @@ -58,5 +57,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_CLANGCOMPLETIONASSISTPROVIDER_H diff --git a/src/plugins/clangcodemodel/clangcompletionchunkstotextconverter.h b/src/plugins/clangcodemodel/clangcompletionchunkstotextconverter.h index 57c5e2b8f1..8b0590fda6 100644 --- a/src/plugins/clangcodemodel/clangcompletionchunkstotextconverter.h +++ b/src/plugins/clangcodemodel/clangcompletionchunkstotextconverter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_COMPLETIONCHUNKSTOTEXTCONVERTER_H -#define CLANGCODEMODEL_INTERNAL_COMPLETIONCHUNKSTOTEXTCONVERTER_H +#pragma once #include <clangbackendipc/codecompletionchunk.h> @@ -106,5 +105,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_COMPLETIONCHUNKSTOTEXTCONVERTER_H diff --git a/src/plugins/clangcodemodel/clangcompletioncontextanalyzer.h b/src/plugins/clangcodemodel/clangcompletioncontextanalyzer.h index 4041f531a4..8f0e79a45b 100644 --- a/src/plugins/clangcodemodel/clangcompletioncontextanalyzer.h +++ b/src/plugins/clangcodemodel/clangcompletioncontextanalyzer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCOMPLETIONCONTEXTANALYZER_H -#define CLANGCOMPLETIONCONTEXTANALYZER_H +#pragma once #include <cplusplus/Token.h> @@ -89,5 +88,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCOMPLETIONCONTEXTANALYZER_H diff --git a/src/plugins/clangcodemodel/clangconstants.h b/src/plugins/clangcodemodel/clangconstants.h index 90466029f3..6197ba5412 100644 --- a/src/plugins/clangcodemodel/clangconstants.h +++ b/src/plugins/clangcodemodel/clangconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCONSTANTS_H -#define CLANGCONSTANTS_H +#pragma once namespace ClangCodeModel { namespace Constants { @@ -35,5 +34,3 @@ const char CLANG_WARNING[] = "Clang.Warning"; } // namespace Constants } // namespace ClangCodeModel - -#endif // CLANGCONSTANTS_H diff --git a/src/plugins/clangcodemodel/clangdiagnosticfilter.h b/src/plugins/clangcodemodel/clangdiagnosticfilter.h index c4384160be..9329d43ceb 100644 --- a/src/plugins/clangcodemodel/clangdiagnosticfilter.h +++ b/src/plugins/clangcodemodel/clangdiagnosticfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_CLANGDIAGNOSTICFILTER_H -#define CLANGCODEMODEL_INTERNAL_CLANGDIAGNOSTICFILTER_H +#pragma once #include <clangbackendipc/diagnosticcontainer.h> @@ -59,5 +58,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_CLANGDIAGNOSTICFILTER_H diff --git a/src/plugins/clangcodemodel/clangdiagnosticmanager.h b/src/plugins/clangcodemodel/clangdiagnosticmanager.h index dbfd72ec04..45def83d3a 100644 --- a/src/plugins/clangcodemodel/clangdiagnosticmanager.h +++ b/src/plugins/clangcodemodel/clangdiagnosticmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_CLANGDIAGNOSTICMANAGER_H -#define CLANGCODEMODEL_INTERNAL_CLANGDIAGNOSTICMANAGER_H +#pragma once #include "clangtextmark.h" @@ -83,5 +82,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_CLANGDIAGNOSTICMANAGER_H diff --git a/src/plugins/clangcodemodel/clangeditordocumentparser.h b/src/plugins/clangcodemodel/clangeditordocumentparser.h index 17749428f0..65da483e2f 100644 --- a/src/plugins/clangcodemodel/clangeditordocumentparser.h +++ b/src/plugins/clangcodemodel/clangeditordocumentparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGEDITORDOCUMENTPARSER_H -#define CLANGEDITORDOCUMENTPARSER_H +#pragma once #include <cpptools/baseeditordocumentparser.h> @@ -42,5 +41,3 @@ private: }; } // namespace ClangCodeModel - -#endif // CLANGEDITORDOCUMENTPARSER_H diff --git a/src/plugins/clangcodemodel/clangeditordocumentprocessor.h b/src/plugins/clangcodemodel/clangeditordocumentprocessor.h index a2a9755e25..31c4f5e9a6 100644 --- a/src/plugins/clangcodemodel/clangeditordocumentprocessor.h +++ b/src/plugins/clangcodemodel/clangeditordocumentprocessor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGEDITORDOCUMENTPROCESSOR_H -#define CLANGEDITORDOCUMENTPROCESSOR_H +#pragma once #include "clangdiagnosticmanager.h" #include "clangeditordocumentparser.h" @@ -114,5 +113,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGEDITORDOCUMENTPROCESSOR_H diff --git a/src/plugins/clangcodemodel/clangfixitoperation.h b/src/plugins/clangcodemodel/clangfixitoperation.h index 95e0df846f..83a8c8ed2e 100644 --- a/src/plugins/clangcodemodel/clangfixitoperation.h +++ b/src/plugins/clangcodemodel/clangfixitoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_CLANGFIXITOPERATION_H -#define CLANGCODEMODEL_CLANGFIXITOPERATION_H +#pragma once #include <texteditor/quickfix.h> @@ -66,5 +65,3 @@ private: }; } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_CLANGFIXITOPERATION_H diff --git a/src/plugins/clangcodemodel/clangfixitoperationsextractor.h b/src/plugins/clangcodemodel/clangfixitoperationsextractor.h index 8477a5308a..e504d27dea 100644 --- a/src/plugins/clangcodemodel/clangfixitoperationsextractor.h +++ b/src/plugins/clangcodemodel/clangfixitoperationsextractor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGFIXITOPERATIONSEXTRACTOR_H -#define CLANGFIXITOPERATIONSEXTRACTOR_H +#pragma once #include <texteditor/quickfix.h> @@ -52,5 +51,3 @@ private: }; } // namespace ClangCodeModel - -#endif // CLANGFIXITOPERATIONSEXTRACTOR_H diff --git a/src/plugins/clangcodemodel/clangfunctionhintmodel.h b/src/plugins/clangcodemodel/clangfunctionhintmodel.h index 32d25db1b4..edfb2f6d74 100644 --- a/src/plugins/clangcodemodel/clangfunctionhintmodel.h +++ b/src/plugins/clangcodemodel/clangfunctionhintmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_CLANGFUNCTIONHINTMODEL_H -#define CLANGCODEMODEL_INTERNAL_CLANGFUNCTIONHINTMODEL_H +#pragma once #include <codecompletion.h> @@ -50,5 +49,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_CLANGFUNCTIONHINTMODEL_H diff --git a/src/plugins/clangcodemodel/clanghighlightingmarksreporter.cpp b/src/plugins/clangcodemodel/clanghighlightingmarksreporter.cpp index 1054fa9e28..ccddbc978f 100644 --- a/src/plugins/clangcodemodel/clanghighlightingmarksreporter.cpp +++ b/src/plugins/clangcodemodel/clanghighlightingmarksreporter.cpp @@ -25,57 +25,69 @@ #include "clanghighlightingmarksreporter.h" -#include <cpptools/semantichighlighter.h> +#include <texteditor/textstyles.h> #include <QFuture> namespace { -CppTools::SemanticHighlighter::Kind toCppToolsSemanticHighlighterKind( - ClangBackEnd::HighlightingType type) +TextEditor::TextStyle toTextStyle(ClangBackEnd::HighlightingType type) { using ClangBackEnd::HighlightingType; - using CppTools::SemanticHighlighter; switch (type) { - case HighlightingType::Keyword: - return SemanticHighlighter::PseudoKeywordUse; - case HighlightingType::Function: - return SemanticHighlighter::FunctionUse; - case HighlightingType::VirtualFunction: - return SemanticHighlighter::VirtualMethodUse; - case HighlightingType::Type: - return SemanticHighlighter::TypeUse; - case HighlightingType::LocalVariable: - return SemanticHighlighter::LocalUse; - case HighlightingType::Field: - return SemanticHighlighter::FieldUse; - case HighlightingType::GlobalVariable: - return SemanticHighlighter::Unknown; - case HighlightingType::Enumeration: - return SemanticHighlighter::EnumerationUse; - case HighlightingType::Label: - return SemanticHighlighter::LabelUse; - case HighlightingType::Preprocessor: - case HighlightingType::PreprocessorDefinition: - case HighlightingType::PreprocessorExpansion: - return SemanticHighlighter::MacroUse; - default: - return SemanticHighlighter::Unknown; + case HighlightingType::Keyword: + return TextEditor::C_KEYWORD; + case HighlightingType::Function: + return TextEditor::C_FUNCTION; + case HighlightingType::VirtualFunction: + return TextEditor::C_VIRTUAL_METHOD; + case HighlightingType::Type: + return TextEditor::C_TYPE; + case HighlightingType::LocalVariable: + return TextEditor::C_LOCAL; + case HighlightingType::Field: + return TextEditor::C_FIELD; + case HighlightingType::GlobalVariable: + return TextEditor::C_GLOBAL; + case HighlightingType::Enumeration: + return TextEditor::C_ENUMERATION; + case HighlightingType::Label: + return TextEditor::C_LABEL; + case HighlightingType::Preprocessor: + case HighlightingType::PreprocessorDefinition: + case HighlightingType::PreprocessorExpansion: + return TextEditor::C_PREPROCESSOR; + case HighlightingType::Declaration: + return TextEditor::C_DECLARATION; + default: + return TextEditor::C_TEXT; // never called } Q_UNREACHABLE(); } +TextEditor::TextStyles toTextStyles(ClangBackEnd::HighlightingTypes types) +{ + TextEditor::TextStyles textStyles; + + textStyles.mainStyle = toTextStyle(types.mainHighlightingType); + + for (ClangBackEnd::HighlightingType type : types.mixinHighlightingTypes) + textStyles.mixinStyles.push_back(toTextStyle(type)); + + return textStyles; +} + TextEditor::HighlightingResult toHighlightingResult( const ClangBackEnd::HighlightingMarkContainer &highlightingMark) { - const auto highlighterKind = toCppToolsSemanticHighlighterKind(highlightingMark.type()); + const auto textStyles = toTextStyles(highlightingMark.types()); return TextEditor::HighlightingResult(highlightingMark.line(), highlightingMark.column(), highlightingMark.length(), - highlighterKind); + textStyles); } } // anonymous diff --git a/src/plugins/clangcodemodel/clanghighlightingmarksreporter.h b/src/plugins/clangcodemodel/clanghighlightingmarksreporter.h index b275982d1e..af4f1773b0 100644 --- a/src/plugins/clangcodemodel/clanghighlightingmarksreporter.h +++ b/src/plugins/clangcodemodel/clanghighlightingmarksreporter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_HIGHLIGHTINGMARKSREPORTER_H -#define CLANGCODEMODEL_HIGHLIGHTINGMARKSREPORTER_H +#pragma once #include <QFutureInterface> #include <QObject> @@ -69,5 +68,3 @@ private: }; } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_HIGHLIGHTINGMARKSREPORTER_H diff --git a/src/plugins/clangcodemodel/clangmodelmanagersupport.h b/src/plugins/clangcodemodel/clangmodelmanagersupport.h index 8e37c28f18..4a6a791db7 100644 --- a/src/plugins/clangcodemodel/clangmodelmanagersupport.h +++ b/src/plugins/clangcodemodel/clangmodelmanagersupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_CLANGMODELMANAGERSUPPORT_H -#define CLANGCODEMODEL_INTERNAL_CLANGMODELMANAGERSUPPORT_H +#pragma once #include "clangcompletionassistprovider.h" @@ -112,5 +111,3 @@ public: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_CLANGMODELMANAGERSUPPORT_H diff --git a/src/plugins/clangcodemodel/clangpreprocessorassistproposalitem.h b/src/plugins/clangcodemodel/clangpreprocessorassistproposalitem.h index 771cb0aa3d..8498c8514f 100644 --- a/src/plugins/clangcodemodel/clangpreprocessorassistproposalitem.h +++ b/src/plugins/clangcodemodel/clangpreprocessorassistproposalitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_PREPROCESSORASSISTPROPOSALITEM_H -#define CLANGCODEMODEL_PREPROCESSORASSISTPROPOSALITEM_H +#pragma once #include <texteditor/codeassist/assistproposaliteminterface.h> @@ -70,5 +69,3 @@ private: }; } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_PREPROCESSORASSISTPROPOSALITEM_H diff --git a/src/plugins/clangcodemodel/clangtextmark.h b/src/plugins/clangcodemodel/clangtextmark.h index ac70a50ccf..b669a86d16 100644 --- a/src/plugins/clangcodemodel/clangtextmark.h +++ b/src/plugins/clangcodemodel/clangtextmark.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_CLANGTEXTMARK_H -#define CLANGCODEMODEL_CLANGTEXTMARK_H +#pragma once #include <clangbackendipc_global.h> @@ -47,5 +46,3 @@ private: }; } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_CLANGTEXTMARK_H diff --git a/src/plugins/clangcodemodel/clangutils.h b/src/plugins/clangcodemodel/clangutils.h index 44b574f368..4bdc6c00d4 100644 --- a/src/plugins/clangcodemodel/clangutils.h +++ b/src/plugins/clangcodemodel/clangutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_CLANGUTILS_H -#define CPPTOOLS_CLANGUTILS_H +#pragma once #include <cpptools/projectpart.h> @@ -44,5 +43,3 @@ QString projectPartIdForFile(const QString &filePath); } // namespace Utils } // namespace Clang - -#endif // CPPTOOLS_CLANGUTILS_H diff --git a/src/plugins/clangcodemodel/test/clangcodecompletion_test.h b/src/plugins/clangcodemodel/test/clangcodecompletion_test.h index 54dba98c4e..bd9151bcac 100644 --- a/src/plugins/clangcodemodel/test/clangcodecompletion_test.h +++ b/src/plugins/clangcodemodel/test/clangcodecompletion_test.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODECOMPLETIONTEST_H -#define CLANGCODECOMPLETIONTEST_H +#pragma once #include <QObject> @@ -65,5 +64,3 @@ private slots: } // namespace Tests } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODECOMPLETIONTEST_H diff --git a/src/plugins/clangcodemodel/test/data/myheader.h b/src/plugins/clangcodemodel/test/data/myheader.h index da584c9137..b025d66c01 100644 --- a/src/plugins/clangcodemodel/test/data/myheader.h +++ b/src/plugins/clangcodemodel/test/data/myheader.h @@ -1,2 +1 @@ int globalFromHeader; - diff --git a/src/plugins/clangcodemodel/test/data/qt-widgets-app/mainwindow.h b/src/plugins/clangcodemodel/test/data/qt-widgets-app/mainwindow.h index d252888e89..596295b643 100644 --- a/src/plugins/clangcodemodel/test/data/qt-widgets-app/mainwindow.h +++ b/src/plugins/clangcodemodel/test/data/qt-widgets-app/mainwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#pragma once #include <QMainWindow> @@ -43,5 +42,3 @@ public: private: Ui::MainWindow *ui; }; - -#endif // MAINWINDOW_H diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzer_global.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzer_global.h index 39fb523976..c42bd95ccf 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzer_global.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzer_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZER_GLOBAL_H -#define CLANGSTATICANALYZER_GLOBAL_H +#pragma once #include <QtGlobal> @@ -33,6 +32,3 @@ #else # define CLANGSTATICANALYZER_EXPORT Q_DECL_IMPORT #endif - -#endif // CLANGSTATICANALYZER_GLOBAL_H - diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerconfigwidget.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerconfigwidget.h index 4655a07eec..f410670e50 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerconfigwidget.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerconfigwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERCONFIGWIDGET_H -#define CLANGSTATICANALYZERCONFIGWIDGET_H +#pragma once #include "clangstaticanalyzersettings.h" @@ -51,5 +50,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // CLANGSTATICANALYZERCONFIGWIDGET_H diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerconstants.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerconstants.h index 66b1f149fe..63982c8f1e 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerconstants.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERCONSTANTS_H -#define CLANGSTATICANALYZERCONSTANTS_H +#pragma once namespace ClangStaticAnalyzer { namespace Constants { @@ -34,5 +33,3 @@ const char CLANGSTATICANALYZER_RUN_MODE[] = "ClangStaticAnalyzer.RunMode"; } // Constants } // ClangStaticAnalyzer - -#endif // CLANGSTATICANALYZERCONSTANTS_H diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnostic.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnostic.h index 708b5137f5..e40e90ec98 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnostic.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnostic.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALZYERDIAGNOSTIC_H -#define CLANGSTATICANALZYERDIAGNOSTIC_H +#pragma once #include <debugger/analyzer/diagnosticlocation.h> @@ -67,5 +66,3 @@ public: } // namespace ClangStaticAnalyzer Q_DECLARE_METATYPE(ClangStaticAnalyzer::Internal::Diagnostic) - -#endif // CLANGSTATICANALZYERDIAGNOSTIC_H diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticmodel.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticmodel.h index e8a30f34ef..d4bdcfbf58 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticmodel.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERDIAGNOSTICMODEL_H -#define CLANGSTATICANALYZERDIAGNOSTICMODEL_H +#pragma once #include "clangstaticanalyzerdiagnostic.h" #include "clangstaticanalyzerprojectsettings.h" @@ -78,5 +77,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // CLANGSTATICANALYZERDIAGNOSTICMODEL_H diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticview.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticview.h index 55ba24642c..39a58804f9 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticview.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerdiagnosticview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERDIAGNOSTICVIEW_H -#define CLANGSTATICANALYZERDIAGNOSTICVIEW_H +#pragma once #include <debugger/analyzer/detailederrorview.h> @@ -48,5 +47,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // CLANGSTATICANALYZERDIAGNOSTICVIEW_H diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerlogfilereader.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerlogfilereader.h index 8b05ada7aa..e29a4c1a10 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerlogfilereader.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerlogfilereader.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERLOGFILEREADER_H -#define CLANGSTATICANALYZERLOGFILEREADER_H +#pragma once #include "clangstaticanalyzerdiagnostic.h" @@ -41,5 +40,3 @@ public: } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // CLANGSTATICANALYZERLOGFILEREADER_H diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerplugin.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerplugin.h index b663a16487..7d8d2fe1d0 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerplugin.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERPLUGIN_H -#define CLANGSTATICANALYZERPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -56,6 +55,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzerPlugin - -#endif // CLANGSTATICANALYZERPLUGIN_H - diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettings.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettings.h index f30298b69f..31a3941005 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettings.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERPROJECTSETTINGS_H -#define CLANGSTATICANALYZERPROJECTSETTINGS_H +#pragma once #include <projectexplorer/project.h> #include <utils/fileutils.h> @@ -91,5 +90,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // Include guard. diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettingsmanager.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettingsmanager.h index a588a7824d..50af615372 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettingsmanager.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettingsmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERPROJECTSETTINGSMANAGER_H -#define CLANGSTATICANALYZERPROJECTSETTINGSMANAGER_H +#pragma once namespace ProjectExplorer { class Project; } @@ -51,5 +50,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // Include guard. diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettingswidget.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettingswidget.h index b68003b25c..18090788ac 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettingswidget.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerprojectsettingswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERPROJECTSETTINGSWIDGET_H -#define CLANGSTATICANALYZERPROJECTSETTINGSWIDGET_H +#pragma once #include <QWidget> @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // Include guard. diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h index 525b2a351d..d0497ae100 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERRUNCONTROL_H -#define CLANGSTATICANALYZERRUNCONTROL_H +#pragma once #include <debugger/analyzer/analyzerruncontrol.h> #include <cpptools/projectinfo.h> @@ -104,5 +103,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // CLANGSTATICANALYZERRUNCONTROL_H diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrolfactory.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrolfactory.h index a116b1df94..13f4ac8043 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrolfactory.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrolfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERRUNCONTROLFACTORY_H -#define CLANGSTATICANALYZERRUNCONTROLFACTORY_H +#pragma once #include "clangstaticanalyzertool.h" @@ -53,5 +52,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // CLANGSTATICANALYZERRUNCONTROLFACTORY_H diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerrunner.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerrunner.h index 92852d34c2..eb20359062 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerrunner.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerrunner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERRUNNER_H -#define CLANGSTATICANALYZERRUNNER_H +#pragma once #include <QString> #include <QProcess> @@ -82,5 +81,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // CLANGSTATICANALYZERRUNNER_H diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzersettings.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzersettings.h index 5f7d80a01f..1a2ff5286c 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzersettings.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzersettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERSETTINGS_H -#define CLANGSTATICANALYZERSETTINGS_H +#pragma once #include <QString> @@ -55,5 +54,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // CLANGSTATICANALYZERSETTINGS_H diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.h index 08580b3953..4e1f491693 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERTOOL_H -#define CLANGSTATICANALYZERTOOL_H +#pragma once #include <debugger/analyzer/analyzermanager.h> #include <cpptools/projectinfo.h> @@ -89,5 +88,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // CLANGSTATICANALYZERTOOL_H diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.h index b49ef5b1d3..cc85fda603 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERUNITTESTS_H -#define CLANGSTATICANALYZERUNITTESTS_H +#pragma once #include <QObject> #include <QTemporaryDir> @@ -55,6 +54,3 @@ private: } // namespace Internal } // namespace ClangStaticAnalyzerPlugin - -#endif // Include guard - diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerutils.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerutils.h index 1531d050c6..a4137164de 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerutils.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGSTATICANALYZERUTILS_H -#define CLANGSTATICANALYZERUTILS_H +#pragma once #include <coreplugin/id.h> @@ -48,5 +47,3 @@ QString createFullLocationString(const Debugger::DiagnosticLocation &location); } // namespace Internal } // namespace ClangStaticAnalyzer - -#endif // CLANGSTATICANALYZERUTILS_H diff --git a/src/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.h b/src/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.h index ce76956bad..77673e9e57 100644 --- a/src/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.h +++ b/src/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.h @@ -1,5 +1,4 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#pragma once #include <QMainWindow> @@ -20,5 +19,3 @@ public: private: Ui::MainWindow *ui; }; - -#endif // MAINWINDOW_H diff --git a/src/plugins/classview/classviewconstants.h b/src/plugins/classview/classviewconstants.h index fdb575f70a..424305322c 100644 --- a/src/plugins/classview/classviewconstants.h +++ b/src/plugins/classview/classviewconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSVIEWCONSTANTS_H -#define CLASSVIEWCONSTANTS_H +#pragma once namespace ClassView { namespace Constants { @@ -40,5 +39,3 @@ enum ItemRole } // namespace Constants } // namespace ClassView - -#endif // CLASSVIEWCONSTANTS_H diff --git a/src/plugins/classview/classviewmanager.h b/src/plugins/classview/classviewmanager.h index 86b2d96c78..9a2f46524b 100644 --- a/src/plugins/classview/classviewmanager.h +++ b/src/plugins/classview/classviewmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSVIEWMANAGER_H -#define CLASSVIEWMANAGER_H +#pragma once #include <QObject> #include <QSharedPointer> @@ -106,5 +105,3 @@ private: } // namespace Internal } // namespace ClassView - -#endif // CLASSVIEWMANAGER_H diff --git a/src/plugins/classview/classviewnavigationwidget.h b/src/plugins/classview/classviewnavigationwidget.h index e1fdae993b..55c15d02a5 100644 --- a/src/plugins/classview/classviewnavigationwidget.h +++ b/src/plugins/classview/classviewnavigationwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSVIEWNAVIGATIONWIDGET_H -#define CLASSVIEWNAVIGATIONWIDGET_H +#pragma once #include "classviewtreeitemmodel.h" @@ -90,5 +89,3 @@ private: } // namespace Internal } // namespace ClassView - -#endif // CLASSVIEWNAVIGATIONWIDGET_H diff --git a/src/plugins/classview/classviewnavigationwidgetfactory.h b/src/plugins/classview/classviewnavigationwidgetfactory.h index 5be9b61891..8675760c74 100644 --- a/src/plugins/classview/classviewnavigationwidgetfactory.h +++ b/src/plugins/classview/classviewnavigationwidgetfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSVIEWNAVIGATIONWIDGETFACTORY_H -#define CLASSVIEWNAVIGATIONWIDGETFACTORY_H +#pragma once #include <coreplugin/inavigationwidgetfactory.h> @@ -50,5 +49,3 @@ public: } // namespace Internal } // namespace ClassView - -#endif // CLASSVIEWNAVIGATIONWIDGETFACTORY_H diff --git a/src/plugins/classview/classviewparser.h b/src/plugins/classview/classviewparser.h index c230a3eca7..902ec8cb5a 100644 --- a/src/plugins/classview/classviewparser.h +++ b/src/plugins/classview/classviewparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSVIEWPARSER_H -#define CLASSVIEWPARSER_H +#pragma once #include <QObject> @@ -128,5 +127,3 @@ private: } // namespace Internal } // namespace ClassView - -#endif // CLASSVIEWPARSER_H diff --git a/src/plugins/classview/classviewparsertreeitem.h b/src/plugins/classview/classviewparsertreeitem.h index e8cb82590c..60ca284cee 100644 --- a/src/plugins/classview/classviewparsertreeitem.h +++ b/src/plugins/classview/classviewparsertreeitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSVIEWPARSERTREEITEM_H -#define CLASSVIEWPARSERTREEITEM_H +#pragma once #include "classviewsymbollocation.h" #include "classviewsymbolinformation.h" @@ -99,5 +98,3 @@ private: } // namespace Internal } // namespace ClassView - -#endif // CLASSVIEWPARSERTREEITEM_H diff --git a/src/plugins/classview/classviewplugin.h b/src/plugins/classview/classviewplugin.h index 663cce587f..223a963efc 100644 --- a/src/plugins/classview/classviewplugin.h +++ b/src/plugins/classview/classviewplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSVIEWPLUGIN_H -#define CLASSVIEWPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -49,5 +48,3 @@ public: } // namespace Internal } // namespace ClassView - -#endif // CLASSVIEWPLUGIN_H diff --git a/src/plugins/classview/classviewsymbolinformation.h b/src/plugins/classview/classviewsymbolinformation.h index 7032a07d15..80d13a873b 100644 --- a/src/plugins/classview/classviewsymbolinformation.h +++ b/src/plugins/classview/classviewsymbolinformation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSVIEWSYMBOLINFORMATION_H -#define CLASSVIEWSYMBOLINFORMATION_H +#pragma once #include <QMetaType> #include <QString> @@ -73,5 +72,3 @@ inline uint qHash(const SymbolInformation &information) } // namespace ClassView Q_DECLARE_METATYPE(ClassView::Internal::SymbolInformation) - -#endif // CLASSVIEWSYMBOLINFORMATION_H diff --git a/src/plugins/classview/classviewsymbollocation.h b/src/plugins/classview/classviewsymbollocation.h index 5f4f5660f4..144c0227cd 100644 --- a/src/plugins/classview/classviewsymbollocation.h +++ b/src/plugins/classview/classviewsymbollocation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSVIEWSYMBOLLOCATION_H -#define CLASSVIEWSYMBOLLOCATION_H +#pragma once #include <QMetaType> #include <QString> @@ -68,5 +67,3 @@ inline uint qHash(const SymbolLocation &location) } // namespace ClassView Q_DECLARE_METATYPE(ClassView::Internal::SymbolLocation) - -#endif // CLASSVIEWSYMBOLLOCATION_H diff --git a/src/plugins/classview/classviewtreeitemmodel.h b/src/plugins/classview/classviewtreeitemmodel.h index e3171c8357..9864d179db 100644 --- a/src/plugins/classview/classviewtreeitemmodel.h +++ b/src/plugins/classview/classviewtreeitemmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSVIEWTREEITEMMODEL_H -#define CLASSVIEWTREEITEMMODEL_H +#pragma once #include <QStandardItemModel> @@ -59,5 +58,3 @@ private: } // namespace Internal } // namespace ClassView - -#endif // CLASSVIEWTREEMODEL_H diff --git a/src/plugins/classview/classviewutils.h b/src/plugins/classview/classviewutils.h index 4b7001f943..9a731e90e0 100644 --- a/src/plugins/classview/classviewutils.h +++ b/src/plugins/classview/classviewutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSVIEWUTILS_H -#define CLASSVIEWUTILS_H +#pragma once #include "classviewsymbollocation.h" #include "classviewsymbolinformation.h" @@ -61,5 +60,3 @@ public: } // namespace Internal } // namespace ClassView - -#endif // CLASSVIEWUTILS_H diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.cpp b/src/plugins/cmakeprojectmanager/builddirmanager.cpp index 8edc76ae5c..98c3695342 100644 --- a/src/plugins/cmakeprojectmanager/builddirmanager.cpp +++ b/src/plugins/cmakeprojectmanager/builddirmanager.cpp @@ -61,30 +61,13 @@ namespace CMakeProjectManager { namespace Internal { static QStringList toArguments(const CMakeConfig &config, const ProjectExplorer::Kit *k) { - return Utils::transform(config, [k](const CMakeConfigItem &i) -> QString { - QString a = QString::fromLatin1("-D"); - a.append(QString::fromUtf8(i.key)); - switch (i.type) { - case CMakeConfigItem::FILEPATH: - a.append(QLatin1String(":FILEPATH=")); - break; - case CMakeConfigItem::PATH: - a.append(QLatin1String(":PATH=")); - break; - case CMakeConfigItem::BOOL: - a.append(QLatin1String(":BOOL=")); - break; - case CMakeConfigItem::STRING: - a.append(QLatin1String(":STRING=")); - break; - case CMakeConfigItem::INTERNAL: - a.append(QLatin1String(":INTERNAL=")); - break; - } - a.append(QString::fromUtf8(k->macroExpander()->expand(i.value))); - - return a; - }); + const QStringList argList + = Utils::transform(config, [k](const CMakeConfigItem &i) -> QString { + const QString tmp = i.toString(); + return tmp.isEmpty() ? QString() + : QString::fromLatin1("-D") + k->macroExpander()->expand(tmp); + }); + return Utils::filtered(argList, [](const QString &s) { return !s.isEmpty(); }); } // -------------------------------------------------------------------- diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 57f8c36303..1d133d8d60 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -207,7 +207,10 @@ QList<ConfigModel::DataItem> CMakeBuildConfiguration::completeCMakeConfiguration m_completeConfigurationCache = m_buildDirManager->parsedConfiguration(); CMakeConfig cache = Utils::filtered(m_completeConfigurationCache, - [](const CMakeConfigItem &i) { return i.type != CMakeConfigItem::INTERNAL; }); + [](const CMakeConfigItem &i) { + return i.type != CMakeConfigItem::INTERNAL + && i.type != CMakeConfigItem::STATIC; + }); return Utils::transform(cache, [](const CMakeConfigItem &i) { ConfigModel::DataItem j; j.key = QString::fromUtf8(i.key); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 3ee4f753f1..e8e5e925ab 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -203,9 +203,7 @@ bool CMakeBuildStep::init(QList<const BuildStep *> &earlierSteps) ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); Utils::Environment env = bc->environment(); - // Force output to english for the parsers. Do this here and not in the toolchain's - // addToEnvironment() to not screw up the users run environment. - env.set(QLatin1String("LC_ALL"), QLatin1String("C")); + Utils::Environment::setupEnglishOutput(&env); if (!env.value(QLatin1String("NINJA_STATUS")).startsWith(m_ninjaProgressString)) env.set(QLatin1String("NINJA_STATUS"), m_ninjaProgressString + QLatin1String("%o/sec] ")); pp->setEnvironment(env); diff --git a/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp b/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp index 7f4af54338..3a578c6cac 100644 --- a/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp @@ -120,6 +120,8 @@ CMakeConfigItem CMakeConfigItem::fromString(const QString &s) t = CMakeConfigItem::BOOL; else if (type == QLatin1String("INTERNAL")) t = CMakeConfigItem::INTERNAL; + else if (type == QLatin1String("STATIC")) + t = CMakeConfigItem::STATIC; item.key = key.toUtf8(); item.type = t; @@ -130,7 +132,7 @@ CMakeConfigItem CMakeConfigItem::fromString(const QString &s) QString CMakeConfigItem::toString() const { - if (key.isEmpty()) + if (key.isEmpty() || type == CMakeProjectManager::CMakeConfigItem::STATIC) return QString(); QString typeStr; diff --git a/src/plugins/cmakeprojectmanager/cmakeconfigitem.h b/src/plugins/cmakeprojectmanager/cmakeconfigitem.h index 2562b92479..b11e83b7bb 100644 --- a/src/plugins/cmakeprojectmanager/cmakeconfigitem.h +++ b/src/plugins/cmakeprojectmanager/cmakeconfigitem.h @@ -34,7 +34,7 @@ namespace CMakeProjectManager { class CMakeConfigItem { public: - enum Type { FILEPATH, PATH, BOOL, STRING, INTERNAL }; + enum Type { FILEPATH, PATH, BOOL, STRING, INTERNAL, STATIC }; CMakeConfigItem(); CMakeConfigItem(const CMakeConfigItem &other); CMakeConfigItem(const QByteArray &k, Type t, const QByteArray &d, const QByteArray &v); diff --git a/src/plugins/cmakeprojectmanager/cmakefile.h b/src/plugins/cmakeprojectmanager/cmakefile.h index 0b5d0992c4..e5018ce731 100644 --- a/src/plugins/cmakeprojectmanager/cmakefile.h +++ b/src/plugins/cmakeprojectmanager/cmakefile.h @@ -34,7 +34,6 @@ namespace Internal { class CMakeFile : public Core::IDocument { - Q_OBJECT public: CMakeFile(const Utils::FileName &fileName); diff --git a/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp b/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp index 6422e93105..39e0689be6 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp @@ -339,7 +339,7 @@ void CMakeConfigurationKitConfigWidget::editConfigurationChanges() m_dialog = new QDialog(m_summaryLabel->window()); m_dialog->setWindowTitle(tr("Edit CMake Configuration")); - QVBoxLayout *layout = new QVBoxLayout(m_dialog); + auto layout = new QVBoxLayout(m_dialog); m_editor = new QPlainTextEdit; m_editor->setToolTip(tr("Enter one variable per line with the variable name " "separated from the variable value by \"=\".<br>" diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index d165c83730..a41f6d8cce 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -126,6 +126,15 @@ KitConfigWidget *CMakeKitInformation::createConfigWidget(Kit *k) const return new Internal::CMakeKitConfigWidget(k, this); } +void CMakeKitInformation::addToMacroExpander(Kit *k, Utils::MacroExpander *expander) const +{ + expander->registerFileVariables("CMake:Executable", tr("Path to the cmake executable"), + [this, k]() -> QString { + CMakeTool *tool = CMakeKitInformation::cmakeTool(k); + return tool ? tool->cmakeExecutable().toString() : QString(); + }); +} + // -------------------------------------------------------------------- // CMakeGeneratorKitInformation: // -------------------------------------------------------------------- @@ -208,12 +217,7 @@ QList<Task> CMakeGeneratorKitInformation::validate(const Kit *k) const QString generator = CMakeGeneratorKitInformation::generator(k); QList<Task> result; - if (!tool) { - if (!generator.isEmpty()) { - result << Task(Task::Warning, tr("No CMake Tool configured, CMake generator will be ignored."), - Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); - } - } else { + if (tool) { if (!tool->isValid()) { result << Task(Task::Warning, tr("CMake Tool is unconfigured, CMake generator will be ignored."), Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); @@ -299,6 +303,7 @@ QStringList CMakeConfigurationKitInformation::toStringList(const Kit *k) QStringList current = Utils::transform(CMakeConfigurationKitInformation::configuration(k), [](const CMakeConfigItem &i) { return i.toString(); }); + current = Utils::filtered(current, [](const QString &s) { return !s.isEmpty(); }); Utils::sort(current); return current; } diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.h b/src/plugins/cmakeprojectmanager/cmakekitinformation.h index ede702dc6f..3ee550cf01 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.h +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.h @@ -51,6 +51,8 @@ public: void fix(ProjectExplorer::Kit *k) override; ItemList toUserOutput(const ProjectExplorer::Kit *k) const override; ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *k) const override; + + void addToMacroExpander(ProjectExplorer::Kit *k, Utils::MacroExpander *expander) const override; }; class CMAKE_EXPORT CMakeGeneratorKitInformation : public ProjectExplorer::KitInformation diff --git a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp index 341330c88b..00431ee3b5 100644 --- a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp @@ -84,29 +84,20 @@ QList<Core::LocatorFilterEntry> CMakeLocatorFilter::matchesFor(QFutureInterface< void CMakeLocatorFilter::accept(Core::LocatorFilterEntry selection) const { // Get the project containing the target selected - CMakeProject *cmakeProject = 0; + CMakeProject *cmakeProject = nullptr; foreach (Project *p, SessionManager::projects()) { cmakeProject = qobject_cast<CMakeProject *>(p); if (cmakeProject && cmakeProject->projectFilePath().toString() == selection.internalData.toString()) break; - cmakeProject = 0; } - if (!cmakeProject) - return; - - if (!cmakeProject->activeTarget()) - return; - - if (!cmakeProject->activeTarget()->activeBuildConfiguration()) + if (!cmakeProject || !cmakeProject->activeTarget() || !cmakeProject->activeTarget()->activeBuildConfiguration()) return; // Find the make step ProjectExplorer::BuildStepList *buildStepList = cmakeProject->activeTarget()->activeBuildConfiguration() ->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD); - auto buildStep - = qobject_cast<CMakeBuildStep *>(findOrDefault(buildStepList->steps(), - [](BuildStep *s) -> bool { return qobject_cast<CMakeBuildStep *>(s); })); + auto buildStep = buildStepList->firstOfType<CMakeBuildStep>(); if (!buildStep) return; diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 67c421e98e..084110ef22 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -105,7 +105,7 @@ Utils::SynchronousProcessResponse CMakeTool::run(const QString &arg) const cmake.setTimeoutS(1); cmake.setFlags(Utils::SynchronousProcess::UnixTerminalDisabled); Utils::Environment env = Utils::Environment::systemEnvironment(); - env.set(QLatin1String("LC_ALL"), QLatin1String("C")); + Utils::Environment::setupEnglishOutput(&env); cmake.setProcessEnvironment(env.toProcessEnvironment()); cmake.setTimeOutMessageBoxEnabled(false); diff --git a/src/plugins/cmakeprojectmanager/configmodel.h b/src/plugins/cmakeprojectmanager/configmodel.h index d3a335dbe2..ea80eb7a07 100644 --- a/src/plugins/cmakeprojectmanager/configmodel.h +++ b/src/plugins/cmakeprojectmanager/configmodel.h @@ -83,4 +83,3 @@ private: }; } // namespace CMakeProjectManager - diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.h b/src/plugins/coreplugin/actionmanager/actioncontainer.h index 65b9748042..03d69c4841 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer.h +++ b/src/plugins/coreplugin/actionmanager/actioncontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ACTIONCONTAINER_H -#define ACTIONCONTAINER_H +#pragma once #include "coreplugin/core_global.h" #include "coreplugin/icontext.h" @@ -75,5 +74,3 @@ public: }; } // namespace Core - -#endif // ACTIONCONTAINER_H diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h index 2350119ee7..048f0854a6 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h +++ b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ACTIONCONTAINER_P_H -#define ACTIONCONTAINER_P_H +#pragma once #include "actionmanager_p.h" @@ -141,5 +140,3 @@ private: } // namespace Internal } // namespace Core - -#endif // ACTIONCONTAINER_P_H diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.h b/src/plugins/coreplugin/actionmanager/actionmanager.h index 5add94044f..d1128b984b 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.h +++ b/src/plugins/coreplugin/actionmanager/actionmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ACTIONMANAGER_H -#define ACTIONMANAGER_H +#pragma once #include "coreplugin/core_global.h" #include "coreplugin/coreconstants.h" @@ -89,5 +88,3 @@ private: }; } // namespace Core - -#endif // ACTIONMANAGER_H diff --git a/src/plugins/coreplugin/actionmanager/actionmanager_p.h b/src/plugins/coreplugin/actionmanager/actionmanager_p.h index fabfa7917e..0269fc4992 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager_p.h +++ b/src/plugins/coreplugin/actionmanager/actionmanager_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ACTIONMANAGERPRIVATE_H -#define ACTIONMANAGERPRIVATE_H +#pragma once #include <coreplugin/actionmanager/command_p.h> #include <coreplugin/actionmanager/actioncontainer_p.h> @@ -84,5 +83,3 @@ public: } // namespace Internal } // namespace Core - -#endif // ACTIONMANAGERPRIVATE_H diff --git a/src/plugins/coreplugin/actionmanager/command.h b/src/plugins/coreplugin/actionmanager/command.h index 4555abe898..1d9f9c940b 100644 --- a/src/plugins/coreplugin/actionmanager/command.h +++ b/src/plugins/coreplugin/actionmanager/command.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMMAND_H -#define COMMAND_H +#pragma once #include <coreplugin/core_global.h> #include <coreplugin/id.h> @@ -97,5 +96,3 @@ signals: } // namespace Core Q_DECLARE_OPERATORS_FOR_FLAGS(Core::Command::CommandAttributes) - -#endif // COMMAND_H diff --git a/src/plugins/coreplugin/actionmanager/command_p.h b/src/plugins/coreplugin/actionmanager/command_p.h index eec5f814f2..eebb826aab 100644 --- a/src/plugins/coreplugin/actionmanager/command_p.h +++ b/src/plugins/coreplugin/actionmanager/command_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMMAND_P_H -#define COMMAND_P_H +#pragma once #include "command.h" @@ -100,5 +99,3 @@ private: } // namespace Internal } // namespace Core - -#endif // COMMAND_P_H diff --git a/src/plugins/coreplugin/actionmanager/commandbutton.h b/src/plugins/coreplugin/actionmanager/commandbutton.h index 5828eb6563..deb7c1ed0c 100644 --- a/src/plugins/coreplugin/actionmanager/commandbutton.h +++ b/src/plugins/coreplugin/actionmanager/commandbutton.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMMANDBUTTON_H -#define COMMANDBUTTON_H +#pragma once #include <coreplugin/core_global.h> @@ -56,5 +55,3 @@ private: }; } - -#endif // COMMANDBUTTON_H diff --git a/src/plugins/coreplugin/actionmanager/commandmappings.h b/src/plugins/coreplugin/actionmanager/commandmappings.h index 7e9ea25f4d..89abe7efb0 100644 --- a/src/plugins/coreplugin/actionmanager/commandmappings.h +++ b/src/plugins/coreplugin/actionmanager/commandmappings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMMANDMAPPINGS_H -#define COMMANDMAPPINGS_H +#pragma once #include <coreplugin/core_global.h> @@ -80,5 +79,3 @@ private: }; } // namespace Core - -#endif // COMMANDMAPPINGS_H diff --git a/src/plugins/coreplugin/actionmanager/commandsfile.h b/src/plugins/coreplugin/actionmanager/commandsfile.h index a7c2f2db6f..891856383f 100644 --- a/src/plugins/coreplugin/actionmanager/commandsfile.h +++ b/src/plugins/coreplugin/actionmanager/commandsfile.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMMANDSFILE_H -#define COMMANDSFILE_H +#pragma once #include <QObject> #include <QString> @@ -53,5 +52,3 @@ private: } // namespace Internal } // namespace Core - -#endif //COMMANDSFILE_H diff --git a/src/plugins/coreplugin/basefilewizard.h b/src/plugins/coreplugin/basefilewizard.h index b00e7cc13c..860056a040 100644 --- a/src/plugins/coreplugin/basefilewizard.h +++ b/src/plugins/coreplugin/basefilewizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASEFILEWIZARD_H -#define BASEFILEWIZARD_H +#pragma once #include "core_global.h" @@ -64,5 +63,3 @@ private: }; } // namespace Core - -#endif // BASEFILEWIZARD_H diff --git a/src/plugins/coreplugin/basefilewizardfactory.h b/src/plugins/coreplugin/basefilewizardfactory.h index 3f9c95b840..0026a1d638 100644 --- a/src/plugins/coreplugin/basefilewizardfactory.h +++ b/src/plugins/coreplugin/basefilewizardfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASEFILEWIZARDFACTORY_H -#define BASEFILEWIZARDFACTORY_H +#pragma once #include "core_global.h" #include "generatedfile.h" @@ -126,5 +125,3 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(Core::GeneratedFile::Attributes) Q_DECLARE_OPERATORS_FOR_FLAGS(Core::WizardDialogParameters::DialogParameterFlags) - -#endif // BASEFILEWIZARDFACTORY_H diff --git a/src/plugins/coreplugin/core_global.h b/src/plugins/coreplugin/core_global.h index 4d2ac897e3..663b2e7e5c 100644 --- a/src/plugins/coreplugin/core_global.h +++ b/src/plugins/coreplugin/core_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CORE_GLOBAL_H -#define CORE_GLOBAL_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define CORE_EXPORT Q_DECL_IMPORT #endif - -#endif // CORE_GLOBAL_H diff --git a/src/plugins/coreplugin/coreconstants.h b/src/plugins/coreplugin/coreconstants.h index 0098fc4601..45ed6ec252 100644 --- a/src/plugins/coreplugin/coreconstants.h +++ b/src/plugins/coreplugin/coreconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CORECONSTANTS_H -#define CORECONSTANTS_H +#pragma once #include <QtGlobal> @@ -210,5 +209,3 @@ const int TARGET_ICON_SIZE = 32; } // namespace Constants } // namespace Core - -#endif // CORECONSTANTS_H diff --git a/src/plugins/coreplugin/coreicons.h b/src/plugins/coreplugin/coreicons.h index 537a349271..f95ddbf4b2 100644 --- a/src/plugins/coreplugin/coreicons.h +++ b/src/plugins/coreplugin/coreicons.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COREICONS_H -#define COREICONS_H +#pragma once #include "core_global.h" @@ -104,5 +103,3 @@ CORE_EXPORT extern const Utils::Icon MODE_DESIGN_FLAT_ACTIVE; } // namespace Icons } // namespace Core - -#endif // COREICONS_H diff --git a/src/plugins/coreplugin/corejsextensions.h b/src/plugins/coreplugin/corejsextensions.h index a90584cc4f..861e10bd01 100644 --- a/src/plugins/coreplugin/corejsextensions.h +++ b/src/plugins/coreplugin/corejsextensions.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COREJSEXTENSIONS_H -#define COREJSEXTENSIONS_H +#pragma once #include <utils/stringutils.h> @@ -73,5 +72,3 @@ public: } // namespace Internal } // namespace Core - -#endif // COREJSEXTENSIONS_H diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 2bd8144939..a170e4f487 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -66,7 +66,6 @@ CorePlugin::CorePlugin() : m_mainWindow(0) , m_editMode(0) , m_designMode(0) - , m_findPlugin(0) , m_locator(0) { qRegisterMetaType<Id>(); @@ -75,8 +74,8 @@ CorePlugin::CorePlugin() CorePlugin::~CorePlugin() { IWizardFactory::destroyFeatureProvider(); + Find::destroy(); - delete m_findPlugin; delete m_locator; if (m_editMode) { @@ -137,7 +136,6 @@ void CorePlugin::parseArguments(const QStringList &arguments) // because they need a valid theme set m_mainWindow = new MainWindow; ActionManager::setPresentationModeEnabled(presentationMode); - m_findPlugin = new FindPlugin; m_locator = new Locator; if (overrideColor.isValid()) @@ -168,7 +166,7 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) // Make sure we respect the process's umask when creating new files SaveFile::initializeUmask(); - m_findPlugin->initialize(arguments, errorMessage); + Find::initialize(); m_locator->initialize(this, arguments, errorMessage); MacroExpander *expander = Utils::globalMacroExpander(); @@ -217,7 +215,7 @@ void CorePlugin::extensionsInitialized() { if (m_designMode->designModeIsRequired()) addObject(m_designMode); - m_findPlugin->extensionsInitialized(); + Find::extensionsInitialized(); m_locator->extensionsInitialized(); m_mainWindow->extensionsInitialized(); if (ExtensionSystem::PluginManager::hasError()) { @@ -275,7 +273,7 @@ void CorePlugin::addToPathChooserContextMenu(Utils::PathChooser *pathChooser, QM ExtensionSystem::IPlugin::ShutdownFlag CorePlugin::aboutToShutdown() { - m_findPlugin->aboutToShutdown(); + Find::aboutToShutdown(); m_mainWindow->aboutToShutdown(); return SynchronousShutdown; } diff --git a/src/plugins/coreplugin/coreplugin.h b/src/plugins/coreplugin/coreplugin.h index 5e376b6287..c6135ed85c 100644 --- a/src/plugins/coreplugin/coreplugin.h +++ b/src/plugins/coreplugin/coreplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COREPLUGIN_H -#define COREPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -40,7 +39,6 @@ class Theme; namespace Core { class DesignMode; -class FindPlugin; namespace Internal { @@ -86,11 +84,8 @@ private: MainWindow *m_mainWindow; EditMode *m_editMode; DesignMode *m_designMode; - FindPlugin *m_findPlugin; Locator *m_locator; }; } // namespace Internal } // namespace Core - -#endif // COREPLUGIN_H diff --git a/src/plugins/coreplugin/designmode.cpp b/src/plugins/coreplugin/designmode.cpp index 82ce55ad23..08d3ec20e6 100644 --- a/src/plugins/coreplugin/designmode.cpp +++ b/src/plugins/coreplugin/designmode.cpp @@ -197,7 +197,7 @@ void DesignMode::currentEditorChanged(IEditor *editor) if (!mimeEditorAvailable) { setActiveContext(Context()); - if (ModeManager::currentMode() == this) + if (ModeManager::currentMode() == id()) ModeManager::activateMode(Constants::MODE_EDIT); setEnabled(false); d->m_currentEditor = 0; @@ -217,11 +217,11 @@ void DesignMode::updateActions() emit actionsUpdated(d->m_currentEditor.data()); } -void DesignMode::updateContext(IMode *newMode, IMode *oldMode) +void DesignMode::updateContext(Id newMode, Id oldMode) { - if (newMode == this) + if (newMode == id()) ICore::addAdditionalContext(d->m_activeContext); - else if (oldMode == this) + else if (oldMode == id()) ICore::removeAdditionalContext(d->m_activeContext); } @@ -230,7 +230,7 @@ void DesignMode::setActiveContext(const Context &context) if (d->m_activeContext == context) return; - if (ModeManager::currentMode() == this) + if (ModeManager::currentMode() == id()) ICore::updateAdditionalContexts(d->m_activeContext, context); d->m_activeContext = context; diff --git a/src/plugins/coreplugin/designmode.h b/src/plugins/coreplugin/designmode.h index 7c261f800a..fc0be09ed0 100644 --- a/src/plugins/coreplugin/designmode.h +++ b/src/plugins/coreplugin/designmode.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNMODE_H -#define DESIGNMODE_H +#pragma once #include <coreplugin/imode.h> @@ -69,7 +68,7 @@ private: void updateActions(); void currentEditorChanged(IEditor *editor); - void updateContext(IMode *newMode, IMode *oldMode); + void updateContext(Id newMode, Id oldMode); void setActiveContext(const Context &context); DesignModePrivate *d; @@ -77,5 +76,3 @@ private: }; } // namespace Core - -#endif // DESIGNMODE_H diff --git a/src/plugins/coreplugin/dialogs/addtovcsdialog.h b/src/plugins/coreplugin/dialogs/addtovcsdialog.h index 588ba9c856..2aabc530c2 100644 --- a/src/plugins/coreplugin/dialogs/addtovcsdialog.h +++ b/src/plugins/coreplugin/dialogs/addtovcsdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDTOVCSDIALOG_H -#define ADDTOVCSDIALOG_H +#pragma once #include <QDialog> @@ -49,4 +48,3 @@ private: } // namespace Internal } // namespace Core -#endif // ADDTOVCSDIALOG_H diff --git a/src/plugins/coreplugin/dialogs/externaltoolconfig.h b/src/plugins/coreplugin/dialogs/externaltoolconfig.h index b7f395a653..e0f588b764 100644 --- a/src/plugins/coreplugin/dialogs/externaltoolconfig.h +++ b/src/plugins/coreplugin/dialogs/externaltoolconfig.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXTERNALTOOLCONFIG_H -#define EXTERNALTOOLCONFIG_H +#pragma once #include "coreplugin/externaltool.h" @@ -125,6 +124,3 @@ private: } // Internal } // Core - - -#endif // EXTERNALTOOLCONFIG_H diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index 20b7ef7686..c27cec3c3a 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOPTIONSPAGE_H -#define IOPTIONSPAGE_H +#pragma once #include <coreplugin/id.h> @@ -107,5 +106,3 @@ protected: }; } // namespace Core - -#endif // IOPTIONSPAGE_H diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp index 013779f83d..5506b067a1 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.cpp +++ b/src/plugins/coreplugin/dialogs/newdialog.cpp @@ -471,8 +471,7 @@ void NewDialog::accept() saveState(); if (m_ui->templatesView->currentIndex().isValid()) { IWizardFactory *wizard = currentWizardFactory(); - QTC_CHECK(wizard); - if (wizard) { + if (QTC_GUARD(wizard)) { QTimer::singleShot(0, std::bind(&runWizard, wizard, m_defaultLocation, selectedPlatform(), m_extraVariables)); } diff --git a/src/plugins/coreplugin/dialogs/newdialog.h b/src/plugins/coreplugin/dialogs/newdialog.h index cd51db330b..13385b7f98 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.h +++ b/src/plugins/coreplugin/dialogs/newdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NEWDIALOG_H -#define NEWDIALOG_H +#pragma once #include "../iwizardfactory.h" @@ -94,5 +93,3 @@ private: } // namespace Internal } // namespace Core - -#endif // NEWDIALOG_H diff --git a/src/plugins/coreplugin/dialogs/openwithdialog.h b/src/plugins/coreplugin/dialogs/openwithdialog.h index 4d1fd3f762..d93ea71d6d 100644 --- a/src/plugins/coreplugin/dialogs/openwithdialog.h +++ b/src/plugins/coreplugin/dialogs/openwithdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OPENWITHDIALOG_H -#define OPENWITHDIALOG_H +#pragma once #include <QDialog> #include "ui_openwithdialog.h" @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace Core - -#endif // OPENWITHDIALOG_H diff --git a/src/plugins/coreplugin/dialogs/promptoverwritedialog.h b/src/plugins/coreplugin/dialogs/promptoverwritedialog.h index f235d16660..38d93c6a8a 100644 --- a/src/plugins/coreplugin/dialogs/promptoverwritedialog.h +++ b/src/plugins/coreplugin/dialogs/promptoverwritedialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROMPTOVERWRITEDIALOG_H -#define PROMPTOVERWRITEDIALOG_H +#pragma once #include "../core_global.h" @@ -67,5 +66,3 @@ private: }; } // namespace Core - -#endif // PROMPTOVERWRITEDIALOG_H diff --git a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.h b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.h index 25b5d3e517..b0498aaa8e 100644 --- a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.h +++ b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef READONLYFILESDIALOG_H -#define READONLYFILESDIALOG_H +#pragma once #include <coreplugin/core_global.h> @@ -81,5 +80,3 @@ private: }; } // namespace Core - -#endif // READONLYFILESDIALOG_H diff --git a/src/plugins/coreplugin/dialogs/saveitemsdialog.h b/src/plugins/coreplugin/dialogs/saveitemsdialog.h index cd988eb05e..623cb2e85f 100644 --- a/src/plugins/coreplugin/dialogs/saveitemsdialog.h +++ b/src/plugins/coreplugin/dialogs/saveitemsdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SAVEITEMSDIALOG_H -#define SAVEITEMSDIALOG_H +#pragma once #include <QList> #include <QDialog> @@ -68,5 +67,3 @@ private: } // namespace Internal } // namespace Core - -#endif // SAVEITEMSDIALOG_H diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.h b/src/plugins/coreplugin/dialogs/shortcutsettings.h index 1383523860..4607d68419 100644 --- a/src/plugins/coreplugin/dialogs/shortcutsettings.h +++ b/src/plugins/coreplugin/dialogs/shortcutsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SHORTCUTSETTINGS_H -#define SHORTCUTSETTINGS_H +#pragma once #include <coreplugin/actionmanager/commandmappings.h> #include <coreplugin/dialogs/ioptionspage.h> @@ -131,5 +130,3 @@ private: } // namespace Internal } // namespace Core - -#endif // SHORTCUTSETTINGS_H diff --git a/src/plugins/coreplugin/documentmanager.h b/src/plugins/coreplugin/documentmanager.h index f2eaf8fc26..bf8692f3cb 100644 --- a/src/plugins/coreplugin/documentmanager.h +++ b/src/plugins/coreplugin/documentmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DOCUMENTMANAGER_H -#define DOCUMENTMANAGER_H +#pragma once #include <coreplugin/id.h> @@ -184,5 +183,3 @@ private: } // namespace Core Q_DECLARE_METATYPE(Core::DocumentManager::RecentFile) - -#endif // DOCUMENTMANAGER_H diff --git a/src/plugins/coreplugin/editmode.cpp b/src/plugins/coreplugin/editmode.cpp index f56b6273ad..6432ac8a15 100644 --- a/src/plugins/coreplugin/editmode.cpp +++ b/src/plugins/coreplugin/editmode.cpp @@ -58,25 +58,25 @@ EditMode::EditMode() : m_rightSplitWidgetLayout->setMargin(0); QWidget *rightSplitWidget = new QWidget; rightSplitWidget->setLayout(m_rightSplitWidgetLayout); - auto editorPlaceHolder = new EditorManagerPlaceHolder(this); + auto editorPlaceHolder = new EditorManagerPlaceHolder(Constants::MODE_EDIT); m_rightSplitWidgetLayout->insertWidget(0, editorPlaceHolder); MiniSplitter *rightPaneSplitter = new MiniSplitter; rightPaneSplitter->insertWidget(0, rightSplitWidget); - rightPaneSplitter->insertWidget(1, new RightPanePlaceHolder(this)); + rightPaneSplitter->insertWidget(1, new RightPanePlaceHolder(Constants::MODE_EDIT)); rightPaneSplitter->setStretchFactor(0, 1); rightPaneSplitter->setStretchFactor(1, 0); MiniSplitter *splitter = new MiniSplitter; splitter->setOrientation(Qt::Vertical); splitter->insertWidget(0, rightPaneSplitter); - QWidget *outputPane = new OutputPanePlaceHolder(this, splitter); + QWidget *outputPane = new OutputPanePlaceHolder(Constants::MODE_EDIT, splitter); outputPane->setObjectName(QLatin1String("EditModeOutputPanePlaceHolder")); splitter->insertWidget(1, outputPane); splitter->setStretchFactor(0, 3); splitter->setStretchFactor(1, 0); - m_splitter->insertWidget(0, new NavigationWidgetPlaceHolder(this)); + m_splitter->insertWidget(0, new NavigationWidgetPlaceHolder(Constants::MODE_EDIT)); m_splitter->insertWidget(1, splitter); m_splitter->setStretchFactor(0, 0); m_splitter->setStretchFactor(1, 1); @@ -100,9 +100,9 @@ EditMode::~EditMode() delete m_splitter; } -void EditMode::grabEditorManager(IMode *mode) +void EditMode::grabEditorManager(Id mode) { - if (mode != this) + if (mode != id()) return; if (EditorManager::currentEditor()) diff --git a/src/plugins/coreplugin/editmode.h b/src/plugins/coreplugin/editmode.h index a3f9abdde9..d11ab206e4 100644 --- a/src/plugins/coreplugin/editmode.h +++ b/src/plugins/coreplugin/editmode.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EDITMODE_H -#define EDITMODE_H +#pragma once #include <coreplugin/imode.h> @@ -48,7 +47,7 @@ public: ~EditMode(); private: - void grabEditorManager(IMode *mode); + void grabEditorManager(Id mode); QSplitter *m_splitter; QVBoxLayout *m_rightSplitWidgetLayout; @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace Core - -#endif // EDITMODE_H diff --git a/src/plugins/coreplugin/editormanager/documentmodel.cpp b/src/plugins/coreplugin/editormanager/documentmodel.cpp index efdcf8bace..e24e74e875 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.cpp +++ b/src/plugins/coreplugin/editormanager/documentmodel.cpp @@ -366,14 +366,6 @@ void DocumentModel::removeEditor(IEditor *editor, bool *lastOneForDocument) } } -void DocumentModel::removeDocument(const QString &fileName) -{ - int index = d->indexOfFilePath(Utils::FileName::fromString(fileName)); - // For non suspended entries, we wouldn't know what to do with the associated editors - QTC_ASSERT(d->m_entries.at(index)->isSuspended, return); - d->removeDocument(index); -} - void DocumentModelPrivate::removeDocument(int idx) { if (idx < 0) @@ -451,6 +443,14 @@ DocumentModel::Entry *DocumentModel::entryForDocument(IDocument *document) [&document](Entry *entry) { return entry->document == document; }); } +DocumentModel::Entry *DocumentModel::entryForFilePath(const Utils::FileName &filePath) +{ + const int index = d->indexOfFilePath(filePath); + if (index < 0) + return nullptr; + return d->m_entries.at(index); +} + QList<IDocument *> DocumentModel::openedDocuments() { return d->m_editors.keys(); diff --git a/src/plugins/coreplugin/editormanager/documentmodel.h b/src/plugins/coreplugin/editormanager/documentmodel.h index c79a98b71f..2dcbe4c698 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.h +++ b/src/plugins/coreplugin/editormanager/documentmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DOCUMENTMODEL_H -#define DOCUMENTMODEL_H +#pragma once #include "../core_global.h" #include "../id.h" @@ -70,6 +69,7 @@ public: static QList<Entry *> entries(); static int indexOfDocument(IDocument *document); static Entry *entryForDocument(IDocument *document); + static Entry *entryForFilePath(const Utils::FileName &filePath); static QList<IDocument *> openedDocuments(); static IDocument *documentForFilePath(const QString &filePath); @@ -83,7 +83,6 @@ public: static void addSuspendedDocument(const QString &fileName, const QString &displayName, Id id); static Entry *firstSuspendedEntry(); static void removeEditor(IEditor *editor, bool *lastOneForDocument); - static void removeDocument(const QString &fileName); static void removeEntry(Entry *entry); static void removeAllSuspendedEntries(); @@ -93,4 +92,4 @@ private: } // namespace Core -#endif // DOCUMENTMODEL_H +Q_DECLARE_METATYPE(Core::DocumentModel::Entry *) diff --git a/src/plugins/coreplugin/editormanager/editorarea.h b/src/plugins/coreplugin/editormanager/editorarea.h index 011f868808..2cbece9065 100644 --- a/src/plugins/coreplugin/editormanager/editorarea.h +++ b/src/plugins/coreplugin/editormanager/editorarea.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EDITORAREA_H -#define EDITORAREA_H +#pragma once #include "editorview.h" @@ -62,5 +61,3 @@ private: } // Internal } // Core - -#endif // EDITORAREA_H diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 994da5f9e0..ec70f60f37 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -121,7 +121,7 @@ using namespace Utils; //===================EditorManager===================== -EditorManagerPlaceHolder::EditorManagerPlaceHolder(IMode *mode, QWidget *parent) +EditorManagerPlaceHolder::EditorManagerPlaceHolder(Id mode, QWidget *parent) : QWidget(parent), m_mode(mode) { setLayout(new QVBoxLayout); @@ -143,7 +143,7 @@ EditorManagerPlaceHolder::~EditorManagerPlaceHolder() } } -void EditorManagerPlaceHolder::currentModeChanged(IMode *mode) +void EditorManagerPlaceHolder::currentModeChanged(Id mode) { if (m_mode == mode) { QWidget *previousFocus = 0; @@ -1247,23 +1247,27 @@ IEditor *EditorManagerPrivate::activateEditor(EditorView *view, IEditor *editor, return editor; } -void EditorManagerPrivate::activateEditorForEntry(EditorView *view, DocumentModel::Entry *entry, EditorManager::OpenEditorFlags flags) +bool EditorManagerPrivate::activateEditorForEntry(EditorView *view, DocumentModel::Entry *entry, + EditorManager::OpenEditorFlags flags) { - QTC_ASSERT(view, return); + QTC_ASSERT(view, return false); if (!entry) { // no document view->setCurrentEditor(0); setCurrentView(view); setCurrentEditor(0); - return; + return false; } IDocument *document = entry->document; if (!entry->isSuspended) { - activateEditorForDocument(view, document, flags); - return; + IEditor *editor = activateEditorForDocument(view, document, flags); + return editor != nullptr; } - if (!openEditor(view, entry->fileName().toString(), entry->id(), flags)) + if (!openEditor(view, entry->fileName().toString(), entry->id(), flags)) { DocumentModel::removeEntry(entry); + return false; + } + return true; } void EditorManagerPrivate::closeEditorOrDocument(IEditor *editor) @@ -1670,10 +1674,9 @@ void EditorManagerPrivate::gotoNextSplit() if (nextIndex >= d->m_editorAreas.size()) nextIndex = 0; nextView = d->m_editorAreas.at(nextIndex)->findFirstView(); - QTC_CHECK(nextView); } - if (nextView) + if (QTC_GUARD(nextView)) activateView(nextView); } @@ -1694,10 +1697,9 @@ void EditorManagerPrivate::gotoPreviousSplit() if (nextIndex < 0) nextIndex = d->m_editorAreas.count() - 1; prevView = d->m_editorAreas.at(nextIndex)->findLastView(); - QTC_CHECK(prevView); } - if (prevView) + if (QTC_GUARD(prevView)) activateView(prevView); } diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index d543db4293..8dcb166915 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EDITORMANAGER_H -#define EDITORMANAGER_H +#pragma once #include "../core_global.h" #include "../idocument.h" @@ -73,13 +72,13 @@ class CORE_EXPORT EditorManagerPlaceHolder : public QWidget { Q_OBJECT public: - explicit EditorManagerPlaceHolder(IMode *mode, QWidget *parent = 0); + explicit EditorManagerPlaceHolder(Id mode, QWidget *parent = 0); ~EditorManagerPlaceHolder(); private: - void currentModeChanged(IMode *); + void currentModeChanged(Id mode); - IMode *m_mode; + Id m_mode; }; class CORE_EXPORT EditorManager : public QObject @@ -210,5 +209,3 @@ private: } // namespace Core Q_DECLARE_OPERATORS_FOR_FLAGS(Core::EditorManager::OpenEditorFlags) - -#endif // EDITORMANAGER_H diff --git a/src/plugins/coreplugin/editormanager/editormanager_p.h b/src/plugins/coreplugin/editormanager/editormanager_p.h index 96defc9ec5..085a392cd8 100644 --- a/src/plugins/coreplugin/editormanager/editormanager_p.h +++ b/src/plugins/coreplugin/editormanager/editormanager_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EDITORMANAGER_P_H -#define EDITORMANAGER_P_H +#pragma once #include "documentmodel.h" #include "editorarea.h" @@ -87,7 +86,7 @@ public: EditorManager::OpenEditorFlags flags = EditorManager::NoFlags); static IEditor *activateEditorForDocument(EditorView *view, IDocument *document, EditorManager::OpenEditorFlags flags = 0); - static void activateEditorForEntry(EditorView *view, DocumentModel::Entry *entry, + static bool activateEditorForEntry(EditorView *view, DocumentModel::Entry *entry, EditorManager::OpenEditorFlags flags = EditorManager::NoFlags); /* closes the document if there is no other editor on the document visible */ static void closeEditorOrDocument(IEditor *editor); @@ -259,5 +258,3 @@ private: } // Internal } // Core - -#endif // EDITORMANAGER_P_H diff --git a/src/plugins/coreplugin/editormanager/editorview.h b/src/plugins/coreplugin/editormanager/editorview.h index 831b84c3b1..df0a62a9cb 100644 --- a/src/plugins/coreplugin/editormanager/editorview.h +++ b/src/plugins/coreplugin/editormanager/editorview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EDITORVIEW_H -#define EDITORVIEW_H +#pragma once #include "coreplugin/id.h" @@ -213,4 +212,3 @@ private: } } -#endif // EDITORVIEW_H diff --git a/src/plugins/coreplugin/editormanager/editorwindow.h b/src/plugins/coreplugin/editormanager/editorwindow.h index bf02169199..2fc2f324dc 100644 --- a/src/plugins/coreplugin/editormanager/editorwindow.h +++ b/src/plugins/coreplugin/editormanager/editorwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EDITORWINDOW_H -#define EDITORWINDOW_H +#pragma once #include <QWidget> @@ -50,5 +49,3 @@ private: } // Internal } // Core - -#endif // EDITORWINDOW_H diff --git a/src/plugins/coreplugin/editormanager/ieditor.h b/src/plugins/coreplugin/editormanager/ieditor.h index 033064e536..fccf619779 100644 --- a/src/plugins/coreplugin/editormanager/ieditor.h +++ b/src/plugins/coreplugin/editormanager/ieditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IEDITOR_H -#define IEDITOR_H +#pragma once #include <coreplugin/core_global.h> #include <coreplugin/icontext.h> @@ -67,5 +66,3 @@ private: } // namespace Core Q_DECLARE_METATYPE(Core::IEditor*) - -#endif // IEDITOR_H diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.h b/src/plugins/coreplugin/editormanager/ieditorfactory.h index 1d50cdf26b..583001951c 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory.h +++ b/src/plugins/coreplugin/editormanager/ieditorfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IEDITORFACTORY_H -#define IEDITORFACTORY_H +#pragma once #include <coreplugin/core_global.h> #include <coreplugin/id.h> @@ -61,5 +60,3 @@ private: }; } // namespace Core - -#endif // IEDITORFACTORY_H diff --git a/src/plugins/coreplugin/editormanager/iexternaleditor.h b/src/plugins/coreplugin/editormanager/iexternaleditor.h index 0bc67774fa..24784b1e4a 100644 --- a/src/plugins/coreplugin/editormanager/iexternaleditor.h +++ b/src/plugins/coreplugin/editormanager/iexternaleditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IEXTERNALEDITOR_H -#define IEXTERNALEDITOR_H +#pragma once #include <coreplugin/core_global.h> @@ -48,5 +47,3 @@ public: }; } // namespace Core - -#endif // IEXTERNALEDITOR_H diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.h b/src/plugins/coreplugin/editormanager/openeditorsview.h index fcca6b6e42..758a479ede 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.h +++ b/src/plugins/coreplugin/editormanager/openeditorsview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OPENEDITORSVIEW_H -#define OPENEDITORSVIEW_H +#pragma once #include <coreplugin/inavigationwidgetfactory.h> #include <coreplugin/opendocumentstreeview.h> @@ -94,6 +93,3 @@ public: } // namespace Internal } // namespace Core - - -#endif // OPENEDITORSVIEW_H diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index 868fd31221..0bcd283075 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -25,7 +25,6 @@ #include "openeditorswindow.h" -#include "documentmodel.h" #include "editormanager.h" #include "editormanager_p.h" #include "editorview.h" @@ -45,6 +44,12 @@ Q_DECLARE_METATYPE(Core::IDocument*) using namespace Core; using namespace Core::Internal; +enum class Role +{ + Entry = Qt::UserRole, + View = Qt::UserRole + 1 +}; + OpenEditorsWindow::OpenEditorsWindow(QWidget *parent) : QFrame(parent, Qt::Popup), m_emptyIcon(QLatin1String(":/core/images/empty14.png")), @@ -173,14 +178,14 @@ void OpenEditorsWindow::setEditors(const QList<EditLocation> &globalHistory, Edi { m_editorList->clear(); - QSet<IDocument*> documentsDone; - addHistoryItems(view->editorHistory(), view, documentsDone); + QSet<const DocumentModel::Entry *> entriesDone; + addHistoryItems(view->editorHistory(), view, entriesDone); // add missing editors from the global history - addHistoryItems(globalHistory, view, documentsDone); + addHistoryItems(globalHistory, view, entriesDone); // add purely suspended editors which are not initialised yet - addSuspendedItems(); + addRemainingItems(view, entriesDone); } @@ -188,16 +193,11 @@ void OpenEditorsWindow::selectEditor(QTreeWidgetItem *item) { if (!item) return; - if (IDocument *document = item->data(0, Qt::UserRole).value<IDocument*>()) { - EditorView *view = item->data(0, Qt::UserRole+1).value<EditorView*>(); - EditorManagerPrivate::activateEditorForDocument(view, document); - } else { - if (!EditorManager::openEditor( - item->toolTip(0), item->data(0, Qt::UserRole+2).value<Id>())) { - DocumentModel::removeDocument(item->toolTip(0)); - delete item; - } - } + auto entry = item->data(0, int(Role::Entry)).value<DocumentModel::Entry *>(); + QTC_ASSERT(entry, return); + auto view = item->data(0, int(Role::View)).value<EditorView *>(); + if (!EditorManagerPrivate::activateEditorForEntry(view, entry)) + delete item; } void OpenEditorsWindow::editorClicked(QTreeWidgetItem *item) @@ -212,48 +212,51 @@ void OpenEditorsWindow::ensureCurrentVisible() m_editorList->scrollTo(m_editorList->currentIndex(), QAbstractItemView::PositionAtCenter); } +static DocumentModel::Entry *entryForEditLocation(const EditLocation &item) +{ + if (!item.document.isNull()) + return DocumentModel::entryForDocument(item.document); + return DocumentModel::entryForFilePath(Utils::FileName::fromString(item.fileName)); +} void OpenEditorsWindow::addHistoryItems(const QList<EditLocation> &history, EditorView *view, - QSet<IDocument *> &documentsDone) + QSet<const DocumentModel::Entry *> &entriesDone) { foreach (const EditLocation &hi, history) { - if (hi.document.isNull() || documentsDone.contains(hi.document)) - continue; - documentsDone.insert(hi.document.data()); - DocumentModel::Entry *entry = DocumentModel::entryForDocument(hi.document); - QString title = entry ? entry->displayName() : hi.document->displayName(); - QTC_ASSERT(!title.isEmpty(), continue); - QTreeWidgetItem *item = new QTreeWidgetItem(); - if (hi.document->isModified()) - title += tr("*"); - item->setIcon(0, !hi.document->filePath().isEmpty() && hi.document->isFileReadOnly() - ? DocumentModel::lockedIcon() : m_emptyIcon); - item->setText(0, title); - item->setToolTip(0, hi.document->filePath().toString()); - item->setData(0, Qt::UserRole, QVariant::fromValue(hi.document.data())); - item->setData(0, Qt::UserRole+1, QVariant::fromValue(view)); - item->setTextAlignment(0, Qt::AlignLeft); - - m_editorList->addTopLevelItem(item); - - if (m_editorList->topLevelItemCount() == 1) - m_editorList->setCurrentItem(item); + if (DocumentModel::Entry *entry = entryForEditLocation(hi)) + addItem(entry, entriesDone, view); } } -void OpenEditorsWindow::addSuspendedItems() +void OpenEditorsWindow::addRemainingItems(EditorView *view, + QSet<const DocumentModel::Entry *> &entriesDone) { - foreach (DocumentModel::Entry *entry, DocumentModel::entries()) { - if (!entry->isSuspended) - continue; - QTreeWidgetItem *item = new QTreeWidgetItem(); - QString title = entry->displayName(); - item->setIcon(0, m_emptyIcon); - item->setText(0, title); - item->setToolTip(0, entry->fileName().toString()); - item->setData(0, Qt::UserRole+2, QVariant::fromValue(entry->id())); - item->setTextAlignment(0, Qt::AlignLeft); - - m_editorList->addTopLevelItem(item); - } + foreach (DocumentModel::Entry *entry, DocumentModel::entries()) + addItem(entry, entriesDone, view); +} + +void OpenEditorsWindow::addItem(DocumentModel::Entry *entry, + QSet<const DocumentModel::Entry *> &entriesDone, + EditorView *view) +{ + if (entriesDone.contains(entry)) + return; + entriesDone.insert(entry); + QString title = entry->displayName(); + QTC_ASSERT(!title.isEmpty(), return); + QTreeWidgetItem *item = new QTreeWidgetItem(); + if (entry->document->isModified()) + title += tr("*"); + item->setIcon(0, !entry->fileName().isEmpty() && entry->document->isFileReadOnly() + ? DocumentModel::lockedIcon() : m_emptyIcon); + item->setText(0, title); + item->setToolTip(0, entry->fileName().toString()); + item->setData(0, int(Role::Entry), QVariant::fromValue(entry)); + item->setData(0, int(Role::View), QVariant::fromValue(view)); + item->setTextAlignment(0, Qt::AlignLeft); + + m_editorList->addTopLevelItem(item); + + if (m_editorList->topLevelItemCount() == 1) + m_editorList->setCurrentItem(item); } diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.h b/src/plugins/coreplugin/editormanager/openeditorswindow.h index 355abf6098..e497411b77 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.h +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.h @@ -23,9 +23,9 @@ ** ****************************************************************************/ -#ifndef OPENEDITORSWINDOW_H -#define OPENEDITORSWINDOW_H +#pragma once +#include "documentmodel.h" #include "editorview.h" #include <QFrame> @@ -78,8 +78,12 @@ private: void editorClicked(QTreeWidgetItem *item); void selectEditor(QTreeWidgetItem *item); - void addHistoryItems(const QList<EditLocation> &history, EditorView *view, QSet<IDocument*> &documentsDone); - void addSuspendedItems(); + void addHistoryItems(const QList<EditLocation> &history, EditorView *view, + QSet<const DocumentModel::Entry *> &entriesDone); + void addRemainingItems(EditorView *view, + QSet<const DocumentModel::Entry *> &entriesDone); + void addItem(DocumentModel::Entry *entry, QSet<const DocumentModel::Entry *> &entriesDone, + EditorView *view); void ensureCurrentVisible(); void selectUpDown(bool up); @@ -91,5 +95,3 @@ private: } // namespace Internal } // namespace Core - -#endif // OPENEDITORSWINDOW_H diff --git a/src/plugins/coreplugin/editormanager/systemeditor.h b/src/plugins/coreplugin/editormanager/systemeditor.h index 10a90d0f8c..1589dd21ce 100644 --- a/src/plugins/coreplugin/editormanager/systemeditor.h +++ b/src/plugins/coreplugin/editormanager/systemeditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SYSTEMEDITOR_H -#define SYSTEMEDITOR_H +#pragma once #include "iexternaleditor.h" @@ -47,5 +46,3 @@ public: } // namespace Internal } // namespace Core - -#endif // SYSTEMEDITOR_H diff --git a/src/plugins/coreplugin/editortoolbar.h b/src/plugins/coreplugin/editortoolbar.h index e395b4c392..13f50a0943 100644 --- a/src/plugins/coreplugin/editortoolbar.h +++ b/src/plugins/coreplugin/editortoolbar.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EDITORTOOLBAR_H -#define EDITORTOOLBAR_H +#pragma once #include "core_global.h" @@ -114,5 +113,3 @@ private: }; } // namespace Core - -#endif // EDITORTOOLBAR_H diff --git a/src/plugins/coreplugin/externaltool.h b/src/plugins/coreplugin/externaltool.h index eafd198f42..2bd86bd9d9 100644 --- a/src/plugins/coreplugin/externaltool.h +++ b/src/plugins/coreplugin/externaltool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXTERNALTOOL_H -#define EXTERNALTOOL_H +#pragma once #include <utils/fileutils.h> #include <utils/environment.h> @@ -159,5 +158,3 @@ private: } // Core Q_DECLARE_METATYPE(Core::Internal::ExternalTool *) - -#endif // EXTERNALTOOL_H diff --git a/src/plugins/coreplugin/externaltoolmanager.h b/src/plugins/coreplugin/externaltoolmanager.h index 142e823a39..6e1ca666ff 100644 --- a/src/plugins/coreplugin/externaltoolmanager.h +++ b/src/plugins/coreplugin/externaltoolmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXTERNALTOOLMANAGER_H -#define EXTERNALTOOLMANAGER_H +#pragma once #include "core_global.h" @@ -56,6 +55,3 @@ signals: }; } // namespace Core - - -#endif // EXTERNALTOOLMANAGER_H diff --git a/src/plugins/coreplugin/fancyactionbar.h b/src/plugins/coreplugin/fancyactionbar.h index 590694186b..90e1e33b81 100644 --- a/src/plugins/coreplugin/fancyactionbar.h +++ b/src/plugins/coreplugin/fancyactionbar.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FANCYACTIONBAR_H -#define FANCYACTIONBAR_H +#pragma once #include <QToolButton> @@ -78,5 +77,3 @@ private: } // namespace Internal } // namespace Core - -#endif // FANCYACTIONBAR_H diff --git a/src/plugins/coreplugin/fancytabwidget.h b/src/plugins/coreplugin/fancytabwidget.h index b871af08c6..e59d6189ea 100644 --- a/src/plugins/coreplugin/fancytabwidget.h +++ b/src/plugins/coreplugin/fancytabwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FANCYTABWIDGET_H -#define FANCYTABWIDGET_H +#pragma once #include <QIcon> #include <QWidget> @@ -180,5 +179,3 @@ private: } // namespace Internal } // namespace Core - -#endif // FANCYTABWIDGET_H diff --git a/src/plugins/coreplugin/featureprovider.h b/src/plugins/coreplugin/featureprovider.h index 24e8c93222..43c1a3a536 100644 --- a/src/plugins/coreplugin/featureprovider.h +++ b/src/plugins/coreplugin/featureprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FEATUREPROVIDER_H -#define FEATUREPROVIDER_H +#pragma once #include "core_global.h" @@ -48,5 +47,3 @@ public: }; } // namespace Core - -#endif // FEATUREPROVIDER_H diff --git a/src/plugins/coreplugin/fileiconprovider.h b/src/plugins/coreplugin/fileiconprovider.h index 2c1d629912..5262bd26bc 100644 --- a/src/plugins/coreplugin/fileiconprovider.h +++ b/src/plugins/coreplugin/fileiconprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILEICONPROVIDER_H -#define FILEICONPROVIDER_H +#pragma once #include <coreplugin/core_global.h> @@ -51,5 +50,3 @@ CORE_EXPORT void registerIconOverlayForMimeType(const QIcon &icon, const char *m } // namespace FileIconProvider } // namespace Core - -#endif // FILEICONPROVIDER_H diff --git a/src/plugins/coreplugin/fileutils.h b/src/plugins/coreplugin/fileutils.h index 969deb848c..c82d93bb0e 100644 --- a/src/plugins/coreplugin/fileutils.h +++ b/src/plugins/coreplugin/fileutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CORE_FILEUTILS_H -#define CORE_FILEUTILS_H +#pragma once #include "coreplugin/core_global.h" @@ -49,5 +48,3 @@ struct CORE_EXPORT FileUtils }; } // namespace Core - -#endif // CORE_FILEUTILS_H diff --git a/src/plugins/coreplugin/find/basetextfind.h b/src/plugins/coreplugin/find/basetextfind.h index a0a3b52533..c320cc95bd 100644 --- a/src/plugins/coreplugin/find/basetextfind.h +++ b/src/plugins/coreplugin/find/basetextfind.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASETEXTFIND_H -#define BASETEXTFIND_H +#pragma once #include "ifindsupport.h" @@ -85,5 +84,3 @@ private: }; } // namespace Core - -#endif // BASETEXTFIND_H diff --git a/src/plugins/coreplugin/find/currentdocumentfind.h b/src/plugins/coreplugin/find/currentdocumentfind.h index 613eab7adc..a0d40d8706 100644 --- a/src/plugins/coreplugin/find/currentdocumentfind.h +++ b/src/plugins/coreplugin/find/currentdocumentfind.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CURRENTDOCUMENTFIND_H -#define CURRENTDOCUMENTFIND_H +#pragma once #include "ifindsupport.h" @@ -83,5 +82,3 @@ private: } // namespace Internal } // namespace Core - -#endif // CURRENTDOCUMENTFIND_H diff --git a/src/plugins/coreplugin/find/findplugin.cpp b/src/plugins/coreplugin/find/findplugin.cpp index 276bd6025e..11dbc83330 100644 --- a/src/plugins/coreplugin/find/findplugin.cpp +++ b/src/plugins/coreplugin/find/findplugin.cpp @@ -70,47 +70,42 @@ namespace { namespace Core { -class FindPluginPrivate { -public: - explicit FindPluginPrivate(FindPlugin *q); +class FindPrivate : public QObject +{ + Q_DECLARE_TR_FUNCTIONS(Core::Find) - //variables - static FindPlugin *m_instance; +public: + void filterChanged(IFindFilter *changedFilter); + void displayNameChanged(IFindFilter *changedFilter); + void openFindFilter(QAction *action); + void writeSettings(); + void setFindFlag(Core::FindFlag flag, bool enabled); + void updateCompletion(const QString &text, QStringList &completions, QStringListModel *model); + void setupMenu(); + void setupFilterMenuItems(); + void readSettings(); QHash<IFindFilter *, QAction *> m_filterActions; - Internal::CurrentDocumentFind *m_currentDocumentFind; - Internal::FindToolBar *m_findToolBar; - Internal::FindToolWindow *m_findDialog; - SearchResultWindow *m_searchResultWindow; + Internal::CurrentDocumentFind *m_currentDocumentFind = 0; + Internal::FindToolBar *m_findToolBar = 0; + Internal::FindToolWindow *m_findDialog = 0; + SearchResultWindow *m_searchResultWindow = 0; FindFlags m_findFlags; - QStringListModel *m_findCompletionModel; - QStringListModel *m_replaceCompletionModel; + QStringListModel m_findCompletionModel; + QStringListModel m_replaceCompletionModel; QStringList m_findCompletions; QStringList m_replaceCompletions; - QAction *m_openFindDialog; + QAction *m_openFindDialog = 0; }; -FindPluginPrivate::FindPluginPrivate(FindPlugin *q) : - m_currentDocumentFind(0), m_findToolBar(0), m_findDialog(0), - m_searchResultWindow(0), - m_findCompletionModel(new QStringListModel(q)), - m_replaceCompletionModel(new QStringListModel(q)), - m_openFindDialog(0) -{ -} - -FindPlugin *FindPluginPrivate::m_instance = 0; +Find *m_instance = 0; +FindPrivate *d = 0; -FindPlugin::FindPlugin() : d(new FindPluginPrivate(this)) +void Find::destroy() { - QTC_ASSERT(!FindPluginPrivate::m_instance, return); - FindPluginPrivate::m_instance = this; -} - -FindPlugin::~FindPlugin() -{ - FindPluginPrivate::m_instance = 0; + delete m_instance; + m_instance = 0; delete d->m_currentDocumentFind; delete d->m_findToolBar; delete d->m_findDialog; @@ -119,45 +114,48 @@ FindPlugin::~FindPlugin() delete d; } -FindPlugin *FindPlugin::instance() +Find *Find::instance() { - return FindPluginPrivate::m_instance; + return m_instance; } -void FindPlugin::initialize(const QStringList &, QString *) +void Find::initialize() { - setupMenu(); + QTC_ASSERT(!m_instance, return); + m_instance = new Find; + + d = new FindPrivate; + d->setupMenu(); d->m_currentDocumentFind = new Internal::CurrentDocumentFind; - d->m_findToolBar = new Internal::FindToolBar(this, d->m_currentDocumentFind); - auto *findToolBarContext = new IContext(this); + d->m_findToolBar = new Internal::FindToolBar(d->m_currentDocumentFind); + auto *findToolBarContext = new IContext(m_instance); findToolBarContext->setWidget(d->m_findToolBar); findToolBarContext->setContext(Context(Constants::C_FINDTOOLBAR)); ICore::addContextObject(findToolBarContext); - d->m_findDialog = new Internal::FindToolWindow(this); + d->m_findDialog = new Internal::FindToolWindow; d->m_searchResultWindow = new SearchResultWindow(d->m_findDialog); ExtensionSystem::PluginManager::addObject(d->m_searchResultWindow); - connect(ICore::instance(), &ICore::saveSettingsRequested, this, &FindPlugin::writeSettings); + QObject::connect(ICore::instance(), &ICore::saveSettingsRequested, d, &FindPrivate::writeSettings); } -void FindPlugin::extensionsInitialized() +void Find::extensionsInitialized() { - setupFilterMenuItems(); - readSettings(); + d->setupFilterMenuItems(); + d->readSettings(); } -void FindPlugin::aboutToShutdown() +void Find::aboutToShutdown() { d->m_findToolBar->setVisible(false); d->m_findToolBar->setParent(0); d->m_currentDocumentFind->removeConnections(); } -void FindPlugin::filterChanged() +void FindPrivate::filterChanged(IFindFilter *changedFilter) { - IFindFilter *changedFilter = qobject_cast<IFindFilter *>(sender()); QAction *action = d->m_filterActions.value(changedFilter); QTC_ASSERT(changedFilter, return); QTC_ASSERT(action, return); @@ -172,9 +170,8 @@ void FindPlugin::filterChanged() d->m_openFindDialog->setEnabled(haveEnabledFilters); } -void FindPlugin::displayNameChanged() +void FindPrivate::displayNameChanged(IFindFilter *changedFilter) { - IFindFilter *changedFilter = qobject_cast<IFindFilter *>(sender()); QAction *action = d->m_filterActions.value(changedFilter); QTC_ASSERT(changedFilter, return); QTC_ASSERT(action, return); @@ -182,15 +179,14 @@ void FindPlugin::displayNameChanged() d->m_findDialog->updateFindFilterNames(); } -void FindPlugin::openFindFilter() +void FindPrivate::openFindFilter(QAction *action) { - QAction *action = qobject_cast<QAction*>(sender()); QTC_ASSERT(action, return); IFindFilter *filter = action->data().value<IFindFilter *>(); - openFindDialog(filter); + Find::openFindDialog(filter); } -void FindPlugin::openFindDialog(IFindFilter *filter) +void Find::openFindDialog(IFindFilter *filter) { d->m_currentDocumentFind->acceptCandidate(); const QString currentFindString = @@ -202,7 +198,7 @@ void FindPlugin::openFindDialog(IFindFilter *filter) SearchResultWindow::instance()->openNewSearchPanel(); } -void FindPlugin::setupMenu() +void FindPrivate::setupMenu() { ActionContainer *medit = ActionManager::actionContainer(Constants::M_EDIT); ActionContainer *mfind = ActionManager::createMenu(Constants::M_FIND); @@ -219,16 +215,16 @@ void FindPlugin::setupMenu() ActionContainer *mfindadvanced = ActionManager::createMenu(Constants::M_FIND_ADVANCED); mfindadvanced->menu()->setTitle(tr("Advanced Find")); mfind->addMenu(mfindadvanced, Constants::G_FIND_FILTERS); - d->m_openFindDialog = new QAction(tr("Open Advanced Find..."), this); - d->m_openFindDialog->setIconText(tr("Advanced...")); - cmd = ActionManager::registerAction(d->m_openFindDialog, Constants::ADVANCED_FIND); + m_openFindDialog = new QAction(tr("Open Advanced Find..."), this); + m_openFindDialog->setIconText(tr("Advanced...")); + cmd = ActionManager::registerAction(m_openFindDialog, Constants::ADVANCED_FIND); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F"))); mfindadvanced->addAction(cmd); - connect(d->m_openFindDialog, &QAction::triggered, - this, &FindPlugin::openFindFilter); + connect(m_openFindDialog, &QAction::triggered, + this, [this] { openFindFilter(m_openFindDialog); }); } -void FindPlugin::setupFilterMenuItems() +void FindPrivate::setupFilterMenuItems() { QList<IFindFilter*> findInterfaces = ExtensionSystem::PluginManager::getObjects<IFindFilter>(); Command *cmd; @@ -252,111 +248,111 @@ void FindPlugin::setupFilterMenuItems() cmd->setAttribute(Command::CA_UpdateText); mfindadvanced->addAction(cmd); d->m_filterActions.insert(filter, action); - connect(action, &QAction::triggered, this, &FindPlugin::openFindFilter); - connect(filter, &IFindFilter::enabledChanged, this, &FindPlugin::filterChanged); - connect(filter, &IFindFilter::displayNameChanged, this, &FindPlugin::displayNameChanged); + connect(action, &QAction::triggered, this, [action] { d->openFindFilter(action); }); + connect(filter, &IFindFilter::enabledChanged, this, [filter] { d->filterChanged(filter); }); + connect(filter, &IFindFilter::displayNameChanged, this, [filter] { d->displayNameChanged(filter); }); } d->m_findDialog->setFindFilters(sortedFilters); d->m_openFindDialog->setEnabled(haveEnabledFilters); } -FindFlags FindPlugin::findFlags() const +FindFlags Find::findFlags() { return d->m_findFlags; } -void FindPlugin::setCaseSensitive(bool sensitive) +void Find::setCaseSensitive(bool sensitive) { - setFindFlag(FindCaseSensitively, sensitive); + d->setFindFlag(FindCaseSensitively, sensitive); } -void FindPlugin::setWholeWord(bool wholeOnly) +void Find::setWholeWord(bool wholeOnly) { - setFindFlag(FindWholeWords, wholeOnly); + d->setFindFlag(FindWholeWords, wholeOnly); } -void FindPlugin::setBackward(bool backward) +void Find::setBackward(bool backward) { - setFindFlag(FindBackward, backward); + d->setFindFlag(FindBackward, backward); } -void FindPlugin::setRegularExpression(bool regExp) +void Find::setRegularExpression(bool regExp) { - setFindFlag(FindRegularExpression, regExp); + d->setFindFlag(FindRegularExpression, regExp); } -void FindPlugin::setPreserveCase(bool preserveCase) +void Find::setPreserveCase(bool preserveCase) { - setFindFlag(FindPreserveCase, preserveCase); + d->setFindFlag(FindPreserveCase, preserveCase); } -void FindPlugin::setFindFlag(FindFlag flag, bool enabled) +void FindPrivate::setFindFlag(FindFlag flag, bool enabled) { - bool hasFlag = hasFindFlag(flag); + bool hasFlag = m_findFlags & flag; if ((hasFlag && enabled) || (!hasFlag && !enabled)) return; if (enabled) - d->m_findFlags |= flag; + m_findFlags |= flag; else - d->m_findFlags &= ~flag; + m_findFlags &= ~flag; if (flag != FindBackward) - emit findFlagsChanged(); + emit m_instance->findFlagsChanged(); } -bool FindPlugin::hasFindFlag(FindFlag flag) +bool Find::hasFindFlag(FindFlag flag) { return d->m_findFlags & flag; } -void FindPlugin::writeSettings() +void FindPrivate::writeSettings() { QSettings *settings = ICore::settings(); settings->beginGroup(QLatin1String("Find")); - settings->setValue(QLatin1String("Backward"), hasFindFlag(FindBackward)); - settings->setValue(QLatin1String("CaseSensitively"), hasFindFlag(FindCaseSensitively)); - settings->setValue(QLatin1String("WholeWords"), hasFindFlag(FindWholeWords)); - settings->setValue(QLatin1String("RegularExpression"), hasFindFlag(FindRegularExpression)); - settings->setValue(QLatin1String("PreserveCase"), hasFindFlag(FindPreserveCase)); - settings->setValue(QLatin1String("FindStrings"), d->m_findCompletions); - settings->setValue(QLatin1String("ReplaceStrings"), d->m_replaceCompletions); + settings->setValue(QLatin1String("Backward"), bool(m_findFlags & FindBackward)); + settings->setValue(QLatin1String("CaseSensitively"), bool(m_findFlags & FindCaseSensitively)); + settings->setValue(QLatin1String("WholeWords"), bool(m_findFlags & FindWholeWords)); + settings->setValue(QLatin1String("RegularExpression"), bool(m_findFlags & FindRegularExpression)); + settings->setValue(QLatin1String("PreserveCase"), bool(m_findFlags & FindPreserveCase)); + settings->setValue(QLatin1String("FindStrings"), m_findCompletions); + settings->setValue(QLatin1String("ReplaceStrings"), m_replaceCompletions); settings->endGroup(); - d->m_findToolBar->writeSettings(); - d->m_findDialog->writeSettings(); - d->m_searchResultWindow->writeSettings(); + m_findToolBar->writeSettings(); + m_findDialog->writeSettings(); + m_searchResultWindow->writeSettings(); } -void FindPlugin::readSettings() +void FindPrivate::readSettings() { QSettings *settings = ICore::settings(); settings->beginGroup(QLatin1String("Find")); - bool block = blockSignals(true); - setBackward(settings->value(QLatin1String("Backward"), false).toBool()); - setCaseSensitive(settings->value(QLatin1String("CaseSensitively"), false).toBool()); - setWholeWord(settings->value(QLatin1String("WholeWords"), false).toBool()); - setRegularExpression(settings->value(QLatin1String("RegularExpression"), false).toBool()); - setPreserveCase(settings->value(QLatin1String("PreserveCase"), false).toBool()); - blockSignals(block); - d->m_findCompletions = settings->value(QLatin1String("FindStrings")).toStringList(); - d->m_replaceCompletions = settings->value(QLatin1String("ReplaceStrings")).toStringList(); - d->m_findCompletionModel->setStringList(d->m_findCompletions); - d->m_replaceCompletionModel->setStringList(d->m_replaceCompletions); + bool block = m_instance->blockSignals(true); + Find::setBackward(settings->value(QLatin1String("Backward"), false).toBool()); + Find::setCaseSensitive(settings->value(QLatin1String("CaseSensitively"), false).toBool()); + Find::setWholeWord(settings->value(QLatin1String("WholeWords"), false).toBool()); + Find::setRegularExpression(settings->value(QLatin1String("RegularExpression"), false).toBool()); + Find::setPreserveCase(settings->value(QLatin1String("PreserveCase"), false).toBool()); + m_instance->blockSignals(block); + m_findCompletions = settings->value(QLatin1String("FindStrings")).toStringList(); + m_replaceCompletions = settings->value(QLatin1String("ReplaceStrings")).toStringList(); + m_findCompletionModel.setStringList(m_findCompletions); + m_replaceCompletionModel.setStringList(m_replaceCompletions); settings->endGroup(); - d->m_findToolBar->readSettings(); - d->m_findDialog->readSettings(); - emit findFlagsChanged(); // would have been done in the setXXX methods above + m_findToolBar->readSettings(); + m_findDialog->readSettings(); + emit m_instance->findFlagsChanged(); // would have been done in the setXXX methods above } -void FindPlugin::updateFindCompletion(const QString &text) +void Find::updateFindCompletion(const QString &text) { - updateCompletion(text, d->m_findCompletions, d->m_findCompletionModel); + d->updateCompletion(text, d->m_findCompletions, &d->m_findCompletionModel); } -void FindPlugin::updateReplaceCompletion(const QString &text) +void Find::updateReplaceCompletion(const QString &text) { - updateCompletion(text, d->m_replaceCompletions, d->m_replaceCompletionModel); + d->updateCompletion(text, d->m_replaceCompletions, &d->m_replaceCompletionModel); } -void FindPlugin::updateCompletion(const QString &text, QStringList &completions, QStringListModel *model) +void FindPrivate::updateCompletion(const QString &text, QStringList &completions, QStringListModel *model) { if (text.isEmpty()) return; @@ -367,13 +363,13 @@ void FindPlugin::updateCompletion(const QString &text, QStringList &completions, model->setStringList(completions); } -void FindPlugin::setUseFakeVim(bool on) +void Find::setUseFakeVim(bool on) { if (d->m_findToolBar) d->m_findToolBar->setUseFakeVim(on); } -void FindPlugin::openFindToolBar(FindDirection direction) +void Find::openFindToolBar(FindDirection direction) { if (d->m_findToolBar) { d->m_findToolBar->setBackward(direction == FindBackwardDirection); @@ -381,14 +377,14 @@ void FindPlugin::openFindToolBar(FindDirection direction) } } -QStringListModel *FindPlugin::findCompletionModel() const +QStringListModel *Find::findCompletionModel() { - return d->m_findCompletionModel; + return &(d->m_findCompletionModel); } -QStringListModel *FindPlugin::replaceCompletionModel() const +QStringListModel *Find::replaceCompletionModel() { - return d->m_replaceCompletionModel; + return &(d->m_replaceCompletionModel); } QKeySequence IFindFilter::defaultShortcut() const diff --git a/src/plugins/coreplugin/find/findplugin.h b/src/plugins/coreplugin/find/findplugin.h index 1399c48170..ecb33175e9 100644 --- a/src/plugins/coreplugin/find/findplugin.h +++ b/src/plugins/coreplugin/find/findplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDPLUGIN_H -#define FINDPLUGIN_H +#pragma once #include "textfindconstants.h" @@ -36,68 +35,45 @@ QT_END_NAMESPACE namespace Core { class IFindFilter; -class FindPluginPrivate; +namespace Internal { class CorePlugin; } -namespace Internal { -class CorePlugin; -class FindToolBar; -class CurrentDocumentFind; -} // namespace Internal - -class CORE_EXPORT FindPlugin : public QObject +class CORE_EXPORT Find : public QObject { Q_OBJECT public: - FindPlugin(); - virtual ~FindPlugin(); - - static FindPlugin *instance(); + static Find *instance(); enum FindDirection { FindForwardDirection, FindBackwardDirection }; - FindFlags findFlags() const; - bool hasFindFlag(FindFlag flag); - void updateFindCompletion(const QString &text); - void updateReplaceCompletion(const QString &text); - QStringListModel *findCompletionModel() const; - QStringListModel *replaceCompletionModel() const; - void setUseFakeVim(bool on); - void openFindToolBar(FindDirection direction); - void openFindDialog(IFindFilter *filter); - - void initialize(const QStringList &, QString *); - void extensionsInitialized(); - void aboutToShutdown(); - -public slots: - void setCaseSensitive(bool sensitive); - void setWholeWord(bool wholeOnly); - void setBackward(bool backward); - void setRegularExpression(bool regExp); - void setPreserveCase(bool preserveCase); + static FindFlags findFlags(); + static bool hasFindFlag(FindFlag flag); + static void updateFindCompletion(const QString &text); + static void updateReplaceCompletion(const QString &text); + static QStringListModel *findCompletionModel(); + static QStringListModel *replaceCompletionModel(); + static void setUseFakeVim(bool on); + static void openFindToolBar(FindDirection direction); + static void openFindDialog(IFindFilter *filter); + + static void setCaseSensitive(bool sensitive); + static void setWholeWord(bool wholeOnly); + static void setBackward(bool backward); + static void setRegularExpression(bool regExp); + static void setPreserveCase(bool preserveCase); signals: void findFlagsChanged(); private: - void filterChanged(); - void displayNameChanged(); - void openFindFilter(); - void writeSettings(); - void setFindFlag(Core::FindFlag flag, bool enabled); - void updateCompletion(const QString &text, QStringList &completions, QStringListModel *model); - void setupMenu(); - void setupFilterMenuItems(); - void readSettings(); - - //variables - FindPluginPrivate *d; + friend class Internal::CorePlugin; + static void initialize(); + static void extensionsInitialized(); + static void aboutToShutdown(); + static void destroy(); }; } // namespace Core - -#endif // FINDPLUGIN_H diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index 5d5cda35fe..7144f2e47e 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -63,9 +63,8 @@ static const int FINDBUTTON_SPACER_WIDTH = 20; namespace Core { namespace Internal { -FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumentFind) - : m_plugin(plugin), - m_currentDocumentFind(currentDocumentFind), +FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind) + : m_currentDocumentFind(currentDocumentFind), m_findCompleter(new QCompleter(this)), m_replaceCompleter(new QCompleter(this)), m_findIncrementalTimer(this), @@ -91,8 +90,8 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen connect(m_ui.close, &QToolButton::clicked, this, &FindToolBar::hideAndResetFocus); - m_findCompleter->setModel(m_plugin->findCompletionModel()); - m_replaceCompleter->setModel(m_plugin->replaceCompletionModel()); + m_findCompleter->setModel(Find::findCompletionModel()); + m_replaceCompleter->setModel(Find::replaceCompletionModel()); m_ui.findEdit->setSpecialCompleter(m_findCompleter); m_ui.replaceEdit->setSpecialCompleter(m_replaceCompleter); @@ -529,7 +528,7 @@ void FindToolBar::invokeFindStep() m_findStepTimer.stop(); m_findIncrementalTimer.stop(); if (m_currentDocumentFind->isEnabled()) { - m_plugin->updateFindCompletion(getFindText()); + Find::updateFindCompletion(getFindText()); IFindSupport::Result result = m_currentDocumentFind->findStep(getFindText(), effectiveFindFlags()); indicateSearchState(result); @@ -558,8 +557,8 @@ void FindToolBar::invokeReplace() { setFindFlag(FindBackward, false); if (m_currentDocumentFind->isEnabled() && m_currentDocumentFind->supportsReplace()) { - m_plugin->updateFindCompletion(getFindText()); - m_plugin->updateReplaceCompletion(getReplaceText()); + Find::updateFindCompletion(getFindText()); + Find::updateReplaceCompletion(getReplaceText()); m_currentDocumentFind->replace(getFindText(), getReplaceText(), effectiveFindFlags()); } } @@ -597,16 +596,16 @@ void FindToolBar::invokeGlobalReplacePrevious() void FindToolBar::invokeReplaceStep() { if (m_currentDocumentFind->isEnabled() && m_currentDocumentFind->supportsReplace()) { - m_plugin->updateFindCompletion(getFindText()); - m_plugin->updateReplaceCompletion(getReplaceText()); + Find::updateFindCompletion(getFindText()); + Find::updateReplaceCompletion(getReplaceText()); m_currentDocumentFind->replaceStep(getFindText(), getReplaceText(), effectiveFindFlags()); } } void FindToolBar::invokeReplaceAll() { - m_plugin->updateFindCompletion(getFindText()); - m_plugin->updateReplaceCompletion(getReplaceText()); + Find::updateFindCompletion(getFindText()); + Find::updateReplaceCompletion(getReplaceText()); if (m_currentDocumentFind->isEnabled() && m_currentDocumentFind->supportsReplace()) m_currentDocumentFind->replaceAll(getFindText(), getReplaceText(), effectiveFindFlags()); } diff --git a/src/plugins/coreplugin/find/findtoolbar.h b/src/plugins/coreplugin/find/findtoolbar.h index 20a87c353c..8407645a45 100644 --- a/src/plugins/coreplugin/find/findtoolbar.h +++ b/src/plugins/coreplugin/find/findtoolbar.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDTOOLBAR_H -#define FINDTOOLBAR_H +#pragma once #include "ui_findwidget.h" #include "currentdocumentfind.h" @@ -41,7 +40,6 @@ QT_END_NAMESPACE namespace Core { class FindToolBarPlaceHolder; -class FindPlugin; namespace Internal { @@ -78,7 +76,7 @@ public: }; Q_DECLARE_FLAGS(OpenFlags, OpenFlag) - explicit FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumentFind); + explicit FindToolBar(CurrentDocumentFind *currentDocumentFind); ~FindToolBar(); void readSettings(); @@ -156,7 +154,6 @@ private: void updateIcons(); void updateFlagMenus(); - FindPlugin *m_plugin = nullptr; CurrentDocumentFind *m_currentDocumentFind = nullptr; Ui::FindWidget m_ui; QCompleter *m_findCompleter = nullptr; @@ -195,5 +192,3 @@ private: } // namespace Internal } // namespace Core - -#endif // FINDTOOLBAR_H diff --git a/src/plugins/coreplugin/find/findtoolwindow.cpp b/src/plugins/coreplugin/find/findtoolwindow.cpp index 13cca28e05..de0beddc15 100644 --- a/src/plugins/coreplugin/find/findtoolwindow.cpp +++ b/src/plugins/coreplugin/find/findtoolwindow.cpp @@ -42,9 +42,8 @@ using namespace Core::Internal; static FindToolWindow *m_instance = 0; -FindToolWindow::FindToolWindow(FindPlugin *plugin, QWidget *parent) +FindToolWindow::FindToolWindow(QWidget *parent) : QWidget(parent), - m_plugin(plugin), m_findCompleter(new QCompleter(this)), m_currentFilter(0), m_configWidget(0) @@ -57,14 +56,14 @@ FindToolWindow::FindToolWindow(FindPlugin *plugin, QWidget *parent) connect(m_ui.searchButton, &QAbstractButton::clicked, this, &FindToolWindow::search); connect(m_ui.replaceButton, &QAbstractButton::clicked, this, &FindToolWindow::replace); - connect(m_ui.matchCase, &QAbstractButton::toggled, m_plugin, &FindPlugin::setCaseSensitive); - connect(m_ui.wholeWords, &QAbstractButton::toggled, m_plugin, &FindPlugin::setWholeWord); - connect(m_ui.regExp, &QAbstractButton::toggled, m_plugin, &FindPlugin::setRegularExpression); + connect(m_ui.matchCase, &QAbstractButton::toggled, Find::instance(), &Find::setCaseSensitive); + connect(m_ui.wholeWords, &QAbstractButton::toggled, Find::instance(), &Find::setWholeWord); + connect(m_ui.regExp, &QAbstractButton::toggled, Find::instance(), &Find::setRegularExpression); connect(m_ui.filterList, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, static_cast<void (FindToolWindow::*)(int)>(&FindToolWindow::setCurrentFilter)); connect(m_ui.searchTerm, &QLineEdit::textChanged, this, &FindToolWindow::updateButtonStates); - m_findCompleter->setModel(m_plugin->findCompletionModel()); + m_findCompleter->setModel(Find::findCompletionModel()); m_ui.searchTerm->setSpecialCompleter(m_findCompleter); m_ui.searchTerm->installEventFilter(this); QVBoxLayout *layout = new QVBoxLayout; @@ -73,7 +72,7 @@ FindToolWindow::FindToolWindow(FindPlugin *plugin, QWidget *parent) m_ui.configWidget->setLayout(layout); updateButtonStates(); - connect(m_plugin, &FindPlugin::findFlagsChanged, this, &FindToolWindow::updateFindFlags); + connect(Find::instance(), &Find::findFlagsChanged, this, &FindToolWindow::updateFindFlags); } FindToolWindow::~FindToolWindow() @@ -135,9 +134,9 @@ void FindToolWindow::updateButtonStates() void FindToolWindow::updateFindFlags() { - m_ui.matchCase->setChecked(m_plugin->hasFindFlag(FindCaseSensitively)); - m_ui.wholeWords->setChecked(m_plugin->hasFindFlag(FindWholeWords)); - m_ui.regExp->setChecked(m_plugin->hasFindFlag(FindRegularExpression)); + m_ui.matchCase->setChecked(Find::hasFindFlag(FindCaseSensitively)); + m_ui.wholeWords->setChecked(Find::hasFindFlag(FindWholeWords)); + m_ui.regExp->setChecked(Find::hasFindFlag(FindRegularExpression)); } @@ -223,7 +222,7 @@ void FindToolWindow::acceptAndGetParameters(QString *term, IFindFilter **filter) { if (filter) *filter = 0; - m_plugin->updateFindCompletion(m_ui.searchTerm->text()); + Find::updateFindCompletion(m_ui.searchTerm->text()); int index = m_ui.filterList->currentIndex(); QString searchTerm = m_ui.searchTerm->text(); if (term) @@ -240,7 +239,7 @@ void FindToolWindow::search() IFindFilter *filter = 0; acceptAndGetParameters(&term, &filter); QTC_ASSERT(filter, return); - filter->findAll(term, m_plugin->findFlags()); + filter->findAll(term, Find::findFlags()); } void FindToolWindow::replace() @@ -249,7 +248,7 @@ void FindToolWindow::replace() IFindFilter *filter = 0; acceptAndGetParameters(&term, &filter); QTC_ASSERT(filter, return); - filter->replaceAll(term, m_plugin->findFlags()); + filter->replaceAll(term, Find::findFlags()); } void FindToolWindow::writeSettings() diff --git a/src/plugins/coreplugin/find/findtoolwindow.h b/src/plugins/coreplugin/find/findtoolwindow.h index 3c27210b7b..641c29d2e7 100644 --- a/src/plugins/coreplugin/find/findtoolwindow.h +++ b/src/plugins/coreplugin/find/findtoolwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDTOOLWINDOW_H -#define FINDTOOLWINDOW_H +#pragma once #include "ui_finddialog.h" #include "findplugin.h" @@ -43,7 +42,7 @@ class FindToolWindow : public QWidget Q_OBJECT public: - explicit FindToolWindow(FindPlugin *plugin, QWidget *parent = 0); + explicit FindToolWindow(QWidget *parent = 0); ~FindToolWindow(); static FindToolWindow *instance(); @@ -69,7 +68,6 @@ private: void acceptAndGetParameters(QString *term, IFindFilter **filter); Ui::FindDialog m_ui; - FindPlugin *m_plugin; QList<IFindFilter *> m_filters; QCompleter *m_findCompleter; QWidgetList m_configWidgets; @@ -79,5 +77,3 @@ private: } // namespace Internal } // namespace Core - -#endif // FINDTOOLWINDOW_H diff --git a/src/plugins/coreplugin/find/highlightscrollbar.h b/src/plugins/coreplugin/find/highlightscrollbar.h index f8ae3c1667..d049e9b49f 100644 --- a/src/plugins/coreplugin/find/highlightscrollbar.h +++ b/src/plugins/coreplugin/find/highlightscrollbar.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HIGHLIGHTSCROLLBAR_H -#define HIGHLIGHTSCROLLBAR_H +#pragma once #include <QMap> #include <QScrollBar> @@ -116,5 +115,3 @@ private: }; } // namespace Core - -#endif // HIGHLIGHTSCROLLBAR_H diff --git a/src/plugins/coreplugin/find/ifindfilter.h b/src/plugins/coreplugin/find/ifindfilter.h index bf1cd751be..14396f59d4 100644 --- a/src/plugins/coreplugin/find/ifindfilter.h +++ b/src/plugins/coreplugin/find/ifindfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IFINDFILTER_H -#define IFINDFILTER_H +#pragma once #include "textfindconstants.h" @@ -69,5 +68,3 @@ signals: }; } // namespace Core - -#endif // IFINDFILTER_H diff --git a/src/plugins/coreplugin/find/ifindsupport.h b/src/plugins/coreplugin/find/ifindsupport.h index 4861b9aefa..18a2762784 100644 --- a/src/plugins/coreplugin/find/ifindsupport.h +++ b/src/plugins/coreplugin/find/ifindsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IFINDSUPPORT_H -#define IFINDSUPPORT_H +#pragma once #include "textfindconstants.h" @@ -72,5 +71,3 @@ signals: inline void IFindSupport::highlightAll(const QString &, FindFlags) {} } // namespace Core - -#endif // IFINDSUPPORT_H diff --git a/src/plugins/coreplugin/find/itemviewfind.h b/src/plugins/coreplugin/find/itemviewfind.h index c25e9029ea..dad9089dc5 100644 --- a/src/plugins/coreplugin/find/itemviewfind.h +++ b/src/plugins/coreplugin/find/itemviewfind.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ITEMVIEWFIND_H -#define ITEMVIEWFIND_H +#pragma once #include "ifindsupport.h" @@ -81,5 +80,3 @@ private: }; } // namespace Core - -#endif // ITEMVIEWFIND_H diff --git a/src/plugins/coreplugin/find/searchresultcolor.h b/src/plugins/coreplugin/find/searchresultcolor.h index 67b88af269..51da45b9ca 100644 --- a/src/plugins/coreplugin/find/searchresultcolor.h +++ b/src/plugins/coreplugin/find/searchresultcolor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SEARCHRESULTCOLOR_H -#define SEARCHRESULTCOLOR_H +#pragma once #include <QColor> @@ -41,5 +40,3 @@ public: } // namespace Internal } // namespace Core - -#endif // SEARCHRESULTCOLOR_H diff --git a/src/plugins/coreplugin/find/searchresulttreeitemdelegate.h b/src/plugins/coreplugin/find/searchresulttreeitemdelegate.h index 8e4560c9bd..99e05c2248 100644 --- a/src/plugins/coreplugin/find/searchresulttreeitemdelegate.h +++ b/src/plugins/coreplugin/find/searchresulttreeitemdelegate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SEARCHRESULTTREEITEMDELEGATE_H -#define SEARCHRESULTTREEITEMDELEGATE_H +#pragma once #include <QItemDelegate> @@ -49,5 +48,3 @@ private: } // namespace Internal } // namespace Core - -#endif // SEARCHRESULTTREEITEMDELEGATE_H diff --git a/src/plugins/coreplugin/find/searchresulttreeitemroles.h b/src/plugins/coreplugin/find/searchresulttreeitemroles.h index aa504983d3..4563e316b1 100644 --- a/src/plugins/coreplugin/find/searchresulttreeitemroles.h +++ b/src/plugins/coreplugin/find/searchresulttreeitemroles.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SEARCHRESULTTREEITEMROLES_H -#define SEARCHRESULTTREEITEMROLES_H +#pragma once #include <QAbstractItemView> @@ -48,5 +47,3 @@ enum Roles } // namespace Internal } // namespace Core } // namespace ItemDataRoles - -#endif // SEARCHRESULTTREEITEMROLES_H diff --git a/src/plugins/coreplugin/find/searchresulttreeitems.h b/src/plugins/coreplugin/find/searchresulttreeitems.h index 81fee12b86..1709bc11d0 100644 --- a/src/plugins/coreplugin/find/searchresulttreeitems.h +++ b/src/plugins/coreplugin/find/searchresulttreeitems.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SEARCHRESULTTREEITEMS_H -#define SEARCHRESULTTREEITEMS_H +#pragma once #include "searchresultwindow.h" @@ -70,5 +69,3 @@ private: } // namespace Internal } // namespace Core - -#endif // SEARCHRESULTTREEITEMS_H diff --git a/src/plugins/coreplugin/find/searchresulttreemodel.h b/src/plugins/coreplugin/find/searchresulttreemodel.h index bbc69b078f..08237db837 100644 --- a/src/plugins/coreplugin/find/searchresulttreemodel.h +++ b/src/plugins/coreplugin/find/searchresulttreemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SEARCHRESULTTREEMODEL_H -#define SEARCHRESULTTREEMODEL_H +#pragma once #include "searchresultwindow.h" #include "searchresultcolor.h" @@ -91,5 +90,3 @@ private: } // namespace Internal } // namespace Core - -#endif // SEARCHRESULTTREEMODEL_H diff --git a/src/plugins/coreplugin/find/searchresulttreeview.h b/src/plugins/coreplugin/find/searchresulttreeview.h index c8d6d15aca..bf80cba1ad 100644 --- a/src/plugins/coreplugin/find/searchresulttreeview.h +++ b/src/plugins/coreplugin/find/searchresulttreeview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SEARCHRESULTTREEVIEW_H -#define SEARCHRESULTTREEVIEW_H +#pragma once #include "searchresultwindow.h" @@ -64,5 +63,3 @@ protected: } // namespace Internal } // namespace Core - -#endif // SEARCHRESULTTREEVIEW_H diff --git a/src/plugins/coreplugin/find/searchresultwidget.cpp b/src/plugins/coreplugin/find/searchresultwidget.cpp index b2dba922f7..8d002d35b3 100644 --- a/src/plugins/coreplugin/find/searchresultwidget.cpp +++ b/src/plugins/coreplugin/find/searchresultwidget.cpp @@ -185,10 +185,8 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) : m_preserveCaseCheck->setText(tr("Preserve case")); m_preserveCaseCheck->setEnabled(false); - if (FindPlugin * plugin = FindPlugin::instance()) { - m_preserveCaseCheck->setChecked(plugin->hasFindFlag(FindPreserveCase)); - connect(m_preserveCaseCheck, &QAbstractButton::clicked, plugin, &FindPlugin::setPreserveCase); - } + m_preserveCaseCheck->setChecked(Find::hasFindFlag(FindPreserveCase)); + connect(m_preserveCaseCheck, &QAbstractButton::clicked, Find::instance(), &Find::setPreserveCase); m_matchesFoundLabel = new QLabel(topFindWidget); updateMatchesFoundLabel(); diff --git a/src/plugins/coreplugin/find/searchresultwidget.h b/src/plugins/coreplugin/find/searchresultwidget.h index 2a671b1dee..ef9961f3d8 100644 --- a/src/plugins/coreplugin/find/searchresultwidget.h +++ b/src/plugins/coreplugin/find/searchresultwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SEARCHRESULTWIDGET_H -#define SEARCHRESULTWIDGET_H +#pragma once #include "searchresultwindow.h" @@ -142,5 +141,3 @@ private: } // Internal } // Find - -#endif // SEARCHRESULTWIDGET_H diff --git a/src/plugins/coreplugin/find/searchresultwindow.h b/src/plugins/coreplugin/find/searchresultwindow.h index 6cb6800a1b..8a7e1b918f 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.h +++ b/src/plugins/coreplugin/find/searchresultwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SEARCHRESULTWINDOW_H -#define SEARCHRESULTWINDOW_H +#pragma once #include <coreplugin/ioutputpane.h> @@ -42,7 +41,7 @@ namespace Internal { class SearchResultWindowPrivate; class SearchResultWidget; } -class FindPlugin; +class Find; class SearchResultWindow; class CORE_EXPORT SearchResultItem @@ -194,5 +193,3 @@ private: } // namespace Core Q_DECLARE_METATYPE(Core::SearchResultItem) - -#endif // SEARCHRESULTWINDOW_H diff --git a/src/plugins/coreplugin/find/textfindconstants.h b/src/plugins/coreplugin/find/textfindconstants.h index 22eed71a78..d670abd0f0 100644 --- a/src/plugins/coreplugin/find/textfindconstants.h +++ b/src/plugins/coreplugin/find/textfindconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTFINDCONSTANTS_H -#define TEXTFINDCONSTANTS_H +#pragma once #include <coreplugin/core_global.h> @@ -78,5 +77,3 @@ QTextDocument::FindFlags CORE_EXPORT textDocumentFlagsForFindFlags(FindFlags fla Q_DECLARE_OPERATORS_FOR_FLAGS(Core::FindFlags) Q_DECLARE_METATYPE(Core::FindFlags) - -#endif // TEXTFINDCONSTANTS_H diff --git a/src/plugins/coreplugin/findplaceholder.h b/src/plugins/coreplugin/findplaceholder.h index 90afde4b02..4073354dc1 100644 --- a/src/plugins/coreplugin/findplaceholder.h +++ b/src/plugins/coreplugin/findplaceholder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDPLACEHOLDER_H -#define FINDPLACEHOLDER_H +#pragma once #include "core_global.h" @@ -59,5 +58,3 @@ private: }; } // namespace Core - -#endif // FINDPLACEHOLDER_H diff --git a/src/plugins/coreplugin/generalsettings.h b/src/plugins/coreplugin/generalsettings.h index 5fbcaab636..584048bf72 100644 --- a/src/plugins/coreplugin/generalsettings.h +++ b/src/plugins/coreplugin/generalsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GENERALSETTINGS_H -#define GENERALSETTINGS_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> #include <QPointer> @@ -65,5 +64,3 @@ private: } // namespace Internal } // namespace Core - -#endif // GENERALSETTINGS_H diff --git a/src/plugins/coreplugin/generatedfile.h b/src/plugins/coreplugin/generatedfile.h index de0b8b5e26..9fb2815837 100644 --- a/src/plugins/coreplugin/generatedfile.h +++ b/src/plugins/coreplugin/generatedfile.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CORE_GENERATEDFILE_H -#define CORE_GENERATEDFILE_H +#pragma once #include "coreplugin/id.h" @@ -88,5 +87,3 @@ private: typedef QList<GeneratedFile> GeneratedFiles; } // namespace Core - -#endif // CORE_GENERATEDFILE_H diff --git a/src/plugins/coreplugin/helpmanager.h b/src/plugins/coreplugin/helpmanager.h index 3d2bc7be80..07b22cbe9e 100644 --- a/src/plugins/coreplugin/helpmanager.h +++ b/src/plugins/coreplugin/helpmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HELPMANAGER_H -#define HELPMANAGER_H +#pragma once #include "core_global.h" @@ -109,5 +108,3 @@ private: }; } // Core - -#endif // HELPMANAGER_H diff --git a/src/plugins/coreplugin/icontext.h b/src/plugins/coreplugin/icontext.h index 35deb2c6ea..b2153656a7 100644 --- a/src/plugins/coreplugin/icontext.h +++ b/src/plugins/coreplugin/icontext.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ICONTEXT_H -#define ICONTEXT_H +#pragma once #include <coreplugin/core_global.h> #include <coreplugin/id.h> @@ -85,5 +84,3 @@ protected: }; } // namespace Core - -#endif //ICONTEXT_H diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index 6dd3561713..5bba154fd0 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ICORE_H -#define ICORE_H +#pragma once #include "core_global.h" #include "id.h" @@ -156,5 +155,3 @@ private: }; } // namespace Core - -#endif // ICORE_H diff --git a/src/plugins/coreplugin/id.h b/src/plugins/coreplugin/id.h index 1450592cf9..af56c32b10 100644 --- a/src/plugins/coreplugin/id.h +++ b/src/plugins/coreplugin/id.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CORE_ID_H -#define CORE_ID_H +#pragma once #include "core_global.h" @@ -92,5 +91,3 @@ QDataStream &operator<<(QDataStream &ds, Core::Id id); QDataStream &operator>>(QDataStream &ds, Core::Id &id); CORE_EXPORT QDebug operator<<(QDebug dbg, const Core::Id &id); QT_END_NAMESPACE - -#endif // CORE_ID_H diff --git a/src/plugins/coreplugin/idocument.h b/src/plugins/coreplugin/idocument.h index 72a3dd4333..40cd861fa5 100644 --- a/src/plugins/coreplugin/idocument.h +++ b/src/plugins/coreplugin/idocument.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IDOCUMENT_H -#define IDOCUMENT_H +#pragma once #include "core_global.h" @@ -148,5 +147,3 @@ private: }; } // namespace Core - -#endif // IDOCUMENT_H diff --git a/src/plugins/coreplugin/idocumentfactory.h b/src/plugins/coreplugin/idocumentfactory.h index 6b507107d0..518cb23f1f 100644 --- a/src/plugins/coreplugin/idocumentfactory.h +++ b/src/plugins/coreplugin/idocumentfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IDOCUMENTFACTORY_H -#define IDOCUMENTFACTORY_H +#pragma once #include "id.h" @@ -62,5 +61,3 @@ private: }; } // namespace Core - -#endif // IDOCUMENTFACTORY_H diff --git a/src/plugins/coreplugin/ifilewizardextension.h b/src/plugins/coreplugin/ifilewizardextension.h index 79679b7265..2e788eb8c7 100644 --- a/src/plugins/coreplugin/ifilewizardextension.h +++ b/src/plugins/coreplugin/ifilewizardextension.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IFILEWIZARDEXTENSION_H -#define IFILEWIZARDEXTENSION_H +#pragma once #include <coreplugin/core_global.h> @@ -72,5 +71,3 @@ public slots: }; } // namespace Core - -#endif // IFILEWIZARDEXTENSION_H diff --git a/src/plugins/coreplugin/imode.h b/src/plugins/coreplugin/imode.h index 8cd9d558d8..cf745b4516 100644 --- a/src/plugins/coreplugin/imode.h +++ b/src/plugins/coreplugin/imode.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IMODE_H -#define IMODE_H +#pragma once #include "icontext.h" #include "id.h" @@ -65,5 +64,3 @@ private: }; } // namespace Core - -#endif // IMODE_H diff --git a/src/plugins/coreplugin/inavigationwidgetfactory.h b/src/plugins/coreplugin/inavigationwidgetfactory.h index 245c084a68..940e0543b2 100644 --- a/src/plugins/coreplugin/inavigationwidgetfactory.h +++ b/src/plugins/coreplugin/inavigationwidgetfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INAVIGATIONWIDGET_H -#define INAVIGATIONWIDGET_H +#pragma once #include "id.h" @@ -81,5 +80,3 @@ private: }; } // namespace Core - -#endif // INAVIGATIONWIDGET_H diff --git a/src/plugins/coreplugin/infobar.h b/src/plugins/coreplugin/infobar.h index e096e0e9db..8c2cc7f211 100644 --- a/src/plugins/coreplugin/infobar.h +++ b/src/plugins/coreplugin/infobar.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INFOBAR_H -#define INFOBAR_H +#pragma once #include "core_global.h" #include <coreplugin/id.h> @@ -120,5 +119,3 @@ private: }; } // namespace Core - -#endif // INFOBAR_H diff --git a/src/plugins/coreplugin/ioutputpane.h b/src/plugins/coreplugin/ioutputpane.h index e952d5136f..55d266b406 100644 --- a/src/plugins/coreplugin/ioutputpane.h +++ b/src/plugins/coreplugin/ioutputpane.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOUTPUTPANE_H -#define IOUTPUTPANE_H +#pragma once #include "core_global.h" @@ -88,5 +87,3 @@ signals: } // namespace Core Q_DECLARE_OPERATORS_FOR_FLAGS(Core::IOutputPane::Flags) - -#endif // IOUTPUTPANE_H diff --git a/src/plugins/coreplugin/iversioncontrol.h b/src/plugins/coreplugin/iversioncontrol.h index daaa860153..a78775bae3 100644 --- a/src/plugins/coreplugin/iversioncontrol.h +++ b/src/plugins/coreplugin/iversioncontrol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IVERSIONCONTROL_H -#define IVERSIONCONTROL_H +#pragma once #include "core_global.h" #include "id.h" @@ -264,6 +263,3 @@ private: } // namespace Core #endif - - -#endif // IVERSIONCONTROL_H diff --git a/src/plugins/coreplugin/iwelcomepage.h b/src/plugins/coreplugin/iwelcomepage.h index 465130e6a4..521af86f6a 100644 --- a/src/plugins/coreplugin/iwelcomepage.h +++ b/src/plugins/coreplugin/iwelcomepage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IWELCOMEPAGE_H -#define IWELCOMEPAGE_H +#pragma once #include "core_global.h" @@ -59,5 +58,3 @@ public: }; } // Core - -#endif // IWELCOMEPAGE_H diff --git a/src/plugins/coreplugin/iwizardfactory.h b/src/plugins/coreplugin/iwizardfactory.h index 2adb5be81b..7cf3cbcf8c 100644 --- a/src/plugins/coreplugin/iwizardfactory.h +++ b/src/plugins/coreplugin/iwizardfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IWIZARDFACTORY_H -#define IWIZARDFACTORY_H +#pragma once #include <coreplugin/core_global.h> #include <coreplugin/featureprovider.h> @@ -139,5 +138,3 @@ private: } // namespace Core Q_DECLARE_OPERATORS_FOR_FLAGS(Core::IWizardFactory::WizardFlags) - -#endif // IWIZARDFACTORY_H diff --git a/src/plugins/coreplugin/jsexpander.h b/src/plugins/coreplugin/jsexpander.h index f736cab651..dbffc8c159 100644 --- a/src/plugins/coreplugin/jsexpander.h +++ b/src/plugins/coreplugin/jsexpander.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSEXPANDER_H -#define JSEXPANDER_H +#pragma once #include "core_global.h" @@ -52,5 +51,3 @@ private: }; } // namespace Core - -#endif // JSEXPANDER_H diff --git a/src/plugins/coreplugin/locator/basefilefilter.h b/src/plugins/coreplugin/locator/basefilefilter.h index b472aadce4..16cfc45c71 100644 --- a/src/plugins/coreplugin/locator/basefilefilter.h +++ b/src/plugins/coreplugin/locator/basefilefilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASEFILEFILTER_H -#define BASEFILEFILTER_H +#pragma once #include "ilocatorfilter.h" @@ -85,5 +84,3 @@ private: }; } // namespace Core - -#endif // BASEFILEFILTER_H diff --git a/src/plugins/coreplugin/locator/commandlocator.h b/src/plugins/coreplugin/locator/commandlocator.h index bf18b6aee0..f9704fa43b 100644 --- a/src/plugins/coreplugin/locator/commandlocator.h +++ b/src/plugins/coreplugin/locator/commandlocator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMMANDLOCATOR_H -#define COMMANDLOCATOR_H +#pragma once #include "ilocatorfilter.h" @@ -55,5 +54,3 @@ private: }; } // namespace Core - -#endif // COMMANDLOCATOR_H diff --git a/src/plugins/coreplugin/locator/directoryfilter.h b/src/plugins/coreplugin/locator/directoryfilter.h index ae9dfdb3fd..e0c5d0c379 100644 --- a/src/plugins/coreplugin/locator/directoryfilter.h +++ b/src/plugins/coreplugin/locator/directoryfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIRECTORYFILTER_H -#define DIRECTORYFILTER_H +#pragma once #include "ui_directoryfilter.h" #include "basefilefilter.h" @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace Core - -#endif // DIRECTORYFILTER_H diff --git a/src/plugins/coreplugin/locator/executefilter.h b/src/plugins/coreplugin/locator/executefilter.h index 988bb9b44c..890468354e 100644 --- a/src/plugins/coreplugin/locator/executefilter.h +++ b/src/plugins/coreplugin/locator/executefilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXECUTEFILTER_H -#define EXECUTEFILTER_H +#pragma once #include "ilocatorfilter.h" @@ -73,5 +72,3 @@ private: } // namespace Internal } // namespace Core - -#endif // EXECUTEFILTER_H diff --git a/src/plugins/coreplugin/locator/externaltoolsfilter.h b/src/plugins/coreplugin/locator/externaltoolsfilter.h index 13b9a6e706..86ebf5f851 100644 --- a/src/plugins/coreplugin/locator/externaltoolsfilter.h +++ b/src/plugins/coreplugin/locator/externaltoolsfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXTERNALTOOLSFILTER_H -#define EXTERNALTOOLSFILTER_H +#pragma once #include "ilocatorfilter.h" @@ -49,5 +48,3 @@ private: } // namespace Internal } // namespace Core - -#endif // EXTERNALTOOLSFILTER_H diff --git a/src/plugins/coreplugin/locator/filesystemfilter.h b/src/plugins/coreplugin/locator/filesystemfilter.h index daa4c5c1ca..e7b7bdbc5a 100644 --- a/src/plugins/coreplugin/locator/filesystemfilter.h +++ b/src/plugins/coreplugin/locator/filesystemfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILESYSTEMFILTER_H -#define FILESYSTEMFILTER_H +#pragma once #include "ilocatorfilter.h" #include "ui_filesystemfilter.h" @@ -61,5 +60,3 @@ private: } // namespace Internal } // namespace Core - -#endif // FILESYSTEMFILTER_H diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.h b/src/plugins/coreplugin/locator/ilocatorfilter.h index e9051712cf..d2d083d8cb 100644 --- a/src/plugins/coreplugin/locator/ilocatorfilter.h +++ b/src/plugins/coreplugin/locator/ilocatorfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ILOCATORFILTER_H -#define ILOCATORFILTER_H +#pragma once #include <coreplugin/id.h> @@ -171,5 +170,3 @@ private: }; } // namespace Core - -#endif // ILOCATORFILTER_H diff --git a/src/plugins/coreplugin/locator/locator.cpp b/src/plugins/coreplugin/locator/locator.cpp index d9c8f56bdf..9d09fd76b5 100644 --- a/src/plugins/coreplugin/locator/locator.cpp +++ b/src/plugins/coreplugin/locator/locator.cpp @@ -312,7 +312,7 @@ void Locator::refresh(QList<ILocatorFilter *> filters) { if (filters.isEmpty()) filters = m_filters; - QFuture<void> task = Utils::map(filters, &ILocatorFilter::refresh); + QFuture<void> task = Utils::map(filters, &ILocatorFilter::refresh, Utils::MapReduceOption::Unordered); FutureProgress *progress = ProgressManager::addTask(task, tr("Updating Locator Caches"), Constants::TASK_INDEX); connect(progress, &FutureProgress::finished, this, &Locator::saveSettings); diff --git a/src/plugins/coreplugin/locator/locator.h b/src/plugins/coreplugin/locator/locator.h index c47dd2dc13..62b6d2b896 100644 --- a/src/plugins/coreplugin/locator/locator.h +++ b/src/plugins/coreplugin/locator/locator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LOCATORPLUGIN_H -#define LOCATORPLUGIN_H +#pragma once #include "ilocatorfilter.h" #include "directoryfilter.h" @@ -125,5 +124,3 @@ void Locator::loadSettingsHelper(S *settings) } // namespace Internal } // namespace Core - -#endif // LOCATORPLUGIN_H diff --git a/src/plugins/coreplugin/locator/locatorconstants.h b/src/plugins/coreplugin/locator/locatorconstants.h index 68c0bc7860..35faa771ce 100644 --- a/src/plugins/coreplugin/locator/locatorconstants.h +++ b/src/plugins/coreplugin/locator/locatorconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LOCATORCONSTANTS_H -#define LOCATORCONSTANTS_H +#pragma once #include <QtGlobal> @@ -38,5 +37,3 @@ const char TASK_INDEX[] = "Locator.Task.Index"; } // namespace Constants } // namespace Core - -#endif // LOCATORCONSTANTS_H diff --git a/src/plugins/coreplugin/locator/locatorfiltersfilter.h b/src/plugins/coreplugin/locator/locatorfiltersfilter.h index a6c77f3644..b0e8a1ba0a 100644 --- a/src/plugins/coreplugin/locator/locatorfiltersfilter.h +++ b/src/plugins/coreplugin/locator/locatorfiltersfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LOCATORFILTERSFILTER_H -#define LOCATORFILTERSFILTER_H +#pragma once #include "ilocatorfilter.h" @@ -64,5 +63,3 @@ private: } // namespace Internal } // namespace Core - -#endif // LOCATORFILTERSFILTER_H diff --git a/src/plugins/coreplugin/locator/locatorfiltertest.h b/src/plugins/coreplugin/locator/locatorfiltertest.h index e40df74332..c41d5ba23e 100644 --- a/src/plugins/coreplugin/locator/locatorfiltertest.h +++ b/src/plugins/coreplugin/locator/locatorfiltertest.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LOCATORFILTERTEST_H -#define LOCATORFILTERTEST_H +#pragma once #include "ilocatorfilter.h" @@ -86,5 +85,3 @@ template<> inline char *toString(const Core::Tests::ResultData &data) } // namespace QTest QT_END_NAMESPACE - -#endif // LOCATORFILTERTEST_H diff --git a/src/plugins/coreplugin/locator/locatormanager.h b/src/plugins/coreplugin/locator/locatormanager.h index 1946065ba9..f9edb89f90 100644 --- a/src/plugins/coreplugin/locator/locatormanager.h +++ b/src/plugins/coreplugin/locator/locatormanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LOCATORMANAGER_H -#define LOCATORMANAGER_H +#pragma once #include <coreplugin/core_global.h> @@ -46,5 +45,3 @@ public: }; } // namespace Core - -#endif // LOCATORMANAGER_H diff --git a/src/plugins/coreplugin/locator/locatorsearchutils.h b/src/plugins/coreplugin/locator/locatorsearchutils.h index 47bfdd4b69..cd2582f509 100644 --- a/src/plugins/coreplugin/locator/locatorsearchutils.h +++ b/src/plugins/coreplugin/locator/locatorsearchutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LOCATORSEARCHUTILS_H -#define LOCATORSEARCHUTILS_H +#pragma once #include "ilocatorfilter.h" @@ -37,6 +36,3 @@ void CORE_EXPORT runSearch(QFutureInterface<LocatorFilterEntry> &future, } // namespace Internal } // namespace Core - -#endif // LOCATORSEARCHUTILS_H - diff --git a/src/plugins/coreplugin/locator/locatorsettingspage.h b/src/plugins/coreplugin/locator/locatorsettingspage.h index e1648d9ad7..47cde6d5ad 100644 --- a/src/plugins/coreplugin/locator/locatorsettingspage.h +++ b/src/plugins/coreplugin/locator/locatorsettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LOCATORSETTINGSPAGE_H -#define LOCATORSETTINGSPAGE_H +#pragma once #include "ui_locatorsettingspage.h" @@ -91,5 +90,3 @@ private: } // namespace Internal } // namespace Core - -#endif // LOCATORSETTINGSPAGE_H diff --git a/src/plugins/coreplugin/locator/locatorwidget.h b/src/plugins/coreplugin/locator/locatorwidget.h index 0ff07166c2..876492fa06 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.h +++ b/src/plugins/coreplugin/locator/locatorwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LOCATORWIDGET_H -#define LOCATORWIDGET_H +#pragma once #include "locator.h" @@ -100,5 +99,3 @@ private: } // namespace Internal } // namespace Core - -#endif // LOCATORWIDGET_H diff --git a/src/plugins/coreplugin/locator/opendocumentsfilter.h b/src/plugins/coreplugin/locator/opendocumentsfilter.h index a4a9e49cbf..d676618331 100644 --- a/src/plugins/coreplugin/locator/opendocumentsfilter.h +++ b/src/plugins/coreplugin/locator/opendocumentsfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OPENDOCUMENTSFILTER_H -#define OPENDOCUMENTSFILTER_H +#pragma once #include "ilocatorfilter.h" @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace Core - -#endif // OPENDOCUMENTSFILTER_H diff --git a/src/plugins/coreplugin/locator/spotlightlocatorfilter.h b/src/plugins/coreplugin/locator/spotlightlocatorfilter.h index 6469ce24c0..0ce8c89230 100644 --- a/src/plugins/coreplugin/locator/spotlightlocatorfilter.h +++ b/src/plugins/coreplugin/locator/spotlightlocatorfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SPOTLIGHTLOCATORFILTER_H -#define SPOTLIGHTLOCATORFILTER_H +#pragma once #include "basefilefilter.h" @@ -42,6 +41,3 @@ public: } // Internal } // Core - -#endif // SPOTLIGHTLOCATORFILTER_H - diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index 0f1125f2f4..b2e374662d 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#pragma once #include "icontext.h" #include "icore.h" @@ -204,5 +203,3 @@ private: } // namespace Internal } // namespace Core - -#endif // MAINWINDOW_H diff --git a/src/plugins/coreplugin/manhattanstyle.h b/src/plugins/coreplugin/manhattanstyle.h index 2bdaabffc8..752aa08369 100644 --- a/src/plugins/coreplugin/manhattanstyle.h +++ b/src/plugins/coreplugin/manhattanstyle.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MANHATTANSTYLE_H -#define MANHATTANSTYLE_H +#pragma once #include "core_global.h" @@ -72,5 +71,3 @@ private: ManhattanStylePrivate *d; }; - -#endif // MANHATTANSTYLE_H diff --git a/src/plugins/coreplugin/messagebox.h b/src/plugins/coreplugin/messagebox.h index 3ced8ea3a5..b679636d1f 100644 --- a/src/plugins/coreplugin/messagebox.h +++ b/src/plugins/coreplugin/messagebox.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MESSAGEBOX_H -#define MESSAGEBOX_H +#pragma once #include "core_global.h" @@ -40,6 +39,3 @@ namespace AsynchronousMessageBox { CORE_EXPORT void critical(const QString &title, const QString &desciption); } } - -#endif // MESSAGEBOX_H - diff --git a/src/plugins/coreplugin/messagemanager.h b/src/plugins/coreplugin/messagemanager.h index 4ccdaae977..39daa4d138 100644 --- a/src/plugins/coreplugin/messagemanager.h +++ b/src/plugins/coreplugin/messagemanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MESSAGEMANAGER_H -#define MESSAGEMANAGER_H +#pragma once #include "core_global.h" #include "ioutputpane.h" @@ -71,5 +70,3 @@ private: } // namespace Core Q_DECLARE_METATYPE(Core::MessageManager::PrintToOutputPaneFlags) - -#endif // MESSAGEMANAGER_H diff --git a/src/plugins/coreplugin/messageoutputwindow.h b/src/plugins/coreplugin/messageoutputwindow.h index b926e028a2..bb301f0f0e 100644 --- a/src/plugins/coreplugin/messageoutputwindow.h +++ b/src/plugins/coreplugin/messageoutputwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MESSAGEOUTPUTWINDOW_H -#define MESSAGEOUTPUTWINDOW_H +#pragma once #include "ioutputpane.h" @@ -66,5 +65,3 @@ private: } // namespace Internal } // namespace Core - -#endif // MESSAGEOUTPUTWINDOW_H diff --git a/src/plugins/coreplugin/mimetypemagicdialog.h b/src/plugins/coreplugin/mimetypemagicdialog.h index ffba915ec0..5f5bf8bfe6 100644 --- a/src/plugins/coreplugin/mimetypemagicdialog.h +++ b/src/plugins/coreplugin/mimetypemagicdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MIMETYPEMAGICDIALOG_H -#define MIMETYPEMAGICDIALOG_H +#pragma once #include "ui_mimetypemagicdialog.h" @@ -82,5 +81,3 @@ private: } // Core Q_DECLARE_METATYPE(Core::Internal::MagicData) - -#endif // MIMETYPEMAGICDIALOG_H diff --git a/src/plugins/coreplugin/mimetypesettings.h b/src/plugins/coreplugin/mimetypesettings.h index fe4a075c2e..8153ecbb1b 100644 --- a/src/plugins/coreplugin/mimetypesettings.h +++ b/src/plugins/coreplugin/mimetypesettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MIMETYPESETTINGSPAGE_H -#define MIMETYPESETTINGSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -52,5 +51,3 @@ private: } // Internal } // Core - -#endif // MIMETYPESETTINGSPAGE_H diff --git a/src/plugins/coreplugin/minisplitter.h b/src/plugins/coreplugin/minisplitter.h index fd571b09fa..8679a8e836 100644 --- a/src/plugins/coreplugin/minisplitter.h +++ b/src/plugins/coreplugin/minisplitter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MINISPLITTER_H -#define MINISPLITTER_H +#pragma once #include "core_global.h" @@ -53,5 +52,3 @@ private: }; } // namespace Core - -#endif // MINISPLITTER_H diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index 55733e97f2..cbac31062d 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -115,15 +115,15 @@ ModeManager::~ModeManager() m_instance = 0; } -IMode *ModeManager::currentMode() +Id ModeManager::currentMode() { int currentIndex = d->m_modeStack->currentIndex(); if (currentIndex < 0) - return 0; - return d->m_modes.at(currentIndex); + return Id(); + return d->m_modes.at(currentIndex)->id(); } -IMode *ModeManager::mode(Id id) +static IMode *findMode(Id id) { const int index = indexOf(id); if (index >= 0) @@ -205,7 +205,7 @@ void ModeManager::enabledStateChanged() d->m_modeStack->setTabEnabled(index, mode->isEnabled()); // Make sure we leave any disabled mode to prevent possible crashes: - if (mode == currentMode() && !mode->isEnabled()) { + if (mode->id() == currentMode() && !mode->isEnabled()) { // This assumes that there is always at least one enabled mode. for (int i = 0; i < d->m_modes.count(); ++i) { if (d->m_modes.at(i) != mode && @@ -256,7 +256,7 @@ void ModeManager::currentTabAboutToChange(int index) if (index >= 0) { IMode *mode = d->m_modes.at(index); if (mode) - emit currentModeAboutToChange(mode); + emit currentModeAboutToChange(mode->id()); } } @@ -276,13 +276,13 @@ void ModeManager::currentTabChanged(int index) if (d->m_oldCurrent >= 0) oldMode = d->m_modes.at(d->m_oldCurrent); d->m_oldCurrent = index; - emit currentModeChanged(mode, oldMode); + emit currentModeChanged(mode ? mode->id() : Id(), oldMode ? oldMode->id() : Id()); } } void ModeManager::setFocusToCurrentMode() { - IMode *mode = currentMode(); + IMode *mode = findMode(currentMode()); QTC_ASSERT(mode, return); QWidget *widget = mode->widget(); if (widget) { diff --git a/src/plugins/coreplugin/modemanager.h b/src/plugins/coreplugin/modemanager.h index 0f73a12b79..8f5dbdbba7 100644 --- a/src/plugins/coreplugin/modemanager.h +++ b/src/plugins/coreplugin/modemanager.h @@ -23,10 +23,9 @@ ** ****************************************************************************/ -#ifndef MODEMANAGER_H -#define MODEMANAGER_H +#pragma once -#include <coreplugin/core_global.h> +#include <coreplugin/id.h> #include <QObject> QT_BEGIN_NAMESPACE @@ -35,9 +34,6 @@ QT_END_NAMESPACE namespace Core { -class Id; -class IMode; - namespace Internal { class MainWindow; class FancyTabWidget; @@ -50,8 +46,7 @@ class CORE_EXPORT ModeManager : public QObject public: static ModeManager *instance(); - static IMode *currentMode(); - static IMode *mode(Id id); + static Id currentMode(); static void addAction(QAction *action, int priority); static void addProjectSelector(QAction *action); @@ -64,10 +59,10 @@ public slots: static void setModeSelectorVisible(bool visible); signals: - void currentModeAboutToChange(Core::IMode *mode); + void currentModeAboutToChange(Core::Id mode); // the default argument '=0' is important for connects without the oldMode argument. - void currentModeChanged(Core::IMode *mode, Core::IMode *oldMode = 0); + void currentModeChanged(Core::Id mode, Core::Id oldMode = Core::Id()); private: explicit ModeManager(Internal::MainWindow *mainWindow, Internal::FancyTabWidget *modeStack); @@ -86,5 +81,3 @@ private: }; } // namespace Core - -#endif // MODEMANAGER_H diff --git a/src/plugins/coreplugin/navigationsubwidget.h b/src/plugins/coreplugin/navigationsubwidget.h index 2b945df780..545b0113d3 100644 --- a/src/plugins/coreplugin/navigationsubwidget.h +++ b/src/plugins/coreplugin/navigationsubwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NAVIGATIONSUBWIDGET_H -#define NAVIGATIONSUBWIDGET_H +#pragma once #include <QComboBox> @@ -122,5 +121,3 @@ private: } // namespace Internal } // namespace Core - -#endif // NAVIGATIONSUBWIDGET_H diff --git a/src/plugins/coreplugin/navigationwidget.cpp b/src/plugins/coreplugin/navigationwidget.cpp index ee64915484..8f8f1435c2 100644 --- a/src/plugins/coreplugin/navigationwidget.cpp +++ b/src/plugins/coreplugin/navigationwidget.cpp @@ -55,7 +55,7 @@ NavigationWidgetPlaceHolder* NavigationWidgetPlaceHolder::current() return m_current; } -NavigationWidgetPlaceHolder::NavigationWidgetPlaceHolder(IMode *mode, QWidget *parent) +NavigationWidgetPlaceHolder::NavigationWidgetPlaceHolder(Id mode, QWidget *parent) :QWidget(parent), m_mode(mode) { setLayout(new QVBoxLayout); @@ -104,7 +104,7 @@ void NavigationWidgetPlaceHolder::applyStoredSize(int width) // m_current points to the current PlaceHolder, or zero if there // is no PlaceHolder in this mode // And that the parent of the NavigationWidget gets the correct parent -void NavigationWidgetPlaceHolder::currentModeAboutToChange(IMode *mode) +void NavigationWidgetPlaceHolder::currentModeAboutToChange(Id mode) { NavigationWidget *navigationWidget = NavigationWidget::instance(); diff --git a/src/plugins/coreplugin/navigationwidget.h b/src/plugins/coreplugin/navigationwidget.h index 444d2365d8..1aff5880bc 100644 --- a/src/plugins/coreplugin/navigationwidget.h +++ b/src/plugins/coreplugin/navigationwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NAVIGATIONWIDGET_H -#define NAVIGATIONWIDGET_H +#pragma once #include <coreplugin/minisplitter.h> #include <coreplugin/id.h> @@ -39,7 +38,6 @@ QT_END_NAMESPACE namespace Core { class INavigationWidgetFactory; -class IMode; class Command; class NavigationWidget; struct NavigationWidgetPrivate; @@ -51,15 +49,15 @@ class CORE_EXPORT NavigationWidgetPlaceHolder : public QWidget friend class Core::NavigationWidget; public: - explicit NavigationWidgetPlaceHolder(IMode *mode, QWidget *parent = 0); + explicit NavigationWidgetPlaceHolder(Id mode, QWidget *parent = 0); virtual ~NavigationWidgetPlaceHolder(); static NavigationWidgetPlaceHolder* current(); void applyStoredSize(int width); private: - void currentModeAboutToChange(IMode *); + void currentModeAboutToChange(Id mode); - IMode *m_mode; + Id m_mode; static NavigationWidgetPlaceHolder* m_current; }; @@ -115,5 +113,3 @@ private: }; } // namespace Core - -#endif // NAVIGATIONWIDGET_H diff --git a/src/plugins/coreplugin/opendocumentstreeview.h b/src/plugins/coreplugin/opendocumentstreeview.h index 05d10174e8..50286b63d4 100644 --- a/src/plugins/coreplugin/opendocumentstreeview.h +++ b/src/plugins/coreplugin/opendocumentstreeview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OPENDOCUMENTSTREEVIEW_H -#define OPENDOCUMENTSTREEVIEW_H +#pragma once #include "core_global.h" @@ -53,5 +52,3 @@ private: }; } // namespace Core - -#endif // OPENDOCUMENTSTREEVIEW_H diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp index fe90a73abe..eef0312aea 100644 --- a/src/plugins/coreplugin/outputpane.cpp +++ b/src/plugins/coreplugin/outputpane.cpp @@ -36,9 +36,9 @@ namespace Core { class OutputPanePlaceHolderPrivate { public: - explicit OutputPanePlaceHolderPrivate(IMode *mode, QSplitter *parent); + explicit OutputPanePlaceHolderPrivate(Id mode, QSplitter *parent); - IMode *m_mode; + Id m_mode; QSplitter *m_splitter; int m_nonMaximizedSize = 0; bool m_isMaximized = false; @@ -46,14 +46,14 @@ public: static OutputPanePlaceHolder* m_current; }; -OutputPanePlaceHolderPrivate::OutputPanePlaceHolderPrivate(IMode *mode, QSplitter *parent) : +OutputPanePlaceHolderPrivate::OutputPanePlaceHolderPrivate(Id mode, QSplitter *parent) : m_mode(mode), m_splitter(parent) { } OutputPanePlaceHolder *OutputPanePlaceHolderPrivate::m_current = 0; -OutputPanePlaceHolder::OutputPanePlaceHolder(IMode *mode, QSplitter* parent) +OutputPanePlaceHolder::OutputPanePlaceHolder(Id mode, QSplitter *parent) : QWidget(parent), d(new OutputPanePlaceHolderPrivate(mode, parent)) { setVisible(false); @@ -83,7 +83,7 @@ OutputPanePlaceHolder::~OutputPanePlaceHolder() delete d; } -void OutputPanePlaceHolder::currentModeChanged(IMode *mode) +void OutputPanePlaceHolder::currentModeChanged(Id mode) { if (d->m_current == this) { d->m_current = 0; diff --git a/src/plugins/coreplugin/outputpane.h b/src/plugins/coreplugin/outputpane.h index 6486cc999f..072cda75ab 100644 --- a/src/plugins/coreplugin/outputpane.h +++ b/src/plugins/coreplugin/outputpane.h @@ -23,10 +23,9 @@ ** ****************************************************************************/ -#ifndef OUTPUTPANE_H -#define OUTPUTPANE_H +#pragma once -#include "core_global.h" +#include "id.h" #include <QWidget> @@ -36,9 +35,6 @@ QT_END_NAMESPACE namespace Core { -class IMode; - -namespace Internal { class OutputPaneManager; } class OutputPanePlaceHolderPrivate; class CORE_EXPORT OutputPanePlaceHolder : public QWidget @@ -46,7 +42,7 @@ class CORE_EXPORT OutputPanePlaceHolder : public QWidget Q_OBJECT public: - explicit OutputPanePlaceHolder(IMode *mode, QSplitter *parent = 0); + explicit OutputPanePlaceHolder(Id mode, QSplitter *parent = 0); ~OutputPanePlaceHolder(); static OutputPanePlaceHolder *getCurrent(); @@ -63,11 +59,9 @@ protected: private: void setHeight(int height); - void currentModeChanged(IMode *); + void currentModeChanged(Id mode); OutputPanePlaceHolderPrivate *d; }; } // namespace Core - -#endif // OUTPUTPANE_H diff --git a/src/plugins/coreplugin/outputpanemanager.h b/src/plugins/coreplugin/outputpanemanager.h index 304774856d..b8885dd21d 100644 --- a/src/plugins/coreplugin/outputpanemanager.h +++ b/src/plugins/coreplugin/outputpanemanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OUTPUTPANEMANAGER_H -#define OUTPUTPANEMANAGER_H +#pragma once #include <coreplugin/id.h> @@ -182,5 +181,3 @@ public: } // namespace Internal } // namespace Core - -#endif // OUTPUTPANEMANAGER_H diff --git a/src/plugins/coreplugin/outputwindow.h b/src/plugins/coreplugin/outputwindow.h index 862ead16bf..eee83dd63a 100644 --- a/src/plugins/coreplugin/outputwindow.h +++ b/src/plugins/coreplugin/outputwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OUTPUTWINDOW_H -#define OUTPUTWINDOW_H +#pragma once #include "core_global.h" #include "icontext.h" @@ -98,5 +97,3 @@ private: }; } // namespace Core - -#endif // OUTPUTWINDOW_H diff --git a/src/plugins/coreplugin/patchtool.cpp b/src/plugins/coreplugin/patchtool.cpp index 14590c0048..e4364a3219 100644 --- a/src/plugins/coreplugin/patchtool.cpp +++ b/src/plugins/coreplugin/patchtool.cpp @@ -27,6 +27,7 @@ #include "messagemanager.h" #include "icore.h" #include <utils/synchronousprocess.h> +#include <utils/environment.h> #include <QProcess> #include <QProcessEnvironment> @@ -91,7 +92,7 @@ static bool runPatchHelper(const QByteArray &input, const QString &workingDirect if (!workingDirectory.isEmpty()) patchProcess.setWorkingDirectory(workingDirectory); QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); - env.insert(QLatin1String("LC_ALL"), QLatin1String("C")); + Utils::Environment::setupEnglishOutput(&env); patchProcess.setProcessEnvironment(env); QStringList args; // Add argument 'apply' when git is used as patch command since git 2.5/Windows diff --git a/src/plugins/coreplugin/patchtool.h b/src/plugins/coreplugin/patchtool.h index 6297460995..9047bce7fb 100644 --- a/src/plugins/coreplugin/patchtool.h +++ b/src/plugins/coreplugin/patchtool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CORE_PATCHTOOL_H -#define CORE_PATCHTOOL_H +#pragma once #include "coreplugin/core_global.h" @@ -44,5 +43,3 @@ public: }; } // namespace Core - -#endif // CORE_PATCHTOOL_H diff --git a/src/plugins/coreplugin/plugindialog.h b/src/plugins/coreplugin/plugindialog.h index 5ef4e0cfc7..44e84637dd 100644 --- a/src/plugins/coreplugin/plugindialog.h +++ b/src/plugins/coreplugin/plugindialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINDIALOG_H -#define PLUGINDIALOG_H +#pragma once #include <QDialog> @@ -65,5 +64,3 @@ private: } // namespace Internal } // namespace Core - -#endif // PLUGINDIALOG_H diff --git a/src/plugins/coreplugin/progressmanager/futureprogress.h b/src/plugins/coreplugin/progressmanager/futureprogress.h index 6647103009..e079b7e9e4 100644 --- a/src/plugins/coreplugin/progressmanager/futureprogress.h +++ b/src/plugins/coreplugin/progressmanager/futureprogress.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FUTUREPROGRESS_H -#define FUTUREPROGRESS_H +#pragma once #include <coreplugin/core_global.h> @@ -102,5 +101,3 @@ private: }; } // namespace Core - -#endif // FUTUREPROGRESS_H diff --git a/src/plugins/coreplugin/progressmanager/progressbar.h b/src/plugins/coreplugin/progressmanager/progressbar.h index d2b9abc357..e2334447a2 100644 --- a/src/plugins/coreplugin/progressmanager/progressbar.h +++ b/src/plugins/coreplugin/progressmanager/progressbar.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROGRESSBAR_H -#define PROGRESSBAR_H +#pragma once #include <QString> #include <QWidget> @@ -93,5 +92,3 @@ private: } // namespace Internal } // namespace Core - -#endif // PROGRESSBAR_H diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.h b/src/plugins/coreplugin/progressmanager/progressmanager.h index 6653a70b1f..4d006a45a7 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.h +++ b/src/plugins/coreplugin/progressmanager/progressmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROGRESSMANAGER_H -#define PROGRESSMANAGER_H +#pragma once #include <coreplugin/core_global.h> #include <coreplugin/id.h> @@ -90,5 +89,3 @@ private: } // namespace Core Q_DECLARE_OPERATORS_FOR_FLAGS(Core::ProgressManager::ProgressFlags) - -#endif //PROGRESSMANAGER_H diff --git a/src/plugins/coreplugin/progressmanager/progressmanager_p.h b/src/plugins/coreplugin/progressmanager/progressmanager_p.h index 2217f78186..47e5c4334a 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager_p.h +++ b/src/plugins/coreplugin/progressmanager/progressmanager_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROGRESSMANAGER_P_H -#define PROGRESSMANAGER_P_H +#pragma once #include "progressmanager.h" @@ -122,5 +121,3 @@ public: } // namespace Internal } // namespace Core - -#endif // PROGRESSMANAGER_P_H diff --git a/src/plugins/coreplugin/progressmanager/progressview.h b/src/plugins/coreplugin/progressmanager/progressview.h index c8d312fb28..93a030793a 100644 --- a/src/plugins/coreplugin/progressmanager/progressview.h +++ b/src/plugins/coreplugin/progressmanager/progressview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROGRESSVIEW_H -#define PROGRESSVIEW_H +#pragma once #include "progressmanager.h" @@ -71,5 +70,3 @@ private: } // namespace Internal } // namespace Core - -#endif // PROGRESSVIEW_H diff --git a/src/plugins/coreplugin/removefiledialog.h b/src/plugins/coreplugin/removefiledialog.h index db499ce9c7..f79dc82e02 100644 --- a/src/plugins/coreplugin/removefiledialog.h +++ b/src/plugins/coreplugin/removefiledialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOVEFILEDIALOG_H -#define REMOVEFILEDIALOG_H +#pragma once #include "core_global.h" @@ -50,5 +49,3 @@ private: }; } // namespace Core - -#endif // REMOVEFILEDIALOG_H diff --git a/src/plugins/coreplugin/rightpane.cpp b/src/plugins/coreplugin/rightpane.cpp index 7b894b6b21..4c139cb284 100644 --- a/src/plugins/coreplugin/rightpane.cpp +++ b/src/plugins/coreplugin/rightpane.cpp @@ -45,7 +45,7 @@ RightPanePlaceHolder* RightPanePlaceHolder::current() return m_current; } -RightPanePlaceHolder::RightPanePlaceHolder(IMode *mode, QWidget *parent) +RightPanePlaceHolder::RightPanePlaceHolder(Id mode, QWidget *parent) :QWidget(parent), m_mode(mode) { setLayout(new QVBoxLayout); @@ -92,7 +92,7 @@ void RightPanePlaceHolder::applyStoredSize(int width) // m_current points to the current PlaceHolder, or zero if there // is no PlaceHolder in this mode // And that the parent of the RightPaneWidget gets the correct parent -void RightPanePlaceHolder::currentModeChanged(IMode *mode) +void RightPanePlaceHolder::currentModeChanged(Id mode) { if (m_current == this) { m_current = 0; diff --git a/src/plugins/coreplugin/rightpane.h b/src/plugins/coreplugin/rightpane.h index 1170fb6f80..4fb410f5eb 100644 --- a/src/plugins/coreplugin/rightpane.h +++ b/src/plugins/coreplugin/rightpane.h @@ -23,10 +23,9 @@ ** ****************************************************************************/ -#ifndef RIGHTPANE_H -#define RIGHTPANE_H +#pragma once -#include "core_global.h" +#include "id.h" #include <QWidget> #include <QPointer> @@ -46,14 +45,14 @@ class CORE_EXPORT RightPanePlaceHolder : public QWidget Q_OBJECT public: - explicit RightPanePlaceHolder(IMode *mode, QWidget *parent = 0); + explicit RightPanePlaceHolder(Id mode, QWidget *parent = 0); ~RightPanePlaceHolder(); static RightPanePlaceHolder *current(); private: - void currentModeChanged(IMode *); + void currentModeChanged(Id mode); void applyStoredSize(int width); - IMode *m_mode; + Id m_mode; static RightPanePlaceHolder* m_current; }; @@ -89,5 +88,3 @@ private: }; } // namespace Core - -#endif // RIGHTPANE_H diff --git a/src/plugins/coreplugin/settingsdatabase.h b/src/plugins/coreplugin/settingsdatabase.h index d40fea13b4..382618552c 100644 --- a/src/plugins/coreplugin/settingsdatabase.h +++ b/src/plugins/coreplugin/settingsdatabase.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SETTINGSDATABASE_H -#define SETTINGSDATABASE_H +#pragma once #include "core_global.h" @@ -63,5 +62,3 @@ private: }; } // namespace Core - -#endif // SETTINGSDATABASE_H diff --git a/src/plugins/coreplugin/shellcommand.h b/src/plugins/coreplugin/shellcommand.h index 063ec7394a..7de7246d3d 100644 --- a/src/plugins/coreplugin/shellcommand.h +++ b/src/plugins/coreplugin/shellcommand.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CORE_SHELLCOMMAND_H -#define CORE_SHELLCOMMAND_H +#pragma once #include "core_global.h" @@ -46,5 +45,3 @@ protected: }; } // namespace Core - -#endif // CORE_SHELLCOMMAND_H diff --git a/src/plugins/coreplugin/sidebar.h b/src/plugins/coreplugin/sidebar.h index ab25daeea4..2a09357573 100644 --- a/src/plugins/coreplugin/sidebar.h +++ b/src/plugins/coreplugin/sidebar.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SIDEBAR_H -#define SIDEBAR_H +#pragma once #include "core_global.h" #include "minisplitter.h" @@ -126,5 +125,3 @@ private: }; } // namespace Core - -#endif // SIDEBAR_H diff --git a/src/plugins/coreplugin/sidebarwidget.h b/src/plugins/coreplugin/sidebarwidget.h index ad5ab85848..fbc6c09acc 100644 --- a/src/plugins/coreplugin/sidebarwidget.h +++ b/src/plugins/coreplugin/sidebarwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SIDEBARWIDGET_H -#define SIDEBARWIDGET_H +#pragma once #include <QWidget> @@ -80,5 +79,3 @@ private: } // namespace Internal } // namespace Core - -#endif // SIDEBARWIDGET_H diff --git a/src/plugins/coreplugin/statusbarmanager.h b/src/plugins/coreplugin/statusbarmanager.h index 979df19ab9..1ca9c043c6 100644 --- a/src/plugins/coreplugin/statusbarmanager.h +++ b/src/plugins/coreplugin/statusbarmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STATUSBARMANAGER_H -#define STATUSBARMANAGER_H +#pragma once #include "minisplitter.h" @@ -75,5 +74,3 @@ private: } // namespace Internal } // namespace Core - -#endif // STATUSBARMANAGER_H diff --git a/src/plugins/coreplugin/statusbarwidget.h b/src/plugins/coreplugin/statusbarwidget.h index 45ba8b70f5..a21fbe1300 100644 --- a/src/plugins/coreplugin/statusbarwidget.h +++ b/src/plugins/coreplugin/statusbarwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STATUSBARWIDGET_H -#define STATUSBARWIDGET_H +#pragma once #include "core_global.h" #include "icontext.h" @@ -49,5 +48,3 @@ private: }; } // namespace Core - -#endif // STATUSBARWIDGET_H diff --git a/src/plugins/coreplugin/styleanimator.h b/src/plugins/coreplugin/styleanimator.h index b4926a00ed..020c00edef 100644 --- a/src/plugins/coreplugin/styleanimator.h +++ b/src/plugins/coreplugin/styleanimator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STYLEANIMATOR_H -#define STYLEANIMATOR_H +#pragma once #include <QPointer> #include <QTime> @@ -93,5 +92,3 @@ private: QBasicTimer animationTimer; QList <Animation*> animations; }; - -#endif // STYLEANIMATOR_H diff --git a/src/plugins/coreplugin/systemsettings.h b/src/plugins/coreplugin/systemsettings.h index 7645b29eb3..a4b99be557 100644 --- a/src/plugins/coreplugin/systemsettings.h +++ b/src/plugins/coreplugin/systemsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SYSTEMSETTINGS_H -#define SYSTEMSETTINGS_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> #include <QPointer> @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace Core - -#endif // SYSTEMSETTINGS_H diff --git a/src/plugins/coreplugin/testdatadir.h b/src/plugins/coreplugin/testdatadir.h index 9e4d779e56..d60b0190d1 100644 --- a/src/plugins/coreplugin/testdatadir.h +++ b/src/plugins/coreplugin/testdatadir.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTDATADIR_H -#define TESTDATADIR_H +#pragma once #include "core_global.h" @@ -57,5 +56,3 @@ private: } // namespace Tests } // namespace Core - -#endif // TESTDATADIR_H diff --git a/src/plugins/coreplugin/textdocument.h b/src/plugins/coreplugin/textdocument.h index 42d38a5d15..1a2b27c356 100644 --- a/src/plugins/coreplugin/textdocument.h +++ b/src/plugins/coreplugin/textdocument.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CORE_TEXTDOCUMENT_H -#define CORE_TEXTDOCUMENT_H +#pragma once #include "idocument.h" @@ -64,5 +63,3 @@ private: }; } // namespace Core - -#endif // CORE_TEXTDOCUMENT_H diff --git a/src/plugins/coreplugin/themechooser.h b/src/plugins/coreplugin/themechooser.h index 58186f116d..e95c480269 100644 --- a/src/plugins/coreplugin/themechooser.h +++ b/src/plugins/coreplugin/themechooser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef THEMECHOOSER_H -#define THEMECHOOSER_H +#pragma once #include "id.h" @@ -70,5 +69,3 @@ private: } // namespace Internal } // namespace Core - -#endif // THEMESETTINGS_H diff --git a/src/plugins/coreplugin/toolsettings.h b/src/plugins/coreplugin/toolsettings.h index c8ed371571..8ce3a8d8ba 100644 --- a/src/plugins/coreplugin/toolsettings.h +++ b/src/plugins/coreplugin/toolsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TOOLSETTINGS_H -#define TOOLSETTINGS_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -52,5 +51,3 @@ private: } // namespace Internal } // namespace Core - -#endif // TOOLSETTINGS_H diff --git a/src/plugins/coreplugin/variablechooser.h b/src/plugins/coreplugin/variablechooser.h index cdc4f1be1c..00f79defeb 100644 --- a/src/plugins/coreplugin/variablechooser.h +++ b/src/plugins/coreplugin/variablechooser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef VARIABLECHOOSER_H -#define VARIABLECHOOSER_H +#pragma once #include "core_global.h" @@ -59,5 +58,3 @@ private: }; } // namespace Core - -#endif // VARIABLECHOOSER_H diff --git a/src/plugins/coreplugin/vcsmanager.h b/src/plugins/coreplugin/vcsmanager.h index 51e559b4f9..71e3adeaf8 100644 --- a/src/plugins/coreplugin/vcsmanager.h +++ b/src/plugins/coreplugin/vcsmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef VCSMANAGER_H -#define VCSMANAGER_H +#pragma once #include "core_global.h" @@ -110,5 +109,3 @@ private: }; } // namespace Core - -#endif // VCSMANAGER_H diff --git a/src/plugins/coreplugin/versiondialog.h b/src/plugins/coreplugin/versiondialog.h index bbb39fc1bd..52efab01fe 100644 --- a/src/plugins/coreplugin/versiondialog.h +++ b/src/plugins/coreplugin/versiondialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef VERSIONDIALOG_H -#define VERSIONDIALOG_H +#pragma once #include <QDialog> @@ -47,5 +46,3 @@ public: } // namespace Internal } // namespace Core - -#endif // VERSIONDIALOG_H diff --git a/src/plugins/coreplugin/windowsupport.h b/src/plugins/coreplugin/windowsupport.h index a39a5707c2..6dc13914bf 100644 --- a/src/plugins/coreplugin/windowsupport.h +++ b/src/plugins/coreplugin/windowsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINDOWSUPPORT_H -#define WINDOWSUPPORT_H +#pragma once #include "icontext.h" @@ -84,5 +83,3 @@ private: } // Internal } // Core - -#endif // WINDOWSUPPORT_H diff --git a/src/plugins/cpaster/frontend/argumentscollector.h b/src/plugins/cpaster/frontend/argumentscollector.h index 6fc5d1fefb..d3d94c8b75 100644 --- a/src/plugins/cpaster/frontend/argumentscollector.h +++ b/src/plugins/cpaster/frontend/argumentscollector.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ARGUMENTSCOLLECTOR_H -#define ARGUMENTSCOLLECTOR_H +#pragma once #include <QStringList> @@ -56,5 +55,3 @@ private: QString m_protocol; QString m_errorString; }; - -#endif // ARGUMENTSCOLLECTOR_H diff --git a/src/plugins/cppeditor/cppautocompleter.h b/src/plugins/cppeditor/cppautocompleter.h index 9df35f1330..d58acda608 100644 --- a/src/plugins/cppeditor/cppautocompleter.h +++ b/src/plugins/cppeditor/cppautocompleter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPAUTOCOMPLETER_H -#define CPPAUTOCOMPLETER_H +#pragma once #include <texteditor/autocompleter.h> @@ -50,5 +49,3 @@ public: } // Internal } // CppEditor - -#endif // CPPAUTOCOMPLETER_H diff --git a/src/plugins/cppeditor/cppcanonicalsymbol.h b/src/plugins/cppeditor/cppcanonicalsymbol.h index aca83a387a..293859e9a5 100644 --- a/src/plugins/cppeditor/cppcanonicalsymbol.h +++ b/src/plugins/cppeditor/cppcanonicalsymbol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPCANONICALSYMBOL_H -#define CPPCANONICALSYMBOL_H +#pragma once #include <cplusplus/LookupContext.h> #include <cplusplus/Symbol.h> @@ -61,5 +60,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPCANONICALSYMBOL_H diff --git a/src/plugins/cppeditor/cppcodemodelinspectordialog.h b/src/plugins/cppeditor/cppcodemodelinspectordialog.h index bbb8d35810..ca17d960ba 100644 --- a/src/plugins/cppeditor/cppcodemodelinspectordialog.h +++ b/src/plugins/cppeditor/cppcodemodelinspectordialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPCODEMODELINSPECTORDIALOG_H -#define CPPCODEMODELINSPECTORDIALOG_H +#pragma once #include <cpptools/cppmodelmanager.h> @@ -121,5 +120,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPCODEMODELINSPECTORDIALOG_H diff --git a/src/plugins/cppeditor/cppdocumentationcommenthelper.h b/src/plugins/cppeditor/cppdocumentationcommenthelper.h index f384968965..af864b1bfc 100644 --- a/src/plugins/cppeditor/cppdocumentationcommenthelper.h +++ b/src/plugins/cppeditor/cppdocumentationcommenthelper.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPDOCUMENTATIONCOMMENTHELPER_H -#define CPPDOCUMENTATIONCOMMENTHELPER_H +#pragma once #include "cppeditor_global.h" @@ -39,5 +38,3 @@ bool trySplitComment(TextEditor::TextEditorWidget *editorWidget, } // namespace Internal } // namespace CppEditor - -#endif // CPPDOCUMENTATIONCOMMENTHELPER_H diff --git a/src/plugins/cppeditor/cppdoxygen_test.h b/src/plugins/cppeditor/cppdoxygen_test.h index 68f6b2509a..99af70ce0f 100644 --- a/src/plugins/cppeditor/cppdoxygen_test.h +++ b/src/plugins/cppeditor/cppdoxygen_test.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPDOXYGEN_TEST_H -#define CPPDOXYGEN_TEST_H +#pragma once #include "cppeditortestcase.h" @@ -68,5 +67,3 @@ private: } // namespace Tests } // namespace Internal } // namespace CppEditor - -#endif // CPPDOXYGEN_TEST_H diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h index 8b74d74d40..8317ebfd91 100644 --- a/src/plugins/cppeditor/cppeditor.h +++ b/src/plugins/cppeditor/cppeditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPEDITOR_H -#define CPPEDITOR_H +#pragma once #include "cppfunctiondecldeflink.h" @@ -145,5 +144,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPEDITOR_H diff --git a/src/plugins/cppeditor/cppeditor_global.h b/src/plugins/cppeditor/cppeditor_global.h index 4491614d7c..df1a19f39e 100644 --- a/src/plugins/cppeditor/cppeditor_global.h +++ b/src/plugins/cppeditor/cppeditor_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPEDITOR_GLOBAL_H -#define CPPEDITOR_GLOBAL_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define CPPEDITOR_EXPORT Q_DECL_IMPORT #endif - -#endif // CPPEDITOR_GLOBAL_H diff --git a/src/plugins/cppeditor/cppeditorconstants.h b/src/plugins/cppeditor/cppeditorconstants.h index 417a637351..1d72be7a7a 100644 --- a/src/plugins/cppeditor/cppeditorconstants.h +++ b/src/plugins/cppeditor/cppeditorconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPEDITORCONSTANTS_H -#define CPPEDITORCONSTANTS_H +#pragma once namespace CppEditor { namespace Constants { @@ -53,5 +52,3 @@ const char CPP_PREPROCESSOR_PROJECT_PREFIX[] = "CppPreprocessorProject-"; } // namespace Constants } // namespace CppEditor - -#endif // CPPEDITORCONSTANTS_H diff --git a/src/plugins/cppeditor/cppeditordocument.h b/src/plugins/cppeditor/cppeditordocument.h index c932aa1389..61185f9738 100644 --- a/src/plugins/cppeditor/cppeditordocument.h +++ b/src/plugins/cppeditor/cppeditordocument.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPEDITORDOCUMENT_H -#define CPPEDITORDOCUMENT_H +#pragma once #include <cpptools/baseeditordocumentprocessor.h> #include <cpptools/cppcompletionassistprovider.h> @@ -119,5 +118,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPEDITORDOCUMENT_H diff --git a/src/plugins/cppeditor/cppeditorenums.h b/src/plugins/cppeditor/cppeditorenums.h index 6437f38fc8..909073c3ee 100644 --- a/src/plugins/cppeditor/cppeditorenums.h +++ b/src/plugins/cppeditor/cppeditorenums.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPEDITORENUMS_H -#define CPPEDITORENUMS_H +#pragma once namespace CppEditor { namespace Internal { @@ -52,5 +51,3 @@ enum CppFormats { } // namespace Internal } // namespace CppEditor - -#endif // CPPEDITORENUMS_H diff --git a/src/plugins/cppeditor/cppeditorplugin.h b/src/plugins/cppeditor/cppeditorplugin.h index 7c36b2ee7c..935de13e33 100644 --- a/src/plugins/cppeditor/cppeditorplugin.h +++ b/src/plugins/cppeditor/cppeditorplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPEDITORPLUGIN_H -#define CPPEDITORPLUGIN_H +#pragma once #include <coreplugin/editormanager/ieditorfactory.h> @@ -252,5 +251,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPEDITORPLUGIN_H diff --git a/src/plugins/cppeditor/cppeditortestcase.h b/src/plugins/cppeditor/cppeditortestcase.h index 4b4239c295..dafca4ec14 100644 --- a/src/plugins/cppeditor/cppeditortestcase.h +++ b/src/plugins/cppeditor/cppeditortestcase.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPEDITORTESTCASE_H -#define CPPEDITORTESTCASE_H +#pragma once #include "cppeditor.h" @@ -76,5 +75,3 @@ public: } // namespace Tests } // namespace Internal } // namespace CppEditor - -#endif // CPPEDITORTESTCASE_H diff --git a/src/plugins/cppeditor/cppelementevaluator.h b/src/plugins/cppeditor/cppelementevaluator.h index a528148350..ffc6bd760a 100644 --- a/src/plugins/cppeditor/cppelementevaluator.h +++ b/src/plugins/cppeditor/cppelementevaluator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPELEMENTEVALUATOR_H -#define CPPELEMENTEVALUATOR_H +#pragma once #include <texteditor/texteditor.h> #include <texteditor/helpitem.h> @@ -193,5 +192,3 @@ public: } // namespace Internal } // namespace CppEditor - -#endif // CPPELEMENTEVALUATOR_H diff --git a/src/plugins/cppeditor/cppfollowsymbolundercursor.h b/src/plugins/cppeditor/cppfollowsymbolundercursor.h index bedea8f4d9..3121fe00e8 100644 --- a/src/plugins/cppeditor/cppfollowsymbolundercursor.h +++ b/src/plugins/cppeditor/cppfollowsymbolundercursor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPFOLLOWSYMBOLUNDERCURSOR_H -#define CPPFOLLOWSYMBOLUNDERCURSOR_H +#pragma once #include <cplusplus/CppDocument.h> #include <texteditor/texteditor.h> @@ -64,5 +63,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPFOLLOWSYMBOLUNDERCURSOR_H diff --git a/src/plugins/cppeditor/cppfunctiondecldeflink.h b/src/plugins/cppeditor/cppfunctiondecldeflink.h index ec866c551f..03c1992271 100644 --- a/src/plugins/cppeditor/cppfunctiondecldeflink.h +++ b/src/plugins/cppeditor/cppfunctiondecldeflink.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPFUNCTIONDECLDEFLINK_H -#define CPPFUNCTIONDECLDEFLINK_H +#pragma once #include "cppquickfix.h" @@ -118,5 +117,3 @@ private: } // namespace CppEditor Q_DECLARE_METATYPE(CppEditor::Internal::FunctionDeclDefLink::Marker) - -#endif // CPPFUNCTIONDECLDEFLINK_H diff --git a/src/plugins/cppeditor/cpphighlighter.h b/src/plugins/cppeditor/cpphighlighter.h index b7da0c14be..fd9ba578a5 100644 --- a/src/plugins/cppeditor/cpphighlighter.h +++ b/src/plugins/cppeditor/cpphighlighter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPHIGHLIGHTER_H -#define CPPHIGHLIGHTER_H +#pragma once #include <texteditor/syntaxhighlighter.h> @@ -58,5 +57,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPHIGHLIGHTER_H diff --git a/src/plugins/cppeditor/cpphoverhandler.h b/src/plugins/cppeditor/cpphoverhandler.h index 7562f42e25..accc275152 100644 --- a/src/plugins/cppeditor/cpphoverhandler.h +++ b/src/plugins/cppeditor/cpphoverhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPHOVERHANDLER_H -#define CPPHOVERHANDLER_H +#pragma once #include <texteditor/basehoverhandler.h> @@ -44,5 +43,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPHOVERHANDLER_H diff --git a/src/plugins/cppeditor/cppincludehierarchy.h b/src/plugins/cppeditor/cppincludehierarchy.h index ba50706033..9ae1efdaf8 100644 --- a/src/plugins/cppeditor/cppincludehierarchy.h +++ b/src/plugins/cppeditor/cppincludehierarchy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPINCLUDEHIERARCHY_H -#define CPPINCLUDEHIERARCHY_H +#pragma once #include <coreplugin/inavigationwidgetfactory.h> @@ -111,5 +110,3 @@ public: } // namespace Internal } // namespace CppEditor - -#endif // CPPINCLUDEHIERARCHY_H diff --git a/src/plugins/cppeditor/cppincludehierarchyitem.h b/src/plugins/cppeditor/cppincludehierarchyitem.h index 8723be14b2..f7cd897dab 100644 --- a/src/plugins/cppeditor/cppincludehierarchyitem.h +++ b/src/plugins/cppeditor/cppincludehierarchyitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPINCLUDEHIERARCHYITEM_H -#define CPPINCLUDEHIERARCHYITEM_H +#pragma once #include <QList> #include <QString> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPINCLUDEHIERARCHYITEM_H diff --git a/src/plugins/cppeditor/cppincludehierarchymodel.h b/src/plugins/cppeditor/cppincludehierarchymodel.h index 35f96ac7b3..2bc80bcb12 100644 --- a/src/plugins/cppeditor/cppincludehierarchymodel.h +++ b/src/plugins/cppeditor/cppincludehierarchymodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPINCLUDEHIERARCHYMODEL_H -#define CPPINCLUDEHIERARCHYMODEL_H +#pragma once #include <QAbstractItemModel> @@ -89,5 +88,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPINCLUDEHIERARCHYMODEL_H diff --git a/src/plugins/cppeditor/cppincludehierarchytreeview.h b/src/plugins/cppeditor/cppincludehierarchytreeview.h index 06b53708cf..083b6f1614 100644 --- a/src/plugins/cppeditor/cppincludehierarchytreeview.h +++ b/src/plugins/cppeditor/cppincludehierarchytreeview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPINCLUDEHIERARCHYTREEVIEW_H -#define CPPINCLUDEHIERARCHYTREEVIEW_H +#pragma once #include <utils/navigationtreeview.h> @@ -41,5 +40,3 @@ protected: } // namespace Internal } // namespace CppEditor - -#endif // CPPINCLUDEHIERARCHYTREEVIEW_H diff --git a/src/plugins/cppeditor/cppinsertvirtualmethods.h b/src/plugins/cppeditor/cppinsertvirtualmethods.h index ea5d2ee1fb..cc48fede93 100644 --- a/src/plugins/cppeditor/cppinsertvirtualmethods.h +++ b/src/plugins/cppeditor/cppinsertvirtualmethods.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INSERTVIRTUALMETHODS_H -#define INSERTVIRTUALMETHODS_H +#pragma once #include "cppquickfix.h" @@ -50,5 +49,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // INSERTVIRTUALMETHODS_H diff --git a/src/plugins/cppeditor/cppoutline.h b/src/plugins/cppeditor/cppoutline.h index 573d559bb5..fdc8671639 100644 --- a/src/plugins/cppeditor/cppoutline.h +++ b/src/plugins/cppeditor/cppoutline.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPOUTLINE_H -#define CPPOUTLINE_H +#pragma once #include "cppeditor.h" @@ -100,5 +99,3 @@ public: } // namespace Internal } // namespace CppEditor - -#endif // CPPOUTLINE_H diff --git a/src/plugins/cppeditor/cpppreprocessordialog.h b/src/plugins/cppeditor/cpppreprocessordialog.h index 470a2ad93a..bce7f4e343 100644 --- a/src/plugins/cppeditor/cpppreprocessordialog.h +++ b/src/plugins/cppeditor/cpppreprocessordialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPPREPROCESSORDIALOG_H -#define CPPPREPROCESSORDIALOG_H +#pragma once #include <cpptools/cppmodelmanager.h> @@ -65,5 +64,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPPREPROCESSORDIALOG_H diff --git a/src/plugins/cppeditor/cppquickfix.h b/src/plugins/cppeditor/cppquickfix.h index 38b5fe3468..02c63534c7 100644 --- a/src/plugins/cppeditor/cppquickfix.h +++ b/src/plugins/cppeditor/cppquickfix.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPQUICKFIX_H -#define CPPQUICKFIX_H +#pragma once #include "cppeditor_global.h" #include "cppquickfixassistant.h" @@ -64,5 +63,3 @@ public: }; } // namespace CppEditor - -#endif // CPPQUICKFIX_H diff --git a/src/plugins/cppeditor/cppquickfixassistant.h b/src/plugins/cppeditor/cppquickfixassistant.h index 8da6b1da6a..96c259aab4 100644 --- a/src/plugins/cppeditor/cppquickfixassistant.h +++ b/src/plugins/cppeditor/cppquickfixassistant.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPQUICKFIXASSISTANT_H -#define CPPQUICKFIXASSISTANT_H +#pragma once #include <cpptools/cppsemanticinfo.h> #include <texteditor/codeassist/assistinterface.h> @@ -81,5 +80,3 @@ public: } // Internal } // CppEditor - -#endif // CPPQUICKFIXASSISTANT_H diff --git a/src/plugins/cppeditor/cppquickfixes.h b/src/plugins/cppeditor/cppquickfixes.h index eb99e732a4..55e3a4e80c 100644 --- a/src/plugins/cppeditor/cppquickfixes.h +++ b/src/plugins/cppeditor/cppquickfixes.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPQUICKFIXES_H -#define CPPQUICKFIXES_H +#pragma once #include "cppeditor_global.h" #include "cppquickfix.h" @@ -567,5 +566,3 @@ public: } // namespace Internal } // namespace CppEditor - -#endif // CPPQUICKFIXES_H diff --git a/src/plugins/cppeditor/cppsnippetprovider.h b/src/plugins/cppeditor/cppsnippetprovider.h index 361413181d..fd6d3b26bb 100644 --- a/src/plugins/cppeditor/cppsnippetprovider.h +++ b/src/plugins/cppeditor/cppsnippetprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPSNIPPETPROVIDER_H -#define CPPSNIPPETPROVIDER_H +#pragma once #include <texteditor/snippets/isnippetprovider.h> @@ -45,5 +44,3 @@ public: } // Internal } // CppEditor - -#endif // CPPSNIPPETPROVIDER_H diff --git a/src/plugins/cppeditor/cpptypehierarchy.h b/src/plugins/cppeditor/cpptypehierarchy.h index a9d4ac0626..861a7875b3 100644 --- a/src/plugins/cppeditor/cpptypehierarchy.h +++ b/src/plugins/cppeditor/cpptypehierarchy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTYPEHIERARCHY_H -#define CPPTYPEHIERARCHY_H +#pragma once #include <coreplugin/inavigationwidgetfactory.h> @@ -111,5 +110,3 @@ public: } // namespace Internal } // namespace CppEditor - -#endif // CPPTYPEHIERARCHY_H diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.h b/src/plugins/cppeditor/cppuseselectionsupdater.h index d1bc479dc9..00f173c194 100644 --- a/src/plugins/cppeditor/cppuseselectionsupdater.h +++ b/src/plugins/cppeditor/cppuseselectionsupdater.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPUSESELECTIONSUPDATER_H -#define CPPUSESELECTIONSUPDATER_H +#pragma once #include <cpptools/cppsemanticinfo.h> #include <texteditor/texteditorconstants.h> @@ -114,5 +113,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPUSESELECTIONSUPDATER_H diff --git a/src/plugins/cppeditor/cppvirtualfunctionassistprovider.h b/src/plugins/cppeditor/cppvirtualfunctionassistprovider.h index 11c67de2a4..5a930530b5 100644 --- a/src/plugins/cppeditor/cppvirtualfunctionassistprovider.h +++ b/src/plugins/cppeditor/cppvirtualfunctionassistprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPFOLLOWVIRTUALSYMBOLS_H -#define CPPFOLLOWVIRTUALSYMBOLS_H +#pragma once #include <texteditor/codeassist/iassistprovider.h> @@ -68,5 +67,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPFOLLOWVIRTUALSYMBOLS_H diff --git a/src/plugins/cppeditor/cppvirtualfunctionproposalitem.h b/src/plugins/cppeditor/cppvirtualfunctionproposalitem.h index 5a28e1f902..5d86d4b390 100644 --- a/src/plugins/cppeditor/cppvirtualfunctionproposalitem.h +++ b/src/plugins/cppeditor/cppvirtualfunctionproposalitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPVIRTUALFUNCTIONPROPOSALITEM_H -#define CPPVIRTUALFUNCTIONPROPOSALITEM_H +#pragma once #include <texteditor/texteditor.h> #include <texteditor/codeassist/assistproposalitem.h> @@ -49,5 +48,3 @@ private: } // namespace Internal } // namespace CppEditor - -#endif // CPPVIRTUALFUNCTIONPROPOSALITEM_H diff --git a/src/plugins/cpptools/abstracteditorsupport.h b/src/plugins/cpptools/abstracteditorsupport.h index 7db8c69f99..0aacf3a4d2 100644 --- a/src/plugins/cpptools/abstracteditorsupport.h +++ b/src/plugins/cpptools/abstracteditorsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ABSTRACTEDITORSUPPORT_H -#define ABSTRACTEDITORSUPPORT_H +#pragma once #include "cpptools_global.h" @@ -57,5 +56,3 @@ private: }; } // namespace CppTools - -#endif // ABSTRACTEDITORSUPPORT_H diff --git a/src/plugins/cpptools/baseeditordocumentparser.h b/src/plugins/cpptools/baseeditordocumentparser.h index 82d2532326..3822394c61 100644 --- a/src/plugins/cpptools/baseeditordocumentparser.h +++ b/src/plugins/cpptools/baseeditordocumentparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASEEDITORDOCUMENTPARSER_H -#define BASEEDITORDOCUMENTPARSER_H +#pragma once #include "cpptools_global.h" #include "cppworkingcopy.h" @@ -86,5 +85,3 @@ private: }; } // namespace CppTools - -#endif // BASEEDITORDOCUMENTPARSER_H diff --git a/src/plugins/cpptools/baseeditordocumentprocessor.h b/src/plugins/cpptools/baseeditordocumentprocessor.h index 5f8e9a7353..844cadc64c 100644 --- a/src/plugins/cpptools/baseeditordocumentprocessor.h +++ b/src/plugins/cpptools/baseeditordocumentprocessor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASEEDITORDOCUMENTPROCESSOR_H -#define BASEEDITORDOCUMENTPROCESSOR_H +#pragma once #include "baseeditordocumentparser.h" #include "cppsemanticinfo.h" @@ -99,6 +98,3 @@ private: }; } // namespace CppTools - -#endif // BASEEDITORDOCUMENTPROCESSOR_H - diff --git a/src/plugins/cpptools/builtineditordocumentparser.h b/src/plugins/cpptools/builtineditordocumentparser.h index e86939ab53..c2eb4c86ee 100644 --- a/src/plugins/cpptools/builtineditordocumentparser.h +++ b/src/plugins/cpptools/builtineditordocumentparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BUILTINEDITORDOCUMENTPARSER_H -#define BUILTINEDITORDOCUMENTPARSER_H +#pragma once #include "baseeditordocumentparser.h" #include "cpptools_global.h" @@ -82,5 +81,3 @@ private: }; } // namespace CppTools - -#endif // BUILTINEDITORDOCUMENTPARSER_H diff --git a/src/plugins/cpptools/builtineditordocumentprocessor.h b/src/plugins/cpptools/builtineditordocumentprocessor.h index e971655101..2efd6af078 100644 --- a/src/plugins/cpptools/builtineditordocumentprocessor.h +++ b/src/plugins/cpptools/builtineditordocumentprocessor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BUILTINEDITORDOCUMENTPROCESSOR_H -#define BUILTINEDITORDOCUMENTPROCESSOR_H +#pragma once #include "baseeditordocumentprocessor.h" #include "builtineditordocumentparser.h" @@ -73,5 +72,3 @@ private: }; } // namespace CppTools - -#endif // BUILTINEDITORDOCUMENTPROCESSOR_H diff --git a/src/plugins/cpptools/builtinindexingsupport.h b/src/plugins/cpptools/builtinindexingsupport.h index d40948a14f..82414338ec 100644 --- a/src/plugins/cpptools/builtinindexingsupport.h +++ b/src/plugins/cpptools/builtinindexingsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BUILTININDEXINGSUPPORT_H -#define BUILTININDEXINGSUPPORT_H +#pragma once #include "cppindexingsupport.h" #include "cppmodelmanager.h" @@ -53,5 +52,3 @@ private: } // namespace Internal } // namespace CppTools - -#endif // BUILTININDEXINGSUPPORT_H diff --git a/src/plugins/cpptools/commentssettings.h b/src/plugins/cpptools/commentssettings.h index d0d3d5da29..f5ba5f0f09 100644 --- a/src/plugins/cpptools/commentssettings.h +++ b/src/plugins/cpptools/commentssettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMMENTSSETTINGS_H -#define COMMENTSSETTINGS_H +#pragma once #include "cpptools_global.h" @@ -56,5 +55,3 @@ inline bool operator!=(const CommentsSettings &a, const CommentsSettings &b) { return !(a == b); } } // namespace CppTools - -#endif // COMMENTSSETTINGS_H diff --git a/src/plugins/cpptools/compileroptionsbuilder.h b/src/plugins/cpptools/compileroptionsbuilder.h index e48cf99fdd..f24105f2f2 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.h +++ b/src/plugins/cpptools/compileroptionsbuilder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_COMPILEROPTIONSBUILDER_H -#define CPPTOOLS_COMPILEROPTIONSBUILDER_H +#pragma once #include "cpptools_global.h" @@ -71,5 +70,3 @@ private: }; } // namespace CppTools - -#endif // CPPTOOLS_COMPILEROPTIONSBUILDER_H diff --git a/src/plugins/cpptools/completionsettingspage.h b/src/plugins/cpptools/completionsettingspage.h index f972ab5fa6..3cc1a3eb14 100644 --- a/src/plugins/cpptools/completionsettingspage.h +++ b/src/plugins/cpptools/completionsettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPLETIONSETTINGSPAGE_H -#define COMPLETIONSETTINGSPAGE_H +#pragma once #include "commentssettings.h" @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace CppTools - -#endif // COMPLETIONSETTINGSPAGE_H diff --git a/src/plugins/cpptools/cppchecksymbols.h b/src/plugins/cpptools/cppchecksymbols.h index e91bab1f57..1cbd3f1030 100644 --- a/src/plugins/cpptools/cppchecksymbols.h +++ b/src/plugins/cpptools/cppchecksymbols.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUSCHECKSYMBOLS_H -#define CPLUSPLUSCHECKSYMBOLS_H +#pragma once #include "cpptools_global.h" #include "cppsemanticinfo.h" @@ -193,5 +192,3 @@ private: }; } // namespace CppTools - -#endif // CPLUSPLUSCHECKSYMBOLS_H diff --git a/src/plugins/cpptools/cppclassesfilter.h b/src/plugins/cpptools/cppclassesfilter.h index 2ae81cbc57..89d80df26b 100644 --- a/src/plugins/cpptools/cppclassesfilter.h +++ b/src/plugins/cpptools/cppclassesfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPCLASSESFILTER_H -#define CPPCLASSESFILTER_H +#pragma once #include "cpptools_global.h" #include "cpplocatorfilter.h" @@ -48,5 +47,3 @@ protected: }; } // namespace CppTools - -#endif // CPPCLASSESFILTER_H diff --git a/src/plugins/cpptools/cppcodeformatter.h b/src/plugins/cpptools/cppcodeformatter.h index e686deb8b6..f6e2e7e17c 100644 --- a/src/plugins/cpptools/cppcodeformatter.h +++ b/src/plugins/cpptools/cppcodeformatter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPCODEFORMATTER_H -#define CPPCODEFORMATTER_H +#pragma once #include "cpptools_global.h" #include "cppcodestylesettings.h" @@ -288,5 +287,3 @@ private: }; } // namespace CppTools - -#endif // CPPCODEFORMATTER_H diff --git a/src/plugins/cpptools/cppcodemodelinspectordumper.h b/src/plugins/cpptools/cppcodemodelinspectordumper.h index 01b836b75e..c548b92bc4 100644 --- a/src/plugins/cpptools/cppcodemodelinspectordumper.h +++ b/src/plugins/cpptools/cppcodemodelinspectordumper.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPCODEMODELINSPECTORDUMPER_H -#define CPPCODEMODELINSPECTORDUMPER_H +#pragma once #include "cpptools_global.h" @@ -88,5 +87,3 @@ private: } // namespace CppCodeModelInspector } // namespace CppTools - -#endif // CPPCODEMODELINSPECTORDUMPER_H diff --git a/src/plugins/cpptools/cppcodemodelsettings.h b/src/plugins/cpptools/cppcodemodelsettings.h index 81dab011af..92a212f8a8 100644 --- a/src/plugins/cpptools/cppcodemodelsettings.h +++ b/src/plugins/cpptools/cppcodemodelsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_CPPCODEMODELSETTINGS_H -#define CPPTOOLS_CPPCODEMODELSETTINGS_H +#pragma once #include "cpptools_global.h" @@ -78,5 +77,3 @@ private: }; } // namespace CppTools - -#endif // CPPTOOLS_CPPCODEMODELSETTINGS_H diff --git a/src/plugins/cpptools/cppcodemodelsettingspage.h b/src/plugins/cpptools/cppcodemodelsettingspage.h index 29fbb77069..6641c7898c 100644 --- a/src/plugins/cpptools/cppcodemodelsettingspage.h +++ b/src/plugins/cpptools/cppcodemodelsettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_INTERNAL_CPPCODEMODELSETTINGSPAGE_H -#define CPPTOOLS_INTERNAL_CPPCODEMODELSETTINGSPAGE_H +#pragma once #include "cppcodemodelsettings.h" @@ -85,5 +84,3 @@ private: } // Internal namespace } // CppTools namespace - -#endif // CPPTOOLS_INTERNAL_CPPCODEMODELSETTINGSPAGE_H diff --git a/src/plugins/cpptools/cppcodestylepreferences.h b/src/plugins/cpptools/cppcodestylepreferences.h index 2190c35b47..7317528a02 100644 --- a/src/plugins/cpptools/cppcodestylepreferences.h +++ b/src/plugins/cpptools/cppcodestylepreferences.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPCODESTYLEPREFERENCES_H -#define CPPCODESTYLEPREFERENCES_H +#pragma once #include "cpptools_global.h" #include "cppcodestylesettings.h" @@ -69,5 +68,3 @@ private: }; } // namespace CppTools - -#endif // CPPCODESTYLEPREFERENCES_H diff --git a/src/plugins/cpptools/cppcodestylepreferencesfactory.h b/src/plugins/cpptools/cppcodestylepreferencesfactory.h index bcd3d46928..05f28ede6e 100644 --- a/src/plugins/cpptools/cppcodestylepreferencesfactory.h +++ b/src/plugins/cpptools/cppcodestylepreferencesfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPCODESTYLEPREFERENCESFACTORY_H -#define CPPCODESTYLEPREFERENCESFACTORY_H +#pragma once #include <texteditor/icodestylepreferencesfactory.h> @@ -46,5 +45,3 @@ public: }; } // namespace CppTools - -#endif // CPPCODESTYLEPREFERENCESFACTORY_H diff --git a/src/plugins/cpptools/cppcodestylesettings.h b/src/plugins/cpptools/cppcodestylesettings.h index 0646010cf5..60dcc2fbf6 100644 --- a/src/plugins/cpptools/cppcodestylesettings.h +++ b/src/plugins/cpptools/cppcodestylesettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPCODESTYLESETTINGS_H -#define CPPCODESTYLESETTINGS_H +#pragma once #include "cpptools_global.h" @@ -110,5 +109,3 @@ public: } // namespace CppTools Q_DECLARE_METATYPE(CppTools::CppCodeStyleSettings) - -#endif // CPPCODESTYLESETTINGS_H diff --git a/src/plugins/cpptools/cppcodestylesettingspage.h b/src/plugins/cpptools/cppcodestylesettingspage.h index 63e3ed4aca..c9ae76e1cd 100644 --- a/src/plugins/cpptools/cppcodestylesettingspage.h +++ b/src/plugins/cpptools/cppcodestylesettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPCODESTYLESETTINGSPAGE_H -#define CPPCODESTYLESETTINGSPAGE_H +#pragma once #include "cpptools_global.h" #include "cppcodestylesettings.h" @@ -98,5 +97,3 @@ private: } // namespace Internal } // namespace CppTools - -#endif // CPPCODESTYLESETTINGSPAGE_H diff --git a/src/plugins/cpptools/cppcompletionassist.h b/src/plugins/cpptools/cppcompletionassist.h index 7872759081..809a5a1005 100644 --- a/src/plugins/cpptools/cppcompletionassist.h +++ b/src/plugins/cpptools/cppcompletionassist.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPCOMPLETIONASSIST_H -#define CPPCOMPLETIONASSIST_H +#pragma once #include "builtineditordocumentparser.h" #include "cppcompletionassistprocessor.h" @@ -214,5 +213,3 @@ private: } // CppTools Q_DECLARE_METATYPE(CPlusPlus::Symbol *) - -#endif // CPPCOMPLETIONASSIST_H diff --git a/src/plugins/cpptools/cppcompletionassistprocessor.h b/src/plugins/cpptools/cppcompletionassistprocessor.h index 4f46be0b00..7ccc632e63 100644 --- a/src/plugins/cpptools/cppcompletionassistprocessor.h +++ b/src/plugins/cpptools/cppcompletionassistprocessor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPCOMPLETIONASSISTPROCESSOR_H -#define CPPCOMPLETIONASSISTPROCESSOR_H +#pragma once #include "cpptools_global.h" @@ -71,5 +70,3 @@ private: }; } // namespace CppTools - -#endif // CPPCOMPLETIONASSISTPROCESSOR_H diff --git a/src/plugins/cpptools/cppcompletionassistprovider.h b/src/plugins/cpptools/cppcompletionassistprovider.h index 975f880c61..16382581c7 100644 --- a/src/plugins/cpptools/cppcompletionassistprovider.h +++ b/src/plugins/cpptools/cppcompletionassistprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_CPPCOMPLETIONASSISTPROVIDER_H -#define CPPTOOLS_CPPCOMPLETIONASSISTPROVIDER_H +#pragma once #include "cpptools_global.h" @@ -67,5 +66,3 @@ public: }; } // namespace CppTools - -#endif // CPPTOOLS_CPPCOMPLETIONASSISTPROVIDER_H diff --git a/src/plugins/cpptools/cppcurrentdocumentfilter.h b/src/plugins/cpptools/cppcurrentdocumentfilter.h index 3b664ac650..3e30f6ddab 100644 --- a/src/plugins/cpptools/cppcurrentdocumentfilter.h +++ b/src/plugins/cpptools/cppcurrentdocumentfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPCURRENTDOCUMENTFILTER_H -#define CPPCURRENTDOCUMENTFILTER_H +#pragma once #include "searchsymbols.h" @@ -69,5 +68,3 @@ private: } // namespace Internal } // namespace CppTools - -#endif // CPPCURRENTDOCUMENTFILTER_H diff --git a/src/plugins/cpptools/cppdoxygen.h b/src/plugins/cpptools/cppdoxygen.h index 8e523cdbcd..f1e708bd98 100644 --- a/src/plugins/cpptools/cppdoxygen.h +++ b/src/plugins/cpptools/cppdoxygen.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPDOXYGEN_H -#define CPPDOXYGEN_H +#pragma once #include "cpptools_global.h" @@ -323,5 +322,3 @@ CPPTOOLS_EXPORT int classifyDoxygenTag(const QChar *s, int n); CPPTOOLS_EXPORT const char *doxygenTagSpell(int index); } // namespace ::CppTools - -#endif // CPPDOXYGEN_H diff --git a/src/plugins/cpptools/cppeditoroutline.h b/src/plugins/cpptools/cppeditoroutline.h index 9c561eec82..361b2fe25a 100644 --- a/src/plugins/cpptools/cppeditoroutline.h +++ b/src/plugins/cpptools/cppeditoroutline.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPEDITOROUTLINE_H -#define CPPEDITOROUTLINE_H +#pragma once #include "cpptools_global.h" @@ -90,5 +89,3 @@ private: }; } // namespace CppTools - -#endif // CPPEDITOROUTLINE_H diff --git a/src/plugins/cpptools/cppfileiterationorder.h b/src/plugins/cpptools/cppfileiterationorder.h index 3db83e749f..3df02ee22b 100644 --- a/src/plugins/cpptools/cppfileiterationorder.h +++ b/src/plugins/cpptools/cppfileiterationorder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILEITERATIONORDER_H -#define FILEITERATIONORDER_H +#pragma once #include "cpptools_global.h" @@ -75,5 +74,3 @@ CPPTOOLS_EXPORT bool operator<(const FileIterationOrder::Entry &first, const FileIterationOrder::Entry &second); } // namespace CppTools - -#endif // FILEITERATIONORDER_H diff --git a/src/plugins/cpptools/cppfilesettingspage.h b/src/plugins/cpptools/cppfilesettingspage.h index 24f5b368ec..4731adc7c9 100644 --- a/src/plugins/cpptools/cppfilesettingspage.h +++ b/src/plugins/cpptools/cppfilesettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPFILESETTINGSPAGE_H -#define CPPFILESETTINGSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -103,5 +102,3 @@ private: } // namespace Internal } // namespace CppTools - -#endif // CPPFILESETTINGSPAGE_H diff --git a/src/plugins/cpptools/cppfindreferences.h b/src/plugins/cpptools/cppfindreferences.h index 233e1bff4d..c747e502dd 100644 --- a/src/plugins/cpptools/cppfindreferences.h +++ b/src/plugins/cpptools/cppfindreferences.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPFINDREFERENCES_H -#define CPPFINDREFERENCES_H +#pragma once #include <cplusplus/FindUsages.h> @@ -100,5 +99,3 @@ private: } // namespace CppTools Q_DECLARE_METATYPE(CppTools::Internal::CppFindReferencesParameters) - -#endif // CPPFINDREFERENCES_H diff --git a/src/plugins/cpptools/cppfunctionsfilter.h b/src/plugins/cpptools/cppfunctionsfilter.h index 6976d4b35f..f052a7a2d2 100644 --- a/src/plugins/cpptools/cppfunctionsfilter.h +++ b/src/plugins/cpptools/cppfunctionsfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPFUNCTIONSFILTER_H -#define CPPFUNCTIONSFILTER_H +#pragma once #include "cpplocatordata.h" #include "cpplocatorfilter.h" @@ -48,5 +47,3 @@ protected: } // namespace Internal } // namespace CppTools - -#endif // CPPFUNCTIONSFILTER_H diff --git a/src/plugins/cpptools/cppincludesfilter.h b/src/plugins/cpptools/cppincludesfilter.h index c1c87a6d38..84700c8a10 100644 --- a/src/plugins/cpptools/cppincludesfilter.h +++ b/src/plugins/cpptools/cppincludesfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPINCLUDESFILTER_H -#define CPPINCLUDESFILTER_H +#pragma once #include <coreplugin/locator/basefilefilter.h> @@ -52,5 +51,3 @@ private: } // namespace Internal } // namespace CppTools - -#endif // CPPINCLUDESFILTER_H diff --git a/src/plugins/cpptools/cppindexingsupport.h b/src/plugins/cpptools/cppindexingsupport.h index d201592663..e97bb50f67 100644 --- a/src/plugins/cpptools/cppindexingsupport.h +++ b/src/plugins/cpptools/cppindexingsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_CPPINDEXINGSUPPORT_H -#define CPPTOOLS_CPPINDEXINGSUPPORT_H +#pragma once #include "cpptools_global.h" @@ -90,5 +89,3 @@ public: Q_DECLARE_METATYPE(CppTools::SymbolSearcher::SearchScope) Q_DECLARE_METATYPE(CppTools::SymbolSearcher::Parameters) Q_DECLARE_METATYPE(CppTools::SymbolSearcher::SymbolTypes) - -#endif // CPPTOOLS_CPPINDEXINGSUPPORT_H diff --git a/src/plugins/cpptools/cpplocalsymbols.h b/src/plugins/cpptools/cpplocalsymbols.h index b58a4add01..ef2a37f3aa 100644 --- a/src/plugins/cpptools/cpplocalsymbols.h +++ b/src/plugins/cpptools/cpplocalsymbols.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPLOCALSYMBOLS_H -#define CPPLOCALSYMBOLS_H +#pragma once #include "cpptools_global.h" #include "cppsemanticinfo.h" @@ -42,5 +41,3 @@ public: }; } // namespace CppTools - -#endif // CPPLOCALSYMBOLS_H diff --git a/src/plugins/cpptools/cpplocatordata.h b/src/plugins/cpptools/cpplocatordata.h index 292fa650e0..393d8dc198 100644 --- a/src/plugins/cpptools/cpplocatordata.h +++ b/src/plugins/cpptools/cpplocatordata.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPLOCATORDATA_H -#define CPPLOCATORDATA_H +#pragma once #include <functional> #include <QHash> @@ -84,5 +83,3 @@ private: }; } // CppTools namespace - -#endif // CPPLOCATORDATA_H diff --git a/src/plugins/cpptools/cpplocatorfilter.h b/src/plugins/cpptools/cpplocatorfilter.h index 42f6badc6e..90716a5286 100644 --- a/src/plugins/cpptools/cpplocatorfilter.h +++ b/src/plugins/cpptools/cpplocatorfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPLOCATORFILTER_H -#define CPPLOCATORFILTER_H +#pragma once #include "cpplocatordata.h" #include "searchsymbols.h" @@ -57,5 +56,3 @@ protected: } // namespace Internal } // namespace CppTools - -#endif // CPPLOCATORFILTER_H diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h index 41ec74ee67..b13f3f0bb1 100644 --- a/src/plugins/cpptools/cppmodelmanager.h +++ b/src/plugins/cpptools/cppmodelmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPMODELMANAGER_H -#define CPPMODELMANAGER_H +#pragma once #include "cpptools_global.h" @@ -225,5 +224,3 @@ private: }; } // namespace CppTools - -#endif // CPPMODELMANAGER_H diff --git a/src/plugins/cpptools/cppmodelmanagersupport.h b/src/plugins/cpptools/cppmodelmanagersupport.h index 27fad98094..cfef02e1a0 100644 --- a/src/plugins/cpptools/cppmodelmanagersupport.h +++ b/src/plugins/cpptools/cppmodelmanagersupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_CPPMODELMANAGERSUPPORT_H -#define CPPTOOLS_CPPMODELMANAGERSUPPORT_H +#pragma once #include "cpptools_global.h" @@ -63,5 +62,3 @@ public: }; } // CppTools namespace - -#endif // CPPTOOLS_CPPMODELMANAGERSUPPORT_H diff --git a/src/plugins/cpptools/cppmodelmanagersupportinternal.h b/src/plugins/cpptools/cppmodelmanagersupportinternal.h index 3aa9088515..0a2290f595 100644 --- a/src/plugins/cpptools/cppmodelmanagersupportinternal.h +++ b/src/plugins/cpptools/cppmodelmanagersupportinternal.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_INTERNAL_CPPMODELMANAGERSUPPORTINTERNAL_H -#define CPPTOOLS_INTERNAL_CPPMODELMANAGERSUPPORTINTERNAL_H +#pragma once #include "cppmodelmanagersupport.h" @@ -60,5 +59,3 @@ public: } // Internal namespace } // CppTools namespace - -#endif // CPPTOOLS_INTERNAL_CPPMODELMANAGERSUPPORTINTERNAL_H diff --git a/src/plugins/cpptools/cpppointerdeclarationformatter.h b/src/plugins/cpptools/cpppointerdeclarationformatter.h index 773f139590..f1e3952709 100644 --- a/src/plugins/cpptools/cpppointerdeclarationformatter.h +++ b/src/plugins/cpptools/cpppointerdeclarationformatter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPPOINTERDECLARATIONFORMATTER_H -#define CPPPOINTERDECLARATIONFORMATTER_H +#pragma once #include "cpptools_global.h" #include "cpprefactoringchanges.h" @@ -120,5 +119,3 @@ private: }; } // namespace CppTools - -#endif // CPPPOINTERDECLARATIONFORMATTER_H diff --git a/src/plugins/cpptools/cppprojectfile.h b/src/plugins/cpptools/cppprojectfile.h index 74539b5d8e..a4b47dee87 100644 --- a/src/plugins/cpptools/cppprojectfile.h +++ b/src/plugins/cpptools/cppprojectfile.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_CPPPROJECTFILE_H -#define CPPTOOLS_CPPPROJECTFILE_H +#pragma once #include "cpptools_global.h" @@ -66,5 +65,3 @@ public: QDebug operator<<(QDebug stream, const CppTools::ProjectFile &cxxFile); } // namespace CppTools - -#endif // CPPTOOLS_CPPPROJECTFILE_H diff --git a/src/plugins/cpptools/cppqtstyleindenter.h b/src/plugins/cpptools/cppqtstyleindenter.h index eb3196043a..35b26d60ac 100644 --- a/src/plugins/cpptools/cppqtstyleindenter.h +++ b/src/plugins/cpptools/cppqtstyleindenter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPQTSTYLEINDENTER_H -#define CPPQTSTYLEINDENTER_H +#pragma once #include "cpptools_global.h" @@ -65,5 +64,3 @@ private: }; } // CppTools - -#endif // CPPQTSTYLEINDENTER_H diff --git a/src/plugins/cpptools/cpprefactoringchanges.h b/src/plugins/cpptools/cpprefactoringchanges.h index 7aeecca9f7..af14598c50 100644 --- a/src/plugins/cpptools/cpprefactoringchanges.h +++ b/src/plugins/cpptools/cpprefactoringchanges.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPREFACTORINGCHANGES_H -#define CPPREFACTORINGCHANGES_H +#pragma once #include "cpptools_global.h" @@ -98,5 +97,3 @@ private: }; } // namespace CppTools - -#endif // CPPREFACTORINGCHANGES_H diff --git a/src/plugins/cpptools/cppselectionchanger.h b/src/plugins/cpptools/cppselectionchanger.h index 8e64fbdee4..1a29989df2 100644 --- a/src/plugins/cpptools/cppselectionchanger.h +++ b/src/plugins/cpptools/cppselectionchanger.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPSELECTIONCHANGER_H -#define CPPSELECTIONCHANGER_H +#pragma once #include "cpptools_global.h" @@ -124,5 +123,3 @@ private: }; } // namespace CppTools - -#endif // CPPSELECTIONCHANGER_H diff --git a/src/plugins/cpptools/cppsemanticinfo.h b/src/plugins/cpptools/cppsemanticinfo.h index d3391e9dc4..c9540f2d3c 100644 --- a/src/plugins/cpptools/cppsemanticinfo.h +++ b/src/plugins/cpptools/cppsemanticinfo.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPSEMANTICINFO_H -#define CPPSEMANTICINFO_H +#pragma once #include "cpptools_global.h" @@ -81,5 +80,3 @@ public: }; } // namespace CppTools - -#endif // CPPSEMANTICINFO_H diff --git a/src/plugins/cpptools/cppsemanticinfoupdater.h b/src/plugins/cpptools/cppsemanticinfoupdater.h index 8ecba4a2df..944ffe07d5 100644 --- a/src/plugins/cpptools/cppsemanticinfoupdater.h +++ b/src/plugins/cpptools/cppsemanticinfoupdater.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPSEMANTICINFOUPDATER_H -#define CPPSEMANTICINFOUPDATER_H +#pragma once #include "cppsemanticinfo.h" @@ -56,5 +55,3 @@ private: }; } // namespace CppTools - -#endif // CPPSEMANTICINFOUPDATER_H diff --git a/src/plugins/cpptools/cppsourceprocessertesthelper.h b/src/plugins/cpptools/cppsourceprocessertesthelper.h index 390e1a25d7..5f2d995f4a 100644 --- a/src/plugins/cpptools/cppsourceprocessertesthelper.h +++ b/src/plugins/cpptools/cppsourceprocessertesthelper.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPPSOURCEPROCESSERTESTHELPER_H -#define CPPPSOURCEPROCESSERTESTHELPER_H +#pragma once #include "cpptools_global.h" @@ -50,5 +49,3 @@ public: } // namespace Tests } // namespace CppTools - -#endif // CPPPSOURCEPROCESSERTESTHELPER_H diff --git a/src/plugins/cpptools/cppsourceprocessor.h b/src/plugins/cpptools/cppsourceprocessor.h index 39b612c157..ec1b9ef775 100644 --- a/src/plugins/cpptools/cppsourceprocessor.h +++ b/src/plugins/cpptools/cppsourceprocessor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPSOURCEPROCESSOR_H -#define CPPSOURCEPROCESSOR_H +#pragma once #include "cppmodelmanager.h" #include "cppworkingcopy.h" @@ -124,5 +123,3 @@ private: } // namespace Internal } // namespace CppTools - -#endif // CPPSOURCEPROCESSOR_H diff --git a/src/plugins/cpptools/cpptools_global.h b/src/plugins/cpptools/cpptools_global.h index 322d94cb9d..4396b11cb2 100644 --- a/src/plugins/cpptools/cpptools_global.h +++ b/src/plugins/cpptools/cpptools_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_GLOBAL_H -#define CPPTOOLS_GLOBAL_H +#pragma once #include <QtGlobal> @@ -35,5 +34,3 @@ #else # define CPPTOOLS_EXPORT Q_DECL_IMPORT #endif - -#endif // CPPTOOLS_GLOBAL_H diff --git a/src/plugins/cpptools/cpptoolsbridge.h b/src/plugins/cpptools/cpptoolsbridge.h index ba35177850..ef5d12ed81 100644 --- a/src/plugins/cpptools/cpptoolsbridge.h +++ b/src/plugins/cpptools/cpptoolsbridge.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_CPPTOOLSBRIDGE_H -#define CPPTOOLS_CPPTOOLSBRIDGE_H +#pragma once #include "cpptools_global.h" @@ -58,5 +57,3 @@ private: }; } // namespace CppTools - -#endif // CPPTOOLS_CPPTOOLSBRIDGE_H diff --git a/src/plugins/cpptools/cpptoolsbridgeinterface.h b/src/plugins/cpptools/cpptoolsbridgeinterface.h index ef9ad38696..c62ee41996 100644 --- a/src/plugins/cpptools/cpptoolsbridgeinterface.h +++ b/src/plugins/cpptools/cpptoolsbridgeinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLSBRIDGEINTERFACE_H -#define CPPTOOLSBRIDGEINTERFACE_H +#pragma once #include <QtGlobal> @@ -53,5 +52,3 @@ public: }; } // namespace CppTools - -#endif // CPPTOOLSBRIDGEINTERFACE_H diff --git a/src/plugins/cpptools/cpptoolsbridgeqtcreatorimplementation.h b/src/plugins/cpptools/cpptoolsbridgeqtcreatorimplementation.h index 88a657dfa5..5570523067 100644 --- a/src/plugins/cpptools/cpptoolsbridgeqtcreatorimplementation.h +++ b/src/plugins/cpptools/cpptoolsbridgeqtcreatorimplementation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_CPPTOOLSBRIDGEQTCREATORIMPLEMENTATION_H -#define CPPTOOLS_CPPTOOLSBRIDGEQTCREATORIMPLEMENTATION_H +#pragma once #include "cpptoolsbridgeinterface.h" @@ -44,5 +43,3 @@ public: } // namespace Internal } // namespace CppTools - -#endif // CPPTOOLS_CPPTOOLSBRIDGEQTCREATORIMPLEMENTATION_H diff --git a/src/plugins/cpptools/cpptoolsconstants.h b/src/plugins/cpptools/cpptoolsconstants.h index 5d2d06201c..dbd32dc527 100644 --- a/src/plugins/cpptools/cpptoolsconstants.h +++ b/src/plugins/cpptools/cpptoolsconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLSCONSTANTS_H -#define CPPTOOLSCONSTANTS_H +#pragma once #include <QtGlobal> @@ -70,5 +69,3 @@ const char CPP_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++"); } // namespace Constants } // namespace CppTools - -#endif // CPPTOOLSCONSTANTS_H diff --git a/src/plugins/cpptools/cpptoolsjsextension.h b/src/plugins/cpptools/cpptoolsjsextension.h index 9d0d16ebe8..f009c6c259 100644 --- a/src/plugins/cpptools/cpptoolsjsextension.h +++ b/src/plugins/cpptools/cpptoolsjsextension.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLSJSEXTENSION_H -#define CPPTOOLSJSEXTENSION_H +#pragma once #include <QObject> @@ -61,5 +60,3 @@ public: } // namespace Internal } // namespace CppTools - -#endif // CPPTOOLSJSEXTENSION_H diff --git a/src/plugins/cpptools/cpptoolsplugin.h b/src/plugins/cpptools/cpptoolsplugin.h index 46c2a0622f..b4d55b9927 100644 --- a/src/plugins/cpptools/cpptoolsplugin.h +++ b/src/plugins/cpptools/cpptoolsplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_H -#define CPPTOOLS_H +#pragma once #include "cpptools_global.h" #include "stringtable.h" @@ -188,5 +187,3 @@ private: } // namespace Internal } // namespace CppTools - -#endif // CPPTOOLS_H diff --git a/src/plugins/cpptools/cpptoolsreuse.h b/src/plugins/cpptools/cpptoolsreuse.h index 22549144c2..cdb86bd565 100644 --- a/src/plugins/cpptools/cpptoolsreuse.h +++ b/src/plugins/cpptools/cpptoolsreuse.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLSREUSE_H -#define CPPTOOLSREUSE_H +#pragma once #include "cpptools_global.h" @@ -77,5 +76,3 @@ int fileSizeLimit(); bool skipFileDueToSizeLimit(const QFileInfo &fileInfo, int limitInMB = fileSizeLimit()); } // CppTools - -#endif // CPPTOOLSREUSE_H diff --git a/src/plugins/cpptools/cpptoolssettings.h b/src/plugins/cpptools/cpptoolssettings.h index efcb74fbfe..bb5234f2dc 100644 --- a/src/plugins/cpptools/cpptoolssettings.h +++ b/src/plugins/cpptools/cpptoolssettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLSSETTINGS_H -#define CPPTOOLSSETTINGS_H +#pragma once #include "cpptools_global.h" @@ -71,5 +70,3 @@ private: }; } // namespace CppTools - -#endif // CPPTOOLSSETTINGS_H diff --git a/src/plugins/cpptools/cpptoolstestcase.h b/src/plugins/cpptools/cpptoolstestcase.h index 98b03047ed..0d9369001c 100644 --- a/src/plugins/cpptools/cpptoolstestcase.h +++ b/src/plugins/cpptools/cpptoolstestcase.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLSTESTCASE_H -#define CPPTOOLSTESTCASE_H +#pragma once #include "cpptools_global.h" @@ -186,5 +185,3 @@ public: } // namespace Tests } // namespace CppTools - -#endif // CPPTOOLSTESTCASE_H diff --git a/src/plugins/cpptools/cppworkingcopy.h b/src/plugins/cpptools/cppworkingcopy.h index 5efd71773f..6c370d5b68 100644 --- a/src/plugins/cpptools/cppworkingcopy.h +++ b/src/plugins/cpptools/cppworkingcopy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPWORKINGCOPY_H -#define CPPWORKINGCOPY_H +#pragma once #include "cpptools_global.h" @@ -83,5 +82,3 @@ private: }; } // namespace CppTools - -#endif // CPPWORKINGCOPY_H diff --git a/src/plugins/cpptools/doxygengenerator.h b/src/plugins/cpptools/doxygengenerator.h index c816ebfcb9..051ecfbd3e 100644 --- a/src/plugins/cpptools/doxygengenerator.h +++ b/src/plugins/cpptools/doxygengenerator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DOXYGENGENERATOR_H -#define DOXYGENGENERATOR_H +#pragma once #include "cpptools_global.h" @@ -95,5 +94,3 @@ private: }; } // namespace CppTools - -#endif // DOXYGENGENERATOR_H diff --git a/src/plugins/cpptools/editordocumenthandle.h b/src/plugins/cpptools/editordocumenthandle.h index 96bbcd360c..2e7d4784c3 100644 --- a/src/plugins/cpptools/editordocumenthandle.h +++ b/src/plugins/cpptools/editordocumenthandle.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EDITORDOCUMENTHANDLE_H -#define EDITORDOCUMENTHANDLE_H +#pragma once #include "cpptools_global.h" #include "senddocumenttracker.h" @@ -61,5 +60,3 @@ private: }; } // namespace CppTools - -#endif // EDITORDOCUMENTHANDLE_H diff --git a/src/plugins/cpptools/functionutils.h b/src/plugins/cpptools/functionutils.h index 6a5d6b7656..312492a873 100644 --- a/src/plugins/cpptools/functionutils.h +++ b/src/plugins/cpptools/functionutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FUNCTIONUTILS_H -#define FUNCTIONUTILS_H +#pragma once #include "cpptools_global.h" @@ -60,5 +59,3 @@ public: }; } // namespace CppTools - -#endif // FUNCTIONUTILS_H diff --git a/src/plugins/cpptools/includeutils.h b/src/plugins/cpptools/includeutils.h index d1587be1bd..5375877ded 100644 --- a/src/plugins/cpptools/includeutils.h +++ b/src/plugins/cpptools/includeutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INCLUDEUTILS_H -#define INCLUDEUTILS_H +#pragma once #include "cpptools_global.h" @@ -108,5 +107,3 @@ private: } // namespace IncludeUtils } // namespace CppTools - -#endif // INCLUDEUTILS_H diff --git a/src/plugins/cpptools/indexitem.h b/src/plugins/cpptools/indexitem.h index 3b0aa6d3a3..edfa9a75fa 100644 --- a/src/plugins/cpptools/indexitem.h +++ b/src/plugins/cpptools/indexitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_INDEXITEM_H -#define CPPTOOLS_INDEXITEM_H +#pragma once #include "cpptools_global.h" @@ -133,5 +132,3 @@ private: } // CppTools namespace Q_DECLARE_METATYPE(CppTools::IndexItem::Ptr) - -#endif // CPPTOOLS_INDEXITEM_H diff --git a/src/plugins/cpptools/insertionpointlocator.h b/src/plugins/cpptools/insertionpointlocator.h index 9eb22a89ca..434af1f0e7 100644 --- a/src/plugins/cpptools/insertionpointlocator.h +++ b/src/plugins/cpptools/insertionpointlocator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INSERTIONPOINTLOCATOR_H -#define INSERTIONPOINTLOCATOR_H +#pragma once #include "cpptools_global.h" #include "cpprefactoringchanges.h" @@ -103,5 +102,3 @@ private: }; } // namespace CppTools - -#endif // INSERTIONPOINTLOCATOR_H diff --git a/src/plugins/cpptools/modelmanagertesthelper.h b/src/plugins/cpptools/modelmanagertesthelper.h index 86a331252e..f7ef4ec189 100644 --- a/src/plugins/cpptools/modelmanagertesthelper.h +++ b/src/plugins/cpptools/modelmanagertesthelper.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_INTERNAL_MODELMANAGERTESTHELPER_H -#define CPPTOOLS_INTERNAL_MODELMANAGERTESTHELPER_H +#pragma once #include "cpptools_global.h" #include "cppmodelmanager.h" @@ -90,5 +89,3 @@ private: } // namespace Tests } // namespace CppTools - -#endif // CPPTOOLS_INTERNAL_MODELMANAGERTESTHELPER_H diff --git a/src/plugins/cpptools/projectinfo.h b/src/plugins/cpptools/projectinfo.h index a22656d39c..3f84215f8b 100644 --- a/src/plugins/cpptools/projectinfo.h +++ b/src/plugins/cpptools/projectinfo.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_PROJECTINFO_H -#define CPPTOOLS_PROJECTINFO_H +#pragma once #include "cpptools_global.h" @@ -81,5 +80,3 @@ private: }; } // namespace CppTools - -#endif // CPPTOOLS_PROJECTINFO_H diff --git a/src/plugins/cpptools/projectpart.h b/src/plugins/cpptools/projectpart.h index 897b1ed20b..b18a57e149 100644 --- a/src/plugins/cpptools/projectpart.h +++ b/src/plugins/cpptools/projectpart.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_PROJECTPART_H -#define CPPTOOLS_PROJECTPART_H +#pragma once #include "cpptools_global.h" @@ -117,5 +116,3 @@ public: // fields }; } // namespace CppTools - -#endif // CPPTOOLS_PROJECTPART_H diff --git a/src/plugins/cpptools/projectpartbuilder.h b/src/plugins/cpptools/projectpartbuilder.h index a922b48d4a..91eaca910f 100644 --- a/src/plugins/cpptools/projectpartbuilder.h +++ b/src/plugins/cpptools/projectpartbuilder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_PROJECTPARTBUILDER_H -#define CPPTOOLS_PROJECTPARTBUILDER_H +#pragma once #include "cpptools_global.h" @@ -78,5 +77,3 @@ private: }; } // namespace CppTools - -#endif // CPPTOOLS_PROJECTPARTBUILDER_H diff --git a/src/plugins/cpptools/projectpartheaderpath.h b/src/plugins/cpptools/projectpartheaderpath.h index d12e5bdf72..fb554580e5 100644 --- a/src/plugins/cpptools/projectpartheaderpath.h +++ b/src/plugins/cpptools/projectpartheaderpath.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROJECTPARTHEADERPATH_H -#define PROJECTPARTHEADERPATH_H +#pragma once #include <QVector> @@ -79,4 +78,3 @@ inline uint qHash(const ProjectPartHeaderPath &key, uint seed = 0) return ((qHash(key.path) << 2) | key.type) ^ seed; } } // namespace CppTools -#endif // PROJECTPARTHEADERPATH_H diff --git a/src/plugins/cpptools/searchsymbols.h b/src/plugins/cpptools/searchsymbols.h index 680e1ab51b..68580d6156 100644 --- a/src/plugins/cpptools/searchsymbols.h +++ b/src/plugins/cpptools/searchsymbols.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SEARCHSYMBOLS_H -#define SEARCHSYMBOLS_H +#pragma once #include "cpptools_global.h" #include "cppindexingsupport.h" @@ -114,5 +113,3 @@ private: } // namespace CppTools Q_DECLARE_OPERATORS_FOR_FLAGS(CppTools::SearchSymbols::SymbolTypes) - -#endif // SEARCHSYMBOLS_H diff --git a/src/plugins/cpptools/semantichighlighter.cpp b/src/plugins/cpptools/semantichighlighter.cpp index 672530e3a7..df0107ba63 100644 --- a/src/plugins/cpptools/semantichighlighter.cpp +++ b/src/plugins/cpptools/semantichighlighter.cpp @@ -35,14 +35,16 @@ #include <QLoggingCategory> #include <QTextDocument> -using TextEditor::SemanticHighlighter::incrementalApplyExtraAdditionalFormats; -using TextEditor::SemanticHighlighter::clearExtraAdditionalFormatsUntilEnd; +using namespace TextEditor; + +using SemanticHighlighter::incrementalApplyExtraAdditionalFormats; +using SemanticHighlighter::clearExtraAdditionalFormatsUntilEnd; static Q_LOGGING_CATEGORY(log, "qtc.cpptools.semantichighlighter") namespace CppTools { -SemanticHighlighter::SemanticHighlighter(TextEditor::TextDocument *baseTextDocument) +SemanticHighlighter::SemanticHighlighter(TextDocument *baseTextDocument) : QObject(baseTextDocument) , m_baseTextDocument(baseTextDocument) , m_revision(0) @@ -75,7 +77,7 @@ void SemanticHighlighter::run() disconnectWatcher(); m_watcher->cancel(); } - m_watcher.reset(new QFutureWatcher<TextEditor::HighlightingResult>); + m_watcher.reset(new QFutureWatcher<HighlightingResult>); connectWatcher(); m_revision = documentRevision(); @@ -91,7 +93,7 @@ void SemanticHighlighter::onHighlighterResultAvailable(int from, int to) qCDebug(log) << "onHighlighterResultAvailable()" << from << to; - TextEditor::SyntaxHighlighter *highlighter = m_baseTextDocument->syntaxHighlighter(); + SyntaxHighlighter *highlighter = m_baseTextDocument->syntaxHighlighter(); QTC_ASSERT(highlighter, return); incrementalApplyExtraAdditionalFormats(highlighter, m_watcher->future(), from, to, m_formatMap); } @@ -100,9 +102,8 @@ void SemanticHighlighter::onHighlighterFinished() { QTC_ASSERT(m_watcher, return); if (!m_watcher->isCanceled() && documentRevision() == m_revision) { - TextEditor::SyntaxHighlighter *highlighter = m_baseTextDocument->syntaxHighlighter(); - QTC_CHECK(highlighter); - if (highlighter) { + SyntaxHighlighter *highlighter = m_baseTextDocument->syntaxHighlighter(); + if (QTC_GUARD(highlighter)) { qCDebug(log) << "onHighlighterFinished() - clearing formats"; clearExtraAdditionalFormatsUntilEnd(highlighter, m_watcher->future()); } @@ -112,7 +113,7 @@ void SemanticHighlighter::onHighlighterFinished() void SemanticHighlighter::connectWatcher() { - typedef QFutureWatcher<TextEditor::HighlightingResult> Watcher; + typedef QFutureWatcher<HighlightingResult> Watcher; connect(m_watcher.data(), &Watcher::resultsReadyAt, this, &SemanticHighlighter::onHighlighterResultAvailable); connect(m_watcher.data(), &Watcher::finished, @@ -121,7 +122,7 @@ void SemanticHighlighter::connectWatcher() void SemanticHighlighter::disconnectWatcher() { - typedef QFutureWatcher<TextEditor::HighlightingResult> Watcher; + typedef QFutureWatcher<HighlightingResult> Watcher; disconnect(m_watcher.data(), &Watcher::resultsReadyAt, this, &SemanticHighlighter::onHighlighterResultAvailable); disconnect(m_watcher.data(), &Watcher::finished, @@ -137,18 +138,18 @@ void SemanticHighlighter::updateFormatMapFromFontSettings() { QTC_ASSERT(m_baseTextDocument, return); - const TextEditor::FontSettings &fs = m_baseTextDocument->fontSettings(); - - m_formatMap[TypeUse] = fs.toTextCharFormat(TextEditor::C_TYPE); - m_formatMap[LocalUse] = fs.toTextCharFormat(TextEditor::C_LOCAL); - m_formatMap[FieldUse] = fs.toTextCharFormat(TextEditor::C_FIELD); - m_formatMap[EnumerationUse] = fs.toTextCharFormat(TextEditor::C_ENUMERATION); - m_formatMap[VirtualMethodUse] = fs.toTextCharFormat(TextEditor::C_VIRTUAL_METHOD); - m_formatMap[LabelUse] = fs.toTextCharFormat(TextEditor::C_LABEL); - m_formatMap[MacroUse] = fs.toTextCharFormat(TextEditor::C_PREPROCESSOR); - m_formatMap[FunctionUse] = fs.toTextCharFormat(TextEditor::C_FUNCTION); - m_formatMap[PseudoKeywordUse] = fs.toTextCharFormat(TextEditor::C_KEYWORD); - m_formatMap[StringUse] = fs.toTextCharFormat(TextEditor::C_STRING); + const FontSettings &fs = m_baseTextDocument->fontSettings(); + + m_formatMap[TypeUse] = fs.toTextCharFormat(C_TYPE); + m_formatMap[LocalUse] = fs.toTextCharFormat(C_LOCAL); + m_formatMap[FieldUse] = fs.toTextCharFormat(C_FIELD); + m_formatMap[EnumerationUse] = fs.toTextCharFormat(C_ENUMERATION); + m_formatMap[VirtualMethodUse] = fs.toTextCharFormat(C_VIRTUAL_METHOD); + m_formatMap[LabelUse] = fs.toTextCharFormat(C_LABEL); + m_formatMap[MacroUse] = fs.toTextCharFormat(C_PREPROCESSOR); + m_formatMap[FunctionUse] = fs.toTextCharFormat(C_FUNCTION); + m_formatMap[PseudoKeywordUse] = fs.toTextCharFormat(C_KEYWORD); + m_formatMap[StringUse] = fs.toTextCharFormat(C_STRING); } } // namespace CppTools diff --git a/src/plugins/cpptools/semantichighlighter.h b/src/plugins/cpptools/semantichighlighter.h index f69a8d73c7..6305da03d7 100644 --- a/src/plugins/cpptools/semantichighlighter.h +++ b/src/plugins/cpptools/semantichighlighter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SEMANTICHIGHLIGHTER_H -#define SEMANTICHIGHLIGHTER_H +#pragma once #include "cpptools_global.h" @@ -92,5 +91,3 @@ private: }; } // namespace CppTools - -#endif // SEMANTICHIGHLIGHTER_H diff --git a/src/plugins/cpptools/senddocumenttracker.h b/src/plugins/cpptools/senddocumenttracker.h index 70ada43e53..be84a8b16a 100644 --- a/src/plugins/cpptools/senddocumenttracker.h +++ b/src/plugins/cpptools/senddocumenttracker.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_SENDDOCUMENTTRACKER_H -#define CPPTOOLS_SENDDOCUMENTTRACKER_H +#pragma once #include "cpptools_global.h" @@ -57,5 +56,3 @@ private: }; } // namespace CppTools - -#endif // CPPTOOLS_SENDDOCUMENTTRACKER_H diff --git a/src/plugins/cpptools/stringtable.h b/src/plugins/cpptools/stringtable.h index c1ee1689f1..62ad48b138 100644 --- a/src/plugins/cpptools/stringtable.h +++ b/src/plugins/cpptools/stringtable.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STRINGTABLE_H -#define STRINGTABLE_H +#pragma once #include <QAtomicInt> #include <QMutex> @@ -69,5 +68,3 @@ private: } // Internal namespace } // CppTools namespace - -#endif // STRINGTABLE_H diff --git a/src/plugins/cpptools/symbolfinder.h b/src/plugins/cpptools/symbolfinder.h index b463a1287d..a8cf2e6bb7 100644 --- a/src/plugins/cpptools/symbolfinder.h +++ b/src/plugins/cpptools/symbolfinder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SYMBOLFINDER_H -#define SYMBOLFINDER_H +#pragma once #include "cpptools_global.h" @@ -84,6 +83,3 @@ private: }; } // namespace CppTools - -#endif // SYMBOLFINDER_H - diff --git a/src/plugins/cpptools/symbolsfindfilter.h b/src/plugins/cpptools/symbolsfindfilter.h index 837aabca2f..52b2cde5d9 100644 --- a/src/plugins/cpptools/symbolsfindfilter.h +++ b/src/plugins/cpptools/symbolsfindfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SYMBOLSFINDFILTER_H -#define SYMBOLSFINDFILTER_H +#pragma once #include "searchsymbols.h" @@ -123,5 +122,3 @@ private: } // Internal } // CppTools - -#endif // SYMBOLSFINDFILTER_H diff --git a/src/plugins/cpptools/typehierarchybuilder.h b/src/plugins/cpptools/typehierarchybuilder.h index 00ed68596f..055794687e 100644 --- a/src/plugins/cpptools/typehierarchybuilder.h +++ b/src/plugins/cpptools/typehierarchybuilder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPPTOOLS_TYPEHIERARCHYBUILDER_H -#define CPPTOOLS_TYPEHIERARCHYBUILDER_H +#pragma once #include "cpptools_global.h" @@ -77,5 +76,3 @@ private: }; } // CppTools - -#endif // CPPTOOLS_TYPEHIERARCHYBUILDER_H diff --git a/src/plugins/debugger/analyzer/analyzerconstants.h b/src/plugins/debugger/analyzer/analyzerconstants.h index c2554f42c2..4260d718c8 100644 --- a/src/plugins/debugger/analyzer/analyzerconstants.h +++ b/src/plugins/debugger/analyzer/analyzerconstants.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef ANALYZERCONSTANTS_H -#define ANALYZERCONSTANTS_H +#pragma once #include <QtGlobal> @@ -45,5 +44,3 @@ const char ANALYZERTASK_ID[] = "Analyzer.TaskId"; } // namespace Constants } // namespace Debugger - -#endif // ANALYZERCONSTANTS_H diff --git a/src/plugins/debugger/analyzer/analyzericons.h b/src/plugins/debugger/analyzer/analyzericons.h index c12014220f..ac09fe84ef 100644 --- a/src/plugins/debugger/analyzer/analyzericons.h +++ b/src/plugins/debugger/analyzer/analyzericons.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANALYZERICONS_H -#define ANALYZERICONS_H +#pragma once #include <utils/icon.h> @@ -43,5 +42,3 @@ const Utils::Icon MODE_ANALYZE_FLAT_ACTIVE({ } // namespace Icons } // namespace Debugger - -#endif // ANALYZERICONS_H diff --git a/src/plugins/debugger/analyzer/analyzermanager.h b/src/plugins/debugger/analyzer/analyzermanager.h index 70209ea291..c853418d89 100644 --- a/src/plugins/debugger/analyzer/analyzermanager.h +++ b/src/plugins/debugger/analyzer/analyzermanager.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef ANALYZERMANAGER_H -#define ANALYZERMANAGER_H +#pragma once #include "analyzerconstants.h" @@ -150,5 +149,3 @@ DEBUGGER_EXPORT AnalyzerRunControl *createAnalyzerRunControl( ProjectExplorer::RunConfiguration *runConfiguration, Core::Id runMode); } // namespace Debugger - -#endif // ANALYZERMANAGER_H diff --git a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.h b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.h index ad4ba8cc2d..23d028ff95 100644 --- a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.h +++ b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef ANALYZERRUNCONFIGWIDGET_H -#define ANALYZERRUNCONFIGWIDGET_H +#pragma once #include <debugger/debugger_global.h> @@ -63,5 +62,3 @@ private: }; } // namespace Debugger - -#endif // ANALYZERRUNCONFIGWIDGET_H diff --git a/src/plugins/debugger/analyzer/analyzerruncontrol.h b/src/plugins/debugger/analyzer/analyzerruncontrol.h index a919a7f363..a990bc8655 100644 --- a/src/plugins/debugger/analyzer/analyzerruncontrol.h +++ b/src/plugins/debugger/analyzer/analyzerruncontrol.h @@ -24,14 +24,14 @@ ** ****************************************************************************/ -#ifndef ANALYZERRUNCONTROL_H -#define ANALYZERRUNCONTROL_H +#pragma once #include <debugger/debugger_global.h> #include <projectexplorer/runconfiguration.h> #include <utils/outputformat.h> +#include <utils/port.h> namespace Debugger { @@ -52,7 +52,7 @@ public: virtual void pause() {} virtual void unpause() {} - virtual void notifyRemoteSetupDone(quint16) {} + virtual void notifyRemoteSetupDone(Utils::Port) {} virtual void notifyRemoteFinished() {} signals: @@ -66,5 +66,3 @@ private: }; } // namespace Debugger - -#endif // ANALYZERRUNCONTROL_H diff --git a/src/plugins/debugger/analyzer/analyzerstartparameters.h b/src/plugins/debugger/analyzer/analyzerstartparameters.h index 73226c0e33..d12deea850 100644 --- a/src/plugins/debugger/analyzer/analyzerstartparameters.h +++ b/src/plugins/debugger/analyzer/analyzerstartparameters.h @@ -23,13 +23,13 @@ ** ****************************************************************************/ -#ifndef ANALYZERSTARTPARAMETERS_H -#define ANALYZERSTARTPARAMETERS_H +#pragma once #include <debugger/debugger_global.h> #include <projectexplorer/runnables.h> #include <ssh/sshconnection.h> +#include <utils/port.h> #include <QMetaType> @@ -41,11 +41,9 @@ public: QSsh::SshConnectionParameters connParams; QString analyzerHost; QString analyzerSocket; - quint16 analyzerPort = 0; + Utils::Port analyzerPort; }; DEBUGGER_EXPORT bool operator==(const AnalyzerConnection &c1, const AnalyzerConnection &c2); } // namespace Debugger - -#endif // ANALYZERSTARTPARAMETERS_H diff --git a/src/plugins/debugger/analyzer/analyzerutils.h b/src/plugins/debugger/analyzer/analyzerutils.h index 65f3de5f30..1c5327d4fe 100644 --- a/src/plugins/debugger/analyzer/analyzerutils.h +++ b/src/plugins/debugger/analyzer/analyzerutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANALYZERUTILS_H -#define ANALYZERUTILS_H +#pragma once #include <debugger/debugger_global.h> @@ -38,5 +37,3 @@ namespace AnalyzerUtils DEBUGGER_EXPORT void logToIssuesPane(ProjectExplorer::Task::TaskType type, const QString &message); } - -#endif // ANALYZERUTILS_H diff --git a/src/plugins/debugger/analyzer/detailederrorview.h b/src/plugins/debugger/analyzer/detailederrorview.h index 3e10e1e3d9..74fbc78aab 100644 --- a/src/plugins/debugger/analyzer/detailederrorview.h +++ b/src/plugins/debugger/analyzer/detailederrorview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DETAILEDERRORVIEW_H -#define DETAILEDERRORVIEW_H +#pragma once #include <debugger/debugger_global.h> @@ -69,5 +68,3 @@ private: }; } // namespace Debugger - -#endif // DETAILEDERRORVIEW_H diff --git a/src/plugins/debugger/analyzer/diagnosticlocation.h b/src/plugins/debugger/analyzer/diagnosticlocation.h index 61fdbe2298..31f9036f44 100644 --- a/src/plugins/debugger/analyzer/diagnosticlocation.h +++ b/src/plugins/debugger/analyzer/diagnosticlocation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANALYZERDIAGNOSTIC_H -#define ANALYZERDIAGNOSTIC_H +#pragma once #include <debugger/debugger_global.h> @@ -55,6 +54,3 @@ DEBUGGER_EXPORT QDebug operator<<(QDebug dbg, const DiagnosticLocation &location } // namespace Debugger Q_DECLARE_METATYPE(Debugger::DiagnosticLocation) - -#endif // Include guard. - diff --git a/src/plugins/debugger/analyzer/startremotedialog.h b/src/plugins/debugger/analyzer/startremotedialog.h index ff559a51bf..b7e1c33787 100644 --- a/src/plugins/debugger/analyzer/startremotedialog.h +++ b/src/plugins/debugger/analyzer/startremotedialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STARTREMOTEDIALOG_H -#define STARTREMOTEDIALOG_H +#pragma once #include <debugger/debugger_global.h> @@ -57,5 +56,3 @@ private: }; } // namespace Debugger - -#endif // STARTREMOTEDIALOG_H diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index 150cfd4375..af1ac48556 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_BREAKHANDLER_H -#define DEBUGGER_BREAKHANDLER_H +#pragma once #include "breakpoint.h" #include "debuggerprotocol.h" @@ -235,5 +234,3 @@ private: } // namespace Debugger Q_DECLARE_METATYPE(Debugger::Internal::Breakpoint) - -#endif // DEBUGGER_BREAKHANDLER_H diff --git a/src/plugins/debugger/breakpoint.h b/src/plugins/debugger/breakpoint.h index 509f1660c6..deabf6b028 100644 --- a/src/plugins/debugger/breakpoint.h +++ b/src/plugins/debugger/breakpoint.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_BREAKPOINT_H -#define DEBUGGER_BREAKPOINT_H +#pragma once #include <QMetaType> #include <QString> @@ -232,6 +231,3 @@ inline uint qHash(const Debugger::Internal::BreakpointModelId &id) Q_DECLARE_METATYPE(Debugger::Internal::BreakpointModelId) Q_DECLARE_METATYPE(Debugger::Internal::BreakpointResponseId) - - -#endif // DEBUGGER_BREAKPOINT_H diff --git a/src/plugins/debugger/breakwindow.h b/src/plugins/debugger/breakwindow.h index 1af4d25c2a..7feba0c14f 100644 --- a/src/plugins/debugger/breakwindow.h +++ b/src/plugins/debugger/breakwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_BREAKWINDOW_H -#define DEBUGGER_BREAKWINDOW_H +#pragma once #include "breakhandler.h" #include <utils/basetreeview.h> @@ -58,6 +57,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_BREAKWINDOW - diff --git a/src/plugins/debugger/cdb/bytearrayinputstream.h b/src/plugins/debugger/cdb/bytearrayinputstream.h index 2468d361b8..2d2a0f5083 100644 --- a/src/plugins/debugger/cdb/bytearrayinputstream.h +++ b/src/plugins/debugger/cdb/bytearrayinputstream.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BYTEARRAYINPUTSTREAM_H -#define BYTEARRAYINPUTSTREAM_H +#pragma once #include <QString> @@ -100,5 +99,3 @@ QByteArray simplify(const QByteArray &inIn); } // namespace Internal } // namespace Debugger - -#endif // BYTEARRAYINPUTSTREAM_H diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 4c064583e4..1343fc32c0 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -549,7 +549,7 @@ bool CdbEngine::launchCDB(const DebuggerRunParameters &sp, QString *errorMessage arguments << QLatin1String("-srcpath") << sourcePaths.join(QLatin1Char(';')); // Compile argument string preserving quotes - QString nativeArguments = stringSetting(CdbAdditionalArguments); + QString nativeArguments = expand(stringSetting(CdbAdditionalArguments)); switch (sp.startMode) { case StartInternal: case StartExternal: diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h index 536157f9ce..fd5118e50f 100644 --- a/src/plugins/debugger/cdb/cdbengine.h +++ b/src/plugins/debugger/cdb/cdbengine.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_CDBENGINE_H -#define DEBUGGER_CDBENGINE_H +#pragma once #include <debugger/debuggerengine.h> #include <debugger/breakhandler.h> @@ -265,5 +264,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_CDBENGINE_H diff --git a/src/plugins/debugger/cdb/cdboptionspage.h b/src/plugins/debugger/cdb/cdboptionspage.h index 8ad0d4017c..041c69198d 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.h +++ b/src/plugins/debugger/cdb/cdboptionspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CDBOPTIONSPAGE_H -#define CDBOPTIONSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> #include <utils/savedaction.h> @@ -128,5 +127,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // CDBOPTIONSPAGE_H diff --git a/src/plugins/debugger/cdb/cdbparsehelpers.h b/src/plugins/debugger/cdb/cdbparsehelpers.h index 7bd4322ea6..ebed376db5 100644 --- a/src/plugins/debugger/cdb/cdbparsehelpers.h +++ b/src/plugins/debugger/cdb/cdbparsehelpers.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CDBPARSEHELPERS_H -#define CDBPARSEHELPERS_H +#pragma once #include <debugger/breakpoint.h> @@ -98,5 +97,3 @@ QDebug operator<<(QDebug s, const WinException &e); } // namespace Internal } // namespace Debugger - -#endif // CDBPARSEHELPERS_H diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h index 8394fb91db..05f4a120fa 100644 --- a/src/plugins/debugger/commonoptionspage.h +++ b/src/plugins/debugger/commonoptionspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_COMMONOPTIONSPAGE_H -#define DEBUGGER_COMMONOPTIONSPAGE_H +#pragma once #include "debuggersourcepathmappingwidget.h" @@ -99,5 +98,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_COMMONOPTIONSPAGE_H diff --git a/src/plugins/debugger/console/console.h b/src/plugins/debugger/console/console.h index 40a8f1d7a4..22938bbc3d 100644 --- a/src/plugins/debugger/console/console.h +++ b/src/plugins/debugger/console/console.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_CONSOLE_H -#define DEBUGGER_CONSOLE_H +#pragma once #include "consoleitem.h" @@ -101,5 +100,3 @@ Console *debuggerConsole(); } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_CONSOLE_H diff --git a/src/plugins/debugger/console/consoleedit.h b/src/plugins/debugger/console/consoleedit.h index 73691f30fe..b27348f6d9 100644 --- a/src/plugins/debugger/console/consoleedit.h +++ b/src/plugins/debugger/console/consoleedit.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_CONSOLEEDIT_H -#define DEBUGGER_CONSOLEEDIT_H +#pragma once #include <QModelIndex> #include <QString> @@ -60,5 +59,3 @@ private: } // Debugger } // Internal - -#endif // DEBUGGER_CONSOLEEDIT_H diff --git a/src/plugins/debugger/console/consoleitem.h b/src/plugins/debugger/console/consoleitem.h index 3567d35f70..0fd530d3fd 100644 --- a/src/plugins/debugger/console/consoleitem.h +++ b/src/plugins/debugger/console/consoleitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONSOLEITEM_H -#define CONSOLEITEM_H +#pragma once #include <utils/treemodel.h> @@ -82,5 +81,3 @@ private: } // Internal } // Debugger - -#endif // CONSOLEITEM_H diff --git a/src/plugins/debugger/console/consoleitemdelegate.h b/src/plugins/debugger/console/consoleitemdelegate.h index 114f6ef596..2016a38647 100644 --- a/src/plugins/debugger/console/consoleitemdelegate.h +++ b/src/plugins/debugger/console/consoleitemdelegate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_CONSOLEITEMDELEGATE_H -#define DEBUGGER_CONSOLEITEMDELEGATE_H +#pragma once #include "consoleitemmodel.h" #include "console.h" @@ -173,5 +172,3 @@ public: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_CONSOLEITEMDELEGATE_H diff --git a/src/plugins/debugger/console/consoleitemmodel.h b/src/plugins/debugger/console/consoleitemmodel.h index d5a2a98bfc..c0c7c8485b 100644 --- a/src/plugins/debugger/console/consoleitemmodel.h +++ b/src/plugins/debugger/console/consoleitemmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_CONSOLEITEMMODEL_H -#define DEBUGGER_CONSOLEITEMMODEL_H +#pragma once #include "consoleitem.h" #include <utils/treemodel.h> @@ -64,5 +63,3 @@ private: } // Internal } // Debugger - -#endif // DEBUGGER_CONSOLEITEMMODEL_H diff --git a/src/plugins/debugger/console/consoleproxymodel.h b/src/plugins/debugger/console/consoleproxymodel.h index 5cc9975025..f02346f66c 100644 --- a/src/plugins/debugger/console/consoleproxymodel.h +++ b/src/plugins/debugger/console/consoleproxymodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_CONSOLEPROXYMODEL_H -#define DEBUGGER_CONSOLEPROXYMODEL_H +#pragma once #include "consoleitem.h" @@ -62,5 +61,3 @@ private: } // Internal } // Debugger - -#endif // DEBUGGER_CONSOLEPROXYMODEL_H diff --git a/src/plugins/debugger/console/consoleview.h b/src/plugins/debugger/console/consoleview.h index 7b5a5b31fd..3aedd125e1 100644 --- a/src/plugins/debugger/console/consoleview.h +++ b/src/plugins/debugger/console/consoleview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_CONSOLEVIEW_H -#define DEBUGGER_CONSOLEVIEW_H +#pragma once #include <utils/itemviews.h> @@ -61,5 +60,3 @@ private: } // Internal } // Debugger - -#endif // DEBUGGER_CONSOLEVIEW_H diff --git a/src/plugins/debugger/debugger_global.h b/src/plugins/debugger/debugger_global.h index f19f63874f..fc1597cc82 100644 --- a/src/plugins/debugger/debugger_global.h +++ b/src/plugins/debugger/debugger_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGERGLOBAL_H -#define DEBUGGERGLOBAL_H +#pragma once #include <QtGlobal> @@ -33,5 +32,3 @@ #else # define DEBUGGER_EXPORT Q_DECL_IMPORT #endif - -#endif // DEBUGGERGLOBAL_H diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index 6c1a7100e3..b1f180c53c 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_ACTIONS_H -#define DEBUGGER_ACTIONS_H +#pragma once #include <QObject> #include <QHash> @@ -181,5 +180,3 @@ enum DebuggerActionCode } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_WATCHWINDOW_H diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index 5964860883..0cac2e2628 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGERCONSTANTS_H -#define DEBUGGERCONSTANTS_H +#pragma once #include <QFlags> @@ -213,5 +212,3 @@ enum DebuggerLanguage Q_DECLARE_FLAGS(DebuggerLanguages, DebuggerLanguage) } // namespace Debugger - -#endif // DEBUGGERCONSTANTS_H diff --git a/src/plugins/debugger/debuggercore.h b/src/plugins/debugger/debuggercore.h index 80e1f9b88a..2b5557f4fd 100644 --- a/src/plugins/debugger/debuggercore.h +++ b/src/plugins/debugger/debuggercore.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGERCORE_H -#define DEBUGGERCORE_H +#pragma once #include "debuggerconstants.h" @@ -111,5 +110,3 @@ bool isReverseDebuggingEnabled(); } // namespace Internal } // namespace Debugger - -#endif // DEBUGGERPLUGIN_H diff --git a/src/plugins/debugger/debuggerdialogs.h b/src/plugins/debugger/debuggerdialogs.h index 8b17bbddfc..6365c3baf5 100644 --- a/src/plugins/debugger/debuggerdialogs.h +++ b/src/plugins/debugger/debuggerdialogs.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_DIALOGS_H -#define DEBUGGER_DIALOGS_H +#pragma once #include "watchhandler.h" @@ -192,5 +191,3 @@ private: } // namespace Debugger } // namespace Internal - -#endif // DEBUGGER_DIALOGS_H diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 92dd21b994..1c9f374182 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -900,26 +900,27 @@ void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &re if (result.success) { showMessage(_("NOTE: REMOTE SETUP DONE: GDB SERVER PORT: %1 QML PORT %2") - .arg(result.gdbServerPort).arg(result.qmlServerPort)); + .arg(result.gdbServerPort.number()).arg(result.qmlServerPort.number())); if (d->remoteSetupState() != RemoteSetupCancelled) d->setRemoteSetupState(RemoteSetupSucceeded); - if (result.gdbServerPort != InvalidPid) { + if (result.gdbServerPort.isValid()) { QString &rc = d->m_runParameters.remoteChannel; const int sepIndex = rc.lastIndexOf(QLatin1Char(':')); if (sepIndex != -1) { rc.replace(sepIndex + 1, rc.count() - sepIndex - 1, - QString::number(result.gdbServerPort)); + QString::number(result.gdbServerPort.number())); } } else if (result.inferiorPid != InvalidPid && runParameters().startMode == AttachExternal) { // e.g. iOS Simulator runParameters().attachPID = result.inferiorPid; } - if (result.qmlServerPort != InvalidPort) { + if (result.qmlServerPort.isValid()) { d->m_runParameters.qmlServerPort = result.qmlServerPort; - d->m_runParameters.inferior.commandLineArguments.replace(_("%qml_port%"), QString::number(result.qmlServerPort)); + d->m_runParameters.inferior.commandLineArguments.replace( + _("%qml_port%"), QString::number(result.qmlServerPort.number())); } } else { @@ -1337,6 +1338,16 @@ void DebuggerEngine::removeBreakpointMarker(const Breakpoint &bp) d->m_disassemblerAgent.removeBreakpointMarker(bp); } +QString DebuggerEngine::expand(const QString &string) const +{ + return d->m_runParameters.macroExpander->expand(string); +} + +QByteArray DebuggerEngine::expand(const QByteArray &string) const +{ + return d->m_runParameters.macroExpander->expand(string); +} + void DebuggerEngine::updateBreakpointMarker(const Breakpoint &bp) { d->m_disassemblerAgent.updateBreakpointMarker(bp); diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 4d82620f6e..d3afc56ddd 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_DEBUGGERENGINE_H -#define DEBUGGER_DEBUGGERENGINE_H +#pragma once #include "debugger_global.h" #include "debuggerconstants.h" @@ -44,6 +43,7 @@ class QAbstractItemModel; QT_END_NAMESPACE namespace Core { class IOptionsPage; } +namespace Utils { class MacroExpander; } namespace Debugger { @@ -80,6 +80,7 @@ class DebuggerRunParameters : public DebuggerStartParameters { public: DebuggerRunParameters() {} + DebuggerRunParameters(const DebuggerStartParameters &sp) : DebuggerStartParameters(sp) {} DebuggerEngineType masterEngineType = NoEngineType; DebuggerEngineType cppEngineType = NoEngineType; @@ -112,6 +113,8 @@ public: bool nativeMixedEnabled = false; + Utils::MacroExpander *macroExpander = 0; + // For Debugger testing. int testCase = 0; }; @@ -319,6 +322,9 @@ public: void updateBreakpointMarker(const Breakpoint &bp); void removeBreakpointMarker(const Breakpoint &bp); + QString expand(const QString &string) const; + QByteArray expand(const QByteArray &string) const; + signals: void stateChanged(Debugger::DebuggerState state); // A new stack frame is on display including locals. @@ -478,5 +484,3 @@ DebuggerRunControl *createAndScheduleRun(const DebuggerRunParameters &rp, const Q_DECLARE_METATYPE(Debugger::Internal::UpdateParameters) Q_DECLARE_METATYPE(Debugger::Internal::ContextData) - -#endif // DEBUGGER_DEBUGGERENGINE_H diff --git a/src/plugins/debugger/debuggericons.h b/src/plugins/debugger/debuggericons.h index 15cf5f114c..6291d426c5 100644 --- a/src/plugins/debugger/debuggericons.h +++ b/src/plugins/debugger/debuggericons.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGERICONS_H -#define DEBUGGERICONS_H +#pragma once #include <utils/icon.h> @@ -107,5 +106,3 @@ const Utils::Icon MODE_DEBUGGER_FLAT_ACTIVE({ } // namespace Icons } // namespace Debugger - -#endif // DEBUGGERICONS_H diff --git a/src/plugins/debugger/debuggerinternalconstants.h b/src/plugins/debugger/debuggerinternalconstants.h index 3b9f65977c..9ff0611cac 100644 --- a/src/plugins/debugger/debuggerinternalconstants.h +++ b/src/plugins/debugger/debuggerinternalconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGERINTERNALCONSTANTS_H -#define DEBUGGERINTERNALCONSTANTS_H +#pragma once #include <QtGlobal> @@ -99,6 +98,3 @@ enum ModelRoles }; } // namespace Debugger - -#endif // DEBUGGERINTERNALCONSTANTS_H - diff --git a/src/plugins/debugger/debuggeritem.h b/src/plugins/debugger/debuggeritem.h index 2e0e6ea5af..e48b0108b5 100644 --- a/src/plugins/debugger/debuggeritem.h +++ b/src/plugins/debugger/debuggeritem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_DEBUGGERITEM_H -#define DEBUGGER_DEBUGGERITEM_H +#pragma once #include "debugger_global.h" #include "debuggerconstants.h" @@ -123,5 +122,3 @@ private: }; } // namespace Debugger - -#endif // DEBUGGER_DEBUGGERITEM_H diff --git a/src/plugins/debugger/debuggeritemmanager.h b/src/plugins/debugger/debuggeritemmanager.h index 620c097c40..c4a7101ec9 100644 --- a/src/plugins/debugger/debuggeritemmanager.h +++ b/src/plugins/debugger/debuggeritemmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_DEBUGGERITEMMANAGER_H -#define DEBUGGER_DEBUGGERITEMMANAGER_H +#pragma once #include "debugger_global.h" #include "debuggerconstants.h" @@ -72,5 +71,3 @@ private: }; } // namespace Debugger - -#endif // DEBUGGER_DEBUGGERITEMMANAGER_H diff --git a/src/plugins/debugger/debuggerkitconfigwidget.h b/src/plugins/debugger/debuggerkitconfigwidget.h index a6fd2a09e6..ff89d4e70d 100644 --- a/src/plugins/debugger/debuggerkitconfigwidget.h +++ b/src/plugins/debugger/debuggerkitconfigwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_DEBUGGERKITCONFIGWIDGET_H -#define DEBUGGER_DEBUGGERKITCONFIGWIDGET_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> #include <projectexplorer/kitconfigwidget.h> @@ -81,5 +80,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_DEBUGGERKITCONFIGWIDGET_H diff --git a/src/plugins/debugger/debuggerkitinformation.h b/src/plugins/debugger/debuggerkitinformation.h index 5cc0498cd0..44af814954 100644 --- a/src/plugins/debugger/debuggerkitinformation.h +++ b/src/plugins/debugger/debuggerkitinformation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_DEBUGGERKITINFORMATION_H -#define DEBUGGER_DEBUGGERKITINFORMATION_H +#pragma once #include "debugger_global.h" #include "debuggerconstants.h" @@ -68,5 +67,3 @@ public: }; } // namespace Debugger - -#endif // DEBUGGER_DEBUGGERKITINFORMATION_H diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index c8fc6ee330..d4b6a8c955 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -202,7 +202,7 @@ void DebuggerMainWindow::finalizeSetup() addDockWidget(Qt::BottomDockWidgetArea, dock); } -QWidget *createModeWindow(Core::IMode *mode, DebuggerMainWindow *mainWindow, QWidget *central) +QWidget *createModeWindow(const Core::Id &mode, DebuggerMainWindow *mainWindow, QWidget *central) { if (!central) central = new EditorManagerPlaceHolder(mode); diff --git a/src/plugins/debugger/debuggermainwindow.h b/src/plugins/debugger/debuggermainwindow.h index 28bb312580..5fe6c86c2f 100644 --- a/src/plugins/debugger/debuggermainwindow.h +++ b/src/plugins/debugger/debuggermainwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGERMAINWINDOW_H -#define DEBUGGERMAINWINDOW_H +#pragma once #include "debugger_global.h" @@ -41,7 +40,7 @@ class QComboBox; class QStackedWidget; QT_END_NAMESPACE -namespace Core { class IMode; } +namespace Core { class Id; } namespace Utils { @@ -136,8 +135,6 @@ private: QHash<QByteArray, Perspective> m_perspectiveForPerspectiveId; }; -QWidget *createModeWindow(Core::IMode *mode, DebuggerMainWindow *mainWindow, QWidget *central); +DEBUGGER_EXPORT QWidget *createModeWindow(const Core::Id &mode, DebuggerMainWindow *mainWindow, QWidget *central); } // Utils - -#endif // DEBUGGERMAINWINDOW_H diff --git a/src/plugins/debugger/debuggeroptionspage.h b/src/plugins/debugger/debuggeroptionspage.h index d7ac28cd8f..804addf3df 100644 --- a/src/plugins/debugger/debuggeroptionspage.h +++ b/src/plugins/debugger/debuggeroptionspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_DEBUGGEROPTIONSPAGE_H -#define DEBUGGER_DEBUGGEROPTIONSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -53,5 +52,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_DEBUGGEROPTIONSPAGE_H diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 89e9023aa4..75ed55aff3 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -680,7 +680,7 @@ public: void activateDebugMode(); void toggleBreakpointHelper(); void toggleBreakpoint(const ContextData &location, const QString &tracePointMessage = QString()); - void onModeChanged(IMode *mode); + void onModeChanged(Id mode); void updateDebugWithoutDeployMenu(); void startAndDebugApplication(); @@ -1729,7 +1729,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, // Debug mode setup m_mode = new DebugMode; - m_modeWindow = createModeWindow(m_mode, m_mainWindow, 0); + m_modeWindow = createModeWindow(Constants::MODE_DEBUG, m_mainWindow, 0); m_mode->setWidget(m_modeWindow); m_plugin->addAutoReleasedObject(new DebugModeContext(m_mainWindow)); @@ -2107,8 +2107,10 @@ void DebuggerPluginPrivate::attachToQmlPort() const QVariant qmlServerPort = configValue("LastQmlServerPort"); if (qmlServerPort.isValid()) dlg.setPort(qmlServerPort.toInt()); + else if (rp.qmlServerPort.isValid()) + dlg.setPort(rp.qmlServerPort.number()); else - dlg.setPort(rp.qmlServerPort); + dlg.setPort(-1); const Id kitId = Id::fromSetting(configValue("LastProfile")); if (kitId.isValid()) @@ -2127,7 +2129,7 @@ void DebuggerPluginPrivate::attachToQmlPort() rp.connParams = device->sshParameters(); rp.qmlServerAddress = device->qmlProfilerHost(); } - rp.qmlServerPort = dlg.port(); + rp.qmlServerPort = Utils::Port(dlg.port()); rp.startMode = AttachToRemoteProcess; rp.closeMode = KillAtClose; rp.languages = QmlLanguage; @@ -2702,8 +2704,7 @@ void DebuggerPluginPrivate::dumpLog() /*! Activates the previous mode when the current mode is the debug mode. */ void DebuggerPluginPrivate::activatePreviousMode() { - if (ModeManager::currentMode() == ModeManager::mode(MODE_DEBUG) - && m_previousMode.isValid()) { + if (ModeManager::currentMode() == MODE_DEBUG && m_previousMode.isValid()) { // If stopping the application also makes Qt Creator active (as the // "previously active application"), doing the switch synchronously // leads to funny effects with floating dock widgets @@ -2863,7 +2864,7 @@ static QString formatStartParameters(DebuggerRunParameters &sp) } if (!sp.qmlServerAddress.isEmpty()) str << "QML server: " << sp.qmlServerAddress << ':' - << sp.qmlServerPort << '\n'; + << (sp.qmlServerPort.isValid() ? sp.qmlServerPort.number() : -1) << '\n'; if (!sp.remoteChannel.isEmpty()) str << "Remote: " << sp.remoteChannel << '\n'; str << "Sysroot: " << sp.sysRoot << '\n'; @@ -2959,8 +2960,7 @@ bool boolSetting(int code) QString stringSetting(int code) { - QString raw = dd->m_debuggerSettings->item(code)->value().toString(); - return globalMacroExpander()->expand(raw); + return dd->m_debuggerSettings->item(code)->value().toString(); } QStringList stringListSetting(int code) @@ -3318,13 +3318,13 @@ void DebuggerPluginPrivate::updateActiveLanguages() // return QObject::eventFilter(obj, event); //} -void DebuggerPluginPrivate::onModeChanged(IMode *mode) +void DebuggerPluginPrivate::onModeChanged(Id mode) { // FIXME: This one gets always called, even if switching between modes // different then the debugger mode. E.g. Welcome and Help mode and // also on shutdown. - if (mode && mode->id() == MODE_DEBUG) { + if (mode == MODE_DEBUG) { if (IEditor *editor = EditorManager::currentEditor()) editor->widget()->setFocus(); @@ -3360,7 +3360,7 @@ void DebuggerPluginPrivate::onModeChanged(IMode *mode) void saveModeToRestore() { - dd->m_previousMode = ModeManager::currentMode()->id(); + dd->m_previousMode = ModeManager::currentMode(); } } // namespace Internal diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h index 1d682b610d..5090960860 100644 --- a/src/plugins/debugger/debuggerplugin.h +++ b/src/plugins/debugger/debuggerplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGERPLUGIN_H -#define DEBUGGERPLUGIN_H +#pragma once #include "debugger_global.h" #include <extensionsystem/iplugin.h> @@ -62,5 +61,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGERPLUGIN_H diff --git a/src/plugins/debugger/debuggerprotocol.h b/src/plugins/debugger/debuggerprotocol.h index b5047a12cc..6bf081e4d6 100644 --- a/src/plugins/debugger/debuggerprotocol.h +++ b/src/plugins/debugger/debuggerprotocol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_PROTOCOL_H -#define DEBUGGER_PROTOCOL_H +#pragma once #include <QByteArray> #include <QList> @@ -237,24 +236,17 @@ enum DisplayFormat }; -// These enum values are passed from the dumper to the frontend, +// These values are passed from the dumper to the frontend, // typically as a result of passing a related DisplayFormat value. // They are never stored in settings. -// Keep in sync with dumper.py, symbolgroupvalue.cpp of CDB -enum DebuggerDisplay -{ - StopDisplay = 0, - DisplayImageData = 1, - DisplayUtf16String = 2, - DisplayImageFile = 3, - DisplayLatin1String = 4, - DisplayUtf8String = 5, - DisplayPlotData = 6 -}; +const char DisplayLatin1String[] = "latin1:separate"; +const char DisplayUtf8String[] = "utf8:separate"; +const char DisplayUtf16String[] = "utf16:separate"; +const char DisplayUcs4String[] = "ucs4:separate"; +const char DisplayImageData[] = "imagedata:separate"; +const char DisplayImageFile[] = "imagefile:separate"; +const char DisplayPlotData[] = "plotdata:separate"; } // namespace Internal } // namespace Debugger - - -#endif // DEBUGGER_PROTOCOL_H diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.h b/src/plugins/debugger/debuggerrunconfigurationaspect.h index 07bf2da3c2..7e22838310 100644 --- a/src/plugins/debugger/debuggerrunconfigurationaspect.h +++ b/src/plugins/debugger/debuggerrunconfigurationaspect.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGERRUNCONFIGURATIONASPECT_H -#define DEBUGGERRUNCONFIGURATIONASPECT_H +#pragma once #include "debugger_global.h" #include "debuggerconstants.h" @@ -82,5 +81,3 @@ private: }; } // namespace Debugger - -#endif // DEBUGGERRUNCONFIGURATIONASPECT_H diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index e9cb897acd..76959a7448 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -106,6 +106,11 @@ static const char *engineTypeName(DebuggerEngineType et) return "No engine"; } +DebuggerRunControl *createHelper(RunConfiguration *runConfig, Internal::DebuggerEngine *engine) +{ + return new DebuggerRunControl(runConfig, engine); +} + DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfig, DebuggerEngine *engine) : RunControl(runConfig, DebugRunMode), m_engine(engine), @@ -302,258 +307,215 @@ void DebuggerRunControl::abortDebugger() namespace Internal { -class DebuggerRunControlCreator -{ -public: - DebuggerRunControlCreator() {} - - // Life cycle: Initialize from StartParameters, enrich by automatically - // detectable pieces, construct an Engine and a RunControl. - void initialize(const DebuggerStartParameters &sp); - void enrich(const RunConfiguration *runConfig, const Kit *kit); - void createRunControl(Core::Id runMode = DebugRunMode); - QString fullError() const { return m_errors.join(QLatin1Char('\n')); } - - // Result. - DebuggerRunParameters m_rp; - QStringList m_errors; - DebuggerRunControl *m_runControl = 0; - - const RunConfiguration *m_runConfig = 0; -}; - -void DebuggerRunControlCreator::initialize(const DebuggerStartParameters &sp) +// Re-used for Combined C++/QML engine. +DebuggerEngine *createEngine(DebuggerEngineType et, const DebuggerRunParameters &rp, QStringList *errors) { - m_rp.DebuggerStartParameters::operator=(sp); + switch (et) { + case GdbEngineType: + return createGdbEngine(rp); + case CdbEngineType: + return createCdbEngine(rp, errors); + case PdbEngineType: + return createPdbEngine(rp); + case QmlEngineType: + return createQmlEngine(rp); + case LldbEngineType: + return createLldbEngine(rp); + case QmlCppEngineType: + return createQmlCppEngine(rp, errors); + default: + if (errors) + errors->append(DebuggerPlugin::tr("Unknown debugger type \"%1\"").arg(_(engineTypeName(et)))); + } + return 0; } -void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const Kit *kit) +static DebuggerRunControl *doCreate(DebuggerRunParameters rp, RunConfiguration *runConfig, + const Kit *kit, Core::Id runMode, QStringList *errors) { - m_runConfig = runConfig; - QTC_ASSERT(kit, return); - - Target *target = 0; - Project *project = 0; - - // Find a Kit and Target. Either could be missing. - if (m_runConfig) - target = m_runConfig->target(); + QTC_ASSERT(kit, return 0); // Extract as much as possible from available RunConfiguration. - if (m_runConfig && m_runConfig->runnable().is<StandardRunnable>()) { - m_rp.inferior = m_runConfig->runnable().as<StandardRunnable>(); - m_rp.useTerminal = m_rp.inferior.runMode == ApplicationLauncher::Console; + if (runConfig && runConfig->runnable().is<StandardRunnable>()) { + rp.inferior = runConfig->runnable().as<StandardRunnable>(); + rp.useTerminal = rp.inferior.runMode == ApplicationLauncher::Console; // Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...) - m_rp.inferior.workingDirectory = FileUtils::normalizePathName(m_rp.inferior.workingDirectory); + rp.inferior.workingDirectory = FileUtils::normalizePathName(rp.inferior.workingDirectory); } // We might get an executable from a local PID. - if (m_rp.inferior.executable.isEmpty() && m_rp.attachPID != InvalidPid) { + if (rp.inferior.executable.isEmpty() && rp.attachPID != InvalidPid) { foreach (const DeviceProcessItem &p, DeviceProcessList::localProcesses()) - if (p.pid == m_rp.attachPID) - m_rp.inferior.executable = p.exe; + if (p.pid == rp.attachPID) + rp.inferior.executable = p.exe; } - if (m_runConfig) { - if (auto envAspect = m_runConfig->extraAspect<EnvironmentAspect>()) { - m_rp.inferior.environment = envAspect->environment(); // Correct. - m_rp.stubEnvironment = m_rp.inferior.environment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX - m_rp.debuggerEnvironment = m_rp.inferior.environment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX + rp.macroExpander = kit->macroExpander(); + + if (runConfig) { + if (auto envAspect = runConfig->extraAspect<EnvironmentAspect>()) { + rp.inferior.environment = envAspect->environment(); // Correct. + rp.stubEnvironment = rp.inferior.environment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX + rp.debuggerEnvironment = rp.inferior.environment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX + } + if (Project *project = runConfig->target()->project()) { + rp.projectSourceDirectory = project->projectDirectory().toString(); + rp.projectSourceFiles = project->files(Project::SourceFiles); } } if (ToolChain *tc = ToolChainKitInformation::toolChain(kit)) - m_rp.toolChainAbi = tc->targetAbi(); + rp.toolChainAbi = tc->targetAbi(); - if (target) - project = target->project(); - - if (project && m_rp.projectSourceDirectory.isEmpty()) - m_rp.projectSourceDirectory = project->projectDirectory().toString(); - - if (project && m_rp.projectSourceFiles.isEmpty()) - m_rp.projectSourceFiles = project->files(Project::SourceFiles); - - if (project && m_rp.projectSourceFiles.isEmpty()) - m_rp.projectSourceFiles = project->files(Project::SourceFiles); - - if (false && project) { + if (false) { const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit); - m_rp.nativeMixedEnabled = version && version->qtVersion() >= QtSupport::QtVersionNumber(5, 7, 0); + rp.nativeMixedEnabled = version && version->qtVersion() >= QtSupport::QtVersionNumber(5, 7, 0); } bool ok = false; int nativeMixedOverride = qgetenv("QTC_DEBUGGER_NATIVE_MIXED").toInt(&ok); if (ok) - m_rp.nativeMixedEnabled = bool(nativeMixedOverride); + rp.nativeMixedEnabled = bool(nativeMixedOverride); - m_rp.cppEngineType = DebuggerKitInformation::engineType(kit); - m_rp.sysRoot = SysRootKitInformation::sysRoot(kit).toString(); - m_rp.debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString(); - m_rp.device = DeviceKitInformation::device(kit); + rp.cppEngineType = DebuggerKitInformation::engineType(kit); + rp.sysRoot = SysRootKitInformation::sysRoot(kit).toString(); + rp.debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString(); + rp.device = DeviceKitInformation::device(kit); - if (project) { - m_rp.projectSourceDirectory = project->projectDirectory().toString(); - m_rp.projectSourceFiles = project->files(Project::SourceFiles); - } + if (rp.displayName.isEmpty() && runConfig) + rp.displayName = runConfig->displayName(); - if (m_rp.displayName.isEmpty() && m_runConfig) - m_rp.displayName = m_runConfig->displayName(); - - if (m_runConfig && m_runConfig->property("supportsDebugger").toBool()) { - QString mainScript = m_runConfig->property("mainScript").toString(); - QString interpreter = m_runConfig->property("interpreter").toString(); + if (runConfig && runConfig->property("supportsDebugger").toBool()) { + QString mainScript = runConfig->property("mainScript").toString(); + QString interpreter = runConfig->property("interpreter").toString(); if (!interpreter.isEmpty() && mainScript.endsWith(_(".py"))) { - m_rp.mainScript = mainScript; - m_rp.interpreter = interpreter; - QString args = m_runConfig->property("arguments").toString(); + rp.mainScript = mainScript; + rp.interpreter = interpreter; + QString args = runConfig->property("arguments").toString(); if (!args.isEmpty()) { - if (!m_rp.inferior.commandLineArguments.isEmpty()) - m_rp.inferior.commandLineArguments.append(QLatin1Char(' ')); - m_rp.inferior.commandLineArguments.append(args); + if (!rp.inferior.commandLineArguments.isEmpty()) + rp.inferior.commandLineArguments.append(QLatin1Char(' ')); + rp.inferior.commandLineArguments.append(args); } - m_rp.masterEngineType = PdbEngineType; + rp.masterEngineType = PdbEngineType; } } DebuggerRunConfigurationAspect *debuggerAspect = 0; - if (m_runConfig) - debuggerAspect = m_runConfig->extraAspect<DebuggerRunConfigurationAspect>(); + if (runConfig) + debuggerAspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>(); if (debuggerAspect) - m_rp.multiProcess = debuggerAspect->useMultiProcess(); + rp.multiProcess = debuggerAspect->useMultiProcess(); if (debuggerAspect) { - m_rp.languages = NoLanguage; + rp.languages = NoLanguage; if (debuggerAspect->useCppDebugger()) - m_rp.languages |= CppLanguage; + rp.languages |= CppLanguage; if (debuggerAspect->useQmlDebugger()) - m_rp.languages |= QmlLanguage; + rp.languages |= QmlLanguage; } // This can happen e.g. when started from the command line. - if (m_rp.languages == NoLanguage) - m_rp.languages = CppLanguage; + if (rp.languages == NoLanguage) + rp.languages = CppLanguage; // validate debugger if C++ debugging is enabled - if (m_rp.languages & CppLanguage) { + if (rp.languages & CppLanguage) { const QList<Task> tasks = DebuggerKitInformation::validateDebugger(kit); if (!tasks.isEmpty()) { foreach (const Task &t, tasks) - m_errors.append(t.description); - return; + errors->append(t.description); + return 0; } } - if (m_rp.languages & QmlLanguage) { - if (m_rp.device && m_rp.device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { + if (rp.languages & QmlLanguage) { + if (rp.device && rp.device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { QTcpServer server; const bool canListen = server.listen(QHostAddress::LocalHost) || server.listen(QHostAddress::LocalHostIPv6); if (!canListen) { - m_errors.append(DebuggerPlugin::tr("Not enough free ports for QML debugging.") + QLatin1Char(' ')); - return; + errors->append(DebuggerPlugin::tr("Not enough free ports for QML debugging.") + ' '); + return 0; } - m_rp.qmlServerAddress = server.serverAddress().toString(); - m_rp.qmlServerPort = server.serverPort(); + rp.qmlServerAddress = server.serverAddress().toString(); + rp.qmlServerPort = Utils::Port(server.serverPort()); // Makes sure that all bindings go through the JavaScript engine, so that // breakpoints are actually hit! - const QString optimizerKey = _("QML_DISABLE_OPTIMIZER"); - if (!m_rp.inferior.environment.hasKey(optimizerKey)) - m_rp.inferior.environment.set(optimizerKey, _("1")); + const QString optimizerKey = "QML_DISABLE_OPTIMIZER"; + if (!rp.inferior.environment.hasKey(optimizerKey)) + rp.inferior.environment.set(optimizerKey, "1"); } } if (!boolSetting(AutoEnrichParameters)) { - const QString sysroot = m_rp.sysRoot; - if (m_rp.debugInfoLocation.isEmpty()) - m_rp.debugInfoLocation = sysroot + QLatin1String("/usr/lib/debug"); - if (m_rp.debugSourceLocation.isEmpty()) { - QString base = sysroot + QLatin1String("/usr/src/debug/"); - m_rp.debugSourceLocation.append(base + QLatin1String("qt5base/src/corelib")); - m_rp.debugSourceLocation.append(base + QLatin1String("qt5base/src/gui")); - m_rp.debugSourceLocation.append(base + QLatin1String("qt5base/src/network")); + const QString sysroot = rp.sysRoot; + if (rp.debugInfoLocation.isEmpty()) + rp.debugInfoLocation = sysroot + "/usr/lib/debug"; + if (rp.debugSourceLocation.isEmpty()) { + QString base = sysroot + "/usr/src/debug/"; + rp.debugSourceLocation.append(base + "qt5base/src/corelib"); + rp.debugSourceLocation.append(base + "qt5base/src/gui"); + rp.debugSourceLocation.append(base + "qt5base/src/network"); } } - if (m_rp.masterEngineType == NoEngineType) { - if (m_rp.languages & QmlLanguage) { + if (rp.masterEngineType == NoEngineType) { + if (rp.languages & QmlLanguage) { QmlDebug::QmlDebugServicesPreset service; - if (m_rp.languages & CppLanguage) { - if (m_rp.nativeMixedEnabled) { + if (rp.languages & CppLanguage) { + if (rp.nativeMixedEnabled) { service = QmlDebug::QmlNativeDebuggerServices; } else { - m_rp.masterEngineType = QmlCppEngineType; + rp.masterEngineType = QmlCppEngineType; service = QmlDebug::QmlDebuggerServices; } } else { - m_rp.masterEngineType = QmlEngineType; + rp.masterEngineType = QmlEngineType; service = QmlDebug::QmlDebuggerServices; } - if (m_rp.startMode != AttachExternal && m_rp.startMode != AttachCrashedExternal) { - QtcProcess::addArg(&m_rp.inferior.commandLineArguments, - (m_rp.languages & CppLanguage) && m_rp.nativeMixedEnabled ? + if (rp.startMode != AttachExternal && rp.startMode != AttachCrashedExternal) { + QtcProcess::addArg(&rp.inferior.commandLineArguments, + (rp.languages & CppLanguage) && rp.nativeMixedEnabled ? QmlDebug::qmlDebugNativeArguments(service, false) : - QmlDebug::qmlDebugTcpArguments(service, m_rp.qmlServerPort)); + QmlDebug::qmlDebugTcpArguments(service, rp.qmlServerPort)); } } } - if (m_rp.masterEngineType == NoEngineType) - m_rp.masterEngineType = m_rp.cppEngineType; + if (rp.masterEngineType == NoEngineType) + rp.masterEngineType = rp.cppEngineType; - if (m_rp.device && m_rp.connParams.port == 0) - m_rp.connParams = m_rp.device->sshParameters(); + if (rp.device && rp.connParams.port == 0) + rp.connParams = rp.device->sshParameters(); // Could have been set from command line. - if (m_rp.remoteChannel.isEmpty()) - m_rp.remoteChannel = m_rp.connParams.host + QLatin1Char(':') + QString::number(m_rp.connParams.port); + if (rp.remoteChannel.isEmpty()) + rp.remoteChannel = rp.connParams.host + ':' + QString::number(rp.connParams.port); - if (m_rp.startMode == NoStartMode) - m_rp.startMode = StartInternal; -} + if (rp.startMode == NoStartMode) + rp.startMode = StartInternal; -// Re-used for Combined C++/QML engine. -DebuggerEngine *createEngine(DebuggerEngineType et, const DebuggerRunParameters &rp, QStringList *errors) -{ - switch (et) { - case GdbEngineType: - return createGdbEngine(rp); - case CdbEngineType: - return createCdbEngine(rp, errors); - case PdbEngineType: - return createPdbEngine(rp); - case QmlEngineType: - return createQmlEngine(rp); - case LldbEngineType: - return createLldbEngine(rp); - case QmlCppEngineType: - return createQmlCppEngine(rp, errors); - default: - if (errors) - errors->append(DebuggerPlugin::tr("Unknown debugger type \"%1\"").arg(_(engineTypeName(et)))); - } - return 0; -} -void DebuggerRunControlCreator::createRunControl(Core::Id runMode) -{ if (runMode == DebugRunModeWithBreakOnMain) - m_rp.breakOnMain = true; + rp.breakOnMain = true; - DebuggerEngine *engine = createEngine(m_rp.masterEngineType, m_rp, &m_errors); + DebuggerEngine *engine = createEngine(rp.masterEngineType, rp, errors); if (!engine) { - m_errors.append(DebuggerPlugin::tr("Unable to create a debugger engine of the type \"%1\""). - arg(_(engineTypeName(m_rp.masterEngineType)))); - m_rp.startMode = NoStartMode; - return; + errors->append(DebuggerPlugin::tr("Unable to create a debugger engine of the type \"%1\""). + arg(_(engineTypeName(rp.masterEngineType)))); + rp.startMode = NoStartMode; + return 0; } - m_runControl = new DebuggerRunControl(const_cast<RunConfiguration *>(m_runConfig), engine); + DebuggerRunControl *runControl = createHelper(runConfig, engine); + + if (!runControl) + rp.startMode = NoStartMode; - if (!m_runControl) - m_rp.startMode = NoStartMode; + return runControl; } //////////////////////////////////////////////////////////////////////// @@ -583,12 +545,12 @@ public: // We cover only local setup here. Remote setups are handled by the // RunControl factories in the target specific plugins. - DebuggerRunControlCreator creator; - creator.enrich(runConfig, runConfig->target()->kit()); - creator.createRunControl(mode); + QStringList errors; + DebuggerRunControl *runControl = doCreate(DebuggerRunParameters(), runConfig, + runConfig->target()->kit(), mode, &errors); if (errorMessage) - *errorMessage = creator.fullError(); - return creator.m_runControl; + *errorMessage = errors.join('\n'); + return runControl; } bool canRun(RunConfiguration *runConfig, Core::Id mode) const override @@ -623,17 +585,15 @@ QObject *createDebuggerRunControlFactory(QObject *parent) DebuggerRunControl *createAndScheduleRun(const DebuggerRunParameters &rp, const Kit *kit) { QTC_ASSERT(kit, return 0); // Caller needs to look for a suitable kit. - DebuggerRunControlCreator creator; - creator.m_rp = rp; - creator.enrich(0, kit); - creator.createRunControl(DebugRunMode); - if (!creator.m_runControl) { - ProjectExplorerPlugin::showRunErrorMessage(creator.fullError()); + QStringList errors; + DebuggerRunControl *runControl = doCreate(rp, 0, kit, DebugRunMode, &errors); + if (!runControl) { + ProjectExplorerPlugin::showRunErrorMessage(errors.join('\n')); return 0; } Internal::showMessage(rp.startMessage, 0); - ProjectExplorerPlugin::startRunControl(creator.m_runControl, DebugRunMode); - return creator.m_runControl; // Only used for tests. + ProjectExplorerPlugin::startRunControl(runControl, DebugRunMode); + return runControl; // Only used for tests. } } // namespace Internal @@ -647,17 +607,16 @@ DebuggerRunControl *createDebuggerRunControl(const DebuggerStartParameters &sp, Core::Id runMode) { QTC_ASSERT(runConfig, return 0); - DebuggerRunControlCreator creator; - creator.initialize(sp); - creator.enrich(runConfig, runConfig->target()->kit()); - creator.createRunControl(runMode); + QStringList errors; + DebuggerRunControl *runControl = doCreate(sp, runConfig, runConfig->target()->kit(), runMode, &errors); + QString msg = errors.join('\n'); if (errorMessage) - *errorMessage = creator.fullError(); - if (!creator.m_runControl) { - Core::ICore::showWarningWithOptions(DebuggerRunControl::tr("Debugger"), creator.fullError()); + *errorMessage = msg; + if (!runControl) { + Core::ICore::showWarningWithOptions(DebuggerRunControl::tr("Debugger"), msg); return 0; } - return creator.m_runControl; + return runControl; } } // namespace Debugger diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index 9270674083..d5b41cad8e 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGERRUNCONTROL_H -#define DEBUGGERRUNCONTROL_H +#pragma once #include "debugger_global.h" #include "debuggerconstants.h" @@ -37,10 +36,7 @@ class RemoteSetupResult; class DebuggerStartParameters; class DebuggerRunControl; -namespace Internal { -class DebuggerEngine; -class DebuggerRunControlCreator; -} +namespace Internal { class DebuggerEngine; } DEBUGGER_EXPORT DebuggerRunControl *createDebuggerRunControl(const DebuggerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfig, @@ -83,7 +79,8 @@ signals: private: void handleFinished(); - friend class Internal::DebuggerRunControlCreator; + friend DebuggerRunControl *createHelper(ProjectExplorer::RunConfiguration *runConfig, + Internal::DebuggerEngine *engine); DebuggerRunControl(ProjectExplorer::RunConfiguration *runConfig, Internal::DebuggerEngine *engine); @@ -93,5 +90,3 @@ private: }; } // namespace Debugger - -#endif // DEBUGGERRUNCONTROL_H diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.h b/src/plugins/debugger/debuggersourcepathmappingwidget.h index fb0e7cecf7..0ae147b15b 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.h +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGERSOURCEPATHMAPPINGWIDGET_H -#define DEBUGGERSOURCEPATHMAPPINGWIDGET_H +#pragma once #include <QGroupBox> #include <QMap> @@ -91,5 +90,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGERSOURCEPATHMAPPINGWIDGET_H diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h index 33a73e863b..27ebf7bd40 100644 --- a/src/plugins/debugger/debuggerstartparameters.h +++ b/src/plugins/debugger/debuggerstartparameters.h @@ -23,14 +23,14 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_DEBUGGERSTARTPARAMETERS_H -#define DEBUGGER_DEBUGGERSTARTPARAMETERS_H +#pragma once #include "debugger_global.h" #include "debuggerconstants.h" #include <ssh/sshconnection.h> #include <utils/environment.h> +#include <utils/port.h> #include <projectexplorer/abi.h> #include <projectexplorer/runconfiguration.h> #include <projectexplorer/runnables.h> @@ -45,14 +45,13 @@ namespace Debugger { // Note: This is part of the "soft interface" of the debugger plugin. // Do not add anything that needs implementation in a .cpp file. -const int InvalidPort = -1; const qint64 InvalidPid = -1; class DEBUGGER_EXPORT RemoteSetupResult { public: - int gdbServerPort = InvalidPort; - int qmlServerPort = InvalidPort; + Utils::Port gdbServerPort; + Utils::Port qmlServerPort; qint64 inferiorPid = InvalidPid; bool success = false; QString reason; @@ -74,7 +73,7 @@ public: // Used by Qml debugging. QString qmlServerAddress; - int qmlServerPort = InvalidPort; + Utils::Port qmlServerPort; // Used by general remote debugging. QString remoteChannel; @@ -110,6 +109,3 @@ public: Q_DECLARE_METATYPE(Debugger::RemoteSetupResult) Q_DECLARE_METATYPE(Debugger::DebuggerStartParameters) - -#endif // DEBUGGER_DEBUGGERSTARTPARAMETERS_H - diff --git a/src/plugins/debugger/debuggerstringutils.h b/src/plugins/debugger/debuggerstringutils.h index 653bb739f2..11cf8f2aab 100644 --- a/src/plugins/debugger/debuggerstringutils.h +++ b/src/plugins/debugger/debuggerstringutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGERSTRINGUTILS_H -#define DEBUGGERSTRINGUTILS_H +#pragma once #ifndef qdoc @@ -43,5 +42,3 @@ inline QString _(const QByteArray &ba) { return QString::fromLatin1(ba, ba.size( } // namespace Debugger #endif // qdoc - -#endif // DEBUGGERSTRINGUTILS_H diff --git a/src/plugins/debugger/debuggertooltipmanager.h b/src/plugins/debugger/debuggertooltipmanager.h index 0b98fcd6a2..cc479d046a 100644 --- a/src/plugins/debugger/debuggertooltipmanager.h +++ b/src/plugins/debugger/debuggertooltipmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_DEBUGGERTOOLTIPMANAGER_H -#define DEBUGGER_DEBUGGERTOOLTIPMANAGER_H +#pragma once #include "debuggerconstants.h" @@ -102,5 +101,3 @@ public slots: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_INTERNAL_DEBUGGERTOOLTIPMANAGER_H diff --git a/src/plugins/debugger/disassembleragent.h b/src/plugins/debugger/disassembleragent.h index 58f2b5717a..423c949ab6 100644 --- a/src/plugins/debugger/disassembleragent.h +++ b/src/plugins/debugger/disassembleragent.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_DISASSEMBLERAGENT_H -#define DEBUGGER_DISASSEMBLERAGENT_H +#pragma once #include <QObject> @@ -75,5 +74,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_DISASSEMBLERAGENT_H diff --git a/src/plugins/debugger/disassemblerlines.h b/src/plugins/debugger/disassemblerlines.h index 71786db802..ff8586d429 100644 --- a/src/plugins/debugger/disassemblerlines.h +++ b/src/plugins/debugger/disassemblerlines.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_DISASSEMBLERLINES_H -#define DEBUGGER_DISASSEMBLERLINES_H +#pragma once #include <QStringList> #include <QHash> @@ -92,5 +91,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_DISASSEMBLERLINES_H diff --git a/src/plugins/debugger/gdb/attachgdbadapter.h b/src/plugins/debugger/gdb/attachgdbadapter.h index 23597bf017..412e4726d6 100644 --- a/src/plugins/debugger/gdb/attachgdbadapter.h +++ b/src/plugins/debugger/gdb/attachgdbadapter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_ATTACHGDBADAPTER_H -#define DEBUGGER_ATTACHGDBADAPTER_H +#pragma once #include "gdbengine.h" @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_ATTACHDBADAPTER_H diff --git a/src/plugins/debugger/gdb/coregdbadapter.cpp b/src/plugins/debugger/gdb/coregdbadapter.cpp index 5040343378..d946efbe4a 100644 --- a/src/plugins/debugger/gdb/coregdbadapter.cpp +++ b/src/plugins/debugger/gdb/coregdbadapter.cpp @@ -137,7 +137,7 @@ GdbCoreEngine::readExecutableNameFromCore(const QString &debuggerCommand, const QProcess proc; QStringList envLang = QProcess::systemEnvironment(); - envLang.replaceInStrings(QRegExp(QLatin1String("^LC_ALL=.*")), QLatin1String("LC_ALL=C")); + Utils::Environment::setupEnglishOutput(&envLang); proc.setEnvironment(envLang); proc.start(debuggerCommand, args); diff --git a/src/plugins/debugger/gdb/coregdbadapter.h b/src/plugins/debugger/gdb/coregdbadapter.h index a72dbd88dd..1e93fb968b 100644 --- a/src/plugins/debugger/gdb/coregdbadapter.h +++ b/src/plugins/debugger/gdb/coregdbadapter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_COREGDBADAPTER_H -#define DEBUGGER_COREGDBADAPTER_H +#pragma once #include "gdbengine.h" @@ -76,5 +75,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_COREDBADAPTER_H diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 2251a0d3ab..5b99bcd2c8 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4193,7 +4193,7 @@ void GdbEngine::loadInitScript() ).arg(script)); } } else { - const QString commands = stringSetting(GdbStartupCommands); + const QString commands = expand(stringSetting(GdbStartupCommands)); if (!commands.isEmpty()) runCommand({commands.toLocal8Bit(), NoFlags}); } @@ -4265,7 +4265,7 @@ void GdbEngine::abortDebugger() void GdbEngine::resetInferior() { if (!runParameters().commandsForReset.isEmpty()) { - QByteArray commands = globalMacroExpander()->expand(runParameters().commandsForReset); + const QByteArray commands = expand(runParameters().commandsForReset); foreach (QByteArray command, commands.split('\n')) { command = command.trimmed(); if (!command.isEmpty()) @@ -4307,7 +4307,7 @@ void GdbEngine::handleInferiorPrepared() CHECK_STATE(InferiorSetupRequested); if (!rp.commandsAfterConnect.isEmpty()) { - QByteArray commands = globalMacroExpander()->expand(rp.commandsAfterConnect); + const QByteArray commands = expand(rp.commandsAfterConnect); foreach (QByteArray command, commands.split('\n')) runCommand({command, NoFlags}); } diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 20464d00c6..2f67440fa1 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_GDBENGINE_H -#define DEBUGGER_GDBENGINE_H +#pragma once #include <debugger/debuggerengine.h> @@ -466,5 +465,3 @@ protected: } // namespace Debugger Q_DECLARE_OPERATORS_FOR_FLAGS(Debugger::Internal::GdbEngine::GdbCommandFlags) - -#endif // DEBUGGER_GDBENGINE_H diff --git a/src/plugins/debugger/gdb/gdbplainengine.h b/src/plugins/debugger/gdb/gdbplainengine.h index 86d79ebde6..ab1f809156 100644 --- a/src/plugins/debugger/gdb/gdbplainengine.h +++ b/src/plugins/debugger/gdb/gdbplainengine.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GDBPLAINENGINE_H -#define GDBPLAINENGINE_H +#pragma once #include "gdbengine.h" #include <debugger/outputcollector.h> @@ -60,5 +59,3 @@ private: } // namespace Debugger } // namespace Internal - -#endif // GDBPLAINENGINE_H diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.h b/src/plugins/debugger/gdb/remotegdbserveradapter.h index 95ccc52c98..ed69e5620a 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.h +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTEGDBSERVERADAPTER_H -#define REMOTEGDBSERVERADAPTER_H +#pragma once #include "gdbengine.h" @@ -71,5 +70,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // REMOTEGDBSERVERADAPTER_H diff --git a/src/plugins/debugger/gdb/startgdbserverdialog.cpp b/src/plugins/debugger/gdb/startgdbserverdialog.cpp index cb17291f4e..6a1da0cb86 100644 --- a/src/plugins/debugger/gdb/startgdbserverdialog.cpp +++ b/src/plugins/debugger/gdb/startgdbserverdialog.cpp @@ -108,8 +108,8 @@ void GdbServerStarter::run() void GdbServerStarter::portListReady() { PortList ports = d->device->freePorts(); - const int port = d->gatherer.getNextFreePort(&ports); - if (port == -1) { + const Port port = d->gatherer.getNextFreePort(&ports); + if (!port.isValid()) { QTC_ASSERT(false, /**/); emit logMessage(tr("Process aborted")); return; @@ -130,7 +130,7 @@ void GdbServerStarter::portListReady() if (gdbServerPath.isEmpty()) gdbServerPath = "gdbserver"; QByteArray cmd = gdbServerPath + " --attach :" - + QByteArray::number(port) + ' ' + QByteArray::number(d->process.pid); + + QByteArray::number(port.number()) + ' ' + QByteArray::number(d->process.pid); logMessage(tr("Running command: %1").arg(QString::fromLatin1(cmd))); d->runner.run(cmd, d->device->sshParameters()); } diff --git a/src/plugins/debugger/gdb/startgdbserverdialog.h b/src/plugins/debugger/gdb/startgdbserverdialog.h index 1660318100..df2630e4bc 100644 --- a/src/plugins/debugger/gdb/startgdbserverdialog.h +++ b/src/plugins/debugger/gdb/startgdbserverdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STARTGDBSERVERDIALOG_H -#define STARTGDBSERVERDIALOG_H +#pragma once #include <QObject> @@ -65,5 +64,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // STARTGDBSERVERDIALOG_H diff --git a/src/plugins/debugger/gdb/termgdbadapter.h b/src/plugins/debugger/gdb/termgdbadapter.h index 125d4bfacc..17dd5a4eb9 100644 --- a/src/plugins/debugger/gdb/termgdbadapter.h +++ b/src/plugins/debugger/gdb/termgdbadapter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_TERMGDBADAPTER_H -#define DEBUGGER_TERMGDBADAPTER_H +#pragma once #include "gdbengine.h" @@ -66,5 +65,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_TERMGDBADAPTER_H diff --git a/src/plugins/debugger/imageviewer.h b/src/plugins/debugger/imageviewer.h index da58eb85d5..ece5465486 100644 --- a/src/plugins/debugger/imageviewer.h +++ b/src/plugins/debugger/imageviewer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IMAGEVIEWER_H -#define IMAGEVIEWER_H +#pragma once #include <QWidget> @@ -77,5 +76,3 @@ private: Data m_data; QString m_info; }; - -#endif // IMAGEVIEWER_H diff --git a/src/plugins/debugger/loadcoredialog.h b/src/plugins/debugger/loadcoredialog.h index 7ba216b73b..bce0d75e41 100644 --- a/src/plugins/debugger/loadcoredialog.h +++ b/src/plugins/debugger/loadcoredialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LOADCOREDIALOG_H -#define LOADCOREDIALOG_H +#pragma once #include <QDialog> @@ -74,5 +73,3 @@ private: } // namespace Debugger } // namespace Internal - -#endif // LOADCOREDIALOG_H diff --git a/src/plugins/debugger/localsandexpressionswindow.h b/src/plugins/debugger/localsandexpressionswindow.h index 05dacd4879..15294640d1 100644 --- a/src/plugins/debugger/localsandexpressionswindow.h +++ b/src/plugins/debugger/localsandexpressionswindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LOCALSANDEXPRESSIONSWINDOW_H -#define LOCALSANDEXPRESSIONSWINDOW_H +#pragma once #include <QWidget> #include <QTimer> @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // LOCALSANDEXPRESSIONSWINDOW_H diff --git a/src/plugins/debugger/logwindow.h b/src/plugins/debugger/logwindow.h index 6d78adcabc..6f6e3d713e 100644 --- a/src/plugins/debugger/logwindow.h +++ b/src/plugins/debugger/logwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_LOGWINDOW_H -#define DEBUGGER_LOGWINDOW_H +#pragma once #include "debuggerconstants.h" @@ -90,6 +89,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_LOGWINDOW_H - diff --git a/src/plugins/debugger/memoryagent.h b/src/plugins/debugger/memoryagent.h index dc4341eb42..b761eac4c8 100644 --- a/src/plugins/debugger/memoryagent.h +++ b/src/plugins/debugger/memoryagent.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_MEMORYAGENT_H -#define DEBUGGER_MEMORYAGENT_H +#pragma once #include "debuggerconstants.h" @@ -116,5 +115,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_MEMORYAGENT_H diff --git a/src/plugins/debugger/memoryview.h b/src/plugins/debugger/memoryview.h index 307f1c53c9..45c5e0827e 100644 --- a/src/plugins/debugger/memoryview.h +++ b/src/plugins/debugger/memoryview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_INTERNAL_MEMORYVIEW_H -#define DEBUGGER_INTERNAL_MEMORYVIEW_H +#pragma once #include <QWidget> @@ -80,5 +79,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_INTERNAL_MEMORYVIEW_H diff --git a/src/plugins/debugger/moduleshandler.h b/src/plugins/debugger/moduleshandler.h index 9feb8a6af3..004ddeb39b 100644 --- a/src/plugins/debugger/moduleshandler.h +++ b/src/plugins/debugger/moduleshandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_MODULESHANDLER_H -#define DEBUGGER_MODULESHANDLER_H +#pragma once #include <utils/elfreader.h> #include <utils/treemodel.h> @@ -136,5 +135,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_MODULESHANDLER_H diff --git a/src/plugins/debugger/moduleswindow.h b/src/plugins/debugger/moduleswindow.h index 0ce21d35bf..ac32c23f5f 100644 --- a/src/plugins/debugger/moduleswindow.h +++ b/src/plugins/debugger/moduleswindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_MODULESWINDOW_H -#define DEBUGGER_MODULESWINDOW_H +#pragma once #include <utils/basetreeview.h> @@ -45,6 +44,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_MODULESWINDOW_H - diff --git a/src/plugins/debugger/namedemangler/demanglerexceptions.h b/src/plugins/debugger/namedemangler/demanglerexceptions.h index 3b0b4a77c8..eb210c3f7d 100644 --- a/src/plugins/debugger/namedemangler/demanglerexceptions.h +++ b/src/plugins/debugger/namedemangler/demanglerexceptions.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEMANGLEREXCEPTIONS_H -#define DEMANGLEREXCEPTIONS_H +#pragma once #include <QtGlobal> #include <QSharedPointer> @@ -75,5 +74,3 @@ template <typename T> QSharedPointer<T> demanglerCast(const QSharedPointer<Parse } // namespace Internal } // namespace Debugger - -#endif // DEMANGLEREXCEPTIONS_H diff --git a/src/plugins/debugger/namedemangler/globalparsestate.h b/src/plugins/debugger/namedemangler/globalparsestate.h index 3002d931a8..9794d57f7c 100644 --- a/src/plugins/debugger/namedemangler/globalparsestate.h +++ b/src/plugins/debugger/namedemangler/globalparsestate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLOBAL_PARSE_STATE_H -#define GLOBAL_PARSE_STATE_H +#pragma once #include <QByteArray> #include <QSharedPointer> @@ -68,5 +67,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // GLOBAL_PARSE_STATE_H diff --git a/src/plugins/debugger/namedemangler/namedemangler.h b/src/plugins/debugger/namedemangler/namedemangler.h index 16ce555031..9e57e5fba9 100644 --- a/src/plugins/debugger/namedemangler/namedemangler.h +++ b/src/plugins/debugger/namedemangler/namedemangler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NAME_DEMANGLER_H -#define NAME_DEMANGLER_H +#pragma once #include <QtGlobal> @@ -70,5 +69,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // Include guard. diff --git a/src/plugins/debugger/namedemangler/parsetreenodes.h b/src/plugins/debugger/namedemangler/parsetreenodes.h index 8b0bbadce5..782a06cce5 100644 --- a/src/plugins/debugger/namedemangler/parsetreenodes.h +++ b/src/plugins/debugger/namedemangler/parsetreenodes.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PARSETREENODES_H -#define PARSETREENODES_H +#pragma once #include "globalparsestate.h" @@ -829,5 +828,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // PARSETREENODES_H diff --git a/src/plugins/debugger/pdb/pdbengine.h b/src/plugins/debugger/pdb/pdbengine.h index 60882e8189..f71f1911ba 100644 --- a/src/plugins/debugger/pdb/pdbengine.h +++ b/src/plugins/debugger/pdb/pdbengine.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_PDBENGINE_H -#define DEBUGGER_PDBENGINE_H +#pragma once #include <debugger/debuggerengine.h> @@ -123,5 +122,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_PDBENGINE_H diff --git a/src/plugins/debugger/procinterrupt.h b/src/plugins/debugger/procinterrupt.h index 4cfb9ff6b5..b1d71e6db9 100644 --- a/src/plugins/debugger/procinterrupt.h +++ b/src/plugins/debugger/procinterrupt.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_PROCINTERRUPT_H -#define DEBUGGER_PROCINTERRUPT_H +#pragma once #include <QString> @@ -36,5 +35,3 @@ bool interruptProcess(qint64 pID, int engineType, QString *errorMessage, } // Internal } // GdbDebugger - -#endif // DEBUGGER_PROCINTERRUPT_H diff --git a/src/plugins/debugger/qml/interactiveinterpreter.h b/src/plugins/debugger/qml/interactiveinterpreter.h index 95fa2b3db7..541e33a558 100644 --- a/src/plugins/debugger/qml/interactiveinterpreter.h +++ b/src/plugins/debugger/qml/interactiveinterpreter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INTERACTIVEINTERPRETER_H -#define INTERACTIVEINTERPRETER_H +#pragma once #include <qmljs/parser/qmljslexer_p.h> #include <qmljs/parser/qmljsengine_p.h> @@ -57,4 +56,3 @@ private: } } -#endif // INTERACTIVEINTERPRETER_H diff --git a/src/plugins/debugger/qml/qmlcppengine.h b/src/plugins/debugger/qml/qmlcppengine.h index b45f38dbe1..e549a26206 100644 --- a/src/plugins/debugger/qml/qmlcppengine.h +++ b/src/plugins/debugger/qml/qmlcppengine.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLCPPENGINE_H -#define QMLCPPENGINE_H +#pragma once #include <debugger/debuggerengine.h> @@ -139,5 +138,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // QMLCPPENGINE_H diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 3a12d27271..cdce030c80 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -301,7 +301,10 @@ QmlEngine::QmlEngine(const DebuggerRunParameters &startParameters, DebuggerEngin d->msgClient = new QDebugMessageClient(d->connection); connect(d->msgClient, &QDebugMessageClient::newState, - this, &QmlEngine::clientStateChanged); + this, [this](QmlDebugClient::State state) { + logServiceStateChange(d->msgClient->name(), d->msgClient->serviceVersion(), state); + }); + connect(d->msgClient, &QDebugMessageClient::message, this, &appendDebugOutput); } @@ -344,7 +347,7 @@ void QmlEngine::connectionEstablished() notifyEngineRunAndInferiorRunOk(); } -void QmlEngine::tryToConnect(quint16 port) +void QmlEngine::tryToConnect(Utils::Port port) { showMessage(QLatin1String("QML Debugger: No application output received in time, trying to connect ..."), LogStatus); d->retryOnConnectFail = true; @@ -363,7 +366,7 @@ void QmlEngine::tryToConnect(quint16 port) } } -void QmlEngine::beginConnection(quint16 port) +void QmlEngine::beginConnection(Utils::Port port) { d->noDebugOutputTimer.stop(); @@ -388,13 +391,13 @@ void QmlEngine::beginConnection(quint16 port) * the connection will be closed again (instead of returning the "connection refused" * error that we expect). */ - if (runParameters().qmlServerPort > 0) + if (runParameters().qmlServerPort.isValid()) port = runParameters().qmlServerPort; if (!d->connection || d->connection->isConnected()) return; - d->connection->connectToHost(host, port); + d->connection->connectToHost(host, port.number()); //A timeout to check the connection state d->connectionTimer.start(); @@ -560,7 +563,7 @@ void QmlEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) DebuggerEngine::notifyEngineRemoteSetupFinished(result); if (result.success) { - if (result.qmlServerPort != InvalidPort) + if (result.qmlServerPort.isValid()) runParameters().qmlServerPort = result.qmlServerPort; notifyEngineSetupOk(); @@ -584,7 +587,7 @@ void QmlEngine::notifyEngineRemoteServerRunning(const QByteArray &serverChannel, bool ok = false; quint16 qmlPort = serverChannel.toUInt(&ok); if (ok) - runParameters().qmlServerPort = qmlPort; + runParameters().qmlServerPort = Utils::Port(qmlPort); else qWarning() << tr("QML debugging port not set: Unable to convert %1 to unsigned int.").arg(QString::fromLatin1(serverChannel)); @@ -1212,18 +1215,6 @@ void QmlEngine::connectionStateChanged(QAbstractSocket::SocketState socketState) showConnectionStateMessage(QmlDebugConnection::socketStateToString(socketState)); } -void QmlEngine::clientStateChanged(QmlDebugClient::State state) -{ - QString serviceName; - float version = 0; - if (QmlDebugClient *client = qobject_cast<QmlDebugClient*>(sender())) { - serviceName = client->name(); - version = client->serviceVersion(); - } - - logServiceStateChange(serviceName, version, state); -} - void QmlEngine::checkConnectionState() { if (!isConnected()) { @@ -2485,7 +2476,7 @@ void QmlEnginePrivate::handleLookup(const QVariantMap &response) void QmlEnginePrivate::stateChanged(State state) { - engine->clientStateChanged(state); + engine->logServiceStateChange(name(), serviceVersion(), state); if (state == QmlDebugClient::Enabled) { /// Start session. diff --git a/src/plugins/debugger/qml/qmlengine.h b/src/plugins/debugger/qml/qmlengine.h index 139b48941b..5e534ab08e 100644 --- a/src/plugins/debugger/qml/qmlengine.h +++ b/src/plugins/debugger/qml/qmlengine.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLENGINE_H -#define QMLENGINE_H +#pragma once #include <debugger/debuggerengine.h> @@ -61,8 +60,8 @@ private slots: void errorMessageBoxFinished(int result); void updateCurrentContext(); - void tryToConnect(quint16 port = 0); - void beginConnection(quint16 port = 0); + void tryToConnect(Utils::Port port = Utils::Port()); + void beginConnection(Utils::Port port = Utils::Port()); void connectionEstablished(); void connectionStartupFailed(); void appStartupFailed(const QString &errorMessage); @@ -138,7 +137,6 @@ private: void connectionErrorOccurred(QAbstractSocket::SocketError socketError); void connectionStateChanged(QAbstractSocket::SocketState socketState); - void clientStateChanged(QmlDebug::QmlDebugClient::State state); void checkConnectionState(); void showConnectionStateMessage(const QString &message); bool isConnected() const; @@ -152,5 +150,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // QMLENGINE_H diff --git a/src/plugins/debugger/qml/qmlengineutils.h b/src/plugins/debugger/qml/qmlengineutils.h index 46d0995176..abb6c4c103 100644 --- a/src/plugins/debugger/qml/qmlengineutils.h +++ b/src/plugins/debugger/qml/qmlengineutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLENGINEUTILS_H -#define QMLENGINEUTILS_H +#pragma once #include <qmldebug/qdebugmessageclient.h> #include <qmldebug/qmloutputparser.h> @@ -39,5 +38,3 @@ QStringList highlightExceptionCode(int lineNumber, const QString &filePath, cons } // namespace Internal } // namespace Debugger - -#endif // QMLENGINEUTILS_H diff --git a/src/plugins/debugger/qml/qmlinspectoragent.h b/src/plugins/debugger/qml/qmlinspectoragent.h index 611739b7b5..f8ed4e131e 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.h +++ b/src/plugins/debugger/qml/qmlinspectoragent.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLINSPECTORAGENT_H -#define QMLINSPECTORAGENT_H +#pragma once #include <QStack> #include <QPointer> @@ -161,5 +160,3 @@ private: } // Internal } // Debugger - -#endif // QMLINSPECTORAGENT_H diff --git a/src/plugins/debugger/qml/qmlv8debuggerclientconstants.h b/src/plugins/debugger/qml/qmlv8debuggerclientconstants.h index 2eb60a454f..d3f03db8f3 100644 --- a/src/plugins/debugger/qml/qmlv8debuggerclientconstants.h +++ b/src/plugins/debugger/qml/qmlv8debuggerclientconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLV8DEBUGGERCLIENTCONSTANTS_H -#define QMLV8DEBUGGERCLIENTCONSTANTS_H +#pragma once namespace Debugger { namespace Internal { @@ -115,4 +114,3 @@ const char INTERNAL_FUNCTION[] = "(function(method) { "\ "})"; } //Internal } //Debugger -#endif // QMLV8DEBUGGERCLIENTCONSTANTS_H diff --git a/src/plugins/debugger/registerhandler.h b/src/plugins/debugger/registerhandler.h index f1974ee5b4..f8bf2ca3fe 100644 --- a/src/plugins/debugger/registerhandler.h +++ b/src/plugins/debugger/registerhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_REGISTERHANDLER_H -#define DEBUGGER_REGISTERHANDLER_H +#pragma once #include <utils/treemodel.h> @@ -144,5 +143,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_REGISTERHANDLER_H diff --git a/src/plugins/debugger/registerpostmortemaction.h b/src/plugins/debugger/registerpostmortemaction.h index 3748daf83b..bff1f6c78e 100644 --- a/src/plugins/debugger/registerpostmortemaction.h +++ b/src/plugins/debugger/registerpostmortemaction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REGISTERPOSTMORTEMACTION_H -#define REGISTERPOSTMORTEMACTION_H +#pragma once #include <utils/savedaction.h> @@ -44,5 +43,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // REGISTERPOSTMORTEMACTION_H diff --git a/src/plugins/debugger/registerwindow.h b/src/plugins/debugger/registerwindow.h index 9a3b11704b..13a6f91c02 100644 --- a/src/plugins/debugger/registerwindow.h +++ b/src/plugins/debugger/registerwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_REGISTERWINDOW_H -#define DEBUGGER_REGISTERWINDOW_H +#pragma once #include <utils/basetreeview.h> @@ -47,5 +46,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_REGISTERWINDOW_H diff --git a/src/plugins/debugger/shared/backtrace.h b/src/plugins/debugger/shared/backtrace.h index 86daa5ca72..ea4ec142eb 100644 --- a/src/plugins/debugger/shared/backtrace.h +++ b/src/plugins/debugger/shared/backtrace.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_BACKTRACE_H -#define DEBUGGER_BACKTRACE_H +#pragma once namespace Debugger { namespace Internal { @@ -33,5 +32,3 @@ void dumpBacktrace(int maxdepth = -1); } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_BACKTRACE_H diff --git a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h index b246bcd6d0..8a760d11b1 100644 --- a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h +++ b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SYMBOLPATHLISTEDITOR_H -#define SYMBOLPATHLISTEDITOR_H +#pragma once #include <utils/pathlisteditor.h> @@ -95,5 +94,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // SYMBOLPATHLISTEDITOR_H diff --git a/src/plugins/debugger/shared/hostutils.h b/src/plugins/debugger/shared/hostutils.h index 7c2a1d6f04..3348530867 100644 --- a/src/plugins/debugger/shared/hostutils.h +++ b/src/plugins/debugger/shared/hostutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_HOSTUTILS_H -#define DEBUGGER_HOSTUTILS_H +#pragma once #include <QList> @@ -68,5 +67,3 @@ bool isDebuggerWinException(unsigned long code); } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_HOSTUTILS_H diff --git a/src/plugins/debugger/shared/peutils.h b/src/plugins/debugger/shared/peutils.h index 47f3ee0bf8..0d25d8ace1 100644 --- a/src/plugins/debugger/shared/peutils.h +++ b/src/plugins/debugger/shared/peutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_PEUTILS_H -#define DEBUGGER_PEUTILS_H +#pragma once #include <qnamespace.h> @@ -43,5 +42,3 @@ bool getPDBFiles(const QString &peExecutableFileName, QStringList *rc, QString * } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_PEUTILS_H diff --git a/src/plugins/debugger/shared/symbolpathsdialog.h b/src/plugins/debugger/shared/symbolpathsdialog.h index d6c0ad89bc..304988e285 100644 --- a/src/plugins/debugger/shared/symbolpathsdialog.h +++ b/src/plugins/debugger/shared/symbolpathsdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SYMBOLPATHSDIALOG_H -#define SYMBOLPATHSDIALOG_H +#pragma once #include <QDialog> #include <QString> @@ -60,5 +59,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // SYMBOLPATHSDIALOG_H diff --git a/src/plugins/debugger/simplifytype.h b/src/plugins/debugger/simplifytype.h index 72dd536780..ac4f981dcc 100644 --- a/src/plugins/debugger/simplifytype.h +++ b/src/plugins/debugger/simplifytype.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_SIMPLIFY_TYPE_H -#define DEBUGGER_SIMPLIFY_TYPE_H +#pragma once #include <QString> @@ -38,6 +37,3 @@ QString simplifyType(const QString &typeIn); } // namespace Internal } // namespace Debugger - - -#endif // DEBUGGER_SIMPLIFY_TYPE_H diff --git a/src/plugins/debugger/snapshothandler.h b/src/plugins/debugger/snapshothandler.h index 71163647c0..fb9225d335 100644 --- a/src/plugins/debugger/snapshothandler.h +++ b/src/plugins/debugger/snapshothandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_SNAPSHOTHANDLER_H -#define DEBUGGER_SNAPSHOTHANDLER_H +#pragma once #include <QAbstractTableModel> #include <QPointer> @@ -79,5 +78,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_SNAPSHOTHANDLER_H diff --git a/src/plugins/debugger/snapshotwindow.h b/src/plugins/debugger/snapshotwindow.h index 6097874a8b..dfcdaf5e6a 100644 --- a/src/plugins/debugger/snapshotwindow.h +++ b/src/plugins/debugger/snapshotwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_SNAPSHOTWINDOW_H -#define DEBUGGER_SNAPSHOTWINDOW_H +#pragma once #include <utils/basetreeview.h> @@ -51,6 +50,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_SNAPSHOTWINDOW_H - diff --git a/src/plugins/debugger/sourceagent.h b/src/plugins/debugger/sourceagent.h index 14a90c8eb3..592d8ce66a 100644 --- a/src/plugins/debugger/sourceagent.h +++ b/src/plugins/debugger/sourceagent.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_SOURCE_AGENT_H -#define DEBUGGER_SOURCE_AGENT_H +#pragma once #include <QString> @@ -49,5 +48,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif diff --git a/src/plugins/debugger/sourcefileshandler.h b/src/plugins/debugger/sourcefileshandler.h index 93cf42c3b4..a859880d1e 100644 --- a/src/plugins/debugger/sourcefileshandler.h +++ b/src/plugins/debugger/sourcefileshandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_SOURCEFILESHANDLER_H -#define DEBUGGER_SOURCEFILESHANDLER_H +#pragma once #include <QAbstractItemModel> #include <QStringList> @@ -65,5 +64,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_SOURCEFILESHANDLER_H diff --git a/src/plugins/debugger/sourcefileswindow.h b/src/plugins/debugger/sourcefileswindow.h index 8080f72551..9a2af38198 100644 --- a/src/plugins/debugger/sourcefileswindow.h +++ b/src/plugins/debugger/sourcefileswindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SOURCEFILESWINDOW_H -#define SOURCEFILESWINDOW_H +#pragma once #include <utils/basetreeview.h> @@ -45,6 +44,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // SOURCEFILESWINDOW_H - diff --git a/src/plugins/debugger/sourceutils.h b/src/plugins/debugger/sourceutils.h index 9b6e51d382..12ea4a338f 100644 --- a/src/plugins/debugger/sourceutils.h +++ b/src/plugins/debugger/sourceutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SOURCE_UTILS_H -#define SOURCE_UTILS_H +#pragma once #include <QString> @@ -58,5 +57,3 @@ ContextData getLocationContext(TextEditor::TextDocument *document, int lineNumbe } // namespace Internal } // namespace Debugger - -#endif // SOURCE_UTILS_H diff --git a/src/plugins/debugger/stackframe.h b/src/plugins/debugger/stackframe.h index df29aa5019..5d7674e642 100644 --- a/src/plugins/debugger/stackframe.h +++ b/src/plugins/debugger/stackframe.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_STACKFRAME_H -#define DEBUGGER_STACKFRAME_H +#pragma once #include "debuggerconstants.h" @@ -74,5 +73,3 @@ typedef QList<StackFrame> StackFrames; } // namespace Debugger Q_DECLARE_METATYPE(Debugger::Internal::StackFrame) - -#endif // DEBUGGER_STACKFRAME_H diff --git a/src/plugins/debugger/stackhandler.h b/src/plugins/debugger/stackhandler.h index e10b9818e5..10649f5b88 100644 --- a/src/plugins/debugger/stackhandler.h +++ b/src/plugins/debugger/stackhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_STACKHANDLER_H -#define DEBUGGER_STACKHANDLER_H +#pragma once #include "stackframe.h" @@ -98,5 +97,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_STACKHANDLER_H diff --git a/src/plugins/debugger/stackwindow.h b/src/plugins/debugger/stackwindow.h index 3dbfb3740d..7a44c996a4 100644 --- a/src/plugins/debugger/stackwindow.h +++ b/src/plugins/debugger/stackwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_STACKWINDOW_H -#define DEBUGGER_STACKWINDOW_H +#pragma once #include <utils/basetreeview.h> #include <QCoreApplication> @@ -50,6 +49,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_STACKWINDOW_H - diff --git a/src/plugins/debugger/terminal.h b/src/plugins/debugger/terminal.h index 2383772d57..67b3bf851a 100644 --- a/src/plugins/debugger/terminal.h +++ b/src/plugins/debugger/terminal.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_TERMINAL_H -#define DEBUGGER_TERMINAL_H +#pragma once #include <QCoreApplication> #include <QSocketNotifier> @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_TERMINAL_H diff --git a/src/plugins/debugger/threaddata.h b/src/plugins/debugger/threaddata.h index 2a5c2315f4..23f280c105 100644 --- a/src/plugins/debugger/threaddata.h +++ b/src/plugins/debugger/threaddata.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef THREADDATA_H -#define THREADDATA_H +#pragma once #include <QString> #include <QVector> @@ -111,5 +110,3 @@ typedef QVector<ThreadData> Threads; } // namespace Internal } // namespace Debugger - -#endif // THREADDATA_H diff --git a/src/plugins/debugger/threadshandler.h b/src/plugins/debugger/threadshandler.h index 3e644a0387..5ddfbf5dca 100644 --- a/src/plugins/debugger/threadshandler.h +++ b/src/plugins/debugger/threadshandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef THREADSHANDLER_H -#define THREADSHANDLER_H +#pragma once #include "threaddata.h" @@ -90,5 +89,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // THREADSHANDLER_H diff --git a/src/plugins/debugger/threadswindow.h b/src/plugins/debugger/threadswindow.h index 9a814a27c8..8840043fb3 100644 --- a/src/plugins/debugger/threadswindow.h +++ b/src/plugins/debugger/threadswindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef THREADSWINDOW_H -#define THREADSWINDOW_H +#pragma once #include <utils/basetreeview.h> @@ -45,5 +44,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // THREADSWINDOW_H diff --git a/src/plugins/debugger/unstartedappwatcherdialog.h b/src/plugins/debugger/unstartedappwatcherdialog.h index 6ab2cc4caf..47d38c17d9 100644 --- a/src/plugins/debugger/unstartedappwatcherdialog.h +++ b/src/plugins/debugger/unstartedappwatcherdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UNSTARTEDAPPWATCHERDIALOG_H -#define UNSTARTEDAPPWATCHERDIALOG_H +#pragma once #include <QDialog> #include <QTimer> @@ -96,5 +95,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // UNSTARTEDAPPWATCHERDIALOG_H diff --git a/src/plugins/debugger/watchdata.cpp b/src/plugins/debugger/watchdata.cpp index 9cc7f944fa..b74921e554 100644 --- a/src/plugins/debugger/watchdata.cpp +++ b/src/plugins/debugger/watchdata.cpp @@ -110,7 +110,6 @@ bool isIntOrFloatType(const QByteArray &type) WatchItem::WatchItem() : id(WatchItem::InvalidId), state(InitialState), - editformat(StopDisplay), address(0), origaddr(0), size(0), @@ -401,7 +400,7 @@ void WatchItem::parseHelper(const GdbMi &input, bool maySort) setType(mi.data()); editvalue = input["editvalue"].data(); - editformat = DebuggerDisplay(input["editformat"].toInt()); + editformat = input["editformat"].data(); editencoding = DebuggerEncoding(input["editencoding"].data()); mi = input["valueelided"]; diff --git a/src/plugins/debugger/watchdata.h b/src/plugins/debugger/watchdata.h index 160117608a..98053b6776 100644 --- a/src/plugins/debugger/watchdata.h +++ b/src/plugins/debugger/watchdata.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_WATCHDATA_H -#define DEBUGGER_WATCHDATA_H +#pragma once #include "debuggerprotocol.h" @@ -98,6 +97,7 @@ public: static const QString &shadowedNameFormat(); QByteArray hexAddress() const; + QByteArray key() const { return address ? hexAddress() : iname; } public: qint64 id; // Token for the engine for internal mapping @@ -107,7 +107,7 @@ public: QString name; // Displayed name QString value; // Displayed value QByteArray editvalue; // Displayed value - DebuggerDisplay editformat; // Format of displayed value + QByteArray editformat; // Format of displayed value DebuggerEncoding editencoding; // Encoding of displayed value QByteArray type; // Type for further processing quint64 address; // Displayed address of the actual object @@ -130,5 +130,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_WATCHDATA_H diff --git a/src/plugins/debugger/watchdelegatewidgets.h b/src/plugins/debugger/watchdelegatewidgets.h index 139391b368..e9acb3a217 100644 --- a/src/plugins/debugger/watchdelegatewidgets.h +++ b/src/plugins/debugger/watchdelegatewidgets.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WATCHDELEGATEWIDGETS_H -#define WATCHDELEGATEWIDGETS_H +#pragma once #include <QLineEdit> #include <QComboBox> @@ -109,5 +108,3 @@ public: } // namespace Internal } // namespace Debugger - -#endif // WATCHDELEGATEWIDGETS_H diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 0ad2e6f7d8..594add236c 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -301,8 +301,9 @@ public: return 0; } - template <class T> T *prepareObject(const QByteArray &key, const QString &tabName) + template <class T> T *prepareObject(const WatchItem *item) { + const QByteArray key = item->key(); T *t = 0; if (QWidget *w = findWidget(key)) { t = qobject_cast<T *>(w); @@ -312,8 +313,9 @@ public: if (!t) { t = new T; t->setProperty(KeyProperty, key); - addTab(t, tabName); + addTab(t, item->name); } + setProperty(INameProperty, item->iname); setCurrentWidget(t); show(); @@ -1498,17 +1500,16 @@ static void swapEndian(char *d, int nchar) void WatchModel::showEditValue(const WatchItem *item) { - const QByteArray key = item->address ? item->hexAddress() : item->iname; - switch (item->editformat) { - case StopDisplay: - m_separatedView->removeObject(key); - break; - case DisplayImageData: - case DisplayImageFile: { // QImage - int width = 0, height = 0, nbytes = 0, format = 0; + const QByteArray &format = item->editformat; + if (format.isEmpty()) { + // Nothing + m_separatedView->removeObject(item->key()); + } else if (format == DisplayImageData || format == DisplayImageFile) { + // QImage + int width = 0, height = 0, nbytes = 0, imformat = 0; QByteArray ba; uchar *bits = 0; - if (item->editformat == DisplayImageData) { + if (format == DisplayImageData) { ba = QByteArray::fromHex(item->editvalue); QTC_ASSERT(ba.size() > 16, return); const int *header = (int *)(ba.data()); @@ -1518,11 +1519,11 @@ void WatchModel::showEditValue(const WatchItem *item) width = header[0]; height = header[1]; nbytes = header[2]; - format = header[3]; - } else if (item->editformat == DisplayImageFile) { + imformat = header[3]; + } else if (format == DisplayImageFile) { QTextStream ts(item->editvalue); QString fileName; - ts >> width >> height >> nbytes >> format >> fileName; + ts >> width >> height >> nbytes >> imformat >> fileName; QFile f(fileName); f.open(QIODevice::ReadOnly); ba = f.readAll(); @@ -1532,11 +1533,10 @@ void WatchModel::showEditValue(const WatchItem *item) QTC_ASSERT(0 < width && width < 10000, return); QTC_ASSERT(0 < height && height < 10000, return); QTC_ASSERT(0 < nbytes && nbytes < 10000 * 10000, return); - QTC_ASSERT(0 < format && format < 32, return); - QImage im(width, height, QImage::Format(format)); + QTC_ASSERT(0 < imformat && imformat < 32, return); + QImage im(width, height, QImage::Format(imformat)); std::memcpy(im.bits(), bits, nbytes); - ImageViewer *v = m_separatedView->prepareObject<ImageViewer>(key, item->name); - v->setProperty(INameProperty, item->iname); + ImageViewer *v = m_separatedView->prepareObject<ImageViewer>(item); v->setInfo(item->address ? tr("%1 Object at %2").arg(QLatin1String(item->type), QLatin1String(item->hexAddress())) : @@ -1546,35 +1546,29 @@ void WatchModel::showEditValue(const WatchItem *item) .arg(width).arg(height).arg(nbytes).arg(im.format()).arg(im.depth()) ); v->setImage(im); - break; - } - case DisplayUtf16String: - case DisplayLatin1String: - case DisplayUtf8String: { // String data. + } else if (format == DisplayLatin1String + || format == DisplayUtf8String + || format == DisplayUtf16String + || format == DisplayUcs4String) { + // String data. QByteArray ba = QByteArray::fromHex(item->editvalue); QString str; - if (item->editformat == DisplayUtf16String) - str = QString::fromUtf16((ushort *)ba.constData(), ba.size()/2); - else if (item->editformat == DisplayLatin1String) + if (format == DisplayLatin1String) str = QString::fromLatin1(ba.constData(), ba.size()); - else if (item->editformat == DisplayUtf8String) + else if (format == DisplayUtf8String) str = QString::fromUtf8(ba.constData(), ba.size()); - QTextEdit *t = m_separatedView->prepareObject<QTextEdit>(key, item->name); - t->setProperty(INameProperty, item->iname); - t->setText(str); - break; - } - case DisplayPlotData: { // Plots + else if (format == DisplayUtf16String) + str = QString::fromUtf16((ushort *)ba.constData(), ba.size() / 2); + else if (format == DisplayUtf16String) + str = QString::fromUcs4((uint *)ba.constData(), ba.size() / 4); + m_separatedView->prepareObject<QTextEdit>(item)->setText(str); + } else if (format == DisplayPlotData) { + // Plots std::vector<double> data; readNumericVector(&data, QByteArray::fromHex(item->editvalue), item->editencoding); - PlotViewer *v = m_separatedView->prepareObject<PlotViewer>(key, item->name); - v->setProperty(INameProperty, item->iname); - v->setData(data); - break; - } - default: - QTC_ASSERT(false, qDebug() << "Display format: " << item->editformat); - break; + m_separatedView->prepareObject<PlotViewer>(item)->setData(data); + } else { + QTC_ASSERT(false, qDebug() << "Display format: " << format); } } @@ -1714,6 +1708,24 @@ QString WatchHandler::nameForFormat(int format) return WatchModel::nameForFormat(format); } +static const char *formatStringFromFormatCode(int code) +{ + switch (code) { + // Taken from debuggerprotocol.h, DisplayFormat. + case Latin1StringFormat: + return "latin"; + case SeparateLatin1StringFormat: + return "latin:separate"; + case Utf8StringFormat: + return "utf8"; + case SeparateUtf8StringFormat: + return "utf8:separate"; + case Utf16StringFormat: + return "utf16"; + } + return ""; +} + QByteArray WatchHandler::typeFormatRequests() const { QByteArray ba; @@ -1725,7 +1737,7 @@ QByteArray WatchHandler::typeFormatRequests() const if (format != AutomaticFormat) { ba.append(it.key().toHex()); ba.append('='); - ba.append(QByteArray::number(format)); + ba.append(formatStringFromFormatCode(format)); ba.append(','); } } @@ -1745,7 +1757,7 @@ QByteArray WatchHandler::individualFormatRequests() const if (format != AutomaticFormat) { ba.append(it.key()); ba.append('='); - ba.append(QByteArray::number(it.value())); + ba.append(formatStringFromFormatCode(it.value())); ba.append(','); } } diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 09db91be34..6b5fc51b11 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_WATCHHANDLER_H -#define DEBUGGER_WATCHHANDLER_H +#pragma once #include "watchdata.h" @@ -131,5 +130,3 @@ private: } // namespace Debugger Q_DECLARE_METATYPE(Debugger::Internal::DisplayFormat) - -#endif // DEBUGGER_WATCHHANDLER_H diff --git a/src/plugins/debugger/watchutils.h b/src/plugins/debugger/watchutils.h index 91f019b648..0e7e55baaf 100644 --- a/src/plugins/debugger/watchutils.h +++ b/src/plugins/debugger/watchutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WATCHUTILS_H -#define WATCHUTILS_H +#pragma once // NOTE: Don't add dependencies to other files. // This is used in the debugger auto-tests. @@ -54,5 +53,3 @@ QString removeObviousSideEffects(const QString &exp); } // namespace Internal } // namespace Debugger - -#endif // WATCHUTILS_H diff --git a/src/plugins/debugger/watchwindow.h b/src/plugins/debugger/watchwindow.h index 569e436cfd..f7eefe9bd0 100644 --- a/src/plugins/debugger/watchwindow.h +++ b/src/plugins/debugger/watchwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGGER_WATCHWINDOW_H -#define DEBUGGER_WATCHWINDOW_H +#pragma once #include <utils/basetreeview.h> @@ -92,5 +91,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // DEBUGGER_WATCHWINDOW_H diff --git a/src/plugins/designer/codemodelhelpers.h b/src/plugins/designer/codemodelhelpers.h index 9c5385ea9b..9e3e845d74 100644 --- a/src/plugins/designer/codemodelhelpers.h +++ b/src/plugins/designer/codemodelhelpers.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CODEMODELHELPERS_H -#define CODEMODELHELPERS_H +#pragma once #include <QtGlobal> @@ -46,5 +45,3 @@ bool navigateToSlot(const QString &uiFileName, } // namespace Internal } // namespace Designer - -#endif // CODEMODELHELPERS_H diff --git a/src/plugins/designer/cpp/formclasswizard.h b/src/plugins/designer/cpp/formclasswizard.h index 520c3575d4..8dc4868a5e 100644 --- a/src/plugins/designer/cpp/formclasswizard.h +++ b/src/plugins/designer/cpp/formclasswizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORMCLASSWIZARD_H -#define FORMCLASSWIZARD_H +#pragma once #include "formclasswizardparameters.h" @@ -52,5 +51,3 @@ private: } // namespace Internal } // namespace Designer - -#endif // FORMCLASSWIZARD_H diff --git a/src/plugins/designer/cpp/formclasswizarddialog.h b/src/plugins/designer/cpp/formclasswizarddialog.h index 41ddd60345..18c96e0f0f 100644 --- a/src/plugins/designer/cpp/formclasswizarddialog.h +++ b/src/plugins/designer/cpp/formclasswizarddialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORMCLASSWIZARDDIALOG_H -#define FORMCLASSWIZARDDIALOG_H +#pragma once #include <coreplugin/basefilewizard.h> @@ -66,5 +65,3 @@ private: } // namespace Internal } // namespace Designer - -#endif // FORMCLASSWIZARDDIALOG_H diff --git a/src/plugins/designer/cpp/formclasswizardpage.h b/src/plugins/designer/cpp/formclasswizardpage.h index 37e2b30703..1f442610a5 100644 --- a/src/plugins/designer/cpp/formclasswizardpage.h +++ b/src/plugins/designer/cpp/formclasswizardpage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORMCLASSWIZARDPAGE_H -#define FORMCLASSWIZARDPAGE_H +#pragma once #include <QWizardPage> @@ -75,5 +74,3 @@ private: } // namespace Internal } // namespace Designer - -#endif //FORMCLASSWIZARDPAGE_H diff --git a/src/plugins/designer/cpp/formclasswizardparameters.h b/src/plugins/designer/cpp/formclasswizardparameters.h index 043c045750..7aa25f5cb3 100644 --- a/src/plugins/designer/cpp/formclasswizardparameters.h +++ b/src/plugins/designer/cpp/formclasswizardparameters.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORMCLASSWIZARDPARAMETERS_H -#define FORMCLASSWIZARDPARAMETERS_H +#pragma once #include <QString> #include <QMetaType> @@ -48,5 +47,3 @@ public: } // namespace Designer Q_DECLARE_METATYPE(Designer::FormClassWizardParameters) - -#endif // FORMCLASSWIZARDPARAMETERS_H diff --git a/src/plugins/designer/designer_export.h b/src/plugins/designer/designer_export.h index c6c1c25593..000e6c6130 100644 --- a/src/plugins/designer/designer_export.h +++ b/src/plugins/designer/designer_export.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNER_EXPORT_H -#define DESIGNER_EXPORT_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define DESIGNER_EXPORT Q_DECL_IMPORT #endif - -#endif // DESIGNER_EXPORT_H diff --git a/src/plugins/designer/designerconstants.h b/src/plugins/designer/designerconstants.h index 1704211df9..a097a991d0 100644 --- a/src/plugins/designer/designerconstants.h +++ b/src/plugins/designer/designerconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNERCONSTANTS_H -#define DESIGNERCONSTANTS_H +#pragma once #include <QtGlobal> @@ -73,5 +72,3 @@ namespace Internal { } } // Constants } // Designer - -#endif //DESIGNERCONSTANTS_H diff --git a/src/plugins/designer/designercontext.h b/src/plugins/designer/designercontext.h index 20cb7f1210..11bd0afd8e 100644 --- a/src/plugins/designer/designercontext.h +++ b/src/plugins/designer/designercontext.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNERCONTEXT_H -#define DESIGNERCONTEXT_H +#pragma once #include <coreplugin/icontext.h> @@ -43,5 +42,3 @@ public: } // namespace Internal } // namespace Designer - -#endif // DESIGNERCONTEXT_H diff --git a/src/plugins/designer/editordata.h b/src/plugins/designer/editordata.h index a2fd63bfbf..c4d92f9a41 100644 --- a/src/plugins/designer/editordata.h +++ b/src/plugins/designer/editordata.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EDITORDATA_H -#define EDITORDATA_H +#pragma once namespace SharedTools { class WidgetHost; } @@ -45,5 +44,3 @@ public: } // namespace Internal } // namespace Designer - -#endif // EDITORDATA_H diff --git a/src/plugins/designer/editorwidget.h b/src/plugins/designer/editorwidget.h index 374157cff2..76e77665f3 100644 --- a/src/plugins/designer/editorwidget.h +++ b/src/plugins/designer/editorwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNER_EDITORWIDGET_H -#define DESIGNER_EDITORWIDGET_H +#pragma once #include "designerconstants.h" @@ -75,5 +74,3 @@ private: } // namespace Internal } // namespace Designer - -#endif // DESIGNER_EDITORWIDGET_H diff --git a/src/plugins/designer/formeditorfactory.h b/src/plugins/designer/formeditorfactory.h index f81b657317..8c8b898a7e 100644 --- a/src/plugins/designer/formeditorfactory.h +++ b/src/plugins/designer/formeditorfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORMEDITORFACTORY_H -#define FORMEDITORFACTORY_H +#pragma once #include <coreplugin/editormanager/ieditorfactory.h> @@ -43,5 +42,3 @@ public: } // namespace Internal } // namespace Designer - -#endif // FORMEDITORFACTORY_H diff --git a/src/plugins/designer/formeditorplugin.h b/src/plugins/designer/formeditorplugin.h index 8fa68e3f14..47ecdeda28 100644 --- a/src/plugins/designer/formeditorplugin.h +++ b/src/plugins/designer/formeditorplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORMEDITORPLUGIN_H -#define FORMEDITORPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace Designer - -#endif // FORMEDITORPLUGIN_H diff --git a/src/plugins/designer/formeditorstack.cpp b/src/plugins/designer/formeditorstack.cpp index 6de9360b11..085a641409 100644 --- a/src/plugins/designer/formeditorstack.cpp +++ b/src/plugins/designer/formeditorstack.cpp @@ -177,13 +177,13 @@ SharedTools::WidgetHost *FormEditorStack::formWindowEditorForXmlEditor(const Cor return i != -1 ? m_formEditors.at(i).widgetHost : static_cast<SharedTools::WidgetHost *>(0); } -void FormEditorStack::modeAboutToChange(Core::IMode *m) +void FormEditorStack::modeAboutToChange(Core::Id mode) { - if (Designer::Constants::Internal::debug && m) - qDebug() << "FormEditorStack::modeAboutToChange" << m->id().toString(); + if (Designer::Constants::Internal::debug) + qDebug() << "FormEditorStack::modeAboutToChange" << mode.toString(); // Sync the editor when entering edit mode - if (m && m->id() == Core::Constants::MODE_EDIT) + if (mode == Core::Constants::MODE_EDIT) foreach (const EditorData &data, m_formEditors) data.formWindowEditor->formWindowFile()->syncXmlFromFormWindow(); } diff --git a/src/plugins/designer/formeditorstack.h b/src/plugins/designer/formeditorstack.h index d8f84c2cde..05258e2aed 100644 --- a/src/plugins/designer/formeditorstack.h +++ b/src/plugins/designer/formeditorstack.h @@ -23,11 +23,12 @@ ** ****************************************************************************/ -#ifndef FORMEDITORSTACK_H -#define FORMEDITORSTACK_H +#pragma once #include "editordata.h" +#include <coreplugin/id.h> + #include <QStackedWidget> #include <QList> @@ -36,10 +37,7 @@ class QDesignerFormWindowInterface; class QDesignerFormEditorInterface; QT_END_NAMESPACE -namespace Core { - class IEditor; - class IMode; -} +namespace Core { class IEditor; } namespace Designer { namespace Internal { @@ -69,7 +67,7 @@ public slots: private slots: void updateFormWindowSelectionHandles(); - void modeAboutToChange(Core::IMode *); + void modeAboutToChange(Core::Id mode); void formSizeChanged(int w, int h); private: @@ -82,5 +80,3 @@ private: } // namespace Internal } // namespace Designer - -#endif // FORMEDITORSTACK_H diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index a911e5ad35..b00d0849dd 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -434,7 +434,7 @@ void FormEditorData::fullInit() // 'Run' in 'Design' mode emits output. MiniSplitter *splitter = new MiniSplitter(Qt::Vertical); splitter->addWidget(m_editorWidget); - QWidget *outputPane = new OutputPanePlaceHolder(m_designMode, splitter); + QWidget *outputPane = new OutputPanePlaceHolder(m_designMode->id(), splitter); outputPane->setObjectName(QLatin1String("DesignerOutputPanePlaceHolder")); splitter->addWidget(outputPane); layout->addWidget(splitter); diff --git a/src/plugins/designer/formeditorw.h b/src/plugins/designer/formeditorw.h index 51eaaf6a13..7dbc96d94f 100644 --- a/src/plugins/designer/formeditorw.h +++ b/src/plugins/designer/formeditorw.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORMEDITORW_H -#define FORMEDITORW_H +#pragma once #include "designerconstants.h" @@ -90,5 +89,3 @@ public: } // namespace Internal } // namespace Designer - -#endif // FORMEDITORW_H diff --git a/src/plugins/designer/formtemplatewizardpage.h b/src/plugins/designer/formtemplatewizardpage.h index 471837e360..047ca4667e 100644 --- a/src/plugins/designer/formtemplatewizardpage.h +++ b/src/plugins/designer/formtemplatewizardpage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORMTEMPLATEWIZARDPAGE_H -#define FORMTEMPLATEWIZARDPAGE_H +#pragma once #include <projectexplorer/jsonwizard/jsonwizardpagefactory.h> @@ -80,5 +79,3 @@ private: } // namespace Internal } // namespace Designer - -#endif // FORMTEMPLATEWIZARDPAGE_H diff --git a/src/plugins/designer/formwindoweditor.h b/src/plugins/designer/formwindoweditor.h index 146f528316..80eaeabf24 100644 --- a/src/plugins/designer/formwindoweditor.h +++ b/src/plugins/designer/formwindoweditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORMWINDOWEDITOR_H -#define FORMWINDOWEDITOR_H +#pragma once #include "designer_export.h" #include <texteditor/texteditor.h> @@ -60,5 +59,3 @@ public: }; } // namespace Designer - -#endif // FORMWINDOWEDITOR_H diff --git a/src/plugins/designer/formwindowfile.h b/src/plugins/designer/formwindowfile.h index 648460b7e1..7ee62bb951 100644 --- a/src/plugins/designer/formwindowfile.h +++ b/src/plugins/designer/formwindowfile.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORMWINDOWFILE_H -#define FORMWINDOWFILE_H +#pragma once #include <texteditor/textdocument.h> @@ -89,5 +88,3 @@ private: } // namespace Internal } // namespace Designer - -#endif // FORMWINDOWFILE_H diff --git a/src/plugins/designer/qtcreatorintegration.h b/src/plugins/designer/qtcreatorintegration.h index 00baa16bb6..a00540ba8d 100644 --- a/src/plugins/designer/qtcreatorintegration.h +++ b/src/plugins/designer/qtcreatorintegration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTCREATORINTEGRATION_H -#define QTCREATORINTEGRATION_H +#pragma once #include <QtGlobal> #include <QDesignerIntegration> @@ -65,5 +64,3 @@ private: } // namespace Internal } // namespace Designer - -#endif // QTCREATORINTEGRATION_H diff --git a/src/plugins/designer/qtdesignerformclasscodegenerator.h b/src/plugins/designer/qtdesignerformclasscodegenerator.h index 6f67e052ab..96eb76e07f 100644 --- a/src/plugins/designer/qtdesignerformclasscodegenerator.h +++ b/src/plugins/designer/qtdesignerformclasscodegenerator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTDESIGNERFORMCLASSCODEGENERATOR_H -#define QTDESIGNERFORMCLASSCODEGENERATOR_H +#pragma once #include <QString> #include <QVariant> @@ -52,5 +51,3 @@ public: Q_INVOKABLE QVariant generateFormClassCode(const Designer::FormClassWizardParameters ¶meters); }; } // namespace Designer - -#endif // QTDESIGNERFORMCLASSCODEGENERATOR_H diff --git a/src/plugins/designer/resourcehandler.h b/src/plugins/designer/resourcehandler.h index d714a04c1b..4fa3630d7e 100644 --- a/src/plugins/designer/resourcehandler.h +++ b/src/plugins/designer/resourcehandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RESOURCEHANDLER_H -#define RESOURCEHANDLER_H +#pragma once #include <QObject> #include <QStringList> @@ -71,5 +70,3 @@ private: } // namespace Internal } // namespace Designer - -#endif // RESOURCEHANDLER_H diff --git a/src/plugins/designer/settingsmanager.h b/src/plugins/designer/settingsmanager.h index 164f35e11d..2d64d95048 100644 --- a/src/plugins/designer/settingsmanager.h +++ b/src/plugins/designer/settingsmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SETTINGSMANAGER_H -#define SETTINGSMANAGER_H +#pragma once #include <QDesignerSettingsInterface> @@ -51,5 +50,3 @@ private: } // namespace Internal } // namespace Designer - -#endif // SETTINGSMANAGER_H diff --git a/src/plugins/designer/settingspage.h b/src/plugins/designer/settingspage.h index 98360b822f..7e0a6b1836 100644 --- a/src/plugins/designer/settingspage.h +++ b/src/plugins/designer/settingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNER_SETTINGSPAGE_H -#define DESIGNER_SETTINGSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -73,5 +72,3 @@ private: } // namespace Internal } // namespace Designer - -#endif // DESIGNER_SETTINGSPAGE_H diff --git a/src/plugins/diffeditor/diffeditor.h b/src/plugins/diffeditor/diffeditor.h index 346b36c498..7539ff31d6 100644 --- a/src/plugins/diffeditor/diffeditor.h +++ b/src/plugins/diffeditor/diffeditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIFFEDITOR_H -#define DIFFEDITOR_H +#pragma once #include "diffeditorcontroller.h" @@ -111,5 +110,3 @@ private: } // namespace Internal } // namespace DiffEditor - -#endif // DIFFEDITOR_H diff --git a/src/plugins/diffeditor/diffeditor_global.h b/src/plugins/diffeditor/diffeditor_global.h index 4a1ccb9a8c..763096abbf 100644 --- a/src/plugins/diffeditor/diffeditor_global.h +++ b/src/plugins/diffeditor/diffeditor_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIFFEDITOR_GLOBAL_H -#define DIFFEDITOR_GLOBAL_H +#pragma once #include <QtGlobal> @@ -33,5 +32,3 @@ #else # define DIFFEDITOR_EXPORT Q_DECL_IMPORT #endif - -#endif // DIFFEDITOR_GLOBAL_H diff --git a/src/plugins/diffeditor/diffeditorconstants.h b/src/plugins/diffeditor/diffeditorconstants.h index d9a1a5f9e3..1c9f605aa4 100644 --- a/src/plugins/diffeditor/diffeditorconstants.h +++ b/src/plugins/diffeditor/diffeditorconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIFFEDITORCONSTANTS_H -#define DIFFEDITORCONSTANTS_H +#pragma once #include <QtGlobal> @@ -40,5 +39,3 @@ const char EXPAND_BRANCHES[] = "Branches: <Expand>"; } // namespace Constants } // namespace DiffEditor - -#endif // DIFFEDITORCONSTANTS_H diff --git a/src/plugins/diffeditor/diffeditorcontroller.h b/src/plugins/diffeditor/diffeditorcontroller.h index 3eb7546610..f73524fff5 100644 --- a/src/plugins/diffeditor/diffeditorcontroller.h +++ b/src/plugins/diffeditor/diffeditorcontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIFFEDITORCONTROLLER_H -#define DIFFEDITORCONTROLLER_H +#pragma once #include "diffeditor_global.h" #include "diffutils.h" @@ -96,5 +95,3 @@ private: }; } // namespace DiffEditor - -#endif // DIFFEDITORCONTROLLER_H diff --git a/src/plugins/diffeditor/diffeditordocument.h b/src/plugins/diffeditor/diffeditordocument.h index 936d465784..81d98bb42d 100644 --- a/src/plugins/diffeditor/diffeditordocument.h +++ b/src/plugins/diffeditor/diffeditordocument.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIFFEDITORDOCUMENT_H -#define DIFFEDITORDOCUMENT_H +#pragma once #include "diffutils.h" @@ -107,5 +106,3 @@ private: } // namespace Internal } // namespace DiffEditor - -#endif // DIFFEDITORDOCUMENT_H diff --git a/src/plugins/diffeditor/diffeditorfactory.h b/src/plugins/diffeditor/diffeditorfactory.h index da54f39290..bea963632e 100644 --- a/src/plugins/diffeditor/diffeditorfactory.h +++ b/src/plugins/diffeditor/diffeditorfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIFFEDITORFACTORY_H -#define DIFFEDITORFACTORY_H +#pragma once #include "diffeditor_global.h" @@ -46,5 +45,3 @@ public: } // namespace Internal } // namespace DiffEditor - -#endif // DIFFEDITORFACTORY_H diff --git a/src/plugins/diffeditor/diffeditoricons.h b/src/plugins/diffeditor/diffeditoricons.h index d10bac9e6b..4db2c02dfc 100644 --- a/src/plugins/diffeditor/diffeditoricons.h +++ b/src/plugins/diffeditor/diffeditoricons.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIFFEDITORICONS_H -#define DIFFEDITORICONS_H +#pragma once #include <utils/icon.h> @@ -40,5 +39,3 @@ const Utils::Icon SIDEBYSIDE_DIFF({ } // namespace Icons } // namespace DiffEditor - -#endif // DIFFEDITORICONS_H diff --git a/src/plugins/diffeditor/diffeditorplugin.h b/src/plugins/diffeditor/diffeditorplugin.h index 07c2cd6c4a..3f38425517 100644 --- a/src/plugins/diffeditor/diffeditorplugin.h +++ b/src/plugins/diffeditor/diffeditorplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIFFEDITORPLUGIN_H -#define DIFFEDITORPLUGIN_H +#pragma once #include "diffeditor_global.h" @@ -55,5 +54,3 @@ private slots: } // namespace Internal } // namespace DiffEditor - -#endif // DIFFEDITORPLUGIN_H diff --git a/src/plugins/diffeditor/differ.h b/src/plugins/diffeditor/differ.h index ec8166afea..d841dd0bee 100644 --- a/src/plugins/diffeditor/differ.h +++ b/src/plugins/diffeditor/differ.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIFFER_H -#define DIFFER_H +#pragma once #include "diffeditor_global.h" #include <QString> @@ -114,5 +113,3 @@ private: }; } // namespace DiffEditor - -#endif // DIFF_H diff --git a/src/plugins/diffeditor/diffutils.h b/src/plugins/diffeditor/diffutils.h index 2412bc5432..417309294b 100644 --- a/src/plugins/diffeditor/diffutils.h +++ b/src/plugins/diffeditor/diffutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIFFUTILS_H -#define DIFFUTILS_H +#pragma once #include "diffeditor_global.h" @@ -149,5 +148,3 @@ public: }; } // namespace DiffEditor - -#endif // DIFFUTILS_H diff --git a/src/plugins/diffeditor/diffview.h b/src/plugins/diffeditor/diffview.h index 2d2cdc6b88..bf5342f273 100644 --- a/src/plugins/diffeditor/diffview.h +++ b/src/plugins/diffeditor/diffview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIFFVIEW_H -#define DIFFVIEW_H +#pragma once #include <coreplugin/id.h> @@ -133,5 +132,3 @@ private: } // namespace Internal } // namespace DiffEditor - -#endif // DIFFVIEW_H diff --git a/src/plugins/diffeditor/selectabletexteditorwidget.h b/src/plugins/diffeditor/selectabletexteditorwidget.h index 52eaa911f7..2d04c7b39e 100644 --- a/src/plugins/diffeditor/selectabletexteditorwidget.h +++ b/src/plugins/diffeditor/selectabletexteditorwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SELECTABLETEXTEDITORWIDGET_H -#define SELECTABLETEXTEDITORWIDGET_H +#pragma once #include <texteditor/texteditor.h> @@ -66,5 +65,3 @@ private: } // namespace Internal } // namespace DiffEditor - -#endif // SELECTABLETEXTEDITORWIDGET_H diff --git a/src/plugins/diffeditor/sidebysidediffeditorwidget.h b/src/plugins/diffeditor/sidebysidediffeditorwidget.h index 8eb7f4efca..bd6fcf3252 100644 --- a/src/plugins/diffeditor/sidebysidediffeditorwidget.h +++ b/src/plugins/diffeditor/sidebysidediffeditorwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SIDEBYSIDEDIFFEDITORWIDGET_H -#define SIDEBYSIDEDIFFEDITORWIDGET_H +#pragma once #include "diffutils.h" @@ -119,5 +118,3 @@ private: } // namespace Internal } // namespace DiffEditor - -#endif // SIDEBYSIDEDIFFEDITORWIDGET_H diff --git a/src/plugins/diffeditor/unifieddiffeditorwidget.h b/src/plugins/diffeditor/unifieddiffeditorwidget.h index abbf0d7780..7deb3bcecc 100644 --- a/src/plugins/diffeditor/unifieddiffeditorwidget.h +++ b/src/plugins/diffeditor/unifieddiffeditorwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UNIFIEDDIFFEDITORWIDGET_H -#define UNIFIEDDIFFEDITORWIDGET_H +#pragma once #include "diffutils.h" #include "selectabletexteditorwidget.h" @@ -141,5 +140,3 @@ private: } // namespace Internal } // namespace DiffEditor - -#endif // UNIFIEDDIFFEDITORWIDGET_H diff --git a/src/plugins/emacskeys/emacskeysconstants.h b/src/plugins/emacskeys/emacskeysconstants.h index 37d4873948..5f87669bbf 100644 --- a/src/plugins/emacskeys/emacskeysconstants.h +++ b/src/plugins/emacskeys/emacskeysconstants.h @@ -22,8 +22,7 @@ ** ****************************************************************************/ -#ifndef EMACSKEYSCONSTANTS_H -#define EMACSKEYSCONSTANTS_H +#pragma once namespace EmacsKeys { namespace Constants { @@ -55,5 +54,3 @@ const char SCROLL_HALF_UP[] = "EmacsKeys.ScrollHalfUp"; } // namespace EmacsKeys } // namespace Constants - -#endif // EMACSKEYSCONSTANTS_H diff --git a/src/plugins/emacskeys/emacskeysplugin.h b/src/plugins/emacskeys/emacskeysplugin.h index a44dda7abf..ec95a6a39a 100644 --- a/src/plugins/emacskeys/emacskeysplugin.h +++ b/src/plugins/emacskeys/emacskeysplugin.h @@ -22,8 +22,7 @@ ** ****************************************************************************/ -#ifndef EMACSKEYS_H -#define EMACSKEYS_H +#pragma once #include <extensionsystem/iplugin.h> @@ -102,5 +101,3 @@ private: } // namespace Internal } // namespace EmacsKeys - -#endif // EMACSKEYS_H diff --git a/src/plugins/emacskeys/emacskeysstate.h b/src/plugins/emacskeys/emacskeysstate.h index 2969ccea95..ff9f7a9b82 100644 --- a/src/plugins/emacskeys/emacskeysstate.h +++ b/src/plugins/emacskeys/emacskeysstate.h @@ -22,8 +22,7 @@ ** ****************************************************************************/ -#ifndef EMACSKEYSSTATE_H -#define EMACSKEYSSTATE_H +#pragma once #include <QObject> @@ -71,5 +70,3 @@ private: } // namespace Internal } // namespace EmacsKeys - -#endif // EMACSKEYSSTATE_H diff --git a/src/plugins/fakevim/fakevimactions.h b/src/plugins/fakevim/fakevimactions.h index 5b2e8889d5..e1c230ba51 100644 --- a/src/plugins/fakevim/fakevimactions.h +++ b/src/plugins/fakevim/fakevimactions.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FAKEVIM_ACTIONS_H -#define FAKEVIM_ACTIONS_H +#pragma once #ifndef FAKEVIM_STANDALONE # include <utils/savedaction.h> @@ -143,5 +142,3 @@ FakeVimAction *theFakeVimSetting(int code); } // namespace Internal } // namespace FakeVim - -#endif // FAKEVIM_ACTTIONS_H diff --git a/src/plugins/fakevim/fakevimhandler.h b/src/plugins/fakevim/fakevimhandler.h index f9c71e87a0..cd4e17117e 100644 --- a/src/plugins/fakevim/fakevimhandler.h +++ b/src/plugins/fakevim/fakevimhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FAKEVIM_HANDLER_H -#define FAKEVIM_HANDLER_H +#pragma once #include <QObject> #include <QTextEdit> @@ -169,6 +168,3 @@ private: } // namespace FakeVim Q_DECLARE_METATYPE(FakeVim::Internal::ExCommand) - - -#endif // FAKEVIM_HANDLER_H diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 795c0215e0..97f19948a1 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -1561,12 +1561,9 @@ void FakeVimPluginPrivate::keepOnlyWindow() void FakeVimPluginPrivate::find(bool reverse) { - if (FindPlugin *plugin = FindPlugin::instance()) { - plugin->setUseFakeVim(true); - plugin->openFindToolBar(reverse - ? FindPlugin::FindBackwardDirection - : FindPlugin::FindForwardDirection); - } + Find::setUseFakeVim(true); + Find::openFindToolBar(reverse ? Find::FindBackwardDirection + : Find::FindForwardDirection); } void FakeVimPluginPrivate::findNext(bool reverse) @@ -1873,8 +1870,7 @@ void FakeVimPluginPrivate::setUseFakeVim(const QVariant &value) { //qDebug() << "SET USE FAKEVIM" << value; bool on = value.toBool(); - if (FindPlugin::instance()) - FindPlugin::instance()->setUseFakeVim(on); + Find::setUseFakeVim(on); setUseFakeVimInternal(on); setShowRelativeLineNumbers(theFakeVimSetting(ConfigRelativeNumber)->value()); } diff --git a/src/plugins/fakevim/fakevimplugin.h b/src/plugins/fakevim/fakevimplugin.h index 4f3ee2201d..edbf6ab0b9 100644 --- a/src/plugins/fakevim/fakevimplugin.h +++ b/src/plugins/fakevim/fakevimplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FAKEVIMPLUGIN_H -#define FAKEVIMPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -184,5 +183,3 @@ private: } // namespace Internal } // namespace FakeVim - -#endif // FAKEVIMPLUGIN_H diff --git a/src/plugins/fakevim/fakevimtr.h b/src/plugins/fakevim/fakevimtr.h index 42bc0ac79d..cb6f2b47ea 100644 --- a/src/plugins/fakevim/fakevimtr.h +++ b/src/plugins/fakevim/fakevimtr.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FAKEVIMTR_H -#define FAKEVIMTR_H +#pragma once #include <QCoreApplication> @@ -36,5 +35,3 @@ struct Tr }; } // namespace FakeVim - -#endif // FAKEVIMTR diff --git a/src/plugins/genericprojectmanager/genericmakestep.cpp b/src/plugins/genericprojectmanager/genericmakestep.cpp index e7076baf2b..f696359bf0 100644 --- a/src/plugins/genericprojectmanager/genericmakestep.cpp +++ b/src/plugins/genericprojectmanager/genericmakestep.cpp @@ -108,9 +108,7 @@ bool GenericMakeStep::init(QList<const BuildStep *> &earlierSteps) pp->setMacroExpander(bc->macroExpander()); pp->setWorkingDirectory(bc->buildDirectory().toString()); Utils::Environment env = bc->environment(); - // Force output to english for the parsers. Do this here and not in the toolchain's - // addToEnvironment() to not screw up the users run environment. - env.set(QLatin1String("LC_ALL"), QLatin1String("C")); + Utils::Environment::setupEnglishOutput(&env); pp->setEnvironment(env); pp->setCommand(makeCommand(bc->environment())); pp->setArguments(allArguments()); diff --git a/src/plugins/genericprojectmanager/genericproject.h b/src/plugins/genericprojectmanager/genericproject.h index 2ecd8ddd8d..1ad1567c88 100644 --- a/src/plugins/genericprojectmanager/genericproject.h +++ b/src/plugins/genericprojectmanager/genericproject.h @@ -107,7 +107,6 @@ private: class GenericProjectFile : public Core::IDocument { - Q_OBJECT public: GenericProjectFile(GenericProject *parent, QString fileName, GenericProject::RefreshOptions options); diff --git a/src/plugins/git/gerrit/branchcombobox.h b/src/plugins/git/gerrit/branchcombobox.h index fe34abc61c..fcc97693a6 100644 --- a/src/plugins/git/gerrit/branchcombobox.h +++ b/src/plugins/git/gerrit/branchcombobox.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BRANCHCOMBOBOX_H -#define BRANCHCOMBOBOX_H +#pragma once #include <QComboBox> @@ -48,5 +47,3 @@ private: } // namespace Internal } // namespace Gerrit - -#endif // BRANCHCOMBOBOX_H diff --git a/src/plugins/git/gerrit/gerritdialog.h b/src/plugins/git/gerrit/gerritdialog.h index 48b657ec72..5f2fc2ec65 100644 --- a/src/plugins/git/gerrit/gerritdialog.h +++ b/src/plugins/git/gerrit/gerritdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GERRIT_INTERNAL_GERRITDIALOG_H -#define GERRIT_INTERNAL_GERRITDIALOG_H +#pragma once #include <utils/pathchooser.h> @@ -115,5 +114,3 @@ private: } // namespace Internal } // namespace Gerrit - -#endif // GERRIT_INTERNAL_GERRITDIALOG_H diff --git a/src/plugins/git/gerrit/gerritmodel.h b/src/plugins/git/gerrit/gerritmodel.h index b0a8803a26..1ceb7e7980 100644 --- a/src/plugins/git/gerrit/gerritmodel.h +++ b/src/plugins/git/gerrit/gerritmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GERRIT_INTERNAL_GERRITMODEL_H -#define GERRIT_INTERNAL_GERRITMODEL_H +#pragma once #include <QStandardItemModel> #include <QSharedPointer> @@ -147,5 +146,3 @@ private: } // namespace Gerrit Q_DECLARE_METATYPE(Gerrit::Internal::GerritChangePtr) - -#endif // GERRIT_INTERNAL_GERRITMODEL_H diff --git a/src/plugins/git/gerrit/gerritoptionspage.h b/src/plugins/git/gerrit/gerritoptionspage.h index 59e9ebba8c..0a63fea958 100644 --- a/src/plugins/git/gerrit/gerritoptionspage.h +++ b/src/plugins/git/gerrit/gerritoptionspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GERRIT_INTERNAL_GERRITOPTIONSPAGE_H -#define GERRIT_INTERNAL_GERRITOPTIONSPAGE_H +#pragma once #include <vcsbase/vcsbaseoptionspage.h> @@ -81,5 +80,3 @@ private: } // namespace Internal } // namespace Gerrit - -#endif // GERRIT_INTERNAL_GERRITOPTIONSPAGE_H diff --git a/src/plugins/git/gerrit/gerritparameters.h b/src/plugins/git/gerrit/gerritparameters.h index bfc7959745..1d2de0fb25 100644 --- a/src/plugins/git/gerrit/gerritparameters.h +++ b/src/plugins/git/gerrit/gerritparameters.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GERRITPARAMETERS_H -#define GERRITPARAMETERS_H +#pragma once #include <QStringList> @@ -63,5 +62,3 @@ inline bool operator!=(const GerritParameters &p1, const GerritParameters &p2) } // namespace Internal } // namespace Gerrit - -#endif // GERRITPARAMETERS_H diff --git a/src/plugins/git/gerrit/gerritplugin.h b/src/plugins/git/gerrit/gerritplugin.h index 140d3091d0..b0d0cc51d6 100644 --- a/src/plugins/git/gerrit/gerritplugin.h +++ b/src/plugins/git/gerrit/gerritplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GERRIT_INTERNAL_GERRITPLUGIN_H -#define GERRIT_INTERNAL_GERRITPLUGIN_H +#pragma once #include <utils/fileutils.h> @@ -89,5 +88,3 @@ private: } // namespace Internal } // namespace Gerrit - -#endif // GERRIT_INTERNAL_GERRITPLUGIN_H diff --git a/src/plugins/git/gerrit/gerritpushdialog.h b/src/plugins/git/gerrit/gerritpushdialog.h index e46a84ccf4..ace926fdc5 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.h +++ b/src/plugins/git/gerrit/gerritpushdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GERRITPUSHDIALOG_H -#define GERRITPUSHDIALOG_H +#pragma once #include <QDialog> #include <QMultiMap> @@ -76,5 +75,3 @@ private: } // namespace Internal } // namespace Gerrit - -#endif // GERRITPUSHDIALOG_H diff --git a/src/plugins/glsleditor/glslautocompleter.h b/src/plugins/glsleditor/glslautocompleter.h index c117d568d1..8f09d242cd 100644 --- a/src/plugins/glsleditor/glslautocompleter.h +++ b/src/plugins/glsleditor/glslautocompleter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLAUTOCOMPLETER_H -#define GLSLAUTOCOMPLETER_H +#pragma once #include <texteditor/autocompleter.h> @@ -50,5 +49,3 @@ public: } // namespace Internal } // namespace GlslEditor - -#endif // GLSLAUTOCOMPLETER_H diff --git a/src/plugins/glsleditor/glslcompletionassist.h b/src/plugins/glsleditor/glslcompletionassist.h index ca1bd84a44..234b6331f0 100644 --- a/src/plugins/glsleditor/glslcompletionassist.h +++ b/src/plugins/glsleditor/glslcompletionassist.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLCOMPLETIONASSIST_H -#define GLSLCOMPLETIONASSIST_H +#pragma once #include "glsleditor.h" @@ -127,5 +126,3 @@ private: } // namespace Internal } // namespace GlslEditor - -#endif // GLSLCOMPLETIONASSIST_H diff --git a/src/plugins/glsleditor/glsleditor.h b/src/plugins/glsleditor/glsleditor.h index 4c1deab1e0..99411bfe8b 100644 --- a/src/plugins/glsleditor/glsleditor.h +++ b/src/plugins/glsleditor/glsleditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLEDITOR_H -#define GLSLEDITOR_H +#pragma once #include <texteditor/texteditor.h> @@ -43,5 +42,3 @@ public: } // namespace Internal } // namespace GlslEditor - -#endif // GLSLEDITOR_H diff --git a/src/plugins/glsleditor/glsleditorconstants.h b/src/plugins/glsleditor/glsleditorconstants.h index 6a5c973e61..8121517e0f 100644 --- a/src/plugins/glsleditor/glsleditorconstants.h +++ b/src/plugins/glsleditor/glsleditorconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLEDITOR_CONSTANTS_H -#define GLSLEDITOR_CONSTANTS_H +#pragma once #include <QtGlobal> @@ -50,5 +49,3 @@ const char WIZARD_TR_CATEGORY_GLSL[] = QT_TRANSLATE_NOOP("GLSLEditor", "GLSL"); } // namespace Constants } // namespace GlslEditor - -#endif // GLSLEDITOR_CONSTANTS_H diff --git a/src/plugins/glsleditor/glsleditorplugin.h b/src/plugins/glsleditor/glsleditorplugin.h index e29e2fadae..31925dc7b9 100644 --- a/src/plugins/glsleditor/glsleditorplugin.h +++ b/src/plugins/glsleditor/glsleditorplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLEDITORPLUGIN_H -#define GLSLEDITORPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> #include <glsl/glsl.h> @@ -67,5 +66,3 @@ public: } // namespace Internal } // namespace GlslEditor - -#endif // GLSLEDITORPLUGIN_H diff --git a/src/plugins/glsleditor/glslhighlighter.h b/src/plugins/glsleditor/glslhighlighter.h index c2329d1fbe..afbe882a41 100644 --- a/src/plugins/glsleditor/glslhighlighter.h +++ b/src/plugins/glsleditor/glslhighlighter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLHIGHLIGHTER_H -#define GLSLHIGHLIGHTER_H +#pragma once #include <texteditor/syntaxhighlighter.h> @@ -62,5 +61,3 @@ protected: } // namespace Internal } // namespace GlslEditor - -#endif // GLSLHIGHLIGHTER_H diff --git a/src/plugins/glsleditor/glslhoverhandler.h b/src/plugins/glsleditor/glslhoverhandler.h index d7cc27a4bf..f15c8b9948 100644 --- a/src/plugins/glsleditor/glslhoverhandler.h +++ b/src/plugins/glsleditor/glslhoverhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLHOVERHANDLER_H -#define GLSLHOVERHANDLER_H +#pragma once #include <texteditor/basehoverhandler.h> @@ -43,5 +42,3 @@ private: } // namespace Internal } // namespace GlslEditor - -#endif // GLSLHOVERHANDLER_H diff --git a/src/plugins/glsleditor/glslindenter.h b/src/plugins/glsleditor/glslindenter.h index 499c99a164..e52a024b10 100644 --- a/src/plugins/glsleditor/glslindenter.h +++ b/src/plugins/glsleditor/glslindenter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GLSLINDENTER_H -#define GLSLINDENTER_H +#pragma once #include <texteditor/indenter.h> @@ -53,5 +52,3 @@ public: } // namespace Internal } // namespace GlslEditor - -#endif // GLSLINDENTER_H diff --git a/src/plugins/helloworld/helloworldplugin.h b/src/plugins/helloworld/helloworldplugin.h index 0172b7b8f9..c8d08d5484 100644 --- a/src/plugins/helloworld/helloworldplugin.h +++ b/src/plugins/helloworld/helloworldplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HELLOWORLDPLUGIN_H -#define HELLOWORLDPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -51,5 +50,3 @@ private slots: } // namespace Internal } // namespace HelloWorld - -#endif // HELLOWORLDPLUGIN_H diff --git a/src/plugins/helloworld/helloworldwindow.h b/src/plugins/helloworld/helloworldwindow.h index 6332cf35b7..382dac8f22 100644 --- a/src/plugins/helloworld/helloworldwindow.h +++ b/src/plugins/helloworld/helloworldwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HELLOWORLDWINDOW_H -#define HELLOWORLDWINDOW_H +#pragma once #include <QWidget> @@ -41,5 +40,3 @@ public: } // namespace Internal } // namespace HelloWorld - -#endif // HELLOWORLDWINDOW_H diff --git a/src/plugins/help/centralwidget.h b/src/plugins/help/centralwidget.h index b2cc68fd6e..088487e349 100644 --- a/src/plugins/help/centralwidget.h +++ b/src/plugins/help/centralwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CENTRALWIDGET_H -#define CENTRALWIDGET_H +#pragma once #include "helpwidget.h" @@ -49,5 +48,3 @@ public: } // namespace Internal } // namespace Help - -#endif // CENTRALWIDGET_H diff --git a/src/plugins/help/docsettingspage.h b/src/plugins/help/docsettingspage.h index a4d7ca48e4..e3ea9156db 100644 --- a/src/plugins/help/docsettingspage.h +++ b/src/plugins/help/docsettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DOCSETTINGSPAGE_H -#define DOCSETTINGSPAGE_H +#pragma once #include "ui_docsettingspage.h" #include <coreplugin/dialogs/ioptionspage.h> @@ -77,5 +76,3 @@ private: } // namespace Help } // namespace Internal - -#endif // DOCSETTINGSPAGE_H diff --git a/src/plugins/help/filtersettingspage.h b/src/plugins/help/filtersettingspage.h index 6d151c9489..0e5b917bd5 100644 --- a/src/plugins/help/filtersettingspage.h +++ b/src/plugins/help/filtersettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILTERSETTINGSPAGE_H -#define FILTERSETTINGSPAGE_H +#pragma once #include "ui_filtersettingspage.h" #include <coreplugin/dialogs/ioptionspage.h> @@ -72,5 +71,3 @@ private: } // namespace Help } // namespace Internal - -#endif // DOCSETTINGSPAGE_H diff --git a/src/plugins/help/generalsettingspage.h b/src/plugins/help/generalsettingspage.h index 1ca5cf4770..d8d133c886 100644 --- a/src/plugins/help/generalsettingspage.h +++ b/src/plugins/help/generalsettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GENERALSETTINGSPAGE_H -#define GENERALSETTINGSPAGE_H +#pragma once #include "ui_generalsettingspage.h" #include <coreplugin/dialogs/ioptionspage.h> @@ -79,5 +78,3 @@ private: } // Internal } // Help - -#endif // GENERALSETTINGSPAGE_H diff --git a/src/plugins/help/helpconstants.h b/src/plugins/help/helpconstants.h index f5c2622cd6..a832eb29b2 100644 --- a/src/plugins/help/helpconstants.h +++ b/src/plugins/help/helpconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HELPCONSTANTS_H -#define HELPCONSTANTS_H +#pragma once #include <QtGlobal> #include <QLatin1String> @@ -66,5 +65,3 @@ static const char SB_SEARCH[] = QT_TRANSLATE_NOOP("Help::Internal::HelpPlugin", } // Constants } // Help - -#endif // HELPCONSTANTS_H diff --git a/src/plugins/help/helpfindsupport.h b/src/plugins/help/helpfindsupport.h index d9007cbaa1..3c5cd393a0 100644 --- a/src/plugins/help/helpfindsupport.h +++ b/src/plugins/help/helpfindsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HELPFINDSUPPORT_H -#define HELPFINDSUPPORT_H +#pragma once #include "centralwidget.h" @@ -58,5 +57,3 @@ private: } // namespace Internal } // namespace Help - -#endif // HELPFINDSUPPORT_H diff --git a/src/plugins/help/helpindexfilter.h b/src/plugins/help/helpindexfilter.h index abbd13c8d0..f0edb547f6 100644 --- a/src/plugins/help/helpindexfilter.h +++ b/src/plugins/help/helpindexfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HELPINDEXFILTER_H -#define HELPINDEXFILTER_H +#pragma once #include <coreplugin/locator/ilocatorfilter.h> @@ -68,5 +67,3 @@ private: } // namespace Internal } // namespace Help - -#endif // HELPINDEXFILTER_H diff --git a/src/plugins/help/helpmode.h b/src/plugins/help/helpmode.h index 6036f81472..cc3c93222d 100644 --- a/src/plugins/help/helpmode.h +++ b/src/plugins/help/helpmode.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HELPMODE_H -#define HELPMODE_H +#pragma once #include <coreplugin/imode.h> @@ -42,5 +41,3 @@ public: } // namespace Internal } // namespace Help - -#endif // HELPMODE_H diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index b3c728e19a..4bcf9fbab1 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -241,8 +241,8 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error) SLOT(showLinkInHelpMode(QUrl))); QDesktopServices::setUrlHandler(QLatin1String("qthelp"), HelpManager::instance(), "handleHelpRequest"); - connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*,Core::IMode*)), - this, SLOT(modeChanged(Core::IMode*,Core::IMode*))); + connect(ModeManager::instance(), &ModeManager::currentModeChanged, + this, &HelpPlugin::modeChanged); m_mode = new HelpMode; m_mode->setWidget(m_centralWidget); @@ -445,10 +445,10 @@ void HelpPlugin::slotHideRightPane() RightPaneWidget::instance()->setShown(false); } -void HelpPlugin::modeChanged(IMode *mode, IMode *old) +void HelpPlugin::modeChanged(Core::Id mode, Core::Id old) { Q_UNUSED(old) - if (mode == m_mode) { + if (mode == m_mode->id()) { qApp->setOverrideCursor(Qt::WaitCursor); doSetupIfNeeded(); qApp->restoreOverrideCursor(); @@ -478,7 +478,7 @@ void HelpPlugin::updateSideBarSource(const QUrl &newUrl) void HelpPlugin::setupHelpEngineIfNeeded() { LocalHelpManager::setEngineNeedsUpdate(); - if (ModeManager::currentMode() == m_mode + if (ModeManager::currentMode() == m_mode->id() || LocalHelpManager::contextHelpOption() == HelpManager::ExternalHelpAlways) LocalHelpManager::setupGuiHelpEngine(); } diff --git a/src/plugins/help/helpplugin.h b/src/plugins/help/helpplugin.h index db48dd76f6..b4a98a5a7d 100644 --- a/src/plugins/help/helpplugin.h +++ b/src/plugins/help/helpplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HELPPLUGIN_H -#define HELPPLUGIN_H +#pragma once #include "helpwidget.h" @@ -43,7 +42,6 @@ class QUrl; QT_END_NAMESPACE namespace Core { -class IMode; class MiniSplitter; class SideBar; class SideBarItem; @@ -80,7 +78,7 @@ public: static HelpViewer *createHelpViewer(qreal zoom); private slots: - void modeChanged(Core::IMode *mode, Core::IMode *old); + void modeChanged(Core::Id mode, Core::Id old); void showContextHelp(); void activateIndex(); @@ -135,5 +133,3 @@ private: } // namespace Internal } // namespace Help - -#endif // HELPPLUGIN_H diff --git a/src/plugins/help/helpviewer.h b/src/plugins/help/helpviewer.h index e1f52de833..4ceccb176f 100644 --- a/src/plugins/help/helpviewer.h +++ b/src/plugins/help/helpviewer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HELPVIEWER_H -#define HELPVIEWER_H +#pragma once #include <coreplugin/find/textfindconstants.h> @@ -105,5 +104,3 @@ protected slots: } // namespace Internal } // namespace Help - -#endif // HELPVIEWER_H diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp index 284cfec2b6..0a374514cb 100644 --- a/src/plugins/help/helpwidget.cpp +++ b/src/plugins/help/helpwidget.cpp @@ -222,8 +222,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget connect(m_copy, &QAction::triggered, this, &HelpWidget::copy); Core::ActionContainer *advancedMenu = Core::ActionManager::actionContainer(Core::Constants::M_EDIT_ADVANCED); - QTC_CHECK(advancedMenu); - if (advancedMenu) { + if (QTC_GUARD(advancedMenu)) { // reuse TextEditor constants to avoid a second pair of menu actions m_scaleUp = new QAction(tr("Increase Font Size"), this); cmd = Core::ActionManager::registerAction(m_scaleUp, TextEditor::Constants::INCREASE_FONT_SIZE, diff --git a/src/plugins/help/helpwidget.h b/src/plugins/help/helpwidget.h index bff37b68b0..5d29dd3e6b 100644 --- a/src/plugins/help/helpwidget.h +++ b/src/plugins/help/helpwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HELPWIDGET_H -#define HELPWIDGET_H +#pragma once #include <coreplugin/icontext.h> @@ -147,5 +146,3 @@ private: } // Internal } // Help - -#endif // HELPWIDGET_H diff --git a/src/plugins/help/localhelpmanager.h b/src/plugins/help/localhelpmanager.h index 6fdae1743e..4eae028e3e 100644 --- a/src/plugins/help/localhelpmanager.h +++ b/src/plugins/help/localhelpmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LOCALHELPMANAGER_H -#define LOCALHELPMANAGER_H +#pragma once #include <coreplugin/helpmanager.h> @@ -129,5 +128,3 @@ private: } // Help Q_DECLARE_METATYPE(Help::Internal::LocalHelpManager::HelpData) - -#endif // LOCALHELPMANAGER_H diff --git a/src/plugins/help/macwebkithelpviewer.h b/src/plugins/help/macwebkithelpviewer.h index 33c8cf1567..9c4d5ab6ab 100644 --- a/src/plugins/help/macwebkithelpviewer.h +++ b/src/plugins/help/macwebkithelpviewer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MACWEBKITHELPVIEWER_H -#define MACWEBKITHELPVIEWER_H +#pragma once #include "helpviewer.h" @@ -135,5 +134,3 @@ private: } // namespace Internal } // namespace Help - -#endif // MACWEBKITHELPVIEWER_H diff --git a/src/plugins/help/openpagesmanager.h b/src/plugins/help/openpagesmanager.h index d94f82392c..f27164d20b 100644 --- a/src/plugins/help/openpagesmanager.h +++ b/src/plugins/help/openpagesmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OPENPAGESMANAGER_H -#define OPENPAGESMANAGER_H +#pragma once #include <QObject> @@ -94,5 +93,3 @@ private: } // namespace Internal } // namespace Help - -#endif // OPENPAGESMANAGER_H diff --git a/src/plugins/help/openpagesmodel.h b/src/plugins/help/openpagesmodel.h index b657666430..3db1cec3b5 100644 --- a/src/plugins/help/openpagesmodel.h +++ b/src/plugins/help/openpagesmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OPENPAGESMODEL_H -#define OPENPAGESMODEL_H +#pragma once #include <QList> #include <QAbstractTableModel> @@ -60,5 +59,3 @@ private: } // namespace Internal } // namespace Help - -#endif // OPENPAGESMODEL_H diff --git a/src/plugins/help/openpagesswitcher.h b/src/plugins/help/openpagesswitcher.h index 962da8a3f3..2903e486ad 100644 --- a/src/plugins/help/openpagesswitcher.h +++ b/src/plugins/help/openpagesswitcher.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OPENPAGESSWITCHER_H -#define OPENPAGESSWITCHER_H +#pragma once #include <QFrame> @@ -68,5 +67,3 @@ private: } // namespace Internal } // namespace Help - -#endif // OPENPAGESSWITCHER_H diff --git a/src/plugins/help/openpageswidget.h b/src/plugins/help/openpageswidget.h index cc07765f2c..1cfb931be9 100644 --- a/src/plugins/help/openpageswidget.h +++ b/src/plugins/help/openpageswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OPENPAGESWIDGET_H -#define OPENPAGESWIDGET_H +#pragma once #include <coreplugin/opendocumentstreeview.h> @@ -62,5 +61,3 @@ private: } // namespace Internal } // namespace Help - -#endif // OPENPAGESWIDGET_H diff --git a/src/plugins/help/qtwebkithelpviewer.cpp b/src/plugins/help/qtwebkithelpviewer.cpp index fdd6104acd..395a89df9c 100644 --- a/src/plugins/help/qtwebkithelpviewer.cpp +++ b/src/plugins/help/qtwebkithelpviewer.cpp @@ -375,7 +375,7 @@ bool QtWebKitHelpWidget::eventFilter(QObject *obj, QEvent *event) if (event->type() == QEvent::KeyPress) { if (QKeyEvent *keyEvent = static_cast<QKeyEvent*> (event)) { if (keyEvent->key() == Qt::Key_Slash) - FindPlugin::instance()->openFindToolBar(FindPlugin::FindForwardDirection); + Find::openFindToolBar(Find::FindForwardDirection); } } return QWebView::eventFilter(obj, event); diff --git a/src/plugins/help/qtwebkithelpviewer.h b/src/plugins/help/qtwebkithelpviewer.h index d556978da4..ff85a92a28 100644 --- a/src/plugins/help/qtwebkithelpviewer.h +++ b/src/plugins/help/qtwebkithelpviewer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTWEBKITHELPVIEWER_H -#define QTWEBKITHELPVIEWER_H +#pragma once #include "helpviewer.h" @@ -157,5 +156,3 @@ private: } // namespace Help #endif // !QT_NO_WEBKIT - -#endif // QTWEBKITHELPVIEWER_H diff --git a/src/plugins/help/remotehelpfilter.h b/src/plugins/help/remotehelpfilter.h index e10a02eea5..19309d753c 100644 --- a/src/plugins/help/remotehelpfilter.h +++ b/src/plugins/help/remotehelpfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTEHELPFILTER_H -#define REMOTEHELPFILTER_H +#pragma once #include "ui_remotehelpfilter.h" @@ -82,5 +81,3 @@ private: } // namespace Internal } // namespace Help - -#endif // REMOTEHELPFILTER_H diff --git a/src/plugins/help/searchtaskhandler.h b/src/plugins/help/searchtaskhandler.h index 9cfac3eff1..54ca8cf9ba 100644 --- a/src/plugins/help/searchtaskhandler.h +++ b/src/plugins/help/searchtaskhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HELP_SEARCHTASKHANDLER_H -#define HELP_SEARCHTASKHANDLER_H +#pragma once #include <projectexplorer/itaskhandler.h> @@ -38,11 +37,9 @@ class SearchTaskHandler : public ProjectExplorer::ITaskHandler Q_OBJECT public: - SearchTaskHandler() {} - - bool canHandle(const ProjectExplorer::Task &task) const; - void handle(const ProjectExplorer::Task &task); - QAction *createAction(QObject *parent) const; + bool canHandle(const ProjectExplorer::Task &task) const override; + void handle(const ProjectExplorer::Task &task) override; + QAction *createAction(QObject *parent) const override; signals: void search(const QUrl &url); @@ -50,5 +47,3 @@ signals: } // namespace Internal } // namespace Help - -#endif // HELP_SEARCHTASKHANDLER_H diff --git a/src/plugins/help/searchwidget.h b/src/plugins/help/searchwidget.h index 95cdd92aa4..3c2bdf670d 100644 --- a/src/plugins/help/searchwidget.h +++ b/src/plugins/help/searchwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SEARCHWIDGET_H -#define SEARCHWIDGET_H +#pragma once #include <coreplugin/sidebar.h> @@ -103,5 +102,3 @@ private: } // namespace Internal } // namespace Help - -#endif // SEARCHWIDGET_H diff --git a/src/plugins/help/textbrowserhelpviewer.cpp b/src/plugins/help/textbrowserhelpviewer.cpp index 64464f5ca4..611cf00609 100644 --- a/src/plugins/help/textbrowserhelpviewer.cpp +++ b/src/plugins/help/textbrowserhelpviewer.cpp @@ -405,7 +405,7 @@ bool TextBrowserHelpWidget::eventFilter(QObject *obj, QEvent *event) QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); if (keyEvent->key() == Qt::Key_Slash) { keyEvent->accept(); - Core::FindPlugin::instance()->openFindToolBar(Core::FindPlugin::FindForwardDirection); + Core::Find::openFindToolBar(Core::Find::FindForwardDirection); return true; } } else if (event->type() == QEvent::ToolTip) { diff --git a/src/plugins/help/textbrowserhelpviewer.h b/src/plugins/help/textbrowserhelpviewer.h index ef777d6a81..5640fe10ad 100644 --- a/src/plugins/help/textbrowserhelpviewer.h +++ b/src/plugins/help/textbrowserhelpviewer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTBROWSERHELPVIEWER_H -#define TEXTBROWSERHELPVIEWER_H +#pragma once #include "centralwidget.h" #include "helpviewer.h" @@ -119,5 +118,3 @@ private: } // namespace Internal } // namespace Help - -#endif // TEXTBROWSERHELPVIEWER_H diff --git a/src/plugins/help/xbelsupport.h b/src/plugins/help/xbelsupport.h index 4927c34a6a..dedd112f7f 100644 --- a/src/plugins/help/xbelsupport.h +++ b/src/plugins/help/xbelsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef XBELSUPPORT_H -#define XBELSUPPORT_H +#pragma once #include <QIcon> #include <QXmlStreamReader> @@ -75,5 +74,3 @@ private: } // Internal } // Help - -#endif // XBELSUPPORT_H diff --git a/src/plugins/imageviewer/imageview.h b/src/plugins/imageviewer/imageview.h index b120dac26d..9c9020c2c4 100644 --- a/src/plugins/imageviewer/imageview.h +++ b/src/plugins/imageviewer/imageview.h @@ -48,8 +48,7 @@ ** ****************************************************************************/ -#ifndef IMAGEVIEW_H -#define IMAGEVIEW_H +#pragma once #include <QGraphicsView> @@ -104,5 +103,3 @@ private: } // namespace Internal } // namespace ImageViewer - -#endif // IMAGEVIEW_H diff --git a/src/plugins/imageviewer/imageviewer.h b/src/plugins/imageviewer/imageviewer.h index d2bbb32541..9a4baab18d 100644 --- a/src/plugins/imageviewer/imageviewer.h +++ b/src/plugins/imageviewer/imageviewer.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef IMAGEVIEWER_H -#define IMAGEVIEWER_H +#pragma once #include <coreplugin/editormanager/ieditor.h> #include <coreplugin/idocument.h> @@ -82,5 +81,3 @@ private: } // namespace Internal } // namespace ImageViewer - -#endif // IMAGEVIEWER_H diff --git a/src/plugins/imageviewer/imageviewerconstants.h b/src/plugins/imageviewer/imageviewerconstants.h index 3152295dd3..496d3a8d6a 100644 --- a/src/plugins/imageviewer/imageviewerconstants.h +++ b/src/plugins/imageviewer/imageviewerconstants.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef IMAGEVIEWERCONSTANTS_H -#define IMAGEVIEWERCONSTANTS_H +#pragma once namespace ImageViewer { namespace Constants { @@ -44,5 +43,3 @@ const char ACTION_TOGGLE_ANIMATION[] = "ImageViewer.ToggleAnimation"; } // namespace Constants } // namespace ImageViewer - -#endif // IMAGEVIEWERCONSTANTS_H diff --git a/src/plugins/imageviewer/imageviewerfactory.h b/src/plugins/imageviewer/imageviewerfactory.h index d288ddaf4b..de307ebdfb 100644 --- a/src/plugins/imageviewer/imageviewerfactory.h +++ b/src/plugins/imageviewer/imageviewerfactory.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef IMAGEVIEWERFACTORY_H -#define IMAGEVIEWERFACTORY_H +#pragma once #include <coreplugin/editormanager/ieditorfactory.h> #include <coreplugin/editormanager/ieditor.h> @@ -45,5 +44,3 @@ public: } // namespace Internal } // namespace ImageViewer - -#endif // IMAGEVIEWERFACTORY_H diff --git a/src/plugins/imageviewer/imageviewerfile.h b/src/plugins/imageviewer/imageviewerfile.h index 772dc42955..9442e7821d 100644 --- a/src/plugins/imageviewer/imageviewerfile.h +++ b/src/plugins/imageviewer/imageviewerfile.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef IMAGEVIEWERFILE_H -#define IMAGEVIEWERFILE_H +#pragma once #include <coreplugin/idocument.h> @@ -94,5 +93,3 @@ private: } // namespace Internal } // namespace ImageViewer - -#endif // IMAGEVIEWERFILE_H diff --git a/src/plugins/imageviewer/imageviewerplugin.h b/src/plugins/imageviewer/imageviewerplugin.h index 841295dd88..83868edc11 100644 --- a/src/plugins/imageviewer/imageviewerplugin.h +++ b/src/plugins/imageviewer/imageviewerplugin.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef IMAGEVIEWERPLUGIN_H -#define IMAGEVIEWERPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace ImageViewer - -#endif // IMAGEVIEWERPLUGIN_H diff --git a/src/plugins/ios/iosanalyzesupport.cpp b/src/plugins/ios/iosanalyzesupport.cpp index c9e7020af3..9da560b617 100644 --- a/src/plugins/ios/iosanalyzesupport.cpp +++ b/src/plugins/ios/iosanalyzesupport.cpp @@ -97,13 +97,13 @@ void IosAnalyzeSupport::qmlServerReady() m_runControl->notifyRemoteSetupDone(m_qmlPort); } -void IosAnalyzeSupport::handleServerPorts(int gdbServerPort, int qmlPort) +void IosAnalyzeSupport::handleServerPorts(Utils::Port gdbServerPort, Utils::Port qmlPort) { Q_UNUSED(gdbServerPort); m_qmlPort = qmlPort; } -void IosAnalyzeSupport::handleGotInferiorPid(qint64 pid, int qmlPort) +void IosAnalyzeSupport::handleGotInferiorPid(qint64 pid, Utils::Port qmlPort) { Q_UNUSED(pid); m_qmlPort = qmlPort; diff --git a/src/plugins/ios/iosanalyzesupport.h b/src/plugins/ios/iosanalyzesupport.h index 2b18c5f693..2da08d4c1e 100644 --- a/src/plugins/ios/iosanalyzesupport.h +++ b/src/plugins/ios/iosanalyzesupport.h @@ -23,12 +23,12 @@ ** ****************************************************************************/ -#ifndef IOSANALYZESUPPORT_H -#define IOSANALYZESUPPORT_H +#pragma once #include "iosrunconfiguration.h" #include <qmldebug/qmloutputparser.h> +#include <utils/port.h> #include <QProcess> #include <QObject> @@ -52,8 +52,8 @@ public: private: void qmlServerReady(); - void handleServerPorts(int gdbServerFd, int qmlPort); - void handleGotInferiorPid(qint64 pid, int qmlPort); + void handleServerPorts(Utils::Port gdbServerPort, Utils::Port qmlPort); + void handleGotInferiorPid(qint64 pid, Utils::Port qmlPort); void handleRemoteProcessFinished(bool cleanEnd); void handleRemoteOutput(const QString &output); @@ -62,10 +62,8 @@ private: Debugger::AnalyzerRunControl *m_runControl; IosRunner * const m_runner; QmlDebug::QmlOutputParser m_outputParser; - int m_qmlPort; + Utils::Port m_qmlPort; }; } // namespace Internal } // namespace Ios - -#endif // IOSANALYZESUPPORT_H diff --git a/src/plugins/ios/iosbuildstep.cpp b/src/plugins/ios/iosbuildstep.cpp index 1d1234c8c5..ccc7fbb799 100644 --- a/src/plugins/ios/iosbuildstep.cpp +++ b/src/plugins/ios/iosbuildstep.cpp @@ -111,9 +111,7 @@ bool IosBuildStep::init(QList<const BuildStep *> &earlierSteps) pp->setMacroExpander(bc->macroExpander()); pp->setWorkingDirectory(bc->buildDirectory().toString()); Utils::Environment env = bc->environment(); - // Force output to english for the parsers. Do this here and not in the toolchain's - // addToEnvironment() to not screw up the users run environment. - env.set(QLatin1String("LC_ALL"), QLatin1String("C")); + Utils::Environment::setupEnglishOutput(&env); pp->setEnvironment(env); pp->setCommand(buildCommand()); pp->setArguments(Utils::QtcProcess::joinArgs(allArguments())); diff --git a/src/plugins/ios/iosbuildstep.h b/src/plugins/ios/iosbuildstep.h index a89df243e8..9a08d43f9f 100644 --- a/src/plugins/ios/iosbuildstep.h +++ b/src/plugins/ios/iosbuildstep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSBUILDSTEP_H -#define IOSBUILDSTEP_H +#pragma once #include <projectexplorer/abstractprocessstep.h> @@ -125,5 +124,3 @@ public: } // namespace Internal } // namespace Ios - -#endif // IOSBUILDSTEP_H diff --git a/src/plugins/ios/iosconfigurations.h b/src/plugins/ios/iosconfigurations.h index 94ebeb1384..15b457c17f 100644 --- a/src/plugins/ios/iosconfigurations.h +++ b/src/plugins/ios/iosconfigurations.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSCONFIGURATIONS_H -#define IOSCONFIGURATIONS_H +#pragma once #include <projectexplorer/abi.h> #include <projectexplorer/toolchain.h> @@ -81,5 +80,3 @@ private: } // namespace Internal } // namespace Ios - -#endif // IOSCONFIGURATIONS_H diff --git a/src/plugins/ios/iosconstants.h b/src/plugins/ios/iosconstants.h index 559994491f..4bb8e9b832 100644 --- a/src/plugins/ios/iosconstants.h +++ b/src/plugins/ios/iosconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSCONSTANTS_H -#define IOSCONSTANTS_H +#pragma once #include <QtGlobal> #include <QLoggingCategory> @@ -56,5 +55,3 @@ const char EXTRA_INFO_KEY[] = "extraInfo"; } // namespace Constants; } // namespace Ios - -#endif // IOSCONSTANTS_H diff --git a/src/plugins/ios/iosdebugsupport.cpp b/src/plugins/ios/iosdebugsupport.cpp index 8adfb5e795..0d42fb6d2e 100644 --- a/src/plugins/ios/iosdebugsupport.cpp +++ b/src/plugins/ios/iosdebugsupport.cpp @@ -181,18 +181,19 @@ IosDebugSupport::~IosDebugSupport() { } -void IosDebugSupport::handleServerPorts(int gdbServerPort, int qmlPort) +void IosDebugSupport::handleServerPorts(Utils::Port gdbServerPort, Utils::Port qmlPort) { RemoteSetupResult result; result.gdbServerPort = gdbServerPort; result.qmlServerPort = qmlPort; - result.success = gdbServerPort > 0 || (m_runner && !m_runner->cppDebug() && qmlPort > 0); + result.success = gdbServerPort.isValid() + || (m_runner && !m_runner->cppDebug() && qmlPort.isValid()); if (!result.success) result.reason = tr("Could not get debug server file descriptor."); m_runControl->notifyEngineRemoteSetupFinished(result); } -void IosDebugSupport::handleGotInferiorPid(qint64 pid, int qmlPort) +void IosDebugSupport::handleGotInferiorPid(qint64 pid, Utils::Port qmlPort) { RemoteSetupResult result; result.qmlServerPort = qmlPort; diff --git a/src/plugins/ios/iosdebugsupport.h b/src/plugins/ios/iosdebugsupport.h index e5f12c7699..1d9560cd46 100644 --- a/src/plugins/ios/iosdebugsupport.h +++ b/src/plugins/ios/iosdebugsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSDEBUGSUPPORT_H -#define IOSDEBUGSUPPORT_H +#pragma once #include "iosrunconfiguration.h" #include <QProcess> @@ -51,8 +50,8 @@ public: ~IosDebugSupport(); private: - void handleServerPorts(int gdbServerFd, int qmlPort); - void handleGotInferiorPid(qint64, int qmlPort); + void handleServerPorts(Utils::Port gdbServerPort, Utils::Port qmlPort); + void handleGotInferiorPid(qint64, Utils::Port qmlPort); void handleRemoteProcessFinished(bool cleanEnd); void handleRemoteOutput(const QString &output); @@ -65,5 +64,3 @@ private: } // namespace Internal } // namespace Ios - -#endif // IOSDEBUGSUPPORT_H diff --git a/src/plugins/ios/iosdeployconfiguration.h b/src/plugins/ios/iosdeployconfiguration.h index 2fc7113814..2dc92fdfce 100644 --- a/src/plugins/ios/iosdeployconfiguration.h +++ b/src/plugins/ios/iosdeployconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSDEPLOYCONFIGURATION_H -#define IOSDEPLOYCONFIGURATION_H +#pragma once #include <projectexplorer/deployconfiguration.h> @@ -69,5 +68,3 @@ public: } // namespace Internal } // namespace Ios - -#endif // IOSDEPLOYCONFIGURATION_H diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index 76839d2760..37d76fb8df 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -176,7 +176,7 @@ void IosDeployStep::handleDidTransferApp(IosToolHandler *handler, const QString m_transferStatus = TransferFailed; if (!m_expectFail) TaskHub::addTask(Task::Error, - tr("Deployment failed. The settings in the Organizer window of Xcode might be incorrect."), + tr("Deployment failed. The settings in the Devices window of Xcode might be incorrect."), ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); } m_futureInterface.reportResult(status == IosToolHandler::Success); diff --git a/src/plugins/ios/iosdeploystep.h b/src/plugins/ios/iosdeploystep.h index d5064f3da7..f7b1efcb9d 100644 --- a/src/plugins/ios/iosdeploystep.h +++ b/src/plugins/ios/iosdeploystep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSDEPLOYSTEP_H -#define IOSDEPLOYSTEP_H +#pragma once #include "iosconfigurations.h" #include "iosdevice.h" @@ -110,5 +109,3 @@ private: } // namespace Internal } // namespace Ios - -#endif // IOSDEPLOYSTEP_H diff --git a/src/plugins/ios/iosdeploystepfactory.h b/src/plugins/ios/iosdeploystepfactory.h index 63bc1e92ae..93ac9b784f 100644 --- a/src/plugins/ios/iosdeploystepfactory.h +++ b/src/plugins/ios/iosdeploystepfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSDEPLOYSTEPFACTORY_H -#define IOSDEPLOYSTEPFACTORY_H +#pragma once #include <projectexplorer/buildstep.h> @@ -55,5 +54,3 @@ public: } // namespace Internal } // namespace Ios - -#endif // IOSDEPLOYSTEPFACTORY_H diff --git a/src/plugins/ios/iosdeploystepwidget.h b/src/plugins/ios/iosdeploystepwidget.h index 331857d2ce..38c91ab9b2 100644 --- a/src/plugins/ios/iosdeploystepwidget.h +++ b/src/plugins/ios/iosdeploystepwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSDEPLOYSTEPWIDGET_H -#define IOSDEPLOYSTEPWIDGET_H +#pragma once #include <projectexplorer/buildstep.h> @@ -54,5 +53,3 @@ private: } // namespace Internal } // namespace Ios - -#endif // IOSDEPLOYSTEPWIDGET_H diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index 7be1c8d07b..c0e9403834 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -88,8 +88,8 @@ IosDevice::IosDevice() setDisplayName(IosDevice::name()); setDeviceState(DeviceDisconnected); Utils::PortList ports; - ports.addRange(Constants::IOS_DEVICE_PORT_START, - Constants::IOS_DEVICE_PORT_END); + ports.addRange(Utils::Port(Constants::IOS_DEVICE_PORT_START), + Utils::Port(Constants::IOS_DEVICE_PORT_END)); setFreePorts(ports); } @@ -200,12 +200,12 @@ QString IosDevice::osVersion() const return m_extraInfo.value(QLatin1String("osVersion")); } -quint16 IosDevice::nextPort() const +Utils::Port IosDevice::nextPort() const { // use qrand instead? if (++m_lastPort >= Constants::IOS_DEVICE_PORT_END) m_lastPort = Constants::IOS_DEVICE_PORT_START; - return m_lastPort; + return Utils::Port(m_lastPort); } bool IosDevice::canAutoDetectPorts() const diff --git a/src/plugins/ios/iosdevice.h b/src/plugins/ios/iosdevice.h index bac9c3d201..8c6921f232 100644 --- a/src/plugins/ios/iosdevice.h +++ b/src/plugins/ios/iosdevice.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSDEVICE_H -#define IOSDEVICE_H +#pragma once #include "iostoolhandler.h" @@ -67,7 +66,7 @@ public: QString uniqueDeviceID() const; IosDevice(const QString &uid); QString osVersion() const; - quint16 nextPort() const; + Utils::Port nextPort() const; bool canAutoDetectPorts() const override; static QString name(); @@ -116,5 +115,3 @@ IosDevice::ConstPtr device(ProjectExplorer::Kit *); } // namespace Internal } // namespace Ios - -#endif // IOSDEVICE_H diff --git a/src/plugins/ios/iosdevicefactory.h b/src/plugins/ios/iosdevicefactory.h index 105b468d22..5e2e39b59f 100644 --- a/src/plugins/ios/iosdevicefactory.h +++ b/src/plugins/ios/iosdevicefactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSDEVICEFACTORY_H -#define IOSDEVICEFACTORY_H +#pragma once #include <projectexplorer/devicesupport/idevicefactory.h> @@ -52,5 +51,3 @@ public: } // namespace Internal } // namespace Ios - -#endif // IOSDEVICEFACTORY_H diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index 4f311061e6..21b726e007 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -90,9 +90,7 @@ bool IosPresetBuildStep::init(QList<const BuildStep *> &earlierSteps) pp->setMacroExpander(bc->macroExpander()); pp->setWorkingDirectory(bc->buildDirectory().toString()); Utils::Environment env = bc->environment(); - // Force output to english for the parsers. Do this here and not in the toolchain's - // addToEnvironment() to not screw up the users run environment. - env.set(QLatin1String("LC_ALL"), QLatin1String("C")); + Utils::Environment::setupEnglishOutput(&env); pp->setEnvironment(env); pp->setCommand(command()); pp->setArguments(Utils::QtcProcess::joinArgs(arguments())); diff --git a/src/plugins/ios/iosdsymbuildstep.h b/src/plugins/ios/iosdsymbuildstep.h index 034570275a..819347ce53 100644 --- a/src/plugins/ios/iosdsymbuildstep.h +++ b/src/plugins/ios/iosdsymbuildstep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSDSYMBUILDSTEP_H -#define IOSDSYMBUILDSTEP_H +#pragma once #include <projectexplorer/abstractprocessstep.h> @@ -138,5 +137,3 @@ public: } // namespace Internal } // namespace Ios - -#endif // IOSDSYMBUILDSTEP_H diff --git a/src/plugins/ios/iosmanager.h b/src/plugins/ios/iosmanager.h index 0a3c36c24a..06c665e23e 100644 --- a/src/plugins/ios/iosmanager.h +++ b/src/plugins/ios/iosmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSMANAGER_H -#define IOSMANAGER_H +#pragma once #include <utils/fileutils.h> @@ -48,5 +47,3 @@ public: } // namespace Internal } // namespace Ios - -#endif // IOSMANAGER_H diff --git a/src/plugins/ios/iosplugin.h b/src/plugins/ios/iosplugin.h index bcef3298de..f53a6bb568 100644 --- a/src/plugins/ios/iosplugin.h +++ b/src/plugins/ios/iosplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSPLUGIN_H -#define IOSPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -45,5 +44,3 @@ private slots: }; } // namespace Ios - -#endif // IOSPLUGIN_H diff --git a/src/plugins/ios/iosprobe.h b/src/plugins/ios/iosprobe.h index 9be5dd55e8..8d192b9611 100644 --- a/src/plugins/ios/iosprobe.h +++ b/src/plugins/ios/iosprobe.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSPROBE_H -#define IOSPROBE_H +#pragma once #include <QSettings> #include <QSharedPointer> #include <QString> @@ -76,5 +75,3 @@ private: QStringList m_developerPaths; }; } // namespace Ios - -#endif // IOSPROBE_H diff --git a/src/plugins/ios/iosqtversion.h b/src/plugins/ios/iosqtversion.h index 16840cb892..6d4a093ba5 100644 --- a/src/plugins/ios/iosqtversion.h +++ b/src/plugins/ios/iosqtversion.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSQTVERSION_H -#define IOSQTVERSION_H +#pragma once #include <qtsupport/baseqtversion.h> @@ -59,5 +58,3 @@ public: } // namespace Internal } // namespace Ios - -#endif // IOSQTVERSION_H diff --git a/src/plugins/ios/iosqtversionfactory.h b/src/plugins/ios/iosqtversionfactory.h index 59a2657342..820f6bf329 100644 --- a/src/plugins/ios/iosqtversionfactory.h +++ b/src/plugins/ios/iosqtversionfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSQTVERSIONFACTORY_H -#define IOSQTVERSIONFACTORY_H +#pragma once #include <qtsupport/qtversionfactory.h> @@ -47,5 +46,3 @@ public: } // namespace Internal } // namespace Ios - -#endif // IOSQTVERSIONFACTORY_H diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index 12dabfc69f..66f4826e0c 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -174,19 +174,8 @@ void IosRunConfiguration::updateDisplayNames() IosDeployStep *IosRunConfiguration::deployStep() const { - IosDeployStep * step = 0; DeployConfiguration *config = target()->activeDeployConfiguration(); - BuildStepList *bsl = config->stepList(); - if (bsl) { - const QList<BuildStep *> &buildSteps = bsl->steps(); - for (int i = buildSteps.count() - 1; i >= 0; --i) { - step = qobject_cast<IosDeployStep *>(buildSteps.at(i)); - if (step) - break; - } - } - Q_ASSERT_X(step, Q_FUNC_INFO, "Impossible: iOS build configuration without deploy step."); - return step; + return config ? config->stepList()->firstOfType<IosDeployStep>() : nullptr; } FileName IosRunConfiguration::profilePath() const diff --git a/src/plugins/ios/iosrunconfiguration.h b/src/plugins/ios/iosrunconfiguration.h index d73c0c027e..e82a84a054 100644 --- a/src/plugins/ios/iosrunconfiguration.h +++ b/src/plugins/ios/iosrunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSRUNCONFIGURATION_H -#define IOSRUNCONFIGURATION_H +#pragma once #include "iosconstants.h" #include "iosconfigurations.h" @@ -93,5 +92,3 @@ private: } // namespace Internal } // namespace Ios - -#endif // IOSRUNCONFIGURATION_H diff --git a/src/plugins/ios/iosruncontrol.h b/src/plugins/ios/iosruncontrol.h index e265025640..97f5784d69 100644 --- a/src/plugins/ios/iosruncontrol.h +++ b/src/plugins/ios/iosruncontrol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSRUNCONTROL_H -#define IOSRUNCONTROL_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -60,5 +59,3 @@ private: } // namespace Internal } // namespace Ios - -#endif // IOSRUNCONTROL_H diff --git a/src/plugins/ios/iosrunfactories.h b/src/plugins/ios/iosrunfactories.h index 0c0d9c16fa..325deb8d87 100644 --- a/src/plugins/ios/iosrunfactories.h +++ b/src/plugins/ios/iosrunfactories.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSRUNFACTORIES_H -#define IOSRUNFACTORIES_H +#pragma once #include <projectexplorer/runconfiguration.h> #include <qmakeprojectmanager/qmakerunconfigurationfactory.h> @@ -87,5 +86,3 @@ private: } // namespace Internal } // namespace Ios - -#endif // IOSRUNFACTORIES_H diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index 55ef3766ef..59a2e1bec7 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -76,7 +76,7 @@ QString IosRunner::bundlePath() QStringList IosRunner::extraArgs() { QStringList res = m_arguments; - if (m_qmlPort != 0) + if (m_qmlPort.isValid()) res << QmlDebug::qmlDebugTcpArguments(m_qmlDebugServices, m_qmlPort); return res; } @@ -113,7 +113,7 @@ void IosRunner::start() emit finished(m_cleanExit); } m_cleanExit = false; - m_qmlPort = 0; + m_qmlPort = Utils::Port(); if (!QFileInfo::exists(m_bundleDir)) { TaskHub::addTask(Task::Warning, tr("Could not find %1.").arg(m_bundleDir), @@ -177,7 +177,8 @@ void IosRunner::handleDidStartApp(IosToolHandler *handler, const QString &bundle } void IosRunner::handleGotServerPorts(IosToolHandler *handler, const QString &bundlePath, - const QString &deviceId, int gdbPort, int qmlPort) + const QString &deviceId, Utils::Port gdbPort, + Utils::Port qmlPort) { Q_UNUSED(bundlePath); Q_UNUSED(deviceId); m_qmlPort = qmlPort; @@ -200,8 +201,8 @@ void IosRunner::handleAppOutput(IosToolHandler *handler, const QString &output) QRegExp qmlPortRe(QLatin1String("QML Debugger: Waiting for connection on port ([0-9]+)...")); int index = qmlPortRe.indexIn(output); QString res(output); - if (index != -1 && m_qmlPort) - res.replace(qmlPortRe.cap(1), QString::number(m_qmlPort)); + if (index != -1 && m_qmlPort.isValid()) + res.replace(qmlPortRe.cap(1), QString::number(m_qmlPort.number())); emit appOutput(res); } @@ -222,8 +223,8 @@ void IosRunner::handleErrorMsg(IosToolHandler *handler, const QString &msg) } QRegExp qmlPortRe(QLatin1String("QML Debugger: Waiting for connection on port ([0-9]+)...")); int index = qmlPortRe.indexIn(msg); - if (index != -1 && m_qmlPort) - res.replace(qmlPortRe.cap(1), QString::number(m_qmlPort)); + if (index != -1 && m_qmlPort.isValid()) + res.replace(qmlPortRe.cap(1), QString::number(m_qmlPort.number())); emit errorMsg(res); } diff --git a/src/plugins/ios/iosrunner.h b/src/plugins/ios/iosrunner.h index b00b5f9b4e..b9e6ef4a4b 100644 --- a/src/plugins/ios/iosrunner.h +++ b/src/plugins/ios/iosrunner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSRUNNER_H -#define IOSRUNNER_H +#pragma once #include "iosconfigurations.h" #include "iostoolhandler.h" @@ -67,8 +66,8 @@ public slots: signals: void didStartApp(Ios::IosToolHandler::OpStatus status); - void gotServerPorts(int gdbPort, int qmlPort); - void gotInferiorPid(qint64 pid, int); + void gotServerPorts(Utils::Port gdbPort, Utils::Port qmlPort); + void gotInferiorPid(qint64 pid, Utils::Port qmlPort); void appOutput(const QString &output); void errorMsg(const QString &msg); void finished(bool cleanExit); @@ -77,7 +76,7 @@ private: void handleDidStartApp(Ios::IosToolHandler *handler, const QString &bundlePath, const QString &deviceId, Ios::IosToolHandler::OpStatus status); void handleGotServerPorts(Ios::IosToolHandler *handler, const QString &bundlePath, - const QString &deviceId, int gdbPort, int qmlPort); + const QString &deviceId, Utils::Port gdbPort, Utils::Port qmlPort); void handleGotInferiorPid(Ios::IosToolHandler *handler, const QString &bundlePath, const QString &deviceId, qint64 pid); void handleAppOutput(Ios::IosToolHandler *handler, const QString &output); @@ -94,11 +93,9 @@ private: QmlDebug::QmlDebugServicesPreset m_qmlDebugServices; bool m_cleanExit; - quint16 m_qmlPort; + Utils::Port m_qmlPort; qint64 m_pid; }; } // namespace Internal } // namespace Ios - -#endif // IOSRUNNER_H diff --git a/src/plugins/ios/iossettingspage.h b/src/plugins/ios/iossettingspage.h index b71f820058..0f2c48e885 100644 --- a/src/plugins/ios/iossettingspage.h +++ b/src/plugins/ios/iossettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSSETTINGSPAGE_H -#define IOSSETTINGSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -52,5 +51,3 @@ private: } // namespace Internal } // namespace Ios - -#endif // IOSSETTINGSPAGE_H diff --git a/src/plugins/ios/iossettingswidget.h b/src/plugins/ios/iossettingswidget.h index c15608b294..f42134e493 100644 --- a/src/plugins/ios/iossettingswidget.h +++ b/src/plugins/ios/iossettingswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSSETTINGSWIDGET_H -#define IOSSETTINGSWIDGET_H +#pragma once #include "iosconfigurations.h" @@ -61,5 +60,3 @@ private: } // namespace Internal } // namespace Ios - -#endif // IOSSETTINGSWIDGET_H diff --git a/src/plugins/ios/iossimulator.cpp b/src/plugins/ios/iossimulator.cpp index a73a16712b..9494b356bc 100644 --- a/src/plugins/ios/iossimulator.cpp +++ b/src/plugins/ios/iossimulator.cpp @@ -28,6 +28,7 @@ #include "iostoolhandler.h" #include <projectexplorer/kitinformation.h> +#include <utils/port.h> #include <QCoreApplication> #include <QMapIterator> @@ -171,7 +172,7 @@ QVariantMap IosSimulator::toMap() const return res; } -quint16 IosSimulator::nextPort() const +Utils::Port IosSimulator::nextPort() const { for (int i = 0; i < 100; ++i) { // use qrand instead? @@ -192,7 +193,7 @@ quint16 IosSimulator::nextPort() const || portVerifier.exitCode() != 0) break; } - return m_lastPort; + return Utils::Port(m_lastPort); } bool IosSimulator::canAutoDetectPorts() const diff --git a/src/plugins/ios/iossimulator.h b/src/plugins/ios/iossimulator.h index 1e3c614698..df02e6807a 100644 --- a/src/plugins/ios/iossimulator.h +++ b/src/plugins/ios/iossimulator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSSIMULATOR_H -#define IOSSIMULATOR_H +#pragma once #include <projectexplorer/devicesupport/idevice.h> #include <utils/fileutils.h> @@ -80,7 +79,7 @@ public: ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override; void fromMap(const QVariantMap &map) override; QVariantMap toMap() const override; - quint16 nextPort() const; + Utils::Port nextPort() const; bool canAutoDetectPorts() const override; ProjectExplorer::IDevice::Ptr clone() const override; @@ -103,5 +102,3 @@ IosSimulator::ConstPtr simulator(ProjectExplorer::Kit *kit); } // namespace Ios Q_DECLARE_METATYPE(Ios::Internal::IosDeviceType) - -#endif // IOSSIMULATOR_H diff --git a/src/plugins/ios/iossimulatorfactory.h b/src/plugins/ios/iossimulatorfactory.h index 395c72e8a2..0b8d222235 100644 --- a/src/plugins/ios/iossimulatorfactory.h +++ b/src/plugins/ios/iossimulatorfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSSIMULATORFACTORY_H -#define IOSSIMULATORFACTORY_H +#pragma once #include <projectexplorer/devicesupport/idevicefactory.h> @@ -48,5 +47,3 @@ public: } // namespace Internal } // namespace Ios - -#endif // IOSSIMULATORFACTORY_H diff --git a/src/plugins/ios/iostoolhandler.cpp b/src/plugins/ios/iostoolhandler.cpp index 9ac9ef4be9..c304ec8ac1 100644 --- a/src/plugins/ios/iostoolhandler.cpp +++ b/src/plugins/ios/iostoolhandler.cpp @@ -141,8 +141,8 @@ public: IosToolHandler::OpStatus status); void didStartApp(const QString &bundlePath, const QString &deviceId, IosToolHandler::OpStatus status); - void gotServerPorts(const QString &bundlePath, const QString &deviceId, int gdbPort, - int qmlPort); + void gotServerPorts(const QString &bundlePath, const QString &deviceId, Utils::Port gdbPort, + Utils::Port qmlPort); void gotInferiorPid(const QString &bundlePath, const QString &deviceId, qint64 pid); void deviceInfo(const QString &deviceId, const IosToolHandler::Dict &info); void appOutput(const QString &output); @@ -306,8 +306,8 @@ void IosToolHandlerPrivate::didStartApp(const QString &bundlePath, const QString emit q->didStartApp(q, bundlePath, deviceId, status); } -void IosToolHandlerPrivate::gotServerPorts(const QString &bundlePath, - const QString &deviceId, int gdbPort, int qmlPort) +void IosToolHandlerPrivate::gotServerPorts(const QString &bundlePath, const QString &deviceId, + Utils::Port gdbPort, Utils::Port qmlPort) { emit q->gotServerPorts(q, bundlePath, deviceId, gdbPort, qmlPort); } @@ -445,8 +445,10 @@ void IosToolHandlerPrivate::processXml() } else if (elName == QLatin1String("server_ports")) { stack.append(ParserState(ParserState::ServerPorts)); QXmlStreamAttributes attributes = outputParser.attributes(); - int gdbServerPort = attributes.value(QLatin1String("gdb_server")).toString().toInt(); - int qmlServerPort = attributes.value(QLatin1String("qml_server")).toString().toInt(); + Utils::Port gdbServerPort( + attributes.value(QLatin1String("gdb_server")).toString().toInt()); + Utils::Port qmlServerPort( + attributes.value(QLatin1String("qml_server")).toString().toInt()); gotServerPorts(bundlePath, deviceId, gdbServerPort, qmlServerPort); } else { qCWarning(toolHandlerLog) << "unexpected element " << elName; diff --git a/src/plugins/ios/iostoolhandler.h b/src/plugins/ios/iostoolhandler.h index 1649997cc2..ce9cf31dac 100644 --- a/src/plugins/ios/iostoolhandler.h +++ b/src/plugins/ios/iostoolhandler.h @@ -23,8 +23,9 @@ ** ****************************************************************************/ -#ifndef IOSTOOLHANDLER_H -#define IOSTOOLHANDLER_H +#pragma once + +#include <utils/port.h> #include <QObject> #include <QMap> @@ -73,7 +74,7 @@ signals: void didStartApp(Ios::IosToolHandler *handler, const QString &bundlePath, const QString &deviceId, Ios::IosToolHandler::OpStatus status); void gotServerPorts(Ios::IosToolHandler *handler, const QString &bundlePath, - const QString &deviceId, int gdbPort, int qmlPort); + const QString &deviceId, Utils::Port gdbPort, Utils::Port qmlPort); void gotInferiorPid(Ios::IosToolHandler *handler, const QString &bundlePath, const QString &deviceId, qint64 pid); void deviceInfo(Ios::IosToolHandler *handler, const QString &deviceId, @@ -95,5 +96,3 @@ private: }; } // namespace Ios - -#endif // IOSTOOLHANDLER_H diff --git a/src/plugins/macros/actionmacrohandler.h b/src/plugins/macros/actionmacrohandler.h index 8c7a87d4b2..77c766d682 100644 --- a/src/plugins/macros/actionmacrohandler.h +++ b/src/plugins/macros/actionmacrohandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ACTIOMACROHANDLER_H -#define ACTIOMACROHANDLER_H +#pragma once #include "imacrohandler.h" @@ -65,5 +64,3 @@ private: } // namespace Internal } // namespace Macros - -#endif // ACTIOMACROHANDLER_H diff --git a/src/plugins/macros/findmacrohandler.h b/src/plugins/macros/findmacrohandler.h index 49503eba5d..78eb338a47 100644 --- a/src/plugins/macros/findmacrohandler.h +++ b/src/plugins/macros/findmacrohandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDMACROHANDLER_H -#define FINDMACROHANDLER_H +#pragma once #include "imacrohandler.h" @@ -61,5 +60,3 @@ private slots: } // namespace Internal } // namespace Macros - -#endif // FINDMACROHANDLER_H diff --git a/src/plugins/macros/imacrohandler.h b/src/plugins/macros/imacrohandler.h index 403aa3e800..e05e4c063c 100644 --- a/src/plugins/macros/imacrohandler.h +++ b/src/plugins/macros/imacrohandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MACROSPLUGIN_IMACROHANDLER_H -#define MACROSPLUGIN_IMACROHANDLER_H +#pragma once #include <QObject> @@ -65,5 +64,3 @@ private: } // namespace Internal } // namespace Macros - -#endif // MACROSPLUGIN_IMACROHANDLER_H diff --git a/src/plugins/macros/macro.h b/src/plugins/macros/macro.h index 1c81acbb30..d2f4befa45 100644 --- a/src/plugins/macros/macro.h +++ b/src/plugins/macros/macro.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MACROSPLUGIN_MACRO_H -#define MACROSPLUGIN_MACRO_H +#pragma once #include <QList> #include <QString> @@ -69,5 +68,3 @@ private: } // namespace Internal } // namespace Macros - -#endif // MACROSPLUGIN_MACRO_H diff --git a/src/plugins/macros/macroevent.h b/src/plugins/macros/macroevent.h index 043e860334..72ae9942d4 100644 --- a/src/plugins/macros/macroevent.h +++ b/src/plugins/macros/macroevent.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MACROSPLUGIN_MACROEVENT_H -#define MACROSPLUGIN_MACROEVENT_H +#pragma once #include <coreplugin/id.h> @@ -60,5 +59,3 @@ private: } // namespace Internal } // namespace Macros - -#endif // MACROSPLUGIN_MACROEVENT_H diff --git a/src/plugins/macros/macrolocatorfilter.h b/src/plugins/macros/macrolocatorfilter.h index 32264c20d8..a20b296ce6 100644 --- a/src/plugins/macros/macrolocatorfilter.h +++ b/src/plugins/macros/macrolocatorfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MACROSPLUGIN_MACROLOCATORFILTER_H -#define MACROSPLUGIN_MACROLOCATORFILTER_H +#pragma once #include <coreplugin/locator/ilocatorfilter.h> @@ -54,5 +53,3 @@ private: } // namespace Internal } // namespace Macros - -#endif // MACROSPLUGIN_MACROLOCATORFILTER_H diff --git a/src/plugins/macros/macromanager.h b/src/plugins/macros/macromanager.h index e88870d448..2d1c8b6596 100644 --- a/src/plugins/macros/macromanager.h +++ b/src/plugins/macros/macromanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MACROSPLUGIN_MACROMANAGER_H -#define MACROSPLUGIN_MACROMANAGER_H +#pragma once #include <QObject> #include <QMap> @@ -80,5 +79,3 @@ private: } // namespace Internal } // namespace Macros - -#endif // MACROSPLUGIN_MACROMANAGER_H diff --git a/src/plugins/macros/macrooptionspage.h b/src/plugins/macros/macrooptionspage.h index 7d13062c9b..88b44f32f5 100644 --- a/src/plugins/macros/macrooptionspage.h +++ b/src/plugins/macros/macrooptionspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MACROSPLUGIN_MACROOPTIONSPAGE_H -#define MACROSPLUGIN_MACROOPTIONSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -53,5 +52,3 @@ private: } // namespace Internal } // namespace Macros - -#endif // MACROSPLUGIN_MACROOPTIONSPAGE_H diff --git a/src/plugins/macros/macrooptionswidget.h b/src/plugins/macros/macrooptionswidget.h index 156aff462a..135d01b858 100644 --- a/src/plugins/macros/macrooptionswidget.h +++ b/src/plugins/macros/macrooptionswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MACROSPLUGIN_MACROOPTIONSWIDGET_H -#define MACROSPLUGIN_MACROOPTIONSWIDGET_H +#pragma once #include <QWidget> @@ -73,5 +72,3 @@ private: } // namespace Internal } // namespace Macros - -#endif // MACROSPLUGIN_MACROOPTIONSWIDGET_H diff --git a/src/plugins/macros/macrosconstants.h b/src/plugins/macros/macrosconstants.h index 491e34a222..056677b2b7 100644 --- a/src/plugins/macros/macrosconstants.h +++ b/src/plugins/macros/macrosconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MACROSPLUGIN_MACROSCONSTANTS_H -#define MACROSPLUGIN_MACROSCONSTANTS_H +#pragma once namespace Macros { namespace Constants { @@ -46,5 +45,3 @@ const char M_EXTENSION[] = "mac"; } // namespace Constants } // namespace Macros - -#endif // MACROSPLUGIN_MACROSCONSTANTS_H diff --git a/src/plugins/macros/macrosplugin.h b/src/plugins/macros/macrosplugin.h index d202b619f2..dcb14694b8 100644 --- a/src/plugins/macros/macrosplugin.h +++ b/src/plugins/macros/macrosplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MACROSPLUGIN_MACROSPLUGIN_H -#define MACROSPLUGIN_MACROSPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -51,5 +50,3 @@ private: } // namespace Internal } // namespace Macros - -#endif // MACROSPLUGIN_MACROSPLUGIN_H diff --git a/src/plugins/macros/macrotextfind.h b/src/plugins/macros/macrotextfind.h index 71e65028ac..fd1f9d1638 100644 --- a/src/plugins/macros/macrotextfind.h +++ b/src/plugins/macros/macrotextfind.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MACROSPLUGIN_MACROTEXTFIND_H -#define MACROSPLUGIN_MACROTEXTFIND_H +#pragma once #include <coreplugin/find/ifindsupport.h> @@ -74,5 +73,3 @@ private: } // namespace Internal } // namespace Macros - -#endif // MACROSPLUGIN_MACROTEXTFIND_H diff --git a/src/plugins/macros/savedialog.h b/src/plugins/macros/savedialog.h index 7ad3695665..a45c04dcfc 100644 --- a/src/plugins/macros/savedialog.h +++ b/src/plugins/macros/savedialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MACROSPLUGIN_SAVEDIALOG_H -#define MACROSPLUGIN_SAVEDIALOG_H +#pragma once #include <QDialog> @@ -51,5 +50,3 @@ private: } // namespace Internal } // namespace Macros - -#endif // MACROSPLUGIN_SAVEDIALOG_H diff --git a/src/plugins/macros/texteditormacrohandler.h b/src/plugins/macros/texteditormacrohandler.h index fc39522af2..a213425a35 100644 --- a/src/plugins/macros/texteditormacrohandler.h +++ b/src/plugins/macros/texteditormacrohandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITORMACROHANDLER_H -#define TEXTEDITORMACROHANDLER_H +#pragma once #include "imacrohandler.h" @@ -60,5 +59,3 @@ private: } // namespace Internal } // namespace Macros - -#endif // TEXTEDITORMACROHANDLER_H diff --git a/src/plugins/modeleditor/actionhandler.h b/src/plugins/modeleditor/actionhandler.h index b595db1436..5bd2ce0e91 100644 --- a/src/plugins/modeleditor/actionhandler.h +++ b/src/plugins/modeleditor/actionhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ACTIONHANDLER_H -#define ACTIONHANDLER_H +#pragma once #include <QObject> @@ -94,5 +93,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // ACTIONHANDLER_H diff --git a/src/plugins/modeleditor/classviewcontroller.h b/src/plugins/modeleditor/classviewcontroller.h index 7af4ad6238..4bf67d480e 100644 --- a/src/plugins/modeleditor/classviewcontroller.h +++ b/src/plugins/modeleditor/classviewcontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSVIEWCONTROLLER_H -#define CLASSVIEWCONTROLLER_H +#pragma once #include <QObject> @@ -50,5 +49,3 @@ public: } // namespace Internal } // namespace ModelEditor - -#endif // CLASSVIEWCONTROLLER_H diff --git a/src/plugins/modeleditor/componentviewcontroller.h b/src/plugins/modeleditor/componentviewcontroller.h index df46a4f859..6d73a6cdcd 100644 --- a/src/plugins/modeleditor/componentviewcontroller.h +++ b/src/plugins/modeleditor/componentviewcontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPONENTVIEWCONTROLLER_H -#define COMPONENTVIEWCONTROLLER_H +#pragma once #include <QObject> @@ -64,5 +63,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // COMPONENTVIEWCONTROLLER_H diff --git a/src/plugins/modeleditor/diagramsviewmanager.h b/src/plugins/modeleditor/diagramsviewmanager.h index 7e75410dca..0811d6cd70 100644 --- a/src/plugins/modeleditor/diagramsviewmanager.h +++ b/src/plugins/modeleditor/diagramsviewmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIAGRAMSVIEWMANAGER_H -#define DIAGRAMSVIEWMANAGER_H +#pragma once #include <QObject> #include "qmt/diagram_ui/diagramsviewinterface.h" @@ -65,5 +64,3 @@ public: } // namespace Internal } // namespace ModelEditor - -#endif // DIAGRAMSVIEWMANAGER_H diff --git a/src/plugins/modeleditor/dragtool.h b/src/plugins/modeleditor/dragtool.h index 08939e0be0..5764f97ec6 100644 --- a/src/plugins/modeleditor/dragtool.h +++ b/src/plugins/modeleditor/dragtool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DRAGTOOL_H -#define DRAGTOOL_H +#pragma once #include <QWidget> #include <QIcon> @@ -58,5 +57,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // DRAGTOOL_H diff --git a/src/plugins/modeleditor/editordiagramview.h b/src/plugins/modeleditor/editordiagramview.h index f637941db6..f0183d1dd7 100644 --- a/src/plugins/modeleditor/editordiagramview.h +++ b/src/plugins/modeleditor/editordiagramview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EDITORDIAGRAMVIEW_H -#define EDITORDIAGRAMVIEW_H +#pragma once #include "qmt/diagram_widgets_ui/diagramview.h" @@ -53,5 +52,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // EDITORDIAGRAMVIEW_H diff --git a/src/plugins/modeleditor/elementtasks.h b/src/plugins/modeleditor/elementtasks.h index 1b29cc6b85..9e38b43abe 100644 --- a/src/plugins/modeleditor/elementtasks.h +++ b/src/plugins/modeleditor/elementtasks.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ELEMENTTASKS_H -#define ELEMENTTASKS_H +#pragma once #include "qmt/tasks/ielementtasks.h" @@ -89,5 +88,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // ELEMENTTASKS_H diff --git a/src/plugins/modeleditor/extdocumentcontroller.h b/src/plugins/modeleditor/extdocumentcontroller.h index ab6d6ac2f7..28f3bed9ed 100644 --- a/src/plugins/modeleditor/extdocumentcontroller.h +++ b/src/plugins/modeleditor/extdocumentcontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXTDOCUMENTCONTROLLER_H -#define EXTDOCUMENTCONTROLLER_H +#pragma once #include "qmt/document_controller/documentcontroller.h" @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // EXTDOCUMENTCONTROLLER_H diff --git a/src/plugins/modeleditor/extpropertiesmview.h b/src/plugins/modeleditor/extpropertiesmview.h index 1ad45aff81..673fcd9d39 100644 --- a/src/plugins/modeleditor/extpropertiesmview.h +++ b/src/plugins/modeleditor/extpropertiesmview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXTPROPERTIESMVIEW_H -#define EXTPROPERTIESMVIEW_H +#pragma once #include "qmt/model_widgets_ui/propertiesviewmview.h" @@ -57,5 +56,3 @@ private: } // namespace Interal } // namespace ModelEditor - -#endif // EXTPROPERTIESMVIEW_H diff --git a/src/plugins/modeleditor/jsextension.h b/src/plugins/modeleditor/jsextension.h index 3a969f54af..be2479fd68 100644 --- a/src/plugins/modeleditor/jsextension.h +++ b/src/plugins/modeleditor/jsextension.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSEXTENSION_H -#define JSEXTENSION_H +#pragma once #include <QObject> @@ -44,5 +43,3 @@ public: } // namespace Internal } // namespace ModelEditor - -#endif // JSEXTENSION_H diff --git a/src/plugins/modeleditor/modeldocument.h b/src/plugins/modeleditor/modeldocument.h index afdc22075a..f83085866a 100644 --- a/src/plugins/modeleditor/modeldocument.h +++ b/src/plugins/modeleditor/modeldocument.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELDOCUMENT_H -#define MODELDOCUMENT_H +#pragma once #include <coreplugin/idocument.h> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // MODELDOCUMENT_H diff --git a/src/plugins/modeleditor/modeleditor.h b/src/plugins/modeleditor/modeleditor.h index b8ab618138..5d741f1008 100644 --- a/src/plugins/modeleditor/modeleditor.h +++ b/src/plugins/modeleditor/modeleditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELDIAGRAMEDITOR_H -#define MODELDIAGRAMEDITOR_H +#pragma once #include <coreplugin/editormanager/ieditor.h> @@ -154,5 +153,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // MODELDIAGRAMEDITOR_H diff --git a/src/plugins/modeleditor/modeleditor_constants.h b/src/plugins/modeleditor/modeleditor_constants.h index 32e8759b8e..a1314874f3 100644 --- a/src/plugins/modeleditor/modeleditor_constants.h +++ b/src/plugins/modeleditor/modeleditor_constants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELEDITORCONSTANTS_H -#define MODELEDITORCONSTANTS_H +#pragma once namespace ModelEditor { namespace Constants { @@ -63,5 +62,3 @@ const char SETTINGS_RIGHT_HORIZ_SPLITTER[] = "RightHorizSplitter"; } // namespace Constants } // namespace ModelEditor - -#endif // MODELEDITORCONSTANTS_H diff --git a/src/plugins/modeleditor/modeleditor_global.h b/src/plugins/modeleditor/modeleditor_global.h index 054225f141..0327c570e3 100644 --- a/src/plugins/modeleditor/modeleditor_global.h +++ b/src/plugins/modeleditor/modeleditor_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELEDITOR_GLOBAL_H -#define MODELEDITOR_GLOBAL_H +#pragma once #include <QtGlobal> @@ -33,5 +32,3 @@ #else # define MODELEDITOR_EXPORT Q_DECL_IMPORT #endif - -#endif // MODELEDITOR_GLOBAL_H diff --git a/src/plugins/modeleditor/modeleditor_plugin.h b/src/plugins/modeleditor/modeleditor_plugin.h index 0dcf89642d..5ab927361d 100644 --- a/src/plugins/modeleditor/modeleditor_plugin.h +++ b/src/plugins/modeleditor/modeleditor_plugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELEDITORPLUGIN_H -#define MODELEDITORPLUGIN_H +#pragma once #include "modeleditor_global.h" @@ -58,5 +57,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // MODELEDITORPLUGIN_H diff --git a/src/plugins/modeleditor/modeleditorfactory.h b/src/plugins/modeleditor/modeleditorfactory.h index 797b06a311..972a1ae44e 100644 --- a/src/plugins/modeleditor/modeleditorfactory.h +++ b/src/plugins/modeleditor/modeleditorfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STRUCTUREDIAGRAMEDITORFACTORY_H -#define STRUCTUREDIAGRAMEDITORFACTORY_H +#pragma once #include <coreplugin/editormanager/ieditorfactory.h> @@ -53,5 +52,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // STRUCTUREDIAGRAMEDITORFACTORY_H diff --git a/src/plugins/modeleditor/modelindexer.h b/src/plugins/modeleditor/modelindexer.h index e7d6aaad3a..19694e60b1 100644 --- a/src/plugins/modeleditor/modelindexer.h +++ b/src/plugins/modeleditor/modelindexer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELINDEXER_H -#define MODELINDEXER_H +#pragma once #include <QObject> @@ -86,5 +85,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // MODELINDEXER_H diff --git a/src/plugins/modeleditor/modelsmanager.h b/src/plugins/modeleditor/modelsmanager.h index fb93f7e59c..9232f16df3 100644 --- a/src/plugins/modeleditor/modelsmanager.h +++ b/src/plugins/modeleditor/modelsmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELSMANAGER_H -#define MODELSMANAGER_H +#pragma once #include <QObject> @@ -75,5 +74,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // MODELSMANAGER_H diff --git a/src/plugins/modeleditor/openelementvisitor.h b/src/plugins/modeleditor/openelementvisitor.h index dcd5fca2d7..48e0408076 100644 --- a/src/plugins/modeleditor/openelementvisitor.h +++ b/src/plugins/modeleditor/openelementvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OPENELEMENTVISITOR_H -#define OPENELEMENTVISITOR_H +#pragma once #include "qmt/diagram/dconstvisitor.h" #include "qmt/model/mconstvisitor.h" @@ -87,5 +86,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // OPENELEMENTVISITOR_H diff --git a/src/plugins/modeleditor/pxnodecontroller.cpp b/src/plugins/modeleditor/pxnodecontroller.cpp index 4ae41c1acf..ecac98854c 100644 --- a/src/plugins/modeleditor/pxnodecontroller.cpp +++ b/src/plugins/modeleditor/pxnodecontroller.cpp @@ -319,8 +319,7 @@ void PxNodeController::onMenuActionTriggered(PxNodeController::MenuAction *actio if (!action->packageStereotype.isEmpty()) package->setStereotypes(QStringList() << action->packageStereotype); auto folderNode = dynamic_cast<const ProjectExplorer::FolderNode *>(node); - QTC_CHECK(folderNode); - if (folderNode) { + if (QTC_GUARD(folderNode)) { d->diagramSceneController->modelController()->undoController()->beginMergeSequence(tr("Create Component Model")); QStringList relativeElements = qmt::NameController::buildElementsPath( d->pxnodeUtilities->calcRelativePath(folderNode, d->anchorFolder), true); diff --git a/src/plugins/modeleditor/pxnodecontroller.h b/src/plugins/modeleditor/pxnodecontroller.h index 5f16ab632a..7bfcbd41aa 100644 --- a/src/plugins/modeleditor/pxnodecontroller.h +++ b/src/plugins/modeleditor/pxnodecontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PXNODECONTROLLER_H -#define PXNODECONTROLLER_H +#pragma once #include <QObject> @@ -71,5 +70,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // PXNODECONTROLLER_H diff --git a/src/plugins/modeleditor/pxnodeutilities.h b/src/plugins/modeleditor/pxnodeutilities.h index 4d80ff1c51..1aea2f1b9a 100644 --- a/src/plugins/modeleditor/pxnodeutilities.h +++ b/src/plugins/modeleditor/pxnodeutilities.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PXNODEUTILITIES_H -#define PXNODEUTILITIES_H +#pragma once #include <QObject> @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // PXNODEUTILITIES_H diff --git a/src/plugins/modeleditor/settingscontroller.h b/src/plugins/modeleditor/settingscontroller.h index 63080b820f..9400cd6282 100644 --- a/src/plugins/modeleditor/settingscontroller.h +++ b/src/plugins/modeleditor/settingscontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SETTINGS_H -#define SETTINGS_H +#pragma once #include <QObject> @@ -56,5 +55,3 @@ public: } // namespace Internal } // namespace ModelEditor - -#endif // SETTINGS_H diff --git a/src/plugins/modeleditor/uicontroller.h b/src/plugins/modeleditor/uicontroller.h index 8a48c79bd4..76496be10a 100644 --- a/src/plugins/modeleditor/uicontroller.h +++ b/src/plugins/modeleditor/uicontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UICONTROLLER_H -#define UICONTROLLER_H +#pragma once #include <QObject> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace ModelEditor - -#endif // UICONTROLLER_H diff --git a/src/plugins/projectexplorer/abiwidget.cpp b/src/plugins/projectexplorer/abiwidget.cpp index 4f773c54b5..278a37a378 100644 --- a/src/plugins/projectexplorer/abiwidget.cpp +++ b/src/plugins/projectexplorer/abiwidget.cpp @@ -68,8 +68,7 @@ public: // AbiWidget // -------------------------------------------------------------------------- -AbiWidget::AbiWidget(QWidget *parent) : - QWidget(parent), +AbiWidget::AbiWidget(QWidget *parent) : QWidget(parent), d(new Internal::AbiWidgetPrivate) { QHBoxLayout *layout = new QHBoxLayout(this); diff --git a/src/plugins/projectexplorer/abiwidget.h b/src/plugins/projectexplorer/abiwidget.h index 7c34a8519f..55a27134e0 100644 --- a/src/plugins/projectexplorer/abiwidget.h +++ b/src/plugins/projectexplorer/abiwidget.h @@ -43,7 +43,7 @@ class PROJECTEXPLORER_EXPORT AbiWidget : public QWidget Q_OBJECT public: - AbiWidget(QWidget *parent = 0); + AbiWidget(QWidget *parent = nullptr); ~AbiWidget() override; void setAbis(const QList<Abi> &, const Abi ¤t); diff --git a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp index 922918081e..15400eab85 100644 --- a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp +++ b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp @@ -41,12 +41,10 @@ enum { debug = 0 }; namespace ProjectExplorer { namespace Internal { - AbstractMsvcToolChain::AbstractMsvcToolChain(Core::Id typeId, Detection d, const Abi &abi, - const QString& vcvarsBat) : - ToolChain(typeId, d), + const QString& vcvarsBat) : ToolChain(typeId, d), m_lastEnvironment(Utils::Environment::systemEnvironment()), m_abi(abi), m_vcvarsBat(vcvarsBat) @@ -232,7 +230,6 @@ QByteArray AbstractMsvcToolChain::msvcPredefinedMacros(const QStringList cxxflag return predefinedMacros; } - bool AbstractMsvcToolChain::generateEnvironmentSettings(Utils::Environment &env, const QString &batchFile, const QString &batchArgs, @@ -401,7 +398,6 @@ bool AbstractMsvcToolChain::WarningFlagAdder::triggered() const return m_triggered; } - } // namespace Internal } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index c26a9442d3..227a979793 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -83,19 +83,13 @@ using namespace ProjectExplorer; */ AbstractProcessStep::AbstractProcessStep(BuildStepList *bsl, Core::Id id) : - BuildStep(bsl, id), m_timer(0), m_futureInterface(0), - m_ignoreReturnValue(false), m_process(0), - m_outputParserChain(0), m_skipFlush(false) -{ -} + BuildStep(bsl, id) +{ } AbstractProcessStep::AbstractProcessStep(BuildStepList *bsl, AbstractProcessStep *bs) : - BuildStep(bsl, bs), m_timer(0), m_futureInterface(0), - m_ignoreReturnValue(bs->m_ignoreReturnValue), - m_process(0), m_outputParserChain(0), m_skipFlush(false) -{ -} + BuildStep(bsl, bs), m_ignoreReturnValue(bs->m_ignoreReturnValue) +{ } AbstractProcessStep::~AbstractProcessStep() { @@ -226,7 +220,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi) if (!m_process->waitForStarted()) { processStartupFailed(); delete m_process; - m_process = 0; + m_process = nullptr; fi.reportResult(false); emit finished(); return; @@ -248,13 +242,13 @@ void AbstractProcessStep::cleanUp() // Clean up output parsers if (m_outputParserChain) { delete m_outputParserChain; - m_outputParserChain = 0; + m_outputParserChain = nullptr; } delete m_process; - m_process = 0; + m_process = nullptr; m_futureInterface->reportResult(returnValue); - m_futureInterface = 0; + m_futureInterface = nullptr; emit finished(); } @@ -451,7 +445,7 @@ void AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus) { m_timer->stop(); delete m_timer; - m_timer = 0; + m_timer = nullptr; QString line = QString::fromLocal8Bit(m_process->readAllStandardError()); if (!line.isEmpty()) diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index cd32d2716a..4cdec6adf7 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -88,14 +88,14 @@ private: void outputAdded(const QString &string, BuildStep::OutputFormat format); - QTimer *m_timer; - QFutureInterface<bool> *m_futureInterface; + QTimer *m_timer = nullptr; + QFutureInterface<bool> *m_futureInterface = nullptr; ProcessParameters m_param; - bool m_ignoreReturnValue; - Utils::QtcProcess *m_process; - IOutputParser *m_outputParserChain; - bool m_killProcess; - bool m_skipFlush; + bool m_ignoreReturnValue = false; + bool m_killProcess = false; + bool m_skipFlush = false; + Utils::QtcProcess *m_process = nullptr; + IOutputParser *m_outputParserChain = nullptr; }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/allprojectsfilter.cpp b/src/plugins/projectexplorer/allprojectsfilter.cpp index a994b83016..fa82b38052 100644 --- a/src/plugins/projectexplorer/allprojectsfilter.cpp +++ b/src/plugins/projectexplorer/allprojectsfilter.cpp @@ -50,7 +50,7 @@ AllProjectsFilter::AllProjectsFilter() void AllProjectsFilter::markFilesAsOutOfDate() { - setFileIterator(0); + setFileIterator(nullptr); } void AllProjectsFilter::prepareSearch(const QString &entry) diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp index 076097f2dd..7ce05f7495 100644 --- a/src/plugins/projectexplorer/allprojectsfind.cpp +++ b/src/plugins/projectexplorer/allprojectsfind.cpp @@ -46,8 +46,7 @@ using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; using namespace TextEditor; -AllProjectsFind::AllProjectsFind() - : m_configWidget(0) +AllProjectsFind::AllProjectsFind() : m_configWidget(nullptr) { connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::fileListChanged, this, &AllProjectsFind::handleFileListChanged); @@ -138,10 +137,10 @@ QWidget *AllProjectsFind::createConfigWidget() { if (!m_configWidget) { m_configWidget = new QWidget; - QGridLayout * const gridLayout = new QGridLayout(m_configWidget); + auto gridLayout = new QGridLayout(m_configWidget); gridLayout->setMargin(0); m_configWidget->setLayout(gridLayout); - QLabel * const filePatternLabel = new QLabel(tr("Fi&le pattern:")); + auto filePatternLabel = new QLabel(tr("Fi&le pattern:")); filePatternLabel->setMinimumWidth(80); filePatternLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); filePatternLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp index a3d8b4534b..e397454803 100644 --- a/src/plugins/projectexplorer/applicationlauncher.cpp +++ b/src/plugins/projectexplorer/applicationlauncher.cpp @@ -88,8 +88,8 @@ ApplicationLauncherPrivate::ApplicationLauncherPrivate() : { } -ApplicationLauncher::ApplicationLauncher(QObject *parent) - : QObject(parent), d(new ApplicationLauncherPrivate) +ApplicationLauncher::ApplicationLauncher(QObject *parent) : QObject(parent), + d(new ApplicationLauncherPrivate) { if (ProjectExplorerPlugin::projectExplorerSettings().mergeStdErrAndStdOut){ d->m_guiProcess.setReadChannelMode(QProcess::MergedChannels); diff --git a/src/plugins/projectexplorer/applicationlauncher.h b/src/plugins/projectexplorer/applicationlauncher.h index ae62cb857d..e27729722b 100644 --- a/src/plugins/projectexplorer/applicationlauncher.h +++ b/src/plugins/projectexplorer/applicationlauncher.h @@ -47,7 +47,7 @@ public: Gui }; - explicit ApplicationLauncher(QObject *parent = 0); + explicit ApplicationLauncher(QObject *parent = nullptr); ~ApplicationLauncher() override; void setProcessChannelMode(QProcess::ProcessChannelMode mode); diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 8346697f6c..c95226b794 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -85,7 +85,7 @@ class TabWidget : public QTabWidget { Q_OBJECT public: - TabWidget(QWidget *parent = 0); + TabWidget(QWidget *parent = nullptr); signals: void contextMenuRequested(const QPoint &pos, const int index); protected: @@ -139,8 +139,7 @@ void TabWidget::slotContextMenuRequested(const QPoint &pos) AppOutputPane::RunControlTab::RunControlTab(RunControl *rc, Core::OutputWindow *w) : runControl(rc), window(w), asyncClosing(false), behaviorOnOutput(Flash) -{ -} +{ } AppOutputPane::AppOutputPane() : m_mainWidget(new QWidget), @@ -627,7 +626,7 @@ void AppOutputPane::zoomOut() m_zoom = m_runControlTabs.first().window->fontZoom(); } -void AppOutputPane::enableButtons(const RunControl *rc /* = 0 */, bool isRunning /* = false */) +void AppOutputPane::enableButtons(const RunControl *rc, bool isRunning) { if (rc) { m_reRunButton->setEnabled(!isRunning && rc->supportsReRunning()); diff --git a/src/plugins/projectexplorer/appoutputpane.h b/src/plugins/projectexplorer/appoutputpane.h index a68349b8df..efe56fc26f 100644 --- a/src/plugins/projectexplorer/appoutputpane.h +++ b/src/plugins/projectexplorer/appoutputpane.h @@ -120,8 +120,8 @@ private: void enableButtons(const RunControl *rc, bool isRunning); struct RunControlTab { - explicit RunControlTab(RunControl *runControl = 0, - Core::OutputWindow *window = 0); + explicit RunControlTab(RunControl *runControl = nullptr, + Core::OutputWindow *window = nullptr); RunControl* runControl; Core::OutputWindow *window; // Is the run control stopping asynchronously, close the tab once it finishes diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 135a415183..15b505804c 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -56,7 +56,7 @@ BuildConfiguration::BuildConfiguration(Target *target, Core::Id id) : m_clearSystemEnvironment(false) { Q_ASSERT(target); - BuildStepList *bsl = new BuildStepList(this, Core::Id(Constants::BUILDSTEPS_BUILD)); + auto bsl = new BuildStepList(this, Core::Id(Constants::BUILDSTEPS_BUILD)); //: Display name of the build build step list. Used as part of the labels in the project window. bsl->setDefaultDisplayName(tr("Build")); m_stepLists.append(bsl); @@ -173,7 +173,7 @@ bool BuildConfiguration::fromMap(const QVariantMap &map) qWarning() << "No data for build step list" << i << "found!"; continue; } - BuildStepList *list = new BuildStepList(this, data); + auto list = new BuildStepList(this, data); if (list->isNull()) { qWarning() << "Failed to restore build step list" << i; delete list; @@ -282,7 +282,7 @@ void BuildConfiguration::cloneSteps(BuildConfiguration *source) qDeleteAll(m_stepLists); m_stepLists.clear(); foreach (BuildStepList *bsl, source->m_stepLists) { - BuildStepList *newBsl = new BuildStepList(this, bsl); + auto newBsl = new BuildStepList(this, bsl); newBsl->cloneSteps(bsl); m_stepLists.append(newBsl); } diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index 741227c03a..925740834e 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -119,7 +119,7 @@ class PROJECTEXPLORER_EXPORT IBuildConfigurationFactory : public QObject Q_OBJECT public: - explicit IBuildConfigurationFactory(QObject *parent = 0); + explicit IBuildConfigurationFactory(QObject *parent = nullptr); ~IBuildConfigurationFactory() override; // The priority is negative if this factory can not create anything for the target. @@ -152,4 +152,3 @@ signals: }; } // namespace ProjectExplorer - diff --git a/src/plugins/projectexplorer/buildconfigurationmodel.cpp b/src/plugins/projectexplorer/buildconfigurationmodel.cpp index 340f0cef2d..b8ef079f38 100644 --- a/src/plugins/projectexplorer/buildconfigurationmodel.cpp +++ b/src/plugins/projectexplorer/buildconfigurationmodel.cpp @@ -81,7 +81,7 @@ int BuildConfigurationModel::columnCount(const QModelIndex &parent) const void BuildConfigurationModel::displayNameChanged() { - BuildConfiguration *rc = qobject_cast<BuildConfiguration *>(sender()); + auto rc = qobject_cast<BuildConfiguration *>(sender()); if (!rc) return; diff --git a/src/plugins/projectexplorer/buildconfigurationmodel.h b/src/plugins/projectexplorer/buildconfigurationmodel.h index c267facd04..b5712f85fc 100644 --- a/src/plugins/projectexplorer/buildconfigurationmodel.h +++ b/src/plugins/projectexplorer/buildconfigurationmodel.h @@ -36,7 +36,7 @@ class BuildConfigurationModel : public QAbstractListModel { Q_OBJECT public: - explicit BuildConfigurationModel(Target *target, QObject *parent = 0); + explicit BuildConfigurationModel(Target *target, QObject *parent = nullptr); int rowCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; diff --git a/src/plugins/projectexplorer/buildenvironmentwidget.cpp b/src/plugins/projectexplorer/buildenvironmentwidget.cpp index aea3e9b9f2..f7f253d94b 100644 --- a/src/plugins/projectexplorer/buildenvironmentwidget.cpp +++ b/src/plugins/projectexplorer/buildenvironmentwidget.cpp @@ -35,10 +35,10 @@ using namespace ProjectExplorer; -BuildEnvironmentWidget::BuildEnvironmentWidget(BuildConfiguration *bc) - : m_buildConfiguration(0) +BuildEnvironmentWidget::BuildEnvironmentWidget(BuildConfiguration *bc) : + m_buildConfiguration(nullptr) { - QVBoxLayout *vbox = new QVBoxLayout(this); + auto vbox = new QVBoxLayout(this); vbox->setMargin(0); m_clearSystemEnvironmentCheckBox = new QCheckBox(this); m_clearSystemEnvironmentCheckBox->setText(tr("Clear system environment")); diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 0a28ed31b3..62ea36914b 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -28,10 +28,12 @@ #include "buildprogress.h" #include "buildsteplist.h" #include "compileoutputwindow.h" +#include "kit.h" #include "project.h" #include "projectexplorer.h" #include "projectexplorersettings.h" #include "target.h" +#include "task.h" #include "taskwindow.h" #include "taskhub.h" @@ -107,8 +109,8 @@ BuildManagerPrivate::BuildManagerPrivate() : { } -static BuildManagerPrivate *d = 0; -static BuildManager *m_instance = 0; +static BuildManagerPrivate *d = nullptr; +static BuildManager *m_instance = nullptr; BuildManager::BuildManager(QObject *parent, QAction *cancelBuildAction) : QObject(parent) @@ -168,7 +170,7 @@ void BuildManager::extensionsInitialized() BuildManager::~BuildManager() { cancel(); - m_instance = 0; + m_instance = nullptr; ExtensionSystem::PluginManager::removeObject(d->m_taskWindow); delete d->m_taskWindow; @@ -256,15 +258,15 @@ void BuildManager::clearBuildQueue() d->m_buildQueue.clear(); d->m_enabledState.clear(); d->m_running = false; - d->m_previousBuildStepProject = 0; - d->m_currentBuildStep = 0; + d->m_previousBuildStepProject = nullptr; + d->m_currentBuildStep = nullptr; d->m_progressFutureInterface->reportCanceled(); d->m_progressFutureInterface->reportFinished(); d->m_progressWatcher.setFuture(QFuture<void>()); delete d->m_progressFutureInterface; - d->m_progressFutureInterface = 0; - d->m_futureProgress = 0; + d->m_progressFutureInterface = nullptr; + d->m_futureProgress = nullptr; d->m_maxProgress = 0; emit m_instance->buildQueueFinished(false); @@ -392,9 +394,15 @@ void BuildManager::nextBuildQueue() bool result = d->m_skipDisabled || d->m_watcher.result(); if (!result) { // Build Failure + Target *t = d->m_currentBuildStep->target(); const QString projectName = d->m_currentBuildStep->project()->displayName(); - const QString targetName = d->m_currentBuildStep->target()->displayName(); + const QString targetName = t->displayName(); addToOutputWindow(tr("Error while building/deploying project %1 (kit: %2)").arg(projectName, targetName), BuildStep::ErrorOutput); + const QList<Task> kitTasks = t->kit()->validate(); + if (!kitTasks.isEmpty()) { + addToOutputWindow(tr("The kit %1 has configuration issues which might be the root cause for this problem.") + .arg(targetName), BuildStep::ErrorOutput); + } addToOutputWindow(tr("When executing step \"%1\"").arg(d->m_currentBuildStep->displayName()), BuildStep::ErrorOutput); // NBS TODO fix in qtconcurrent d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, tr("Error while building/deploying project %1 (kit: %2)").arg(projectName, targetName)); @@ -464,12 +472,12 @@ void BuildManager::nextStep() } } else { d->m_running = false; - d->m_previousBuildStepProject = 0; + d->m_previousBuildStepProject = nullptr; d->m_progressFutureInterface->reportFinished(); d->m_progressWatcher.setFuture(QFuture<void>()); - d->m_currentBuildStep = 0; + d->m_currentBuildStep = nullptr; delete d->m_progressFutureInterface; - d->m_progressFutureInterface = 0; + d->m_progressFutureInterface = nullptr; d->m_maxProgress = 0; emit m_instance->buildQueueFinished(true); } @@ -545,9 +553,8 @@ bool BuildManager::buildLists(QList<BuildStepList *> bsls, const QStringList &st QStringList names; names.reserve(steps.size()); for (int i = 0; i < bsls.size(); ++i) { - for (int j = 0; j < bsls.at(i)->steps().size(); ++j) { + for (int j = 0; j < bsls.at(i)->count(); ++j) names.append(stepListNames.at(i)); - } } bool success = buildQueueAppend(steps, names, preambelMessage); diff --git a/src/plugins/projectexplorer/buildprogress.cpp b/src/plugins/projectexplorer/buildprogress.cpp index 24d191cd1e..f42790b7ff 100644 --- a/src/plugins/projectexplorer/buildprogress.cpp +++ b/src/plugins/projectexplorer/buildprogress.cpp @@ -27,27 +27,27 @@ #include "projectexplorerconstants.h" #include <coreplugin/coreicons.h> + #include <utils/stylehelper.h> -#include <QVBoxLayout> -#include <QHBoxLayout> -#include <QLabel> #include <QFont> +#include <QLabel> +#include <QHBoxLayout> #include <QPixmap> -#include <QDebug> +#include <QVBoxLayout> using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; -BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation) - : m_contentWidget(new QWidget), - m_errorIcon(new QLabel), - m_warningIcon(new QLabel), - m_errorLabel(new QLabel), - m_warningLabel(new QLabel), - m_taskWindow(taskWindow) +BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation) : + m_contentWidget(new QWidget), + m_errorIcon(new QLabel), + m_warningIcon(new QLabel), + m_errorLabel(new QLabel), + m_warningLabel(new QLabel), + m_taskWindow(taskWindow) { - QHBoxLayout *contentLayout = new QHBoxLayout; + auto contentLayout = new QHBoxLayout; contentLayout->setContentsMargins(0, 0, 0, 0); contentLayout->setSpacing(0); setLayout(contentLayout); @@ -60,12 +60,12 @@ BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation layout->setContentsMargins(8, 2, 0, 2); layout->setSpacing(2); m_contentWidget->setLayout(layout); - QHBoxLayout *errorLayout = new QHBoxLayout; + auto errorLayout = new QHBoxLayout; errorLayout->setSpacing(2); layout->addLayout(errorLayout); errorLayout->addWidget(m_errorIcon); errorLayout->addWidget(m_errorLabel); - QHBoxLayout *warningLayout = new QHBoxLayout; + auto warningLayout = new QHBoxLayout; warningLayout->setSpacing(2); layout->addLayout(warningLayout); warningLayout->addWidget(m_warningIcon); diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp index 27b81cd8bb..665ffe132f 100644 --- a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp @@ -61,16 +61,15 @@ BuildSettingsWidget::~BuildSettingsWidget() } BuildSettingsWidget::BuildSettingsWidget(Target *target) : - m_target(target), - m_buildConfiguration(0) + m_target(target) { Q_ASSERT(m_target); - QVBoxLayout *vbox = new QVBoxLayout(this); + auto vbox = new QVBoxLayout(this); vbox->setContentsMargins(0, 0, 0, 0); if (!IBuildConfigurationFactory::find(m_target)) { - QLabel *noSettingsLabel = new QLabel(this); + auto noSettingsLabel = new QLabel(this); noSettingsLabel->setText(tr("No build settings available")); QFont f = noSettingsLabel->font(); f.setPointSizeF(f.pointSizeF() * 1.2); @@ -80,7 +79,7 @@ BuildSettingsWidget::BuildSettingsWidget(Target *target) : } { // Edit Build Configuration row - QHBoxLayout *hbox = new QHBoxLayout(); + auto hbox = new QHBoxLayout(); hbox->setContentsMargins(0, 0, 0, 0); hbox->addWidget(new QLabel(tr("Edit build configuration:"), this)); m_buildConfigurationComboBox = new QComboBox(this); @@ -110,7 +109,7 @@ BuildSettingsWidget::BuildSettingsWidget(Target *target) : } m_buildConfiguration = m_target->activeBuildConfiguration(); - BuildConfigurationModel *model = static_cast<BuildConfigurationModel *>(m_buildConfigurationComboBox->model()); + auto model = static_cast<BuildConfigurationModel *>(m_buildConfigurationComboBox->model()); m_buildConfigurationComboBox->setCurrentIndex(model->indexFor(m_buildConfiguration).row()); updateAddButtonMenu(); @@ -135,7 +134,7 @@ void BuildSettingsWidget::addSubWidget(NamedWidget *widget) { widget->setContentsMargins(0, 10, 0, 0); - QLabel *label = new QLabel(this); + auto label = new QLabel(this); label->setText(widget->displayName()); connect(widget, &NamedWidget::displayNameChanged, label, &QLabel::setText); @@ -218,7 +217,7 @@ void BuildSettingsWidget::updateBuildSettings() void BuildSettingsWidget::currentIndexChanged(int index) { - BuildConfigurationModel *model = static_cast<BuildConfigurationModel *>(m_buildConfigurationComboBox->model()); + auto model = static_cast<BuildConfigurationModel *>(m_buildConfigurationComboBox->model()); BuildConfiguration *buildConfiguration = model->buildConfigurationAt(index); SessionManager::setActiveBuildConfiguration(m_target, buildConfiguration, SetActive::Cascade); } @@ -230,7 +229,7 @@ void BuildSettingsWidget::updateActiveConfiguration() m_buildConfiguration = m_target->activeBuildConfiguration(); - BuildConfigurationModel *model = static_cast<BuildConfigurationModel *>(m_buildConfigurationComboBox->model()); + auto model = static_cast<BuildConfigurationModel *>(m_buildConfigurationComboBox->model()); m_buildConfigurationComboBox->setCurrentIndex(model->indexFor(m_buildConfiguration).row()); updateBuildSettings(); diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.h b/src/plugins/projectexplorer/buildsettingspropertiespage.h index e2e5c5a6da..ca7a6d0187 100644 --- a/src/plugins/projectexplorer/buildsettingspropertiespage.h +++ b/src/plugins/projectexplorer/buildsettingspropertiespage.h @@ -69,7 +69,7 @@ private: QString uniqueName(const QString &name); Target *m_target; - BuildConfiguration *m_buildConfiguration; + BuildConfiguration *m_buildConfiguration = nullptr; QPushButton *m_addButton; QPushButton *m_removeButton; diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 727c4ee3ba..e4a19efbdc 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -89,6 +89,7 @@ signals: void finished(); void enabledChanged(); + private: bool m_enabled; }; @@ -98,7 +99,7 @@ class PROJECTEXPLORER_EXPORT IBuildStepFactory : public QObject Q_OBJECT public: - explicit IBuildStepFactory(QObject *parent = 0); + explicit IBuildStepFactory(QObject *parent = nullptr); // used to show the list of possible additons to a target, returns a list of types virtual QList<Core::Id> availableCreationIds(BuildStepList *parent) const = 0; diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index 49991c45ed..77139204ce 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -61,8 +61,7 @@ const char STEPS_PREFIX[] = "ProjectExplorer.BuildStepList.Step."; } // namespace BuildStepList::BuildStepList(QObject *parent, Core::Id id) : - ProjectConfiguration(parent, id), - m_isNull(false) + ProjectConfiguration(parent, id) { Q_ASSERT(parent); } @@ -169,6 +168,11 @@ QList<BuildStep *> BuildStepList::steps() const return m_steps; } +QList<BuildStep *> BuildStepList::steps(const std::function<bool (const BuildStep *)> &filter) const +{ + return Utils::filtered(steps(), filter); +} + void BuildStepList::insertStep(int position, BuildStep *step) { m_steps.insert(position, step); @@ -202,10 +206,10 @@ BuildStep *BuildStepList::at(int position) Target *BuildStepList::target() const { Q_ASSERT(parent()); - BuildConfiguration *bc = qobject_cast<BuildConfiguration *>(parent()); + auto bc = qobject_cast<BuildConfiguration *>(parent()); if (bc) return bc->target(); - DeployConfiguration *dc = qobject_cast<DeployConfiguration *>(parent()); + auto dc = qobject_cast<DeployConfiguration *>(parent()); if (dc) return dc->target(); return 0; diff --git a/src/plugins/projectexplorer/buildsteplist.h b/src/plugins/projectexplorer/buildsteplist.h index a24e8190bf..40a8614189 100644 --- a/src/plugins/projectexplorer/buildsteplist.h +++ b/src/plugins/projectexplorer/buildsteplist.h @@ -47,6 +47,27 @@ public: ~BuildStepList() override; QList<BuildStep *> steps() const; + QList<BuildStep *> steps(const std::function<bool(const BuildStep *)> &filter) const; + template <class BS> BS *firstOfType() { + BS *bs = nullptr; + for (int i = 0; i < count(); ++i) { + bs = qobject_cast<BS *>(at(i)); + if (bs) + return bs; + } + return nullptr; + } + template <class BS> QList<BS *>allOfType() { + QList<BS *> result; + BS *bs = nullptr; + for (int i = 0; i < count(); ++i) { + bs = qobject_cast<BS *>(at(i)); + if (bs) + result.append(bs); + } + return result; + } + bool isNull() const; int count() const; bool isEmpty() const; @@ -74,8 +95,7 @@ protected: private: QList<BuildStep *> m_steps; - bool m_isNull; + bool m_isNull = false; }; } // namespace ProjectExplorer - diff --git a/src/plugins/projectexplorer/buildstepspage.cpp b/src/plugins/projectexplorer/buildstepspage.cpp index 066eb20271..feb2ee5888 100644 --- a/src/plugins/projectexplorer/buildstepspage.cpp +++ b/src/plugins/projectexplorer/buildstepspage.cpp @@ -52,16 +52,16 @@ using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; using namespace Utils; -ToolWidget::ToolWidget(QWidget *parent) - : FadingPanel(parent), m_buildStepEnabled(true), m_targetOpacity(1.0f) +ToolWidget::ToolWidget(QWidget *parent) : FadingPanel(parent), + m_targetOpacity(1.0f) { - QHBoxLayout *layout = new QHBoxLayout; + auto layout = new QHBoxLayout; layout->setMargin(4); layout->setSpacing(4); setLayout(layout); m_firstWidget = new FadingWidget(this); m_firstWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - QHBoxLayout *hbox = new QHBoxLayout(); + auto hbox = new QHBoxLayout(); hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(0); m_firstWidget->setLayout(hbox); @@ -209,7 +209,7 @@ BuildStepListWidget::~BuildStepListWidget() void BuildStepListWidget::updateSummary() { - BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(sender()); + auto widget = qobject_cast<BuildStepConfigWidget *>(sender()); if (widget) { foreach (const BuildStepsWidgetData *s, m_buildStepsData) { if (s->widget == widget) { @@ -222,7 +222,7 @@ void BuildStepListWidget::updateSummary() void BuildStepListWidget::updateAdditionalSummary() { - BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(sender()); + auto widget = qobject_cast<BuildStepConfigWidget *>(sender()); if (widget) { foreach (const BuildStepsWidgetData *s, m_buildStepsData) { if (s->widget == widget) { @@ -235,7 +235,7 @@ void BuildStepListWidget::updateAdditionalSummary() void BuildStepListWidget::updateEnabledState() { - BuildStep *step = qobject_cast<BuildStep *>(sender()); + auto step = qobject_cast<BuildStep *>(sender()); if (step) { foreach (const BuildStepsWidgetData *s, m_buildStepsData) { if (s->step == step) { @@ -324,7 +324,7 @@ void BuildStepListWidget::updateAddBuildStepMenu() void BuildStepListWidget::addBuildStepWidget(int pos, BuildStep *step) { // create everything - BuildStepsWidgetData *s = new BuildStepsWidgetData(step); + auto s = new BuildStepsWidgetData(step); m_buildStepsData.insert(pos, s); m_vbox->insertWidget(pos, s->detailsWidget); @@ -412,7 +412,7 @@ void BuildStepListWidget::triggerDisable(int pos) void BuildStepListWidget::setupUi() { - if (0 != m_addButton) + if (m_addButton) return; m_disableMapper = new QSignalMapper(this); @@ -436,7 +436,7 @@ void BuildStepListWidget::setupUi() m_noStepsLabel->setContentsMargins(0, 0, 0, 0); m_vbox->addWidget(m_noStepsLabel); - QHBoxLayout *hboxLayout = new QHBoxLayout(); + auto hboxLayout = new QHBoxLayout(); hboxLayout->setContentsMargins(0, 4, 0, 0); m_addButton = new QPushButton(this); m_addButton->setMenu(new QMenu(this)); @@ -479,11 +479,10 @@ void BuildStepListWidget::updateBuildStepButtonsState() } BuildStepsPage::BuildStepsPage(BuildConfiguration *bc, Core::Id id) : - NamedWidget(), m_id(id), m_widget(new BuildStepListWidget(this)) { - QVBoxLayout *layout = new QVBoxLayout(this); + auto layout = new QVBoxLayout(this); layout->setMargin(0); layout->setSpacing(0); layout->addWidget(m_widget); @@ -495,6 +494,3 @@ BuildStepsPage::BuildStepsPage(BuildConfiguration *bc, Core::Id id) : if (m_id == Constants::BUILDSTEPS_CLEAN) setDisplayName(tr("Clean Steps")); } - -BuildStepsPage::~BuildStepsPage() -{ } diff --git a/src/plugins/projectexplorer/buildstepspage.h b/src/plugins/projectexplorer/buildstepspage.h index e315d77c43..bbb1396710 100644 --- a/src/plugins/projectexplorer/buildstepspage.h +++ b/src/plugins/projectexplorer/buildstepspage.h @@ -51,7 +51,7 @@ class ToolWidget : public Utils::FadingPanel { Q_OBJECT public: - explicit ToolWidget(QWidget *parent = 0); + explicit ToolWidget(QWidget *parent = nullptr); void fadeTo(qreal value); void setOpacity(qreal value); @@ -75,7 +75,7 @@ private: QToolButton *m_downButton; QToolButton *m_removeButton; - bool m_buildStepEnabled; + bool m_buildStepEnabled = true; Utils::FadingWidget *m_firstWidget; Utils::FadingWidget *m_secondWidget; qreal m_targetOpacity; @@ -98,7 +98,7 @@ class BuildStepListWidget : public NamedWidget Q_OBJECT public: - BuildStepListWidget(QWidget *parent = 0); + BuildStepListWidget(QWidget *parent = nullptr); virtual ~BuildStepListWidget(); void init(BuildStepList *bsl); @@ -145,11 +145,10 @@ class BuildStepsPage : public NamedWidget public: BuildStepsPage(BuildConfiguration *bc, Core::Id id); - virtual ~BuildStepsPage(); private: Core::Id m_id; - BuildStepListWidget *m_widget; + BuildStepListWidget *m_widget = nullptr; }; } // Internal diff --git a/src/plugins/projectexplorer/cesdkhandler.cpp b/src/plugins/projectexplorer/cesdkhandler.cpp index 5ddd17d436..1048c2ff13 100644 --- a/src/plugins/projectexplorer/cesdkhandler.cpp +++ b/src/plugins/projectexplorer/cesdkhandler.cpp @@ -35,11 +35,6 @@ using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; using Utils::Environment; -CeSdkInfo::CeSdkInfo() - : m_major(0), m_minor(0) -{ -} - void CeSdkInfo::addToEnvironment(Environment &env) { // qDebug() << "adding " << name() << "to Environment"; diff --git a/src/plugins/projectexplorer/cesdkhandler.h b/src/plugins/projectexplorer/cesdkhandler.h index dbbb5356a6..ec3e65eed7 100644 --- a/src/plugins/projectexplorer/cesdkhandler.h +++ b/src/plugins/projectexplorer/cesdkhandler.h @@ -36,36 +36,26 @@ namespace ProjectExplorer { class PROJECTEXPLORER_EXPORT CeSdkInfo { public: - CeSdkInfo(); - - inline QString name() const; - inline QString binPath() const; - inline QString includePath() const; - inline QString libPath() const; - void addToEnvironment(Utils::Environment &env); - inline bool isValid() const; - inline int majorVersion() const; - inline int minorVersion() const; - inline bool isSupported() const; + QString name() const { return m_name; } + QString binPath() const { return m_bin; } + QString includePath() const { return m_include; } + QString libPath() const { return m_lib; } + void addToEnvironment(Utils::Environment &env); + bool isValid() const { return !m_name.isEmpty() && !m_bin.isEmpty() && !m_include.isEmpty() && !m_lib.isEmpty(); } + int majorVersion() const { return m_major; } + int minorVersion() const { return m_minor; } + bool isSupported() const { return m_major >= 5; } private: - friend class CeSdkHandler; - QString m_name; - QString m_bin; - QString m_include; - QString m_lib; - int m_major; - int m_minor; -}; + friend class CeSdkHandler; -inline QString CeSdkInfo::name() const { return m_name; } -inline QString CeSdkInfo::binPath() const { return m_bin; } -inline QString CeSdkInfo::includePath() const { return m_include; } -inline QString CeSdkInfo::libPath() const { return m_lib; } -inline bool CeSdkInfo::isValid() const { return !m_name.isEmpty() && !m_bin.isEmpty() && !m_include.isEmpty() && !m_lib.isEmpty(); } -inline int CeSdkInfo::majorVersion() const { return m_major; } -inline int CeSdkInfo::minorVersion() const { return m_minor; } -inline bool CeSdkInfo::isSupported() const { return m_major >= 5; } + QString m_name; + QString m_bin; + QString m_include; + QString m_lib; + int m_major = 0; + int m_minor = 0; +}; class PROJECTEXPLORER_EXPORT CeSdkHandler { @@ -74,6 +64,7 @@ public: inline QList<CeSdkInfo> listAll() const; CeSdkInfo find(const QString &name) const; static QString platformName(const QString &qtpath); + private: inline QString fixPaths(QString path) const; QList<CeSdkInfo> m_list; diff --git a/src/plugins/projectexplorer/clangparser.cpp b/src/plugins/projectexplorer/clangparser.cpp index b265266376..b860d68b0f 100644 --- a/src/plugins/projectexplorer/clangparser.cpp +++ b/src/plugins/projectexplorer/clangparser.cpp @@ -40,7 +40,7 @@ static Task::TaskType taskType(const QString &capture) } // opt. drive letter + filename: (2 brackets) -static const char * const FILE_PATTERN = "(<command line>|([A-Za-z]:)?[^:]+\\.[^:]+)"; +static const char *const FILE_PATTERN = "(<command line>|([A-Za-z]:)?[^:]+\\.[^:]+)"; ClangParser::ClangParser() : m_commandRegExp(QLatin1String("^clang(\\+\\+)?: +(fatal +)?(warning|error|note): (.*)$")), diff --git a/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp b/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp index 7161e26b70..3750e6a123 100644 --- a/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/codestylesettingspropertiespage.cpp @@ -49,7 +49,7 @@ CodeStyleSettingsWidget::CodeStyleSettingsWidget(Project *project) : QWidget(), Core::Id languageId = factory->languageId(); ICodeStylePreferences *codeStylePreferences = config->codeStyle(languageId); - CodeStyleEditor *preview = new CodeStyleEditor(factory, codeStylePreferences, m_ui.stackedWidget); + auto preview = new CodeStyleEditor(factory, codeStylePreferences, m_ui.stackedWidget); preview->clearMargins(); m_ui.stackedWidget->addWidget(preview); m_ui.languageComboBox->addItem(factory->displayName()); diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index 6b44e5a7c8..e460371e08 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -65,8 +65,7 @@ class CompileOutputTextEdit : public Core::OutputWindow { Q_OBJECT public: - CompileOutputTextEdit(const Core::Context &context) - : Core::OutputWindow(context) + CompileOutputTextEdit(const Core::Context &context) : Core::OutputWindow(context) { setWheelZoomEnabled(true); @@ -182,7 +181,7 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) : connect(m_zoomOutButton, &QToolButton::clicked, this, [this]() { m_outputWindow->zoomOut(1); }); - Aggregation::Aggregate *agg = new Aggregation::Aggregate; + auto agg = new Aggregation::Aggregate; agg->add(m_outputWindow); agg->add(new Core::BaseTextFind(m_outputWindow)); @@ -284,9 +283,7 @@ void CompileOutputWindow::clearContents() } void CompileOutputWindow::visibilityChanged(bool) -{ - -} +{ } int CompileOutputWindow::priorityInStatusBar() const { @@ -304,14 +301,10 @@ bool CompileOutputWindow::canPrevious() const } void CompileOutputWindow::goToNext() -{ - -} +{ } void CompileOutputWindow::goToPrev() -{ - -} +{ } bool CompileOutputWindow::canNavigate() const { diff --git a/src/plugins/projectexplorer/configtaskhandler.cpp b/src/plugins/projectexplorer/configtaskhandler.cpp index 73c1a30ed9..5ad2a11a81 100644 --- a/src/plugins/projectexplorer/configtaskhandler.cpp +++ b/src/plugins/projectexplorer/configtaskhandler.cpp @@ -56,7 +56,7 @@ void ConfigTaskHandler::handle(const Task &task) QAction *ConfigTaskHandler::createAction(QObject *parent) const { - QAction *action = new QAction(Core::ICore::msgShowOptionsDialog(), parent); + auto action = new QAction(Core::ICore::msgShowOptionsDialog(), parent); action->setToolTip(Core::ICore::msgShowOptionsDialogToolTip()); return action; } diff --git a/src/plugins/projectexplorer/copytaskhandler.cpp b/src/plugins/projectexplorer/copytaskhandler.cpp index b40c8296fc..1896eb2f7d 100644 --- a/src/plugins/projectexplorer/copytaskhandler.cpp +++ b/src/plugins/projectexplorer/copytaskhandler.cpp @@ -64,6 +64,5 @@ Core::Id CopyTaskHandler::actionManagerId() const QAction *CopyTaskHandler::createAction(QObject *parent) const { - QAction *copyAction = new QAction(parent); - return copyAction; + return new QAction(parent); } diff --git a/src/plugins/projectexplorer/currentprojectfilter.cpp b/src/plugins/projectexplorer/currentprojectfilter.cpp index be1ecd448b..cc67c637c8 100644 --- a/src/plugins/projectexplorer/currentprojectfilter.cpp +++ b/src/plugins/projectexplorer/currentprojectfilter.cpp @@ -36,7 +36,7 @@ using namespace Core; using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; -CurrentProjectFilter::CurrentProjectFilter() : BaseFileFilter(), m_project(0) +CurrentProjectFilter::CurrentProjectFilter() : BaseFileFilter() { setId("Files in current project"); setDisplayName(tr("Files in Current Project")); @@ -49,7 +49,7 @@ CurrentProjectFilter::CurrentProjectFilter() : BaseFileFilter(), m_project(0) void CurrentProjectFilter::markFilesAsOutOfDate() { - setFileIterator(0); + setFileIterator(nullptr); } void CurrentProjectFilter::prepareSearch(const QString &entry) diff --git a/src/plugins/projectexplorer/currentprojectfilter.h b/src/plugins/projectexplorer/currentprojectfilter.h index c62b2fa5de..d36f1bf6a1 100644 --- a/src/plugins/projectexplorer/currentprojectfilter.h +++ b/src/plugins/projectexplorer/currentprojectfilter.h @@ -49,7 +49,7 @@ private: void currentProjectChanged(); void markFilesAsOutOfDate(); - Project *m_project; + Project *m_project = nullptr; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index e0c48be58c..bffcd83945 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -100,7 +100,7 @@ void CurrentProjectFind::handleProjectChanged() void CurrentProjectFind::recheckEnabled() { - Core::SearchResult *search = qobject_cast<Core::SearchResult *>(sender()); + auto search = qobject_cast<Core::SearchResult *>(sender()); if (!search) return; QString projectFile = getAdditionalParameters(search).toString(); diff --git a/src/plugins/projectexplorer/customparserconfigdialog.h b/src/plugins/projectexplorer/customparserconfigdialog.h index 3b235c8205..c34dbfbf4e 100644 --- a/src/plugins/projectexplorer/customparserconfigdialog.h +++ b/src/plugins/projectexplorer/customparserconfigdialog.h @@ -43,7 +43,7 @@ class CustomParserConfigDialog : public QDialog Q_OBJECT public: - explicit CustomParserConfigDialog(QDialog *parent = 0); + explicit CustomParserConfigDialog(QDialog *parent = nullptr); ~CustomParserConfigDialog() override; void setExampleSettings(); diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp index 261599df52..a910450113 100644 --- a/src/plugins/projectexplorer/customtoolchain.cpp +++ b/src/plugins/projectexplorer/customtoolchain.cpp @@ -204,7 +204,7 @@ IOutputParser *CustomToolChain::outputParser() const case Msvc: return new MsvcParser; #endif case Custom: return new CustomParser(m_customParserSettings); - default: return 0; + default: return nullptr; } } @@ -352,7 +352,7 @@ bool CustomToolChain::operator ==(const ToolChain &other) const if (!ToolChain::operator ==(other)) return false; - const CustomToolChain *customTc = static_cast<const CustomToolChain *>(&other); + auto customTc = static_cast<const CustomToolChain *>(&other); return m_compilerCommand == customTc->m_compilerCommand && m_makeCommand == customTc->m_makeCommand && m_targetAbi == customTc->m_targetAbi @@ -428,12 +428,12 @@ bool CustomToolChainFactory::canRestore(const QVariantMap &data) ToolChain *CustomToolChainFactory::restore(const QVariantMap &data) { - CustomToolChain *tc = new CustomToolChain(ToolChain::ManualDetection); + auto tc = new CustomToolChain(ToolChain::ManualDetection); if (tc->fromMap(data)) return tc; delete tc; - return 0; + return nullptr; } // -------------------------------------------------------------------------- @@ -499,8 +499,8 @@ CustomToolChainConfigWidget::CustomToolChainConfigWidget(CustomToolChain *tc) : for (int i = 0; i < CustomToolChain::OutputParserCount; ++i) m_errorParserComboBox->addItem(CustomToolChain::parserName((CustomToolChain::OutputParser)i)); - QWidget *parserLayoutWidget = new QWidget; - QHBoxLayout *parserLayout = new QHBoxLayout(parserLayoutWidget); + auto parserLayoutWidget = new QWidget; + auto parserLayout = new QHBoxLayout(parserLayoutWidget); parserLayout->setContentsMargins(0, 0, 0, 0); m_predefinedMacros->setTabChangesFocus(true); m_predefinedMacros->setToolTip(tr("Each line defines a macro. Format is MACRO[=VALUE].")); @@ -576,7 +576,7 @@ void CustomToolChainConfigWidget::applyImpl() if (toolChain()->isAutoDetected()) return; - CustomToolChain *tc = static_cast<CustomToolChain *>(toolChain()); + auto tc = static_cast<CustomToolChain *>(toolChain()); Q_ASSERT(tc); QString displayName = tc->displayName(); tc->setCompilerCommand(m_compilerCommand->fileName()); @@ -595,7 +595,7 @@ void CustomToolChainConfigWidget::setFromToolchain() { // subwidgets are not yet connected! bool blocked = blockSignals(true); - CustomToolChain *tc = static_cast<CustomToolChain *>(toolChain()); + auto tc = static_cast<CustomToolChain *>(toolChain()); m_compilerCommand->setFileName(tc->compilerCommand()); m_makeCommand->setFileName(FileName::fromString(tc->makeCommand(Environment()))); m_abiWidget->setAbis(QList<Abi>(), tc->targetAbi()); @@ -610,7 +610,7 @@ void CustomToolChainConfigWidget::setFromToolchain() bool CustomToolChainConfigWidget::isDirtyImpl() const { - CustomToolChain *tc = static_cast<CustomToolChain *>(toolChain()); + auto tc = static_cast<CustomToolChain *>(toolChain()); Q_ASSERT(tc); return m_compilerCommand->fileName() != tc->compilerCommand() || m_makeCommand->path() != tc->makeCommand(Environment()) diff --git a/src/plugins/projectexplorer/customwizard/customwizard.cpp b/src/plugins/projectexplorer/customwizard/customwizard.cpp index 0471a53cc4..a4878f319e 100644 --- a/src/plugins/projectexplorer/customwizard/customwizard.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizard.cpp @@ -135,10 +135,10 @@ void CustomWizard::setParameters(const CustomWizardParametersPtr &p) Core::BaseFileWizard *CustomWizard::create(QWidget *parent, const Core::WizardDialogParameters &p) const { QTC_ASSERT(!d->m_parameters.isNull(), return 0); - Core::BaseFileWizard *wizard = new Core::BaseFileWizard(this, p.extraValues(), parent); + auto wizard = new Core::BaseFileWizard(this, p.extraValues(), parent); d->m_context->reset(); - CustomWizardPage *customPage = new CustomWizardPage(d->m_context, parameters()); + auto customPage = new CustomWizardPage(d->m_context, parameters()); customPage->setPath(p.defaultPath()); if (parameters()->firstPageId >= 0) wizard->setPage(parameters()->firstPageId, customPage); @@ -202,7 +202,7 @@ template <class WizardPage> WizardPage *findWizardPage(const QWizard *w) { foreach (int pageId, w->pageIds()) - if (WizardPage *wp = qobject_cast<WizardPage *>(w->page(pageId))) + if (auto wp = qobject_cast<WizardPage *>(w->page(pageId))) return wp; return 0; } @@ -330,7 +330,7 @@ CustomWizard *CustomWizard::createWizard(const CustomProjectWizard::CustomWizard return p->klass.isEmpty() ? (p->kind == factory->kind()) : (p->klass == factory->klass()); }); - CustomWizard *rc = 0; + CustomWizard *rc = nullptr; if (factory) rc = factory->create(); @@ -474,7 +474,7 @@ CustomProjectWizard::CustomProjectWizard() Core::BaseFileWizard *CustomProjectWizard::create(QWidget *parent, const Core::WizardDialogParameters ¶meters) const { - BaseProjectWizardDialog *projectDialog = new BaseProjectWizardDialog(this, parent, parameters); + auto projectDialog = new BaseProjectWizardDialog(this, parent, parameters); initProjectWizardDialog(projectDialog, parameters.defaultPath(), projectDialog->extensionPages()); diff --git a/src/plugins/projectexplorer/customwizard/customwizard.h b/src/plugins/projectexplorer/customwizard/customwizard.h index 28eee0ef89..619b8470c6 100644 --- a/src/plugins/projectexplorer/customwizard/customwizard.h +++ b/src/plugins/projectexplorer/customwizard/customwizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMWIZARD_H -#define CUSTOMWIZARD_H +#pragma once #include "../projectexplorer_export.h" @@ -75,7 +74,7 @@ template <class Wizard> class CustomWizardMetaFactory : public ICustomWizardMeta public: CustomWizardMetaFactory(const QString &klass, Core::IWizardFactory::WizardKind kind) : ICustomWizardMetaFactory(klass, kind) { } CustomWizardMetaFactory(Core::IWizardFactory::WizardKind kind) : ICustomWizardMetaFactory(QString(), kind) { } - CustomWizard *create() const { return new Wizard; } + CustomWizard *create() const override { return new Wizard; } }; // Documentation inside. @@ -87,7 +86,7 @@ public: typedef QMap<QString, QString> FieldReplacementMap; CustomWizard(); - ~CustomWizard(); + ~CustomWizard() override; // Can be reimplemented to create custom wizards. initWizardDialog() needs to be // called. @@ -131,7 +130,7 @@ class PROJECTEXPLORER_EXPORT CustomProjectWizard : public CustomWizard public: CustomProjectWizard(); - static bool postGenerateOpen(const Core::GeneratedFiles &l, QString *errorMessage = 0); + static bool postGenerateOpen(const Core::GeneratedFiles &l, QString *errorMessage = nullptr); signals: void projectLocationChanged(const QString &path); @@ -151,5 +150,3 @@ private: }; } // namespace ProjectExplorer - -#endif // CUSTOMWIZARD_H diff --git a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp index 542e3689f9..3cdfe71bbd 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp @@ -69,17 +69,17 @@ namespace Internal { \sa ProjectExplorer::CustomWizard */ -CustomWizardFieldPage::LineEditData::LineEditData(QLineEdit* le, const QString &defText, const QString &pText) : +CustomWizardFieldPage::LineEditData::LineEditData(QLineEdit *le, const QString &defText, const QString &pText) : lineEdit(le), defaultText(defText), placeholderText(pText) { } -CustomWizardFieldPage::TextEditData::TextEditData(QTextEdit* le, const QString &defText) : +CustomWizardFieldPage::TextEditData::TextEditData(QTextEdit *le, const QString &defText) : textEdit(le), defaultText(defText) { } -CustomWizardFieldPage::PathChooserData::PathChooserData(PathChooser* pe, const QString &defText) : +CustomWizardFieldPage::PathChooserData::PathChooserData(PathChooser *pe, const QString &defText) : pathChooser(pe), defaultText(defText) { } @@ -93,7 +93,7 @@ CustomWizardFieldPage::CustomWizardFieldPage(const QSharedPointer<CustomWizardCo m_formLayout(new QFormLayout), m_errorLabel(new QLabel) { - QVBoxLayout *vLayout = new QVBoxLayout; + auto vLayout = new QVBoxLayout; m_formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); if (debug) qDebug() << Q_FUNC_INFO << parameters->fields.size(); @@ -109,10 +109,6 @@ CustomWizardFieldPage::CustomWizardFieldPage(const QSharedPointer<CustomWizardCo setTitle(parameters->fieldPageTitle); } -CustomWizardFieldPage::~CustomWizardFieldPage() -{ -} - void CustomWizardFieldPage::addRow(const QString &name, QWidget *w) { m_formLayout->addRow(name, w); @@ -144,7 +140,7 @@ void CustomWizardFieldPage::addField(const CustomWizardField &field)\ bool spansRow = false; // Check known classes: QComboBox const QString className = field.controlAttributes.value(QLatin1String("class")); - QWidget *fieldWidget = 0; + QWidget *fieldWidget = nullptr; if (className == QLatin1String("QComboBox")) { fieldWidget = registerComboBox(fieldName, field); } else if (className == QLatin1String("QTextEdit")) { @@ -196,7 +192,7 @@ static void comboChoices(const CustomWizardField::ControlAttributeMap &controlAt QWidget *CustomWizardFieldPage::registerComboBox(const QString &fieldName, const CustomWizardField &field) { - TextFieldComboBox *combo = new TextFieldComboBox; + auto combo = new TextFieldComboBox; do { // Set up items and current index QStringList values; QStringList displayTexts; @@ -220,7 +216,7 @@ QWidget *CustomWizardFieldPage::registerComboBox(const QString &fieldName, QWidget *CustomWizardFieldPage::registerTextEdit(const QString &fieldName, const CustomWizardField &field) { - QTextEdit *textEdit = new QTextEdit; + auto textEdit = new QTextEdit; // Suppress formatting by default (inverting QTextEdit's default value) when // pasting from Bug tracker, etc. const bool acceptRichText = field.controlAttributes.value(QLatin1String("acceptRichText")) == QLatin1String("true"); @@ -236,7 +232,7 @@ QWidget *CustomWizardFieldPage::registerTextEdit(const QString &fieldName, QWidget *CustomWizardFieldPage::registerPathChooser(const QString &fieldName, const CustomWizardField &field) { - PathChooser *pathChooser = new PathChooser; + auto pathChooser = new PathChooser; const QString expectedKind = field.controlAttributes.value(QLatin1String("expectedkind")).toLower(); if (expectedKind == QLatin1String("existingdirectory")) pathChooser->setExpectedKind(PathChooser::ExistingDirectory); @@ -266,7 +262,7 @@ QWidget *CustomWizardFieldPage::registerCheckBox(const QString &fieldName, { typedef CustomWizardField::ControlAttributeMap::const_iterator AttributeMapConstIt; - TextFieldCheckBox *checkBox = new TextFieldCheckBox(fieldDescription); + auto checkBox = new TextFieldCheckBox(fieldDescription); const bool defaultValue = field.controlAttributes.value(QLatin1String("defaultvalue")) == QLatin1String("true"); checkBox->setChecked(defaultValue); const AttributeMapConstIt trueTextIt = field.controlAttributes.constFind(QLatin1String("truevalue")); @@ -284,7 +280,7 @@ QWidget *CustomWizardFieldPage::registerCheckBox(const QString &fieldName, QWidget *CustomWizardFieldPage::registerLineEdit(const QString &fieldName, const CustomWizardField &field) { - QLineEdit *lineEdit = new QLineEdit; + auto lineEdit = new QLineEdit; const QString validationRegExp = field.controlAttributes.value(QLatin1String("validator")); if (!validationRegExp.isEmpty()) { diff --git a/src/plugins/projectexplorer/customwizard/customwizardpage.h b/src/plugins/projectexplorer/customwizard/customwizardpage.h index 40f96de412..e670b97430 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardpage.h +++ b/src/plugins/projectexplorer/customwizard/customwizardpage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMWIZARDPAGE_H -#define CUSTOMWIZARDPAGE_H +#pragma once #include <QComboBox> #include <QCheckBox> @@ -55,12 +54,11 @@ public: explicit CustomWizardFieldPage(const QSharedPointer<CustomWizardContext> &ctx, const QSharedPointer<CustomWizardParameters> ¶meters, - QWidget *parent = 0); - virtual ~CustomWizardFieldPage(); + QWidget *parent = nullptr); - virtual bool validatePage(); - virtual void initializePage(); - virtual void cleanupPage(); + bool validatePage() override; + void initializePage() override; + void cleanupPage() override; static QMap<QString, QString> replacementMap(const QWizard *w, const QSharedPointer<CustomWizardContext> &ctx, @@ -73,23 +71,23 @@ protected: private: class LineEditData { public: - explicit LineEditData(QLineEdit* le = 0, const QString &defText = QString(), const QString &pText = QString()); - QLineEdit* lineEdit; + explicit LineEditData(QLineEdit *le = nullptr, const QString &defText = QString(), const QString &pText = QString()); + QLineEdit *lineEdit; QString defaultText; QString placeholderText; QString userChange; }; class TextEditData { public: - explicit TextEditData(QTextEdit* le = 0, const QString &defText = QString()); - QTextEdit* textEdit; + explicit TextEditData(QTextEdit *le = nullptr, const QString &defText = QString()); + QTextEdit *textEdit; QString defaultText; QString userChange; }; class PathChooserData { public: - explicit PathChooserData(Utils::PathChooser* pe = 0, const QString &defText = QString()); - Utils::PathChooser* pathChooser; + explicit PathChooserData(Utils::PathChooser *pe = nullptr, const QString &defText = QString()); + Utils::PathChooser *pathChooser; QString defaultText; QString userChange; }; @@ -122,12 +120,12 @@ class CustomWizardPage : public CustomWizardFieldPage { public: explicit CustomWizardPage(const QSharedPointer<CustomWizardContext> &ctx, const QSharedPointer<CustomWizardParameters> ¶meters, - QWidget *parent = 0); + QWidget *parent = nullptr); QString path() const; void setPath(const QString &path); - virtual bool isComplete() const; + bool isComplete() const override; private: Utils::PathChooser *m_pathChooser; @@ -135,5 +133,3 @@ private: } // namespace Internal } // namespace ProjectExplorer - -#endif // CUSTOMWIZARDPAGE_H diff --git a/src/plugins/projectexplorer/customwizard/customwizardparameters.h b/src/plugins/projectexplorer/customwizard/customwizardparameters.h index 01916ebcd6..0dd10a8df3 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardparameters.h +++ b/src/plugins/projectexplorer/customwizard/customwizardparameters.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMWIZARDPARAMETERS_H -#define CUSTOMWIZARDPARAMETERS_H +#pragma once #include <coreplugin/iwizardfactory.h> @@ -162,5 +161,3 @@ extern const char customWizardFileOpenProjectAttributeC[]; } // namespace Internal } // namespace ProjectExplorer - -#endif // CUSTOMWIZARDPARAMETERS_H diff --git a/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.h b/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.h index a36c4edb22..4581c88cc4 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.h +++ b/src/plugins/projectexplorer/customwizard/customwizardscriptgenerator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMWIZARDSCRIPTGENERATOR_H -#define CUSTOMWIZARDSCRIPTGENERATOR_H +#pragma once #include <QMap> #include <QStringList> @@ -56,5 +55,3 @@ bool runCustomWizardGeneratorScript(const QString &targetPath, } // namespace Internal } // namespace ProjectExplorer - -#endif // CUSTOMWIZARDSCRIPTGENERATOR_H diff --git a/src/plugins/projectexplorer/dependenciespanel.cpp b/src/plugins/projectexplorer/dependenciespanel.cpp index 64cbab2e67..fed8a6a653 100644 --- a/src/plugins/projectexplorer/dependenciespanel.cpp +++ b/src/plugins/projectexplorer/dependenciespanel.cpp @@ -105,7 +105,7 @@ bool DependenciesModel::setData(const QModelIndex &index, const QVariant &value, { if (role == Qt::CheckStateRole) { Project *p = m_projects.at(index.row()); - const Qt::CheckState c = static_cast<Qt::CheckState>(value.toInt()); + auto c = static_cast<const Qt::CheckState>(value.toInt()); if (c == Qt::Checked) { if (SessionManager::addDependency(m_project, p)) { @@ -206,22 +206,21 @@ void DependenciesView::updateSizeHint() // DependenciesWidget // -DependenciesWidget::DependenciesWidget(Project *project, QWidget *parent) - : QWidget(parent) - , m_project(project) - , m_model(new DependenciesModel(project, this)) +DependenciesWidget::DependenciesWidget(Project *project, QWidget *parent) : QWidget(parent), + m_project(project), + m_model(new DependenciesModel(project, this)) { - QVBoxLayout *vbox = new QVBoxLayout(this); + auto vbox = new QVBoxLayout(this); vbox->setContentsMargins(0, 0, 0, 0); m_detailsContainer = new Utils::DetailsWidget(this); m_detailsContainer->setState(Utils::DetailsWidget::NoSummary); vbox->addWidget(m_detailsContainer); - QWidget *detailsWidget = new QWidget(m_detailsContainer); + auto detailsWidget = new QWidget(m_detailsContainer); m_detailsContainer->setWidget(detailsWidget); - QGridLayout *layout = new QGridLayout(detailsWidget); + auto layout = new QGridLayout(detailsWidget); layout->setContentsMargins(0, -1, 0, -1); - DependenciesView *treeView = new DependenciesView(this); + auto treeView = new DependenciesView(this); treeView->setModel(m_model); treeView->setHeaderHidden(true); layout->addWidget(treeView, 0 ,0); diff --git a/src/plugins/projectexplorer/dependenciespanel.h b/src/plugins/projectexplorer/dependenciespanel.h index 5c5c886e5c..2a87b26a4e 100644 --- a/src/plugins/projectexplorer/dependenciespanel.h +++ b/src/plugins/projectexplorer/dependenciespanel.h @@ -50,7 +50,7 @@ class DependenciesModel : public QAbstractListModel Q_OBJECT public: - explicit DependenciesModel(Project *project, QObject *parent = 0); + explicit DependenciesModel(Project *project, QObject *parent = nullptr); int rowCount(const QModelIndex &index) const override; int columnCount(const QModelIndex &index) const override; diff --git a/src/plugins/projectexplorer/deployablefile.cpp b/src/plugins/projectexplorer/deployablefile.cpp index efdabfbf4a..1d7b6132c1 100644 --- a/src/plugins/projectexplorer/deployablefile.cpp +++ b/src/plugins/projectexplorer/deployablefile.cpp @@ -33,20 +33,13 @@ using namespace Utils; namespace ProjectExplorer { -DeployableFile::DeployableFile() - : m_type(TypeNormal) -{ -} - DeployableFile::DeployableFile(const QString &localFilePath, const QString &remoteDir, Type type) : m_localFilePath(FileName::fromUserInput(localFilePath)), m_remoteDir(remoteDir), m_type(type) -{ -} +{ } DeployableFile::DeployableFile(const FileName &localFilePath, const QString &remoteDir, Type type) : m_localFilePath(localFilePath), m_remoteDir(remoteDir), m_type(type) -{ -} +{ } QString DeployableFile::remoteFilePath() const { diff --git a/src/plugins/projectexplorer/deployablefile.h b/src/plugins/projectexplorer/deployablefile.h index 4517b2e62e..70d05c29e8 100644 --- a/src/plugins/projectexplorer/deployablefile.h +++ b/src/plugins/projectexplorer/deployablefile.h @@ -42,7 +42,7 @@ public: TypeExecutable }; - DeployableFile(); + DeployableFile() = default; DeployableFile(const QString &m_localFilePath, const QString &m_remoteDir, Type type = TypeNormal); DeployableFile(const Utils::FileName &localFilePath, const QString &remoteDir, @@ -59,7 +59,7 @@ public: private: Utils::FileName m_localFilePath; QString m_remoteDir; - Type m_type; + Type m_type = TypeNormal; }; diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp index 1b2f9c1fd1..6d119ef910 100644 --- a/src/plugins/projectexplorer/deployconfiguration.cpp +++ b/src/plugins/projectexplorer/deployconfiguration.cpp @@ -40,8 +40,7 @@ const char BUILD_STEP_LIST_COUNT[] = "ProjectExplorer.BuildConfiguration.BuildSt const char BUILD_STEP_LIST_PREFIX[] = "ProjectExplorer.BuildConfiguration.BuildStepList."; DeployConfiguration::DeployConfiguration(Target *target, Core::Id id) : - ProjectConfiguration(target, id), - m_stepList(0) + ProjectConfiguration(target, id) { Q_ASSERT(target); m_stepList = new BuildStepList(this, Core::Id(Constants::BUILDSTEPS_DEPLOY)); @@ -53,8 +52,7 @@ DeployConfiguration::DeployConfiguration(Target *target, Core::Id id) : } DeployConfiguration::DeployConfiguration(Target *target, DeployConfiguration *source) : - ProjectConfiguration(target, source), - m_stepList(0) + ProjectConfiguration(target, source) { Q_ASSERT(target); // Do not clone stepLists here, do that in the derived constructor instead @@ -94,7 +92,7 @@ QVariantMap DeployConfiguration::toMap() const NamedWidget *DeployConfiguration::createConfigWidget() { - return 0; + return nullptr; } bool DeployConfiguration::isEnabled() const @@ -227,7 +225,7 @@ bool DefaultDeployConfigurationFactory::canCreate(Target *parent, Core::Id id) c DeployConfiguration *DefaultDeployConfigurationFactory::create(Target *parent, Core::Id id) { if (!canCreate(parent, id)) - return 0; + return nullptr; return new DefaultDeployConfiguration(parent, id); } @@ -239,11 +237,11 @@ bool DefaultDeployConfigurationFactory::canRestore(Target *parent, const QVarian DeployConfiguration *DefaultDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map) { if (!canRestore(parent, map)) - return 0; - DefaultDeployConfiguration *dc = new DefaultDeployConfiguration(parent, idFromMap(map)); + return nullptr; + auto dc = new DefaultDeployConfiguration(parent, idFromMap(map)); if (!dc->fromMap(map)) { delete dc; - return 0; + return nullptr; } return dc; } @@ -256,7 +254,7 @@ bool DefaultDeployConfigurationFactory::canClone(Target *parent, DeployConfigura DeployConfiguration *DefaultDeployConfigurationFactory::clone(Target *parent, DeployConfiguration *product) { if (!canClone(parent, product)) - return 0; + return nullptr; return new DefaultDeployConfiguration(parent, product); } diff --git a/src/plugins/projectexplorer/deployconfiguration.h b/src/plugins/projectexplorer/deployconfiguration.h index 5648cbe15c..aec33fd308 100644 --- a/src/plugins/projectexplorer/deployconfiguration.h +++ b/src/plugins/projectexplorer/deployconfiguration.h @@ -72,7 +72,7 @@ protected: private: void ctor(); - BuildStepList *m_stepList; + BuildStepList *m_stepList = nullptr; }; class PROJECTEXPLORER_EXPORT DefaultDeployConfiguration : public DeployConfiguration @@ -90,7 +90,7 @@ class PROJECTEXPLORER_EXPORT DeployConfigurationFactory : public QObject Q_OBJECT public: - explicit DeployConfigurationFactory(QObject *parent = 0); + explicit DeployConfigurationFactory(QObject *parent = nullptr); // used to show the list of possible additons to a target, returns a list of types virtual QList<Core::Id> availableCreationIds(Target *parent) const = 0; @@ -130,4 +130,3 @@ private: }; } // namespace ProjectExplorer - diff --git a/src/plugins/projectexplorer/deployconfigurationmodel.cpp b/src/plugins/projectexplorer/deployconfigurationmodel.cpp index 1f14521f20..b0e5dc70eb 100644 --- a/src/plugins/projectexplorer/deployconfigurationmodel.cpp +++ b/src/plugins/projectexplorer/deployconfigurationmodel.cpp @@ -50,9 +50,9 @@ public: } }; -DeployConfigurationModel::DeployConfigurationModel(Target *target, QObject *parent) - : QAbstractListModel(parent), - m_target(target) +DeployConfigurationModel::DeployConfigurationModel(Target *target, QObject *parent) : + QAbstractListModel(parent), + m_target(target) { m_deployConfigurations = m_target->deployConfigurations(); Utils::sort(m_deployConfigurations, DeployConfigurationComparer()); @@ -62,9 +62,10 @@ DeployConfigurationModel::DeployConfigurationModel(Target *target, QObject *pare connect(target, &Target::removedDeployConfiguration, this, &DeployConfigurationModel::removedDeployConfiguration); - foreach (DeployConfiguration *dc, m_deployConfigurations) + foreach (DeployConfiguration *dc, m_deployConfigurations) { connect(dc, &ProjectConfiguration::displayNameChanged, this, &DeployConfigurationModel::displayNameChanged); + } } int DeployConfigurationModel::rowCount(const QModelIndex &parent) const @@ -79,7 +80,7 @@ int DeployConfigurationModel::columnCount(const QModelIndex &parent) const void DeployConfigurationModel::displayNameChanged() { - DeployConfiguration *dc = qobject_cast<DeployConfiguration *>(sender()); + auto dc = qobject_cast<DeployConfiguration *>(sender()); if (!dc) return; @@ -135,14 +136,14 @@ QVariant DeployConfigurationModel::data(const QModelIndex &index, int role) cons DeployConfiguration *DeployConfigurationModel::deployConfigurationAt(int i) { if (i > m_deployConfigurations.size() || i < 0) - return 0; + return nullptr; return m_deployConfigurations.at(i); } DeployConfiguration *DeployConfigurationModel::deployConfigurationFor(const QModelIndex &idx) { if (idx.row() > m_deployConfigurations.size() || idx.row() < 0) - return 0; + return nullptr; return m_deployConfigurations.at(idx.row()); } diff --git a/src/plugins/projectexplorer/deployconfigurationmodel.h b/src/plugins/projectexplorer/deployconfigurationmodel.h index af0712c64e..95b6092898 100644 --- a/src/plugins/projectexplorer/deployconfigurationmodel.h +++ b/src/plugins/projectexplorer/deployconfigurationmodel.h @@ -37,7 +37,7 @@ class DeployConfigurationModel : public QAbstractListModel { Q_OBJECT public: - explicit DeployConfigurationModel(Target *target, QObject *parent = 0); + explicit DeployConfigurationModel(Target *target, QObject *parent = nullptr); int rowCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; diff --git a/src/plugins/projectexplorer/deploymentdatamodel.cpp b/src/plugins/projectexplorer/deploymentdatamodel.cpp index 8a3a4ee255..f5d655792f 100644 --- a/src/plugins/projectexplorer/deploymentdatamodel.cpp +++ b/src/plugins/projectexplorer/deploymentdatamodel.cpp @@ -27,10 +27,8 @@ namespace ProjectExplorer { -DeploymentDataModel::DeploymentDataModel(QObject *parent) - : QAbstractTableModel(parent) -{ -} +DeploymentDataModel::DeploymentDataModel(QObject *parent) : QAbstractTableModel(parent) +{ } void DeploymentDataModel::setDeploymentData(const DeploymentData &deploymentData) { diff --git a/src/plugins/projectexplorer/deploymentdatamodel.h b/src/plugins/projectexplorer/deploymentdatamodel.h index d148b572ad..a2437cb4bc 100644 --- a/src/plugins/projectexplorer/deploymentdatamodel.h +++ b/src/plugins/projectexplorer/deploymentdatamodel.h @@ -36,7 +36,7 @@ class PROJECTEXPLORER_EXPORT DeploymentDataModel : public QAbstractTableModel { Q_OBJECT public: - explicit DeploymentDataModel(QObject *parent = 0); + explicit DeploymentDataModel(QObject *parent = nullptr); void setDeploymentData(const DeploymentData &deploymentData); diff --git a/src/plugins/projectexplorer/deploymentdataview.cpp b/src/plugins/projectexplorer/deploymentdataview.cpp index e25743be4c..40f4ad3fb4 100644 --- a/src/plugins/projectexplorer/deploymentdataview.cpp +++ b/src/plugins/projectexplorer/deploymentdataview.cpp @@ -44,8 +44,8 @@ public: using namespace Internal; -DeploymentDataView::DeploymentDataView(Target *target, QWidget *parent) : - NamedWidget(parent), d(new DeploymentDataViewPrivate) +DeploymentDataView::DeploymentDataView(Target *target, QWidget *parent) : NamedWidget(parent), + d(new DeploymentDataViewPrivate) { d->ui.setupUi(this); d->ui.deploymentDataView->setTextElideMode(Qt::ElideMiddle); diff --git a/src/plugins/projectexplorer/deploymentdataview.h b/src/plugins/projectexplorer/deploymentdataview.h index 5f984b3189..f8d3b11698 100644 --- a/src/plugins/projectexplorer/deploymentdataview.h +++ b/src/plugins/projectexplorer/deploymentdataview.h @@ -38,7 +38,7 @@ class PROJECTEXPLORER_EXPORT DeploymentDataView : public NamedWidget Q_OBJECT public: - explicit DeploymentDataView(Target *target, QWidget *parent = 0); + explicit DeploymentDataView(Target *target, QWidget *parent = nullptr); ~DeploymentDataView() override; private: diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 9e794a8a42..d48f9d6399 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -451,13 +451,13 @@ public: static Core::Id testTypeId() { return "TestType"; } private: TestDevice(const TestDevice &other) : IDevice(other) {} - QString displayType() const { return QLatin1String("blubb"); } - IDeviceWidget *createWidget() { return 0; } - QList<Core::Id> actionIds() const { return QList<Core::Id>(); } - QString displayNameForActionId(Core::Id) const { return QString(); } - void executeAction(Core::Id, QWidget *) { } - Ptr clone() const { return Ptr(new TestDevice(*this)); } - DeviceProcessSignalOperation::Ptr signalOperation() const + QString displayType() const override { return QLatin1String("blubb"); } + IDeviceWidget *createWidget() override { return 0; } + QList<Core::Id> actionIds() const override { return QList<Core::Id>(); } + QString displayNameForActionId(Core::Id) const override { return QString(); } + void executeAction(Core::Id, QWidget *) override { } + Ptr clone() const override { return Ptr(new TestDevice(*this)); } + DeviceProcessSignalOperation::Ptr signalOperation() const override { return DeviceProcessSignalOperation::Ptr(); } diff --git a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp index 7dc96f7662..60f4a39ca7 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp @@ -25,6 +25,7 @@ #include "deviceusedportsgatherer.h" +#include <utils/port.h> #include <utils/portlist.h> #include <utils/qtcassert.h> #include <ssh/sshconnection.h> @@ -42,7 +43,7 @@ class DeviceUsedPortsGathererPrivate public: SshConnection *connection; SshRemoteProcess::Ptr process; - QList<int> usedPorts; + QList<Port> usedPorts; QByteArray remoteStdout; QByteArray remoteStderr; IDevice::ConstPtr device; @@ -110,17 +111,17 @@ void DeviceUsedPortsGatherer::stop() d->connection = 0; } -int DeviceUsedPortsGatherer::getNextFreePort(PortList *freePorts) const +Port DeviceUsedPortsGatherer::getNextFreePort(PortList *freePorts) const { while (freePorts->hasMore()) { - const int port = freePorts->getNext(); + const Port port = freePorts->getNext(); if (!d->usedPorts.contains(port)) return port; } - return -1; + return Port(); } -QList<int> DeviceUsedPortsGatherer::usedPorts() const +QList<Port> DeviceUsedPortsGatherer::usedPorts() const { return d->usedPorts; } @@ -128,8 +129,8 @@ QList<int> DeviceUsedPortsGatherer::usedPorts() const void DeviceUsedPortsGatherer::setupUsedPorts() { d->usedPorts.clear(); - const QList<int> usedPorts = d->device->portsGatheringMethod()->usedPorts(d->remoteStdout); - foreach (const int port, usedPorts) { + const QList<Port> usedPorts = d->device->portsGatheringMethod()->usedPorts(d->remoteStdout); + foreach (const Port port, usedPorts) { if (d->device->freePorts().contains(port)) d->usedPorts << port; } diff --git a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h index f57e5951c0..e326557469 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h +++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.h @@ -27,7 +27,10 @@ #include "idevice.h" -namespace Utils { class PortList; } +namespace Utils { +class Port; +class PortList; +} // namespace Utils namespace ProjectExplorer { namespace Internal { class DeviceUsedPortsGathererPrivate; } @@ -42,8 +45,8 @@ public: void start(const ProjectExplorer::IDevice::ConstPtr &device); void stop(); - int getNextFreePort(Utils::PortList *freePorts) const; // returns -1 if no more are left - QList<int> usedPorts() const; + Utils::Port getNextFreePort(Utils::PortList *freePorts) const; // returns -1 if no more are left + QList<Utils::Port> usedPorts() const; signals: void error(const QString &errMsg); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 3ab1ff03cd..ff30c66cf1 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -44,6 +44,7 @@ namespace QSsh { class SshConnectionParameters; } namespace Utils { class Environment; class PortList; +class Port; } // Utils namespace ProjectExplorer { @@ -103,7 +104,7 @@ public: virtual ~PortsGatheringMethod() = default; virtual QByteArray commandLine(QAbstractSocket::NetworkLayerProtocol protocol) const = 0; - virtual QList<int> usedPorts(const QByteArray &commandOutput) const = 0; + virtual QList<Utils::Port> usedPorts(const QByteArray &commandOutput) const = 0; }; // See cpp file for documentation. diff --git a/src/plugins/projectexplorer/doubletabwidget.cpp b/src/plugins/projectexplorer/doubletabwidget.cpp index 6e6084d695..8f2c176ef3 100644 --- a/src/plugins/projectexplorer/doubletabwidget.cpp +++ b/src/plugins/projectexplorer/doubletabwidget.cpp @@ -27,6 +27,7 @@ #include "ui_doubletabwidget.h" #include <utils/fileutils.h> +#include <utils/qtcassert.h> #include <utils/stylehelper.h> #include <utils/theme/theme.h> @@ -37,8 +38,6 @@ #include <QMenu> #include <QToolTip> -#include <QDebug> - using namespace ProjectExplorer::Internal; using namespace Utils; @@ -96,9 +95,7 @@ static void drawSecondLevelSeparator(QPainter *painter, QPoint top, QPoint botto DoubleTabWidget::DoubleTabWidget(QWidget *parent) : QWidget(parent), m_selection(StyleHelper::dpiSpecificImageFile(QLatin1String(":/projectexplorer/images/selection.png"))), - ui(new Ui::DoubleTabWidget), - m_currentIndex(-1), - m_lastVisibleIndex(-1) + ui(new Ui::DoubleTabWidget) { ui->setupUi(this); } @@ -170,7 +167,7 @@ QSize DoubleTabWidget::minimumSizeHint() const void DoubleTabWidget::updateNameIsUniqueAdd(Tab *tab) { tab->nameIsUnique = true; - for (int i=0; i < m_tabs.size(); ++i) { + for (int i = 0; i < m_tabs.size(); ++i) { if (m_tabs.at(i).name == tab->name) { m_tabs[i].nameIsUnique = false; tab->nameIsUnique = false; @@ -183,15 +180,16 @@ void DoubleTabWidget::updateNameIsUniqueRemove(const Tab &tab) { if (tab.nameIsUnique) return; - int index; + int index = -1; int count = 0; - for (int i=0; i < m_tabs.size(); ++i) { + for (int i = 0; i < m_tabs.size(); ++i) { if (m_tabs.at(i).name == tab.name) { ++count; index = i; } } + QTC_ASSERT(index >= 0, return); if (count == 1) m_tabs[index].nameIsUnique = true; } @@ -544,7 +542,7 @@ void DoubleTabWidget::paintEvent(QPaintEvent *event) bool DoubleTabWidget::event(QEvent *event) { if (event->type() == QEvent::ToolTip) { - QHelpEvent *helpevent = static_cast<QHelpEvent*>(event); + auto helpevent = static_cast<QHelpEvent*>(event); QPair<HitArea, int> hit = convertPosToTab(helpevent->pos()); if (hit.first == HITTAB && m_tabs.at(m_currentTabIndices.at(hit.second)).nameIsUnique) { const QString &fileName = m_tabs.at(m_currentTabIndices.at(hit.second)).fullName; diff --git a/src/plugins/projectexplorer/doubletabwidget.h b/src/plugins/projectexplorer/doubletabwidget.h index d701bcea00..6b96ff704b 100644 --- a/src/plugins/projectexplorer/doubletabwidget.h +++ b/src/plugins/projectexplorer/doubletabwidget.h @@ -38,7 +38,7 @@ class DoubleTabWidget : public QWidget { Q_OBJECT public: - explicit DoubleTabWidget(QWidget *parent = 0); + explicit DoubleTabWidget(QWidget *parent = nullptr); ~DoubleTabWidget() override; void setTitle(const QString &title); @@ -68,7 +68,8 @@ protected: QSize minimumSizeHint() const override; private: - struct Tab { + class Tab { + public: QString name; QString fullName; bool nameIsUnique; @@ -86,12 +87,11 @@ private: Ui::DoubleTabWidget *ui; - QString m_title; QList<Tab> m_tabs; - int m_currentIndex; + int m_currentIndex = -1; + int m_lastVisibleIndex = -1; QVector<int> m_currentTabIndices; - int m_lastVisibleIndex; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index 5eedf278e6..01060baacb 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -62,21 +62,19 @@ namespace ProjectExplorer { struct EditorConfigurationPrivate { - EditorConfigurationPrivate() - : m_useGlobal(true) - , m_typingSettings(TextEditorSettings::typingSettings()) - , m_storageSettings(TextEditorSettings::storageSettings()) - , m_behaviorSettings(TextEditorSettings::behaviorSettings()) - , m_extraEncodingSettings(TextEditorSettings::extraEncodingSettings()) - , m_textCodec(Core::EditorManager::defaultTextCodec()) - { - } - - bool m_useGlobal; - ICodeStylePreferences *m_defaultCodeStyle; + EditorConfigurationPrivate() : + m_typingSettings(TextEditorSettings::typingSettings()), + m_storageSettings(TextEditorSettings::storageSettings()), + m_behaviorSettings(TextEditorSettings::behaviorSettings()), + m_extraEncodingSettings(TextEditorSettings::extraEncodingSettings()), + m_textCodec(Core::EditorManager::defaultTextCodec()) + { } + + ICodeStylePreferences *m_defaultCodeStyle = nullptr; TypingSettings m_typingSettings; StorageSettings m_storageSettings; BehaviorSettings m_behaviorSettings; + bool m_useGlobal = true; ExtraEncodingSettings m_extraEncodingSettings; MarginSettings m_marginSettings; QTextCodec *m_textCodec; @@ -277,7 +275,7 @@ void EditorConfiguration::setUseGlobalSettings(bool use) d->m_useGlobal = use; d->m_defaultCodeStyle->setCurrentDelegate(use ? TextEditorSettings::codeStyle() : 0); foreach (Core::IEditor *editor, Core::DocumentModel::editorsForOpenedDocuments()) { - if (TextEditorWidget *widget = qobject_cast<TextEditorWidget *>(editor->widget())) { + if (auto widget = qobject_cast<TextEditorWidget *>(editor->widget())) { Project *project = SessionManager::projectForFile(editor->document()->filePath()); if (project && project->editorConfiguration() == this) switchSettings(widget); diff --git a/src/plugins/projectexplorer/environmentaspect.cpp b/src/plugins/projectexplorer/environmentaspect.cpp index d724cd986e..ba2a2fb2e7 100644 --- a/src/plugins/projectexplorer/environmentaspect.cpp +++ b/src/plugins/projectexplorer/environmentaspect.cpp @@ -39,8 +39,8 @@ namespace ProjectExplorer { // EnvironmentAspect: // -------------------------------------------------------------------- -EnvironmentAspect::EnvironmentAspect(RunConfiguration *runConfig) - : IRunConfigurationAspect(runConfig), m_base(-1) +EnvironmentAspect::EnvironmentAspect(RunConfiguration *runConfig) : + IRunConfigurationAspect(runConfig), m_base(-1) { setDisplayName(tr("Run Environment")); setId("EnvironmentAspect"); diff --git a/src/plugins/projectexplorer/environmentaspectwidget.cpp b/src/plugins/projectexplorer/environmentaspectwidget.cpp index 4996eec917..e5e78032eb 100644 --- a/src/plugins/projectexplorer/environmentaspectwidget.cpp +++ b/src/plugins/projectexplorer/environmentaspectwidget.cpp @@ -50,13 +50,13 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect, QWid QTC_CHECK(m_aspect); setContentsMargins(0, 0, 0, 0); - QVBoxLayout *topLayout = new QVBoxLayout(this); + auto topLayout = new QVBoxLayout(this); topLayout->setMargin(0); - QWidget *baseEnvironmentWidget = new QWidget; - QHBoxLayout *baseLayout = new QHBoxLayout(baseEnvironmentWidget); + auto baseEnvironmentWidget = new QWidget; + auto baseLayout = new QHBoxLayout(baseEnvironmentWidget); baseLayout->setMargin(0); - QLabel *label = new QLabel(tr("Base environment for this run configuration:"), this); + auto label = new QLabel(tr("Base environment for this run configuration:"), this); baseLayout->addWidget(label); m_baseEnvironmentComboBox = new QComboBox; QList<int> bases = m_aspect->possibleBaseEnvironments(); diff --git a/src/plugins/projectexplorer/environmentitemswidget.cpp b/src/plugins/projectexplorer/environmentitemswidget.cpp index 15b960934b..c35cbac971 100644 --- a/src/plugins/projectexplorer/environmentitemswidget.cpp +++ b/src/plugins/projectexplorer/environmentitemswidget.cpp @@ -67,7 +67,7 @@ EnvironmentItemsWidget::EnvironmentItemsWidget(QWidget *parent) : QWidget(parent), d(new EnvironmentItemsWidgetPrivate) { d->m_editor = new TextEditor::SnippetEditorWidget(this); - QVBoxLayout *layout = new QVBoxLayout(this); + auto layout = new QVBoxLayout(this); layout->addWidget(d->m_editor); } @@ -104,11 +104,10 @@ EnvironmentItemsDialog::EnvironmentItemsDialog(QWidget *parent) : { resize(640, 480); d->m_editor = new EnvironmentItemsWidget(this); - QDialogButtonBox *box = new QDialogButtonBox( - QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); + auto box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); connect(box, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(box, &QDialogButtonBox::rejected, this, &QDialog::reject); - QVBoxLayout *layout = new QVBoxLayout(this); + auto layout = new QVBoxLayout(this); layout->addWidget(d->m_editor); layout->addWidget(box); setWindowTitle(tr("Edit Environment")); diff --git a/src/plugins/projectexplorer/environmentitemswidget.h b/src/plugins/projectexplorer/environmentitemswidget.h index 6306d5f770..8a81281862 100644 --- a/src/plugins/projectexplorer/environmentitemswidget.h +++ b/src/plugins/projectexplorer/environmentitemswidget.h @@ -36,7 +36,7 @@ class EnvironmentItemsWidget : public QWidget { Q_OBJECT public: - explicit EnvironmentItemsWidget(QWidget *parent = 0); + explicit EnvironmentItemsWidget(QWidget *parent = nullptr); ~EnvironmentItemsWidget() override; void setEnvironmentItems(const QList<Utils::EnvironmentItem> &items); @@ -53,14 +53,15 @@ class EnvironmentItemsDialog : public QDialog { Q_OBJECT public: - explicit EnvironmentItemsDialog(QWidget *parent = 0); + explicit EnvironmentItemsDialog(QWidget *parent = nullptr); ~EnvironmentItemsDialog() override; void setEnvironmentItems(const QList<Utils::EnvironmentItem> &items); QList<Utils::EnvironmentItem> environmentItems() const; static QList<Utils::EnvironmentItem> - getEnvironmentItems(QWidget *parent, const QList<Utils::EnvironmentItem> &initial, bool *ok = 0); + getEnvironmentItems(QWidget *parent, const QList<Utils::EnvironmentItem> &initial, + bool *ok = nullptr); private: EnvironmentItemsDialogPrivate *d; diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp index 707626c518..ce5ea989af 100644 --- a/src/plugins/projectexplorer/environmentwidget.cpp +++ b/src/plugins/projectexplorer/environmentwidget.cpp @@ -50,10 +50,9 @@ class EnvironmentValidator : public QValidator { Q_OBJECT public: - EnvironmentValidator(QWidget *parent, Utils::EnvironmentModel *model, - QTreeView *view, - const QModelIndex &index) - : QValidator(parent), m_model(model), m_view(view), m_index(index) + EnvironmentValidator(QWidget *parent, Utils::EnvironmentModel *model, QTreeView *view, + const QModelIndex &index) : + QValidator(parent), m_model(model), m_view(view), m_index(index) { m_hideTipTimer.setInterval(2000); m_hideTipTimer.setSingleShot(true); @@ -103,7 +102,7 @@ public: if (index.column() != 0) return w; - if (QLineEdit *edit = qobject_cast<QLineEdit *>(w)) + if (auto edit = qobject_cast<QLineEdit *>(w)) edit->setValidator(new EnvironmentValidator(edit, m_model, m_view, index)); return w; } @@ -144,22 +143,22 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails connect(d->m_model, &Utils::EnvironmentModel::focusIndex, this, &EnvironmentWidget::focusIndex); - QVBoxLayout *vbox = new QVBoxLayout(this); + auto vbox = new QVBoxLayout(this); vbox->setContentsMargins(0, 0, 0, 0); d->m_detailsContainer = new Utils::DetailsWidget(this); - QWidget *details = new QWidget(d->m_detailsContainer); + auto details = new QWidget(d->m_detailsContainer); d->m_detailsContainer->setWidget(details); details->setVisible(false); - QVBoxLayout *vbox2 = new QVBoxLayout(details); + auto vbox2 = new QVBoxLayout(details); vbox2->setMargin(0); if (additionalDetailsWidget) vbox2->addWidget(additionalDetailsWidget); - QHBoxLayout *horizontalLayout = new QHBoxLayout(); + auto horizontalLayout = new QHBoxLayout(); horizontalLayout->setMargin(0); auto tree = new Utils::TreeView(this); connect(tree, &QAbstractItemView::activated, @@ -178,7 +177,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails findWrapper->setFrameStyle(QFrame::StyledPanel); horizontalLayout->addWidget(findWrapper); - QVBoxLayout *buttonLayout = new QVBoxLayout(); + auto buttonLayout = new QVBoxLayout(); d->m_editButton = new QPushButton(this); d->m_editButton->setText(tr("&Edit")); @@ -235,7 +234,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails EnvironmentWidget::~EnvironmentWidget() { delete d->m_model; - d->m_model = 0; + d->m_model = nullptr; delete d; } diff --git a/src/plugins/projectexplorer/environmentwidget.h b/src/plugins/projectexplorer/environmentwidget.h index 73cf307ab1..380a68917e 100644 --- a/src/plugins/projectexplorer/environmentwidget.h +++ b/src/plugins/projectexplorer/environmentwidget.h @@ -45,7 +45,7 @@ class PROJECTEXPLORER_EXPORT EnvironmentWidget : public QWidget Q_OBJECT public: - explicit EnvironmentWidget(QWidget *parent, QWidget *additionalDetailsWidget = 0); + explicit EnvironmentWidget(QWidget *parent, QWidget *additionalDetailsWidget = nullptr); ~EnvironmentWidget() override; void setBaseEnvironmentText(const QString &text); diff --git a/src/plugins/projectexplorer/expanddata.cpp b/src/plugins/projectexplorer/expanddata.cpp index f58f6066b1..9e940aeb27 100644 --- a/src/plugins/projectexplorer/expanddata.cpp +++ b/src/plugins/projectexplorer/expanddata.cpp @@ -28,9 +28,9 @@ using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; -ExpandData::ExpandData(const QString &path_, const QString &displayName_) - : path(path_), displayName(displayName_) -{} +ExpandData::ExpandData(const QString &path_, const QString &displayName_) : + path(path_), displayName(displayName_) +{ } bool ExpandData::operator==(const ExpandData &other) const { diff --git a/src/plugins/projectexplorer/extracompiler.cpp b/src/plugins/projectexplorer/extracompiler.cpp index 605e24252e..77f9961e2a 100644 --- a/src/plugins/projectexplorer/extracompiler.cpp +++ b/src/plugins/projectexplorer/extracompiler.cpp @@ -317,8 +317,7 @@ void ExtraCompilerPrivate::updateIssues() if (!lastEditor) return; - TextEditor::TextEditorWidget *widget = - qobject_cast<TextEditor::TextEditorWidget *>(lastEditor->widget()); + auto widget = qobject_cast<TextEditor::TextEditorWidget *>(lastEditor->widget()); if (!widget) return; diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 919b1ffa6d..c6a660ed3f 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -69,15 +69,14 @@ class DotRemovalFilter : public QSortFilterProxyModel { Q_OBJECT public: - explicit DotRemovalFilter(QObject *parent = 0); + explicit DotRemovalFilter(QObject *parent = nullptr); protected: virtual bool filterAcceptsRow(int source_row, const QModelIndex &parent) const; Qt::DropActions supportedDragActions() const; }; DotRemovalFilter::DotRemovalFilter(QObject *parent) : QSortFilterProxyModel(parent) -{ -} +{ } bool DotRemovalFilter::filterAcceptsRow(int source_row, const QModelIndex &parent) const { @@ -97,15 +96,13 @@ Qt::DropActions DotRemovalFilter::supportedDragActions() const class FolderNavigationModel : public QFileSystemModel { public: - explicit FolderNavigationModel(QObject *parent = 0); + explicit FolderNavigationModel(QObject *parent = nullptr); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; Qt::DropActions supportedDragActions() const; }; -FolderNavigationModel::FolderNavigationModel(QObject *parent) : - QFileSystemModel(parent) -{ -} +FolderNavigationModel::FolderNavigationModel(QObject *parent) : QFileSystemModel(parent) +{ } QVariant FolderNavigationModel::data(const QModelIndex &index, int role) const { @@ -125,15 +122,13 @@ Qt::DropActions FolderNavigationModel::supportedDragActions() const Shows a file system folder */ -FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) - : QWidget(parent), - m_listView(new Utils::ListView(this)), - m_fileSystemModel(new FolderNavigationModel(this)), - m_filterHiddenFilesAction(new QAction(tr("Show Hidden Files"), this)), - m_filterModel(new DotRemovalFilter(this)), - m_title(new Utils::ElidingLabel(this)), - m_autoSync(false), - m_toggleSync(new QToolButton(this)) +FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent), + m_listView(new Utils::ListView(this)), + m_fileSystemModel(new FolderNavigationModel(this)), + m_filterHiddenFilesAction(new QAction(tr("Show Hidden Files"), this)), + m_filterModel(new DotRemovalFilter(this)), + m_title(new Utils::ElidingLabel(this)), + m_toggleSync(new QToolButton(this)) { m_fileSystemModel->setResolveSymlinks(false); m_fileSystemModel->setIconProvider(Core::FileIconProvider::iconProvider()); @@ -154,7 +149,7 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) m_listView->setDragDropMode(QAbstractItemView::DragOnly); setFocusProxy(m_listView); - QVBoxLayout *layout = new QVBoxLayout(); + auto layout = new QVBoxLayout(); layout->addWidget(m_title); layout->addWidget(m_listView); m_title->setMargin(5); @@ -424,14 +419,14 @@ FolderNavigationWidgetFactory::FolderNavigationWidgetFactory() Core::NavigationView FolderNavigationWidgetFactory::createWidget() { Core::NavigationView n; - FolderNavigationWidget *fnw = new FolderNavigationWidget; + auto fnw = new FolderNavigationWidget; n.widget = fnw; - QToolButton *filter = new QToolButton; + auto filter = new QToolButton; filter->setIcon(Core::Icons::FILTER.icon()); filter->setToolTip(tr("Filter Files")); filter->setPopupMode(QToolButton::InstantPopup); filter->setProperty("noArrow", true); - QMenu *filterMenu = new QMenu(filter); + auto filterMenu = new QMenu(filter); filterMenu->addAction(fnw->m_filterHiddenFilesAction); filter->setMenu(filterMenu); n.dockToolBarWidgets << filter << fnw->m_toggleSync; @@ -440,7 +435,7 @@ Core::NavigationView FolderNavigationWidgetFactory::createWidget() void FolderNavigationWidgetFactory::saveSettings(int position, QWidget *widget) { - FolderNavigationWidget *fnw = qobject_cast<FolderNavigationWidget *>(widget); + auto fnw = qobject_cast<FolderNavigationWidget *>(widget); QTC_ASSERT(fnw, return); QSettings *settings = Core::ICore::settings(); const QString baseKey = QLatin1String("FolderNavigationWidget.") + QString::number(position); @@ -450,7 +445,7 @@ void FolderNavigationWidgetFactory::saveSettings(int position, QWidget *widget) void FolderNavigationWidgetFactory::restoreSettings(int position, QWidget *widget) { - FolderNavigationWidget *fnw = qobject_cast<FolderNavigationWidget *>(widget); + auto fnw = qobject_cast<FolderNavigationWidget *>(widget); QTC_ASSERT(fnw, return); QSettings *settings = Core::ICore::settings(); const QString baseKey = QLatin1String("FolderNavigationWidget.") + QString::number(position); diff --git a/src/plugins/projectexplorer/foldernavigationwidget.h b/src/plugins/projectexplorer/foldernavigationwidget.h index 6caa8209a4..cf10b1c5f5 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.h +++ b/src/plugins/projectexplorer/foldernavigationwidget.h @@ -48,7 +48,7 @@ class FolderNavigationWidget : public QWidget Q_OBJECT Q_PROPERTY(bool autoSynchronization READ autoSynchronization WRITE setAutoSynchronization) public: - explicit FolderNavigationWidget(QWidget *parent = 0); + explicit FolderNavigationWidget(QWidget *parent = nullptr); static QStringList projectFilesInDirectory(const QString &path); @@ -80,8 +80,9 @@ private: QAction *m_filterHiddenFilesAction; QSortFilterProxyModel *m_filterModel; QLabel *m_title; - bool m_autoSync; + bool m_autoSync = false; QToolButton *m_toggleSync; + // FolderNavigationWidgetFactory needs private members to build a menu friend class FolderNavigationWidgetFactory; }; @@ -89,6 +90,7 @@ private: class FolderNavigationWidgetFactory : public Core::INavigationWidgetFactory { Q_OBJECT + public: FolderNavigationWidgetFactory(); diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index d1f5466555..e657c0dea8 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -71,9 +71,8 @@ static QByteArray runGcc(const FileName &gcc, const QStringList &arguments, cons return QByteArray(); QProcess cpp; - // Force locale: This function is used only to detect settings inside the tool chain, so this is save. QStringList environment(env); - environment.append(QLatin1String("LC_ALL=C")); + Utils::Environment::setupEnglishOutput(&environment); cpp.setEnvironment(environment); cpp.start(gcc.toString(), arguments); @@ -735,7 +734,7 @@ bool GccToolChain::operator ==(const ToolChain &other) const if (!ToolChain::operator ==(other)) return false; - const GccToolChain *gccTc = static_cast<const GccToolChain *>(&other); + auto gccTc = static_cast<const GccToolChain *>(&other); return m_compilerCommand == gccTc->m_compilerCommand && m_targetAbi == gccTc->m_targetAbi && m_platformCodeGenFlags == gccTc->m_platformCodeGenFlags && m_platformLinkerFlags == gccTc->m_platformLinkerFlags; @@ -818,7 +817,7 @@ ToolChain *GccToolChainFactory::restore(const QVariantMap &data) return tc; delete tc; - return 0; + return nullptr; } GccToolChain *GccToolChainFactory::createToolChain(bool autoDetect) @@ -884,8 +883,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains(const QString &comp GccToolChainConfigWidget::GccToolChainConfigWidget(GccToolChain *tc) : ToolChainConfigWidget(tc), m_compilerCommand(new PathChooser), - m_abiWidget(new AbiWidget), - m_isReadOnly(false) + m_abiWidget(new AbiWidget) { Q_ASSERT(tc); @@ -921,7 +919,7 @@ void GccToolChainConfigWidget::applyImpl() if (toolChain()->isAutoDetected()) return; - GccToolChain *tc = static_cast<GccToolChain *>(toolChain()); + auto tc = static_cast<GccToolChain *>(toolChain()); Q_ASSERT(tc); QString displayName = tc->displayName(); tc->setCompilerCommand(m_compilerCommand->fileName()); @@ -938,7 +936,7 @@ void GccToolChainConfigWidget::setFromToolchain() { // subwidgets are not yet connected! bool blocked = blockSignals(true); - GccToolChain *tc = static_cast<GccToolChain *>(toolChain()); + auto tc = static_cast<GccToolChain *>(toolChain()); m_compilerCommand->setFileName(tc->compilerCommand()); m_platformCodeGenFlagsLineEdit->setText(QtcProcess::joinArgs(tc->platformCodeGenFlags())); m_platformLinkerFlagsLineEdit->setText(QtcProcess::joinArgs(tc->platformLinkerFlags())); @@ -950,7 +948,7 @@ void GccToolChainConfigWidget::setFromToolchain() bool GccToolChainConfigWidget::isDirtyImpl() const { - GccToolChain *tc = static_cast<GccToolChain *>(toolChain()); + auto tc = static_cast<GccToolChain *>(toolChain()); Q_ASSERT(tc); return m_compilerCommand->fileName() != tc->compilerCommand() || m_platformCodeGenFlagsLineEdit->text() != QtcProcess::joinArgs(tc->platformCodeGenFlags()) @@ -1316,8 +1314,7 @@ GccToolChain *LinuxIccToolChainFactory::createToolChain(bool autoDetect) } GccToolChain::WarningFlagAdder::WarningFlagAdder(const QString &flag, WarningFlags &flags) : - m_flags(flags), - m_triggered(false) + m_flags(flags) { if (!flag.startsWith(QLatin1String("-W"))) { m_triggered = true; diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 33c900537a..cd651ab444 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -94,10 +94,10 @@ public: public: DetectedAbisResult() = default; DetectedAbisResult(const QList<Abi> &supportedAbis, - const QString &originalTargetTriple = QString()) - : supportedAbis(supportedAbis) - , originalTargetTriple(originalTargetTriple) - {} + const QString &originalTargetTriple = QString()) : + supportedAbis(supportedAbis), + originalTargetTriple(originalTargetTriple) + { } QList<Abi> supportedAbis; QString originalTargetTriple; @@ -132,15 +132,16 @@ protected: class WarningFlagAdder { - QByteArray m_flagUtf8; - WarningFlags &m_flags; - bool m_doesEnable; - bool m_triggered; public: WarningFlagAdder(const QString &flag, WarningFlags &flags); void operator ()(const char name[], WarningFlags flagsSet); bool triggered() const; + private: + QByteArray m_flagUtf8; + WarningFlags &m_flags; + bool m_doesEnable; + bool m_triggered = false; }; private: diff --git a/src/plugins/projectexplorer/gcctoolchainfactories.h b/src/plugins/projectexplorer/gcctoolchainfactories.h index 700e8d09eb..cdebccc27f 100644 --- a/src/plugins/projectexplorer/gcctoolchainfactories.h +++ b/src/plugins/projectexplorer/gcctoolchainfactories.h @@ -94,7 +94,7 @@ private: QLineEdit *m_platformLinkerFlagsLineEdit; AbiWidget *m_abiWidget; - bool m_isReadOnly; + bool m_isReadOnly = false; QByteArray m_macros; }; diff --git a/src/plugins/projectexplorer/gnumakeparser.cpp b/src/plugins/projectexplorer/gnumakeparser.cpp index 271d65df64..1045138a94 100644 --- a/src/plugins/projectexplorer/gnumakeparser.cpp +++ b/src/plugins/projectexplorer/gnumakeparser.cpp @@ -41,9 +41,7 @@ namespace { const char * const MAKEFILE_PATTERN("^((.*?[/\\\\])?[Mm]akefile(\\.[a-zA-Z]+)?):(\\d+):\\s"); } -GnuMakeParser::GnuMakeParser() : - m_suppressIssues(false), - m_fatalErrorCount(0) +GnuMakeParser::GnuMakeParser() { setObjectName(QLatin1String("GnuMakeParser")); m_makeDir.setPattern(QLatin1String(MAKEEXEC_PATTERN) + diff --git a/src/plugins/projectexplorer/gnumakeparser.h b/src/plugins/projectexplorer/gnumakeparser.h index 97bd7805fc..9c5108bc4b 100644 --- a/src/plugins/projectexplorer/gnumakeparser.h +++ b/src/plugins/projectexplorer/gnumakeparser.h @@ -61,12 +61,13 @@ private: QStringList m_directories; + bool m_suppressIssues = false; + + int m_fatalErrorCount = 0; + #if defined WITH_TESTS friend class ProjectExplorerPlugin; #endif - bool m_suppressIssues; - - int m_fatalErrorCount; }; #if defined WITH_TESTS diff --git a/src/plugins/projectexplorer/headerpath.h b/src/plugins/projectexplorer/headerpath.h index 37200239a0..db3d5590b1 100644 --- a/src/plugins/projectexplorer/headerpath.h +++ b/src/plugins/projectexplorer/headerpath.h @@ -39,9 +39,7 @@ public: FrameworkHeaderPath }; - HeaderPath() : m_kind(GlobalHeaderPath) - { } - + HeaderPath() = default; HeaderPath(const QString &path, Kind kind) : m_path(path), m_kind(kind) { } @@ -55,7 +53,7 @@ public: private: QString m_path; - Kind m_kind; + Kind m_kind = GlobalHeaderPath; }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/importwidget.cpp b/src/plugins/projectexplorer/importwidget.cpp index 2e6deeabef..d9bd629179 100644 --- a/src/plugins/projectexplorer/importwidget.cpp +++ b/src/plugins/projectexplorer/importwidget.cpp @@ -39,24 +39,24 @@ ImportWidget::ImportWidget(QWidget *parent) : m_pathChooser(new Utils::PathChooser) { setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - QVBoxLayout *vboxLayout = new QVBoxLayout(); + auto vboxLayout = new QVBoxLayout(); setLayout(vboxLayout); vboxLayout->setContentsMargins(0, 0, 0, 0); - Utils::DetailsWidget *detailsWidget = new Utils::DetailsWidget(this); + auto detailsWidget = new Utils::DetailsWidget(this); detailsWidget->setUseCheckBox(false); detailsWidget->setSummaryText(tr("Import Build From...")); detailsWidget->setSummaryFontBold(true); // m_detailsWidget->setIcon(); // FIXME: Set icon! vboxLayout->addWidget(detailsWidget); - QWidget *widget = new QWidget; - QVBoxLayout *layout = new QVBoxLayout(widget); + auto widget = new QWidget; + auto layout = new QVBoxLayout(widget); layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(m_pathChooser); m_pathChooser->setExpectedKind(Utils::PathChooser::ExistingDirectory); m_pathChooser->setHistoryCompleter(QLatin1String("Import.SourceDir.History")); - QPushButton *importButton = new QPushButton(tr("Import"), widget); + auto importButton = new QPushButton(tr("Import"), widget); layout->addWidget(importButton); connect(importButton, &QAbstractButton::clicked, this, &ImportWidget::handleImportRequest); diff --git a/src/plugins/projectexplorer/importwidget.h b/src/plugins/projectexplorer/importwidget.h index dc3601c71d..9a55f64e1b 100644 --- a/src/plugins/projectexplorer/importwidget.h +++ b/src/plugins/projectexplorer/importwidget.h @@ -40,7 +40,7 @@ class ImportWidget : public QWidget Q_OBJECT public: - explicit ImportWidget(QWidget *parent = 0); + explicit ImportWidget(QWidget *parent = nullptr); void setCurrentDirectory(const Utils::FileName &dir); diff --git a/src/plugins/projectexplorer/ioutputparser.cpp b/src/plugins/projectexplorer/ioutputparser.cpp index 59efa62ef1..bf772e576c 100644 --- a/src/plugins/projectexplorer/ioutputparser.cpp +++ b/src/plugins/projectexplorer/ioutputparser.cpp @@ -224,4 +224,4 @@ QString IOutputParser::rightTrimmed(const QString &in) return in.mid(0, pos); } -} +} // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/ioutputparser.h b/src/plugins/projectexplorer/ioutputparser.h index 92bcbb0f16..7590ce2f7e 100644 --- a/src/plugins/projectexplorer/ioutputparser.h +++ b/src/plugins/projectexplorer/ioutputparser.h @@ -70,8 +70,7 @@ public slots: private: virtual void doFlush(); - IOutputParser *m_parser = 0; + IOutputParser *m_parser = nullptr; }; } // namespace ProjectExplorer - diff --git a/src/plugins/projectexplorer/itaskhandler.h b/src/plugins/projectexplorer/itaskhandler.h index 307a15a330..9f8692bbf4 100644 --- a/src/plugins/projectexplorer/itaskhandler.h +++ b/src/plugins/projectexplorer/itaskhandler.h @@ -44,6 +44,8 @@ class PROJECTEXPLORER_EXPORT ITaskHandler : public QObject Q_OBJECT public: + virtual ~ITaskHandler() { } + virtual bool isDefaultHandler() const { return false; } virtual bool canHandle(const Task &) const = 0; virtual void handle(const Task &) = 0; diff --git a/src/plugins/projectexplorer/journaldwatcher.cpp b/src/plugins/projectexplorer/journaldwatcher.cpp index a702d18c95..5f8bebc83d 100644 --- a/src/plugins/projectexplorer/journaldwatcher.cpp +++ b/src/plugins/projectexplorer/journaldwatcher.cpp @@ -34,18 +34,14 @@ namespace ProjectExplorer { -JournaldWatcher *JournaldWatcher::m_instance = 0; +JournaldWatcher *JournaldWatcher::m_instance = nullptr; namespace Internal { class JournaldWatcherPrivate { public: - JournaldWatcherPrivate() : - m_journalContext(0), - m_notifier(0) - { } - + JournaldWatcherPrivate() = default; ~JournaldWatcherPrivate() { teardown(); @@ -67,8 +63,8 @@ public: }; QList<SubscriberInformation> m_subscriptions; - sd_journal *m_journalContext; - QSocketNotifier *m_notifier; + sd_journal *m_journalContext = nullptr; + QSocketNotifier *m_notifier = nullptr; }; bool JournaldWatcherPrivate::setup() @@ -96,11 +92,11 @@ bool JournaldWatcherPrivate::setup() void JournaldWatcherPrivate::teardown() { delete m_notifier; - m_notifier = 0; + m_notifier = nullptr; if (m_journalContext) { sd_journal_close(m_journalContext); - m_journalContext = 0; + m_journalContext = nullptr; } } @@ -130,16 +126,16 @@ JournaldWatcher::LogEntry JournaldWatcherPrivate::retrieveEntry() using namespace Internal; -static JournaldWatcherPrivate *d = 0; +static JournaldWatcherPrivate *d = nullptr; JournaldWatcher::~JournaldWatcher() { d->teardown(); - m_instance = 0; + m_instance = nullptr; delete d; - d = 0; + d = nullptr; } JournaldWatcher *JournaldWatcher::instance() diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp index ca825246b3..b1b1c450ac 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp @@ -662,8 +662,7 @@ void PathChooserField::initializeData(MacroExpander *expander) CheckBoxField::CheckBoxField() : m_checkedValue(QLatin1String("0")), - m_uncheckedValue(QLatin1String("1")), - m_isModified(false) + m_uncheckedValue(QLatin1String("1")) { } bool CheckBoxField::parseData(const QVariant &data, QString *errorMessage) @@ -732,9 +731,6 @@ void CheckBoxField::initializeData(MacroExpander *expander) // ComboBoxFieldData: // -------------------------------------------------------------------- -ComboBoxField::ComboBoxField() : m_index(-1), m_disabledIndex(-1), m_savedIndex(-1) -{ } - struct ComboBoxItem { ComboBoxItem(const QString &k = QString(), const QString &v = QString(), const QVariant &c = true) : key(k), value(v), condition(c) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h index ffa5031346..62c3556996 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONFIELDPAGE_H -#define JSONFIELDPAGE_H +#pragma once #include "../projectexplorer_export.h" @@ -108,16 +107,16 @@ public: }; JsonFieldPage(Utils::MacroExpander *expander, QWidget *parent = 0); - ~JsonFieldPage(); + ~JsonFieldPage() override; typedef std::function<Field *()> FieldFactory; static void registerFieldFactory(const QString &id, const FieldFactory &ff); bool setup(const QVariant &data); - bool isComplete() const; - void initializePage(); - void cleanupPage(); + bool isComplete() const override; + void initializePage() override; + void cleanupPage() override; QFormLayout *layout() const { return m_formLayout; } @@ -140,5 +139,3 @@ private: }; } // namespace ProjectExplorer - -#endif // JSONFIELDPAGE_H diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h index 7478a3020f..0e67fdff7f 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONFIELDPAGE_P_H -#define JSONFIELDPAGE_P_H +#pragma once #include "jsonfieldpage.h" @@ -54,7 +53,7 @@ public: QVariant m_isCompleteExpando; QString m_isCompleteExpandoMessage; - QWidget *m_widget = 0; + QWidget *m_widget = nullptr; }; // -------------------------------------------------------------------- @@ -67,8 +66,8 @@ public: LabelField(); private: - QWidget *createWidget(const QString &displayName, JsonFieldPage *page); - bool parseData(const QVariant &data, QString *errorMessage); + QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override; + bool parseData(const QVariant &data, QString *errorMessage) override; bool m_wordWrap; QString m_text; @@ -79,11 +78,11 @@ class SpacerField : public JsonFieldPage::Field public: SpacerField(); - bool suppressName() const { return true; } + bool suppressName() const override { return true; } private: - bool parseData(const QVariant &data, QString *errorMessage); - QWidget *createWidget(const QString &displayName, JsonFieldPage *page); + bool parseData(const QVariant &data, QString *errorMessage) override; + QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override; int m_factor; }; @@ -94,13 +93,13 @@ public: LineEditField(); private: - bool parseData(const QVariant &data, QString *errorMessage); - QWidget *createWidget(const QString &displayName, JsonFieldPage *page); + bool parseData(const QVariant &data, QString *errorMessage) override; + QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override; - void setup(JsonFieldPage *page, const QString &name); + void setup(JsonFieldPage *page, const QString &name) override; - bool validate(Utils::MacroExpander *expander, QString *message); - void initializeData(Utils::MacroExpander *expander); + bool validate(Utils::MacroExpander *expander, QString *message) override; + void initializeData(Utils::MacroExpander *expander) override; bool m_isModified; bool m_isValidating; @@ -120,13 +119,13 @@ public: TextEditField(); private: - bool parseData(const QVariant &data, QString *errorMessage); - QWidget *createWidget(const QString &displayName, JsonFieldPage *page); + bool parseData(const QVariant &data, QString *errorMessage) override; + QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override; - void setup(JsonFieldPage *page, const QString &name); + void setup(JsonFieldPage *page, const QString &name) override; - bool validate(Utils::MacroExpander *expander, QString *message); - void initializeData(Utils::MacroExpander *expander); + bool validate(Utils::MacroExpander *expander, QString *message) override; + void initializeData(Utils::MacroExpander *expander) override; QString m_defaultText; bool m_acceptRichText; @@ -141,15 +140,15 @@ public: PathChooserField(); private: - bool parseData(const QVariant &data, QString *errorMessage); + bool parseData(const QVariant &data, QString *errorMessage) override; - QWidget *createWidget(const QString &displayName, JsonFieldPage *page); - void setEnabled(bool e); + QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override; + void setEnabled(bool e) override; - void setup(JsonFieldPage *page, const QString &name); + void setup(JsonFieldPage *page, const QString &name) override; - bool validate(Utils::MacroExpander *expander, QString *message); - void initializeData(Utils::MacroExpander *expander); + bool validate(Utils::MacroExpander *expander, QString *message) override; + void initializeData(Utils::MacroExpander *expander) override; QString m_path; QString m_basePath; @@ -164,49 +163,47 @@ class CheckBoxField : public JsonFieldPage::Field public: CheckBoxField(); - bool suppressName() const { return true; } + bool suppressName() const override { return true; } private: - bool parseData(const QVariant &data, QString *errorMessage); + bool parseData(const QVariant &data, QString *errorMessage) override; - QWidget *createWidget(const QString &displayName, JsonFieldPage *page); + QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override; - void setup(JsonFieldPage *page, const QString &name); + void setup(JsonFieldPage *page, const QString &name) override; - bool validate(Utils::MacroExpander *expander, QString *message); - void initializeData(Utils::MacroExpander *expander); + bool validate(Utils::MacroExpander *expander, QString *message) override; + void initializeData(Utils::MacroExpander *expander) override; QString m_checkedValue; QString m_uncheckedValue; QVariant m_checkedExpression; - bool m_isModified; + bool m_isModified = false; }; class ComboBoxField : public JsonFieldPage::Field { public: - ComboBoxField(); + ComboBoxField() = default; private: - bool parseData(const QVariant &data, QString *errorMessage); + bool parseData(const QVariant &data, QString *errorMessage) override; - QWidget *createWidget(const QString &displayName, JsonFieldPage *page); + QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override; - void setup(JsonFieldPage *page, const QString &name); + void setup(JsonFieldPage *page, const QString &name) override; - bool validate(Utils::MacroExpander *expander, QString *message); - void initializeData(Utils::MacroExpander *expander); + bool validate(Utils::MacroExpander *expander, QString *message) override; + void initializeData(Utils::MacroExpander *expander) override; QStringList m_itemList; QStringList m_itemDataList; QVariantList m_itemConditionList; - int m_index; - int m_disabledIndex; + int m_index = -1; + int m_disabledIndex = -1; - mutable int m_savedIndex; + mutable int m_savedIndex = -1; }; } // namespace ProjectExplorer - -#endif // JSONFIELDPAGE_P_H diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfilepage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfilepage.cpp index cbaf11d8b9..865ee82865 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfilepage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonfilepage.cpp @@ -32,13 +32,12 @@ namespace ProjectExplorer { -JsonFilePage::JsonFilePage(QWidget *parent) : - Utils::FileWizardPage(parent) +JsonFilePage::JsonFilePage(QWidget *parent) : Utils::FileWizardPage(parent) { } void JsonFilePage::initializePage() { - JsonWizard *wiz = qobject_cast<JsonWizard *>(wizard()); + auto wiz = qobject_cast<JsonWizard *>(wizard()); if (!wiz) return; diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfilepage.h b/src/plugins/projectexplorer/jsonwizard/jsonfilepage.h index 9753171cec..1bdeb5b8f4 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfilepage.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonfilepage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONFILEPAGE_H -#define JSONFILEPAGE_H +#pragma once #include <utils/filewizardpage.h> @@ -36,12 +35,10 @@ class JsonFilePage : public Utils::FileWizardPage Q_OBJECT public: - JsonFilePage(QWidget *parent = 0); + JsonFilePage(QWidget *parent = nullptr); - void initializePage(); - bool validatePage(); + void initializePage() override; + bool validatePage() override; }; } // namespace ProjectExplorer - -#endif // JSONFILEPAGE_H diff --git a/src/plugins/projectexplorer/jsonwizard/jsonkitspage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonkitspage.cpp index aed65d3cce..4275f6db5d 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonkitspage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonkitspage.cpp @@ -52,7 +52,7 @@ JsonKitsPage::JsonKitsPage(QWidget *parent) : TargetSetupPage(parent) void JsonKitsPage::initializePage() { - JsonWizard *wiz = qobject_cast<JsonWizard *>(wizard()); + auto wiz = qobject_cast<JsonWizard *>(wizard()); QTC_ASSERT(wiz, return); connect(wiz, &JsonWizard::filesPolished, this, &JsonKitsPage::setupProjectFiles); @@ -72,10 +72,10 @@ void JsonKitsPage::initializePage() void JsonKitsPage::cleanupPage() { - JsonWizard *wiz = qobject_cast<JsonWizard *>(wizard()); + auto wiz = qobject_cast<JsonWizard *>(wizard()); QTC_ASSERT(wiz, return); - disconnect(wiz, &JsonWizard::allDone, this, 0); + disconnect(wiz, &JsonWizard::allDone, this, nullptr); TargetSetupPage::cleanupPage(); } @@ -102,7 +102,7 @@ void JsonKitsPage::setPreferredFeatures(const QVariant &data) void JsonKitsPage::setupProjectFiles(const JsonWizard::GeneratorFiles &files) { - Project *project = 0; + Project *project = nullptr; QList<IProjectManager *> managerList = ExtensionSystem::PluginManager::getObjects<IProjectManager>(); foreach (const JsonWizard::GeneratorFile &f, files) { @@ -122,7 +122,7 @@ void JsonKitsPage::setupProjectFiles(const JsonWizard::GeneratorFiles &files) if (setupProject(project)) project->saveSettings(); delete project; - project = 0; + project = nullptr; } } } diff --git a/src/plugins/projectexplorer/jsonwizard/jsonkitspage.h b/src/plugins/projectexplorer/jsonwizard/jsonkitspage.h index 5924310eb9..35077a2405 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonkitspage.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonkitspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONKITSPAGE_H -#define JSONKITSPAGE_H +#pragma once #include "jsonwizard.h" #include "../targetsetuppage.h" @@ -39,10 +38,10 @@ class JsonKitsPage : public TargetSetupPage Q_OBJECT public: - JsonKitsPage(QWidget *parent = 0); + JsonKitsPage(QWidget *parent = nullptr); - void initializePage(); - void cleanupPage(); + void initializePage() override; + void cleanupPage() override; void setUnexpandedProjectPath(const QString &path); QString unexpandedProjectPath() const; @@ -71,9 +70,7 @@ private: QVector<ConditionalFeature> m_preferredFeatures; QSet<Core::Id> evaluate(const QVector<ConditionalFeature> &list, const QVariant &defaultSet, - JsonWizard *wiz); + JsonWizard *wiz); }; } // namespace ProjectExplorer - -#endif // JSONKITSPAGE_H diff --git a/src/plugins/projectexplorer/jsonwizard/jsonprojectpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonprojectpage.cpp index c44ce5d2db..b23b000d30 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonprojectpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonprojectpage.cpp @@ -35,13 +35,12 @@ namespace ProjectExplorer { -JsonProjectPage::JsonProjectPage(QWidget *parent) : - Utils::ProjectIntroPage(parent) +JsonProjectPage::JsonProjectPage(QWidget *parent) : Utils::ProjectIntroPage(parent) { } void JsonProjectPage::initializePage() { - JsonWizard *wiz = qobject_cast<JsonWizard *>(wizard()); + auto wiz = qobject_cast<JsonWizard *>(wizard()); QTC_ASSERT(wiz, return); setPath(wiz->stringValue(QLatin1String("InitialPath"))); @@ -81,7 +80,6 @@ QString JsonProjectPage::uniqueProjectName(const QString &path) if (!pathDir.exists(name)) return name; } - return prefix; } } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/jsonwizard/jsonprojectpage.h b/src/plugins/projectexplorer/jsonwizard/jsonprojectpage.h index 8a7e3d9c90..b362b98894 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonprojectpage.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonprojectpage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONPROJECTPAGE_H -#define JSONPROJECTPAGE_H +#pragma once #include <utils/projectintropage.h> @@ -36,14 +35,12 @@ class JsonProjectPage : public Utils::ProjectIntroPage Q_OBJECT public: - JsonProjectPage(QWidget *parent = 0); + JsonProjectPage(QWidget *parent = nullptr); - void initializePage(); - bool validatePage(); + void initializePage() override; + bool validatePage() override; static QString uniqueProjectName(const QString &path); }; } // namespace ProjectExplorer - -#endif // JSONPROJECTPAGE_H diff --git a/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp index 6fee29f61a..909f690b22 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp @@ -80,7 +80,7 @@ static IWizardFactory::WizardKind wizardKind(JsonWizard *wiz) JsonSummaryPage::JsonSummaryPage(QWidget *parent) : Internal::ProjectWizardPage(parent), - m_wizard(0) + m_wizard(nullptr) { connect(this, &Internal::ProjectWizardPage::projectNodeChanged, this, &JsonSummaryPage::summarySettingsHaveChanged); @@ -96,6 +96,7 @@ void JsonSummaryPage::setHideProjectUiValue(const QVariant &hideProjectUiValue) void JsonSummaryPage::initializePage() { m_wizard = qobject_cast<JsonWizard *>(wizard()); + QTC_ASSERT(m_wizard, return); m_wizard->setValue(QLatin1String(KEY_SELECTED_PROJECT), QVariant()); m_wizard->setValue(QLatin1String(KEY_SELECTED_NODE), QVariant()); @@ -147,7 +148,7 @@ bool JsonSummaryPage::validatePage() void JsonSummaryPage::cleanupPage() { - disconnect(m_wizard, &JsonWizard::filesReady, this, 0); + disconnect(m_wizard, &JsonWizard::filesReady, this, nullptr); } void JsonSummaryPage::triggerCommit(const JsonWizard::GeneratorFiles &files) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.h b/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.h index 09e0677537..6ea9598bb3 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONSUMMARYPAGE_H -#define JSONSUMMARYPAGE_H +#pragma once #include "../projectwizardpage.h" #include "jsonwizard.h" @@ -41,12 +40,12 @@ class JsonSummaryPage : public Internal::ProjectWizardPage Q_OBJECT public: - JsonSummaryPage(QWidget *parent = 0); + JsonSummaryPage(QWidget *parent = nullptr); void setHideProjectUiValue(const QVariant &hideProjectUiValue); - void initializePage(); - bool validatePage(); - void cleanupPage(); + void initializePage() override; + bool validatePage() override; + void cleanupPage() override; public slots: void triggerCommit(const JsonWizard::GeneratorFiles &files); @@ -63,5 +62,3 @@ private: }; } // namespace ProjectExplorer - -#endif // JSONSUMMARYPAGE_H diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp index d95b4e1802..3c2a247e9a 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp @@ -44,8 +44,7 @@ namespace ProjectExplorer { -JsonWizard::JsonWizard(QWidget *parent) : - Utils::Wizard(parent) +JsonWizard::JsonWizard(QWidget *parent) : Utils::Wizard(parent) { setMinimumSize(800, 500); m_expander.registerExtraResolver([this](const QString &name, QString *ret) -> bool { @@ -298,7 +297,7 @@ void JsonWizard::reject() void JsonWizard::handleNewPages(int pageId) { - Utils::WizardPage *wp = qobject_cast<Utils::WizardPage *>(page(pageId)); + auto wp = qobject_cast<Utils::WizardPage *>(page(pageId)); if (!wp) return; diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizard.h b/src/plugins/projectexplorer/jsonwizard/jsonwizard.h index c550e4008a..d571f9cab7 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizard.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONWIZARD_H -#define JSONWIZARD_H +#pragma once #include "../projectexplorer_export.h" @@ -47,7 +46,7 @@ class PROJECTEXPLORER_EXPORT JsonWizard : public Utils::Wizard public: class GeneratorFile { public: - GeneratorFile() : generator(0) { } + GeneratorFile() : generator(nullptr) { } GeneratorFile(const Core::GeneratedFile &f, JsonWizardGenerator *g) : file(f), generator(g) { } @@ -60,8 +59,8 @@ public: typedef QList<GeneratorFile> GeneratorFiles; Q_PROPERTY(GeneratorFiles generateFileList READ generateFileList) - explicit JsonWizard(QWidget *parent = 0); - ~JsonWizard(); + explicit JsonWizard(QWidget *parent = nullptr); + ~JsonWizard() override; void addGenerator(JsonWizardGenerator *gen); @@ -129,5 +128,3 @@ private: }; } // namespace ProjectExplorer - -#endif // JSONWIZARD_H diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp index 8e5b279937..7856a08b28 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp @@ -308,7 +308,7 @@ JsonWizardFactory *JsonWizardFactory::createWizardFactory(const QVariantMap &dat JsonWizardFactory *factory = new JsonWizardFactory; if (!factory->initialize(data, baseDir, errorMessage)) { delete factory; - factory = 0; + factory = nullptr; } return factory; } @@ -350,9 +350,6 @@ void JsonWizardFactory::registerGeneratorFactory(JsonWizardGeneratorFactory *fac s_generatorFactories.append(factory); } -JsonWizardFactory::~JsonWizardFactory() -{ } - Utils::Wizard *JsonWizardFactory::runWizardImpl(const QString &path, QWidget *parent, Core::Id platform, const QVariantMap &variables) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.h b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.h index 949f371fd5..3722f10318 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONWIZARDFACTORY_H -#define JSONWIZARDFACTORY_H +#pragma once #include "../projectexplorer_export.h" @@ -82,8 +81,6 @@ public: static void registerPageFactory(JsonWizardPageFactory *factory); static void registerGeneratorFactory(JsonWizardGeneratorFactory *factory); - ~JsonWizardFactory(); - static QList<QVariant> objectOrList(const QVariant &data, QString *errorMessage); static QString localizedString(const QVariant &value); @@ -123,5 +120,3 @@ private: }; } //namespace ProjectExplorer - -#endif // JSONWIZARDFACTORY_H diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.h b/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.h index cf0a25b60a..52bee65d6e 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONWIZARDFILEGENERATOR_H -#define JSONWIZARDFILEGENERATOR_H +#pragma once #include "jsonwizardgeneratorfactory.h" @@ -41,9 +40,9 @@ public: Core::GeneratedFiles fileList(Utils::MacroExpander *expander, const QString &wizardDir, const QString &projectDir, - QString *errorMessage); + QString *errorMessage) override; - bool writeFile(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage); + bool writeFile(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage) override; private: class File { @@ -61,12 +60,10 @@ private: }; Core::GeneratedFile generateFile(const File &file, Utils::MacroExpander *expander, - QString *errorMessage); + QString *errorMessage); QList<File> m_fileList; }; } // namespace Internal } // namespace ProjectExplorer - -#endif // JSONWIZARDFILEGENERATOR_H diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp index 7f45ddf47e..79b29c8f7c 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp @@ -92,10 +92,10 @@ bool JsonWizardGenerator::formatFile(const JsonWizard *wizard, GeneratedFile *fi if (!languageId.isValid()) return true; // don't modify files like *.ui, *.pro - Project *baseProject = qobject_cast<Project *>(wizard->property("SelectedProject").value<QObject *>()); + auto baseProject = qobject_cast<Project *>(wizard->property("SelectedProject").value<QObject *>()); ICodeStylePreferencesFactory *factory = TextEditorSettings::codeStyleFactory(languageId); - Indenter *indenter = 0; + Indenter *indenter = nullptr; if (factory) indenter = factory->createIndenter(); if (!indenter) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.h b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.h index 3e4e2ba296..04997198c8 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONWIZARDGENERATORFACTORY_H -#define JSONWIZARDGENERATORFACTORY_H +#pragma once #include "../projectexplorer_export.h" @@ -100,8 +99,8 @@ public: JsonWizardGenerator *create(Core::Id typeId, const QVariant &data, const QString &path, Core::Id platform, - const QVariantMap &variables); - bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage); + const QVariantMap &variables) override; + bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage) override; }; class ScannerGeneratorFactory : public JsonWizardGeneratorFactory @@ -113,11 +112,9 @@ public: JsonWizardGenerator *create(Core::Id typeId, const QVariant &data, const QString &path, Core::Id platform, - const QVariantMap &variables); - bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage); + const QVariantMap &variables) override; + bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage) override; }; } // namespace Internal } // namespace ProjectExplorer - -#endif // JSONWIZARDGENERATORFACTORY_H diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.h b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.h index ee676d938e..5752b3b4cb 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONWIZARDPAGEFACTORY_H -#define JSONWIZARDPAGEFACTORY_H +#pragma once #include "../projectexplorer_export.h" @@ -61,5 +60,3 @@ private: }; } // namespace ProjectExplorer - -#endif // JSONWIZARDPAGEFACTORY_H diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp index c3abd6be12..89fa6cb23b 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp @@ -63,13 +63,13 @@ Utils::WizardPage *FieldPageFactory::create(JsonWizard *wizard, Core::Id typeId, { Q_UNUSED(wizard); - QTC_ASSERT(canCreate(typeId), return 0); + QTC_ASSERT(canCreate(typeId), return nullptr); - JsonFieldPage *page = new JsonFieldPage(wizard->expander()); + auto page = new JsonFieldPage(wizard->expander()); if (!page->setup(data)) { delete page; - return 0; + return nullptr; } return page; @@ -110,10 +110,9 @@ Utils::WizardPage *FilePageFactory::create(JsonWizard *wizard, Core::Id typeId, { Q_UNUSED(wizard); Q_UNUSED(data); - QTC_ASSERT(canCreate(typeId), return 0); + QTC_ASSERT(canCreate(typeId), return nullptr); - JsonFilePage *page = new JsonFilePage; - return page; + return new JsonFilePage; } bool FilePageFactory::validateData(Core::Id typeId, const QVariant &data, QString *errorMessage) @@ -144,9 +143,9 @@ KitsPageFactory::KitsPageFactory() Utils::WizardPage *KitsPageFactory::create(JsonWizard *wizard, Core::Id typeId, const QVariant &data) { Q_UNUSED(wizard); - QTC_ASSERT(canCreate(typeId), return 0); + QTC_ASSERT(canCreate(typeId), return nullptr); - JsonKitsPage *page = new JsonKitsPage; + auto page = new JsonKitsPage; const QVariantMap dataMap = data.toMap(); page->setUnexpandedProjectPath(dataMap.value(QLatin1String(KEY_PROJECT_FILE)).toString()); page->setRequiredFeatures(dataMap.value(QLatin1String(KEY_REQUIRED_FEATURES))); @@ -205,9 +204,9 @@ Utils::WizardPage *ProjectPageFactory::create(JsonWizard *wizard, Core::Id typeI { Q_UNUSED(wizard); Q_UNUSED(data); - QTC_ASSERT(canCreate(typeId), return 0); + QTC_ASSERT(canCreate(typeId), return nullptr); - JsonProjectPage *page = new JsonProjectPage; + auto page = new JsonProjectPage; QVariantMap tmp = data.isNull() ? QVariantMap() : data.toMap(); QString description @@ -265,9 +264,9 @@ Utils::WizardPage *SummaryPageFactory::create(JsonWizard *wizard, Core::Id typeI { Q_UNUSED(wizard); Q_UNUSED(data); - QTC_ASSERT(canCreate(typeId), return 0); + QTC_ASSERT(canCreate(typeId), return nullptr); - JsonSummaryPage *page = new JsonSummaryPage; + auto page = new JsonSummaryPage; QVariant hideProjectUi = data.toMap().value(QLatin1String(KEY_HIDE_PROJECT_UI)); page->setHideProjectUiValue(hideProjectUi); return page; diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.h b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.h index 31ea597ecf..447842a889 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONWIZARDPAGEFACTORY_P_H -#define JSONWIZARDPAGEFACTORY_P_H +#pragma once #include "jsonwizardpagefactory.h" @@ -36,8 +35,8 @@ class FieldPageFactory : public JsonWizardPageFactory public: FieldPageFactory(); - Utils::WizardPage *create(JsonWizard *wizard, Core::Id typeId, const QVariant &data); - bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage); + Utils::WizardPage *create(JsonWizard *wizard, Core::Id typeId, const QVariant &data) override; + bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage) override; }; class FilePageFactory : public JsonWizardPageFactory @@ -45,8 +44,8 @@ class FilePageFactory : public JsonWizardPageFactory public: FilePageFactory(); - Utils::WizardPage *create(JsonWizard *wizard, Core::Id typeId, const QVariant &data); - bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage); + Utils::WizardPage *create(JsonWizard *wizard, Core::Id typeId, const QVariant &data) override; + bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage) override; }; class KitsPageFactory : public JsonWizardPageFactory @@ -54,8 +53,8 @@ class KitsPageFactory : public JsonWizardPageFactory public: KitsPageFactory(); - Utils::WizardPage *create(JsonWizard *wizard, Core::Id typeId, const QVariant &data); - bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage); + Utils::WizardPage *create(JsonWizard *wizard, Core::Id typeId, const QVariant &data) override; + bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage) override; }; class ProjectPageFactory : public JsonWizardPageFactory @@ -63,8 +62,8 @@ class ProjectPageFactory : public JsonWizardPageFactory public: ProjectPageFactory(); - Utils::WizardPage *create(JsonWizard *wizard, Core::Id typeId, const QVariant &data); - bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage); + Utils::WizardPage *create(JsonWizard *wizard, Core::Id typeId, const QVariant &data) override; + bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage) override; }; class SummaryPageFactory : public JsonWizardPageFactory @@ -72,11 +71,9 @@ class SummaryPageFactory : public JsonWizardPageFactory public: SummaryPageFactory(); - Utils::WizardPage *create(JsonWizard *wizard, Core::Id typeId, const QVariant &data); - bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage); + Utils::WizardPage *create(JsonWizard *wizard, Core::Id typeId, const QVariant &data) override; + bool validateData(Core::Id typeId, const QVariant &data, QString *errorMessage) override; }; } // namespace Internal } // namespace ProjectExplorer - -#endif // JSONWIZARDPAGEFACTORY_P_H diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.h b/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.h index a6e395fccb..e852ad1fe0 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardscannergenerator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef JSONWIZARDSCANNERGENERATOR_H -#define JSONWIZARDSCANNERGENERATOR_H +#pragma once #include "jsonwizardgeneratorfactory.h" @@ -43,7 +42,7 @@ public: Core::GeneratedFiles fileList(Utils::MacroExpander *expander, const QString &wizardDir, const QString &projectDir, - QString *errorMessage); + QString *errorMessage) override; private: Core::GeneratedFiles scan(const QString &dir, const QDir &base); @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace ProjectExplorer - -#endif // JSONWIZARDSCANNERGENERATOR_H diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index f05d0da8c0..30d193ce60 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -72,14 +72,7 @@ class KitPrivate public: KitPrivate(Id id, Kit *kit) : - m_id(id), - m_nestedBlockingLevel(0), - m_autodetected(false), - m_sdkProvided(false), - m_isValid(true), - m_hasWarning(false), - m_hasValidityInfo(false), - m_mustNotify(false) + m_id(id) { if (!id.isValid()) m_id = Id::fromString(QUuid::createUuid().toString()); @@ -116,13 +109,13 @@ public: QString m_fileSystemFriendlyName; QString m_autoDetectionSource; Id m_id; - int m_nestedBlockingLevel; - bool m_autodetected; - bool m_sdkProvided; - bool m_isValid; - bool m_hasWarning; - bool m_hasValidityInfo; - bool m_mustNotify; + int m_nestedBlockingLevel = 0; + bool m_autodetected = false; + bool m_sdkProvided = false; + bool m_isValid = true; + bool m_hasWarning = false; + bool m_hasValidityInfo = false; + bool m_mustNotify = false; QIcon m_icon; FileName m_iconPath; @@ -210,7 +203,7 @@ void Kit::unblockNotification() Kit *Kit::clone(bool keepName) const { - Kit *k = new Kit; + auto k = new Kit; if (keepName) k->d->m_unexpandedDisplayName = d->m_unexpandedDisplayName; else @@ -512,7 +505,7 @@ void Kit::addToEnvironment(Environment &env) const IOutputParser *Kit::createOutputParser() const { - IOutputParser *first = new OsParser; + auto first = new OsParser; QList<KitInformation *> infoList = KitManager::kitInformation(); foreach (KitInformation *ki, infoList) first->appendOutputParser(ki->createOutputParser(this)); diff --git a/src/plugins/projectexplorer/kit.h b/src/plugins/projectexplorer/kit.h index 00cb589ec4..f50c94f44f 100644 --- a/src/plugins/projectexplorer/kit.h +++ b/src/plugins/projectexplorer/kit.h @@ -42,6 +42,7 @@ namespace ProjectExplorer { class IOutputParser; namespace Internal { +class KitManagerPrivate; class KitModel; class KitPrivate; } // namespace Internal @@ -139,6 +140,7 @@ private: friend class KitInformation; friend class KitManager; + friend class Internal::KitManagerPrivate; friend class Internal::KitModel; // needed for setAutoDetected() when cloning kits }; diff --git a/src/plugins/projectexplorer/kitchooser.cpp b/src/plugins/projectexplorer/kitchooser.cpp index 50f4a527f0..c08e1303f2 100644 --- a/src/plugins/projectexplorer/kitchooser.cpp +++ b/src/plugins/projectexplorer/kitchooser.cpp @@ -51,7 +51,7 @@ KitChooser::KitChooser(QWidget *parent) : m_chooser->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); m_manageButton = new QPushButton(KitConfigWidget::msgManage(), this); - QHBoxLayout *layout = new QHBoxLayout(this); + auto layout = new QHBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(m_chooser); layout->addWidget(m_manageButton); @@ -116,7 +116,7 @@ Kit *KitChooser::currentKit() const { const int index = m_chooser->currentIndex(); Core::ICore::settings()->setValue(QLatin1String(lastKitKey), index); - return index == -1 ? 0 : kitAt(index); + return index == -1 ? nullptr : kitAt(index); } void KitChooser::setCurrentKitId(Core::Id id) @@ -143,7 +143,7 @@ void KitChooser::setKitMatcher(const KitChooser::KitMatcher &matcher) Kit *KitChooser::kitAt(int index) const { - Core::Id id = qvariant_cast<Core::Id>(m_chooser->itemData(index)); + auto id = qvariant_cast<Core::Id>(m_chooser->itemData(index)); return KitManager::find(id); } diff --git a/src/plugins/projectexplorer/kitchooser.h b/src/plugins/projectexplorer/kitchooser.h index 95269a3daa..5bd3561844 100644 --- a/src/plugins/projectexplorer/kitchooser.h +++ b/src/plugins/projectexplorer/kitchooser.h @@ -48,7 +48,7 @@ class PROJECTEXPLORER_EXPORT KitChooser : public QWidget Q_OBJECT public: - explicit KitChooser(QWidget *parent = 0); + explicit KitChooser(QWidget *parent = nullptr); void setCurrentKitId(Core::Id id); Core::Id currentKitId() const; diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index d2d9fece2e..7ecb304bc7 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -41,6 +41,7 @@ #include <utils/macroexpander.h> #include <utils/qtcassert.h> +#include <QDir> #include <QFileInfo> namespace ProjectExplorer { @@ -66,9 +67,20 @@ QList<Task> SysRootKitInformation::validate(const Kit *k) const { QList<Task> result; const Utils::FileName dir = SysRootKitInformation::sysRoot(k); - if (!dir.toFileInfo().isDir() && SysRootKitInformation::hasSysRoot(k)) { + if (dir.isEmpty()) + return result; + + const QFileInfo fi = dir.toFileInfo(); + + if (!fi.exists()) { + result << Task(Task::Error, tr("Sys Root \"%1\" does not exist in the file system.").arg(dir.toUserOutput()), + Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); + } else if (!fi.isDir()) { result << Task(Task::Error, tr("Sys Root \"%1\" is not a directory.").arg(dir.toUserOutput()), Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); + } else if (QDir(dir.toString()).entryList(QDir::AllEntries | QDir::NoDotAndDotDot).isEmpty()) { + result << Task(Task::Error, tr("Sys Root \"%1\" is empty.").arg(dir.toUserOutput()), + Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); } return result; } @@ -83,6 +95,13 @@ KitInformation::ItemList SysRootKitInformation::toUserOutput(const Kit *k) const return ItemList() << qMakePair(tr("Sys Root"), sysRoot(k).toUserOutput()); } +void SysRootKitInformation::addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const +{ + expander->registerFileVariables("SysRoot", tr("Sys Root"), [this, kit]() -> QString { + return SysRootKitInformation::sysRoot(kit).toString(); + }); +} + Core::Id SysRootKitInformation::id() { return "PE.Profile.SysRoot"; diff --git a/src/plugins/projectexplorer/kitinformation.h b/src/plugins/projectexplorer/kitinformation.h index ca49e57ad3..49054fcfb0 100644 --- a/src/plugins/projectexplorer/kitinformation.h +++ b/src/plugins/projectexplorer/kitinformation.h @@ -56,6 +56,7 @@ public: KitConfigWidget *createConfigWidget(Kit *k) const override; ItemList toUserOutput(const Kit *k) const override; + void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override; static Core::Id id(); static bool hasSysRoot(const Kit *k); diff --git a/src/plugins/projectexplorer/kitinformationconfigwidget.cpp b/src/plugins/projectexplorer/kitinformationconfigwidget.cpp index a4ef73a5fc..b57bf86b25 100644 --- a/src/plugins/projectexplorer/kitinformationconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitinformationconfigwidget.cpp @@ -430,13 +430,13 @@ void KitEnvironmentConfigWidget::editEnvironmentChanges() m_dialog = new QDialog(m_summaryLabel); m_dialog->setWindowTitle(tr("Edit Environment Changes")); - QVBoxLayout *layout = new QVBoxLayout(m_dialog); + auto layout = new QVBoxLayout(m_dialog); m_editor = new QPlainTextEdit; m_editor->setToolTip(tr("Enter one variable per line with the variable name " "separated from the variable value by \"=\".<br>" "Environment variables can be referenced with ${OTHER}.")); - QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Apply|QDialogButtonBox::Cancel); + auto buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Apply|QDialogButtonBox::Cancel); layout->addWidget(m_editor); layout->addWidget(buttons); @@ -462,8 +462,8 @@ void KitEnvironmentConfigWidget::applyChanges() void KitEnvironmentConfigWidget::closeChangesDialog() { m_dialog->deleteLater(); - m_dialog = 0; - m_editor = 0; + m_dialog = nullptr; + m_editor = nullptr; } void KitEnvironmentConfigWidget::acceptChangesDialog() diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index aa05440e0a..236058ea71 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -71,22 +71,19 @@ static FileName settingsFileName() class KitManagerPrivate { public: - KitManagerPrivate(); ~KitManagerPrivate(); - Kit *m_defaultKit; - bool m_initialized; + Kit *m_defaultKit = nullptr; + bool m_initialized = false; QList<KitInformation *> m_informationList; QList<Kit *> m_kitList; - PersistentSettingsWriter *m_writer; + PersistentSettingsWriter *m_writer = nullptr; }; -KitManagerPrivate::KitManagerPrivate() : - m_defaultKit(0), m_initialized(false), m_writer(0) -{ } - KitManagerPrivate::~KitManagerPrivate() { + foreach (Kit *k, m_kitList) + delete k; qDeleteAll(m_informationList); delete m_writer; } @@ -97,8 +94,8 @@ KitManagerPrivate::~KitManagerPrivate() // KitManager: // -------------------------------------------------------------------------- -static Internal::KitManagerPrivate *d; -static KitManager *m_instance; +static Internal::KitManagerPrivate *d = nullptr; +static KitManager *m_instance = nullptr; KitManager *KitManager::instance() { @@ -230,11 +227,9 @@ void KitManager::restoreKits() KitManager::~KitManager() { - foreach (Kit *k, d->m_kitList) - delete k; - d->m_kitList.clear(); delete d; - m_instance = 0; + d = nullptr; + m_instance = nullptr; } void KitManager::saveKits() @@ -480,14 +475,7 @@ void KitManager::deregisterKit(Kit *k) return; d->m_kitList.removeOne(k); if (defaultKit() == k) { - QList<Kit *> stList = kits(); - Kit *newDefault = 0; - foreach (Kit *cur, stList) { - if (cur->isValid()) { - newDefault = cur; - break; - } - } + Kit *newDefault = Utils::findOrDefault(kits(), [](Kit *k) { return k->isValid(); }); setDefaultKit(newDefault); } emit m_instance->kitRemoved(k); diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index 3a9ccd9b5d..a34f567cf3 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -168,7 +168,7 @@ signals: void kitsLoaded(); private: - explicit KitManager(QObject *parent = 0); + explicit KitManager(QObject *parent = nullptr); // Make sure the this is only called after all // KitInformation are registered! diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index 0079d650e0..d5b4d60e87 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -60,12 +60,10 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k) : m_nameEdit(new QLineEdit), m_fileSystemFriendlyNameLineEdit(new QLineEdit), m_kit(k), - m_modifiedKit(new Kit(Core::Id(WORKING_COPY_KIT_ID))), - m_fixingKit(false), - m_hasUniqueName(true) + m_modifiedKit(new Kit(Core::Id(WORKING_COPY_KIT_ID))) { - static const Qt::Alignment alignment - = static_cast<Qt::Alignment>(style()->styleHint(QStyle::SH_FormLayoutLabelAlignment)); + static auto alignment + = static_cast<const Qt::Alignment>(style()->styleHint(QStyle::SH_FormLayoutLabelAlignment)); m_layout->addWidget(m_nameEdit, 0, WidgetColumn); m_layout->addWidget(m_iconButton, 0, ButtonColumn); @@ -86,10 +84,10 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k) : connect(m_fileSystemFriendlyNameLineEdit, &QLineEdit::textChanged, this, &KitManagerConfigWidget::setFileSystemFriendlyName); - QWidget *inner = new QWidget; + auto inner = new QWidget; inner->setLayout(m_layout); - QGridLayout *mainLayout = new QGridLayout(this); + auto mainLayout = new QGridLayout(this); mainLayout->setMargin(1); mainLayout->addWidget(inner, 0, 0); @@ -207,7 +205,7 @@ void KitManagerConfigWidget::addConfigWidget(KitConfigWidget *widget) QString name = widget->displayName(); QString toolTip = widget->toolTip(); - QAction *action = new QAction(tr("Mark as Mutable"), 0); + auto action = new QAction(tr("Mark as Mutable"), 0); action->setCheckable(true); action->setChecked(widget->isMutable()); action->setEnabled(!widget->isSticky()); @@ -225,8 +223,8 @@ void KitManagerConfigWidget::addConfigWidget(KitConfigWidget *widget) if (QWidget *button = widget->buttonWidget()) m_layout->addWidget(button, row, ButtonColumn); - static const Qt::Alignment alignment - = static_cast<Qt::Alignment>(style()->styleHint(QStyle::SH_FormLayoutLabelAlignment)); + static auto alignment + = static_cast<const Qt::Alignment>(style()->styleHint(QStyle::SH_FormLayoutLabelAlignment)); QLabel *label = createLabel(name, toolTip); m_layout->addWidget(label, row, LabelColumn, alignment); m_widgets.append(widget); @@ -365,7 +363,7 @@ void KitManagerConfigWidget::showEvent(QShowEvent *event) QLabel *KitManagerConfigWidget::createLabel(const QString &name, const QString &toolTip) { - QLabel *label = new QLabel(name); + auto label = new QLabel(name); label->setToolTip(toolTip); return label; } diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.h b/src/plugins/projectexplorer/kitmanagerconfigwidget.h index 86ae1d1a0b..2054304a5b 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.h +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.h @@ -97,9 +97,9 @@ private: QList<QLabel *> m_labels; Kit *m_kit; Kit *m_modifiedKit; - bool m_isDefaultKit; - bool m_fixingKit; - bool m_hasUniqueName; + bool m_isDefaultKit = false; + bool m_fixingKit = false; + bool m_hasUniqueName = true; QList<QAction *> m_actions; mutable QString m_cachedDisplayName; }; diff --git a/src/plugins/projectexplorer/kitmodel.cpp b/src/plugins/projectexplorer/kitmodel.cpp index 35196fcfaa..e932c53673 100644 --- a/src/plugins/projectexplorer/kitmodel.cpp +++ b/src/plugins/projectexplorer/kitmodel.cpp @@ -102,11 +102,8 @@ public: // KitModel // -------------------------------------------------------------------------- -KitModel::KitModel(QBoxLayout *parentLayout, QObject *parent) : - TreeModel(parent), - m_parentLayout(parentLayout), - m_defaultNode(0), - m_keepUnique(true) +KitModel::KitModel(QBoxLayout *parentLayout, QObject *parent) : TreeModel(parent), + m_parentLayout(parentLayout) { setHeader(QStringList(tr("Name"))); m_autoRoot = new TreeItem(QStringList(tr("Auto-detected"))); @@ -140,7 +137,7 @@ Kit *KitModel::kit(const QModelIndex &index) KitNode *KitModel::kitNode(const QModelIndex &index) { TreeItem *n = itemForIndex(index); - return n && n->level() == 2 ? static_cast<KitNode *>(n) : 0; + return (n && n->level() == 2) ? static_cast<KitNode *>(n) : nullptr; } QModelIndex KitModel::indexOf(Kit *k) const @@ -168,12 +165,12 @@ KitManagerConfigWidget *KitModel::widget(const QModelIndex &index) void KitModel::isAutoDetectedChanged() { - KitManagerConfigWidget *w = qobject_cast<KitManagerConfigWidget *>(sender()); + auto w = qobject_cast<KitManagerConfigWidget *>(sender()); int idx = -1; idx = Utils::indexOf(m_manualRoot->children(), [w](TreeItem *node) { return static_cast<KitNode *>(node)->widget == w; }); - TreeItem *oldParent = 0; + TreeItem *oldParent = nullptr; TreeItem *newParent = w->workingCopy()->isAutoDetected() ? m_autoRoot : m_manualRoot; if (idx != -1) { oldParent = m_manualRoot; @@ -284,7 +281,7 @@ KitNode *KitModel::findWorkingCopy(Kit *k) const KitNode *KitModel::createNode(Kit *k) { - KitNode *node = new KitNode(k); + auto node = new KitNode(k); m_parentLayout->addWidget(node->widget); connect(node->widget, &KitManagerConfigWidget::dirty, [this, node] { if (m_autoRoot->children().contains(node) diff --git a/src/plugins/projectexplorer/kitmodel.h b/src/plugins/projectexplorer/kitmodel.h index 545130e8ff..9ddda63169 100644 --- a/src/plugins/projectexplorer/kitmodel.h +++ b/src/plugins/projectexplorer/kitmodel.h @@ -53,7 +53,7 @@ class KitModel : public Utils::TreeModel Q_OBJECT public: - explicit KitModel(QBoxLayout *parentLayout, QObject *parent = 0); + explicit KitModel(QBoxLayout *parentLayout, QObject *parent = nullptr); Kit *kit(const QModelIndex &); KitNode *kitNode(const QModelIndex &); @@ -90,9 +90,9 @@ private: QList<KitNode *> m_toRemoveList; QBoxLayout *m_parentLayout; - KitNode *m_defaultNode; + KitNode *m_defaultNode = nullptr; - bool m_keepUnique; + bool m_keepUnique = true; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/kitoptionspage.cpp b/src/plugins/projectexplorer/kitoptionspage.cpp index 4da68df9dd..2d7d8a4c57 100644 --- a/src/plugins/projectexplorer/kitoptionspage.cpp +++ b/src/plugins/projectexplorer/kitoptionspage.cpp @@ -262,7 +262,7 @@ void KitOptionsPage::finish() { if (m_widget) { delete m_widget; - m_widget = 0; + m_widget = nullptr; } } diff --git a/src/plugins/projectexplorer/linuxiccparser.cpp b/src/plugins/projectexplorer/linuxiccparser.cpp index 4ed2e2b077..4e64f56b3c 100644 --- a/src/plugins/projectexplorer/linuxiccparser.cpp +++ b/src/plugins/projectexplorer/linuxiccparser.cpp @@ -31,8 +31,8 @@ using namespace ProjectExplorer; -LinuxIccParser::LinuxIccParser() - : m_expectFirstLine(true), m_indent(0), m_temporary(Task()) +LinuxIccParser::LinuxIccParser() : + m_temporary(Task()) { setObjectName(QLatin1String("LinuxIccParser")); // main.cpp(53): error #308: function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible diff --git a/src/plugins/projectexplorer/linuxiccparser.h b/src/plugins/projectexplorer/linuxiccparser.h index 866e5cfb5d..bfb57d850c 100644 --- a/src/plugins/projectexplorer/linuxiccparser.h +++ b/src/plugins/projectexplorer/linuxiccparser.h @@ -49,8 +49,8 @@ private: QRegExp m_caretLine; QRegExp m_pchInfoLine; - bool m_expectFirstLine; - int m_indent; + bool m_expectFirstLine = true; + int m_indent = 0; Task m_temporary; int m_lines = 0; }; diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.cpp b/src/plugins/projectexplorer/localapplicationruncontrol.cpp index 2e99c51b18..35a6c2c9e9 100644 --- a/src/plugins/projectexplorer/localapplicationruncontrol.cpp +++ b/src/plugins/projectexplorer/localapplicationruncontrol.cpp @@ -131,8 +131,8 @@ void LocalApplicationRunControl::processExited(int exitCode, QProcess::ExitStatu static bool isLocal(RunConfiguration *runConfiguration) { - Target *target = runConfiguration ? runConfiguration->target() : 0; - Kit *kit = target ? target->kit() : 0; + Target *target = runConfiguration ? runConfiguration->target() : nullptr; + Kit *kit = target ? target->kit() : nullptr; return DeviceTypeKitInformation::deviceTypeId(kit) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE; } diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.h b/src/plugins/projectexplorer/localapplicationruncontrol.h index c4703d7132..940a5586ca 100644 --- a/src/plugins/projectexplorer/localapplicationruncontrol.h +++ b/src/plugins/projectexplorer/localapplicationruncontrol.h @@ -35,7 +35,7 @@ class LocalApplicationRunControlFactory : public IRunControlFactory Q_OBJECT public: bool canRun(RunConfiguration *runConfiguration, Core::Id mode) const override; - RunControl* create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage) override; + RunControl *create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage) override; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 98f207e737..f4bef00484 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -166,8 +166,7 @@ void TargetSelectorDelegate::paint(QPainter *painter, //////// // ListWidget //////// -ListWidget::ListWidget(QWidget *parent) - : QListWidget(parent), m_maxCount(0), m_optimalWidth(0) +ListWidget::ListWidget(QWidget *parent) : QListWidget(parent) { setFocusPolicy(Qt::NoFocus); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -251,7 +250,7 @@ QListWidgetItem *ProjectListWidget::itemForProject(Project *project) if (currentItem->data(Qt::UserRole).value<Project*>() == project) return currentItem; } - return 0; + return nullptr; } QString ProjectListWidget::fullName(Project *project) @@ -264,7 +263,7 @@ void ProjectListWidget::addProject(Project *project) m_ignoreIndexChange = true; int pos = count(); - for (int i=0; i < count(); ++i) { + for (int i = 0; i < count(); ++i) { Project *p = item(i)->data(Qt::UserRole).value<Project*>(); if (projectLesserThan(project, p)) { pos = i; @@ -488,7 +487,7 @@ void GenericListWidget::rowChanged(int index) void GenericListWidget::displayNameChanged() { m_ignoreIndexChange = true; - ProjectConfiguration *activeProjectConfiguration = 0; + ProjectConfiguration *activeProjectConfiguration = nullptr; if (currentItem()) activeProjectConfiguration = currentItem()->data(Qt::UserRole).value<ProjectConfiguration *>(); @@ -536,7 +535,7 @@ QListWidgetItem *GenericListWidget::itemForProjectConfiguration(ProjectConfigura if (lwi->data(Qt::UserRole).value<ProjectConfiguration *>() == pc) return lwi; } - return 0; + return nullptr; } ///////// @@ -544,7 +543,7 @@ QListWidgetItem *GenericListWidget::itemForProjectConfiguration(ProjectConfigura ///////// KitAreaWidget::KitAreaWidget(QWidget *parent) : QWidget(parent), - m_layout(new QGridLayout(this)), m_kit(0) + m_layout(new QGridLayout(this)) { m_layout->setMargin(3); setAutoFillBackground(true); @@ -553,7 +552,7 @@ KitAreaWidget::KitAreaWidget(QWidget *parent) : QWidget(parent), KitAreaWidget::~KitAreaWidget() { - setKit(0); + setKit(nullptr); } void KitAreaWidget::setKit(Kit *k) @@ -644,13 +643,8 @@ QWidget *MiniProjectTargetSelector::createTitleLabel(const QString &text) } MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorAction, QWidget *parent) : - QWidget(parent), m_projectAction(targetSelectorAction), - m_project(0), - m_target(0), - m_buildConfiguration(0), - m_deployConfiguration(0), - m_runConfiguration(0), - m_hideOnRelease(false) + QWidget(parent), + m_projectAction(targetSelectorAction) { QPalette p; p.setColor(QPalette::Foreground, creatorTheme()->color(Theme::MiniProjectTargetSelectorTextColor)); @@ -958,7 +952,7 @@ void MiniProjectTargetSelector::doLayout(bool keepSize) setFixedSize(m_summaryLabel->width() + 1, heightWithoutKitArea + kitAreaHeight); //1 extra pixel for the border } - QPoint moveTo = statusBar->mapToGlobal(QPoint(0,0)); + QPoint moveTo = statusBar->mapToGlobal(QPoint(0, 0)); moveTo -= QPoint(0, height()); move(moveTo); } @@ -1253,7 +1247,7 @@ void MiniProjectTargetSelector::changeStartupProject(Project *project) this, &MiniProjectTargetSelector::activeTargetChanged); activeTargetChanged(m_project->activeTarget()); } else { - activeTargetChanged(0); + activeTargetChanged(nullptr); } if (project) { @@ -1262,7 +1256,7 @@ void MiniProjectTargetSelector::changeStartupProject(Project *project) list.append(t); m_listWidgets[TARGET]->setProjectConfigurations(list, project->activeTarget()); } else { - m_listWidgets[TARGET]->setProjectConfigurations(QList<ProjectConfiguration *>(), 0); + m_listWidgets[TARGET]->setProjectConfigurations(QList<ProjectConfiguration *>(), nullptr); } updateActionAndSummary(); @@ -1287,7 +1281,7 @@ void MiniProjectTargetSelector::activeTargetChanged(Target *target) m_target = target; - m_kitAreaWidget->setKit(m_target ? m_target->kit() : 0); + m_kitAreaWidget->setKit(m_target ? m_target->kit() : nullptr); m_listWidgets[TARGET]->setActiveProjectConfiguration(m_target); @@ -1344,12 +1338,12 @@ void MiniProjectTargetSelector::activeTargetChanged(Target *target) connect(m_target, &Target::activeRunConfigurationChanged, this, &MiniProjectTargetSelector::activeRunConfigurationChanged); } else { - m_listWidgets[BUILD]->setProjectConfigurations(QList<ProjectConfiguration *>(), 0); - m_listWidgets[DEPLOY]->setProjectConfigurations(QList<ProjectConfiguration *>(), 0); - m_listWidgets[RUN]->setProjectConfigurations(QList<ProjectConfiguration *>(), 0); - m_buildConfiguration = 0; - m_deployConfiguration = 0; - m_runConfiguration = 0; + m_listWidgets[BUILD]->setProjectConfigurations(QList<ProjectConfiguration *>(), nullptr); + m_listWidgets[DEPLOY]->setProjectConfigurations(QList<ProjectConfiguration *>(), nullptr); + m_listWidgets[RUN]->setProjectConfigurations(QList<ProjectConfiguration *>(), nullptr); + m_buildConfiguration = nullptr; + m_deployConfiguration = nullptr; + m_runConfiguration = nullptr; } updateActionAndSummary(); } diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.h b/src/plugins/projectexplorer/miniprojecttargetselector.h index e099a075ea..9dd2e8fe57 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.h +++ b/src/plugins/projectexplorer/miniprojecttargetselector.h @@ -65,8 +65,8 @@ public: int padding(); private: - int m_maxCount; - int m_optimalWidth; + int m_maxCount = 0; + int m_optimalWidth = 0; }; class ProjectListWidget : public ListWidget @@ -74,7 +74,7 @@ class ProjectListWidget : public ListWidget Q_OBJECT public: - explicit ProjectListWidget(QWidget *parent = 0); + explicit ProjectListWidget(QWidget *parent = nullptr); private: void addProject(ProjectExplorer::Project *project); @@ -91,7 +91,7 @@ class KitAreaWidget : public QWidget { Q_OBJECT public: - explicit KitAreaWidget(QWidget *parent = 0); + explicit KitAreaWidget(QWidget *parent = nullptr); ~KitAreaWidget() override; void setKit(ProjectExplorer::Kit *k); @@ -100,7 +100,7 @@ private: void updateKit(ProjectExplorer::Kit *k); QGridLayout *m_layout; - Kit *m_kit; + Kit *m_kit = nullptr; QList<KitConfigWidget *> m_widgets; QList<QLabel *> m_labels; }; @@ -110,7 +110,7 @@ class GenericListWidget : public ListWidget Q_OBJECT public: - explicit GenericListWidget(QWidget *parent = 0); + explicit GenericListWidget(QWidget *parent = nullptr); signals: void changeActiveProjectConfiguration(ProjectExplorer::ProjectConfiguration *dc); @@ -134,7 +134,7 @@ class MiniProjectTargetSelector : public QWidget Q_OBJECT public: - explicit MiniProjectTargetSelector(QAction *projectAction, QWidget *parent = 0); + explicit MiniProjectTargetSelector(QAction *projectAction, QWidget *parent = nullptr); void setVisible(bool visible) override; void keyPressEvent(QKeyEvent *ke) override; @@ -202,12 +202,12 @@ private: QVector<QWidget *> m_titleWidgets; QLabel *m_summaryLabel; - Project *m_project; - Target *m_target; - BuildConfiguration *m_buildConfiguration; - DeployConfiguration *m_deployConfiguration; - RunConfiguration *m_runConfiguration; - bool m_hideOnRelease; + Project *m_project = nullptr; + Target *m_target = nullptr; + BuildConfiguration *m_buildConfiguration = nullptr; + DeployConfiguration *m_deployConfiguration = nullptr; + RunConfiguration *m_runConfiguration = nullptr; + bool m_hideOnRelease = false; QDateTime m_earliestHidetime; }; diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 61e1ba4636..696502117f 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -61,6 +61,8 @@ static QString platformName(MsvcToolChain::Platform t) switch (t) { case MsvcToolChain::x86: return QLatin1String("x86"); + case MsvcToolChain::amd64_x86: + return QLatin1String("amd64_x86"); case MsvcToolChain::amd64: return QLatin1String("amd64"); case MsvcToolChain::x86_amd64: @@ -83,7 +85,8 @@ static bool hostSupportsPlatform(MsvcToolChain::Platform platform) { switch (Utils::HostOsInfo::hostArchitecture()) { case Utils::HostOsInfo::HostArchitectureAMD64: - if (platform == MsvcToolChain::amd64 || platform == MsvcToolChain::amd64_arm) + if (platform == MsvcToolChain::amd64 || platform == MsvcToolChain::amd64_arm + || platform == MsvcToolChain::amd64_x86) return true; // fall through (all x86 toolchains are also working on an amd64 host) case Utils::HostOsInfo::HostArchitectureX86: @@ -107,6 +110,7 @@ static Abi findAbiOfMsvc(MsvcToolChain::Type type, MsvcToolChain::Platform platf switch (platform) { case MsvcToolChain::x86: + case MsvcToolChain::amd64_x86: wordWidth = 32; break; case MsvcToolChain::ia64: @@ -340,14 +344,12 @@ Utils::Environment MsvcToolChain::readEnvironmentSetting(Utils::Environment& env MsvcToolChain::MsvcToolChain(const QString &name, const Abi &abi, const QString &varsBat, const QString &varsBatArg, Detection d) : MsvcToolChain(Constants::MSVC_TOOLCHAIN_TYPEID, name, abi, varsBat, varsBatArg, d) -{ -} +{ } MsvcToolChain::MsvcToolChain(Core::Id typeId, const QString &name, const Abi &abi, const QString &varsBat, const QString &varsBatArg, - Detection d) - : AbstractMsvcToolChain(typeId, d, abi, varsBat) - , m_varsBatArg(varsBatArg) + Detection d) : AbstractMsvcToolChain(typeId, d, abi, varsBat), + m_varsBatArg(varsBatArg) { Q_ASSERT(!name.isEmpty()); @@ -364,12 +366,10 @@ bool MsvcToolChain::isValid() const MsvcToolChain::MsvcToolChain(Core::Id typeId) : AbstractMsvcToolChain(typeId, ManualDetection) -{ -} +{ } MsvcToolChain::MsvcToolChain() : MsvcToolChain(Constants::MSVC_TOOLCHAIN_TYPEID) -{ -} +{ } QString MsvcToolChain::typeDisplayName() const { @@ -452,10 +452,10 @@ ToolChain *MsvcToolChain::clone() const // call setFromMsvcToolChain(). // -------------------------------------------------------------------------- -MsvcBasedToolChainConfigWidget::MsvcBasedToolChainConfigWidget(ToolChain *tc) - : ToolChainConfigWidget(tc) - , m_nameDisplayLabel(new QLabel(this)) - , m_varsBatDisplayLabel(new QLabel(this)) +MsvcBasedToolChainConfigWidget::MsvcBasedToolChainConfigWidget(ToolChain *tc) : + ToolChainConfigWidget(tc), + m_nameDisplayLabel(new QLabel(this)), + m_varsBatDisplayLabel(new QLabel(this)) { m_nameDisplayLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); m_mainLayout->addRow(m_nameDisplayLabel); @@ -630,6 +630,8 @@ QString MsvcToolChainFactory::vcVarsBatFor(const QString &basePath, const QStrin return basePath + QLatin1String("/bin/ia64/vcvars64.bat"); if (toolchainName == QLatin1String("x86_ia64")) return basePath + QLatin1String("/bin/x86_ia64/vcvarsx86_ia64.bat"); + if (toolchainName == QLatin1String("amd64_x86")) + return basePath + QLatin1String("/bin/amd64_x86/vcvarsamd64_x86.bat"); return QString(); } @@ -809,7 +811,7 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect(const QList<ToolChain *> &al // x86_arm was put before amd64_arm as a workaround for auto detected windows phone // toolchains. As soon as windows phone builds support x64 cross builds, this change // can be reverted. - platforms << MsvcToolChain::x86 + platforms << MsvcToolChain::x86 << MsvcToolChain::amd64_x86 << MsvcToolChain::amd64 << MsvcToolChain::x86_amd64 << MsvcToolChain::arm << MsvcToolChain::x86_arm << MsvcToolChain::amd64_arm << MsvcToolChain::ia64 << MsvcToolChain::x86_ia64; @@ -853,7 +855,7 @@ bool MsvcToolChainFactory::canRestore(const QVariantMap &data) template <class ToolChainType> ToolChainType *readFromMap(const QVariantMap &data) { - ToolChainType *result = new ToolChainType; + auto result = new ToolChainType; if (result->fromMap(data)) return result; delete result; diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index 05be7831df..12cc614a8f 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -49,7 +49,8 @@ public: x86_ia64, arm, x86_arm, - amd64_arm + amd64_arm, + amd64_x86 }; explicit MsvcToolChain(const QString &name, const Abi &abi, diff --git a/src/plugins/projectexplorer/namedwidget.h b/src/plugins/projectexplorer/namedwidget.h index d11d439ef0..26c9550f7e 100644 --- a/src/plugins/projectexplorer/namedwidget.h +++ b/src/plugins/projectexplorer/namedwidget.h @@ -36,7 +36,7 @@ class PROJECTEXPLORER_EXPORT NamedWidget : public QWidget Q_OBJECT public: - explicit NamedWidget(QWidget *parent = 0); + explicit NamedWidget(QWidget *parent = nullptr); QString displayName() const; diff --git a/src/plugins/projectexplorer/nodesvisitor.h b/src/plugins/projectexplorer/nodesvisitor.h index 957e9f4131..641be9025a 100644 --- a/src/plugins/projectexplorer/nodesvisitor.h +++ b/src/plugins/projectexplorer/nodesvisitor.h @@ -43,9 +43,9 @@ class PROJECTEXPLORER_EXPORT NodesVisitor { public: virtual ~NodesVisitor(); - virtual void visitSessionNode(SessionNode *) {} - virtual void visitProjectNode(ProjectNode *) {} - virtual void visitFolderNode(FolderNode *) {} + virtual void visitSessionNode(SessionNode *) { } + virtual void visitProjectNode(ProjectNode *) { } + virtual void visitFolderNode(FolderNode *) { } protected: NodesVisitor() {} @@ -65,7 +65,7 @@ public: private: Utils::FileName m_path; - QList<Node*> m_nodes; + QList<Node *> m_nodes; }; class PROJECTEXPLORER_EXPORT FindAllFilesVisitor : public NodesVisitor { diff --git a/src/plugins/projectexplorer/osparser.cpp b/src/plugins/projectexplorer/osparser.cpp index 8deecf5f16..acd4d3d633 100644 --- a/src/plugins/projectexplorer/osparser.cpp +++ b/src/plugins/projectexplorer/osparser.cpp @@ -31,8 +31,7 @@ using namespace ProjectExplorer; -OsParser::OsParser() : - m_hasFatalError(false) +OsParser::OsParser() { setObjectName(QLatin1String("OsParser")); } diff --git a/src/plugins/projectexplorer/osparser.h b/src/plugins/projectexplorer/osparser.h index 40fc67d275..a053a65a73 100644 --- a/src/plugins/projectexplorer/osparser.h +++ b/src/plugins/projectexplorer/osparser.h @@ -46,7 +46,7 @@ public: bool hasFatalErrors() const override; private: - bool m_hasFatalError; + bool m_hasFatalError = false; }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/panelswidget.cpp b/src/plugins/projectexplorer/panelswidget.cpp index 01a68ee47a..ee587f889f 100644 --- a/src/plugins/projectexplorer/panelswidget.cpp +++ b/src/plugins/projectexplorer/panelswidget.cpp @@ -123,7 +123,7 @@ PanelsWidget::PanelsWidget(QWidget *parent) : m_root->setPalette(pal); // The layout holding the individual panels: - QVBoxLayout *topLayout = new QVBoxLayout(m_root); + auto topLayout = new QVBoxLayout(m_root); topLayout->setMargin(0); topLayout->setSpacing(0); @@ -165,14 +165,14 @@ void PanelsWidget::addPropertiesPanel(PropertiesPanel *panel) // icon: if (!panel->icon().isNull()) { - QLabel *iconLabel = new QLabel(m_root); + auto iconLabel = new QLabel(m_root); iconLabel->setPixmap(panel->icon().pixmap(ICON_SIZE, ICON_SIZE)); iconLabel->setContentsMargins(0, ABOVE_HEADING_MARGIN, 0, 0); m_layout->addWidget(iconLabel, headerRow, 0, 3, 1, Qt::AlignTop | Qt::AlignHCenter); } // name: - QLabel *nameLabel = new QLabel(m_root); + auto nameLabel = new QLabel(m_root); nameLabel->setText(panel->displayName()); QPalette palette = nameLabel->palette(); for (int i = QPalette::Active; i < QPalette::NColorGroups; ++i ) { @@ -191,7 +191,7 @@ void PanelsWidget::addPropertiesPanel(PropertiesPanel *panel) // line: const int lineRow(headerRow + 1); - QWidget *line = new OnePixelBlackLine(m_root); + auto line = new OnePixelBlackLine(m_root); m_layout->addWidget(line, lineRow, 1, 1, -1, Qt::AlignTop); // add the widget: diff --git a/src/plugins/projectexplorer/panelswidget.h b/src/plugins/projectexplorer/panelswidget.h index 067cfc5811..aae2d80ce3 100644 --- a/src/plugins/projectexplorer/panelswidget.h +++ b/src/plugins/projectexplorer/panelswidget.h @@ -40,7 +40,7 @@ class PROJECTEXPLORER_EXPORT PanelsWidget : public QScrollArea { Q_OBJECT public: - explicit PanelsWidget(QWidget *parent = 0); + explicit PanelsWidget(QWidget *parent = nullptr); ~PanelsWidget() override; // Adds a widget diff --git a/src/plugins/projectexplorer/pluginfilefactory.h b/src/plugins/projectexplorer/pluginfilefactory.h index 7440106ded..725b1f8a9c 100644 --- a/src/plugins/projectexplorer/pluginfilefactory.h +++ b/src/plugins/projectexplorer/pluginfilefactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINFILEFACTORY_H -#define PLUGINFILEFACTORY_H +#pragma once #include <coreplugin/idocumentfactory.h> @@ -54,5 +53,3 @@ private: } // namespace Internal } // namespace ProjectExplorer - -#endif // PLUGINFILEFACTORY diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index 64833b4585..a05665f42f 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -44,14 +44,12 @@ const char PROCESS_WORKINGDIRECTORY_KEY[] = "ProjectExplorer.ProcessStep.Working const char PROCESS_ARGUMENTS_KEY[] = "ProjectExplorer.ProcessStep.Arguments"; } -ProcessStep::ProcessStep(BuildStepList *bsl) : - AbstractProcessStep(bsl, Core::Id(PROCESS_STEP_ID)) +ProcessStep::ProcessStep(BuildStepList *bsl) : AbstractProcessStep(bsl, Core::Id(PROCESS_STEP_ID)) { ctor(); } -ProcessStep::ProcessStep(BuildStepList *bsl, ProcessStep *bs) : - AbstractProcessStep(bsl, bs), +ProcessStep::ProcessStep(BuildStepList *bsl, ProcessStep *bs) : AbstractProcessStep(bsl, bs), m_command(bs->m_command), m_arguments(bs->m_arguments), m_workingDirectory(bs->m_workingDirectory) @@ -165,7 +163,7 @@ bool ProcessStepFactory::canCreate(BuildStepList *parent, Core::Id id) const BuildStep *ProcessStepFactory::create(BuildStepList *parent, Core::Id id) { if (!canCreate(parent, id)) - return 0; + return nullptr; return new ProcessStep(parent); } @@ -177,7 +175,7 @@ bool ProcessStepFactory::canClone(BuildStepList *parent, BuildStep *bs) const BuildStep *ProcessStepFactory::clone(BuildStepList *parent, BuildStep *bs) { if (!canClone(parent, bs)) - return 0; + return nullptr; return new ProcessStep(parent, static_cast<ProcessStep *>(bs)); } @@ -190,13 +188,13 @@ bool ProcessStepFactory::canRestore(BuildStepList *parent, const QVariantMap &ma BuildStep *ProcessStepFactory::restore(BuildStepList *parent, const QVariantMap &map) { if (!canRestore(parent, map)) - return 0; + return nullptr; - ProcessStep *bs(new ProcessStep(parent)); + auto bs = new ProcessStep(parent); if (bs->fromMap(map)) return bs; delete bs; - return 0; + return nullptr; } QList<Core::Id> ProcessStepFactory::availableCreationIds(BuildStepList *parent) const @@ -215,8 +213,8 @@ QString ProcessStepFactory::displayNameForId(Core::Id id) const // ProcessStepConfigWidget //******* -ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step) - : m_step(step) +ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step) : + m_step(step) { m_ui.setupUi(this); m_ui.command->setExpectedKind(Utils::PathChooser::Command); diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index d20c324c39..914dfec934 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -89,16 +89,16 @@ public: ~ProjectPrivate(); Core::Id m_id; - Core::IDocument *m_document = 0; - IProjectManager *m_manager = 0; - ProjectNode *m_rootProjectNode = 0; + Core::IDocument *m_document = nullptr; + IProjectManager *m_manager = nullptr; + ProjectNode *m_rootProjectNode = nullptr; QList<Target *> m_targets; - Target *m_activeTarget = 0; + Target *m_activeTarget = nullptr; EditorConfiguration m_editorConfiguration; Core::Context m_projectContext; Core::Context m_projectLanguages; QVariantMap m_pluginSettings; - Internal::UserFileAccessor *m_accessor = 0; + Internal::UserFileAccessor *m_accessor = nullptr; KitMatcher m_requiredKitMatcher; KitMatcher m_preferredKitMatcher; @@ -108,9 +108,9 @@ public: ProjectPrivate::~ProjectPrivate() { - // Make sure our root node is 0 when deleting + // Make sure our root node is null when deleting ProjectNode *oldNode = m_rootProjectNode; - m_rootProjectNode = 0; + m_rootProjectNode = nullptr; delete oldNode; delete m_document; @@ -166,14 +166,14 @@ QString Project::makeUnique(const QString &preferredName, const QStringList &use void Project::changeEnvironment() { - Target *t = qobject_cast<Target *>(sender()); + auto t = qobject_cast<Target *>(sender()); if (t == activeTarget()) emit environmentChanged(); } void Project::changeBuildConfigurationEnabled() { - Target *t = qobject_cast<Target *>(sender()); + auto t = qobject_cast<Target *>(sender()); if (t == activeTarget()) emit buildConfigurationEnabledChanged(); } @@ -195,7 +195,7 @@ void Project::addTarget(Target *t) emit addedTarget(t); // check activeTarget: - if (activeTarget() == 0) + if (!activeTarget()) setActiveTarget(t); } @@ -208,7 +208,7 @@ bool Project::removeTarget(Target *target) if (target == activeTarget()) { if (d->m_targets.size() == 1) - SessionManager::setActiveTarget(this, 0, SetActive::Cascade); + SessionManager::setActiveTarget(this, nullptr, SetActive::Cascade); else if (d->m_targets.first() == target) SessionManager::setActiveTarget(this, d->m_targets.at(1), SetActive::Cascade); else @@ -264,19 +264,19 @@ bool Project::supportsKit(Kit *k, QString *errorMessage) const Target *Project::createTarget(Kit *k) { if (!k || target(k)) - return 0; + return nullptr; - Target *t = new Target(this, k); + auto t = new Target(this, k); if (!setupTarget(t)) { delete t; - return 0; + return nullptr; } return t; } Target *Project::cloneTarget(Target *sourceTarget, Kit *k) { - Target *newTarget = new Target(this, k); + auto newTarget = new Target(this, k); QStringList buildconfigurationError; QStringList deployconfigurationError; @@ -367,7 +367,7 @@ Target *Project::cloneTarget(Target *sourceTarget, Kit *k) .arg(k->displayName())); delete newTarget; - newTarget = 0; + newTarget = nullptr; } else if (!buildconfigurationError.isEmpty() || !deployconfigurationError.isEmpty() || ! runconfigurationError.isEmpty()) { @@ -399,7 +399,7 @@ Target *Project::cloneTarget(Target *sourceTarget, Kit *k) msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); if (msgBox.exec() != QDialog::Accepted) { delete newTarget; - newTarget = 0; + newTarget = nullptr; } } @@ -446,19 +446,19 @@ Target *Project::restoreTarget(const QVariantMap &data) if (target(id)) { qWarning("Warning: Duplicated target id found, not restoring second target with id '%s'. Continuing.", qPrintable(id.toString())); - return 0; + return nullptr; } Kit *k = KitManager::find(id); if (!k) { qWarning("Warning: No kit '%s' found. Continuing.", qPrintable(id.toString())); - return 0; + return nullptr; } - Target *t = new Target(this, k); + auto t = new Target(this, k); if (!t->fromMap(data)) { delete t; - return 0; + return nullptr; } return t; @@ -724,7 +724,7 @@ Utils::MacroExpander *Project::macroExpander() const ProjectImporter *Project::createProjectImporter() const { - return 0; + return nullptr; } KitMatcher Project::requiredKitMatcher() const @@ -749,7 +749,7 @@ void Project::setPreferredKitMatcher(const KitMatcher &matcher) void Project::onBuildDirectoryChanged() { - Target *target = qobject_cast<Target *>(sender()); + auto target = qobject_cast<Target *>(sender()); if (target && target == activeTarget()) emit buildDirectoryChanged(); } diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 7fd785279f..d407953f30 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -98,7 +98,7 @@ public: Target *activeTarget() const; Target *target(Core::Id id) const; Target *target(Kit *k) const; - virtual bool supportsKit(Kit *k, QString *errorMessage = 0) const; + virtual bool supportsKit(Kit *k, QString *errorMessage = nullptr) const; Target *createTarget(Kit *k); Target *cloneTarget(Target *sourceTarget, Kit *k); diff --git a/src/plugins/projectexplorer/projectconfiguration.cpp b/src/plugins/projectexplorer/projectconfiguration.cpp index d804828628..700fd8ec71 100644 --- a/src/plugins/projectexplorer/projectconfiguration.cpp +++ b/src/plugins/projectexplorer/projectconfiguration.cpp @@ -31,8 +31,7 @@ const char CONFIGURATION_ID_KEY[] = "ProjectExplorer.ProjectConfiguration.Id"; const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ProjectConfiguration.DisplayName"; const char DEFAULT_DISPLAY_NAME_KEY[] = "ProjectExplorer.ProjectConfiguration.DefaultDisplayName"; -ProjectConfiguration::ProjectConfiguration(QObject *parent, Core::Id id) : - QObject(parent), +ProjectConfiguration::ProjectConfiguration(QObject *parent, Core::Id id) : QObject(parent), m_id(id) { setObjectName(id.toString()); } @@ -45,9 +44,6 @@ ProjectConfiguration::ProjectConfiguration(QObject *parent, const ProjectConfigu m_displayName = tr("Clone of %1").arg(source->displayName()); } -ProjectConfiguration::~ProjectConfiguration() -{ } - Core::Id ProjectConfiguration::id() const { return m_id; diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h index 9f0103eae2..ac417d23de 100644 --- a/src/plugins/projectexplorer/projectconfiguration.h +++ b/src/plugins/projectexplorer/projectconfiguration.h @@ -44,7 +44,7 @@ class PROJECTEXPLORER_EXPORT ProjectConfiguration : public QObject public: // ctors are protected - ~ProjectConfiguration() override; + ~ProjectConfiguration() = default; Core::Id id() const; QString displayName() const; @@ -81,4 +81,3 @@ PROJECTEXPLORER_EXPORT Core::Id idFromMap(const QVariantMap &map); PROJECTEXPLORER_EXPORT QString displayNameFromMap(const QVariantMap &map); } // namespace ProjectExplorer - diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 7f16707f06..ef0857b805 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -169,19 +169,19 @@ namespace ProjectExplorer { static Target *activeTarget() { Project *project = ProjectTree::currentProject(); - return project ? project->activeTarget() : 0; + return project ? project->activeTarget() : nullptr; } static BuildConfiguration *activeBuildConfiguration() { Target *target = activeTarget(); - return target ? target->activeBuildConfiguration() : 0; + return target ? target->activeBuildConfiguration() : nullptr; } static Kit *currentKit() { Target *target = activeTarget(); - return target ? target->kit() : 0; + return target ? target->kit() : nullptr; } class ProjectExplorerPluginPrivate : public QObject @@ -189,8 +189,6 @@ class ProjectExplorerPluginPrivate : public QObject Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::ProjectExplorerPlugin) public: - ProjectExplorerPluginPrivate(); - void deploy(QList<Project *>); int queue(QList<Project *>, QList<Id> stepIds); void updateContextMenuActions(); @@ -255,6 +253,7 @@ public: void searchOnFileSystem(); void showInGraphicalShell(); void removeFile(); + void duplicateFile(); void deleteFile(); void handleRenameFile(); void handleSetStartupProject(); @@ -277,7 +276,7 @@ public: void slotUpdateRunActions(); - void currentModeChanged(Core::IMode *mode, Core::IMode *oldMode); + void currentModeChanged(Core::Id mode, Core::Id oldMode); void updateWelcomePage(); @@ -322,6 +321,7 @@ public: QAction *m_addExistingDirectoryAction; QAction *m_addNewSubprojectAction; QAction *m_removeFileAction; + QAction *m_duplicateFileAction; QAction *m_removeProjectAction; QAction *m_deleteFileAction; QAction *m_renameFileAction; @@ -348,39 +348,26 @@ public: QString m_lastOpenDirectory; QPointer<RunConfiguration> m_delayedRunConfiguration; QList<QPair<RunConfiguration *, Core::Id>> m_delayedRunConfigurationForRun; - bool m_shouldHaveRunConfiguration; - Core::Id m_runMode; QString m_projectFilterString; MiniProjectTargetSelector * m_targetSelector; ProjectExplorerSettings m_projectExplorerSettings; + bool m_shouldHaveRunConfiguration = false; + bool m_shuttingDown; + Core::Id m_runMode = Constants::NO_RUN_MODE; ProjectWelcomePage *m_welcomePage = nullptr; - IMode *m_projectsMode; + IMode *m_projectsMode = nullptr; - TaskHub *m_taskHub; - KitManager *m_kitManager; - ToolChainManager *m_toolChainManager; - bool m_shuttingDown; + TaskHub *m_taskHub = nullptr; + KitManager *m_kitManager = nullptr; + ToolChainManager *m_toolChainManager = nullptr; QStringList m_arguments; QList<ProjectPanelFactory *> m_panelFactories; #ifdef WITH_JOURNALD - JournaldWatcher *m_journalWatcher; + JournaldWatcher *m_journalWatcher = nullptr; #endif QThreadPool m_threadPool; }; -ProjectExplorerPluginPrivate::ProjectExplorerPluginPrivate() : - m_shouldHaveRunConfiguration(false), - m_runMode(Constants::NO_RUN_MODE), - m_projectsMode(0), - m_kitManager(0), - m_toolChainManager(0), - m_shuttingDown(false) -#ifdef WITH_JOURNALD - , m_journalWatcher(0) -#endif -{ -} - class ProjectsMode : public IMode { public: @@ -397,8 +384,8 @@ public: } }; -static ProjectExplorerPlugin *m_instance = 0; -static ProjectExplorerPluginPrivate *dd = 0; +static ProjectExplorerPlugin *m_instance = nullptr; +static ProjectExplorerPluginPrivate *dd = nullptr; ProjectExplorerPlugin::ProjectExplorerPlugin() { @@ -1025,6 +1012,12 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er cmd->setDefaultKeySequence(QKeySequence::Delete); mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER); + // duplicate file action + dd->m_duplicateFileAction = new QAction(tr("Duplicate File..."), this); + cmd = ActionManager::registerAction(dd->m_duplicateFileAction, Constants::DUPLICATEFILE, + projecTreeContext); + mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER); + //: Remove project from parent profile (Project explorer view); will not physically delete any files. dd->m_removeProjectAction = new QAction(tr("Remove Project..."), this); cmd = ActionManager::registerAction(dd->m_removeProjectAction, Constants::REMOVEPROJECT, @@ -1234,6 +1227,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er dd, &ProjectExplorerPluginPrivate::openTerminalHere); connect(dd->m_removeFileAction, &QAction::triggered, dd, &ProjectExplorerPluginPrivate::removeFile); + connect(dd->m_duplicateFileAction, &QAction::triggered, + dd, &ProjectExplorerPluginPrivate::duplicateFile); connect(dd->m_deleteFileAction, &QAction::triggered, dd, &ProjectExplorerPluginPrivate::deleteFile); connect(dd->m_renameFileAction, &QAction::triggered, @@ -1482,7 +1477,7 @@ void ProjectExplorerPlugin::extensionsInitialized() OpenProjectResult result = ProjectExplorerPlugin::openProject(fileName); if (!result) showOpenProjectError(result); - return 0; + return nullptr; }); Utils::MimeDatabase mdb; @@ -1532,7 +1527,7 @@ ExtensionSystem::IPlugin::ShutdownFlag ProjectExplorerPlugin::aboutToShutdown() ProjectTree::aboutToShutDown(); dd->m_proWindow->aboutToShutdown(); // disconnect from session SessionManager::closeAllProjects(); - dd->m_projectsMode = 0; + dd->m_projectsMode = nullptr; dd->m_shuttingDown = true; // Attempt to synchronously shutdown all run controls. // If that fails, fall back to asynchronous shutdown (Debugger run controls @@ -1569,8 +1564,7 @@ void ProjectExplorerPluginPrivate::showSessionManager() updateActions(); - IMode *welcomeMode = ModeManager::mode(Core::Constants::MODE_WELCOME); - if (ModeManager::currentMode() == welcomeMode) + if (ModeManager::currentMode() == Core::Constants::MODE_WELCOME) updateWelcomePage(); } @@ -1778,11 +1772,11 @@ void ProjectExplorerPluginPrivate::updateWelcomePage() m_welcomePage->reloadWelcomeScreenData(); } -void ProjectExplorerPluginPrivate::currentModeChanged(IMode *mode, IMode *oldMode) +void ProjectExplorerPluginPrivate::currentModeChanged(Id mode, Id oldMode) { - if (oldMode && oldMode->id() == Constants::MODE_SESSION) + if (oldMode == Constants::MODE_SESSION) ICore::saveSettings(); - if (mode && mode->id() == Core::Constants::MODE_WELCOME) + if (mode == Core::Constants::MODE_WELCOME) updateWelcomePage(); } @@ -2010,14 +2004,14 @@ void ProjectExplorerPluginPrivate::buildQueueFinished(bool success) if (BuildManager::tasksAvailable()) BuildManager::showTaskWindow(); } - m_delayedRunConfiguration = 0; + m_delayedRunConfiguration = nullptr; m_shouldHaveRunConfiguration = false; m_runMode = Constants::NO_RUN_MODE; } void ProjectExplorerPluginPrivate::runConfigurationConfigurationFinished() { - RunConfiguration *rc = qobject_cast<RunConfiguration *>(sender()); + auto rc = qobject_cast<RunConfiguration *>(sender()); Core::Id runMode = Constants::NO_RUN_MODE; for (int i = 0; i < m_delayedRunConfigurationForRun.size(); ++i) { if (m_delayedRunConfigurationForRun.at(i).first == rc) { @@ -2281,7 +2275,7 @@ int ProjectExplorerPluginPrivate::queue(QList<Project *> projects, QList<Id> ste foreach (Project *pro, projects) { if (!pro || pro->needsConfiguration()) continue; - BuildStepList *bsl = 0; + BuildStepList *bsl = nullptr; if (id == Constants::BUILDSTEPS_DEPLOY && pro->activeTarget()->activeDeployConfiguration()) bsl = pro->activeTarget()->activeDeployConfiguration()->stepList(); @@ -2436,11 +2430,11 @@ void ProjectExplorerPluginPrivate::runProjectWithoutDeploy() void ProjectExplorerPluginPrivate::runProjectContextMenu() { Node *node = ProjectTree::currentNode(); - ProjectNode *projectNode = node ? node->asProjectNode() : 0; + ProjectNode *projectNode = node ? node->asProjectNode() : nullptr; if (projectNode == ProjectTree::currentProject()->rootProjectNode() || !projectNode) { m_instance->runProject(ProjectTree::currentProject(), Constants::NORMAL_RUN_MODE); } else { - QAction *act = qobject_cast<QAction *>(sender()); + auto act = qobject_cast<QAction *>(sender()); if (!act) return; RunConfiguration *rc = act->data().value<RunConfiguration *>(); @@ -2502,11 +2496,11 @@ QPair<bool, QString> ProjectExplorerPluginPrivate::buildSettingsEnabledForSessio } else if (BuildManager::isBuilding()) { result.first = false; result.second = tr("A build is in progress."); - } else if (!hasBuildSettings(0)) { + } else if (!hasBuildSettings(nullptr)) { result.first = false; result.second = tr("Project has no build settings."); } else { - foreach (Project *project, SessionManager::projectOrder(0)) { + foreach (Project *project, SessionManager::projectOrder(nullptr)) { if (project && project->activeTarget() && project->activeTarget()->activeBuildConfiguration() @@ -2622,7 +2616,7 @@ void ProjectExplorerPluginPrivate::projectDisplayNameChanged(Project *pro) void ProjectExplorerPluginPrivate::startupProjectChanged() { - static QPointer<Project> previousStartupProject = 0; + static QPointer<Project> previousStartupProject = nullptr; Project *project = SessionManager::startupProject(); if (project == previousStartupProject) return; @@ -2645,8 +2639,8 @@ void ProjectExplorerPluginPrivate::startupProjectChanged() void ProjectExplorerPluginPrivate::activeTargetChanged() { - static QPointer<Target> previousTarget = 0; - Target *target = 0; + static QPointer<Target> previousTarget = nullptr; + Target *target = nullptr; Project *startupProject = SessionManager::startupProject(); if (startupProject) target = startupProject->activeTarget(); @@ -2669,8 +2663,8 @@ void ProjectExplorerPluginPrivate::activeTargetChanged() void ProjectExplorerPluginPrivate::activeRunConfigurationChanged() { - static QPointer<RunConfiguration> previousRunConfiguration = 0; - RunConfiguration *rc = 0; + static QPointer<RunConfiguration> previousRunConfiguration = nullptr; + RunConfiguration *rc = nullptr; Project *startupProject = SessionManager::startupProject(); if (startupProject && startupProject->activeTarget()) rc = startupProject->activeTarget()->activeRunConfiguration(); @@ -2727,10 +2721,10 @@ void ProjectExplorerPluginPrivate::updateDeployActions() && !project->activeTarget()->activeBuildConfiguration()->isEnabled(); }; - if (Utils::anyOf(SessionManager::projectOrder(0), hasDisabledBuildConfiguration)) + if (Utils::anyOf(SessionManager::projectOrder(nullptr), hasDisabledBuildConfiguration)) enableDeploySessionAction = false; } - if (!hasProjects || !hasDeploySettings(0) || BuildManager::isBuilding()) + if (!hasProjects || !hasDeploySettings(nullptr) || BuildManager::isBuilding()) enableDeploySessionAction = false; m_deploySessionAction->setEnabled(enableDeploySessionAction); @@ -2913,6 +2907,7 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions() m_addNewSubprojectAction->setEnabled(false); m_removeProjectAction->setEnabled(false); m_removeFileAction->setEnabled(false); + m_duplicateFileAction->setEnabled(false); m_deleteFileAction->setEnabled(false); m_renameFileAction->setEnabled(false); @@ -2922,6 +2917,7 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions() m_addNewSubprojectAction->setVisible(true); m_removeProjectAction->setVisible(true); m_removeFileAction->setVisible(true); + m_duplicateFileAction->setVisible(false); m_deleteFileAction->setVisible(true); m_runActionContextMenu->setVisible(false); @@ -2986,6 +2982,9 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions() m_removeFileAction->setVisible(!enableDelete || enableRemove); m_renameFileAction->setEnabled(actions.contains(Rename)); + m_duplicateFileAction->setVisible(actions.contains(DuplicateFile)); + m_duplicateFileAction->setEnabled(actions.contains(DuplicateFile)); + EditorManager::populateOpenWithMenu(m_openWithMenu, ProjectTree::currentNode()->filePath().toString()); } @@ -3061,7 +3060,7 @@ void ProjectExplorerPluginPrivate::addNewSubproject() void ProjectExplorerPluginPrivate::handleAddExistingFiles() { Node *node = ProjectTree::currentNode(); - FolderNode *folderNode = node ? node->asFolderNode() : 0; + FolderNode *folderNode = node ? node->asFolderNode() : nullptr; QTC_ASSERT(folderNode, return); @@ -3076,7 +3075,7 @@ void ProjectExplorerPluginPrivate::handleAddExistingFiles() void ProjectExplorerPluginPrivate::addExistingDirectory() { Node *node = ProjectTree::currentNode(); - FolderNode *folderNode = node ? node->asFolderNode() : 0; + FolderNode *folderNode = node ? node->asFolderNode() : nullptr; QTC_ASSERT(folderNode, return); @@ -3186,6 +3185,37 @@ void ProjectExplorerPluginPrivate::removeFile() } } +void ProjectExplorerPluginPrivate::duplicateFile() +{ + Node *currentNode = ProjectTree::currentNode(); + QTC_ASSERT(currentNode && currentNode->nodeType() == FileNodeType, return); + + FileNode *fileNode = currentNode->asFileNode(); + QString filePath = currentNode->filePath().toString(); + QFileInfo sourceFileInfo(filePath); + QString baseName = sourceFileInfo.baseName(); + + QString newFilePath = filePath; + int copyTokenIndex = filePath.lastIndexOf(baseName)+baseName.length(); + newFilePath.insert(copyTokenIndex, tr("_copy")); + + // Build a new file name till a non-existing file is not found. + uint counter = 0; + while (QFileInfo::exists(newFilePath)) { + newFilePath = filePath; + newFilePath.insert(copyTokenIndex, tr("_copy%1").arg(++counter)); + } + + // Create a copy and add the file to the parent folder node. + FolderNode *folderNode = fileNode->parentFolderNode(); + Q_ASSERT(folderNode); + if (!(QFile::copy(filePath, newFilePath) && folderNode->addFiles(QStringList(newFilePath)))) { + QMessageBox::warning(ICore::mainWindow(), tr("Duplicating File Failed"), + tr("Could not duplicate the file %1.") + .arg(QDir::toNativeSeparators(filePath))); + } +} + void ProjectExplorerPluginPrivate::deleteFile() { Node *currentNode = ProjectTree::currentNode(); @@ -3227,7 +3257,7 @@ void ProjectExplorerPluginPrivate::handleRenameFile() { QWidget *focusWidget = QApplication::focusWidget(); while (focusWidget) { - ProjectTreeWidget *treeWidget = qobject_cast<ProjectTreeWidget*>(focusWidget); + auto treeWidget = qobject_cast<ProjectTreeWidget*>(focusWidget); if (treeWidget) { treeWidget->editCurrentItem(); return; diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index 64e8882e88..bbf2454ff7 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -42,7 +42,7 @@ QT_END_NAMESPACE namespace Core { class IMode; class Id; -} +} // namespace Core namespace ProjectExplorer { class RunControl; @@ -75,7 +75,7 @@ public: const QString &errorMessage) : m_projects(projects), m_alreadyOpen(alreadyOpen), m_errorMessage(errorMessage) - {} + { } explicit operator bool() const { @@ -84,7 +84,7 @@ public: Project *project() const { - return m_projects.isEmpty() ? 0 : m_projects.first(); + return m_projects.isEmpty() ? nullptr : m_projects.first(); } QList<Project *> projects() const @@ -134,7 +134,7 @@ public: static QStringList projectFilePatterns(); static QList<QPair<QString, QString> > recentProjects(); - static bool canRunStartupProject(Core::Id runMode, QString *whyNot = 0); + static bool canRunStartupProject(Core::Id runMode, QString *whyNot = nullptr); static void runProject(Project *pro, Core::Id, const bool forceSkipDeploy = false); static void runStartupProject(Core::Id runMode, bool forceSkipDeploy = false); static void runRunConfiguration(RunConfiguration *rc, Core::Id runMode, diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index f0e866916e..cf9e10b09d 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -76,6 +76,7 @@ const char SEARCHONFILESYSTEM[] = "ProjectExplorer.SearchOnFileSystem"; const char SHOWINGRAPHICALSHELL[] = "ProjectExplorer.ShowInGraphicalShell"; const char OPENTERMIANLHERE[] = "ProjectExplorer.OpenTerminalHere"; const char REMOVEFILE[] = "ProjectExplorer.RemoveFile"; +const char DUPLICATEFILE[] = "ProjectExplorer.DuplicateFile"; const char DELETEFILE[] = "ProjectExplorer.DeleteFile"; const char RENAMEFILE[] = "ProjectExplorer.RenameFile"; const char SETSTARTUP[] = "ProjectExplorer.SetStartup"; @@ -257,6 +258,7 @@ const char GENERATOR_ID_PREFIX[] = "PE.Wizard.Generator."; const char NO_RUN_MODE[]="RunConfiguration.NoRunMode"; const char NORMAL_RUN_MODE[]="RunConfiguration.NormalRunMode"; const char QML_PROFILER_RUN_MODE[]="RunConfiguration.QmlProfilerRunMode"; +const char PERFPROFILER_RUN_MODE[]="PerfProfiler.RunMode"; const char DEBUG_RUN_MODE[]="RunConfiguration.DebugRunMode"; const char DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN[]="RunConfiguration.DebugRunModeWithBreakOnMain"; diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.cpp b/src/plugins/projectexplorer/projectexplorersettingspage.cpp index 19b0ac462e..7605ddbbe2 100644 --- a/src/plugins/projectexplorer/projectexplorersettingspage.cpp +++ b/src/plugins/projectexplorer/projectexplorersettingspage.cpp @@ -45,7 +45,7 @@ class ProjectExplorerSettingsWidget : public QWidget Q_OBJECT public: - explicit ProjectExplorerSettingsWidget(QWidget *parent = 0); + explicit ProjectExplorerSettingsWidget(QWidget *parent = nullptr); ProjectExplorerSettings settings() const; void setSettings(const ProjectExplorerSettings &s); diff --git a/src/plugins/projectexplorer/projectfilewizardextension.cpp b/src/plugins/projectexplorer/projectfilewizardextension.cpp index 4f163f3e42..79d5669d67 100644 --- a/src/plugins/projectexplorer/projectfilewizardextension.cpp +++ b/src/plugins/projectexplorer/projectfilewizardextension.cpp @@ -81,23 +81,16 @@ namespace Internal { class ProjectWizardContext { public: - ProjectWizardContext(); void clear(); - QPointer<ProjectWizardPage> page; // this is managed by the wizard! - const IWizardFactory *wizard; + QPointer<ProjectWizardPage> page = nullptr; // this is managed by the wizard! + const IWizardFactory *wizard = nullptr; }; -ProjectWizardContext::ProjectWizardContext() : - page(0), - wizard(0) -{ -} - void ProjectWizardContext::clear() { - page = 0; - wizard = 0; + page = nullptr; + wizard = nullptr; } // ---- ProjectFileWizardExtension @@ -208,7 +201,7 @@ bool ProjectFileWizardExtension::processProject( static ICodeStylePreferences *codeStylePreferences(Project *project, Id languageId) { if (!languageId.isValid()) - return 0; + return nullptr; if (project) return project->editorConfiguration()->codeStyle(languageId); @@ -232,7 +225,7 @@ void ProjectFileWizardExtension::applyCodeStyle(GeneratedFile *file) const ICodeStylePreferencesFactory *factory = TextEditorSettings::codeStyleFactory(languageId); - Indenter *indenter = 0; + Indenter *indenter = nullptr; if (factory) indenter = factory->createIndenter(); if (!indenter) diff --git a/src/plugins/projectexplorer/projectfilewizardextension.h b/src/plugins/projectexplorer/projectfilewizardextension.h index 9a3675c01c..fe9d3f8d92 100644 --- a/src/plugins/projectexplorer/projectfilewizardextension.h +++ b/src/plugins/projectexplorer/projectfilewizardextension.h @@ -55,7 +55,7 @@ private: bool processProject(const QList<Core::GeneratedFile> &files, bool *removeOpenProjectAttribute, QString *errorMessage); - ProjectWizardContext *m_context = 0; + ProjectWizardContext *m_context = nullptr; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/projectimporter.cpp b/src/plugins/projectexplorer/projectimporter.cpp index fa46b016fa..00f085de95 100644 --- a/src/plugins/projectexplorer/projectimporter.cpp +++ b/src/plugins/projectexplorer/projectimporter.cpp @@ -40,7 +40,7 @@ static const Core::Id KIT_TEMPORARY_NAME("PE.TempName"); static const Core::Id KIT_FINAL_NAME("PE.FinalName"); static const Core::Id TEMPORARY_OF_PROJECTS("PE.TempProject"); -ProjectImporter::ProjectImporter(const QString &path) : m_projectPath(path), m_isUpdating(false) +ProjectImporter::ProjectImporter(const QString &path) : m_projectPath(path) { } ProjectImporter::~ProjectImporter() diff --git a/src/plugins/projectexplorer/projectimporter.h b/src/plugins/projectexplorer/projectimporter.h index f11b03aa8e..635c7b10e2 100644 --- a/src/plugins/projectexplorer/projectimporter.h +++ b/src/plugins/projectexplorer/projectimporter.h @@ -71,7 +71,7 @@ protected: private: const QString m_projectPath; - bool m_isUpdating; + bool m_isUpdating = false; }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 404e7c19aa..311bf89e05 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -79,8 +79,8 @@ bool sortNodes(Node *n1, Node *n2) // projects if (n1Type == ProjectNodeType) { if (n2Type == ProjectNodeType) { - ProjectNode *project1 = static_cast<ProjectNode*>(n1); - ProjectNode *project2 = static_cast<ProjectNode*>(n2); + auto project1 = static_cast<ProjectNode*>(n1); + auto project2 = static_cast<ProjectNode*>(n2); int result = caseFriendlyCompare(project1->displayName(), project2->displayName()); if (result != 0) @@ -100,8 +100,8 @@ bool sortNodes(Node *n1, Node *n2) if (n1Type == VirtualFolderNodeType) { if (n2Type == VirtualFolderNodeType) { - VirtualFolderNode *folder1 = static_cast<VirtualFolderNode *>(n1); - VirtualFolderNode *folder2 = static_cast<VirtualFolderNode *>(n2); + auto folder1 = static_cast<VirtualFolderNode *>(n1); + auto folder2 = static_cast<VirtualFolderNode *>(n2); if (folder1->priority() > folder2->priority()) return true; @@ -124,8 +124,8 @@ bool sortNodes(Node *n1, Node *n2) if (n1Type == FolderNodeType) { if (n2Type == FolderNodeType) { - FolderNode *folder1 = static_cast<FolderNode*>(n1); - FolderNode *folder2 = static_cast<FolderNode*>(n2); + auto folder1 = static_cast<FolderNode*>(n1); + auto folder2 = static_cast<FolderNode*>(n2); int result = caseFriendlyCompare(folder1->filePath().toString(), folder2->filePath().toString()); @@ -170,13 +170,8 @@ bool sortNodes(Node *n1, Node *n2) } // namespace anon -FlatModel::FlatModel(SessionNode *rootNode, QObject *parent) - : QAbstractItemModel(parent), - m_filterProjects(false), - m_filterGeneratedFiles(true), - m_rootNode(rootNode), - m_startupProject(0), - m_parentFolderForChange(0) +FlatModel::FlatModel(SessionNode *rootNode, QObject *parent) : QAbstractItemModel(parent), + m_rootNode(rootNode) { ProjectTree *tree = ProjectTree::instance(); @@ -428,7 +423,7 @@ QList<Node*> FlatModel::childNodes(FolderNode *parentNode, const QSet<Node*> &bl QList<Node*> nodeList; if (parentNode->nodeType() == SessionNodeType) { - SessionNode *sessionNode = static_cast<SessionNode*>(parentNode); + auto sessionNode = static_cast<SessionNode*>(parentNode); QList<ProjectNode*> projectList = sessionNode->projectNodes(); for (int i = 0; i < projectList.size(); ++i) { if (!blackList.contains(projectList.at(i))) @@ -507,7 +502,7 @@ QModelIndex FlatModel::indexForNode(const Node *node_) const // We assume that we are only called for nodes that are represented // we use non-const pointers internally - Node *node = const_cast<Node*>(node_); + auto node = const_cast<Node*>(node_); if (!node) return QModelIndex(); @@ -558,7 +553,7 @@ Node *FlatModel::nodeForIndex(const QModelIndex &index) const { if (index.isValid()) return (Node*)index.internalPointer(); - return 0; + return nullptr; } /* @@ -569,7 +564,7 @@ Node *FlatModel::nodeForIndex(const QModelIndex &index) const FolderNode *FlatModel::visibleFolderNode(FolderNode *node) const { if (!node) - return 0; + return nullptr; for (FolderNode *folderNode = node; folderNode; @@ -577,7 +572,7 @@ FolderNode *FlatModel::visibleFolderNode(FolderNode *node) const if (!filter(folderNode)) return folderNode; } - return 0; + return nullptr; } bool FlatModel::filter(Node *node) const diff --git a/src/plugins/projectexplorer/projectmodels.h b/src/plugins/projectexplorer/projectmodels.h index 0d8eca9a8f..15a41e50b9 100644 --- a/src/plugins/projectexplorer/projectmodels.h +++ b/src/plugins/projectexplorer/projectmodels.h @@ -117,15 +117,15 @@ private: FolderNode *visibleFolderNode(FolderNode *node) const; bool filter(Node *node) const; - bool m_filterProjects; - bool m_filterGeneratedFiles; + bool m_filterProjects = false; + bool m_filterGeneratedFiles = true; SessionNode *m_rootNode; mutable QHash<FolderNode*, QList<Node*> > m_childNodes; - ProjectNode *m_startupProject; + ProjectNode *m_startupProject = nullptr; - FolderNode *m_parentFolderForChange; - Node *m_nodeForSortKeyChange; + FolderNode *m_parentFolderForChange = nullptr; + Node *m_nodeForSortKeyChange = nullptr; static const QLoggingCategory &logger(); diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index 8840f5d902..74dca37a42 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -42,7 +42,7 @@ #include <QIcon> #include <QStyle> -using namespace ProjectExplorer; +namespace ProjectExplorer { /*! \class ProjectExplorer::Node @@ -59,20 +59,14 @@ using namespace ProjectExplorer; \sa ProjectExplorer::NodesWatcher, ProjectExplorer::NodesVisitor */ -Node::Node(NodeType nodeType, const Utils::FileName &filePath, int line) - : m_nodeType(nodeType), - m_line(line), - m_projectNode(0), - m_folderNode(0), - m_filePath(filePath) -{ - -} +Node::Node(NodeType nodeType, const Utils::FileName &filePath, int line) : + m_nodeType(nodeType), + m_line(line), + m_filePath(filePath) +{ } Node::~Node() -{ - -} +{ } void Node::emitNodeSortKeyAboutToChange() { @@ -168,22 +162,22 @@ void Node::emitNodeUpdated() FileNode *Node::asFileNode() { - return 0; + return nullptr; } FolderNode *Node::asFolderNode() { - return 0; + return nullptr; } ProjectNode *Node::asProjectNode() { - return 0; + return nullptr; } SessionNode *Node::asSessionNode() { - return 0; + return nullptr; } void Node::setParentFolderNode(FolderNode *parentFolder) @@ -203,12 +197,10 @@ void Node::setParentFolderNode(FolderNode *parentFolder) FileNode::FileNode(const Utils::FileName &filePath, const FileType fileType, - bool generated, int line) - : Node(FileNodeType, filePath, line), - m_fileType(fileType), - m_generated(generated) -{ -} + bool generated, int line) : Node(FileNodeType, filePath, line), + m_fileType(fileType), + m_generated(generated) +{ } FileType FileNode::fileType() const { @@ -378,10 +370,7 @@ void FolderNode::addFileNodes(const QList<FileNode *> &files) // empty list or greater then last node m_fileNodes.append(file); } else { - QList<FileNode *>::iterator it - = qLowerBound(m_fileNodes.begin(), - m_fileNodes.end(), - file); + auto it = qLowerBound(m_fileNodes.begin(), m_fileNodes.end(), file); m_fileNodes.insert(it, file); } } @@ -409,8 +398,8 @@ void FolderNode::removeFileNodes(const QList<FileNode *> &files) ProjectTree::instance()->emitFilesAboutToBeRemoved(this, toRemove); - QList<FileNode*>::const_iterator toRemoveIter = toRemove.constBegin(); - QList<FileNode*>::iterator filesIter = m_fileNodes.begin(); + auto toRemoveIter = toRemove.constBegin(); + auto filesIter = m_fileNodes.begin(); for (; toRemoveIter != toRemove.constEnd(); ++toRemoveIter) { while (*filesIter != *toRemoveIter) { ++filesIter; @@ -449,10 +438,7 @@ void FolderNode::addFolderNodes(const QList<FolderNode*> &subFolders) m_subFolderNodes.append(folder); } else { // Binary Search for insertion point - QList<FolderNode*>::iterator it - = qLowerBound(m_subFolderNodes.begin(), - m_subFolderNodes.end(), - folder); + auto it = qLowerBound(m_subFolderNodes.begin(), m_subFolderNodes.end(), folder); m_subFolderNodes.insert(it, folder); } @@ -482,8 +468,8 @@ void FolderNode::removeFolderNodes(const QList<FolderNode*> &subFolders) ProjectTree::instance()->emitFoldersAboutToBeRemoved(this, toRemove); - QList<FolderNode*>::const_iterator toRemoveIter = toRemove.constBegin(); - QList<FolderNode*>::iterator folderIter = m_subFolderNodes.begin(); + auto toRemoveIter = toRemove.constBegin(); + auto folderIter = m_subFolderNodes.begin(); for (; toRemoveIter != toRemove.constEnd(); ++toRemoveIter) { QTC_ASSERT((*toRemoveIter)->nodeType() != ProjectNodeType, qDebug("project nodes have to be removed via removeProjectNodes")); @@ -520,14 +506,10 @@ bool FolderNode::showInSimpleTree() const \sa ProjectExplorer::FileNode, ProjectExplorer::ProjectNode */ -VirtualFolderNode::VirtualFolderNode(const Utils::FileName &folderPath, int priority) - : FolderNode(folderPath, VirtualFolderNodeType), m_priority(priority) -{ -} - -VirtualFolderNode::~VirtualFolderNode() -{ -} +VirtualFolderNode::VirtualFolderNode(const Utils::FileName &folderPath, int priority) : + FolderNode(folderPath, VirtualFolderNodeType), + m_priority(priority) +{ } int VirtualFolderNode::priority() const { @@ -547,8 +529,8 @@ int VirtualFolderNode::priority() const /*! Creates an uninitialized project node object. */ -ProjectNode::ProjectNode(const Utils::FileName &projectFilePath) - : FolderNode(projectFilePath, ProjectNodeType) +ProjectNode::ProjectNode(const Utils::FileName &projectFilePath) : + FolderNode(projectFilePath, ProjectNodeType) { // project node "manages" itself setProjectNode(this); @@ -691,9 +673,9 @@ void ProjectNode::removeProjectNodes(const QList<ProjectNode*> &subProjects) ProjectTree::instance()->emitFoldersAboutToBeRemoved(this, toRemove); - QList<FolderNode*>::const_iterator toRemoveIter = toRemove.constBegin(); - QList<FolderNode*>::iterator folderIter = m_subFolderNodes.begin(); - QList<ProjectNode*>::iterator projectIter = m_subProjectNodes.begin(); + auto toRemoveIter = toRemove.constBegin(); + auto folderIter = m_subFolderNodes.begin(); + auto projectIter = m_subProjectNodes.begin(); for (; toRemoveIter != toRemove.constEnd(); ++toRemoveIter) { while (*projectIter != *toRemoveIter) { ++projectIter; @@ -724,10 +706,9 @@ ProjectNode *ProjectNode::asProjectNode() \class ProjectExplorer::SessionNode */ -SessionNode::SessionNode() - : FolderNode(Utils::FileName::fromString(QLatin1String("session")), SessionNodeType) -{ -} +SessionNode::SessionNode() : + FolderNode(Utils::FileName::fromString(QLatin1String("session")), SessionNodeType) +{ } QList<ProjectAction> SessionNode::supportedActions(Node *node) const { @@ -804,9 +785,9 @@ void SessionNode::removeProjectNodes(const QList<ProjectNode*> &projectNodes) ProjectTree::instance()->emitFoldersAboutToBeRemoved(this, toRemove); - QList<FolderNode*>::const_iterator toRemoveIter = toRemove.constBegin(); - QList<FolderNode*>::iterator folderIter = m_subFolderNodes.begin(); - QList<ProjectNode*>::iterator projectIter = m_projectNodes.begin(); + auto toRemoveIter = toRemove.constBegin(); + auto folderIter = m_subFolderNodes.begin(); + auto projectIter = m_projectNodes.begin(); for (; toRemoveIter != toRemove.constEnd(); ++toRemoveIter) { while (*projectIter != *toRemoveIter) { ++projectIter; @@ -825,3 +806,5 @@ void SessionNode::removeProjectNodes(const QList<ProjectNode*> &projectNodes) ProjectTree::instance()->emitFoldersRemoved(this); } } + +} // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index 0e05da8754..de7bf24389 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -83,6 +83,7 @@ enum ProjectAction { // DeleteFile is a define on windows... EraseFile, Rename, + DuplicateFile, // hides actions that use the path(): Open containing folder, open terminal here and Find in Directory HidePathActions, HideFileActions, @@ -136,8 +137,8 @@ protected: private: NodeType m_nodeType; int m_line; - ProjectNode *m_projectNode; - FolderNode *m_folderNode; + ProjectNode *m_projectNode = nullptr; + FolderNode *m_folderNode = nullptr; Utils::FileName m_filePath; }; @@ -192,7 +193,7 @@ public: public: AddNewInformation(const QString &name, int p) :displayName(name), priority(p) - {} + { } QString displayName; int priority; }; @@ -226,9 +227,9 @@ class PROJECTEXPLORER_EXPORT VirtualFolderNode : public FolderNode { public: explicit VirtualFolderNode(const Utils::FileName &folderPath, int priority); - ~VirtualFolderNode() override; int priority() const; + private: int m_priority; }; diff --git a/src/plugins/projectexplorer/projectpanelfactory.cpp b/src/plugins/projectexplorer/projectpanelfactory.cpp index 2240252056..587cb55422 100644 --- a/src/plugins/projectexplorer/projectpanelfactory.cpp +++ b/src/plugins/projectexplorer/projectpanelfactory.cpp @@ -30,7 +30,6 @@ namespace ProjectExplorer { static QList<ProjectPanelFactory *> s_factories; ProjectPanelFactory::ProjectPanelFactory() : - m_priority(0), m_supportsFunction([] (Project *) { return true; }) { } diff --git a/src/plugins/projectexplorer/projectpanelfactory.h b/src/plugins/projectexplorer/projectpanelfactory.h index a251da03ea..416514a986 100644 --- a/src/plugins/projectexplorer/projectpanelfactory.h +++ b/src/plugins/projectexplorer/projectpanelfactory.h @@ -91,7 +91,7 @@ private: friend class ProjectExplorerPlugin; static void destroyFactories(); - int m_priority; + int m_priority = 0; QString m_displayName; std::function<bool (Project *)> m_supportsFunction; std::function<QWidget *(Project *)> m_createWidgetFunction; diff --git a/src/plugins/projectexplorer/projecttree.cpp b/src/plugins/projectexplorer/projecttree.cpp index ae5abd1e6b..43710c1a36 100644 --- a/src/plugins/projectexplorer/projecttree.cpp +++ b/src/plugins/projectexplorer/projecttree.cpp @@ -58,16 +58,9 @@ namespace ProjectExplorer { using namespace Internal; -ProjectTree *ProjectTree::s_instance = 0; +ProjectTree *ProjectTree::s_instance = nullptr; -ProjectTree::ProjectTree(QObject *parent) - : QObject(parent), - m_currentNode(0), - m_currentProject(0), - m_resetCurrentNodeFolder(false), - m_resetCurrentNodeFile(false), - m_resetCurrentNodeProject(false), - m_focusForContextMenu(0) +ProjectTree::ProjectTree(QObject *parent) : QObject(parent) { s_instance = this; @@ -160,7 +153,7 @@ void ProjectTree::documentManagerCurrentFileChanged() Project *ProjectTree::projectForNode(Node *node) { if (!node) - return 0; + return nullptr; FolderNode *rootProjectNode = node->asFolderNode(); if (!rootProjectNode) @@ -179,7 +172,7 @@ void ProjectTree::updateFromDocumentManager(bool invalidCurrentNode) Core::IDocument *document = Core::EditorManager::currentDocument(); const FileName fileName = document ? document->filePath() : FileName(); - Node *currentNode = 0; + Node *currentNode = nullptr; if (!invalidCurrentNode && m_currentNode && m_currentNode->filePath() == fileName) currentNode = m_currentNode; else @@ -444,7 +437,7 @@ void ProjectTree::collapseAll() void ProjectTree::updateExternalFileWarning() { - Core::IDocument *document = qobject_cast<Core::IDocument *>(sender()); + auto document = qobject_cast<Core::IDocument *>(sender()); if (!document || document->filePath().isEmpty()) return; Core::InfoBar *infoBar = document->infoBar(); @@ -486,7 +479,7 @@ bool ProjectTree::hasFocus(ProjectTreeWidget *widget) void ProjectTree::showContextMenu(ProjectTreeWidget *focus, const QPoint &globalPos, Node *node) { - QMenu *contextMenu = 0; + QMenu *contextMenu = nullptr; if (!node) node = SessionManager::sessionNode(); @@ -512,7 +505,7 @@ void ProjectTree::showContextMenu(ProjectTreeWidget *focus, const QPoint &global qWarning("ProjectExplorerPlugin::showContextMenu - Missing handler for node type"); } } else { // session item - emit s_instance->aboutToShowContextMenu(0, node); + emit s_instance->aboutToShowContextMenu(nullptr, node); contextMenu = Core::ActionManager::actionContainer(Constants::M_SESSIONCONTEXT)->menu(); } @@ -541,7 +534,7 @@ void ProjectTree::highlightProject(Project *project, const QString &message) void ProjectTree::hideContextMenu() { - m_focusForContextMenu = 0; + m_focusForContextMenu = nullptr; } bool ProjectTree::isInNodeHierarchy(Node *n) diff --git a/src/plugins/projectexplorer/projecttree.h b/src/plugins/projectexplorer/projecttree.h index 678f298b70..2a48995893 100644 --- a/src/plugins/projectexplorer/projecttree.h +++ b/src/plugins/projectexplorer/projecttree.h @@ -43,7 +43,7 @@ class PROJECTEXPLORER_EXPORT ProjectTree : public QObject { Q_OBJECT public: - explicit ProjectTree(QObject *parent = 0); + explicit ProjectTree(QObject *parent = nullptr); static ProjectTree *instance(); @@ -145,14 +145,14 @@ private: private: static ProjectTree *s_instance; QList<Internal::ProjectTreeWidget *> m_projectTreeWidgets; - Node *m_currentNode; - Project *m_currentProject; + Node *m_currentNode = nullptr; + Project *m_currentProject = nullptr; QList<FileNode *> m_filesAdded; QList<FolderNode *> m_foldersAdded; - bool m_resetCurrentNodeFolder; - bool m_resetCurrentNodeFile; - bool m_resetCurrentNodeProject; - Internal::ProjectTreeWidget *m_focusForContextMenu; + bool m_resetCurrentNodeFolder = false; + bool m_resetCurrentNodeFile = false; + bool m_resetCurrentNodeProject = false; + Internal::ProjectTreeWidget *m_focusForContextMenu = nullptr; Core::Context m_lastProjectContext; }; diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 1b79decf33..680727f1e1 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -165,13 +165,7 @@ private: Shows the projects in form of a tree. */ -ProjectTreeWidget::ProjectTreeWidget(QWidget *parent) - : QWidget(parent), - m_view(0), - m_model(0), - m_filterProjectsAction(0), - m_autoSync(false), - m_autoExpand(true) +ProjectTreeWidget::ProjectTreeWidget(QWidget *parent) : QWidget(parent) { m_model = new FlatModel(SessionManager::sessionNode(), this); Project *pro = SessionManager::startupProject(); @@ -185,7 +179,7 @@ ProjectTreeWidget::ProjectTreeWidget(QWidget *parent) m_view->installEventFilter(this); initView(); - QVBoxLayout *layout = new QVBoxLayout(); + auto layout = new QVBoxLayout(); layout->addWidget(ItemViewFind::createSearchableWrapper( m_view, ItemViewFind::DarkColored, ItemViewFind::FetchMoreWhileSearching)); @@ -580,15 +574,15 @@ ProjectTreeWidgetFactory::ProjectTreeWidgetFactory() NavigationView ProjectTreeWidgetFactory::createWidget() { NavigationView n; - ProjectTreeWidget *ptw = new ProjectTreeWidget; + auto ptw = new ProjectTreeWidget; n.widget = ptw; - QToolButton *filter = new QToolButton; + auto filter = new QToolButton; filter->setIcon(Core::Icons::FILTER.icon()); filter->setToolTip(tr("Filter Tree")); filter->setPopupMode(QToolButton::InstantPopup); filter->setProperty("noArrow", true); - QMenu *filterMenu = new QMenu(filter); + auto filterMenu = new QMenu(filter); filterMenu->addAction(ptw->m_filterProjectsAction); filterMenu->addAction(ptw->m_filterGeneratedFilesAction); filter->setMenu(filterMenu); @@ -599,7 +593,7 @@ NavigationView ProjectTreeWidgetFactory::createWidget() void ProjectTreeWidgetFactory::saveSettings(int position, QWidget *widget) { - ProjectTreeWidget *ptw = qobject_cast<ProjectTreeWidget *>(widget); + auto ptw = qobject_cast<ProjectTreeWidget *>(widget); Q_ASSERT(ptw); QSettings *settings = ICore::settings(); const QString baseKey = QLatin1String("ProjectTreeWidget.") + QString::number(position); @@ -610,7 +604,7 @@ void ProjectTreeWidgetFactory::saveSettings(int position, QWidget *widget) void ProjectTreeWidgetFactory::restoreSettings(int position, QWidget *widget) { - ProjectTreeWidget *ptw = qobject_cast<ProjectTreeWidget *>(widget); + auto ptw = qobject_cast<ProjectTreeWidget *>(widget); Q_ASSERT(ptw); QSettings *settings = ICore::settings(); const QString baseKey = QLatin1String("ProjectTreeWidget.") + QString::number(position); diff --git a/src/plugins/projectexplorer/projecttreewidget.h b/src/plugins/projectexplorer/projecttreewidget.h index bd0bd97310..dbda089187 100644 --- a/src/plugins/projectexplorer/projecttreewidget.h +++ b/src/plugins/projectexplorer/projecttreewidget.h @@ -52,7 +52,7 @@ class ProjectTreeWidget : public QWidget { Q_OBJECT public: - explicit ProjectTreeWidget(QWidget *parent = 0); + explicit ProjectTreeWidget(QWidget *parent = nullptr); ~ProjectTreeWidget() override; bool autoSynchronization() const; @@ -94,16 +94,16 @@ private: void renamed(const Utils::FileName &oldPath, const Utils::FileName &newPath); QSet<ExpandData> m_toExpand; - QTreeView *m_view; - FlatModel *m_model; - QAction *m_filterProjectsAction; + QTreeView *m_view = nullptr; + FlatModel *m_model = nullptr; + QAction *m_filterProjectsAction = nullptr; QAction *m_filterGeneratedFilesAction; QToolButton *m_toggleSync; QModelIndex m_subIndex; QString m_modelId; - bool m_autoSync; - bool m_autoExpand; + bool m_autoSync = false; + bool m_autoExpand = true; Utils::FileName m_delayedRename; static QList<ProjectTreeWidget *> m_projectTreeWidgets; diff --git a/src/plugins/projectexplorer/projectwelcomepage.cpp b/src/plugins/projectexplorer/projectwelcomepage.cpp index 504ec3fbbc..f94d4debee 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.cpp +++ b/src/plugins/projectexplorer/projectwelcomepage.cpp @@ -117,7 +117,7 @@ void SessionModel::resetSessions() void SessionModel::cloneSession(const QString &session) { - SessionNameInputDialog newSessionInputDialog(SessionManager::sessions(), 0); + SessionNameInputDialog newSessionInputDialog(SessionManager::sessions(), nullptr); newSessionInputDialog.setWindowTitle(tr("New session name")); newSessionInputDialog.setValue(session + QLatin1String(" (2)")); @@ -145,7 +145,7 @@ void SessionModel::deleteSession(const QString &session) void SessionModel::renameSession(const QString &session) { - SessionNameInputDialog newSessionInputDialog(SessionManager::sessions(), 0); + SessionNameInputDialog newSessionInputDialog(SessionManager::sessions(), nullptr); newSessionInputDialog.setWindowTitle(tr("New session name")); newSessionInputDialog.setValue(session); @@ -180,7 +180,6 @@ QVariant ProjectModel::data(const QModelIndex &index, int role) const switch (role) { case Qt::DisplayRole: return data.second; - break; case FilePathRole: return data.first; case PrettyFilePathRole: @@ -188,8 +187,6 @@ QVariant ProjectModel::data(const QModelIndex &index, int role) const default: return QVariant(); } - - return QVariant(); } QHash<int, QByteArray> ProjectModel::roleNames() const @@ -209,11 +206,6 @@ void ProjectModel::resetProjects() /////////////////// -ProjectWelcomePage::ProjectWelcomePage() : - m_sessionModel(0), m_projectModel(0) -{ -} - void ProjectWelcomePage::facilitateQml(QQmlEngine *engine) { m_sessionModel = new SessionModel(this); diff --git a/src/plugins/projectexplorer/projectwelcomepage.h b/src/plugins/projectexplorer/projectwelcomepage.h index 9ab1207112..2d56e4c103 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.h +++ b/src/plugins/projectexplorer/projectwelcomepage.h @@ -43,7 +43,7 @@ class SessionModel : public QAbstractListModel public: enum { DefaultSessionRole = Qt::UserRole+1, LastSessionRole, ActiveSessionRole, ProjectsPathRole, ProjectsDisplayRole }; - explicit SessionModel(QObject *parent = 0); + explicit SessionModel(QObject *parent = nullptr); int rowCount(const QModelIndex &parent) const override; QVariant data(const QModelIndex &index, int role) const override; @@ -66,7 +66,7 @@ class ProjectModel : public QAbstractListModel public: enum { FilePathRole = Qt::UserRole+1, PrettyFilePathRole }; - ProjectModel(QObject *parent = 0); + ProjectModel(QObject *parent = nullptr); int rowCount(const QModelIndex &parent) const override; QVariant data(const QModelIndex &index, int role) const override; QHash<int, QByteArray> roleNames() const override; @@ -79,11 +79,11 @@ class ProjectWelcomePage : public Core::IWelcomePage { Q_OBJECT public: - ProjectWelcomePage(); + ProjectWelcomePage() = default; void facilitateQml(QQmlEngine *engine) override; QUrl pageLocation() const override; - QWidget *page() { return 0; } + QWidget *page() { return nullptr; } QString title() const override { return tr("Projects"); } int priority() const override { return 20; } Core::Id id() const override; @@ -100,8 +100,8 @@ signals: void manageSessions(); private: - SessionModel *m_sessionModel; - ProjectModel *m_projectModel; + SessionModel *m_sessionModel = nullptr; + ProjectModel *m_projectModel = nullptr; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 62a83b5d5d..2f211500bb 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -54,7 +54,7 @@ ProjectWindow::ProjectWindow(QWidget *parent) m_currentWidget(0) { // Setup overall layout: - QVBoxLayout *viewLayout = new QVBoxLayout(this); + auto viewLayout = new QVBoxLayout(this); viewLayout->setMargin(0); viewLayout->setSpacing(0); @@ -92,7 +92,7 @@ void ProjectWindow::aboutToShutdown() void ProjectWindow::removedTarget(Target *) { - Project *p = qobject_cast<Project *>(sender()); + auto p = qobject_cast<Project *>(sender()); QTC_ASSERT(p, return); if (p->targets().isEmpty()) projectUpdated(p); @@ -312,10 +312,8 @@ int WidgetCache::indexForProject(Project *project) const Project *WidgetCache::projectFor(int projectIndex) const { - if (projectIndex < 0) - return 0; - if (projectIndex >= m_projects.size()) - return 0; + if (projectIndex < 0 || projectIndex >= m_projects.size()) + return nullptr; return m_projects.at(projectIndex).project; } @@ -351,7 +349,7 @@ int WidgetCache::recheckFactories(Project *project, int oldSupportsIndex) info.supports[i] = fac.at(i)->supports(project); if (!info.supports.at(i)) { delete info.widgets.at(i); - info.widgets[i] = 0; + info.widgets[i] = nullptr; } } diff --git a/src/plugins/projectexplorer/projectwindow.h b/src/plugins/projectexplorer/projectwindow.h index 6389965a06..f2d9652a11 100644 --- a/src/plugins/projectexplorer/projectwindow.h +++ b/src/plugins/projectexplorer/projectwindow.h @@ -78,7 +78,7 @@ class ProjectWindow : public QWidget Q_OBJECT public: - explicit ProjectWindow(QWidget *parent = 0); + explicit ProjectWindow(QWidget *parent = nullptr); void aboutToShutdown(); diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index 8b9f6fa00d..f806ca2c93 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -77,26 +77,19 @@ public: private: QString m_displayName; QString m_toolTip; - FolderNode *m_node; - bool m_canAdd; - int m_priority; + FolderNode *m_node = nullptr; + bool m_canAdd = true; + int m_priority = -1; }; -AddNewTree::AddNewTree(const QString &displayName) - : m_displayName(displayName), - m_node(0), - m_canAdd(true), - m_priority(-1) -{ -} +AddNewTree::AddNewTree(const QString &displayName) : + m_displayName(displayName) +{ } // FIXME: potentially merge the following two functions. // Note the different handling of 'node' and m_canAdd. -AddNewTree::AddNewTree(FolderNode *node, QList<AddNewTree *> children, const QString &displayName) - : m_displayName(displayName), - m_node(0), - m_canAdd(false), - m_priority(-1) +AddNewTree::AddNewTree(FolderNode *node, QList<AddNewTree *> children, const QString &displayName) : + m_displayName(displayName) { if (node) m_toolTip = ProjectExplorerPlugin::directoryFor(node); @@ -104,11 +97,9 @@ AddNewTree::AddNewTree(FolderNode *node, QList<AddNewTree *> children, const QSt appendChild(child); } -AddNewTree::AddNewTree(FolderNode *node, QList<AddNewTree *> children, const FolderNode::AddNewInformation &info) - : m_displayName(info.displayName), - m_node(node), - m_canAdd(true), - m_priority(info.priority) +AddNewTree::AddNewTree(FolderNode *node, QList<AddNewTree *> children, + const FolderNode::AddNewInformation &info) : + m_displayName(info.displayName) { if (node) m_toolTip = ProjectExplorerPlugin::directoryFor(node); @@ -119,13 +110,16 @@ AddNewTree::AddNewTree(FolderNode *node, QList<AddNewTree *> children, const Fol QVariant AddNewTree::data(int, int role) const { - if (role == Qt::DisplayRole) + switch (role) { + case Qt::DisplayRole: return m_displayName; - if (role == Qt::ToolTipRole) + case Qt::ToolTipRole: return m_toolTip; - if (role == Qt::UserRole) + case Qt::UserRole: return QVariant::fromValue(static_cast<void*>(node())); - return QVariant(); + default: + return QVariant(); + } } Qt::ItemFlags AddNewTree::flags(int) const @@ -147,24 +141,21 @@ public: AddNewTree *bestChoice() const; bool deploys(); QString deployingProjects() const; + private: QString m_commonDirectory; QStringList m_files; - bool m_deploys; + bool m_deploys = false; QString m_deployText; - AddNewTree *m_bestChoice; - int m_bestMatchLength; - int m_bestMatchPriority; + AddNewTree *m_bestChoice = nullptr; + int m_bestMatchLength = -1; + int m_bestMatchPriority = -1; }; -BestNodeSelector::BestNodeSelector(const QString &commonDirectory, const QStringList &files) - : m_commonDirectory(commonDirectory), - m_files(files), - m_deploys(false), - m_deployText(QCoreApplication::translate("ProjectWizard", "The files are implicitly added to the projects:") + QLatin1Char('\n')), - m_bestChoice(0), - m_bestMatchLength(-1), - m_bestMatchPriority(-1) +BestNodeSelector::BestNodeSelector(const QString &commonDirectory, const QStringList &files) : + m_commonDirectory(commonDirectory), + m_files(files), + m_deployText(QCoreApplication::translate("ProjectWizard", "The files are implicitly added to the projects:") + QLatin1Char('\n')) { } // Find the project the new files should be added @@ -247,14 +238,14 @@ static inline AddNewTree *buildAddProjectTree(ProjectNode *root, const QString & if (list.contains(AddSubProject) && !list.contains(InheritedFromParent)) { if (projectPath.isEmpty() || root->canAddSubProject(projectPath)) { FolderNode::AddNewInformation info = root->addNewInformation(QStringList() << projectPath, contextNode); - AddNewTree *item = new AddNewTree(root, children, info); + auto item = new AddNewTree(root, children, info); selector->inspect(item, root == contextNode); return item; } } if (children.isEmpty()) - return 0; + return nullptr; return new AddNewTree(root, children, root->displayName()); } @@ -283,12 +274,12 @@ static inline AddNewTree *buildAddFilesTree(FolderNode *root, const QStringList const QList<ProjectAction> &list = root->supportedActions(root); if (list.contains(AddNewFile) && !list.contains(InheritedFromParent)) { FolderNode::AddNewInformation info = root->addNewInformation(files, contextNode); - AddNewTree *item = new AddNewTree(root, children, info); + auto item = new AddNewTree(root, children, info); selector->inspect(item, root == contextNode); return item; } if (children.isEmpty()) - return 0; + return nullptr; return new AddNewTree(root, children, root->displayName()); } @@ -320,11 +311,8 @@ static inline AddNewTree *getChoices(const QStringList &generatedFiles, // ProjectWizardPage: // -------------------------------------------------------------------- -ProjectWizardPage::ProjectWizardPage(QWidget *parent) : - WizardPage(parent), - m_ui(new Ui::WizardPage), - m_model(0), - m_repositoryExists(false) +ProjectWizardPage::ProjectWizardPage(QWidget *parent) : WizardPage(parent), + m_ui(new Ui::WizardPage) { m_ui->setupUi(this); m_ui->vcsManageButton->setText(ICore::msgShowOptionsDialog()); @@ -380,7 +368,7 @@ bool ProjectWizardPage::expandTree(const QModelIndex &root) m_ui->projectComboBox->view()->collapse(root); // if we are a high priority node, our *parent* needs to be expanded - AddNewTree *tree = static_cast<AddNewTree *>(root.internalPointer()); + auto tree = static_cast<AddNewTree *>(root.internalPointer()); if (tree && tree->priority() >= 100) expand = true; @@ -401,7 +389,7 @@ void ProjectWizardPage::setBestNode(AddNewTree *tree) FolderNode *ProjectWizardPage::currentNode() const { QVariant v = m_ui->projectComboBox->currentData(Qt::UserRole); - return v.isNull() ? 0 : static_cast<FolderNode *>(v.value<void *>()); + return v.isNull() ? nullptr : static_cast<FolderNode *>(v.value<void *>()); } void ProjectWizardPage::setAddingSubProject(bool addingSubProject) @@ -423,7 +411,7 @@ void ProjectWizardPage::initializeVersionControls() if (versionControls.isEmpty()) hideVersionControlUiElements(); - IVersionControl *currentSelection = 0; + IVersionControl *currentSelection = nullptr; int currentIdx = versionControlIndex() - 1; if (currentIdx >= 0 && currentIdx <= m_activeVersionControls.size() - 1) currentSelection = m_activeVersionControls.at(currentIdx); @@ -500,7 +488,7 @@ void ProjectWizardPage::initializeProjectTree(Node *context, const QStringList & setAdditionalInfo(selector.deployingProjects()); - TreeModel *model = new TreeModel(tree); + auto model = new TreeModel(tree); setModel(model); setBestNode(selector.bestChoice()); setAddingSubProject(action == AddSubProject); @@ -537,7 +525,7 @@ IVersionControl *ProjectWizardPage::currentVersionControl() { int index = m_ui->addToVersionControlComboBox->currentIndex() - 1; // Subtract "<None>" if (index < 0 || index > m_activeVersionControls.count()) - return 0; // <None> + return nullptr; // <None> return m_activeVersionControls.at(index); } diff --git a/src/plugins/projectexplorer/projectwizardpage.h b/src/plugins/projectexplorer/projectwizardpage.h index a074595b3b..931e4e6729 100644 --- a/src/plugins/projectexplorer/projectwizardpage.h +++ b/src/plugins/projectexplorer/projectwizardpage.h @@ -53,7 +53,7 @@ class ProjectWizardPage : public Utils::WizardPage Q_OBJECT public: - explicit ProjectWizardPage(QWidget *parent = 0); + explicit ProjectWizardPage(QWidget *parent = nullptr); ~ProjectWizardPage() override; FolderNode *currentNode() const; @@ -96,11 +96,11 @@ private: Ui::WizardPage *m_ui; QStringList m_projectToolTips; - Utils::TreeModel *m_model; + Utils::TreeModel *m_model = nullptr; QList<Core::IVersionControl*> m_activeVersionControls; QString m_commonDirectory; - bool m_repositoryExists; + bool m_repositoryExists = false; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/propertiespanel.h b/src/plugins/projectexplorer/propertiespanel.h index 3bff1012c8..0f7e284c4a 100644 --- a/src/plugins/projectexplorer/propertiespanel.h +++ b/src/plugins/projectexplorer/propertiespanel.h @@ -50,7 +50,7 @@ public: private: QString m_displayName; - QWidget *m_widget; + QWidget *m_widget = nullptr; QIcon m_icon; }; diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index c83c064de5..d5e6aed18a 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -110,13 +110,9 @@ ISettingsAspect *ISettingsAspect::clone() const // /////////////////////////////////////////////////////////////////////// -IRunConfigurationAspect::IRunConfigurationAspect(RunConfiguration *runConfig) -{ - m_runConfiguration = runConfig; - m_projectSettings = 0; - m_globalSettings = 0; - m_useGlobalSettings = false; -} +IRunConfigurationAspect::IRunConfigurationAspect(RunConfiguration *runConfig) : + m_runConfiguration(runConfig) +{ } IRunConfigurationAspect::~IRunConfigurationAspect() { @@ -130,7 +126,7 @@ IRunConfigurationAspect::~IRunConfigurationAspect() RunConfigWidget *IRunConfigurationAspect::createConfigurationWidget() { - return 0; + return nullptr; } void IRunConfigurationAspect::setProjectSettings(ISettingsAspect *settings) @@ -293,7 +289,7 @@ RunConfiguration::ConfigurationState RunConfiguration::ensureConfigured(QString BuildConfiguration *RunConfiguration::activeBuildConfiguration() const { if (!target()) - return 0; + return nullptr; return target()->activeBuildConfiguration(); } @@ -358,11 +354,11 @@ QList<IRunConfigurationAspect *> RunConfiguration::extraAspects() const } IRunConfigurationAspect *RunConfiguration::extraAspect(Core::Id id) const { - QTC_ASSERT(m_aspectsInitialized, return 0); + QTC_ASSERT(m_aspectsInitialized, return nullptr); foreach (IRunConfigurationAspect *aspect, m_aspects) if (aspect->id() == id) return aspect; - return 0; + return nullptr; } /*! @@ -438,10 +434,10 @@ IRunConfigurationFactory::IRunConfigurationFactory(QObject *parent) : RunConfiguration *IRunConfigurationFactory::create(Target *parent, Core::Id id) { if (!canCreate(parent, id)) - return 0; + return nullptr; RunConfiguration *rc = doCreate(parent, id); if (!rc) - return 0; + return nullptr; rc->addExtraAspects(); return rc; } @@ -449,11 +445,11 @@ RunConfiguration *IRunConfigurationFactory::create(Target *parent, Core::Id id) RunConfiguration *IRunConfigurationFactory::restore(Target *parent, const QVariantMap &map) { if (!canRestore(parent, map)) - return 0; + return nullptr; RunConfiguration *rc = doRestore(parent, map); if (!rc->fromMap(map)) { delete rc; - rc = 0; + rc = nullptr; } return rc; } @@ -495,7 +491,7 @@ QList<IRunConfigurationFactory *> IRunConfigurationFactory::find(Target *parent) Returns a widget used to configure this runner. Ownership is transferred to the caller. - Returns 0 if @p \a runConfiguration is not suitable for RunControls from this + Returns null if @p \a runConfiguration is not suitable for RunControls from this factory, or no user-accessible configuration is required. */ @@ -518,7 +514,7 @@ IRunControlFactory::IRunControlFactory(QObject *parent) IRunConfigurationAspect *IRunControlFactory::createRunConfigurationAspect(RunConfiguration *rc) { Q_UNUSED(rc); - return 0; + return nullptr; } /*! @@ -567,7 +563,7 @@ public: Utils::Icon icon; const QPointer<RunConfiguration> runConfiguration; QPointer<Project> project; - Utils::OutputFormatter *outputFormatter = 0; + Utils::OutputFormatter *outputFormatter = nullptr; // A handle to the actual application process. ProcessHandle applicationProcessHandle; @@ -581,10 +577,9 @@ public: } // Internal -RunControl::RunControl(RunConfiguration *runConfiguration, Core::Id mode) - : d(new Internal::RunControlPrivate(runConfiguration, mode)) -{ -} +RunControl::RunControl(RunConfiguration *runConfiguration, Core::Id mode) : + d(new Internal::RunControlPrivate(runConfiguration, mode)) +{ } RunControl::~RunControl() { diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index c5b6e2f82f..6649423672 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -147,10 +147,10 @@ protected: private: Core::Id m_id; QString m_displayName; - bool m_useGlobalSettings; - RunConfiguration *m_runConfiguration; - ISettingsAspect *m_projectSettings; // Owned if present. - ISettingsAspect *m_globalSettings; // Not owned. + bool m_useGlobalSettings = false; + RunConfiguration *m_runConfiguration = nullptr; + ISettingsAspect *m_projectSettings = nullptr; // Owned if present. + ISettingsAspect *m_globalSettings = nullptr; // Not owned. }; class PROJECTEXPLORER_EXPORT ClonableConcept @@ -240,7 +240,7 @@ public: // Pop up configuration dialog in case for example the executable is missing. enum ConfigurationState { Configured, UnConfigured, Waiting }; // TODO rename function - virtual ConfigurationState ensureConfigured(QString *errorMessage = 0); + virtual ConfigurationState ensureConfigured(QString *errorMessage = nullptr); Target *target() const; @@ -254,11 +254,11 @@ public: template <typename T> T *extraAspect() const { - QTC_ASSERT(m_aspectsInitialized, return 0); + QTC_ASSERT(m_aspectsInitialized, return nullptr); foreach (IRunConfigurationAspect *aspect, m_aspects) if (T *result = qobject_cast<T *>(aspect)) return result; - return 0; + return nullptr; } virtual Runnable runnable() const; @@ -291,7 +291,7 @@ class PROJECTEXPLORER_EXPORT IRunConfigurationFactory : public QObject Q_OBJECT public: - explicit IRunConfigurationFactory(QObject *parent = 0); + explicit IRunConfigurationFactory(QObject *parent = nullptr); enum CreationMode {UserCreate, AutoCreate}; virtual QList<Core::Id> availableCreationIds(Target *parent, CreationMode mode = UserCreate) const = 0; @@ -320,7 +320,7 @@ class PROJECTEXPLORER_EXPORT IRunControlFactory : public QObject { Q_OBJECT public: - explicit IRunControlFactory(QObject *parent = 0); + explicit IRunControlFactory(QObject *parent = nullptr); virtual bool canRun(RunConfiguration *runConfiguration, Core::Id mode) const = 0; virtual RunControl *create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage) = 0; @@ -353,7 +353,7 @@ public: ~RunControl() override; virtual void start() = 0; - virtual bool promptToStop(bool *optionalPrompt = 0) const; + virtual bool promptToStop(bool *optionalPrompt = nullptr) const; virtual StopResult stop() = 0; virtual bool isRunning() const = 0; virtual bool supportsReRunning() const { return true; } @@ -397,7 +397,7 @@ protected: bool showPromptToStopDialog(const QString &title, const QString &text, const QString &stopButtonText = QString(), const QString &cancelButtonText = QString(), - bool *prompt = 0) const; + bool *prompt = nullptr) const; private: void bringApplicationToForegroundInternal(); @@ -405,4 +405,3 @@ private: }; } // namespace ProjectExplorer - diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 2b5d24c904..1f063d02af 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -49,9 +49,10 @@ namespace ProjectExplorer { \class ProjectExplorer::TerminalAspect */ -TerminalAspect::TerminalAspect(RunConfiguration *runConfig, const QString &key, bool useTerminal, bool userSet) - : IRunConfigurationAspect(runConfig), m_useTerminal(useTerminal), - m_userSet(userSet), m_checkBox(0), m_key(key) +TerminalAspect::TerminalAspect(RunConfiguration *runConfig, const QString &key, + bool useTerminal, bool userSet) : + IRunConfigurationAspect(runConfig), + m_useTerminal(useTerminal), m_userSet(userSet), m_checkBox(nullptr), m_key(key) { setDisplayName(tr("Terminal")); setId("TerminalAspect"); diff --git a/src/plugins/projectexplorer/runconfigurationmodel.cpp b/src/plugins/projectexplorer/runconfigurationmodel.cpp index d9d477b8f3..45d7bf0668 100644 --- a/src/plugins/projectexplorer/runconfigurationmodel.cpp +++ b/src/plugins/projectexplorer/runconfigurationmodel.cpp @@ -50,10 +50,11 @@ public: } }; -RunConfigurationModel::RunConfigurationModel(Target *target, QObject *parent) - : QAbstractListModel(parent), - m_target(target) +RunConfigurationModel::RunConfigurationModel(Target *target, QObject *parent) : + QAbstractListModel(parent), + m_target(target) { + QTC_ASSERT(target, return); m_runConfigurations = m_target->runConfigurations(); Utils::sort(m_runConfigurations, RunConfigurationComparer()); @@ -135,14 +136,14 @@ QVariant RunConfigurationModel::data(const QModelIndex &index, int role) const RunConfiguration *RunConfigurationModel::runConfigurationAt(int i) { if (i > m_runConfigurations.size() || i < 0) - return 0; + return nullptr; return m_runConfigurations.at(i); } RunConfiguration *RunConfigurationModel::runConfigurationFor(const QModelIndex &idx) { if (idx.row() > m_runConfigurations.size() || idx.row() < 0) - return 0; + return nullptr; return m_runConfigurations.at(idx.row()); } diff --git a/src/plugins/projectexplorer/runconfigurationmodel.h b/src/plugins/projectexplorer/runconfigurationmodel.h index a5d9235798..8af2566b95 100644 --- a/src/plugins/projectexplorer/runconfigurationmodel.h +++ b/src/plugins/projectexplorer/runconfigurationmodel.h @@ -37,7 +37,7 @@ class RunConfigurationModel : public QAbstractListModel Q_OBJECT public: - explicit RunConfigurationModel(Target *target, QObject *parent = 0); + explicit RunConfigurationModel(Target *target, QObject *parent = nullptr); int rowCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index 6323d8a46b..3dcc3093de 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -83,17 +83,10 @@ using ExtensionSystem::PluginManager; /// RunSettingsWidget /// -RunSettingsWidget::RunSettingsWidget(Target *target) - : m_target(target), - m_runConfigurationsModel(new RunConfigurationModel(target, this)), - m_deployConfigurationModel(new DeployConfigurationModel(target, this)), - m_runConfigurationWidget(0), - m_runConfiguration(0), - m_runLayout(0), - m_deployConfigurationWidget(0), - m_deployLayout(0), - m_deploySteps(0), - m_ignoreChange(false) +RunSettingsWidget::RunSettingsWidget(Target *target) : + m_target(target), + m_runConfigurationsModel(new RunConfigurationModel(target, this)), + m_deployConfigurationModel(new DeployConfigurationModel(target, this)) { Q_ASSERT(m_target); @@ -102,7 +95,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target) m_removeDeployToolButton = new QPushButton(tr("Remove"), this); m_renameDeployButton = new QPushButton(tr("Rename..."), this); - QWidget *deployWidget = new QWidget(this); + auto deployWidget = new QWidget(this); m_runConfigurationCombo = new QComboBox(this); m_runConfigurationCombo->setSizeAdjustPolicy(QComboBox::AdjustToContents); @@ -112,17 +105,15 @@ RunSettingsWidget::RunSettingsWidget(Target *target) m_removeRunToolButton = new QPushButton(tr("Remove"), this); m_renameRunButton = new QPushButton(tr("Rename..."), this); - QSpacerItem *spacer1 = - new QSpacerItem(10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum); - QSpacerItem *spacer2 = - new QSpacerItem(10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding); + auto spacer1 = new QSpacerItem(10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum); + auto spacer2 = new QSpacerItem(10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding); - QWidget *runWidget = new QWidget(this); + auto runWidget = new QWidget(this); - QLabel *deployTitle = new QLabel(tr("Deployment"), this); - QLabel *deployLabel = new QLabel(tr("Method:"), this); - QLabel *runTitle = new QLabel(tr("Run"), this); - QLabel *runLabel = new QLabel(tr("Run configuration:"), this); + auto deployTitle = new QLabel(tr("Deployment"), this); + auto deployLabel = new QLabel(tr("Method:"), this); + auto runTitle = new QLabel(tr("Run"), this); + auto runLabel = new QLabel(tr("Run configuration:"), this); runLabel->setBuddy(m_runConfigurationCombo); @@ -243,7 +234,7 @@ void RunSettingsWidget::aboutToShowAddMenu() foreach (IRunConfigurationFactory *factory, factories) { QList<Core::Id> ids = factory->availableCreationIds(m_target); foreach (Core::Id id, ids) { - QAction *action = new QAction(factory->displayNameForId(id), m_addRunMenu); + auto action = new QAction(factory->displayNameForId(id), m_addRunMenu); connect(action, &QAction::triggered, [factory, id, this]() { RunConfiguration *newRC = factory->create(m_target, id); if (!newRC) @@ -337,7 +328,7 @@ void RunSettingsWidget::currentRunConfigurationChanged(int index) if (m_ignoreChange) return; - RunConfiguration *selectedRunConfiguration = 0; + RunConfiguration *selectedRunConfiguration = nullptr; if (index >= 0) selectedRunConfiguration = m_runConfigurationsModel->runConfigurationAt(index); @@ -357,7 +348,7 @@ void RunSettingsWidget::currentDeployConfigurationChanged(int index) if (m_ignoreChange) return; if (index == -1) - SessionManager::setActiveDeployConfiguration(m_target, 0, SetActive::Cascade); + SessionManager::setActiveDeployConfiguration(m_target, nullptr, SetActive::Cascade); else SessionManager::setActiveDeployConfiguration(m_target, m_deployConfigurationModel->deployConfigurationAt(index), SetActive::Cascade); @@ -452,9 +443,9 @@ void RunSettingsWidget::updateRemoveToolButton() void RunSettingsWidget::updateDeployConfiguration(DeployConfiguration *dc) { delete m_deployConfigurationWidget; - m_deployConfigurationWidget = 0; + m_deployConfigurationWidget = nullptr; delete m_deploySteps; - m_deploySteps = 0; + m_deploySteps = nullptr; m_ignoreChange = true; m_deployConfigurationCombo->setCurrentIndex(-1); @@ -485,7 +476,7 @@ void RunSettingsWidget::setConfigurationWidget(RunConfiguration *rc) return; delete m_runConfigurationWidget; - m_runConfigurationWidget = 0; + m_runConfigurationWidget = nullptr; removeSubWidgets(); if (!rc) return; @@ -540,7 +531,7 @@ void RunSettingsWidget::addSubWidget(RunConfigWidget *widget) { widget->setContentsMargins(0, 10, 0, 0); - QLabel *label = new QLabel(this); + auto label = new QLabel(this); label->setText(widget->displayName()); connect(widget, &RunConfigWidget::displayNameChanged, label, &QLabel::setText); diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.h b/src/plugins/projectexplorer/runsettingspropertiespage.h index e03408cd22..839a1e5688 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.h +++ b/src/plugins/projectexplorer/runsettingspropertiespage.h @@ -48,8 +48,6 @@ class Target; namespace Internal { -const char RUNSETTINGS_PANEL_ID[] = "ProjectExplorer.RunSettingsPanel"; - class BuildStepListWidget; class RunSettingsWidget : public QWidget @@ -85,15 +83,15 @@ private: Target *m_target; RunConfigurationModel *m_runConfigurationsModel; DeployConfigurationModel *m_deployConfigurationModel; - QWidget *m_runConfigurationWidget; - RunConfiguration *m_runConfiguration; - QVBoxLayout *m_runLayout; - NamedWidget *m_deployConfigurationWidget; - QVBoxLayout *m_deployLayout; - BuildStepListWidget *m_deploySteps; + QWidget *m_runConfigurationWidget = nullptr; + RunConfiguration *m_runConfiguration = nullptr; + QVBoxLayout *m_runLayout = nullptr; + NamedWidget *m_deployConfigurationWidget = nullptr; + QVBoxLayout *m_deployLayout = nullptr; + BuildStepListWidget *m_deploySteps = nullptr; QMenu *m_addRunMenu; QMenu *m_addDeployMenu; - bool m_ignoreChange; + bool m_ignoreChange = false; typedef QPair<RunConfigWidget *, QLabel *> RunConfigItem; QList<RunConfigItem> m_subWidgets; diff --git a/src/plugins/projectexplorer/selectablefilesmodel.cpp b/src/plugins/projectexplorer/selectablefilesmodel.cpp index e3f3abe7b5..5b022468b2 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.cpp +++ b/src/plugins/projectexplorer/selectablefilesmodel.cpp @@ -144,7 +144,7 @@ void SelectableFilesModel::buildTree(const Utils::FileName &baseDir, Tree *tree, } ++m_futureCount; if (fileInfo.isDir()) { - Tree *t = new Tree; + auto t = new Tree; t->parent = tree; t->name = fileInfo.fileName(); t->fullPath = fn; @@ -154,7 +154,7 @@ void SelectableFilesModel::buildTree(const Utils::FileName &baseDir, Tree *tree, allUnchecked &= t->checked == Qt::Unchecked; tree->childDirectories.append(t); } else { - Tree *t = new Tree; + auto t = new Tree; t->parent = tree; t->name = fileInfo.fileName(); t->checked = (m_allFiles || m_files.contains(fn)) ? Qt::Checked : Qt::Unchecked; @@ -193,7 +193,7 @@ int SelectableFilesModel::rowCount(const QModelIndex &parent) const { if (!parent.isValid()) return 1; - Tree *parentT = static_cast<Tree *>(parent.internalPointer()); + auto parentT = static_cast<Tree *>(parent.internalPointer()); return parentT->childDirectories.size() + parentT->visibleFiles.size(); } @@ -201,7 +201,7 @@ QModelIndex SelectableFilesModel::index(int row, int column, const QModelIndex & { if (!parent.isValid()) return createIndex(row, column, m_root); - Tree *parentT = static_cast<Tree *>(parent.internalPointer()); + auto parentT = static_cast<Tree *>(parent.internalPointer()); if (row < parentT->childDirectories.size()) return createIndex(row, column, parentT->childDirectories.at(row)); else @@ -214,7 +214,7 @@ QModelIndex SelectableFilesModel::parent(const QModelIndex &child) const return QModelIndex(); if (!child.internalPointer()) return QModelIndex(); - Tree *parent = static_cast<Tree *>(child.internalPointer())->parent; + auto parent = static_cast<Tree *>(child.internalPointer())->parent; if (!parent) return QModelIndex(); if (!parent->parent) //then the parent is the root @@ -230,7 +230,7 @@ QVariant SelectableFilesModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) return QVariant(); - Tree *t = static_cast<Tree *>(index.internalPointer()); + auto t = static_cast<Tree *>(index.internalPointer()); if (role == Qt::DisplayRole) return t->name; if (role == Qt::CheckStateRole) @@ -247,7 +247,7 @@ bool SelectableFilesModel::setData(const QModelIndex &index, const QVariant &val { if (role == Qt::CheckStateRole) { // We can do that! - Tree *t = static_cast<Tree *>(index.internalPointer()); + auto t = static_cast<Tree *>(index.internalPointer()); t->checked = Qt::CheckState(value.toInt()); propagateDown(index); propagateUp(index); @@ -261,7 +261,7 @@ void SelectableFilesModel::propagateUp(const QModelIndex &index) QModelIndex parent = index.parent(); if (!parent.isValid()) return; - Tree *parentT = static_cast<Tree *>(parent.internalPointer()); + auto parentT = static_cast<Tree *>(parent.internalPointer()); if (!parentT) return; bool allChecked = true; @@ -290,7 +290,7 @@ void SelectableFilesModel::propagateUp(const QModelIndex &index) void SelectableFilesModel::propagateDown(const QModelIndex &index) { - Tree *t = static_cast<Tree *>(index.internalPointer()); + auto t = static_cast<Tree *>(index.internalPointer()); for (int i = 0; i<t->childDirectories.size(); ++i) { t->childDirectories[i]->checked = t->checked; propagateDown(index.child(i, 0)); @@ -405,7 +405,7 @@ Qt::CheckState SelectableFilesModel::applyFilter(const QModelIndex &index) { bool allChecked = true; bool allUnchecked = true; - Tree *t = static_cast<Tree *>(index.internalPointer()); + auto t = static_cast<Tree *>(index.internalPointer()); for (int i=0; i < t->childDirectories.size(); ++i) { Qt::CheckState childCheckState = applyFilter(index.child(i, 0)); @@ -475,7 +475,7 @@ Qt::CheckState SelectableFilesModel::applyFilter(const QModelIndex &index) ++newIndex; } // end of block = newIndex - beginInsertRows(index, visibleIndex, visibleIndex + newIndex-startOfBlock-1); + beginInsertRows(index, visibleIndex, visibleIndex + newIndex - startOfBlock - 1); for (int i= newIndex - 1; i >= startOfBlock; --i) t->visibleFiles.insert(visibleIndex, newRows.at(i)); endInsertRows(); @@ -485,8 +485,8 @@ Qt::CheckState SelectableFilesModel::applyFilter(const QModelIndex &index) break; } if (newIndex != newEnd) { - beginInsertRows(index, visibleIndex, visibleIndex + newEnd-newIndex-1); - for (int i=newEnd-1; i >=newIndex; --i) + beginInsertRows(index, visibleIndex, visibleIndex + newEnd - newIndex - 1); + for (int i = newEnd - 1; i >= newIndex; --i) t->visibleFiles.insert(visibleIndex, newRows.at(i)); endInsertRows(); } @@ -527,7 +527,6 @@ enum class SelectableFilesWidgetRows { SelectableFilesWidget::SelectableFilesWidget(QWidget *parent) : QWidget(parent), - m_model(0), m_baseDirChooser(new Utils::PathChooser), m_baseDirLabel(new QLabel), m_startParsingButton(new QPushButton), @@ -733,7 +732,7 @@ SelectableFilesDialogEditFiles::SelectableFilesDialogEditFiles(const Utils::File m_filesWidget->setBaseDirEditable(false); - QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Horizontal, this); + auto buttonBox = new QDialogButtonBox(Qt::Horizontal, this); buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); connect(buttonBox, &QDialogButtonBox::accepted, diff --git a/src/plugins/projectexplorer/selectablefilesmodel.h b/src/plugins/projectexplorer/selectablefilesmodel.h index f4de2fd253..ec82c055e4 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.h +++ b/src/plugins/projectexplorer/selectablefilesmodel.h @@ -182,7 +182,7 @@ private: void smartExpand(const QModelIndex &index); - SelectableFilesModel *m_model; + SelectableFilesModel *m_model = nullptr; Utils::PathChooser *m_baseDirChooser; QLabel *m_baseDirLabel; diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 116762dceb..2f8e32158d 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -75,15 +75,6 @@ namespace ProjectExplorer { class SessionManagerPrivate { public: - SessionManagerPrivate() : - m_sessionName(QLatin1String("default")), - m_virginSession(true), - m_loadingSession(false), - m_casadeSetActive(false), - m_startupProject(0), - m_writer(0) - {} - bool projectContainsFile(Project *p, const FileName &fileName) const; void restoreValues(const PersistentSettingsReader &reader); void restoreDependencies(const PersistentSettingsReader &reader); @@ -101,30 +92,29 @@ public: public: static QString windowTitleAddition(const QString &filePath); - SessionNode *m_sessionNode; - QString m_sessionName; - bool m_virginSession; + SessionNode *m_sessionNode = nullptr; + QString m_sessionName = QLatin1String("default"); + bool m_virginSession = true; + bool m_loadingSession = false; + bool m_casadeSetActive = false; mutable QStringList m_sessions; mutable QHash<Project *, QStringList> m_projectFileCache; - bool m_loadingSession; - bool m_casadeSetActive; - Project *m_startupProject; + Project *m_startupProject = nullptr; QList<Project *> m_projects; QStringList m_failedProjects; QMap<QString, QStringList> m_depMap; QMap<QString, QVariant> m_values; QFutureInterface<void> m_future; - PersistentSettingsWriter *m_writer; + PersistentSettingsWriter *m_writer = nullptr; }; static SessionManager *m_instance = nullptr; static SessionManagerPrivate *d = nullptr; -SessionManager::SessionManager(QObject *parent) - : QObject(parent) +SessionManager::SessionManager(QObject *parent) : QObject(parent) { m_instance = this; d = new SessionManagerPrivate; @@ -173,11 +163,10 @@ bool SessionManager::isDefaultSession(const QString &session) return session == QLatin1String("default"); } - -void SessionManager::saveActiveMode(IMode *mode) +void SessionManager::saveActiveMode(Id mode) { - if (mode->id() != Core::Constants::MODE_WELCOME) - setValue(QLatin1String("ActiveMode"), mode->id().toString()); + if (mode != Core::Constants::MODE_WELCOME) + setValue(QLatin1String("ActiveMode"), mode.toString()); } void SessionManager::clearProjectFileCache() @@ -473,7 +462,7 @@ bool SessionManager::save() data.insert(QLatin1String("CascadeSetActive"), d->m_casadeSetActive); QMap<QString, QVariant> depMap; - QMap<QString, QStringList>::const_iterator i = d->m_depMap.constBegin(); + auto i = d->m_depMap.constBegin(); while (i != d->m_depMap.constEnd()) { QString key = i.key(); QStringList values; @@ -485,9 +474,9 @@ bool SessionManager::save() data.insert(QLatin1String("ProjectDependencies"), QVariant(depMap)); data.insert(QLatin1String("EditorSettings"), EditorManager::saveState().toBase64()); - QMap<QString, QVariant>::const_iterator it, end = d->m_values.constEnd(); + auto end = d->m_values.constEnd(); QStringList keys; - for (it = d->m_values.constBegin(); it != end; ++it) { + for (auto it = d->m_values.constBegin(); it != end; ++it) { data.insert(QLatin1String("value-") + it.key(), it.value()); keys << it.key(); } @@ -575,7 +564,7 @@ QStringList SessionManagerPrivate::dependenciesOrder() const } while (!unordered.isEmpty()) { - for (int i=(unordered.count()-1); i>=0; --i) { + for (int i = (unordered.count() - 1); i >= 0; --i) { if (unordered.at(i).second.isEmpty()) { ordered << unordered.at(i).first; unordered.removeAt(i); @@ -711,7 +700,7 @@ void SessionManager::removeProjects(QList<Project *> remove) projectFiles.insert(pro->projectFilePath().toString()); } - QSet<QString>::const_iterator i = projectFiles.begin(); + auto i = projectFiles.begin(); while (i != projectFiles.end()) { QStringList dependencies; foreach (const QString &dependency, d->m_depMap.value(*i)) { @@ -763,7 +752,7 @@ void SessionManager::setValue(const QString &name, const QVariant &value) QVariant SessionManager::value(const QString &name) { - QMap<QString, QVariant>::const_iterator it = d->m_values.constFind(name); + auto it = d->m_values.constFind(name); return (it == d->m_values.constEnd()) ? QVariant() : *it; } @@ -866,7 +855,7 @@ void SessionManagerPrivate::restoreValues(const PersistentSettingsReader &reader void SessionManagerPrivate::restoreDependencies(const PersistentSettingsReader &reader) { QMap<QString, QVariant> depMap = reader.restoreValue(QLatin1String("ProjectDependencies")).toMap(); - QMap<QString, QVariant>::const_iterator i = depMap.constBegin(); + auto i = depMap.constBegin(); while (i != depMap.constEnd()) { const QString &key = i.key(); if (!m_failedProjects.contains(key)) { diff --git a/src/plugins/projectexplorer/session.h b/src/plugins/projectexplorer/session.h index 9912b4fa03..ce37b59125 100644 --- a/src/plugins/projectexplorer/session.h +++ b/src/plugins/projectexplorer/session.h @@ -27,23 +27,14 @@ #include "projectexplorer_export.h" +#include <coreplugin/id.h> + #include <utils/persistentsettings.h> -#include <QHash> #include <QString> #include <QStringList> -#include <QMap> -#include <QFutureInterface> - -QT_BEGIN_NAMESPACE -class QAbstractItemModel; -class QTimer; -QT_END_NAMESPACE -namespace Core { -class IMode; -class IEditor; -} // namespace Core +namespace Core { class IEditor; } namespace ProjectExplorer { @@ -61,7 +52,7 @@ class PROJECTEXPLORER_EXPORT SessionManager : public QObject Q_OBJECT public: - explicit SessionManager(QObject *parent = 0); + explicit SessionManager(QObject *parent = nullptr); ~SessionManager() override; static SessionManager *instance(); @@ -148,7 +139,7 @@ signals: void dependencyChanged(ProjectExplorer::Project *a, ProjectExplorer::Project *b); private: - static void saveActiveMode(Core::IMode *mode); + static void saveActiveMode(Core::Id mode); void clearProjectFileCache(); static void configureEditor(Core::IEditor *editor, const QString &fileName); static void markSessionFileDirty(bool makeDefaultVirginDirty = true); diff --git a/src/plugins/projectexplorer/sessiondialog.cpp b/src/plugins/projectexplorer/sessiondialog.cpp index 8e05f7673b..2f6f6b15dc 100644 --- a/src/plugins/projectexplorer/sessiondialog.cpp +++ b/src/plugins/projectexplorer/sessiondialog.cpp @@ -81,13 +81,13 @@ void SessionValidator::fixup(QString &input) const SessionNameInputDialog::SessionNameInputDialog(const QStringList &sessions, QWidget *parent) : QDialog(parent), m_usedSwitchTo(false) { - QVBoxLayout *hlayout = new QVBoxLayout(this); - QLabel *label = new QLabel(tr("Enter the name of the session:"), this); + auto hlayout = new QVBoxLayout(this); + auto label = new QLabel(tr("Enter the name of the session:"), this); hlayout->addWidget(label); m_newSessionLineEdit = new QLineEdit(this); m_newSessionLineEdit->setValidator(new SessionValidator(this, sessions)); hlayout->addWidget(m_newSessionLineEdit); - QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); + auto buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); m_switchToButton = buttons->addButton(tr("Switch To"), QDialogButtonBox::AcceptRole); connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject); @@ -118,8 +118,7 @@ bool SessionNameInputDialog::isSwitchToRequested() const } -SessionDialog::SessionDialog(QWidget *parent) - : QDialog(parent) +SessionDialog::SessionDialog(QWidget *parent) : QDialog(parent) { m_ui.setupUi(this); diff --git a/src/plugins/projectexplorer/sessiondialog.h b/src/plugins/projectexplorer/sessiondialog.h index 4cf231f29e..bb1ae10dd4 100644 --- a/src/plugins/projectexplorer/sessiondialog.h +++ b/src/plugins/projectexplorer/sessiondialog.h @@ -43,7 +43,7 @@ class SessionDialog : public QDialog Q_OBJECT public: - explicit SessionDialog(QWidget *parent = 0); + explicit SessionDialog(QWidget *parent = nullptr); void setAutoLoadSession(bool); bool autoLoadSession() const; @@ -68,7 +68,7 @@ class SessionNameInputDialog : public QDialog Q_OBJECT public: - explicit SessionNameInputDialog(const QStringList &sessions, QWidget *parent = 0); + explicit SessionNameInputDialog(const QStringList &sessions, QWidget *parent = nullptr); void setValue(const QString &value); QString value() const; diff --git a/src/plugins/projectexplorer/settingsaccessor.cpp b/src/plugins/projectexplorer/settingsaccessor.cpp index c7094ae154..28514964d1 100644 --- a/src/plugins/projectexplorer/settingsaccessor.cpp +++ b/src/plugins/projectexplorer/settingsaccessor.cpp @@ -2083,7 +2083,7 @@ QVariantMap UserFileVersion11Upgrader::upgrade(const QVariantMap &map) const QString oldTargetId = extraTargetData.value(QLatin1String("ProjectExplorer.ProjectConfiguration.Id")).toString(); // Check each BCs/DCs and create profiles as needed - Kit *rawKit = new Kit; // Do not needlessly use Core::Ids + auto rawKit = new Kit; // Do not needlessly use Core::Ids QMapIterator<int, QVariantMap> buildIt(bcs); while (buildIt.hasNext()) { buildIt.next(); diff --git a/src/plugins/projectexplorer/showoutputtaskhandler.h b/src/plugins/projectexplorer/showoutputtaskhandler.h index 2d17342d57..2c9aa230d0 100644 --- a/src/plugins/projectexplorer/showoutputtaskhandler.h +++ b/src/plugins/projectexplorer/showoutputtaskhandler.h @@ -44,7 +44,7 @@ public: QAction *createAction(QObject *parent) const override; private: - CompileOutputWindow * m_window; + CompileOutputWindow *m_window; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index e42a76ec1d..be131f39e0 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -154,35 +154,35 @@ Target::~Target() void Target::changeEnvironment() { - BuildConfiguration *bc = qobject_cast<BuildConfiguration *>(sender()); + auto bc = qobject_cast<BuildConfiguration *>(sender()); if (bc == activeBuildConfiguration()) emit environmentChanged(); } void Target::changeBuildConfigurationEnabled() { - BuildConfiguration *bc = qobject_cast<BuildConfiguration *>(sender()); + auto bc = qobject_cast<BuildConfiguration *>(sender()); if (bc == activeBuildConfiguration()) emit buildConfigurationEnabledChanged(); } void Target::changeDeployConfigurationEnabled() { - DeployConfiguration *dc = qobject_cast<DeployConfiguration *>(sender()); + auto dc = qobject_cast<DeployConfiguration *>(sender()); if (dc == activeDeployConfiguration()) emit deployConfigurationEnabledChanged(); } void Target::changeRunConfigurationEnabled() { - RunConfiguration *rc = qobject_cast<RunConfiguration *>(sender()); + auto rc = qobject_cast<RunConfiguration *>(sender()); if (rc == activeRunConfiguration()) emit runConfigurationEnabledChanged(); } void Target::onBuildDirectoryChanged() { - BuildConfiguration *bc = qobject_cast<BuildConfiguration *>(sender()); + auto bc = qobject_cast<BuildConfiguration *>(sender()); if (bc && activeBuildConfiguration() == bc) emit buildDirectoryChanged(); } @@ -263,7 +263,7 @@ bool Target::removeBuildConfiguration(BuildConfiguration *configuration) if (activeBuildConfiguration() == configuration) { if (d->m_buildConfigurations.isEmpty()) - SessionManager::setActiveBuildConfiguration(this, 0, SetActive::Cascade); + SessionManager::setActiveBuildConfiguration(this, nullptr, SetActive::Cascade); else SessionManager::setActiveBuildConfiguration(this, d->m_buildConfigurations.at(0), SetActive::Cascade); } @@ -337,7 +337,7 @@ bool Target::removeDeployConfiguration(DeployConfiguration *dc) if (activeDeployConfiguration() == dc) { if (d->m_deployConfigurations.isEmpty()) - SessionManager::setActiveDeployConfiguration(this, 0, SetActive::Cascade); + SessionManager::setActiveDeployConfiguration(this, nullptr, SetActive::Cascade); else SessionManager::setActiveDeployConfiguration(this, d->m_deployConfigurations.at(0), SetActive::Cascade); @@ -431,7 +431,7 @@ void Target::removeRunConfiguration(RunConfiguration* runConfiguration) if (activeRunConfiguration() == runConfiguration) { if (d->m_runConfigurations.isEmpty()) - setActiveRunConfiguration(0); + setActiveRunConfiguration(nullptr); else setActiveRunConfiguration(d->m_runConfigurations.at(0)); } diff --git a/src/plugins/projectexplorer/target.h b/src/plugins/projectexplorer/target.h index b3498b0a29..c83da9c1a2 100644 --- a/src/plugins/projectexplorer/target.h +++ b/src/plugins/projectexplorer/target.h @@ -174,4 +174,3 @@ private: }; } // namespace ProjectExplorer - diff --git a/src/plugins/projectexplorer/targetselector.cpp b/src/plugins/projectexplorer/targetselector.cpp index 9b1f72409e..9c7062536e 100644 --- a/src/plugins/projectexplorer/targetselector.cpp +++ b/src/plugins/projectexplorer/targetselector.cpp @@ -394,7 +394,7 @@ void TargetSelector::updateButtons() bool TargetSelector::event(QEvent *e) { if (e->type() == QEvent::ToolTip) { - const QHelpEvent *helpEvent = static_cast<const QHelpEvent *>(e); + auto helpEvent = static_cast<const QHelpEvent *>(e); int targetIndex; int subTargetIndex; getControlAt(helpEvent->x(), helpEvent->y(), 0, &targetIndex, &subTargetIndex); diff --git a/src/plugins/projectexplorer/targetselector.h b/src/plugins/projectexplorer/targetselector.h index bad62d0339..13e21770b5 100644 --- a/src/plugins/projectexplorer/targetselector.h +++ b/src/plugins/projectexplorer/targetselector.h @@ -39,7 +39,8 @@ class QPixmapButton; class TargetSelector : public QWidget { -Q_OBJECT + Q_OBJECT + public: class Target { public: @@ -47,7 +48,7 @@ public: int currentSubIndex; }; - explicit TargetSelector(QWidget *parent = 0); + explicit TargetSelector(QWidget *parent = nullptr); QSize sizeHint() const override; diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index cb7b25552f..046a4f2a46 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -76,8 +76,8 @@ TargetSettingsPanelWidget::TargetSettingsPanelWidget(Project *project) : { Q_ASSERT(m_project); - m_panelWidgets[0] = 0; - m_panelWidgets[1] = 0; + m_panelWidgets[0] = nullptr; + m_panelWidgets[1] = nullptr; m_addMenu = new QMenu(this); m_targetMenu = new QMenu(this); @@ -114,8 +114,8 @@ TargetSettingsPanelWidget::~TargetSettingsPanelWidget() bool TargetSettingsPanelWidget::event(QEvent *event) { if (event->type() == QEvent::StatusTip) { - QAction *act = 0; - QMenu *menu = 0; + QAction *act = nullptr; + QMenu *menu = nullptr; if (m_addMenu->activeAction()) { menu = m_addMenu; act = m_addMenu->activeAction(); @@ -129,7 +129,7 @@ bool TargetSettingsPanelWidget::event(QEvent *event) return QWidget::event(event); } - QStatusTipEvent *ev = static_cast<QStatusTipEvent *>(event); + auto ev = static_cast<QStatusTipEvent *>(event); ev->accept(); if (act != m_lastAction) @@ -154,7 +154,7 @@ bool TargetSettingsPanelWidget::event(QEvent *event) void TargetSettingsPanelWidget::setupUi() { - QVBoxLayout *viewLayout = new QVBoxLayout(this); + auto viewLayout = new QVBoxLayout(this); viewLayout->setMargin(0); viewLayout->setSpacing(0); @@ -167,9 +167,9 @@ void TargetSettingsPanelWidget::setupUi() // no target label: m_noTargetLabel = new QWidget; - QVBoxLayout *noTargetLayout = new QVBoxLayout(m_noTargetLabel); + auto noTargetLayout = new QVBoxLayout(m_noTargetLabel); noTargetLayout->setMargin(0); - QLabel *label = new QLabel(m_noTargetLabel); + auto label = new QLabel(m_noTargetLabel); label->setText(tr("No kit defined in this project.")); { QFont f = label->font(); @@ -219,9 +219,9 @@ void TargetSettingsPanelWidget::currentTargetChanged(int targetIndex, int subInd if (targetIndex == -1 || subIndex == -1) { // no more kits! delete m_panelWidgets[0]; - m_panelWidgets[0] = 0; + m_panelWidgets[0] = nullptr; delete m_panelWidgets[1]; - m_panelWidgets[1] = 0; + m_panelWidgets[1] = nullptr; m_centralWidget->setCurrentWidget(m_noTargetLabel); return; @@ -245,9 +245,9 @@ void TargetSettingsPanelWidget::currentTargetChanged(int targetIndex, int subInd auto wrapWidgetInPropertiesPanel = [](QWidget *widget, const QString &displayName, const QIcon &icon) -> PropertiesPanel *{ - PropertiesPanel *panel = new PropertiesPanel; - QWidget *w = new QWidget(); - QVBoxLayout *l = new QVBoxLayout(w); + auto panel = new PropertiesPanel; + auto w = new QWidget(); + auto l = new QVBoxLayout(w); l->addWidget(widget); l->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); l->setContentsMargins(QMargins()); @@ -264,8 +264,8 @@ void TargetSettingsPanelWidget::currentTargetChanged(int targetIndex, int subInd RunSettingsWidget::tr("Run Settings"), QIcon(QLatin1String(":/projectexplorer/images/RunSettings.png"))); - PanelsWidget *buildPanel = new PanelsWidget(m_centralWidget); - PanelsWidget *runPanel = new PanelsWidget(m_centralWidget); + auto buildPanel = new PanelsWidget(m_centralWidget); + auto runPanel = new PanelsWidget(m_centralWidget); buildPanel->addPropertiesPanel(build); runPanel->addPropertiesPanel(run); @@ -413,7 +413,7 @@ void TargetSettingsPanelWidget::activeTargetChanged(Target *target) void TargetSettingsPanelWidget::createAction(Kit *k, QMenu *menu) { - QAction *action = new QAction(k->displayName(), menu); + auto action = new QAction(k->displayName(), menu); action->setData(QVariant::fromValue(k->id())); QString statusTip = QLatin1String("<html><body>"); QString errorMessage; @@ -442,7 +442,7 @@ void TargetSettingsPanelWidget::updateTargetButtons() foreach (IPotentialKit *potentialKit, potentialKits) { if (!potentialKit->isEnabled()) continue; - QAction *action = new QAction(potentialKit->displayName(), m_addMenu); + auto action = new QAction(potentialKit->displayName(), m_addMenu); action->setData(QVariant::fromValue(potentialKit)); m_addMenu->addAction(action); } @@ -480,7 +480,7 @@ void TargetSettingsPanelWidget::updateTargetButtons() void TargetSettingsPanelWidget::renameTarget() { - Target *t = qobject_cast<Target *>(sender()); + auto t = qobject_cast<Target *>(sender()); if (!t) return; const int pos = m_targets.indexOf(t); @@ -504,8 +504,8 @@ void TargetSettingsPanelWidget::importTarget(const Utils::FileName &path) if (!m_importer) return; - Target *target = 0; - BuildConfiguration *bc = 0; + Target *target = nullptr; + BuildConfiguration *bc = nullptr; QList<BuildInfo *> toImport = m_importer->import(path, false); foreach (BuildInfo *info, toImport) { target = m_project->target(info->kitId); diff --git a/src/plugins/projectexplorer/targetsettingspanel.h b/src/plugins/projectexplorer/targetsettingspanel.h index 7705224c09..8b65e0cf70 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.h +++ b/src/plugins/projectexplorer/targetsettingspanel.h @@ -80,20 +80,20 @@ private: void importTarget(const Utils::FileName &path); void createAction(Kit *k, QMenu *menu); - Target *m_currentTarget = 0; + Target *m_currentTarget = nullptr; Project *m_project; ProjectImporter *m_importer; - TargetSettingsWidget *m_selector = 0; - QStackedWidget *m_centralWidget = 0; + TargetSettingsWidget *m_selector = nullptr; + QStackedWidget *m_centralWidget = nullptr; QWidget *m_noTargetLabel; PanelsWidget *m_panelWidgets[2]; QList<Target *> m_targets; QMenu *m_targetMenu; - QMenu *m_changeMenu = 0; - QMenu *m_duplicateMenu = 0; + QMenu *m_changeMenu = nullptr; + QMenu *m_duplicateMenu = nullptr; QMenu *m_addMenu; - QAction *m_lastAction = 0; - QAction *m_importAction = 0; + QAction *m_lastAction = nullptr; + QAction *m_importAction = nullptr; int m_menuTargetIndex = -1; static int s_targetSubIndex; }; diff --git a/src/plugins/projectexplorer/targetsettingswidget.cpp b/src/plugins/projectexplorer/targetsettingswidget.cpp index 397e750a23..5517a4ebea 100644 --- a/src/plugins/projectexplorer/targetsettingswidget.cpp +++ b/src/plugins/projectexplorer/targetsettingswidget.cpp @@ -32,8 +32,7 @@ using namespace ProjectExplorer::Internal; -TargetSettingsWidget::TargetSettingsWidget(QWidget *parent) : - QWidget(parent), +TargetSettingsWidget::TargetSettingsWidget(QWidget *parent) : QWidget(parent), ui(new Ui::TargetSettingsWidget), m_targetSelector(new TargetSelector(this)) { @@ -48,12 +47,12 @@ TargetSettingsWidget::TargetSettingsWidget(QWidget *parent) : "}")); } - QHBoxLayout *headerLayout = new QHBoxLayout; + auto headerLayout = new QHBoxLayout; headerLayout->setContentsMargins(5, 3, 0, 0); ui->header->setLayout(headerLayout); - QWidget *buttonWidget = new QWidget(ui->header); - QVBoxLayout *buttonLayout = new QVBoxLayout; + auto buttonWidget = new QWidget(ui->header); + auto buttonLayout = new QVBoxLayout; buttonLayout->setContentsMargins(0, 0, 0, 0); buttonLayout->setSpacing(4); buttonWidget->setLayout(buttonLayout); diff --git a/src/plugins/projectexplorer/targetsettingswidget.h b/src/plugins/projectexplorer/targetsettingswidget.h index ee6573c384..55597af352 100644 --- a/src/plugins/projectexplorer/targetsettingswidget.h +++ b/src/plugins/projectexplorer/targetsettingswidget.h @@ -44,7 +44,7 @@ class TargetSettingsWidget : public QWidget Q_OBJECT public: - explicit TargetSettingsWidget(QWidget *parent = 0); + explicit TargetSettingsWidget(QWidget *parent = nullptr); ~TargetSettingsWidget() override; void setCentralWidget(QWidget *widget); @@ -78,7 +78,7 @@ private: TargetSelector *m_targetSelector; QPushButton *m_addButton; QPushButton *m_manageButton; - QWidget *m_centralWidget = 0; + QWidget *m_centralWidget = nullptr; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/targetsetuppage.cpp b/src/plugins/projectexplorer/targetsetuppage.cpp index 7b6d250972..447df63542 100644 --- a/src/plugins/projectexplorer/targetsetuppage.cpp +++ b/src/plugins/projectexplorer/targetsetuppage.cpp @@ -67,7 +67,7 @@ public: void setupUi(TargetSetupPage *q) { - QWidget *setupTargetPage = new QWidget(q); + auto setupTargetPage = new QWidget(q); descriptionLabel = new QLabel(setupTargetPage); descriptionLabel->setWordWrap(true); descriptionLabel->setVisible(false); @@ -104,17 +104,16 @@ public: scrollArea = new QScrollArea(scrollAreaWidget); scrollArea->setWidgetResizable(true); - QWidget *scrollAreaWidgetContents; - scrollAreaWidgetContents = new QWidget(); + auto scrollAreaWidgetContents = new QWidget(); scrollAreaWidgetContents->setGeometry(QRect(0, 0, 230, 81)); scrollArea->setWidget(scrollAreaWidgetContents); - QVBoxLayout *verticalLayout = new QVBoxLayout(scrollAreaWidget); + auto verticalLayout = new QVBoxLayout(scrollAreaWidget); verticalLayout->setSpacing(0); verticalLayout->setContentsMargins(0, 0, 0, 0); verticalLayout->addWidget(scrollArea); - QVBoxLayout *verticalLayout_2 = new QVBoxLayout(setupTargetPage); + auto verticalLayout_2 = new QVBoxLayout(setupTargetPage); verticalLayout_2->addWidget(headerLabel); verticalLayout_2->addWidget(noValidKitLabel); verticalLayout_2->addWidget(descriptionLabel); @@ -123,7 +122,7 @@ public: verticalLayout_2->addWidget(centralWidget); verticalLayout_2->addWidget(scrollAreaWidget); - QVBoxLayout *verticalLayout_3 = new QVBoxLayout(q); + auto verticalLayout_3 = new QVBoxLayout(q); verticalLayout_3->setContentsMargins(0, 0, 0, -1); verticalLayout_3->addWidget(setupTargetPage); @@ -141,13 +140,9 @@ using namespace Internal; TargetSetupPage::TargetSetupPage(QWidget *parent) : Utils::WizardPage(parent), - m_importer(0), - m_baseLayout(0), - m_firstWidget(0), m_ui(new TargetSetupPageUi), m_importWidget(new ImportWidget(this)), - m_spacer(new QSpacerItem(0,0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)), - m_forceOptionHint(false) + m_spacer(new QSpacerItem(0,0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)) { m_importWidget->setVisible(false); @@ -161,7 +156,7 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) : policy.setHeightForWidth(sizePolicy().hasHeightForWidth()); setSizePolicy(policy); - QWidget *centralWidget = new QWidget(this); + auto centralWidget = new QWidget(this); m_ui->scrollArea->setWidget(centralWidget); centralWidget->setLayout(new QVBoxLayout); m_ui->centralWidget->setLayout(new QVBoxLayout); @@ -206,9 +201,8 @@ void TargetSetupPage::setRequiredKitMatcher(const KitMatcher &matcher) QList<Core::Id> TargetSetupPage::selectedKits() const { QList<Core::Id> result; - QMap<Core::Id, TargetSetupWidget *>::const_iterator it, end; - it = m_widgets.constBegin(); - end = m_widgets.constEnd(); + auto it = m_widgets.constBegin(); + auto end = m_widgets.constEnd(); for ( ; it != end; ++it) { if (isKitSelected(it.key())) @@ -510,7 +504,7 @@ TargetSetupWidget *TargetSetupPage::addWidget(Kit *k) return 0; QList<BuildInfo *> infoList = factory->availableSetups(k, m_projectPath); - TargetSetupWidget *widget = infoList.isEmpty() ? 0 : new TargetSetupWidget(k, m_projectPath, infoList); + TargetSetupWidget *widget = infoList.isEmpty() ? nullptr : new TargetSetupWidget(k, m_projectPath, infoList); if (!widget) return 0; diff --git a/src/plugins/projectexplorer/targetsetuppage.h b/src/plugins/projectexplorer/targetsetuppage.h index c2d5b1d73b..d004143634 100644 --- a/src/plugins/projectexplorer/targetsetuppage.h +++ b/src/plugins/projectexplorer/targetsetuppage.h @@ -57,7 +57,7 @@ class PROJECTEXPLORER_EXPORT TargetSetupPage : public Utils::WizardPage Q_OBJECT public: - explicit TargetSetupPage(QWidget *parent = 0); + explicit TargetSetupPage(QWidget *parent = nullptr); ~TargetSetupPage() override; /// Initializes the TargetSetupPage @@ -109,12 +109,12 @@ private: KitMatcher m_requiredMatcher; KitMatcher m_preferredMatcher; - ProjectImporter *m_importer; - QLayout *m_baseLayout; + ProjectImporter *m_importer = nullptr; + QLayout *m_baseLayout = nullptr; QString m_projectPath; QString m_defaultShadowBuildLocation; QMap<Core::Id, Internal::TargetSetupWidget *> m_widgets; - Internal::TargetSetupWidget *m_firstWidget; + Internal::TargetSetupWidget *m_firstWidget = nullptr; Internal::TargetSetupPageUi *m_ui; @@ -122,7 +122,7 @@ private: QSpacerItem *m_spacer; QList<QWidget *> m_potentialWidgets; - bool m_forceOptionHint; + bool m_forceOptionHint = false; }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/targetsetupwidget.cpp b/src/plugins/projectexplorer/targetsetupwidget.cpp index 101d8dde92..c5aaab3c88 100644 --- a/src/plugins/projectexplorer/targetsetupwidget.cpp +++ b/src/plugins/projectexplorer/targetsetupwidget.cpp @@ -56,15 +56,12 @@ namespace Internal { TargetSetupWidget::TargetSetupWidget(Kit *k, const QString &projectPath, const QList<BuildInfo *> &infoList) : - m_kit(k), - m_haveImported(false), - m_ignoreChange(false), - m_selected(0) + m_kit(k) { Q_ASSERT(m_kit); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - QVBoxLayout *vboxLayout = new QVBoxLayout(); + auto vboxLayout = new QVBoxLayout(); setLayout(vboxLayout); vboxLayout->setContentsMargins(0, 0, 0, 0); m_detailsWidget = new Utils::DetailsWidget(this); @@ -74,20 +71,20 @@ TargetSetupWidget::TargetSetupWidget(Kit *k, m_detailsWidget->setToolTip(m_kit->toHtml()); vboxLayout->addWidget(m_detailsWidget); - Utils::FadingWidget *panel = new Utils::FadingWidget(m_detailsWidget); - QHBoxLayout *panelLayout = new QHBoxLayout(panel); + auto panel = new Utils::FadingWidget(m_detailsWidget); + auto panelLayout = new QHBoxLayout(panel); m_manageButton = new QPushButton(KitConfigWidget::msgManage()); panelLayout->addWidget(m_manageButton); m_detailsWidget->setToolWidget(panel); handleKitUpdate(m_kit); - QWidget *widget = new QWidget; - QVBoxLayout *layout = new QVBoxLayout; + auto widget = new QWidget; + auto layout = new QVBoxLayout; widget->setLayout(layout); layout->setContentsMargins(0, 0, 0, 0); - QWidget *w = new QWidget; + auto w = new QWidget; m_newBuildsLayout = new QGridLayout; m_newBuildsLayout->setMargin(0); if (Utils::HostOsInfo::isMacHost()) @@ -125,7 +122,7 @@ Kit *TargetSetupWidget::kit() void TargetSetupWidget::clearKit() { - m_kit = 0; + m_kit = nullptr; } bool TargetSetupWidget::isKitSelected() const @@ -165,20 +162,20 @@ void TargetSetupWidget::addBuildInfo(BuildInfo *info, bool isImport) m_infoList << info; - QCheckBox *checkbox = new QCheckBox; + auto checkbox = new QCheckBox; checkbox->setText(info->displayName); checkbox->setChecked(m_enabled.at(pos)); checkbox->setAttribute(Qt::WA_LayoutUsesWidgetRect); m_newBuildsLayout->addWidget(checkbox, pos * 2, 0); - Utils::PathChooser *pathChooser = new Utils::PathChooser(); + auto pathChooser = new Utils::PathChooser(); pathChooser->setExpectedKind(Utils::PathChooser::Directory); pathChooser->setFileName(info->buildDirectory); pathChooser->setHistoryCompleter(QLatin1String("TargetSetup.BuildDir.History")); pathChooser->setReadOnly(isImport); m_newBuildsLayout->addWidget(pathChooser, pos * 2, 1); - QLabel *reportIssuesLabel = new QLabel; + auto reportIssuesLabel = new QLabel; reportIssuesLabel->setIndent(32); m_newBuildsLayout->addWidget(reportIssuesLabel, pos * 2 + 1, 0, 1, 2); reportIssuesLabel->setVisible(false); @@ -289,7 +286,7 @@ void TargetSetupWidget::clear() void TargetSetupWidget::checkBoxToggled(bool b) { - QCheckBox *box = qobject_cast<QCheckBox *>(sender()); + auto box = qobject_cast<QCheckBox *>(sender()); if (!box) return; int index = m_checkboxes.indexOf(box); @@ -309,7 +306,7 @@ void TargetSetupWidget::pathChanged() { if (m_ignoreChange) return; - Utils::PathChooser *pathChooser = qobject_cast<Utils::PathChooser *>(sender()); + auto pathChooser = qobject_cast<Utils::PathChooser *>(sender()); if (!pathChooser) return; int index = m_pathChoosers.indexOf(pathChooser); diff --git a/src/plugins/projectexplorer/targetsetupwidget.h b/src/plugins/projectexplorer/targetsetupwidget.h index f4fa60f603..c3d83d55a7 100644 --- a/src/plugins/projectexplorer/targetsetupwidget.h +++ b/src/plugins/projectexplorer/targetsetupwidget.h @@ -91,7 +91,7 @@ private: Kit *m_kit; QString m_projectPath; - bool m_haveImported; + bool m_haveImported = false; Utils::DetailsWidget *m_detailsWidget; QPushButton *m_manageButton; QGridLayout *m_newBuildsLayout; @@ -101,8 +101,8 @@ private: QList<bool> m_enabled; QList<QLabel *> m_reportIssuesLabels; QList<bool> m_issues; - bool m_ignoreChange; - int m_selected; // Number of selected buildconfiguartions + bool m_ignoreChange = false; + int m_selected = 0; // Number of selected buildconfiguartions }; } // namespace Internal diff --git a/src/plugins/projectexplorer/task.cpp b/src/plugins/projectexplorer/task.cpp index 91e6d5c987..5849601ca0 100644 --- a/src/plugins/projectexplorer/task.cpp +++ b/src/plugins/projectexplorer/task.cpp @@ -83,10 +83,10 @@ Task Task::buildConfigurationMissingTask() Constants::TASK_CATEGORY_BUILDSYSTEM); } -void Task::addMark(TextEditor::TextMark *mark) +void Task::setMark(TextEditor::TextMark *mark) { + QTC_ASSERT(mark, return); QTC_ASSERT(m_mark.isNull(), return); - m_mark = QSharedPointer<TextEditor::TextMark>(mark); } diff --git a/src/plugins/projectexplorer/task.h b/src/plugins/projectexplorer/task.h index 592bef9cab..af8126c40e 100644 --- a/src/plugins/projectexplorer/task.h +++ b/src/plugins/projectexplorer/task.h @@ -37,6 +37,8 @@ namespace ProjectExplorer { +class TaskHub; + // Documentation inside. class PROJECTEXPLORER_EXPORT Task { @@ -66,7 +68,6 @@ public: int movedLine = -1; // contains a line number if the line was moved in the editor Core::Id category; QIcon icon; - void addMark(TextEditor::TextMark *mark); // Having a QList<QTextLayout::FormatRange> in Task isn't that great // It would be cleaner to split up the text into @@ -79,8 +80,12 @@ public: QList<QTextLayout::FormatRange> formats; private: + void setMark(TextEditor::TextMark *mark); + QSharedPointer<TextEditor::TextMark> m_mark; static unsigned int s_nextId; + + friend class TaskHub; }; bool PROJECTEXPLORER_EXPORT operator==(const Task &t1, const Task &t2); diff --git a/src/plugins/projectexplorer/taskhub.cpp b/src/plugins/projectexplorer/taskhub.cpp index 5b5aa4dd0b..beb2086b1c 100644 --- a/src/plugins/projectexplorer/taskhub.cpp +++ b/src/plugins/projectexplorer/taskhub.cpp @@ -33,7 +33,7 @@ using namespace ProjectExplorer; -TaskHub *m_instance = 0; +static TaskHub *m_instance = nullptr; QVector<Core::Id> TaskHub::m_registeredCategories; static Core::Id categoryForType(Task::TaskType type) @@ -51,9 +51,10 @@ static Core::Id categoryForType(Task::TaskType type) class TaskMark : public TextEditor::TextMark { public: - TaskMark(unsigned int id, const QString &fileName, int lineNumber, Task::TaskType type, bool visible) - : TextMark(fileName, lineNumber, categoryForType(type)) - , m_id(id) + TaskMark(unsigned int id, const QString &fileName, int lineNumber, + Task::TaskType type, bool visible) : + TextMark(fileName, lineNumber, categoryForType(type)), + m_id(id) { setVisible(visible); } @@ -108,7 +109,7 @@ TaskHub::TaskHub() TaskHub::~TaskHub() { - m_instance = 0; + m_instance = nullptr; } void TaskHub::addCategory(Core::Id categoryId, const QString &displayName, bool visible) @@ -133,20 +134,18 @@ void TaskHub::addTask(Task task) { QTC_ASSERT(m_registeredCategories.contains(task.category), return); QTC_ASSERT(!task.description.isEmpty(), return); + QTC_ASSERT(!task.isNull(), return); + QTC_ASSERT(task.m_mark.isNull(), return); - if (task.file.isEmpty()) - task.line = -1; - - if (task.line <= 0) + if (task.file.isEmpty() || task.line <= 0) task.line = -1; task.movedLine = task.line; - if (task.line != -1 && !task.file.isEmpty()) { - TaskMark *mark = new TaskMark(task.taskId, task.file.toString(), task.line, - task.type, !task.icon.isNull()); + if (task.line != -1) { + auto mark = new TaskMark(task.taskId, task.file.toString(), task.line, task.type, !task.icon.isNull()); mark->setIcon(task.icon); mark->setPriority(TextEditor::TextMark::LowPriority); - task.addMark(mark); + task.setMark(mark); } emit m_instance->taskAdded(task); } @@ -192,4 +191,3 @@ void TaskHub::requestPopup() { emit m_instance->popupRequested(Core::IOutputPane::NoModeSwitch); } - diff --git a/src/plugins/projectexplorer/taskmodel.cpp b/src/plugins/projectexplorer/taskmodel.cpp index 2bdc319023..4687638575 100644 --- a/src/plugins/projectexplorer/taskmodel.cpp +++ b/src/plugins/projectexplorer/taskmodel.cpp @@ -39,11 +39,7 @@ namespace Internal { // TaskModel ///// -TaskModel::TaskModel(QObject *parent) : - QAbstractItemModel(parent), - m_maxSizeOfFileName(0), - m_lastMaxSizeIndex(0), - m_sizeOfLineNumber(0) +TaskModel::TaskModel(QObject *parent) : QAbstractItemModel(parent) { m_categories.insert(Core::Id(), CategoryData()); } @@ -110,7 +106,7 @@ void TaskModel::addTask(const Task &task) CategoryData &data = m_categories[task.category]; CategoryData &global = m_categories[Core::Id()]; - QList<Task>::iterator it = qLowerBound(m_tasks.begin(), m_tasks.end(),task.taskId, sortById); + auto it = qLowerBound(m_tasks.begin(), m_tasks.end(),task.taskId, sortById); int i = it - m_tasks.begin(); beginInsertRows(QModelIndex(), i, i); m_tasks.insert(it, task); @@ -135,7 +131,7 @@ void TaskModel::removeTask(const Task &task) int TaskModel::rowForId(unsigned int id) { - QList<Task>::const_iterator it = qLowerBound(m_tasks.constBegin(), m_tasks.constEnd(), id, sortById); + auto it = qLowerBound(m_tasks.constBegin(), m_tasks.constEnd(), id, sortById); if (it == m_tasks.constEnd()) return -1; return it - m_tasks.constBegin(); @@ -378,8 +374,8 @@ QVariant TaskFilterModel::data(const QModelIndex &index, int role) const static QPair<int, int> findFilteredRange(int first, int last, const QList<int> &list) { - QList<int>::const_iterator filteredFirst = qLowerBound(list, first); - QList<int>::const_iterator filteredLast = qUpperBound(filteredFirst, list.constEnd(), last); + auto filteredFirst = qLowerBound(list, first); + auto filteredLast = qUpperBound(filteredFirst, list.constEnd(), last); return qMakePair(filteredFirst - list.constBegin(), filteredLast - list.constBegin() - 1); } @@ -453,7 +449,7 @@ void TaskFilterModel::handleReset() QModelIndex TaskFilterModel::mapFromSource(const QModelIndex &idx) const { - QList<int>::const_iterator it = qBinaryFind(m_mapping.constBegin(), m_mapping.constEnd(), idx.row()); + auto it = qBinaryFind(m_mapping.constBegin(), m_mapping.constEnd(), idx.row()); if (it == m_mapping.constEnd()) return QModelIndex(); return index(it - m_mapping.constBegin(), 0); diff --git a/src/plugins/projectexplorer/taskmodel.h b/src/plugins/projectexplorer/taskmodel.h index 113c388413..0b761adabb 100644 --- a/src/plugins/projectexplorer/taskmodel.h +++ b/src/plugins/projectexplorer/taskmodel.h @@ -79,8 +79,6 @@ private: class CategoryData { public: - CategoryData() : count(0), warnings(0), errors(0) { } - void addTask(const Task &task) { ++count; @@ -106,20 +104,20 @@ private: } QString displayName; - int count; - int warnings; - int errors; + int count = 0; + int warnings = 0; + int errors = 0; }; QHash<Core::Id,CategoryData> m_categories; // category id to data QList<Task> m_tasks; // all tasks (in order of id) QHash<QString,bool> m_fileNotFound; - int m_maxSizeOfFileName; - int m_lastMaxSizeIndex; QFont m_fileMeasurementFont; - int m_sizeOfLineNumber; QFont m_lineMeasurementFont; + int m_maxSizeOfFileName = 0; + int m_lastMaxSizeIndex = 0; + int m_sizeOfLineNumber = 0; }; class TaskFilterModel : public QAbstractItemModel @@ -127,7 +125,7 @@ class TaskFilterModel : public QAbstractItemModel Q_OBJECT public: - TaskFilterModel(TaskModel *sourceModel, QObject *parent = 0); + TaskFilterModel(TaskModel *sourceModel, QObject *parent = nullptr); TaskModel *taskModel() { return m_sourceModel; } diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 952ab63f8a..d439c3643b 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -204,7 +204,7 @@ public: Internal::TaskView *m_listview; Internal::TaskWindowContext *m_taskWindowContext; QMenu *m_contextMenu; - ITaskHandler *m_defaultHandler; + ITaskHandler *m_defaultHandler = nullptr; QToolButton *m_filterWarningsButton; QToolButton *m_categoriesButton; QMenu *m_categoriesMenu; @@ -214,7 +214,7 @@ public: static QToolButton *createFilterButton(QIcon icon, const QString &toolTip, QObject *receiver, std::function<void(bool)> lambda) { - QToolButton *button = new QToolButton; + auto button = new QToolButton; button->setIcon(icon); button->setToolTip(toolTip); button->setCheckable(true); @@ -227,8 +227,6 @@ static QToolButton *createFilterButton(QIcon icon, const QString &toolTip, TaskWindow::TaskWindow() : d(new TaskWindowPrivate) { - d->m_defaultHandler = 0; - d->m_model = new Internal::TaskModel(this); d->m_filter = new Internal::TaskFilterModel(d->m_model); d->m_listview = new Internal::TaskView; @@ -500,7 +498,7 @@ void TaskWindow::triggerDefaultHandler(const QModelIndex &index) void TaskWindow::actionTriggered() { - QAction *action = qobject_cast<QAction *>(sender()); + auto action = qobject_cast<QAction *>(sender()); if (!action || !action->isEnabled()) return; ITaskHandler *h = handler(action); @@ -537,7 +535,7 @@ void TaskWindow::updateCategoriesMenu() for (NameToIdsConstIt it = nameToIds.constBegin(); it != cend; ++it) { const QString &displayName = it.key(); const Core::Id categoryId = it.value(); - QAction *action = new QAction(d->m_categoriesMenu); + auto action = new QAction(d->m_categoriesMenu); action->setCheckable(true); action->setText(displayName); action->setChecked(!filteredCategories.contains(categoryId)); @@ -673,7 +671,7 @@ QSize TaskDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd QStyleOptionViewItem opt = option; initStyleOption(&opt, index); - const QAbstractItemView * view = qobject_cast<const QAbstractItemView *>(opt.widget); + auto view = qobject_cast<const QAbstractItemView *>(opt.widget); const bool selected = (view->selectionModel()->currentIndex() == index); QSize s; s.setWidth(option.rect.width()); @@ -687,7 +685,7 @@ QSize TaskDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd int fontHeight = fm.height(); int fontLeading = fm.leading(); - TaskModel *model = static_cast<TaskFilterModel *>(view->model())->taskModel(); + auto model = static_cast<TaskFilterModel *>(view->model())->taskModel(); Positions positions(option, model); if (selected) { @@ -746,7 +744,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, QColor backgroundColor; QColor textColor; - const QAbstractItemView * view = qobject_cast<const QAbstractItemView *>(opt.widget); + auto view = qobject_cast<const QAbstractItemView *>(opt.widget); bool selected = view->selectionModel()->currentIndex() == index; if (selected) { @@ -767,7 +765,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, painter->setPen(textColor); - TaskModel *model = static_cast<TaskFilterModel *>(view->model())->taskModel(); + auto model = static_cast<TaskFilterModel *>(view->model())->taskModel(); Positions positions(opt, model); // Paint TaskIconArea: diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index a63a6ecc01..05ec1bbc84 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -62,9 +62,9 @@ public: } QByteArray m_id; + mutable QString m_displayName; Core::Id m_typeId; Detection m_detection; - mutable QString m_displayName; }; } // namespace Internal @@ -247,7 +247,7 @@ bool ToolChainFactory::canCreate() ToolChain *ToolChainFactory::create() { - return 0; + return nullptr; } bool ToolChainFactory::canRestore(const QVariantMap &) @@ -257,7 +257,7 @@ bool ToolChainFactory::canRestore(const QVariantMap &) ToolChain *ToolChainFactory::restore(const QVariantMap &) { - return 0; + return nullptr; } static QPair<QString, QString> rawIdData(const QVariantMap &data) diff --git a/src/plugins/projectexplorer/toolchainconfigwidget.cpp b/src/plugins/projectexplorer/toolchainconfigwidget.cpp index efe73053a2..2bfe9b3403 100644 --- a/src/plugins/projectexplorer/toolchainconfigwidget.cpp +++ b/src/plugins/projectexplorer/toolchainconfigwidget.cpp @@ -40,11 +40,11 @@ namespace ProjectExplorer { ToolChainConfigWidget::ToolChainConfigWidget(ToolChain *tc) : - m_toolChain(tc), m_errorLabel(0) + m_toolChain(tc) { Q_ASSERT(tc); - Utils::DetailsWidget *centralWidget = new Utils::DetailsWidget; + auto centralWidget = new Utils::DetailsWidget; centralWidget->setState(Utils::DetailsWidget::NoSummary); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -54,7 +54,7 @@ ToolChainConfigWidget::ToolChainConfigWidget(ToolChain *tc) : setWidget(centralWidget); - QWidget *detailsBox = new QWidget(); + auto detailsBox = new QWidget(); m_mainLayout = new QFormLayout(detailsBox); m_mainLayout->setContentsMargins(0, 0, 0, 0); diff --git a/src/plugins/projectexplorer/toolchainconfigwidget.h b/src/plugins/projectexplorer/toolchainconfigwidget.h index 3fdc440f83..e6b5764ca4 100644 --- a/src/plugins/projectexplorer/toolchainconfigwidget.h +++ b/src/plugins/projectexplorer/toolchainconfigwidget.h @@ -76,7 +76,7 @@ protected: private: ToolChain *m_toolChain; - QLabel *m_errorLabel; + QLabel *m_errorLabel = nullptr; }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/toolchainmanager.h b/src/plugins/projectexplorer/toolchainmanager.h index d70f4ba974..11dfe0ec12 100644 --- a/src/plugins/projectexplorer/toolchainmanager.h +++ b/src/plugins/projectexplorer/toolchainmanager.h @@ -76,7 +76,7 @@ signals: void toolChainsLoaded(); private: - explicit ToolChainManager(QObject *parent = 0); + explicit ToolChainManager(QObject *parent = nullptr); // Make sure the this is only called after all // Tool chain Factories are registered! diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index 4e86d3dfa6..fb235e8dc6 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -144,7 +144,7 @@ public: m_addButton->setMenu(addMenu); m_cloneButton = new QPushButton(ToolChainOptionsPage::tr("Clone"), this); - connect(m_cloneButton, &QAbstractButton::clicked, [this] { createToolChain(0); }); + connect(m_cloneButton, &QAbstractButton::clicked, [this] { createToolChain(nullptr); }); m_delButton = new QPushButton(ToolChainOptionsPage::tr("Remove"), this); @@ -218,7 +218,7 @@ void ToolChainOptionsWidget::markForRemoval(ToolChainTreeItem *item) m_model.takeItem(item); if (m_toAddList.contains(item)) { delete item->toolChain; - item->toolChain = 0; + item->toolChain = nullptr; m_toAddList.removeOne(item); delete item; } else { @@ -270,10 +270,10 @@ void ToolChainOptionsWidget::toolChainSelectionChanged() if (oldWidget) oldWidget->setVisible(false); - QWidget *currentTcWidget = item ? item->widget : 0; + QWidget *currentTcWidget = item ? item->widget : nullptr; m_container->setWidget(currentTcWidget); - m_container->setVisible(currentTcWidget != 0); + m_container->setVisible(currentTcWidget); updateState(); } @@ -330,7 +330,7 @@ void ToolChainOptionsWidget::apply() void ToolChainOptionsWidget::createToolChain(ToolChainFactory *factory) { - ToolChain *tc = 0; + ToolChain *tc = nullptr; if (factory) { // Clone. @@ -347,7 +347,7 @@ void ToolChainOptionsWidget::createToolChain(ToolChainFactory *factory) if (!tc) return; - ToolChainTreeItem *item = new ToolChainTreeItem(tc, true); + auto item = new ToolChainTreeItem(tc, true); m_toAddList.append(item); m_manualRoot->appendChild(item); @@ -373,7 +373,7 @@ ToolChainTreeItem *ToolChainOptionsWidget::currentTreeItem() { QModelIndex index = m_toolChainView->currentIndex(); TreeItem *item = m_model.itemForIndex(index); - return item && item->level() == 2 ? static_cast<ToolChainTreeItem *>(item) : 0; + return (item && item->level() == 2) ? static_cast<ToolChainTreeItem *>(item) : nullptr; } // -------------------------------------------------------------------------- @@ -406,7 +406,7 @@ void ToolChainOptionsPage::apply() void ToolChainOptionsPage::finish() { delete m_widget; - m_widget = 0; + m_widget = nullptr; } } // namespace Internal diff --git a/src/plugins/projectexplorer/unconfiguredprojectpanel.cpp b/src/plugins/projectexplorer/unconfiguredprojectpanel.cpp index d109e7e3b6..06e164cd30 100644 --- a/src/plugins/projectexplorer/unconfiguredprojectpanel.cpp +++ b/src/plugins/projectexplorer/unconfiguredprojectpanel.cpp @@ -48,10 +48,10 @@ namespace Internal { /// TargetSetupPageWrapper //////// -TargetSetupPageWrapper::TargetSetupPageWrapper(Project *project) : - QWidget(), m_project(project) +TargetSetupPageWrapper::TargetSetupPageWrapper(Project *project) : QWidget(), + m_project(project) { - QVBoxLayout *layout = new QVBoxLayout(); + auto layout = new QVBoxLayout(); layout->setMargin(0); setLayout(layout); @@ -68,12 +68,12 @@ TargetSetupPageWrapper::TargetSetupPageWrapper(Project *project) : layout->addWidget(m_targetSetupPage); // Apply row - QHBoxLayout *hbox = new QHBoxLayout(); + auto hbox = new QHBoxLayout(); layout->addLayout(hbox); layout->setMargin(0); hbox->addStretch(); - QDialogButtonBox *box = new QDialogButtonBox(this); + auto box = new QDialogButtonBox(this); m_configureButton = new QPushButton(this); m_configureButton->setText(tr("Configure Project")); diff --git a/src/plugins/projectexplorer/waitforstopdialog.cpp b/src/plugins/projectexplorer/waitforstopdialog.cpp index 1b9e4e7176..1bd57372b4 100644 --- a/src/plugins/projectexplorer/waitforstopdialog.cpp +++ b/src/plugins/projectexplorer/waitforstopdialog.cpp @@ -35,18 +35,18 @@ using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; -WaitForStopDialog::WaitForStopDialog(QList<ProjectExplorer::RunControl *> runControls) - : m_runControls(runControls) +WaitForStopDialog::WaitForStopDialog(QList<ProjectExplorer::RunControl *> runControls) : + m_runControls(runControls) { setWindowTitle(tr("Waiting for Applications to Stop")); - QVBoxLayout *layout = new QVBoxLayout(); + auto layout = new QVBoxLayout(); setLayout(layout); m_progressLabel = new QLabel; layout->addWidget(m_progressLabel); - QPushButton *cancelButton = new QPushButton(tr("Cancel")); + auto cancelButton = new QPushButton(tr("Cancel")); connect(cancelButton, &QPushButton::clicked, this, &QDialog::close); layout->addWidget(cancelButton); @@ -74,7 +74,7 @@ void WaitForStopDialog::updateProgressText() void WaitForStopDialog::runControlFinished() { - RunControl *rc = qobject_cast<RunControl *>(sender()); + auto rc = qobject_cast<RunControl *>(sender()); m_runControls.removeOne(rc); if (m_runControls.isEmpty()) { diff --git a/src/plugins/projectexplorer/wincetoolchain.cpp b/src/plugins/projectexplorer/wincetoolchain.cpp index dd8968d60c..3c3ce90512 100644 --- a/src/plugins/projectexplorer/wincetoolchain.cpp +++ b/src/plugins/projectexplorer/wincetoolchain.cpp @@ -122,8 +122,7 @@ Utils::Environment WinCEToolChain::readEnvironmentSetting(Utils::Environment &en if (!generateEnvironmentSettings(env, m_vcvarsBat, QString(), envPairs)) return result; - QMap<QString,QString>::const_iterator envPairIter; - for (envPairIter = envPairs.constBegin(); envPairIter!=envPairs.constEnd(); ++envPairIter) { + for (auto envPairIter = envPairs.constBegin(); envPairIter!=envPairs.constEnd(); ++envPairIter) { // Replace the env values with those from the WinCE SDK QString varValue = envPairIter.value(); if (envPairIter.key() == QLatin1String("PATH")) @@ -139,7 +138,7 @@ Utils::Environment WinCEToolChain::readEnvironmentSetting(Utils::Environment &en // Now loop round and do the delayed expansion - Utils::Environment::const_iterator envIter = result.constBegin(); + auto envIter = result.constBegin(); while (envIter != result.constEnd()) { const QString key = result.key(envIter); const QString unexpandedValue = result.value(envIter); @@ -260,11 +259,11 @@ WinCEToolChain::WinCEToolChain() : WinCEToolChain *WinCEToolChain::readFromMap(const QVariantMap &data) { - WinCEToolChain *tc = new WinCEToolChain; + auto tc = new WinCEToolChain; if (tc->fromMap(data)) return tc; delete tc; - return 0; + return nullptr; } QString WinCEToolChain::typeDisplayName() const @@ -438,7 +437,7 @@ QList<ToolChain *> WinCEToolChainFactory::autoDetect(const QList<ToolChain *> &a } -QString WinCEToolChain::autoDetectCdbDebugger(QStringList *checkedDirectories /* = 0 */) +QString WinCEToolChain::autoDetectCdbDebugger(QStringList *checkedDirectories) { Q_UNUSED(checkedDirectories); return QString(); @@ -454,7 +453,7 @@ bool WinCEToolChain::operator ==(const ToolChain &other) const if (!AbstractMsvcToolChain::operator ==(other)) return false; - const WinCEToolChain *ceTc = static_cast<const WinCEToolChain *>(&other); + auto ceTc = static_cast<const WinCEToolChain *>(&other); return m_ceVer == ceTc->m_ceVer; } @@ -470,7 +469,7 @@ ToolChain *WinCEToolChainFactory::restore(const QVariantMap &data) WinCEToolChainConfigWidget::WinCEToolChainConfigWidget(ToolChain *tc) : ToolChainConfigWidget(tc) { - WinCEToolChain *toolChain = static_cast<WinCEToolChain *>(tc); + auto toolChain = static_cast<WinCEToolChain *>(tc); QTC_ASSERT(tc, return); m_mainLayout->addRow(tr("SDK:"), new QLabel(toolChain->displayName())); diff --git a/src/plugins/projectexplorer/wincetoolchain.h b/src/plugins/projectexplorer/wincetoolchain.h index 1422ccfe91..376b25fe04 100644 --- a/src/plugins/projectexplorer/wincetoolchain.h +++ b/src/plugins/projectexplorer/wincetoolchain.h @@ -65,7 +65,7 @@ public: ToolChain *clone() const override; - static QString autoDetectCdbDebugger(QStringList *checkedDirectories = 0); + static QString autoDetectCdbDebugger(QStringList *checkedDirectories = nullptr); bool operator ==(const ToolChain &other) const override; diff --git a/src/plugins/projectexplorer/windebuginterface.cpp b/src/plugins/projectexplorer/windebuginterface.cpp index 928181d517..c03a07f00b 100644 --- a/src/plugins/projectexplorer/windebuginterface.cpp +++ b/src/plugins/projectexplorer/windebuginterface.cpp @@ -49,7 +49,7 @@ namespace ProjectExplorer { namespace Internal { -WinDebugInterface *WinDebugInterface::m_instance = 0; +WinDebugInterface *WinDebugInterface::m_instance = nullptr; WinDebugInterface *WinDebugInterface::instance() { @@ -76,7 +76,7 @@ WinDebugInterface::~WinDebugInterface() { if (stop()) wait(500); - m_instance = 0; + m_instance = nullptr; } void WinDebugInterface::run() @@ -184,15 +184,15 @@ bool WinDebugInterface::runLoop() namespace ProjectExplorer { namespace Internal { -WinDebugInterface *WinDebugInterface::m_instance = 0; +WinDebugInterface *WinDebugInterface::m_instance = nullptr; -WinDebugInterface *WinDebugInterface::instance() { return 0; } +WinDebugInterface *WinDebugInterface::instance() { return nullptr; } -WinDebugInterface::WinDebugInterface(QObject *) {} +WinDebugInterface::WinDebugInterface(QObject *) { } -WinDebugInterface::~WinDebugInterface() {} +WinDebugInterface::~WinDebugInterface() { } -void WinDebugInterface::run() {} +void WinDebugInterface::run() { } bool WinDebugInterface::runLoop() { return false; } diff --git a/src/plugins/projectexplorer/windebuginterface.h b/src/plugins/projectexplorer/windebuginterface.h index c7de7f6b37..e59e5a4150 100644 --- a/src/plugins/projectexplorer/windebuginterface.h +++ b/src/plugins/projectexplorer/windebuginterface.h @@ -35,7 +35,7 @@ class WinDebugInterface : public QThread Q_OBJECT public: - explicit WinDebugInterface(QObject *parent = 0); + explicit WinDebugInterface(QObject *parent = nullptr); ~WinDebugInterface() override; static WinDebugInterface *instance(); diff --git a/src/plugins/projectexplorer/xcodebuildparser.cpp b/src/plugins/projectexplorer/xcodebuildparser.cpp index 41f24e0a38..cb19e50114 100644 --- a/src/plugins/projectexplorer/xcodebuildparser.cpp +++ b/src/plugins/projectexplorer/xcodebuildparser.cpp @@ -39,9 +39,7 @@ static const char successRe[] = "\\*\\* BUILD SUCCEEDED \\*\\*$"; static const char buildRe[] = "=== BUILD (AGGREGATE )?TARGET (.*) OF PROJECT (.*) WITH .* ===$"; static const char signatureChangeRe[] = "(.+): replacing existing signature$"; -XcodebuildParser::XcodebuildParser() : - m_fatalErrorCount(0), - m_xcodeBuildParserState(OutsideXcodebuild) +XcodebuildParser::XcodebuildParser() { setObjectName(QLatin1String("XcodeParser")); m_failureRe.setPattern(QLatin1String(failureRe)); diff --git a/src/plugins/projectexplorer/xcodebuildparser.h b/src/plugins/projectexplorer/xcodebuildparser.h index 2557c70342..ae49fd7eeb 100644 --- a/src/plugins/projectexplorer/xcodebuildparser.h +++ b/src/plugins/projectexplorer/xcodebuildparser.h @@ -51,12 +51,12 @@ public: bool hasFatalErrors() const override; private: - int m_fatalErrorCount; + int m_fatalErrorCount = 0; QRegExp m_failureRe; QRegExp m_successRe; QRegExp m_buildRe; QRegExp m_replacingSignatureRe; - XcodebuildStatus m_xcodeBuildParserState; + XcodebuildStatus m_xcodeBuildParserState = OutsideXcodebuild; QString m_lastTarget; QString m_lastProject; @@ -71,7 +71,7 @@ class XcodebuildParserTester : public QObject { Q_OBJECT public: - explicit XcodebuildParserTester(XcodebuildParser *parser, QObject *parent = 0); + explicit XcodebuildParserTester(XcodebuildParser *parser, QObject *parent = nullptr); XcodebuildParser *parser; XcodebuildParser::XcodebuildStatus expectedFinalState; diff --git a/src/plugins/pythoneditor/pythoneditor.h b/src/plugins/pythoneditor/pythoneditor.h index 5ac8a7413a..914b28000a 100644 --- a/src/plugins/pythoneditor/pythoneditor.h +++ b/src/plugins/pythoneditor/pythoneditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PYTHONEDITOR_EDITOR_H -#define PYTHONEDITOR_EDITOR_H +#pragma once #include <texteditor/texteditor.h> @@ -41,5 +40,3 @@ public: } // namespace Internal } // namespace PythonEditor - -#endif // PYTHONEDITOR_EDITOR_H diff --git a/src/plugins/pythoneditor/pythoneditorconstants.h b/src/plugins/pythoneditor/pythoneditorconstants.h index 24a8cff3ef..a84281aaa5 100644 --- a/src/plugins/pythoneditor/pythoneditorconstants.h +++ b/src/plugins/pythoneditor/pythoneditorconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PYTHONEDITOR_CONSTANTS_H -#define PYTHONEDITOR_CONSTANTS_H +#pragma once #include <QtGlobal> @@ -43,5 +42,3 @@ const char C_PY_MIME_ICON[] = "text-x-python"; } // namespace Constants } // namespace PythonEditor - -#endif // PYTHONEDITOR_CONSTANTS_H diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index efa9057997..44336458bc 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -226,8 +226,6 @@ class PythonProjectManager : public IProjectManager { Q_OBJECT public: - PythonProjectManager() {} - QString mimeType() const override { return QLatin1String(PythonMimeType); } Project *openProject(const QString &fileName, QString *errorString) override; diff --git a/src/plugins/pythoneditor/pythoneditorplugin.h b/src/plugins/pythoneditor/pythoneditorplugin.h index 0e6aa8a5aa..ae2634c188 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.h +++ b/src/plugins/pythoneditor/pythoneditorplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PYTHONEDITOR_PLUGIN_H -#define PYTHONEDITOR_PLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> #include <projectexplorer/runconfiguration.h> @@ -59,5 +58,3 @@ private: } // namespace Internal } // namespace PythonEditor - -#endif // PYTHONEDITOR_PLUGIN_H diff --git a/src/plugins/pythoneditor/tools/lexical/pythonformattoken.h b/src/plugins/pythoneditor/tools/lexical/pythonformattoken.h index 528d2fbd40..9ae0d4c21c 100644 --- a/src/plugins/pythoneditor/tools/lexical/pythonformattoken.h +++ b/src/plugins/pythoneditor/tools/lexical/pythonformattoken.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PYTHONFORMATTOKEN_H -#define PYTHONFORMATTOKEN_H +#pragma once #include <stdlib.h> @@ -73,5 +72,3 @@ private: } // namespace Internal } // namespace PythonEditor - -#endif // PYTHONFORMATTOKEN_H diff --git a/src/plugins/pythoneditor/tools/lexical/pythonscanner.h b/src/plugins/pythoneditor/tools/lexical/pythonscanner.h index 831184e7b7..0b8dea5800 100644 --- a/src/plugins/pythoneditor/tools/lexical/pythonscanner.h +++ b/src/plugins/pythoneditor/tools/lexical/pythonscanner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PYTHONSCANNER_H -#define PYTHONSCANNER_H +#pragma once #include "pythonformattoken.h" #include "sourcecodestream.h" @@ -85,5 +84,3 @@ private: } // namespace Internal } // namespace PythonEditor - -#endif // PYTHONSCANNER_H diff --git a/src/plugins/pythoneditor/tools/lexical/sourcecodestream.h b/src/plugins/pythoneditor/tools/lexical/sourcecodestream.h index 3326e4f5cf..7c8183b453 100644 --- a/src/plugins/pythoneditor/tools/lexical/sourcecodestream.h +++ b/src/plugins/pythoneditor/tools/lexical/sourcecodestream.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PYTHONEDITOR_SOURCECODESTREAM_H -#define PYTHONEDITOR_SOURCECODESTREAM_H +#pragma once #include <QString> @@ -94,5 +93,3 @@ private: } // namespace Internal } // namespace PythonEditor - -#endif // PYTHONEDITOR_SOURCECODESTREAM_H diff --git a/src/plugins/pythoneditor/tools/pythonhighlighter.h b/src/plugins/pythoneditor/tools/pythonhighlighter.h index e78038ca17..6f78a46624 100644 --- a/src/plugins/pythoneditor/tools/pythonhighlighter.h +++ b/src/plugins/pythoneditor/tools/pythonhighlighter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PYTHONHIGHLIGHTER_H -#define PYTHONHIGHLIGHTER_H +#pragma once #include <texteditor/syntaxhighlighter.h> @@ -48,5 +47,3 @@ private: } // namespace Internal } // namespace PythonEditor - -#endif // PYTHONHIGHLIGHTER_H diff --git a/src/plugins/pythoneditor/tools/pythonindenter.h b/src/plugins/pythoneditor/tools/pythonindenter.h index 6846aa1ba8..c44a002439 100644 --- a/src/plugins/pythoneditor/tools/pythonindenter.h +++ b/src/plugins/pythoneditor/tools/pythonindenter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PYTHONINDENTER_H -#define PYTHONINDENTER_H +#pragma once #include <texteditor/indenter.h> #include <QStringList> @@ -51,5 +50,3 @@ private: }; } // namespace PythonEditor - -#endif // PYTHONINDENTER_H diff --git a/src/plugins/qbsprojectmanager/customqbspropertiesdialog.h b/src/plugins/qbsprojectmanager/customqbspropertiesdialog.h index 56a33c22b2..0668f77720 100644 --- a/src/plugins/qbsprojectmanager/customqbspropertiesdialog.h +++ b/src/plugins/qbsprojectmanager/customqbspropertiesdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTC_CUSTOMQBSPROPERTIESDIALOG_H -#define QTC_CUSTOMQBSPROPERTIESDIALOG_H +#pragma once #include <QVariantMap> #include <QDialog> @@ -54,5 +53,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // Include guard. diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.h b/src/plugins/qbsprojectmanager/defaultpropertyprovider.h index 08c1e5e020..9e7d36f628 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.h +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEFAULTPROPERTYPROVIDER_H -#define DEFAULTPROPERTYPROVIDER_H +#pragma once #include "propertyprovider.h" @@ -46,5 +45,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // DEFAULTPROPERTYPROVIDER_H diff --git a/src/plugins/qbsprojectmanager/propertyprovider.h b/src/plugins/qbsprojectmanager/propertyprovider.h index 960baf28b4..1d99c1aea5 100644 --- a/src/plugins/qbsprojectmanager/propertyprovider.h +++ b/src/plugins/qbsprojectmanager/propertyprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYPROVIDER_H -#define PROPERTYPROVIDER_H +#pragma once #include "qbsprojectmanager_global.h" @@ -45,5 +44,3 @@ public: }; } // namespace QbsProjectManager - -#endif // PROPERTYPROVIDER_H diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index 6b7a1880e9..b6403c0f40 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -115,11 +115,7 @@ NamedWidget *QbsBuildConfiguration::createConfigWidget() QbsBuildStep *QbsBuildConfiguration::qbsStep() const { - foreach (BuildStep *bs, stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD)->steps()) { - if (QbsBuildStep *qbsBs = qobject_cast<QbsBuildStep *>(bs)) - return qbsBs; - } - return 0; + return stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD)->firstOfType<QbsBuildStep>(); } QVariantMap QbsBuildConfiguration::qbsConfiguration() const diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h index cc367f4239..1dd37792bc 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSBUILDCONFIGURATION_H -#define QBSBUILDCONFIGURATION_H +#pragma once #include "qbsprojectmanager_global.h" @@ -135,5 +134,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSBUILDCONFIGURATION_H diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfigurationwidget.h b/src/plugins/qbsprojectmanager/qbsbuildconfigurationwidget.h index 04acc4abaa..b8309ede83 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfigurationwidget.h +++ b/src/plugins/qbsprojectmanager/qbsbuildconfigurationwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSBUILDCONFIGURATIONWIDGET_H -#define QBSBUILDCONFIGURATIONWIDGET_H +#pragma once #include <projectexplorer/namedwidget.h> @@ -59,5 +58,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSBUILDCONFIGURATIONWIDGET_H diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index 27f7d38b53..af15dd2b4e 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSBUILDSTEP_H -#define QBSBUILDSTEP_H +#pragma once #include "qbsbuildconfiguration.h" @@ -184,5 +183,3 @@ public: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSBUILDSTEP_H diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.h b/src/plugins/qbsprojectmanager/qbscleanstep.h index 4f454b2e2f..265d538914 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.h +++ b/src/plugins/qbsprojectmanager/qbscleanstep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSCLEANSTEP_H -#define QBSCLEANSTEP_H +#pragma once #include "qbsbuildconfiguration.h" @@ -138,5 +137,3 @@ public: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSCLEANSTEP_H diff --git a/src/plugins/qbsprojectmanager/qbsconstants.h b/src/plugins/qbsprojectmanager/qbsconstants.h index 66a3a2c21b..61884c7272 100644 --- a/src/plugins/qbsprojectmanager/qbsconstants.h +++ b/src/plugins/qbsprojectmanager/qbsconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSCONSTANTS_H -#define QBSCONSTANTS_H +#pragma once namespace QbsProjectManager { namespace Constants { @@ -54,5 +53,3 @@ const char QBS_PROPERTIES_KEY_FOR_KITS[] = "QbsProjectManager.qbs-properties"; } // namespace Constants } // namespace QbsProjectManager - -#endif // QBSCONSTANTS_H diff --git a/src/plugins/qbsprojectmanager/qbsdeployconfigurationfactory.cpp b/src/plugins/qbsprojectmanager/qbsdeployconfigurationfactory.cpp index fefbfb9592..cbadd8f871 100644 --- a/src/plugins/qbsprojectmanager/qbsdeployconfigurationfactory.cpp +++ b/src/plugins/qbsprojectmanager/qbsdeployconfigurationfactory.cpp @@ -55,11 +55,7 @@ static Core::Id genericQbsDeployConfigurationId() QbsInstallStep *QbsDeployConfiguration::qbsInstallStep() const { - foreach (ProjectExplorer::BuildStep *bs, stepList()->steps()) { - if (QbsInstallStep *install = qobject_cast<QbsInstallStep *>(bs)) - return install; - } - return 0; + return stepList()->firstOfType<QbsInstallStep>(); } QbsDeployConfiguration::QbsDeployConfiguration(ProjectExplorer::Target *target, Core::Id id) : diff --git a/src/plugins/qbsprojectmanager/qbsdeployconfigurationfactory.h b/src/plugins/qbsprojectmanager/qbsdeployconfigurationfactory.h index 6f7553622b..5f12cc2820 100644 --- a/src/plugins/qbsprojectmanager/qbsdeployconfigurationfactory.h +++ b/src/plugins/qbsprojectmanager/qbsdeployconfigurationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSDEPLOYCONFIGURATIONFACTORY_H -#define QBSDEPLOYCONFIGURATIONFACTORY_H +#pragma once #include <projectexplorer/deployconfiguration.h> @@ -71,5 +70,3 @@ public: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSDEPLOYCONFIGURATIONFACTORY_H diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.h b/src/plugins/qbsprojectmanager/qbsinstallstep.h index 6f50e53f7a..95f8434eaf 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.h +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSINSTALLSTEP_H -#define QBSINSTALLSTEP_H +#pragma once #include "qbsbuildconfiguration.h" @@ -144,5 +143,3 @@ public: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSINSTALLSTEP_H diff --git a/src/plugins/qbsprojectmanager/qbslogsink.h b/src/plugins/qbsprojectmanager/qbslogsink.h index bd040a8a6d..f17c4833e1 100644 --- a/src/plugins/qbsprojectmanager/qbslogsink.h +++ b/src/plugins/qbsprojectmanager/qbslogsink.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSLOGSINK_H -#define QBSLOGSINK_H +#pragma once #include <projectexplorer/task.h> @@ -59,5 +58,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSLOGSINK_H diff --git a/src/plugins/qbsprojectmanager/qbsnodes.h b/src/plugins/qbsprojectmanager/qbsnodes.h index d6b7dfe614..9ada718d8d 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.h +++ b/src/plugins/qbsprojectmanager/qbsnodes.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSNODES_H -#define QBSNODES_H +#pragma once #include <projectexplorer/projectnodes.h> @@ -199,5 +198,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSNODES_H diff --git a/src/plugins/qbsprojectmanager/qbsparser.h b/src/plugins/qbsprojectmanager/qbsparser.h index 7b3aeaff2a..6fa8a86c80 100644 --- a/src/plugins/qbsprojectmanager/qbsparser.h +++ b/src/plugins/qbsprojectmanager/qbsparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSPARSER_H -#define QBSPARSER_H +#pragma once #include "qbsprojectmanager_global.h" @@ -53,5 +52,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSPARSER_H diff --git a/src/plugins/qbsprojectmanager/qbsprofilessettingspage.h b/src/plugins/qbsprojectmanager/qbsprofilessettingspage.h index c2933ab6c4..9c851daa0d 100644 --- a/src/plugins/qbsprojectmanager/qbsprofilessettingspage.h +++ b/src/plugins/qbsprojectmanager/qbsprofilessettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSPROFILESSETTINGSPAGE_H -#define QBSPROFILESSETTINGSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -48,5 +47,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // Include guard. diff --git a/src/plugins/qbsprojectmanager/qbsproject.h b/src/plugins/qbsprojectmanager/qbsproject.h index 73b0917eb4..c22a161cd8 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.h +++ b/src/plugins/qbsprojectmanager/qbsproject.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSPROJECT_H -#define QBSPROJECT_H +#pragma once #include "qbsprojectmanager.h" @@ -174,5 +173,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSPROJECT_H diff --git a/src/plugins/qbsprojectmanager/qbsprojectfile.h b/src/plugins/qbsprojectmanager/qbsprojectfile.h index b57fcbcd33..80cf70113b 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectfile.h +++ b/src/plugins/qbsprojectmanager/qbsprojectfile.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSPROJECTFILE_H -#define QBSPROJECTFILE_H +#pragma once #include <coreplugin/idocument.h> @@ -35,7 +34,6 @@ class QbsProject; class QbsProjectFile : public Core::IDocument { - Q_OBJECT public: QbsProjectFile(QbsProject *parent, QString fileName); @@ -48,5 +46,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSPROJECTFILE_H diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanager.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanager.cpp index b0805f65a0..d2afdd1eb6 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanager.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectmanager.cpp @@ -56,12 +56,11 @@ static QString qtcProfilePrefix() { return qtcProfileGroup() + sep; } namespace QbsProjectManager { namespace Internal { -qbs::Settings *QbsManager::m_settings = 0; -Internal::QbsLogSink *QbsManager::m_logSink = 0; -QbsManager *QbsManager::m_instance = 0; +qbs::Settings *QbsManager::m_settings = nullptr; +Internal::QbsLogSink *QbsManager::m_logSink = nullptr; +QbsManager *QbsManager::m_instance = nullptr; -QbsManager::QbsManager() : - m_defaultPropertyProvider(new DefaultPropertyProvider) +QbsManager::QbsManager() : m_defaultPropertyProvider(new DefaultPropertyProvider) { m_instance = this; @@ -98,7 +97,7 @@ QbsManager::~QbsManager() { delete m_defaultPropertyProvider; delete m_settings; - m_instance = 0; + m_instance = nullptr; } QString QbsManager::mimeType() const @@ -112,7 +111,7 @@ ProjectExplorer::Project *QbsManager::openProject(const QString &fileName, QStri if (errorString) *errorString = tr("Failed opening project \"%1\": Project is not a file.") .arg(fileName); - return 0; + return nullptr; } return new QbsProject(this, fileName); diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanager.h b/src/plugins/qbsprojectmanager/qbsprojectmanager.h index 99eb2002f4..ecade37059 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanager.h +++ b/src/plugins/qbsprojectmanager/qbsprojectmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSPROJECTMANAGER_H -#define QBSPROJECTMANAGER_H +#pragma once #include "qbsprojectmanager_global.h" @@ -60,8 +59,8 @@ public: QbsManager(); ~QbsManager(); - QString mimeType() const; - ProjectExplorer::Project *openProject(const QString &fileName, QString *errorString); + QString mimeType() const override; + ProjectExplorer::Project *openProject(const QString &fileName, QString *errorString) override; // QBS profiles management: QString profileForKit(const ProjectExplorer::Kit *k); @@ -92,5 +91,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSPROJECTMANAGER_H diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanager_global.h b/src/plugins/qbsprojectmanager/qbsprojectmanager_global.h index d9d28454d9..7b53f201e3 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanager_global.h +++ b/src/plugins/qbsprojectmanager/qbsprojectmanager_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSPROJECTMANAGER_GLOBAL_H -#define QBSPROJECTMANAGER_GLOBAL_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define QBSPROJECTMANAGER_EXPORT Q_DECL_IMPORT #endif - -#endif // QBSPROJECTMANAGER_GLOBAL_H diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h b/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h index e085eb5aa5..ce89cccd11 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSPROJECTMANAGERCONSTANTS_H -#define QBSPROJECTMANAGERCONSTANTS_H +#pragma once #include <QtGlobal> @@ -67,6 +66,3 @@ static const char QBS_PRODUCT_OVERLAY_ICON[] = ":/qbsprojectmanager/images/produ } // namespace Constants } // namespace QbsProjectManager - -#endif // QBSPROJECTMANAGERCONSTANTS_H - diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.h b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.h index 7f28b0322d..eb54681c7d 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.h +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSPROJECTMANAGERPLUGIN_H -#define QBSPROJECTMANAGERPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> #include <utils/parameteraction.h> @@ -109,5 +108,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSPROJECTMANAGERPLUGIN_H diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagersettings.h b/src/plugins/qbsprojectmanager/qbsprojectmanagersettings.h index afc6c2aad4..08eb11cafc 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagersettings.h +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagersettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSPROJECTMANAGERSETTINGS_H -#define QBSPROJECTMANAGERSETTINGS_H +#pragma once #include <QObject> @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // Include guard. diff --git a/src/plugins/qbsprojectmanager/qbsprojectparser.h b/src/plugins/qbsprojectmanager/qbsprojectparser.h index c00450e574..d354a66079 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectparser.h +++ b/src/plugins/qbsprojectmanager/qbsprojectparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSPROJECTPARSER_H -#define QBSPROJECTPARSER_H +#pragma once #include <utils/environment.h> @@ -82,5 +81,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSPROJECTPARSER_H diff --git a/src/plugins/qbsprojectmanager/qbsrunconfiguration.h b/src/plugins/qbsprojectmanager/qbsrunconfiguration.h index 25d7b33a82..9351d30ac3 100644 --- a/src/plugins/qbsprojectmanager/qbsrunconfiguration.h +++ b/src/plugins/qbsprojectmanager/qbsrunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QBSRUNCONFIGURATION_H -#define QBSRUNCONFIGURATION_H +#pragma once #include <projectexplorer/runnables.h> @@ -153,5 +152,3 @@ private: } // namespace Internal } // namespace QbsProjectManager - -#endif // QBSRUNCONFIGURATION_H diff --git a/src/plugins/qmakeandroidsupport/androidextralibrarylistmodel.h b/src/plugins/qmakeandroidsupport/androidextralibrarylistmodel.h index b4d5dacc5c..f9959d556a 100644 --- a/src/plugins/qmakeandroidsupport/androidextralibrarylistmodel.h +++ b/src/plugins/qmakeandroidsupport/androidextralibrarylistmodel.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDEXTRALIBRARYLISTMODEL_H -#define ANDROIDEXTRALIBRARYLISTMODEL_H +#pragma once #include <QAbstractItemModel> #include <QStringList> @@ -73,5 +72,3 @@ private: } // namespace Internal } // namespace QmakeAndroidSupport - -#endif // ANDROIDEXTRALIBRARYLISTMODEL_H diff --git a/src/plugins/qmakeandroidsupport/androidpackageinstallationfactory.h b/src/plugins/qmakeandroidsupport/androidpackageinstallationfactory.h index 9bb3ce1fe7..f870689439 100644 --- a/src/plugins/qmakeandroidsupport/androidpackageinstallationfactory.h +++ b/src/plugins/qmakeandroidsupport/androidpackageinstallationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDPACKAGEINSTALLATIONFACTORY_H -#define ANDROIDPACKAGEINSTALLATIONFACTORY_H +#pragma once #include <projectexplorer/buildstep.h> @@ -55,5 +54,3 @@ public: } // namespace Internal } // namespace QmakeAndroidSupport - -#endif // ANDROIDPACKAGEINSTALLATIONFACTORY_H diff --git a/src/plugins/qmakeandroidsupport/androidpackageinstallationstep.cpp b/src/plugins/qmakeandroidsupport/androidpackageinstallationstep.cpp index 6630152efb..8dc02fc3ef 100644 --- a/src/plugins/qmakeandroidsupport/androidpackageinstallationstep.cpp +++ b/src/plugins/qmakeandroidsupport/androidpackageinstallationstep.cpp @@ -71,9 +71,7 @@ bool AndroidPackageInstallationStep::init(QList<const BuildStep *> &earlierSteps pp->setWorkingDirectory(bc->buildDirectory().toString()); pp->setCommand(tc->makeCommand(bc->environment())); Utils::Environment env = bc->environment(); - // Force output to english for the parsers. Do this here and not in the toolchain's - // addToEnvironment() to not screw up the users run environment. - env.set(QLatin1String("LC_ALL"), QLatin1String("C")); + Utils::Environment::setupEnglishOutput(&env); pp->setEnvironment(env); const QString innerQuoted = Utils::QtcProcess::quoteArg(dirPath); const QString outerQuoted = Utils::QtcProcess::quoteArg(QString::fromLatin1("INSTALL_ROOT=") + innerQuoted); diff --git a/src/plugins/qmakeandroidsupport/androidpackageinstallationstep.h b/src/plugins/qmakeandroidsupport/androidpackageinstallationstep.h index ca1cfbb44f..c27d43aa4f 100644 --- a/src/plugins/qmakeandroidsupport/androidpackageinstallationstep.h +++ b/src/plugins/qmakeandroidsupport/androidpackageinstallationstep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDPACKAGEINSTALLATIONSTEP_H -#define ANDROIDPACKAGEINSTALLATIONSTEP_H +#pragma once #include <projectexplorer/buildstep.h> #include <projectexplorer/abstractprocessstep.h> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace QmakeAndroidSupport - -#endif // ANDROIDPACKAGEINSTALLATIONSTEP_H diff --git a/src/plugins/qmakeandroidsupport/androidqmakebuildconfigurationfactory.h b/src/plugins/qmakeandroidsupport/androidqmakebuildconfigurationfactory.h index c2044cc1ad..25783a05cb 100644 --- a/src/plugins/qmakeandroidsupport/androidqmakebuildconfigurationfactory.h +++ b/src/plugins/qmakeandroidsupport/androidqmakebuildconfigurationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANDROIDQMAKEBUILDCONFIGURATIONFACTORY_H -#define ANDROIDQMAKEBUILDCONFIGURATIONFACTORY_H +#pragma once #include <qmakeprojectmanager/qmakebuildconfiguration.h> @@ -65,6 +64,3 @@ private: } // namespace Internal } // namespace QmakeAndroidSupport - - -#endif // ANDROIDQMAKEBUILDCONFIGURATIONFACTORY_H diff --git a/src/plugins/qmakeandroidsupport/createandroidmanifestwizard.h b/src/plugins/qmakeandroidsupport/createandroidmanifestwizard.h index eb6cd5bc41..feba63241f 100644 --- a/src/plugins/qmakeandroidsupport/createandroidmanifestwizard.h +++ b/src/plugins/qmakeandroidsupport/createandroidmanifestwizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CREATEANDROIDMANIFESTWIZARD_H -#define CREATEANDROIDMANIFESTWIZARD_H +#pragma once #include <utils/fileutils.h> #include <utils/pathchooser.h> @@ -120,5 +119,3 @@ private: } //namespace QmakeAndroidSupport } //namespace Internal - -#endif // CREATEANDROIDMANIFESTWIZARD_H diff --git a/src/plugins/qmakeandroidsupport/qmakeandroidbuildapkstep.h b/src/plugins/qmakeandroidsupport/qmakeandroidbuildapkstep.h index a3b56871c5..8367236ca0 100644 --- a/src/plugins/qmakeandroidsupport/qmakeandroidbuildapkstep.h +++ b/src/plugins/qmakeandroidsupport/qmakeandroidbuildapkstep.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef QMAKEANDROIDBUILDAPKSTEP_H -#define QMAKEANDROIDBUILDAPKSTEP_H +#pragma once #include <android/androidbuildapkstep.h> @@ -90,5 +89,3 @@ private: } // namespace Internal } // namespace QmakeAndroidSupport - -#endif // QMAKEANDROIDBUILDAPKSTEP_H diff --git a/src/plugins/qmakeandroidsupport/qmakeandroidbuildapkwidget.h b/src/plugins/qmakeandroidsupport/qmakeandroidbuildapkwidget.h index b7c435c255..d7adbb111b 100644 --- a/src/plugins/qmakeandroidsupport/qmakeandroidbuildapkwidget.h +++ b/src/plugins/qmakeandroidsupport/qmakeandroidbuildapkwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEANDROIDBUILDAPKWIDGET_H -#define QMAKEANDROIDBUILDAPKWIDGET_H +#pragma once #include "androidextralibrarylistmodel.h" @@ -75,5 +74,3 @@ public: } // namespace Internal } // namespace QmakeAndroidSupport - -#endif // QMAKEANDROIDBUILDAPKWIDGET_H diff --git a/src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.h b/src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.h index 95d06021ef..fcdd1270a2 100644 --- a/src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.h +++ b/src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKE_ANDROIDRUNCONFIGURATION_H -#define QMAKE_ANDROIDRUNCONFIGURATION_H +#pragma once #include <android/androidrunconfiguration.h> @@ -69,5 +68,3 @@ private: } // namespace Internal } // namespace QmakeAndroidSupport - -#endif // QMAKE_ANDROIDRUNCONFIGURATION_H diff --git a/src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.h b/src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.h index e11c6d4ea1..03c6702631 100644 --- a/src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.h +++ b/src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKE_ANDROIDRUNFACTORIES_H -#define QMAKE_ANDROIDRUNFACTORIES_H +#pragma once #include <android/androidrunfactories.h> #include <projectexplorer/runconfiguration.h> @@ -70,5 +69,3 @@ private: } // namespace Internal } // namespace QmakeAndroidSupport - -#endif // ANDROIDRUNFACTORIES_H diff --git a/src/plugins/qmakeandroidsupport/qmakeandroidsupport.h b/src/plugins/qmakeandroidsupport/qmakeandroidsupport.h index 1a9e4f69c3..52557f1881 100644 --- a/src/plugins/qmakeandroidsupport/qmakeandroidsupport.h +++ b/src/plugins/qmakeandroidsupport/qmakeandroidsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEANDROIDSUPPORT_H -#define QMAKEANDROIDSUPPORT_H +#pragma once #include <android/androidqtsupport.h> @@ -49,5 +48,3 @@ public: } // namespace Internal } // namespace QmakeAndroidSupport - -#endif // QMAKEANDROIDSUPPORT_H diff --git a/src/plugins/qmakeandroidsupport/qmakeandroidsupportplugin.h b/src/plugins/qmakeandroidsupport/qmakeandroidsupportplugin.h index ba5fa5e98f..e2f8be83b2 100644 --- a/src/plugins/qmakeandroidsupport/qmakeandroidsupportplugin.h +++ b/src/plugins/qmakeandroidsupport/qmakeandroidsupportplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEANDROIDSUPPORTPLUGIN_H -#define QMAKEANDROIDSUPPORTPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -45,5 +44,3 @@ public: } // namespace Internal } // namespace QmakeAndroidSupport - -#endif // QMAKEANDROIDSUPPORTPLUGIN_H diff --git a/src/plugins/qmakeprojectmanager/addlibrarywizard.h b/src/plugins/qmakeprojectmanager/addlibrarywizard.h index 7aa90141a1..6a0201c398 100644 --- a/src/plugins/qmakeprojectmanager/addlibrarywizard.h +++ b/src/plugins/qmakeprojectmanager/addlibrarywizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDLIBRARYWIZARD_H -#define ADDLIBRARYWIZARD_H +#pragma once #include <utils/wizard.h> #include <utils/pathchooser.h> @@ -141,5 +140,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // ADDLIBRARYWIZARD_H diff --git a/src/plugins/qmakeprojectmanager/applicationlauncher.h b/src/plugins/qmakeprojectmanager/applicationlauncher.h index 4732497f92..4889a5bc57 100644 --- a/src/plugins/qmakeprojectmanager/applicationlauncher.h +++ b/src/plugins/qmakeprojectmanager/applicationlauncher.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef APPLICATIONLAUNCHER_H -#define APPLICATIONLAUNCHER_H +#pragma once #include <QObject> #include <QStringList> @@ -77,5 +76,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // APPLICATIONLAUNCHER_H diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/classdefinition.h b/src/plugins/qmakeprojectmanager/customwidgetwizard/classdefinition.h index 8142ec82c6..ab6280659b 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/classdefinition.h +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/classdefinition.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSDEFINITION_H -#define CLASSDEFINITION_H +#pragma once #include "ui_classdefinition.h" #include "filenamingparameters.h" @@ -67,5 +66,3 @@ private: } } - -#endif diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/classlist.h b/src/plugins/qmakeprojectmanager/customwidgetwizard/classlist.h index baacbaf657..39c04deafe 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/classlist.h +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/classlist.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLASSLIST_H -#define CLASSLIST_H +#pragma once #include <QListView> @@ -68,4 +67,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager -#endif diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.h b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.h index dece6b2d8b..38b8c9c727 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.h +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMWIDGETPLUGINWIZARDPAGE_H -#define CUSTOMWIDGETPLUGINWIZARDPAGE_H +#pragma once #include "filenamingparameters.h" @@ -75,5 +74,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // CUSTOMWIDGETPLUGINWIZARDPAGE_H diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwidgetswizardpage.h b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwidgetswizardpage.h index d01f053073..6d9ed8d1ad 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwidgetswizardpage.h +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwidgetswizardpage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMWIDGETWIDGETSWIZARDPAGE_H -#define CUSTOMWIDGETWIDGETSWIZARDPAGE_H +#pragma once #include "pluginoptions.h" #include "filenamingparameters.h" @@ -83,5 +82,3 @@ private: } } - -#endif // CUSTOMWIDGETWIDGETSWIZARDPAGE_H diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwizard.h b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwizard.h index 4618d5a3e0..029c81fea2 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwizard.h +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMWIDGETWIZARD_H -#define CUSTOMWIDGETWIZARD_H +#pragma once #include "../wizards/qtwizard.h" @@ -46,5 +45,3 @@ protected: } // namespace Internal } // namespace QmakeProjectManager - -#endif // CUSTOMWIDGETWIZARD_H diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwizarddialog.h b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwizarddialog.h index 5e72537aea..feeddb5c0b 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwizarddialog.h +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetwizarddialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMWIDGETWIZARDDIALOG_H -#define CUSTOMWIDGETWIZARDDIALOG_H +#pragma once #include "../wizards/qtwizard.h" @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // CUSTOMWIDGETWIZARDDIALOG_H diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/filenamingparameters.h b/src/plugins/qmakeprojectmanager/customwidgetwizard/filenamingparameters.h index bc6a1eee88..7f130f3339 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/filenamingparameters.h +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/filenamingparameters.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILENAMINGPARAMETERS_H -#define FILENAMINGPARAMETERS_H +#pragma once #include <QString> #include <QFileInfo> @@ -79,4 +78,3 @@ struct FileNamingParameters } } -#endif // FILENAMINGPARAMETERS_H diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.h b/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.h index c9c2e4afa7..2307a4ba77 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.h +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINGENERATOR_H -#define PLUGINGENERATOR_H +#pragma once #include <QObject> #include <QString> @@ -65,5 +64,3 @@ private: } } - -#endif diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/pluginoptions.h b/src/plugins/qmakeprojectmanager/customwidgetwizard/pluginoptions.h index 8e040c7242..6ff77c8426 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/pluginoptions.h +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/pluginoptions.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINOPTIONS_H -#define PLUGINOPTIONS_H +#pragma once #include <QString> #include <QList> @@ -66,5 +65,3 @@ struct PluginOptions { } } - -#endif diff --git a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h index 5e5d427e73..0eba545650 100644 --- a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h +++ b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESKTOPQMAKERUNCONFIGURATION_H -#define DESKTOPQMAKERUNCONFIGURATION_H +#pragma once #include <qmakeprojectmanager/qmakerunconfigurationfactory.h> @@ -171,5 +170,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // DESKTOPQMAKERUNCONFIGURATION_H diff --git a/src/plugins/qmakeprojectmanager/externaleditors.h b/src/plugins/qmakeprojectmanager/externaleditors.h index 767f1f40e3..f60e355b64 100644 --- a/src/plugins/qmakeprojectmanager/externaleditors.h +++ b/src/plugins/qmakeprojectmanager/externaleditors.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXTERNALEDITORS_H -#define EXTERNALEDITORS_H +#pragma once #include <coreplugin/editormanager/iexternaleditor.h> #include <coreplugin/id.h> @@ -139,5 +138,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // EXTERNALEDITORS_H diff --git a/src/plugins/qmakeprojectmanager/findqmakeprofiles.h b/src/plugins/qmakeprojectmanager/findqmakeprofiles.h index 17ab34626d..ba1772c78c 100644 --- a/src/plugins/qmakeprojectmanager/findqmakeprofiles.h +++ b/src/plugins/qmakeprojectmanager/findqmakeprofiles.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDQMAKEPROFILES_H -#define FINDQMAKEPROFILES_H +#pragma once #include <projectexplorer/nodesvisitor.h> @@ -44,6 +43,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // FINDQMAKEPROFILES_H - diff --git a/src/plugins/qmakeprojectmanager/librarydetailscontroller.h b/src/plugins/qmakeprojectmanager/librarydetailscontroller.h index 2557fa619d..b6388c75d1 100644 --- a/src/plugins/qmakeprojectmanager/librarydetailscontroller.h +++ b/src/plugins/qmakeprojectmanager/librarydetailscontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LIBRARYDETAILSCONTROLLER_H -#define LIBRARYDETAILSCONTROLLER_H +#pragma once #include "addlibrarywizard.h" @@ -198,5 +197,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // LIBRARYDETAILSCONTROLLER_H diff --git a/src/plugins/qmakeprojectmanager/makefileparse.h b/src/plugins/qmakeprojectmanager/makefileparse.h index 33e9d7afcb..9a8783d247 100644 --- a/src/plugins/qmakeprojectmanager/makefileparse.h +++ b/src/plugins/qmakeprojectmanager/makefileparse.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MAKEFILEPARSE_H -#define MAKEFILEPARSE_H +#pragma once #include <utils/fileutils.h> #include <qtsupport/baseqtversion.h> @@ -87,6 +86,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - - -#endif // MAKEFILEPARSE_H diff --git a/src/plugins/qmakeprojectmanager/makestep.cpp b/src/plugins/qmakeprojectmanager/makestep.cpp index afcca92053..c23d90b16a 100644 --- a/src/plugins/qmakeprojectmanager/makestep.cpp +++ b/src/plugins/qmakeprojectmanager/makestep.cpp @@ -233,9 +233,7 @@ bool MakeStep::init(QList<const BuildStep *> &earlierSteps) Utils::QtcProcess::addArg(&args, objectFile); } Utils::Environment env = bc->environment(); - // Force output to english for the parsers. Do this here and not in the toolchain's - // addToEnvironment() to not screw up the users run environment. - env.set(QLatin1String("LC_ALL"), QLatin1String("C")); + Utils::Environment::setupEnglishOutput(&env); // We also prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose if (tc && m_makeCmd.isEmpty()) { if (tc->targetAbi().os() == Abi::WindowsOS @@ -415,9 +413,7 @@ void MakeStepConfigWidget::updateDetails() QString args = m_makeStep->userArguments(); Utils::Environment env = bc->environment(); - // Force output to english for the parsers. Do this here and not in the toolchain's - // addToEnvironment() to not screw up the users run environment. - env.set(QLatin1String("LC_ALL"), QLatin1String("C")); + Utils::Environment::setupEnglishOutput(&env); // We prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose // FIXME doing this without the user having a way to override this is rather bad if (tc && m_makeStep->makeCommand().isEmpty()) { diff --git a/src/plugins/qmakeprojectmanager/makestep.h b/src/plugins/qmakeprojectmanager/makestep.h index 2d49ba5fb6..e3618f4f9c 100644 --- a/src/plugins/qmakeprojectmanager/makestep.h +++ b/src/plugins/qmakeprojectmanager/makestep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MAKESTEP_H -#define MAKESTEP_H +#pragma once #include "qmakeprojectmanager_global.h" @@ -137,5 +136,3 @@ private: }; } // QmakeProjectManager - -#endif // MAKESTEP_H diff --git a/src/plugins/qmakeprojectmanager/profilecompletionassist.h b/src/plugins/qmakeprojectmanager/profilecompletionassist.h index 1104d9548a..a63f3e7a8d 100644 --- a/src/plugins/qmakeprojectmanager/profilecompletionassist.h +++ b/src/plugins/qmakeprojectmanager/profilecompletionassist.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROFILECOMPLETIONASSIST_H -#define PROFILECOMPLETIONASSIST_H +#pragma once #include <texteditor/codeassist/completionassistprovider.h> @@ -53,5 +52,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // PROFILECOMPLETIONASSIST_H diff --git a/src/plugins/qmakeprojectmanager/profileeditor.h b/src/plugins/qmakeprojectmanager/profileeditor.h index 6f1fb49107..048a0f0b13 100644 --- a/src/plugins/qmakeprojectmanager/profileeditor.h +++ b/src/plugins/qmakeprojectmanager/profileeditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROFILEEDITOR_H -#define PROFILEEDITOR_H +#pragma once #include <texteditor/texteditor.h> @@ -41,5 +40,3 @@ public: } // namespace Internal } // namespace QmakeProjectManager - -#endif // PROFILEEDITOR_H diff --git a/src/plugins/qmakeprojectmanager/profilehighlighter.h b/src/plugins/qmakeprojectmanager/profilehighlighter.h index 417cb49a1f..98de83c9c2 100644 --- a/src/plugins/qmakeprojectmanager/profilehighlighter.h +++ b/src/plugins/qmakeprojectmanager/profilehighlighter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROFILEHIGHLIGHTER_H -#define PROFILEHIGHLIGHTER_H +#pragma once #include <texteditor/syntaxhighlighter.h> #include <texteditor/codeassist/keywordscompletionassist.h> @@ -52,5 +51,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // PROFILEHIGHLIGHTER_H diff --git a/src/plugins/qmakeprojectmanager/profilehoverhandler.h b/src/plugins/qmakeprojectmanager/profilehoverhandler.h index 890701c7ad..407c1f4d28 100644 --- a/src/plugins/qmakeprojectmanager/profilehoverhandler.h +++ b/src/plugins/qmakeprojectmanager/profilehoverhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROFILEHOVERHANDLER_H -#define PROFILEHOVERHANDLER_H +#pragma once #include <texteditor/basehoverhandler.h> #include <texteditor/codeassist/keywordscompletionassist.h> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // PROFILEHOVERHANDLER_H diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h index ffb3775f00..a8793b408c 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEBUILDCONFIGURATION_H -#define QMAKEBUILDCONFIGURATION_H +#pragma once #include "qmakeprojectmanager_global.h" @@ -180,5 +179,3 @@ private: }; } // namespace QmakeProjectManager - -#endif // QMAKEBUILDCONFIGURATION_H diff --git a/src/plugins/qmakeprojectmanager/qmakebuildinfo.h b/src/plugins/qmakeprojectmanager/qmakebuildinfo.h index 9d8c0f49e0..41e3eeb507 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildinfo.h +++ b/src/plugins/qmakeprojectmanager/qmakebuildinfo.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEBUILDINFO_H -#define QMAKEBUILDINFO_H +#pragma once #include "qmakebuildconfiguration.h" #include "qmakestep.h" @@ -63,5 +62,3 @@ public: }; } // namespace QmakeProjectManager - -#endif // QMAKEBUILDINFO_H diff --git a/src/plugins/qmakeprojectmanager/qmakekitconfigwidget.h b/src/plugins/qmakeprojectmanager/qmakekitconfigwidget.h index 234d7221c4..43bd4e8ac7 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitconfigwidget.h +++ b/src/plugins/qmakeprojectmanager/qmakekitconfigwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEKITCONFIGWIDGET_H -#define QMAKEKITCONFIGWIDGET_H +#pragma once #include <projectexplorer/kitconfigwidget.h> @@ -62,5 +61,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // QMAKEKITCONFIGWIDGET_H diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.h b/src/plugins/qmakeprojectmanager/qmakekitinformation.h index 79e73a5f3b..0e77153d55 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.h +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEKITINFORMATION_H -#define QMAKEKITINFORMATION_H +#pragma once #include "qmakeprojectmanager_global.h" @@ -56,5 +55,3 @@ public: }; } // namespace QmakeProjectManager - -#endif // QMAKEKITINFORMATION_H diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index 63b4319de0..017a08c8c9 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -950,8 +950,10 @@ QList<ProjectAction> QmakePriFileNode::supportedActions(Node *node) const FileNode *fileNode = node->asFileNode(); if ((fileNode && fileNode->fileType() != ProjectFileType) - || dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(node)) + || dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(node)) { actions << Rename; + actions << DuplicateFile; + } Target *target = m_project->activeTarget(); diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.h b/src/plugins/qmakeprojectmanager/qmakenodes.h index ca565a4515..5e70c708a8 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.h +++ b/src/plugins/qmakeprojectmanager/qmakenodes.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKENODES_H -#define QMAKENODES_H +#pragma once #include "qmakeprojectmanager_global.h" #include "proparser/prowriter.h" @@ -238,7 +237,6 @@ private: namespace Internal { class QmakePriFile : public Core::IDocument { - Q_OBJECT public: QmakePriFile(QmakePriFileNode *qmakePriFile); @@ -420,5 +418,3 @@ private: }; } // namespace QmakeProjectManager - -#endif // QMAKENODES_H diff --git a/src/plugins/qmakeprojectmanager/qmakeparser.h b/src/plugins/qmakeprojectmanager/qmakeparser.h index 98432573fd..c5dbb91a5c 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparser.h +++ b/src/plugins/qmakeprojectmanager/qmakeparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEPARSER_H -#define QMAKEPARSER_H +#pragma once #include "qmakeprojectmanager_global.h" @@ -47,5 +46,3 @@ private: }; } // namespace QmakeProjectManager - -#endif // QMAKEPARSER_H diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index bc07296e53..d286ca3720 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -94,7 +94,6 @@ namespace Internal { class QmakeProjectFile : public Core::IDocument { - Q_OBJECT public: QmakeProjectFile(const QString &filePath); diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.h b/src/plugins/qmakeprojectmanager/qmakeproject.h index c338a81312..77f6c7e756 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.h +++ b/src/plugins/qmakeprojectmanager/qmakeproject.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEPROJECT_H -#define QMAKEPROJECT_H +#pragma once #include "qmakeprojectmanager_global.h" #include "qmakeprojectmanager.h" @@ -206,6 +205,3 @@ private: }; } // namespace QmakeProjectManager - - -#endif // QMAKEPROJECT_H diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.h b/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.h index 8e84e61a2b..2d775fcd80 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEPROJECTCONFIGWIDGET_H -#define QMAKEPROJECTCONFIGWIDGET_H +#pragma once #include <projectexplorer/namedwidget.h> @@ -73,5 +72,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // QMAKEPROJECTCONFIGWIDGET_H diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.h b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.h index 725186a1d5..a6e8dce3c7 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEPROJECTIMPORTER_H -#define QMAKEPROJECTIMPORTER_H +#pragma once #include "qmakestep.h" @@ -61,5 +60,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // QMAKEPROJECTIMPORTER_H diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h index 28b8014bb6..8bffd7cf1c 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h @@ -52,8 +52,8 @@ public: void unregisterProject(QmakeProject *project); void notifyChanged(const Utils::FileName &name); - virtual QString mimeType() const; - ProjectExplorer::Project *openProject(const QString &fileName, QString *errorString); + QString mimeType() const override; + ProjectExplorer::Project *openProject(const QString &fileName, QString *errorString) override; // Context information used in the slot implementations ProjectExplorer::Node *contextNode() const; diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager_global.h b/src/plugins/qmakeprojectmanager/qmakeprojectmanager_global.h index 46c3e2501c..7dee97cb25 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager_global.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEPROJECTMANAGER_GLOBAL_H -#define QMAKEPROJECTMANAGER_GLOBAL_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define QMAKEPROJECTMANAGER_EXPORT Q_DECL_IMPORT #endif - -#endif // QMAKEPROJECTMANAGER_GLOBAL_H diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerconstants.h b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerconstants.h index 649c61bbc6..fcb102589b 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerconstants.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEPROJECTMANAGERCONSTANTS_H -#define QMAKEPROJECTMANAGERCONSTANTS_H +#pragma once #include <QtGlobal> @@ -69,5 +68,3 @@ const char ICON_QTQUICK_APP[] = ":/wizards/images/qtquickapp.png"; } // namespace Constants } // namespace QmakeProjectManager - -#endif // QMAKEPROJECTMANAGERCONSTANTS_H diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h index 2029fe2b9e..473065f5f1 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEPROJECTMANAGERPLUGIN_H -#define QMAKEPROJECTMANAGERPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> #include <coreplugin/icontext.h> @@ -94,5 +93,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // QMAKEPROJECTMANAGERPLUGIN_H diff --git a/src/plugins/qmakeprojectmanager/qmakerunconfigurationfactory.h b/src/plugins/qmakeprojectmanager/qmakerunconfigurationfactory.h index a40978453d..3f0bfc419c 100644 --- a/src/plugins/qmakeprojectmanager/qmakerunconfigurationfactory.h +++ b/src/plugins/qmakeprojectmanager/qmakerunconfigurationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKERUNCONFIGURATIONFACTORY_H -#define QMAKERUNCONFIGURATIONFACTORY_H +#pragma once #include "qmakeprojectmanager_global.h" @@ -49,5 +48,3 @@ public: }; } // namespace QmakeProjectManager - -#endif // QMAKERUNCONFIGURATIONFACTORY_H diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index 3509e85981..5d80671d07 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKESTEP_H -#define QMAKESTEP_H +#pragma once #include "qmakeprojectmanager_global.h" #include <projectexplorer/abstractprocessstep.h> @@ -224,5 +223,3 @@ private: }; } // namespace QmakeProjectManager - -#endif // QMAKESTEP_H diff --git a/src/plugins/qmakeprojectmanager/qtmodulesinfo.h b/src/plugins/qmakeprojectmanager/qtmodulesinfo.h index b3541c3088..5f3e793d3c 100644 --- a/src/plugins/qmakeprojectmanager/qtmodulesinfo.h +++ b/src/plugins/qmakeprojectmanager/qtmodulesinfo.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTMODULESINFO_H -#define QTMODULESINFO_H +#pragma once #include <QStringList> @@ -42,5 +41,3 @@ public: } // namespace Internal } // namespace QmakeProjectManager - -#endif // QTMODULESINFO_H diff --git a/src/plugins/qmakeprojectmanager/wizards/filespage.h b/src/plugins/qmakeprojectmanager/wizards/filespage.h index 0160d9830a..135eb3d146 100644 --- a/src/plugins/qmakeprojectmanager/wizards/filespage.h +++ b/src/plugins/qmakeprojectmanager/wizards/filespage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILESPAGE_H -#define FILESPAGE_H +#pragma once #include <QWizard> @@ -83,5 +82,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // FILESPAGE_H diff --git a/src/plugins/qmakeprojectmanager/wizards/guiappwizard.h b/src/plugins/qmakeprojectmanager/wizards/guiappwizard.h index 44286b26a9..82369889e9 100644 --- a/src/plugins/qmakeprojectmanager/wizards/guiappwizard.h +++ b/src/plugins/qmakeprojectmanager/wizards/guiappwizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GUIAPPWIZARD_H -#define GUIAPPWIZARD_H +#pragma once #include "qtwizard.h" @@ -53,5 +52,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // GUIAPPWIZARD_H diff --git a/src/plugins/qmakeprojectmanager/wizards/guiappwizarddialog.h b/src/plugins/qmakeprojectmanager/wizards/guiappwizarddialog.h index e688b01042..ab28479700 100644 --- a/src/plugins/qmakeprojectmanager/wizards/guiappwizarddialog.h +++ b/src/plugins/qmakeprojectmanager/wizards/guiappwizarddialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GUIAPPWIZARDDIALOG_H -#define GUIAPPWIZARDDIALOG_H +#pragma once #include "qtwizard.h" @@ -72,5 +71,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // GUIAPPWIZARDDIALOG_H diff --git a/src/plugins/qmakeprojectmanager/wizards/libraryparameters.h b/src/plugins/qmakeprojectmanager/wizards/libraryparameters.h index 8c9790de89..760bb03365 100644 --- a/src/plugins/qmakeprojectmanager/wizards/libraryparameters.h +++ b/src/plugins/qmakeprojectmanager/wizards/libraryparameters.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LIBRARYPARAMETERS_H -#define LIBRARYPARAMETERS_H +#pragma once #include "qtprojectparameters.h" @@ -61,5 +60,3 @@ struct LibraryParameters { } // namespace Internal } // namespace QmakeProjectManager - -#endif // LIBRARYPARAMETERS_H diff --git a/src/plugins/qmakeprojectmanager/wizards/librarywizard.h b/src/plugins/qmakeprojectmanager/wizards/librarywizard.h index c327d6d2dc..d96df97df6 100644 --- a/src/plugins/qmakeprojectmanager/wizards/librarywizard.h +++ b/src/plugins/qmakeprojectmanager/wizards/librarywizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LIBRARYWIZARD_H -#define LIBRARYWIZARD_H +#pragma once #include "qtwizard.h" #include "libraryparameters.h" @@ -47,5 +46,3 @@ protected: } // namespace Internal } // namespace QmakeProjectManager - -#endif // LIBRARYWIZARD_H diff --git a/src/plugins/qmakeprojectmanager/wizards/librarywizarddialog.h b/src/plugins/qmakeprojectmanager/wizards/librarywizarddialog.h index 28ba6952f6..620ffe7cca 100644 --- a/src/plugins/qmakeprojectmanager/wizards/librarywizarddialog.h +++ b/src/plugins/qmakeprojectmanager/wizards/librarywizarddialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LIBRARYWIZARDDIALOG_H -#define LIBRARYWIZARDDIALOG_H +#pragma once #include "qtwizard.h" @@ -77,5 +76,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // LIBRARYWIZARDDIALOG_H diff --git a/src/plugins/qmakeprojectmanager/wizards/modulespage.h b/src/plugins/qmakeprojectmanager/wizards/modulespage.h index 7fb8aa9496..394326d1df 100644 --- a/src/plugins/qmakeprojectmanager/wizards/modulespage.h +++ b/src/plugins/qmakeprojectmanager/wizards/modulespage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODULESPAGE_H -#define MODULESPAGE_H +#pragma once #include <QMap> #include <QStringList> @@ -60,5 +59,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // MODULESPAGE_H diff --git a/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.h b/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.h index f973d98604..e82e2fb3ed 100644 --- a/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.h +++ b/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTPROJECTPARAMETERS_H -#define QTPROJECTPARAMETERS_H +#pragma once #include <QStringList> @@ -71,5 +70,3 @@ struct QtProjectParameters { } // namespace Internal } // namespace QmakeProjectManager - -#endif // QTPROJECTPARAMETERS_H diff --git a/src/plugins/qmakeprojectmanager/wizards/qtwizard.h b/src/plugins/qmakeprojectmanager/wizards/qtwizard.h index d14dfe9ce3..813ca9555f 100644 --- a/src/plugins/qmakeprojectmanager/wizards/qtwizard.h +++ b/src/plugins/qmakeprojectmanager/wizards/qtwizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTWIZARD_H -#define QTWIZARD_H +#pragma once #include "qtprojectparameters.h" #include <projectexplorer/baseprojectwizarddialog.h> @@ -146,5 +145,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // QTWIZARD_H diff --git a/src/plugins/qmakeprojectmanager/wizards/subdirsprojectwizard.h b/src/plugins/qmakeprojectmanager/wizards/subdirsprojectwizard.h index dbdd54f2f0..8f6cb99b78 100644 --- a/src/plugins/qmakeprojectmanager/wizards/subdirsprojectwizard.h +++ b/src/plugins/qmakeprojectmanager/wizards/subdirsprojectwizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SUBDIRSPROJECTWIZARD_H -#define SUBDIRSPROJECTWIZARD_H +#pragma once #include "qtwizard.h" @@ -49,5 +48,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // SUBDIRSPROJECTWIZARD_H diff --git a/src/plugins/qmakeprojectmanager/wizards/subdirsprojectwizarddialog.h b/src/plugins/qmakeprojectmanager/wizards/subdirsprojectwizarddialog.h index 9b7160b6e6..7dab8c7273 100644 --- a/src/plugins/qmakeprojectmanager/wizards/subdirsprojectwizarddialog.h +++ b/src/plugins/qmakeprojectmanager/wizards/subdirsprojectwizarddialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SUBDIRSPROJECTWIZARDDIALOG_H -#define SUBDIRSPROJECTWIZARDDIALOG_H +#pragma once #include "qtwizard.h" @@ -47,5 +46,3 @@ public: } // namespace Internal } // namespace QmakeProjectManager - -#endif // SUBDIRSPROJECTWIZARDDIALOG_H diff --git a/src/plugins/qmakeprojectmanager/wizards/testwizard.h b/src/plugins/qmakeprojectmanager/wizards/testwizard.h index 9f027b9426..421cf95743 100644 --- a/src/plugins/qmakeprojectmanager/wizards/testwizard.h +++ b/src/plugins/qmakeprojectmanager/wizards/testwizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTWIZARD_H -#define TESTWIZARD_H +#pragma once #include "qtwizard.h" @@ -46,5 +45,3 @@ protected: } // namespace Internal } // namespace QmakeProjectManager - -#endif // TESTWIZARD_H diff --git a/src/plugins/qmakeprojectmanager/wizards/testwizarddialog.h b/src/plugins/qmakeprojectmanager/wizards/testwizarddialog.h index b92d316867..8efcf0bb47 100644 --- a/src/plugins/qmakeprojectmanager/wizards/testwizarddialog.h +++ b/src/plugins/qmakeprojectmanager/wizards/testwizarddialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTWIZARDDIALOG_H -#define TESTWIZARDDIALOG_H +#pragma once #include "qtwizard.h" @@ -74,5 +73,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // TESTWIZARDDIALOG_H diff --git a/src/plugins/qmakeprojectmanager/wizards/testwizardpage.h b/src/plugins/qmakeprojectmanager/wizards/testwizardpage.h index 7857a598a3..e9076af5bf 100644 --- a/src/plugins/qmakeprojectmanager/wizards/testwizardpage.h +++ b/src/plugins/qmakeprojectmanager/wizards/testwizardpage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTWIZARDPAGE_H -#define TESTWIZARDPAGE_H +#pragma once #include <QWizardPage> @@ -68,5 +67,3 @@ private: } // namespace Internal } // namespace QmakeProjectManager - -#endif // TESTWIZARDPAGE_H diff --git a/src/plugins/qmldesigner/components/componentcore/abstractaction.h b/src/plugins/qmldesigner/components/componentcore/abstractaction.h index f6b43e67d1..0c347b5d23 100644 --- a/src/plugins/qmldesigner/components/componentcore/abstractaction.h +++ b/src/plugins/qmldesigner/components/componentcore/abstractaction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_DEFAULTDESIGNERACTION_H -#define QMLDESIGNER_DEFAULTDESIGNERACTION_H +#pragma once #include "actioninterface.h" @@ -74,5 +73,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_DEFAULTDESIGNERACTION_H diff --git a/src/plugins/qmldesigner/components/componentcore/abstractactiongroup.h b/src/plugins/qmldesigner/components/componentcore/abstractactiongroup.h index f6997ab4c9..d13b7782cc 100644 --- a/src/plugins/qmldesigner/components/componentcore/abstractactiongroup.h +++ b/src/plugins/qmldesigner/components/componentcore/abstractactiongroup.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MENUDESIGNERACTION_H -#define MENUDESIGNERACTION_H +#pragma once #include "actioninterface.h" @@ -57,5 +56,3 @@ private: }; } // namespace QmlDesigner - -#endif // MENUDESIGNERACTION_H diff --git a/src/plugins/qmldesigner/components/componentcore/actioninterface.h b/src/plugins/qmldesigner/components/componentcore/actioninterface.h index 9b6afc4edc..d3d23ca43a 100644 --- a/src/plugins/qmldesigner/components/componentcore/actioninterface.h +++ b/src/plugins/qmldesigner/components/componentcore/actioninterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ABSTRACTDESIGNERACTION_H -#define ABSTRACTDESIGNERACTION_H +#pragma once #include "componentcore_constants.h" #include "selectioncontext.h" @@ -62,5 +61,3 @@ public: }; } //QmlDesigner - -#endif //ABSTRACTDESIGNERACTION_H diff --git a/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h b/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h index 86f1ccf6de..9da0027c0c 100644 --- a/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h +++ b/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPONENTCORE_CONSTANTS_H -#define COMPONENTCORE_CONSTANTS_H +#pragma once #include <QtGlobal> @@ -112,5 +111,3 @@ const int priorityLast = 60; } //ComponentCoreConstants } //QmlDesigner - -#endif //COMPONENTCORE_CONSTANTS_H diff --git a/src/plugins/qmldesigner/components/componentcore/crumblebar.cpp b/src/plugins/qmldesigner/components/componentcore/crumblebar.cpp index 05cb2b7585..cecb5a478a 100644 --- a/src/plugins/qmldesigner/components/componentcore/crumblebar.cpp +++ b/src/plugins/qmldesigner/components/componentcore/crumblebar.cpp @@ -50,7 +50,7 @@ static inline QString componentIdForModelNode(const ModelNode &modelNode) if (modelNode.hasParentProperty() && modelNode.parentProperty().name() != "data" && modelNode.parentProperty().name() != "children") { - return modelNode.parentProperty().name(); + return QString::fromUtf8(modelNode.parentProperty().name()); } else { return modelNode.simplifiedTypeName(); } diff --git a/src/plugins/qmldesigner/components/componentcore/crumblebar.h b/src/plugins/qmldesigner/components/componentcore/crumblebar.h index cb19c6ce0f..a09f2e3b4f 100644 --- a/src/plugins/qmldesigner/components/componentcore/crumblebar.h +++ b/src/plugins/qmldesigner/components/componentcore/crumblebar.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_FORMEDITORCRUMBLEBAR_H -#define QMLDESIGNER_FORMEDITORCRUMBLEBAR_H +#pragma once #include <QObject> #include <utils/crumblepath.h> @@ -70,5 +69,3 @@ bool operator !=(const CrumbleBarInfo &first, const CrumbleBarInfo &second); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::CrumbleBarInfo) - -#endif // QMLDESIGNER_FORMEDITORCRUMBLEBAR_H diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.h b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.h index f0ed41cba1..fca668b679 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.h +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNERACTIONMANAGER_H -#define DESIGNERACTIONMANAGER_H +#pragma once #include <qmldesignercorelib_global.h> #include "actioninterface.h" @@ -51,5 +50,3 @@ private: }; } //QmlDesigner - -#endif //DESIGNERACTIONMANAGER_H diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanagerview.h b/src/plugins/qmldesigner/components/componentcore/designeractionmanagerview.h index 4613cb0332..b33d65f41b 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanagerview.h +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanagerview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_DESIGNERACTIONMANAGERVIEW_H -#define QMLDESIGNER_DESIGNERACTIONMANAGERVIEW_H +#pragma once #include <abstractview.h> @@ -78,5 +77,3 @@ private: } // namespace QmlDesigner - -#endif // QMLDESIGNER_DESIGNERACTIONMANAGERVIEW_H diff --git a/src/plugins/qmldesigner/components/componentcore/findimplementation.h b/src/plugins/qmldesigner/components/componentcore/findimplementation.h index d6f53e1b35..931e0aea94 100644 --- a/src/plugins/qmldesigner/components/componentcore/findimplementation.h +++ b/src/plugins/qmldesigner/components/componentcore/findimplementation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDIMPLEMENTATION_H -#define FINDIMPLEMENTATION_H +#pragma once #include <QList> @@ -36,5 +35,3 @@ public: FindImplementation(); static QList<QmlJSEditor::FindReferences::Usage> run(const QString &fileName, const QString &typeName, const QString &itemName); }; - -#endif // FINDIMPLEMENTATION_H diff --git a/src/plugins/qmldesigner/components/componentcore/layoutingridlayout.h b/src/plugins/qmldesigner/components/componentcore/layoutingridlayout.h index ed7b8eece6..4acc4291a6 100644 --- a/src/plugins/qmldesigner/components/componentcore/layoutingridlayout.h +++ b/src/plugins/qmldesigner/components/componentcore/layoutingridlayout.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LAYOUTINGRIDLAYOUT_H -#define LAYOUTINGRIDLAYOUT_H +#pragma once #include "selectioncontext.h" @@ -82,5 +81,3 @@ private: }; } //QmlDesigner - -#endif // LAYOUTINGRIDLAYOUT_H diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu.cpp index 8f1e3cdd0c..7e9423c2df 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu.cpp @@ -42,7 +42,7 @@ ModelNodeContextMenu::ModelNodeContextMenu(AbstractView *view) : } static QSet<ActionInterface* > findMembers(QSet<ActionInterface* > actionInterface, - const QString &category) + const QByteArray &category) { QSet<ActionInterface* > ret; @@ -55,7 +55,7 @@ static QSet<ActionInterface* > findMembers(QSet<ActionInterface* > actionInterfa void populateMenu(QSet<ActionInterface* > &actionInterfaces, - const QString &category, + const QByteArray &category, QMenu* menu, const SelectionContext &selectionContext) { @@ -96,7 +96,7 @@ void ModelNodeContextMenu::execute(const QPoint &position, bool selectionMenuBoo QSet<ActionInterface* > factories = QSet<ActionInterface* >::fromList(QmlDesignerPlugin::instance()->designerActionManager().designerActions()); - populateMenu(factories, QString(""), mainMenu, m_selectionContext); + populateMenu(factories, QByteArray(), mainMenu, m_selectionContext); mainMenu->exec(position); mainMenu->deleteLater(); diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu.h b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu.h index 615ac45128..58a1d1f9cf 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu.h +++ b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELNODECONTEXTMENU_H -#define MODELNODECONTEXTMENU_H +#pragma once #include <QPoint> #include <QCoreApplication> @@ -50,5 +49,3 @@ private: }; } // namespace QmlDesigner - -#endif // MODELNODECONTEXTMENU_H diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.h b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.h index 11fd6e2dea..233e5c5649 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.h +++ b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELNODECONTEXTMENU_HELPER_H -#define MODELNODECONTEXTMENU_HELPER_H +#pragma once #include "modelnodeoperations.h" #include "abstractaction.h" @@ -191,5 +190,3 @@ private: } //QmlDesigner - -#endif // MODELNODECONTEXTMENU_HELPER_H diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp index 1e8ac14f93..6c6b9198aa 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp @@ -602,7 +602,7 @@ static void addSignal(const QString &typeName, const QString &itemId, const QStr signalHandlerName = itemId.toUtf8() + ".on" + toUpper(signalName).toUtf8(); foreach (const ModelNode &modelNode, rewriterView.allModelNodes()) { - if (modelNode.type() == typeName) { + if (modelNode.type() == typeName.toUtf8()) { modelNode.signalHandlerProperty(signalHandlerName).setSource(QLatin1String("{\n}")); } } @@ -627,11 +627,11 @@ static QStringList getSortedSignalNameList(const ModelNode &modelNode) if (metaInfo.isValid()) { foreach (const PropertyName &signalName, sortedPropertyNameList(metaInfo.signalNames())) if (!signalName.contains("Changed")) - signalNames.append(signalName); + signalNames.append(QString::fromUtf8(signalName)); foreach (const PropertyName &propertyName, sortedPropertyNameList(metaInfo.propertyNames())) if (!propertyName.contains(".")) - signalNames.append(propertyName + "Changed"); + signalNames.append(QString::fromUtf8(propertyName + "Changed")); } return signalNames; diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h index 74682d7d03..bdc43684ce 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELNODEOPERATIONS_H -#define MODELNODEOPERATIONS_H +#pragma once #include "selectioncontext.h" @@ -71,5 +70,3 @@ void removePositioner(const SelectionContext &selectionContext); } // namespace ModelNodeOperationso } //QmlDesigner - -#endif //MODELNODEOPERATIONS_H diff --git a/src/plugins/qmldesigner/components/componentcore/selectioncontext.h b/src/plugins/qmldesigner/components/componentcore/selectioncontext.h index 662c3b1ae9..17e5981e6d 100644 --- a/src/plugins/qmldesigner/components/componentcore/selectioncontext.h +++ b/src/plugins/qmldesigner/components/componentcore/selectioncontext.h @@ -28,8 +28,7 @@ #include <QPointF> #include <QPointer> -#ifndef SELECTIONCONTEXT_H -#define SELECTIONCONTEXT_H +#pragma once namespace QmlDesigner { @@ -72,5 +71,3 @@ private: }; } //QmlDesigner - -#endif //SELECTIONCONTEXT_H diff --git a/src/plugins/qmldesigner/components/debugview/debugview.h b/src/plugins/qmldesigner/components/debugview/debugview.h index 898a85c748..51344f0696 100644 --- a/src/plugins/qmldesigner/components/debugview/debugview.h +++ b/src/plugins/qmldesigner/components/debugview/debugview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGVIEW_H -#define DEBUGVIEW_H +#pragma once #include <abstractview.h> #include <QPointer> @@ -101,5 +100,3 @@ private: //variables } // namespace Internal } // namespace QmlDesigner - -#endif // DEBUGVIEW_H diff --git a/src/plugins/qmldesigner/components/debugview/debugviewwidget.h b/src/plugins/qmldesigner/components/debugview/debugviewwidget.h index 34329f45c3..ca6cdfb8fa 100644 --- a/src/plugins/qmldesigner/components/debugview/debugviewwidget.h +++ b/src/plugins/qmldesigner/components/debugview/debugviewwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGVIEWWIDGET_H -#define DEBUGVIEWWIDGET_H +#pragma once #include <QWidget> @@ -56,6 +55,3 @@ private: } //namespace Internal } //namespace QmlDesigner - -#endif //DEBUGVIEWWIDGET_H - diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp index 048ef76340..0f958a0f96 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp @@ -173,7 +173,7 @@ void FormEditorScene::synchronizeParent(const QmlItemNode &qmlItemNode) reparentItem(qmlItemNode, parentNode); } -void FormEditorScene::synchronizeOtherProperty(const QmlItemNode &qmlItemNode, const QString &propertyName) +void FormEditorScene::synchronizeOtherProperty(const QmlItemNode &qmlItemNode, const QByteArray &propertyName) { if (hasItemForQmlItemNode(qmlItemNode)) { FormEditorItem *item = itemForQmlItemNode(qmlItemNode); diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorscene.h b/src/plugins/qmldesigner/components/formeditor/formeditorscene.h index a356d69cca..a16b45dab2 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorscene.h +++ b/src/plugins/qmldesigner/components/formeditor/formeditorscene.h @@ -71,7 +71,7 @@ public: void synchronizeTransformation(const QmlItemNode &qmlItemNode); void synchronizeParent(const QmlItemNode &qmlItemNode); - void synchronizeOtherProperty(const QmlItemNode &qmlItemNode, const QString &propertyName); + void synchronizeOtherProperty(const QmlItemNode &qmlItemNode, const QByteArray &propertyName); void synchronizeState(const QmlItemNode &qmlItemNode); FormEditorItem* calulateNewParent(FormEditorItem *widget); diff --git a/src/plugins/qmldesigner/components/importmanager/importlabel.h b/src/plugins/qmldesigner/components/importmanager/importlabel.h index 35150ac7c1..6df9e0286c 100644 --- a/src/plugins/qmldesigner/components/importmanager/importlabel.h +++ b/src/plugins/qmldesigner/components/importmanager/importlabel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IMPORTLABEL_H -#define IMPORTLABEL_H +#pragma once #include <QLabel> #include <QPushButton> @@ -56,4 +55,3 @@ private: }; } -#endif // IMPORTLABEL_H diff --git a/src/plugins/qmldesigner/components/importmanager/importmanagercombobox.h b/src/plugins/qmldesigner/components/importmanager/importmanagercombobox.h index 3378621c45..dd566a12bc 100644 --- a/src/plugins/qmldesigner/components/importmanager/importmanagercombobox.h +++ b/src/plugins/qmldesigner/components/importmanager/importmanagercombobox.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IMPORTMANAGERCOMBOBOX_H -#define IMPORTMANAGERCOMBOBOX_H +#pragma once #include <QComboBox> @@ -37,5 +36,3 @@ public: protected: void paintEvent(QPaintEvent *e); }; - -#endif // IMPORTMANAGERCOMBOBOX_H diff --git a/src/plugins/qmldesigner/components/importmanager/importmanagerview.h b/src/plugins/qmldesigner/components/importmanager/importmanagerview.h index e4a2a8630f..340f81fd65 100644 --- a/src/plugins/qmldesigner/components/importmanager/importmanagerview.h +++ b/src/plugins/qmldesigner/components/importmanager/importmanagerview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_IMPORTMANAGERVIEW_H -#define QMLDESIGNER_IMPORTMANAGERVIEW_H +#pragma once #include <abstractview.h> #include <QPointer> @@ -60,5 +59,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_IMPORTMANAGERVIEW_H diff --git a/src/plugins/qmldesigner/components/importmanager/importswidget.h b/src/plugins/qmldesigner/components/importmanager/importswidget.h index 647d68e9d3..bfac06f75c 100644 --- a/src/plugins/qmldesigner/components/importmanager/importswidget.h +++ b/src/plugins/qmldesigner/components/importmanager/importswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_IMPORTSWIDGET_H -#define QMLDESIGNER_IMPORTSWIDGET_H +#pragma once #include <import.h> @@ -69,5 +68,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_IMPORTSWIDGET_H diff --git a/src/plugins/qmldesigner/components/integration/componentaction.h b/src/plugins/qmldesigner/components/integration/componentaction.h index a61b3147fc..4d697cc7f4 100644 --- a/src/plugins/qmldesigner/components/integration/componentaction.h +++ b/src/plugins/qmldesigner/components/integration/componentaction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPONENTACTION_H -#define COMPONENTACTION_H +#pragma once #include <QWidgetAction> #include <QPointer> @@ -64,5 +63,3 @@ private: }; } // namespace QmlDesigner - -#endif // COMPONENTACTION_H diff --git a/src/plugins/qmldesigner/components/integration/componentview.cpp b/src/plugins/qmldesigner/components/integration/componentview.cpp index 1c4e554544..be304dd44d 100644 --- a/src/plugins/qmldesigner/components/integration/componentview.cpp +++ b/src/plugins/qmldesigner/components/integration/componentview.cpp @@ -135,9 +135,9 @@ QString ComponentView::descriptionForNode(const ModelNode &node) const ModelNode parentNode = node.parentProperty().parentModelNode(); if (parentNode.id().isEmpty()) - description = QString::fromUtf8(parentNode.simplifiedTypeName()) + QLatin1Char(' '); + description = parentNode.simplifiedTypeName() + ' '; else - description = parentNode.id() + QLatin1Char(' '); + description = parentNode.id() + ' '; description += QString::fromUtf8(node.parentProperty().name()); } diff --git a/src/plugins/qmldesigner/components/integration/componentview.h b/src/plugins/qmldesigner/components/integration/componentview.h index 865c1cf4f0..4740a7196a 100644 --- a/src/plugins/qmldesigner/components/integration/componentview.h +++ b/src/plugins/qmldesigner/components/integration/componentview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPONENTVIEW_H -#define COMPONENTVIEW_H +#pragma once #include <abstractview.h> #include <modelnode.h> @@ -94,5 +93,3 @@ private: }; } // namespace QmlDesigner - -#endif // COMPONENTVIEW_H diff --git a/src/plugins/qmldesigner/components/integration/designdocumentview.h b/src/plugins/qmldesigner/components/integration/designdocumentview.h index 45a6f7ae0b..d3fc45c38d 100644 --- a/src/plugins/qmldesigner/components/integration/designdocumentview.h +++ b/src/plugins/qmldesigner/components/integration/designdocumentview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DesignDocumentVIEW_H -#define DesignDocumentVIEW_H +#pragma once #include <abstractview.h> #include <modelmerger.h> @@ -54,5 +53,3 @@ private: }; }// namespace QmlDesigner - -#endif // DesignDocumentVIEW_H diff --git a/src/plugins/qmldesigner/components/integration/xuifiledialog.h b/src/plugins/qmldesigner/components/integration/xuifiledialog.h index cc1d2af48c..1ac647322e 100644 --- a/src/plugins/qmldesigner/components/integration/xuifiledialog.h +++ b/src/plugins/qmldesigner/components/integration/xuifiledialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef XUIFILEDIALOG_H -#define XUIFILEDIALOG_H +#pragma once #include <QString> #include <QStringList> @@ -57,5 +56,3 @@ signals: } // namespace Internal } // namespace QmlDesigner - -#endif // XUIFILEDIALOG_H diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryimageprovider.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryimageprovider.h index 613520d8d8..54b6424d71 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryimageprovider.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryimageprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ITEMLIBRARYIMAGEPROVIDER_H -#define ITEMLIBRARYIMAGEPROVIDER_H +#pragma once #include <QQuickImageProvider> @@ -43,5 +42,3 @@ public: } } - -#endif // ITEMLIBRARYIMAGEPROVIDER_H diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryitem.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryitem.h index f411ccbd0f..c5ac7d8d87 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryitem.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_ITEMLIBRARYITEMMODEL_H -#define QMLDESIGNER_ITEMLIBRARYITEMMODEL_H +#pragma once #include <QObject> #include <QString> @@ -66,5 +65,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_ITEMLIBRARYITEMMODEL_H diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.h index 78f5fa3e2e..bf1a211248 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ITEMLIBRARYMODEL_H -#define ITEMLIBRARYMODEL_H +#pragma once #include <QMap> #include <QIcon> @@ -96,5 +95,3 @@ private: // variables } // namespace QmlDesigner QML_DECLARE_TYPE(QmlDesigner::ItemLibraryModel) -#endif // ITEMLIBRARYMODEL_H - diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysection.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysection.h index 74e52d9785..d2a1d914b1 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysection.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysection.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_ITEMLIBRARYSECTION_H -#define QMLDESIGNER_ITEMLIBRARYSECTION_H +#pragma once #include "itemlibrarysectionmodel.h" @@ -68,5 +67,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_ITEMLIBRARYSECTION_H diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.h index dc5a11737d..6e5d9ebf4b 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_ITEMLIBRARYSECTIONMODEL_H -#define QMLDESIGNER_ITEMLIBRARYSECTIONMODEL_H +#pragma once #include "itemlibrarymodel.h" @@ -66,5 +65,3 @@ private: // variables } // namespace QmlDesigner QML_DECLARE_TYPE(QmlDesigner::ItemLibrarySectionModel) - -#endif // QMLDESIGNER_ITEMLIBRARYSECTIONMODEL_H diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarytreeview.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarytreeview.h index 2a79a69919..37faaeef68 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarytreeview.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarytreeview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ITEMLIBRARYCOMPONENTS_H -#define ITEMLIBRARYCOMPONENTS_H +#pragma once #include <QTreeView> #include <QStyledItemDelegate> @@ -61,6 +60,3 @@ private: }; } // namespace QmlDesigner - -#endif // ITEMLIBRARYCOMPONENTS_H - diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.h index f2d987cab9..6391d7bc4f 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ITEMLIBRARYVIEW_H -#define ITEMLIBRARYVIEW_H +#pragma once #include <abstractview.h> @@ -63,4 +62,3 @@ private: }; } -#endif // ITEMLIBRARYVIEW_H diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h index ecdf6aa171..3665d34a95 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ITEMLIBRARYWIDGET_H -#define ITEMLIBRARYWIDGET_H +#pragma once #include "itemlibraryinfo.h" #include "itemlibrarytreeview.h" @@ -138,6 +137,3 @@ private: }; } - -#endif // ITEMLIBRARYWIDGET_H - diff --git a/src/plugins/qmldesigner/components/itemlibrary/resourceitemdelegate.h b/src/plugins/qmldesigner/components/itemlibrary/resourceitemdelegate.h index 63aa7477fd..f90bb4f4be 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/resourceitemdelegate.h +++ b/src/plugins/qmldesigner/components/itemlibrary/resourceitemdelegate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_RESOURCEITEMDELEGATE_H -#define QMLDESIGNER_RESOURCEITEMDELEGATE_H +#pragma once #include <QStyledItemDelegate> #include <QFileSystemModel> @@ -50,5 +49,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_RESOURCEITEMDELEGATE_H diff --git a/src/plugins/qmldesigner/components/logger/logger.h b/src/plugins/qmldesigner/components/logger/logger.h index 3eae0fceb8..64002a8bde 100644 --- a/src/plugins/qmldesigner/components/logger/logger.h +++ b/src/plugins/qmldesigner/components/logger/logger.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QLOGGER_H -#define QLOGGER_H +#pragma once #include <QString> #include <QStringList> @@ -73,5 +72,3 @@ private: QTime *m_timer; }; - -#endif // QLOGGER_H diff --git a/src/plugins/qmldesigner/components/navigator/iconcheckboxitemdelegate.h b/src/plugins/qmldesigner/components/navigator/iconcheckboxitemdelegate.h index fa3ac6f89d..553a7f8c8e 100644 --- a/src/plugins/qmldesigner/components/navigator/iconcheckboxitemdelegate.h +++ b/src/plugins/qmldesigner/components/navigator/iconcheckboxitemdelegate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_ICONCHECKBOXITEMDELEGATE_H -#define QMLDESIGNER_ICONCHECKBOXITEMDELEGATE_H +#pragma once #include <QStyledItemDelegate> @@ -53,5 +52,3 @@ private: NavigatorTreeModel *m_navigatorTreeModel; }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_ICONCHECKBOXITEMDELEGATE_H diff --git a/src/plugins/qmldesigner/components/navigator/nameitemdelegate.h b/src/plugins/qmldesigner/components/navigator/nameitemdelegate.h index 3df50b986d..281a2ea8a4 100644 --- a/src/plugins/qmldesigner/components/navigator/nameitemdelegate.h +++ b/src/plugins/qmldesigner/components/navigator/nameitemdelegate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_NAMEITEMDELEGATE_H -#define QMLDESIGNER_NAMEITEMDELEGATE_H +#pragma once #include <QStyledItemDelegate> @@ -53,5 +52,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_NAMEITEMDELEGATE_H diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp index 1d291775ef..db3fb2183d 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp @@ -546,8 +546,8 @@ static void appendNodeToEndOfTheRow(const ModelNode &modelNode, const ItemRow &n if (modelNode.hasParentProperty()) { NodeAbstractProperty parentProperty(modelNode.parentProperty()); ItemRow parentRow = treeModel->itemRowForNode(parentProperty.parentModelNode()); - if (parentRow.propertyItems.contains(parentProperty.name())) { - QStandardItem *parentPropertyItem = parentRow.propertyItems.value(parentProperty.name()); + if (parentRow.propertyItems.contains(QString::fromUtf8(parentProperty.name()))) { + QStandardItem *parentPropertyItem = parentRow.propertyItems.value(QString::fromUtf8(parentProperty.name())); parentPropertyItem->appendRow(newItemRow.toList()); } else { QStandardItem *parentDefaultPropertyItem = parentRow.idItem; @@ -768,7 +768,7 @@ void NavigatorTreeModel::handleItemLibraryImageDrop(const QMimeData *mimeData, i bool foundTarget = computeTarget(rowModelIndex, this, &targetProperty, &targetRowNumber); if (foundTarget) { - QString imageFileName = QString::fromUtf8(mimeData->data("application/vnd.bauhaus.libraryresource")); + QString imageFileName = QString::fromUtf8(mimeData->data(QLatin1String("application/vnd.bauhaus.libraryresource"))); QmlItemNode newQmlItemNode = QmlItemNode::createQmlItemNodeFromImage(m_view, imageFileName, QPointF(), targetProperty); if (newQmlItemNode.isValid()) { diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.h b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.h index a2b4b33033..f879393e86 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.h +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NAVIGATORTREEMODEL_H -#define NAVIGATORTREEMODEL_H +#pragma once #include <modelnode.h> #include <nodemetainfo.h> @@ -147,5 +146,3 @@ private: }; } // namespace QmlDesigner - -#endif // NAVIGATORTREEMODEL_H diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreeview.h b/src/plugins/qmldesigner/components/navigator/navigatortreeview.h index 24f7df7b4b..f5d4caa5ed 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreeview.h +++ b/src/plugins/qmldesigner/components/navigator/navigatortreeview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NAVIGATORTREEVIEW_H -#define NAVIGATORTREEVIEW_H +#pragma once #include <QTreeView> @@ -38,5 +37,3 @@ public: static void drawSelectionBackground(QPainter *painter, const QStyleOption &option); }; } - -#endif // NAVIGATORTREEVIEW_H diff --git a/src/plugins/qmldesigner/components/navigator/navigatorview.h b/src/plugins/qmldesigner/components/navigator/navigatorview.h index 537f17ae74..bbef3ec1d0 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorview.h +++ b/src/plugins/qmldesigner/components/navigator/navigatorview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NAVIGATORVIEW_H -#define NAVIGATORVIEW_H +#pragma once #include <abstractview.h> @@ -99,4 +98,3 @@ private: }; } -#endif // NAVIGATORVIEW_H diff --git a/src/plugins/qmldesigner/components/navigator/navigatorwidget.h b/src/plugins/qmldesigner/components/navigator/navigatorwidget.h index 917151dda9..526004cf84 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorwidget.h +++ b/src/plugins/qmldesigner/components/navigator/navigatorwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NAVIGATORWIDGET_H -#define NAVIGATORWIDGET_H +#pragma once #include <QFrame> #include <QPointer> @@ -64,5 +63,3 @@ private: // variables }; } - -#endif // NAVIGATORWIDGET_H diff --git a/src/plugins/qmldesigner/components/pluginmanager/iplugin.h b/src/plugins/qmldesigner/components/pluginmanager/iplugin.h index 2ceaab67cb..609cee3f4b 100644 --- a/src/plugins/qmldesigner/components/pluginmanager/iplugin.h +++ b/src/plugins/qmldesigner/components/pluginmanager/iplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IPLUGIN_H -#define IPLUGIN_H +#pragma once #include <QObject> @@ -50,5 +49,3 @@ public: QT_BEGIN_NAMESPACE Q_DECLARE_INTERFACE(QmlDesigner::IPlugin, QMLDESIGNER_PLUGIN_INTERFACE) QT_END_NAMESPACE - -#endif // IPLUGIN_H diff --git a/src/plugins/qmldesigner/components/pluginmanager/pluginmanager.h b/src/plugins/qmldesigner/components/pluginmanager/pluginmanager.h index d971c2d710..819d216e4a 100644 --- a/src/plugins/qmldesigner/components/pluginmanager/pluginmanager.h +++ b/src/plugins/qmldesigner/components/pluginmanager/pluginmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINMANAGER_H -#define PLUGINMANAGER_H +#pragma once #include "pluginpath.h" @@ -72,4 +71,3 @@ private: // variables }; } // namespace QmlDesigner -#endif // PLUGINMANAGER_H diff --git a/src/plugins/qmldesigner/components/pluginmanager/pluginpath.h b/src/plugins/qmldesigner/components/pluginmanager/pluginpath.h index 7b526e5ca2..c1d7e81c22 100644 --- a/src/plugins/qmldesigner/components/pluginmanager/pluginpath.h +++ b/src/plugins/qmldesigner/components/pluginmanager/pluginpath.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGINPATH_H -#define PLUGINPATH_H +#pragma once #include <QObject> #include <QPointer> @@ -91,4 +90,3 @@ private: PluginDataList m_plugins; }; } // namespace QmlDesigner -#endif // PLUGINPATH_H diff --git a/src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.h b/src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.h index 12e8feb7f8..d520cab714 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.h +++ b/src/plugins/qmldesigner/components/propertyeditor/designerpropertymap.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNERPROPERTYMAP_H -#define DESIGNERPROPERTYMAP_H +#pragma once #include <QQmlPropertyMap> #include <QtQml> @@ -44,5 +43,3 @@ public: }; } //QmlDesigner - -#endif // DESIGNERPROPERTYMAP_H diff --git a/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.h b/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.h index 239cda43cc..37faaa9baf 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.h +++ b/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILERESOURCESMODEL_H -#define FILERESOURCESMODEL_H +#pragma once #include <qmlitemnode.h> @@ -83,5 +82,3 @@ private: }; QML_DECLARE_TYPE(FileResourcesModel) - -#endif // FILERESOURCESMODEL_H diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h index 9271cf17c3..56d8ce914d 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h +++ b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GRADIENTMODEL_H -#define GRADIENTMODEL_H +#pragma once #include <qmlitemnode.h> @@ -88,5 +87,3 @@ private: }; QML_DECLARE_TYPE(GradientModel) - -#endif // GRADIENTMODEL_H diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h index 1794926079..785145c09a 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYEDITORCONTEXTOBJECT_H -#define PROPERTYEDITORCONTEXTOBJECT_H +#pragma once #include <QObject> #include <QUrl> @@ -132,5 +131,3 @@ private: }; } //QmlDesigner { - -#endif // PROPERTYEDITORCONTEXTOBJECT_H diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index ec0da2a136..4f245c23f8 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -95,8 +95,8 @@ PropertyEditorQmlBackend::PropertyEditorQmlBackend(PropertyEditorView *propertyE ->settings().value(DesignerSettingsKey::SHOW_PROPERTYEDITOR_WARNINGS).toBool()); m_view->engine()->addImportPath(propertyEditorResourcesPath()); - m_dummyPropertyEditorValue->setValue("#000000"); - context()->setContextProperty("dummyBackendValue", m_dummyPropertyEditorValue.data()); + m_dummyPropertyEditorValue->setValue(QLatin1String("#000000")); + context()->setContextProperty(QLatin1String("dummyBackendValue"), m_dummyPropertyEditorValue.data()); m_contextObject->setBackendValues(&m_backendValuesPropertyMap); m_contextObject->insertInQmlContext(context()); @@ -111,7 +111,7 @@ void PropertyEditorQmlBackend::setupPropertyEditorValue(const PropertyName &name { QmlDesigner::PropertyName propertyName(name); propertyName.replace('.', '_'); - PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(backendValuesPropertyMap().value(propertyName))); + PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(backendValuesPropertyMap().value(QString::fromUtf8(propertyName)))); if (!valueObject) { valueObject = new PropertyEditorValue(&backendValuesPropertyMap()); QObject::connect(valueObject, &PropertyEditorValue::valueChanged, &backendValuesPropertyMap(), &DesignerPropertyMap::valueChanged); @@ -119,8 +119,8 @@ void PropertyEditorQmlBackend::setupPropertyEditorValue(const PropertyName &name backendValuesPropertyMap().insert(QString::fromUtf8(propertyName), QVariant::fromValue(valueObject)); } valueObject->setName(propertyName); - if (type == "QColor") - valueObject->setValue(QVariant("#000000")); + if (type == QLatin1String("QColor")) + valueObject->setValue(QVariant(QLatin1String("#000000"))); else valueObject->setValue(QVariant(1)); @@ -180,7 +180,7 @@ void PropertyEditorQmlBackend::createPropertyEditorValue(const QmlObjectNode &qm { PropertyName propertyName(name); propertyName.replace('.', '_'); - PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(backendValuesPropertyMap().value(propertyName))); + PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(backendValuesPropertyMap().value(QString::fromUtf8(propertyName)))); if (!valueObject) { valueObject = new PropertyEditorValue(&backendValuesPropertyMap()); QObject::connect(valueObject, &PropertyEditorValue::valueChanged, &backendValuesPropertyMap(), &DesignerPropertyMap::valueChanged); @@ -212,7 +212,7 @@ void PropertyEditorQmlBackend::setValue(const QmlObjectNode & qmlObjectNode, con { PropertyName propertyName = name; propertyName.replace('.', '_'); - PropertyEditorValue *propertyValue = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value(propertyName))); + PropertyEditorValue *propertyValue = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value(QString::fromUtf8(propertyName)))); if (propertyValue) { propertyValue->setValue(value); @@ -223,7 +223,6 @@ void PropertyEditorQmlBackend::setValue(const QmlObjectNode & qmlObjectNode, con } } - QQmlContext *PropertyEditorQmlBackend::context() { return m_view->rootContext(); } @@ -269,23 +268,23 @@ void PropertyEditorQmlBackend::setup(const QmlObjectNode &qmlObjectNode, const Q setupLayoutAttachedProperties(qmlObjectNode, propertyEditor); // className - PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value("className"))); + PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value(QLatin1String("className")))); if (!valueObject) valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap); valueObject->setName("className"); valueObject->setModelNode(qmlObjectNode.modelNode()); valueObject->setValue(qmlObjectNode.modelNode().simplifiedTypeName()); QObject::connect(valueObject, &PropertyEditorValue::valueChanged, &backendValuesPropertyMap(), &DesignerPropertyMap::valueChanged); - m_backendValuesPropertyMap.insert("className", QVariant::fromValue(valueObject)); + m_backendValuesPropertyMap.insert(QLatin1String("className"), QVariant::fromValue(valueObject)); // id - valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value("id"))); + valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value(QLatin1String("id")))); if (!valueObject) valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap); valueObject->setName("id"); valueObject->setValue(qmlObjectNode.id()); QObject::connect(valueObject, &PropertyEditorValue::valueChanged, &backendValuesPropertyMap(), &DesignerPropertyMap::valueChanged); - m_backendValuesPropertyMap.insert("id", QVariant::fromValue(valueObject)); + m_backendValuesPropertyMap.insert(QLatin1String("id"), QVariant::fromValue(valueObject)); QmlItemNode itemNode(qmlObjectNode.modelNode()); @@ -333,25 +332,25 @@ void PropertyEditorQmlBackend::initialSetup(const TypeName &typeName, const QUrl NodeMetaInfo metaInfo = propertyEditor->model()->metaInfo(typeName); foreach (const PropertyName &propertyName, metaInfo.propertyNames()) - setupPropertyEditorValue(propertyName, propertyEditor, metaInfo.propertyTypeName(propertyName)); + setupPropertyEditorValue(propertyName, propertyEditor, QString::fromUtf8(metaInfo.propertyTypeName(propertyName))); - PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value("className"))); + PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value(QLatin1String("className")))); if (!valueObject) valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap); valueObject->setName("className"); valueObject->setValue(typeName); QObject::connect(valueObject, &PropertyEditorValue::valueChanged, &backendValuesPropertyMap(), &DesignerPropertyMap::valueChanged); - m_backendValuesPropertyMap.insert("className", QVariant::fromValue(valueObject)); + m_backendValuesPropertyMap.insert(QLatin1String("className"), QVariant::fromValue(valueObject)); // id - valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value("id"))); + valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value(QLatin1String("id")))); if (!valueObject) valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap); valueObject->setName("id"); valueObject->setValue("id"); QObject::connect(valueObject, &PropertyEditorValue::valueChanged, &backendValuesPropertyMap(), &DesignerPropertyMap::valueChanged); - m_backendValuesPropertyMap.insert("id", QVariant::fromValue(valueObject)); + m_backendValuesPropertyMap.insert(QLatin1String("id"), QVariant::fromValue(valueObject)); context()->setContextProperty(QLatin1String("anchorBackend"), &m_backendAnchorBinding); context()->setContextProperty(QLatin1String("modelNodeBackend"), &m_backendModelNode); @@ -383,7 +382,7 @@ QString PropertyEditorQmlBackend::templateGeneration(NodeMetaInfo type, QString qmlTemplate = imports.join(QLatin1Char('\n')) + QLatin1Char('\n'); qmlTemplate += QStringLiteral("Section {\n"); - qmlTemplate += QStringLiteral("caption: \"%1\"\n").arg(QString::fromUtf8(objectNode.modelNode().simplifiedTypeName())); + qmlTemplate += QStringLiteral("caption: \"%1\"\n").arg(objectNode.modelNode().simplifiedTypeName()); qmlTemplate += QStringLiteral("SectionLayout {\n"); QList<PropertyName> orderedList = type.propertyNames(); @@ -399,18 +398,18 @@ QString PropertyEditorQmlBackend::templateGeneration(NodeMetaInfo type, properName.replace('.', '_'); - QString typeName = type.propertyTypeName(name); + TypeName typeName = type.propertyTypeName(name); //alias resolution only possible with instance - if (typeName == QStringLiteral("alias") && objectNode.isValid()) + if (typeName == "alias" && objectNode.isValid()) typeName = objectNode.instanceType(name); if (!superType.hasProperty(name) && type.propertyIsWritable(name) && !name.contains(".")) { foreach (const QmlJS::SimpleReaderNode::Ptr &node, templateConfiguration()->children()) - if (variantToStringList(node->property(QStringLiteral("typeNames"))).contains(typeName)) { + if (variantToStringList(node->property(QStringLiteral("typeNames"))).contains(QString::fromLatin1(typeName))) { const QString fileName = propertyTemplatesPath() + node->property(QStringLiteral("sourceFile")).toString(); QFile file(fileName); if (file.open(QIODevice::ReadOnly)) { - QString source = file.readAll(); + QString source = QString::fromUtf8(file.readAll()); file.close(); qmlTemplate += source.arg(QString::fromUtf8(name)).arg(QString::fromUtf8(properName)); emptyTemplate = false; @@ -429,22 +428,22 @@ QString PropertyEditorQmlBackend::templateGeneration(NodeMetaInfo type, return qmlTemplate; } -QUrl PropertyEditorQmlBackend::getQmlFileUrl(const QString &relativeTypeName, const NodeMetaInfo &info) +QUrl PropertyEditorQmlBackend::getQmlFileUrl(const TypeName &relativeTypeName, const NodeMetaInfo &info) { - return fileToUrl(locateQmlFile(info, fixTypeNameForPanes(relativeTypeName) + QStringLiteral(".qml"))); + return fileToUrl(locateQmlFile(info, QString::fromUtf8(fixTypeNameForPanes(relativeTypeName) + ".qml"))); } -QString PropertyEditorQmlBackend::fixTypeNameForPanes(const QString &typeName) +TypeName PropertyEditorQmlBackend::fixTypeNameForPanes(const TypeName &typeName) { - QString fixedTypeName = typeName; + TypeName fixedTypeName = typeName; fixedTypeName.replace('.', '/'); return fixedTypeName; } -QString PropertyEditorQmlBackend::qmlFileName(const NodeMetaInfo &nodeInfo) +TypeName PropertyEditorQmlBackend::qmlFileName(const NodeMetaInfo &nodeInfo) { - const QString fixedTypeName = fixTypeNameForPanes(nodeInfo.typeName()); - return fixedTypeName + QStringLiteral("Pane.qml"); + const TypeName fixedTypeName = fixTypeNameForPanes(nodeInfo.typeName()); + return fixedTypeName + "Pane.qml"; } QUrl PropertyEditorQmlBackend::fileToUrl(const QString &filePath) { @@ -453,8 +452,8 @@ QUrl PropertyEditorQmlBackend::fileToUrl(const QString &filePath) { if (filePath.isEmpty()) return fileUrl; - if (filePath.startsWith(QLatin1Char(':'))) { - fileUrl.setScheme("qrc"); + if (filePath.startsWith(':')) { + fileUrl.setScheme(QLatin1String("qrc")); QString path = filePath; path.remove(0, 1); // remove trailing ':' fileUrl.setPath(path); @@ -505,7 +504,7 @@ QUrl PropertyEditorQmlBackend::getQmlUrlForModelNode(const ModelNode &modelNode, hierarchy.append(modelNode.metaInfo().superClasses()); foreach (const NodeMetaInfo &info, hierarchy) { - QUrl fileUrl = fileToUrl(locateQmlFile(info, qmlFileName(info))); + QUrl fileUrl = fileToUrl(locateQmlFile(info, QString::fromUtf8(qmlFileName(info)))); if (fileUrl.isValid()) { className = info.typeName(); return fileUrl; diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h index 78707ffb45..af4ceefff4 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYEDITORQMLBACKEND_H -#define PROPERTYEDITORQMLBACKEND_H +#pragma once #include "qmlanchorbindingproxy.h" #include "designerpropertymap.h" @@ -70,7 +69,7 @@ public: static QString templateGeneration(NodeMetaInfo type, NodeMetaInfo superType, const QmlObjectNode &objectNode); - static QUrl getQmlFileUrl(const QString &relativeTypeName, const NodeMetaInfo &info = NodeMetaInfo()); + static QUrl getQmlFileUrl(const TypeName &relativeTypeName, const NodeMetaInfo &info = NodeMetaInfo()); static QUrl getQmlUrlForModelNode(const ModelNode &modelNode, TypeName &className); static bool checkIfUrlExists(const QUrl &url); @@ -88,11 +87,11 @@ private: PropertyEditorView *propertyEditor); void setupPropertyEditorValue(const PropertyName &name, PropertyEditorView *propertyEditor, const QString &type); - static QString qmlFileName(const NodeMetaInfo &nodeInfo); + static TypeName qmlFileName(const NodeMetaInfo &nodeInfo); static QUrl fileToUrl(const QString &filePath); static QString fileFromUrl(const QUrl &url); static QString locateQmlFile(const NodeMetaInfo &info, const QString &relativePath); - static QString fixTypeNameForPanes(const QString &typeName); + static TypeName fixTypeNameForPanes(const TypeName &typeName); private: Quick2PropertyEditorView *m_view; @@ -105,5 +104,3 @@ private: }; } //QmlDesigner - -#endif //PROPERTYEDITORQMLBACKEND_H diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditortransaction.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditortransaction.h index 0854fe8fba..9a1ddca9bd 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditortransaction.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditortransaction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYEDITORTRANSACTION_H -#define PROPERTYEDITORTRANSACTION_H +#pragma once #include "propertyeditorview.h" @@ -49,5 +48,3 @@ private: }; } //QmlDesigner - -#endif // PROPERTYEDITORTRANSACTION_H diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp index 7d2f60162b..9eec21692d 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp @@ -139,7 +139,7 @@ void PropertyEditorValue::setValueWithEmit(const QVariant &value) setValue(newValue); m_isBound = false; - emit valueChanged(name(), value); + emit valueChanged(nameAsQString(), value); emit valueChangedQml(); emit isBoundChanged(); } @@ -174,7 +174,7 @@ void PropertyEditorValue::setExpressionWithEmit(const QString &expression) { if ( m_expression != expression) { setExpression(expression); - emit expressionChanged(name()); + emit expressionChanged(nameAsQString()); } } @@ -213,6 +213,11 @@ QmlDesigner::PropertyName PropertyEditorValue::name() const return m_name; } +QString PropertyEditorValue::nameAsQString() const +{ + return QString::fromUtf8(m_name); +} + void PropertyEditorValue::setName(const QmlDesigner::PropertyName &name) { m_name = name; @@ -273,7 +278,7 @@ void PropertyEditorValue::resetValue() if (m_value.isValid() || isBound()) { m_value = QVariant(); m_isBound = false; - emit valueChanged(name(), QVariant()); + emit valueChanged(nameAsQString(), QVariant()); } } @@ -314,7 +319,7 @@ QString PropertyEditorNodeWrapper::type() if (!(m_modelNode.isValid())) return QString(); - return QString::fromUtf8(m_modelNode.simplifiedTypeName()); + return m_modelNode.simplifiedTypeName(); } @@ -380,7 +385,7 @@ void PropertyEditorNodeWrapper::changeValue(const QString &propertyName) if (m_modelNode.isValid()) { QmlDesigner::QmlObjectNode qmlObjectNode(m_modelNode); - PropertyEditorValue *valueObject = qvariant_cast<PropertyEditorValue *>(m_valuesPropertyMap.value(name)); + PropertyEditorValue *valueObject = qvariant_cast<PropertyEditorValue *>(m_valuesPropertyMap.value(QString::fromLatin1(name))); if (valueObject->value().isValid()) qmlObjectNode.setVariantProperty(name, valueObject->value()); @@ -406,7 +411,7 @@ void PropertyEditorNodeWrapper::setup() valueObject->setName(propertyName); valueObject->setValue(qmlObjectNode.instanceValue(propertyName)); connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &m_valuesPropertyMap, SIGNAL(valueChanged(QString,QVariant))); - m_valuesPropertyMap.insert(propertyName, QVariant::fromValue(valueObject)); + m_valuesPropertyMap.insert(QString::fromUtf8(propertyName), QVariant::fromValue(valueObject)); } } } diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h index 6055455f85..26991db90d 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYEDITORVALUE_H -#define PROPERTYEDITORVALUE_H +#pragma once #include <qmldesignercorelib_global.h> @@ -84,7 +83,7 @@ class PropertyEditorValue : public QObject Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged FINAL) Q_PROPERTY(bool isTranslated READ isTranslated NOTIFY expressionChanged FINAL) - Q_PROPERTY(QString name READ name FINAL) + Q_PROPERTY(QString name READ nameAsQString FINAL) Q_PROPERTY(PropertyEditorNodeWrapper* complexNode READ complexNode NOTIFY complexNodeChanged FINAL) public: @@ -114,6 +113,7 @@ public: bool isTranslated() const; QmlDesigner::PropertyName name() const; + QString nameAsQString() const; void setName(const QmlDesigner::PropertyName &name); QmlDesigner::ModelNode modelNode() const; @@ -154,6 +154,3 @@ private: //variables QML_DECLARE_TYPE(PropertyEditorValue) QML_DECLARE_TYPE(PropertyEditorNodeWrapper) QML_DECLARE_TYPE(QQmlPropertyMap) - - -#endif // PROPERTYEDITORVALUE_H diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp index e09d0150c6..109f5807ab 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp @@ -102,7 +102,7 @@ void PropertyEditorView::setupPane(const TypeName &typeName) { NodeMetaInfo metaInfo = model()->metaInfo(typeName); - QUrl qmlFile = PropertyEditorQmlBackend::getQmlFileUrl(QStringLiteral("Qt/ItemPane"), metaInfo); + QUrl qmlFile = PropertyEditorQmlBackend::getQmlFileUrl("Qt/ItemPane", metaInfo); QUrl qmlSpecificsFile; qmlSpecificsFile = PropertyEditorQmlBackend::getQmlFileUrl(typeName + "Specifics", metaInfo); @@ -144,7 +144,7 @@ void PropertyEditorView::changeValue(const QString &name) return; if (propertyName == "id") { - PropertyEditorValue *value = m_qmlBackEndForCurrentType->propertyValueForName(propertyName); + PropertyEditorValue *value = m_qmlBackEndForCurrentType->propertyValueForName(QString::fromUtf8(propertyName)); const QString newId = value->value().toString(); if (newId == m_selectedNode.id()) @@ -166,7 +166,7 @@ void PropertyEditorView::changeValue(const QString &name) PropertyName underscoreName(propertyName); underscoreName.replace('.', '_'); - PropertyEditorValue *value = m_qmlBackEndForCurrentType->propertyValueForName(underscoreName); + PropertyEditorValue *value = m_qmlBackEndForCurrentType->propertyValueForName(QString::fromLatin1(underscoreName)); if (value ==0) return; @@ -242,7 +242,7 @@ void PropertyEditorView::changeExpression(const QString &propertyName) underscoreName.replace('.', '_'); QmlObjectNode qmlObjectNode(m_selectedNode); - PropertyEditorValue *value = m_qmlBackEndForCurrentType->propertyValueForName(underscoreName); + PropertyEditorValue *value = m_qmlBackEndForCurrentType->propertyValueForName(QString::fromLatin1(underscoreName)); if (!value) { qWarning() << "PropertyEditor::changeExpression no value for " << underscoreName; @@ -257,8 +257,9 @@ void PropertyEditorView::changeExpression(const QString &propertyName) return; } } else if (qmlObjectNode.modelNode().metaInfo().propertyTypeName(name) == "bool") { - if (value->expression().compare("false", Qt::CaseInsensitive) == 0 || value->expression().compare("true", Qt::CaseInsensitive) == 0) { - if (value->expression().compare("true", Qt::CaseInsensitive) == 0) + if (value->expression().compare(QLatin1String("false"), Qt::CaseInsensitive) == 0 + || value->expression().compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) { + if (value->expression().compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) qmlObjectNode.setVariantProperty(name, true); else qmlObjectNode.setVariantProperty(name, false); @@ -376,7 +377,7 @@ void PropertyEditorView::setupQmlBackend() foreach (const NodeMetaInfo &metaInfo, hierarchy) { if (PropertyEditorQmlBackend::checkIfUrlExists(qmlSpecificsFile)) break; - qmlSpecificsFile = PropertyEditorQmlBackend::getQmlFileUrl(metaInfo.typeName() + QStringLiteral("Specifics"), metaInfo); + qmlSpecificsFile = PropertyEditorQmlBackend::getQmlFileUrl(metaInfo.typeName() + "Specifics", metaInfo); diffClassName = metaInfo.typeName(); } } diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.h index f09340170d..ac3bb9e7d0 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYEDITORVIEW_H -#define PROPERTYEDITORVIEW_H +#pragma once #include <abstractview.h> #include <QHash> @@ -118,5 +117,3 @@ private: //variables }; } //QmlDesigner - -#endif // PROPERTYEDITORVIEW_H diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorwidget.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorwidget.h index 4ca0b91f17..445a454f5d 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorwidget.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYEDITORWIDGET_H -#define PROPERTYEDITORWIDGET_H +#pragma once #include <QStackedWidget> @@ -46,5 +45,3 @@ protected: }; } //QmlDesigner - -#endif //PROPERTYEDITORWIDGET_H diff --git a/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.h b/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.h index 0f768d6ed0..e73c55629f 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.h +++ b/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.h @@ -251,4 +251,3 @@ private: #endif //QmlAnchorBindingProxy - diff --git a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h index 511fb99dbb..f60e4ce024 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h +++ b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLMODELNODEPROXY_H -#define QMLMODELNODEPROXY_H +#pragma once #include <qmlitemnode.h> @@ -64,5 +63,3 @@ private: }; } //QmlDesigner - -#endif // QMLMODELNODEPROXY_H diff --git a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h index f3f354eb85..0394c72ec3 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h +++ b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QUICK2PROERTYEDITORVIEW_H -#define QUICK2PROERTYEDITORVIEW_H +#pragma once #include <QQuickWidget> @@ -42,5 +41,3 @@ public: }; } //QmlDesigner - -#endif // QUICK2PROERTYEDITORVIEW_H diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorimageprovider.h b/src/plugins/qmldesigner/components/stateseditor/stateseditorimageprovider.h index 36e630ece0..9576152009 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorimageprovider.h +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorimageprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STATESEDITORIMAGEPROVIDER_H -#define STATESEDITORIMAGEPROVIDER_H +#pragma once #include"abstractview.h" @@ -51,6 +50,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // STATESEDITORIMAGEPROVIDER_H - diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h index 4bdc1127b5..0dbc8c0925 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STATESEDITORMODEL_H -#define STATESEDITORMODEL_H +#pragma once #include <QAbstractListModel> #include <QPointer> @@ -72,5 +71,3 @@ private: }; } // namespace QmlDesigner - -#endif // STATESEDITORMODEL_H diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h index c74b92fe33..c7215874b6 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STATESEDITORVIEW_H -#define STATESEDITORVIEW_H +#pragma once #include <abstractview.h> @@ -97,5 +96,3 @@ private: }; } // namespace QmlDesigner - -#endif // STATESEDITORVIEW_H diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h index 3af714c182..e82e48fa1f 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STATESEDITORWIDGET_H -#define STATESEDITORWIDGET_H +#pragma once #include <QQuickWidget> #include <QPointer> @@ -70,5 +69,3 @@ private: }; } - -#endif // STATESEDITORWIDGET_H diff --git a/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.h b/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.h index 3429dc1fb4..66b8a19b82 100644 --- a/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.h +++ b/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_TABVIEWDESIGNERACTION_H -#define QMLDESIGNER_TABVIEWDESIGNERACTION_H +#pragma once #include "abstractaction.h" @@ -50,5 +49,3 @@ private slots: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_TABVIEWDESIGNERACTION_H diff --git a/src/plugins/qmldesigner/componentsplugin/addtabtotabviewdialog.h b/src/plugins/qmldesigner/componentsplugin/addtabtotabviewdialog.h index 389e28c611..8128985d64 100644 --- a/src/plugins/qmldesigner/componentsplugin/addtabtotabviewdialog.h +++ b/src/plugins/qmldesigner/componentsplugin/addtabtotabviewdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDTABTOTABVIEWDIALOG_H -#define ADDTABTOTABVIEWDIALOG_H +#pragma once #include <QDialog> @@ -46,5 +45,3 @@ private: }; } // namespace QmlDesigner - -#endif // ADDTABTOTABVIEWDIALOG_H diff --git a/src/plugins/qmldesigner/componentsplugin/componentsplugin.h b/src/plugins/qmldesigner/componentsplugin/componentsplugin.h index d714fc8b77..1f43ada810 100644 --- a/src/plugins/qmldesigner/componentsplugin/componentsplugin.h +++ b/src/plugins/qmldesigner/componentsplugin/componentsplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPONENTSPLUGIN_H -#define COMPONENTSPLUGIN_H +#pragma once #include <iwidgetplugin.h> @@ -51,6 +50,3 @@ public: }; } // namespace QmlDesigner - - -#endif //COMPONENTSPLUGIN_H diff --git a/src/plugins/qmldesigner/componentsplugin/entertabdesigneraction.h b/src/plugins/qmldesigner/componentsplugin/entertabdesigneraction.h index 5207aa652b..862790da00 100644 --- a/src/plugins/qmldesigner/componentsplugin/entertabdesigneraction.h +++ b/src/plugins/qmldesigner/componentsplugin/entertabdesigneraction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ENTERTABDESIGNERACTION_H -#define ENTERTABDESIGNERACTION_H +#pragma once #include <abstractactiongroup.h> @@ -53,5 +52,3 @@ private: }; } // namespace QmlDesigner - -#endif // ENTERTABDESIGNERACTION_H diff --git a/src/plugins/qmldesigner/componentsplugin/tabviewindexmodel.h b/src/plugins/qmldesigner/componentsplugin/tabviewindexmodel.h index 2105fe0e5b..e10f46a085 100644 --- a/src/plugins/qmldesigner/componentsplugin/tabviewindexmodel.h +++ b/src/plugins/qmldesigner/componentsplugin/tabviewindexmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TABVIEWINDEXMODEL_H -#define TABVIEWINDEXMODEL_H +#pragma once #include <qmlitemnode.h> @@ -59,5 +58,3 @@ private: }; QML_DECLARE_TYPE(TabViewIndexModel) - -#endif // TABVIEWINDEXMODEL_H diff --git a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp index 59975648c1..46fd19d432 100644 --- a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp +++ b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp @@ -110,7 +110,7 @@ Exception::Exception(int line, for (int i = 0; i < nSize; i++) { - m_backTrace.append(QString("%1\n").arg(symbols[i])); + m_backTrace.append(QString("%1\n").arg(QLatin1String(symbols[i]))); } free(symbols); diff --git a/src/plugins/qmldesigner/designercore/filemanager/addarraymembervisitor.h b/src/plugins/qmldesigner/designercore/filemanager/addarraymembervisitor.h index e178a06ebb..d414e24664 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/addarraymembervisitor.h +++ b/src/plugins/qmldesigner/designercore/filemanager/addarraymembervisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDARRAYMEMBERVISITOR_H -#define ADDARRAYMEMBERVISITOR_H +#pragma once #include "qmlrewriter.h" @@ -64,5 +63,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // ADDARRAYMEMBERVISITOR_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/addobjectvisitor.h b/src/plugins/qmldesigner/designercore/filemanager/addobjectvisitor.h index ae62bdaa90..2b869cbc50 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/addobjectvisitor.h +++ b/src/plugins/qmldesigner/designercore/filemanager/addobjectvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDOBJECTVISITOR_H -#define ADDOBJECTVISITOR_H +#pragma once #include "qmlrewriter.h" @@ -54,5 +53,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // ADDOBJECTVISITOR_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp b/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp index 7e51ae24ba..7628c6b828 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp +++ b/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp @@ -156,7 +156,7 @@ void AddPropertyVisitor::addInMembers(QmlJS::AST::UiObjectInitializer *initializ newPropertyTemplate.prepend(QLatin1Char('\n')); } - const QString newPropertyText = addIndentation(newPropertyTemplate.arg(m_name, m_value), depth); + const QString newPropertyText = addIndentation(newPropertyTemplate.arg(QString::fromLatin1(m_name), m_value), depth); replace(endOfPreviousMember.end(), 0, newPropertyText); setDidRewriting(true); diff --git a/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.h b/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.h index ea8a4dd4b0..9da136d82c 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.h +++ b/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDPROPERTYVISITOR_H -#define ADDPROPERTYVISITOR_H +#pragma once #include "qmlrefactoring.h" #include "qmlrewriter.h" @@ -62,5 +61,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // ADDPROPERTYVISITOR_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/astobjecttextextractor.h b/src/plugins/qmldesigner/designercore/filemanager/astobjecttextextractor.h index ee4a2b1bf3..a1dfb7b71a 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/astobjecttextextractor.h +++ b/src/plugins/qmldesigner/designercore/filemanager/astobjecttextextractor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ASTOBJECTTEXTEXTRACTOR_H -#define ASTOBJECTTEXTEXTRACTOR_H +#pragma once #include <qmljs/parser/qmljsastvisitor_p.h> #include <qmljs/qmljsdocument.h> @@ -51,5 +50,3 @@ private: }; } // namespace QmlDesigner - -#endif // ASTOBJECTTEXTEXTRACTOR_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/changeimportsvisitor.h b/src/plugins/qmldesigner/designercore/filemanager/changeimportsvisitor.h index 2fe05cd088..f498d06aaa 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/changeimportsvisitor.h +++ b/src/plugins/qmldesigner/designercore/filemanager/changeimportsvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHANGEIMPORTSVISITOR_H -#define CHANGEIMPORTSVISITOR_H +#pragma once #include "import.h" #include "qmlrewriter.h" @@ -48,5 +47,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // CHANGEIMPORTSVISITOR_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/changeobjecttypevisitor.h b/src/plugins/qmldesigner/designercore/filemanager/changeobjecttypevisitor.h index 0f2822a8a2..474f83b944 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/changeobjecttypevisitor.h +++ b/src/plugins/qmldesigner/designercore/filemanager/changeobjecttypevisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHANGEOBJECTTYPEVISITOR_H -#define CHANGEOBJECTTYPEVISITOR_H +#pragma once #include "qmlrewriter.h" @@ -52,5 +51,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // CHANGEOBJECTTYPEVISITOR_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/changepropertyvisitor.h b/src/plugins/qmldesigner/designercore/filemanager/changepropertyvisitor.h index 6b0eeca86a..f97eea0a37 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/changepropertyvisitor.h +++ b/src/plugins/qmldesigner/designercore/filemanager/changepropertyvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CHANGEPROPERTYVISITOR_H -#define CHANGEPROPERTYVISITOR_H +#pragma once #include "qmlrefactoring.h" #include "qmlrewriter.h" @@ -64,5 +63,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // CHANGEPROPERTYVISITOR_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/firstdefinitionfinder.h b/src/plugins/qmldesigner/designercore/filemanager/firstdefinitionfinder.h index 7bc48559b2..9aca188a60 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/firstdefinitionfinder.h +++ b/src/plugins/qmldesigner/designercore/filemanager/firstdefinitionfinder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FIRSTDEFINITIONFINDER_H -#define FIRSTDEFINITIONFINDER_H +#pragma once #include <qmljs/parser/qmljsastvisitor_p.h> #include <qmljs/qmljsdocument.h> @@ -54,5 +53,3 @@ private: }; } // namespace QmlDesigner - -#endif // FIRSTDEFINITIONFINDER_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/moveobjectbeforeobjectvisitor.h b/src/plugins/qmldesigner/designercore/filemanager/moveobjectbeforeobjectvisitor.h index 6afd688e46..909c77ef70 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/moveobjectbeforeobjectvisitor.h +++ b/src/plugins/qmldesigner/designercore/filemanager/moveobjectbeforeobjectvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MOVEOBJECTBEFOREOBJECTVISITOR_H -#define MOVEOBJECTBEFOREOBJECTVISITOR_H +#pragma once #include "qmlrewriter.h" @@ -75,5 +74,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // MOVEOBJECTBEFOREOBJECTVISITOR_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/moveobjectvisitor.cpp b/src/plugins/qmldesigner/designercore/filemanager/moveobjectvisitor.cpp index d8b5fc440c..b0fe35fc90 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/moveobjectvisitor.cpp +++ b/src/plugins/qmldesigner/designercore/filemanager/moveobjectvisitor.cpp @@ -101,7 +101,7 @@ private: UiObjectMember *member = iter->member; if (UiArrayBinding *arrayBinding = cast<UiArrayBinding*>(member)) { - if (toString(arrayBinding->qualifiedId) == targetPropertyName) { + if (toString(arrayBinding->qualifiedId) == QString::fromUtf8(targetPropertyName)) { appendToArray(arrayBinding); setDidRewriting(true); @@ -112,7 +112,7 @@ private: { // insert (create) a UiObjectBinding: UiObjectMemberList *insertAfter = searchMemberToInsertAfter(ast->members, targetPropertyName, propertyOrder); - moveInfo.prefixToInsert = QStringLiteral("\n") + targetPropertyName + (targetIsArrayBinding ? QStringLiteral(": [") : QStringLiteral(": ")); + moveInfo.prefixToInsert = QStringLiteral("\n") + QString::fromUtf8(targetPropertyName) + (targetIsArrayBinding ? QStringLiteral(": [") : QStringLiteral(": ")); moveInfo.suffixToInsert = targetIsArrayBinding ? QStringLiteral("\n]") : QStringLiteral(""); if (insertAfter && insertAfter->member) diff --git a/src/plugins/qmldesigner/designercore/filemanager/moveobjectvisitor.h b/src/plugins/qmldesigner/designercore/filemanager/moveobjectvisitor.h index 7b499f42ca..cc6d44825d 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/moveobjectvisitor.h +++ b/src/plugins/qmldesigner/designercore/filemanager/moveobjectvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MOVEOBJECTVISITOR_H -#define MOVEOBJECTVISITOR_H +#pragma once #include "qmlrewriter.h" @@ -64,5 +63,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // MOVEOBJECTVISITOR_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/objectlengthcalculator.h b/src/plugins/qmldesigner/designercore/filemanager/objectlengthcalculator.h index e771ef3bf4..e869bb98b4 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/objectlengthcalculator.h +++ b/src/plugins/qmldesigner/designercore/filemanager/objectlengthcalculator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OBJECTLENGTHCALCULATOR_H -#define OBJECTLENGTHCALCULATOR_H +#pragma once #include <qmljs/parser/qmljsastvisitor_p.h> #include <qmljs/qmljsdocument.h> @@ -51,5 +50,3 @@ private: }; } // namespace QmlDesigner - -#endif // OBJECTLENGTHCALCULATOR_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.cpp b/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.cpp index e5bbc0b61e..f4e53d31d6 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.cpp +++ b/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.cpp @@ -85,7 +85,7 @@ bool QmlRefactoring::addToArrayMemberList(int parentLocation, const PropertyName if (parentLocation < 0) return false; - AddArrayMemberVisitor visit(*textModifier, (quint32) parentLocation, propertyName, content); + AddArrayMemberVisitor visit(*textModifier, (quint32) parentLocation, QString::fromUtf8(propertyName), content); visit.setConvertObjectBindingIntoArrayBinding(true); return visit(qmlDocument->qmlProgram()); } @@ -117,7 +117,11 @@ bool QmlRefactoring::changeProperty(int parentLocation, const PropertyName &name if (parentLocation < 0) return false; - ChangePropertyVisitor visit(*textModifier, (quint32) parentLocation, name, value, propertyType); + ChangePropertyVisitor visit(*textModifier, + (quint32) parentLocation, + QString::fromUtf8(name), + value, + propertyType); return visit(qmlDocument->qmlProgram()); } @@ -168,6 +172,6 @@ bool QmlRefactoring::removeProperty(int parentLocation, const PropertyName &name if (parentLocation < 0 || name.isEmpty()) return false; - RemovePropertyVisitor visit(*textModifier, (quint32) parentLocation, name); + RemovePropertyVisitor visit(*textModifier, (quint32) parentLocation, QString::fromUtf8(name)); return visit(qmlDocument->qmlProgram()); } diff --git a/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.h b/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.h index 4617569cef..d51ca90379 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.h +++ b/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLREFACTORING_H -#define QMLREFACTORING_H +#pragma once #include <import.h> #include <textmodifier.h> @@ -75,5 +74,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLREFACTORING_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/qmlrewriter.cpp b/src/plugins/qmldesigner/designercore/filemanager/qmlrewriter.cpp index b3b214cce2..354a384bd5 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/qmlrewriter.cpp +++ b/src/plugins/qmldesigner/designercore/filemanager/qmlrewriter.cpp @@ -319,7 +319,7 @@ QmlJS::AST::UiObjectMemberList *QMLRewriter::searchMemberToInsertAfter(QmlJS::AS idx = propertyOrder.size() - 1; for (; idx > 0; --idx) { - const QString prop = propertyOrder.at(idx - 1); + const QString prop = QString::fromLatin1(propertyOrder.at(idx - 1)); QmlJS::AST::UiObjectMemberList *candidate = orderedMembers.value(prop, 0); if (candidate != 0) return candidate; diff --git a/src/plugins/qmldesigner/designercore/filemanager/qmlrewriter.h b/src/plugins/qmldesigner/designercore/filemanager/qmlrewriter.h index 62380d2dc0..af54ba8c13 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/qmlrewriter.h +++ b/src/plugins/qmldesigner/designercore/filemanager/qmlrewriter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLREWRITER_H -#define QMLREWRITER_H +#pragma once #include "textmodifier.h" @@ -92,5 +91,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // QMLREWRITER_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/qmlwarningdialog.h b/src/plugins/qmldesigner/designercore/filemanager/qmlwarningdialog.h index 143d40ed77..178c32ca5f 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/qmlwarningdialog.h +++ b/src/plugins/qmldesigner/designercore/filemanager/qmlwarningdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLWARNINGDIALOG_H -#define QMLWARNINGDIALOG_H +#pragma once #include <QDialog> @@ -58,5 +57,3 @@ private: } //Internal } //QmlDesigner - -#endif // QMLWARNINGDIALOG_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/removepropertyvisitor.h b/src/plugins/qmldesigner/designercore/filemanager/removepropertyvisitor.h index 7419d81192..7eb8b53fd9 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/removepropertyvisitor.h +++ b/src/plugins/qmldesigner/designercore/filemanager/removepropertyvisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOVEPROPERTYVISITOR_H -#define REMOVEPROPERTYVISITOR_H +#pragma once #include <QString> @@ -58,5 +57,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // REMOVEPROPERTYVISITOR_H diff --git a/src/plugins/qmldesigner/designercore/filemanager/removeuiobjectmembervisitor.h b/src/plugins/qmldesigner/designercore/filemanager/removeuiobjectmembervisitor.h index 0d4d1ee785..6fc4d1d0b3 100644 --- a/src/plugins/qmldesigner/designercore/filemanager/removeuiobjectmembervisitor.h +++ b/src/plugins/qmldesigner/designercore/filemanager/removeuiobjectmembervisitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOVEUIOBJECTMEMBERVISITOR_H -#define REMOVEUIOBJECTMEMBERVISITOR_H +#pragma once #include <QStack> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // REMOVEUIOBJECTMEMBERVISITOR_H diff --git a/src/plugins/qmldesigner/designercore/include/abstractproperty.h b/src/plugins/qmldesigner/designercore/include/abstractproperty.h index 0c7c23e4fa..ebd286f646 100644 --- a/src/plugins/qmldesigner/designercore/include/abstractproperty.h +++ b/src/plugins/qmldesigner/designercore/include/abstractproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ABSTRACTPROPERTY_H -#define ABSTRACTPROPERTY_H +#pragma once #include <QPointer> #include <QSharedPointer> @@ -122,5 +121,3 @@ QMLDESIGNERCORE_EXPORT uint qHash(const AbstractProperty& property); QMLDESIGNERCORE_EXPORT QTextStream& operator<<(QTextStream &stream, const AbstractProperty &property); QMLDESIGNERCORE_EXPORT QDebug operator<<(QDebug debug, const AbstractProperty &AbstractProperty); } - -#endif //ABSTRACTPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/include/abstractview.h b/src/plugins/qmldesigner/designercore/include/abstractview.h index 0807df0496..aae79fc9ef 100644 --- a/src/plugins/qmldesigner/designercore/include/abstractview.h +++ b/src/plugins/qmldesigner/designercore/include/abstractview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ABSTRACTVIEW_H -#define ABSTRACTVIEW_H +#pragma once #include <qmldesignercorelib_global.h> @@ -269,5 +268,3 @@ QMLDESIGNERCORE_EXPORT QList<Internal::InternalNodePointer> toInternalNodeList(c QMLDESIGNERCORE_EXPORT QList<ModelNode> toModelNodeList(const QList<Internal::InternalNodePointer> &nodeList, AbstractView *view); } - -#endif // ABSTRACTVIEW_H diff --git a/src/plugins/qmldesigner/designercore/include/anchorline.h b/src/plugins/qmldesigner/designercore/include/anchorline.h index 0987611feb..98b6951f77 100644 --- a/src/plugins/qmldesigner/designercore/include/anchorline.h +++ b/src/plugins/qmldesigner/designercore/include/anchorline.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_ANCHORLINE_H -#define QMLDESIGNER_ANCHORLINE_H +#pragma once #include <qmldesignercorelib_global.h> @@ -51,5 +50,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_ANCHORLINE_H diff --git a/src/plugins/qmldesigner/designercore/include/basetexteditmodifier.h b/src/plugins/qmldesigner/designercore/include/basetexteditmodifier.h index 5e31b4e343..58c1950ebd 100644 --- a/src/plugins/qmldesigner/designercore/include/basetexteditmodifier.h +++ b/src/plugins/qmldesigner/designercore/include/basetexteditmodifier.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASETEXTEDITMODIFIER_H -#define BASETEXTEDITMODIFIER_H +#pragma once #include "qmldesignercorelib_global.h" #include "plaintexteditmodifier.h" @@ -50,5 +49,3 @@ public: }; } // namespace QmlDesigner - -#endif // BASETEXTEDITMODIFIER_H diff --git a/src/plugins/qmldesigner/designercore/include/bindingproperty.h b/src/plugins/qmldesigner/designercore/include/bindingproperty.h index 2dbc2d2197..3c4c6f69c5 100644 --- a/src/plugins/qmldesigner/designercore/include/bindingproperty.h +++ b/src/plugins/qmldesigner/designercore/include/bindingproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BINDINGPROPERTY_H -#define BINDINGPROPERTY_H +#pragma once #include "qmldesignercorelib_global.h" #include "abstractproperty.h" @@ -58,5 +57,3 @@ protected: }; } // namespace QmlDesigner - -#endif // BINDINGPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/include/bytearraymodifier.h b/src/plugins/qmldesigner/designercore/include/bytearraymodifier.h index 45390bd2ab..5552f23ae6 100644 --- a/src/plugins/qmldesigner/designercore/include/bytearraymodifier.h +++ b/src/plugins/qmldesigner/designercore/include/bytearraymodifier.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BYTEARRAYMODIFIER_H -#define BYTEARRAYMODIFIER_H +#pragma once #include <QPlainTextEdit> @@ -50,5 +49,3 @@ private: }; } - -#endif // BYTEARRAYMODIFIER_H diff --git a/src/plugins/qmldesigner/designercore/include/componenttextmodifier.h b/src/plugins/qmldesigner/designercore/include/componenttextmodifier.h index a8dfa6ba82..94b268ada5 100644 --- a/src/plugins/qmldesigner/designercore/include/componenttextmodifier.h +++ b/src/plugins/qmldesigner/designercore/include/componenttextmodifier.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPONENTTEXTMODIFIER_H -#define COMPONENTTEXTMODIFIER_H +#pragma once #include "textmodifier.h" @@ -68,5 +67,3 @@ private: }; } // namespace QmlDesigner - -#endif // COMPONENTTEXTMODIFIER_H diff --git a/src/plugins/qmldesigner/designercore/include/customnotifications.h b/src/plugins/qmldesigner/designercore/include/customnotifications.h index 90c5a7c8ef..58cc433e7f 100644 --- a/src/plugins/qmldesigner/designercore/include/customnotifications.h +++ b/src/plugins/qmldesigner/designercore/include/customnotifications.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMNOTIFICATIONS_H -#define CUSTOMNOTIFICATIONS_H +#pragma once #include <QString> @@ -34,5 +33,3 @@ const QString StartRewriterAmend = QStringLiteral("__start rewriter amend__"); const QString EndRewriterAmend = QStringLiteral("__end rewriter amend__"); } - -#endif //CUSTOMNOTIFICATIONS_H diff --git a/src/plugins/qmldesigner/designercore/include/exception.h b/src/plugins/qmldesigner/designercore/include/exception.h index 31514fc887..ea9a5ac876 100644 --- a/src/plugins/qmldesigner/designercore/include/exception.h +++ b/src/plugins/qmldesigner/designercore/include/exception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXCEPTION_H -#define EXCEPTION_H +#pragma once #include <qmldesignercorelib_global.h> @@ -67,6 +66,3 @@ private: QMLDESIGNERCORE_EXPORT QDebug operator<<(QDebug debug, const Exception &exception); } - - -#endif // EXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/forwardview.h b/src/plugins/qmldesigner/designercore/include/forwardview.h index 5c94ae22d1..b34cd107e9 100644 --- a/src/plugins/qmldesigner/designercore/include/forwardview.h +++ b/src/plugins/qmldesigner/designercore/include/forwardview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORWARDVIEW_H -#define FORWARDVIEW_H +#pragma once #include <abstractview.h> @@ -286,5 +285,3 @@ ViewType *ForwardView<ViewType>::firstView() const } // namespace QmlDesigner - -#endif // FORWARDVIEW_H diff --git a/src/plugins/qmldesigner/designercore/include/import.h b/src/plugins/qmldesigner/designercore/include/import.h index 6cd6a801ee..573e682c0b 100644 --- a/src/plugins/qmldesigner/designercore/include/import.h +++ b/src/plugins/qmldesigner/designercore/include/import.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IMPORT_H -#define IMPORT_H +#pragma once #include <QString> #include <QStringList> @@ -77,5 +76,3 @@ QMLDESIGNERCORE_EXPORT uint qHash(const Import &import); } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::Import) - -#endif // IMPORT_H diff --git a/src/plugins/qmldesigner/designercore/include/invalidargumentexception.h b/src/plugins/qmldesigner/designercore/include/invalidargumentexception.h index 295282a56b..b3b4b86a29 100644 --- a/src/plugins/qmldesigner/designercore/include/invalidargumentexception.h +++ b/src/plugins/qmldesigner/designercore/include/invalidargumentexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INVALIDARGUMENTEXCEPTION_H -#define INVALIDARGUMENTEXCEPTION_H +#pragma once #include "exception.h" @@ -48,5 +47,3 @@ private: }; } - -#endif // INVALIDARGUMENTEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/invalididexception.h b/src/plugins/qmldesigner/designercore/include/invalididexception.h index f1a59e69ab..7f74ac7deb 100644 --- a/src/plugins/qmldesigner/designercore/include/invalididexception.h +++ b/src/plugins/qmldesigner/designercore/include/invalididexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INVALIDIDEXCEPTION_H -#define INVALIDIDEXCEPTION_H +#pragma once #include "invalidargumentexception.h" @@ -56,5 +55,3 @@ private: }; } - -#endif // INVALIDIDEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/invalidmetainfoexception.h b/src/plugins/qmldesigner/designercore/include/invalidmetainfoexception.h index 72f1c1b424..079d3e27d6 100644 --- a/src/plugins/qmldesigner/designercore/include/invalidmetainfoexception.h +++ b/src/plugins/qmldesigner/designercore/include/invalidmetainfoexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INVALIDMETAINFOEXCEPTION_H -#define INVALIDMETAINFOEXCEPTION_H +#pragma once #include "exception.h" @@ -42,5 +41,3 @@ public: }; } - -#endif // INVALIDMETAINFOEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/invalidmodelnodeexception.h b/src/plugins/qmldesigner/designercore/include/invalidmodelnodeexception.h index a51b41ea90..e1a38d00c8 100644 --- a/src/plugins/qmldesigner/designercore/include/invalidmodelnodeexception.h +++ b/src/plugins/qmldesigner/designercore/include/invalidmodelnodeexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INVALIDMODELNODEEXCEPTION_H -#define INVALIDMODELNODEEXCEPTION_H +#pragma once #include "exception.h" @@ -42,5 +41,3 @@ public: }; } - -#endif // INVALIDMODELNODEEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/invalidmodelstateexception.h b/src/plugins/qmldesigner/designercore/include/invalidmodelstateexception.h index ebd92aeb11..76d48e880a 100644 --- a/src/plugins/qmldesigner/designercore/include/invalidmodelstateexception.h +++ b/src/plugins/qmldesigner/designercore/include/invalidmodelstateexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INVALIDMODELSTATEEXCEPTION_H -#define INVALIDMODELSTATEEXCEPTION_H +#pragma once #include "exception.h" @@ -42,5 +41,3 @@ public: }; } // namespace QmlDesigner - -#endif // INVALIDMODELSTATEEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/invalidpropertyexception.h b/src/plugins/qmldesigner/designercore/include/invalidpropertyexception.h index 5bbe02e265..38a9e86290 100644 --- a/src/plugins/qmldesigner/designercore/include/invalidpropertyexception.h +++ b/src/plugins/qmldesigner/designercore/include/invalidpropertyexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INVALIDPROPERTYEXCEPTION_H -#define INVALIDPROPERTYEXCEPTION_H +#pragma once #include "exception.h" @@ -46,5 +45,3 @@ private: }; } // namespace QmlDesigner - -#endif // INVALIDPROPERTYEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/invalidqmlsourceexception.h b/src/plugins/qmldesigner/designercore/include/invalidqmlsourceexception.h index 63b7c8a580..9793bb4ddb 100644 --- a/src/plugins/qmldesigner/designercore/include/invalidqmlsourceexception.h +++ b/src/plugins/qmldesigner/designercore/include/invalidqmlsourceexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INVALIDQMLSOURCEEXCEPTION_H -#define INVALIDQMLSOURCEEXCEPTION_H +#pragma once #include <exception.h> @@ -46,5 +45,3 @@ private: }; } // namespace QmlDesigner - -#endif // INVALIDQMLSOURCEEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/invalidreparentingexception.h b/src/plugins/qmldesigner/designercore/include/invalidreparentingexception.h index 316dee31e7..2460ceba1b 100644 --- a/src/plugins/qmldesigner/designercore/include/invalidreparentingexception.h +++ b/src/plugins/qmldesigner/designercore/include/invalidreparentingexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INVALIDREPARENTINGEXCEPTION_H -#define INVALIDREPARENTINGEXCEPTION_H +#pragma once #include "exception.h" @@ -41,5 +40,3 @@ public: }; } // namespace QmlDesigner - -#endif // INVALIDREPARENTINGEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/invalidslideindexexception.h b/src/plugins/qmldesigner/designercore/include/invalidslideindexexception.h index 82110299b8..7f95604c7b 100644 --- a/src/plugins/qmldesigner/designercore/include/invalidslideindexexception.h +++ b/src/plugins/qmldesigner/designercore/include/invalidslideindexexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INVALIDSLIDEINDEXEXCEPTION_H -#define INVALIDSLIDEINDEXEXCEPTION_H +#pragma once #include "exception.h" @@ -40,5 +39,3 @@ public: }; } // namespace QmlDesigner - -#endif // INVALIDSLIDEINDEXEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h b/src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h index 4b876815e7..2fc5a9b794 100644 --- a/src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h +++ b/src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ITEMLIBRARYINFO_H -#define ITEMLIBRARYINFO_H +#pragma once #include "qmldesignercorelib_global.h" @@ -98,7 +97,7 @@ class QMLDESIGNERCORE_EXPORT ItemLibraryInfo : public QObject public: QList<ItemLibraryEntry> entries() const; - QList<ItemLibraryEntry> entriesForType(const QString &typeName, int majorVersion, int minorVersion) const; + QList<ItemLibraryEntry> entriesForType(const QByteArray &typeName, int majorVersion, int minorVersion) const; ItemLibraryEntry entry(const QString &name) const; void addEntry(const ItemLibraryEntry &entry, bool overwriteDuplicate = false); @@ -120,5 +119,3 @@ private: // variables } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ItemLibraryEntry) - -#endif // ITEMLIBRARYINFO_H diff --git a/src/plugins/qmldesigner/designercore/include/iwidgetplugin.h b/src/plugins/qmldesigner/designercore/include/iwidgetplugin.h index ec59ec1af2..f85ad1e144 100644 --- a/src/plugins/qmldesigner/designercore/include/iwidgetplugin.h +++ b/src/plugins/qmldesigner/designercore/include/iwidgetplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IWIDGETPLUGIN_H -#define IWIDGETPLUGIN_H +#pragma once #include <QObject> @@ -46,5 +45,3 @@ public: QT_BEGIN_NAMESPACE Q_DECLARE_INTERFACE(QmlDesigner::IWidgetPlugin, QMLDESIGNER_WIDGETPLUGIN_INTERFACE) QT_END_NAMESPACE - -#endif // IWIDGETPLUGIN_H diff --git a/src/plugins/qmldesigner/designercore/include/mathutils.h b/src/plugins/qmldesigner/designercore/include/mathutils.h index eec4660dfb..5e35d77111 100644 --- a/src/plugins/qmldesigner/designercore/include/mathutils.h +++ b/src/plugins/qmldesigner/designercore/include/mathutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MATHUTILS_H -#define MATHUTILS_H +#pragma once #include <QtGlobal> @@ -38,5 +37,3 @@ inline double round(double value, int digits) } - -#endif // MATHUTILS_H diff --git a/src/plugins/qmldesigner/designercore/include/metainfo.h b/src/plugins/qmldesigner/designercore/include/metainfo.h index d5d5e406b5..90d94c324a 100644 --- a/src/plugins/qmldesigner/designercore/include/metainfo.h +++ b/src/plugins/qmldesigner/designercore/include/metainfo.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef METAINFO_H -#define METAINFO_H +#pragma once #include "qmldesignercorelib_global.h" @@ -83,5 +82,3 @@ private: }; } //namespace QmlDesigner - -#endif // METAINFO_H diff --git a/src/plugins/qmldesigner/designercore/include/metainforeader.h b/src/plugins/qmldesigner/designercore/include/metainforeader.h index 9f1904e6d7..f2e7c81333 100644 --- a/src/plugins/qmldesigner/designercore/include/metainforeader.h +++ b/src/plugins/qmldesigner/designercore/include/metainforeader.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef METAINFOREADER_H -#define METAINFOREADER_H +#pragma once #include "qmldesignercorelib_global.h" #include <metainfo.h> @@ -117,4 +116,3 @@ private: } } -#endif // METAINFOREADER_H diff --git a/src/plugins/qmldesigner/designercore/include/model.h b/src/plugins/qmldesigner/designercore/include/model.h index c18b63292b..dafc4d2c46 100644 --- a/src/plugins/qmldesigner/designercore/include/model.h +++ b/src/plugins/qmldesigner/designercore/include/model.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNERMODEL_H -#define DESIGNERMODEL_H +#pragma once #include <qmldesignercorelib_global.h> #include <QObject> @@ -118,5 +117,3 @@ public: }; } - -#endif // DESIGNERMODEL_H diff --git a/src/plugins/qmldesigner/designercore/include/modelmerger.h b/src/plugins/qmldesigner/designercore/include/modelmerger.h index bf680675d9..b49bfeb24b 100644 --- a/src/plugins/qmldesigner/designercore/include/modelmerger.h +++ b/src/plugins/qmldesigner/designercore/include/modelmerger.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELMERGER_H -#define MODELMERGER_H +#pragma once #include <QPointer> @@ -51,5 +50,3 @@ private: }; } //namespace QmlDesigner - -#endif // MODELMERGER_H diff --git a/src/plugins/qmldesigner/designercore/include/modelnode.h b/src/plugins/qmldesigner/designercore/include/modelnode.h index c0aa93102b..3b8b1fcf68 100644 --- a/src/plugins/qmldesigner/designercore/include/modelnode.h +++ b/src/plugins/qmldesigner/designercore/include/modelnode.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELNODE_H -#define MODELNODE_H +#pragma once #include "qmldesignercorelib_global.h" #include <QPointer> @@ -93,7 +92,7 @@ public: ModelNode& operator=(const ModelNode &other); TypeName type() const; - TypeName simplifiedTypeName() const; + QString simplifiedTypeName() const; int minorVersion() const; int majorVersion() const; @@ -210,5 +209,3 @@ QMLDESIGNERCORE_EXPORT QTextStream& operator<<(QTextStream &stream, const ModelN } Q_DECLARE_METATYPE(QmlDesigner::ModelNode) - -#endif // MODELNODE_H diff --git a/src/plugins/qmldesigner/designercore/include/modelnodepositionstorage.h b/src/plugins/qmldesigner/designercore/include/modelnodepositionstorage.h index 181fee548a..283c15d1ce 100644 --- a/src/plugins/qmldesigner/designercore/include/modelnodepositionstorage.h +++ b/src/plugins/qmldesigner/designercore/include/modelnodepositionstorage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELNODEPOSITIONSTORAGE_H -#define MODELNODEPOSITIONSTORAGE_H +#pragma once #include "modelnode.h" @@ -74,5 +73,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // MODELNODEPOSITIONSTORAGE_H diff --git a/src/plugins/qmldesigner/designercore/include/modificationgroupexception.h b/src/plugins/qmldesigner/designercore/include/modificationgroupexception.h index 5a61a37fd8..7397ed3e3f 100644 --- a/src/plugins/qmldesigner/designercore/include/modificationgroupexception.h +++ b/src/plugins/qmldesigner/designercore/include/modificationgroupexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODIFICATIONGROUPEXCEPTION_H -#define MODIFICATIONGROUPEXCEPTION_H +#pragma once #include "exception.h" @@ -39,5 +38,3 @@ public: }; } - -#endif // MODIFICATIONGROUPEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/modificationgrouptoken.h b/src/plugins/qmldesigner/designercore/include/modificationgrouptoken.h index 62a48242a2..dffa975f9d 100644 --- a/src/plugins/qmldesigner/designercore/include/modificationgrouptoken.h +++ b/src/plugins/qmldesigner/designercore/include/modificationgrouptoken.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODIFICATIONGROUPTOKEN_H -#define MODIFICATIONGROUPTOKEN_H +#pragma once #include <corelib_global.h> @@ -67,5 +66,3 @@ private: }; } - -#endif // MODIFICATIONGROUPTOKEN_H diff --git a/src/plugins/qmldesigner/designercore/include/nodeabstractproperty.h b/src/plugins/qmldesigner/designercore/include/nodeabstractproperty.h index d5c3209f7f..07f75d07a6 100644 --- a/src/plugins/qmldesigner/designercore/include/nodeabstractproperty.h +++ b/src/plugins/qmldesigner/designercore/include/nodeabstractproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEABSTRACTPROPERTY_H -#define NODEABSTRACTPROPERTY_H +#pragma once #include "abstractproperty.h" @@ -71,5 +70,3 @@ QMLDESIGNERCORE_EXPORT QTextStream& operator<<(QTextStream &stream, const NodeAb QMLDESIGNERCORE_EXPORT QDebug operator<<(QDebug debug, const NodeAbstractProperty &property); } // namespace QmlDesigner - -#endif // NODEABSTRACTPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/include/nodeanchors.h b/src/plugins/qmldesigner/designercore/include/nodeanchors.h index ca1518a297..efa20cc1a3 100644 --- a/src/plugins/qmldesigner/designercore/include/nodeanchors.h +++ b/src/plugins/qmldesigner/designercore/include/nodeanchors.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEANCHORS_H -#define NODEANCHORS_H +#pragma once #include <QPointer> @@ -106,5 +105,3 @@ CORESHARED_EXPORT QDebug operator<<(QDebug debug, const NodeAnchors &anchors); CORESHARED_EXPORT QTextStream& operator<<(QTextStream &stream, const NodeAnchors &anchors); } // namespace QmlDesigner - -#endif // NODEANCHORS_H diff --git a/src/plugins/qmldesigner/designercore/include/nodeinstance.h b/src/plugins/qmldesigner/designercore/include/nodeinstance.h index a5f64c92c6..9595396ae9 100644 --- a/src/plugins/qmldesigner/designercore/include/nodeinstance.h +++ b/src/plugins/qmldesigner/designercore/include/nodeinstance.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROXYNODEINSTANCE_H -#define PROXYNODEINSTANCE_H +#pragma once #include <QSharedPointer> #include <QTransform> @@ -131,5 +130,3 @@ private: bool operator ==(const NodeInstance &first, const NodeInstance &second); } - -#endif // PROXYNODEINSTANCE_H diff --git a/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h b/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h index dc11a2296e..4d4ffaa629 100644 --- a/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h +++ b/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEINSTANCEVIEW_H -#define NODEINSTANCEVIEW_H +#pragma once #include "qmldesignercorelib_global.h" #include "abstractview.h" @@ -205,5 +204,3 @@ private: //variables }; } // namespace ProxyNodeInstanceView - -#endif // NODEINSTANCEVIEW_H diff --git a/src/plugins/qmldesigner/designercore/include/nodelistproperty.h b/src/plugins/qmldesigner/designercore/include/nodelistproperty.h index 065b954f20..94af238bef 100644 --- a/src/plugins/qmldesigner/designercore/include/nodelistproperty.h +++ b/src/plugins/qmldesigner/designercore/include/nodelistproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODELISTPROPERTY_H -#define NODELISTPROPERTY_H +#pragma once #include "qmldesignercorelib_global.h" @@ -60,5 +59,3 @@ protected: NodeListProperty(const Internal::InternalNodeListPropertyPointer &internalNodeListProperty, Model* model, AbstractView *view); }; } - -#endif //NODELISTROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/include/nodemetainfo.h b/src/plugins/qmldesigner/designercore/include/nodemetainfo.h index 1e81226f1f..0ed326b804 100644 --- a/src/plugins/qmldesigner/designercore/include/nodemetainfo.h +++ b/src/plugins/qmldesigner/designercore/include/nodemetainfo.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEMETAINFO_H -#define NODEMETAINFO_H +#pragma once #include <QList> #include <QString> @@ -82,7 +81,7 @@ public: QList<NodeMetaInfo> superClasses() const; NodeMetaInfo directSuperClass() const; - QList<TypeName> superClassNames() const; + QStringList superClassNames() const; bool defaultPropertyIsComponent() const; @@ -112,5 +111,3 @@ private: }; } //QmlDesigner - -#endif // NODEMETAINFO_H diff --git a/src/plugins/qmldesigner/designercore/include/nodeproperty.h b/src/plugins/qmldesigner/designercore/include/nodeproperty.h index aaa5cf1b04..6c90488ec6 100644 --- a/src/plugins/qmldesigner/designercore/include/nodeproperty.h +++ b/src/plugins/qmldesigner/designercore/include/nodeproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEPROPERTY_H -#define NODEPROPERTY_H +#pragma once #include "qmldesignercorelib_global.h" #include "nodeabstractproperty.h" @@ -51,5 +50,3 @@ protected: }; } // namespace QmlDesigner - -#endif // NODEPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/include/notimplementedexception.h b/src/plugins/qmldesigner/designercore/include/notimplementedexception.h index d93dc757c0..170d70c89d 100644 --- a/src/plugins/qmldesigner/designercore/include/notimplementedexception.h +++ b/src/plugins/qmldesigner/designercore/include/notimplementedexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NOTIMPLEMENTEDEXCEPTION_H -#define NOTIMPLEMENTEDEXCEPTION_H +#pragma once #include "exception.h" @@ -42,5 +41,3 @@ public: }; } - -#endif // NOTIMPLEMENTEDEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/objectpropertybinding.h b/src/plugins/qmldesigner/designercore/include/objectpropertybinding.h index a6d948b91c..e2e6f05689 100644 --- a/src/plugins/qmldesigner/designercore/include/objectpropertybinding.h +++ b/src/plugins/qmldesigner/designercore/include/objectpropertybinding.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OBJECTPROPERTYBINDING_H -#define OBJECTPROPERTYBINDING_H +#pragma once #include <modelnode.h> @@ -47,5 +46,3 @@ private: } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::ObjectPropertyBinding); - -#endif // OBJECTPROPERTYBINDING_H diff --git a/src/plugins/qmldesigner/designercore/include/plaintexteditmodifier.h b/src/plugins/qmldesigner/designercore/include/plaintexteditmodifier.h index c11180e562..7530be3b40 100644 --- a/src/plugins/qmldesigner/designercore/include/plaintexteditmodifier.h +++ b/src/plugins/qmldesigner/designercore/include/plaintexteditmodifier.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLAINTEXTEDITMODIFIER_H -#define PLAINTEXTEDITMODIFIER_H +#pragma once #include "qmldesignercorelib_global.h" #include "textmodifier.h" @@ -104,5 +103,3 @@ public: }; } - -#endif // PLAINTEXTEDITMODIFIER_H diff --git a/src/plugins/qmldesigner/designercore/include/propertybinding.h b/src/plugins/qmldesigner/designercore/include/propertybinding.h index 7bb04d3bbd..bb2a835eac 100644 --- a/src/plugins/qmldesigner/designercore/include/propertybinding.h +++ b/src/plugins/qmldesigner/designercore/include/propertybinding.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYBINDING_H -#define PROPERTYBINDING_H +#pragma once #include <QMetaType> #include <QSharedPointer> @@ -54,5 +53,3 @@ private: } // namespace QmlDesigner Q_DECLARE_METATYPE(QmlDesigner::PropertyBinding); - -#endif // PROPERTYBINDING_H diff --git a/src/plugins/qmldesigner/designercore/include/propertycontainer.h b/src/plugins/qmldesigner/designercore/include/propertycontainer.h index 04ce101921..5eebf01fbd 100644 --- a/src/plugins/qmldesigner/designercore/include/propertycontainer.h +++ b/src/plugins/qmldesigner/designercore/include/propertycontainer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYCONTAINER_H -#define PROPERTYCONTAINER_H +#pragma once #include "qmldesignercorelib_global.h" @@ -72,7 +71,3 @@ QMLDESIGNERCORE_EXPORT QDataStream &operator>>(QDataStream &stream, QList<Proper QMLDESIGNERCORE_EXPORT QDebug operator<<(QDebug debug, QList<PropertyContainer> &propertyContainerList); } //namespace QmlDesigner - - - -#endif //PROPERTYCONTAINER_H diff --git a/src/plugins/qmldesigner/designercore/include/propertynode.h b/src/plugins/qmldesigner/designercore/include/propertynode.h index 26e576c185..1f4c90aedb 100644 --- a/src/plugins/qmldesigner/designercore/include/propertynode.h +++ b/src/plugins/qmldesigner/designercore/include/propertynode.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYNODE_H -#define PROPERTYNODE_H +#pragma once #include "qmldesignercorelib_global.h" @@ -40,5 +39,3 @@ public: }; } // namespace QmlDesigner - -#endif // PROPERTYNODE_H diff --git a/src/plugins/qmldesigner/designercore/include/propertyparser.h b/src/plugins/qmldesigner/designercore/include/propertyparser.h index 2a447a51b7..d5211ca7d5 100644 --- a/src/plugins/qmldesigner/designercore/include/propertyparser.h +++ b/src/plugins/qmldesigner/designercore/include/propertyparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROPERTYPARSER_H -#define PROPERTYPARSER_H +#pragma once #include <QVariant> @@ -42,5 +41,3 @@ QVariant variantFromString(const QString &s); } // namespace PropertyParser } // namespace Internal } // namespace Designer - -#endif // PROPERTYPARSER_H diff --git a/src/plugins/qmldesigner/designercore/include/qmlanchors.h b/src/plugins/qmldesigner/designercore/include/qmlanchors.h index 8993f3bd87..cd0736a682 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlanchors.h +++ b/src/plugins/qmldesigner/designercore/include/qmlanchors.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QmlAnchors_H -#define QmlAnchors_H +#pragma once #include <qmldesignercorelib_global.h> #include <qmlitemnode.h> @@ -84,5 +83,3 @@ private: }; } //QmlDesigner - -#endif // QmlAnchors_H diff --git a/src/plugins/qmldesigner/designercore/include/qmlchangeset.h b/src/plugins/qmldesigner/designercore/include/qmlchangeset.h index c7e38f0522..8440a6a785 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlchangeset.h +++ b/src/plugins/qmldesigner/designercore/include/qmlchangeset.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLCHANGESET_H -#define QMLCHANGESET_H +#pragma once #include <qmldesignercorelib_global.h> #include <modelnode.h> @@ -55,5 +54,3 @@ public: }; } //QmlDesigner - -#endif // QMLCHANGESET_H diff --git a/src/plugins/qmldesigner/designercore/include/qmldesignercorelib_global.h b/src/plugins/qmldesigner/designercore/include/qmldesignercorelib_global.h index 1e9b41ae86..964625cbc1 100644 --- a/src/plugins/qmldesigner/designercore/include/qmldesignercorelib_global.h +++ b/src/plugins/qmldesigner/designercore/include/qmldesignercorelib_global.h @@ -23,13 +23,11 @@ ** ****************************************************************************/ -#ifndef CORELIB_GLOBAL_H -#define CORELIB_GLOBAL_H +#pragma once #include <QtGlobal> #include <QList> - // Unnecessary since core isn't a dll any more. #define TEST_CORESHARED_EXPORT @@ -75,5 +73,3 @@ enum AnchorLineType { //#endif #include <qglobal.h> - -#endif // CORELIB_GLOBAL_H diff --git a/src/plugins/qmldesigner/designercore/include/qmlitemnode.h b/src/plugins/qmldesigner/designercore/include/qmlitemnode.h index e5e4b3cf2d..1f1f98ca5c 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlitemnode.h +++ b/src/plugins/qmldesigner/designercore/include/qmlitemnode.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QmlItemNode_H -#define QmlItemNode_H +#pragma once #include <qmldesignercorelib_global.h> #include <modelnode.h> @@ -110,7 +109,7 @@ public: QPixmap instanceRenderPixmap() const; QPixmap instanceBlurredRenderPixmap() const; - TypeName simplifiedTypeName() const; + QString simplifiedTypeName() const; const QList<QmlItemNode> allDirectSubModelNodes() const; const QList<QmlItemNode> allSubModelNodes() const; @@ -152,6 +151,3 @@ QMLDESIGNERCORE_EXPORT QList<ModelNode> toModelNodeList(const QList<QmlItemNode> QMLDESIGNERCORE_EXPORT QList<QmlItemNode> toQmlItemNodeList(const QList<ModelNode> &modelNodeList); } //QmlDesigner - - -#endif // QmlItemNode_H diff --git a/src/plugins/qmldesigner/designercore/include/qmlmodelnodefacade.h b/src/plugins/qmldesigner/designercore/include/qmlmodelnodefacade.h index 00f9df6c82..db2c36381b 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlmodelnodefacade.h +++ b/src/plugins/qmldesigner/designercore/include/qmlmodelnodefacade.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLMODELNODEFACADE_H -#define QMLMODELNODEFACADE_H +#pragma once #include <qmldesignercorelib_global.h> #include <modelnode.h> @@ -59,5 +58,3 @@ private: }; } //QmlDesigner - -#endif // QMLMODELNODEFACADE_H diff --git a/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h b/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h index 5ce65e09f5..3e9d5ff7e4 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h +++ b/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLOBJECTNODE_H -#define QMLOBJECTNODE_H +#pragma once #include <qmldesignercorelib_global.h> #include "qmlmodelnodefacade.h" @@ -126,5 +125,3 @@ QMLDESIGNERCORE_EXPORT uint qHash(const QmlObjectNode &node); QMLDESIGNERCORE_EXPORT QList<ModelNode> toModelNodeList(const QList<QmlObjectNode> &fxObjectNodeList); QMLDESIGNERCORE_EXPORT QList<QmlObjectNode> toQmlObjectNodeList(const QList<ModelNode> &modelNodeList); }// QmlDesigner - -#endif // QMLOBJECTNODE_H diff --git a/src/plugins/qmldesigner/designercore/include/qmlstate.h b/src/plugins/qmldesigner/designercore/include/qmlstate.h index c6a8332c76..4ee216f84f 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlstate.h +++ b/src/plugins/qmldesigner/designercore/include/qmlstate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLSTATE_H -#define QMLSTATE_H +#pragma once #include <qmldesignercorelib_global.h> #include "qmlmodelnodefacade.h" @@ -77,6 +76,3 @@ protected: }; } //QmlDesigner - - -#endif // QMLSTATE_H diff --git a/src/plugins/qmldesigner/designercore/include/removebasestateexception.h b/src/plugins/qmldesigner/designercore/include/removebasestateexception.h index 45ab1c7ff5..f088036da1 100644 --- a/src/plugins/qmldesigner/designercore/include/removebasestateexception.h +++ b/src/plugins/qmldesigner/designercore/include/removebasestateexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOVEBASESTATEEXCEPTION_H -#define REMOVEBASESTATEEXCEPTION_H +#pragma once #include <exception.h> @@ -41,5 +40,3 @@ public: }; } // namespace QmlDesigner - -#endif // REMOVEBASESTATEEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/rewriterview.h b/src/plugins/qmldesigner/designercore/include/rewriterview.h index b82abef2a7..1bcc4ffccb 100644 --- a/src/plugins/qmldesigner/designercore/include/rewriterview.h +++ b/src/plugins/qmldesigner/designercore/include/rewriterview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REWRITERVIEW_H -#define REWRITERVIEW_H +#pragma once #include "qmldesignercorelib_global.h" #include "abstractview.h" @@ -215,5 +214,3 @@ private: //variables }; } //QmlDesigner - -#endif // REWRITERVIEW_H diff --git a/src/plugins/qmldesigner/designercore/include/rewritingexception.h b/src/plugins/qmldesigner/designercore/include/rewritingexception.h index 067ecd1dc3..b732e9269e 100644 --- a/src/plugins/qmldesigner/designercore/include/rewritingexception.h +++ b/src/plugins/qmldesigner/designercore/include/rewritingexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REWRITINGEXCEPTION_H -#define REWRITINGEXCEPTION_H +#pragma once #include "exception.h" @@ -48,5 +47,3 @@ private: }; } // namespace QmlDesigner - -#endif // REWRITINGEXCEPTION_H diff --git a/src/plugins/qmldesigner/designercore/include/signalhandlerproperty.h b/src/plugins/qmldesigner/designercore/include/signalhandlerproperty.h index 4e76c0fa6b..47763a37f2 100644 --- a/src/plugins/qmldesigner/designercore/include/signalhandlerproperty.h +++ b/src/plugins/qmldesigner/designercore/include/signalhandlerproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SIGNALHANDLERPROPERTY_H -#define SIGNALHANDLERPROPERTY_H +#pragma once #include "qmldesignercorelib_global.h" #include "abstractproperty.h" @@ -49,5 +48,3 @@ protected: }; } // namespace QmlDesigner - -#endif // SIGNALHANDLERPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/include/subcomponentmanager.h b/src/plugins/qmldesigner/designercore/include/subcomponentmanager.h index b965c02716..15e2c41d01 100644 --- a/src/plugins/qmldesigner/designercore/include/subcomponentmanager.h +++ b/src/plugins/qmldesigner/designercore/include/subcomponentmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SUBCOMPONENTMANAGER_H -#define SUBCOMPONENTMANAGER_H +#pragma once #include "qmldesignercorelib_global.h" @@ -77,6 +76,3 @@ private: // variables }; } // namespace QmlDesigner - - -#endif // SUBCOMPONENTMANAGER_H diff --git a/src/plugins/qmldesigner/designercore/include/textmodifier.h b/src/plugins/qmldesigner/designercore/include/textmodifier.h index 6e93e7f07f..863ecabd9f 100644 --- a/src/plugins/qmldesigner/designercore/include/textmodifier.h +++ b/src/plugins/qmldesigner/designercore/include/textmodifier.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTMODIFIER_H -#define TEXTMODIFIER_H +#pragma once #include "qmldesignercorelib_global.h" @@ -91,5 +90,3 @@ signals: }; } - -#endif // TEXTMODIFIER_H diff --git a/src/plugins/qmldesigner/designercore/include/variantproperty.h b/src/plugins/qmldesigner/designercore/include/variantproperty.h index e05697e256..c909958de0 100644 --- a/src/plugins/qmldesigner/designercore/include/variantproperty.h +++ b/src/plugins/qmldesigner/designercore/include/variantproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef VARIANTPROPERTY_H -#define VARIANTPROPERTY_H +#pragma once #include "qmldesignercorelib_global.h" #include "abstractproperty.h" @@ -67,5 +66,3 @@ QMLDESIGNERCORE_EXPORT QTextStream& operator<<(QTextStream &stream, const Varian QMLDESIGNERCORE_EXPORT QDebug operator<<(QDebug debug, const VariantProperty &VariantProperty); } - -#endif //VARIANTPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/include/viewmanager.h b/src/plugins/qmldesigner/designercore/include/viewmanager.h index 7690ff98a1..f6a594f54b 100644 --- a/src/plugins/qmldesigner/designercore/include/viewmanager.h +++ b/src/plugins/qmldesigner/designercore/include/viewmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_VIEWMANAGER_H -#define QMLDESIGNER_VIEWMANAGER_H +#pragma once #include "abstractview.h" @@ -107,5 +106,3 @@ private: // variables }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_VIEWMANAGER_H diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp index 0df45b4b53..aa6e057c03 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp @@ -540,7 +540,7 @@ void NodeInstanceServerProxy::printEditorProcessOutput() while (m_qmlPuppetEditorProcess && m_qmlPuppetEditorProcess->canReadLine()) { QByteArray line = m_qmlPuppetEditorProcess->readLine(); line.chop(1); - qDebug().nospace() << "Editor Puppet: " << qPrintable(line); + qDebug().nospace() << "Editor Puppet: " << line; } qDebug() << "\n"; } @@ -550,7 +550,7 @@ void NodeInstanceServerProxy::printPreviewProcessOutput() while (m_qmlPuppetPreviewProcess && m_qmlPuppetPreviewProcess->canReadLine()) { QByteArray line = m_qmlPuppetPreviewProcess->readLine(); line.chop(1); - qDebug().nospace() << "Preview Puppet: " << qPrintable(line); + qDebug().nospace() << "Preview Puppet: " << line; } qDebug() << "\n"; } @@ -560,7 +560,7 @@ void NodeInstanceServerProxy::printRenderProcessOutput() while (m_qmlPuppetRenderProcess && m_qmlPuppetRenderProcess->canReadLine()) { QByteArray line = m_qmlPuppetRenderProcess->readLine(); line.chop(1); - qDebug().nospace() << "Render Puppet: " << qPrintable(line); + qDebug().nospace() << "Render Puppet: " << line; } qDebug() << "\n"; diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h index 56f7d18228..1b770749a8 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NODEINSTANCESERVERPROXY_H -#define NODEINSTANCESERVERPROXY_H +#pragma once #include "nodeinstanceserverinterface.h" @@ -124,5 +123,3 @@ private: }; } // namespace QmlDesigner - -#endif // NODEINSTANCESERVERPROXY_H diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp index 2b110747b3..d5bcfaff6b 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp @@ -124,7 +124,7 @@ NodeInstanceView::~NodeInstanceView() bool isSkippedRootNode(const ModelNode &node) { - static QStringList skipList = QStringList() << "Qt.ListModel" << "QtQuick.ListModel" << "Qt.ListModel" << "QtQuick.ListModel"; + static PropertyNameList skipList = PropertyNameList() << "Qt.ListModel" << "QtQuick.ListModel" << "Qt.ListModel" << "QtQuick.ListModel"; if (skipList.contains(node.type())) return true; @@ -135,7 +135,7 @@ bool isSkippedRootNode(const ModelNode &node) bool isSkippedNode(const ModelNode &node) { - static QStringList skipList = QStringList() << "QtQuick.XmlRole" << "Qt.XmlRole" << "QtQuick.ListElement" << "Qt.ListElement"; + static PropertyNameList skipList = PropertyNameList() << "QtQuick.XmlRole" << "Qt.XmlRole" << "QtQuick.ListElement" << "Qt.ListElement"; if (skipList.contains(node.type())) return true; @@ -318,7 +318,7 @@ void NodeInstanceView::propertiesAboutToBeRemoved(const QList<AbstractProperty>& nodeInstanceServer()->removeProperties(createRemovePropertiesCommand(nonNodePropertyList)); foreach (const AbstractProperty &property, propertyList) { - const QString &name = property.name(); + const PropertyName &name = property.name(); if (name == "anchors.fill") { resetHorizontalAnchors(property.parentModelNode()); resetVerticalAnchors(property.parentModelNode()); diff --git a/src/plugins/qmldesigner/designercore/instances/puppetbuildprogressdialog.h b/src/plugins/qmldesigner/designercore/instances/puppetbuildprogressdialog.h index 2dc6919d3a..4952335f23 100644 --- a/src/plugins/qmldesigner/designercore/instances/puppetbuildprogressdialog.h +++ b/src/plugins/qmldesigner/designercore/instances/puppetbuildprogressdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PUPPETBUILDPROGRESSDIALOG_H -#define PUPPETBUILDPROGRESSDIALOG_H +#pragma once #include <QDialog> @@ -59,4 +58,3 @@ private: }; } -#endif // PUPPETBUILDPROGRESSDIALOG_H diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.h b/src/plugins/qmldesigner/designercore/instances/puppetcreator.h index eac79607d3..f39d210a3e 100644 --- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.h +++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_PUPPETCREATOR_H -#define QMLDESIGNER_PUPPETCREATOR_H +#pragma once #include <QString> #include <QProcessEnvironment> @@ -120,5 +119,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_PUPPETCREATOR_H diff --git a/src/plugins/qmldesigner/designercore/instances/puppetdialog.h b/src/plugins/qmldesigner/designercore/instances/puppetdialog.h index 91654fb125..c65094042c 100644 --- a/src/plugins/qmldesigner/designercore/instances/puppetdialog.h +++ b/src/plugins/qmldesigner/designercore/instances/puppetdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PUPPETDIALOG_H -#define PUPPETDIALOG_H +#pragma once #include <QDialog> @@ -56,5 +55,3 @@ private: }; } //QmlDesigner - -#endif // PUPPETDIALOG_H diff --git a/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp index ea7cdbb061..786a5b8cc8 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp @@ -170,7 +170,7 @@ void ItemLibraryEntry::setLibraryEntryIconPath(const QString &iconPath) m_data->libraryEntryIconPath = iconPath; } -static QString getSourceForUrl(const QString &fileURl) +static QByteArray getSourceForUrl(const QString &fileURl) { Utils::FileReader fileReader; @@ -184,7 +184,7 @@ void ItemLibraryEntry::setQmlPath(const QString &qml) { m_data->qml = qml; - m_data->qmlSource = getSourceForUrl(qml); + m_data->qmlSource = QString::fromUtf8(getSourceForUrl(qml)); } void ItemLibraryEntry::setRequiredImport(const QString &requiredImport) @@ -264,7 +264,7 @@ ItemLibraryInfo::ItemLibraryInfo(QObject *parent) -QList<ItemLibraryEntry> ItemLibraryInfo::entriesForType(const QString &typeName, int majorVersion, int minorVersion) const +QList<ItemLibraryEntry> ItemLibraryInfo::entriesForType(const QByteArray &typeName, int majorVersion, int minorVersion) const { QList<ItemLibraryEntry> entries; diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp index ccd4e21cc0..e7f13239fd 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp @@ -46,7 +46,7 @@ namespace Internal { struct TypeDescription { - TypeName className; + QString className; int minorVersion; int majorVersion; }; @@ -330,9 +330,9 @@ private: const ContextPtr m_context; }; -static inline bool isValueType(const QString &type) +static inline bool isValueType(const TypeName &type) { - QStringList objectValuesList; + PropertyTypeList objectValuesList; objectValuesList << "QFont" << "QPoint" << "QPointF" << "QSize" << "QSizeF" << "QVector3D" << "QVector2D"; return objectValuesList.contains(type); } @@ -367,7 +367,7 @@ QStringList prototypes(const ObjectValue *ov, const ContextPtr &context, bool ve } } else { if (versions) - list << ov->className() + " -1.-1"; + list << ov->className() + QLatin1String(" -1.-1"); else list << ov->className(); } @@ -394,10 +394,11 @@ QList<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const Cont QList<PropertyInfo> newList = processor.properties(); foreach (PropertyInfo property, newList) { - PropertyName name = property.first; - if (!objectValue->isWritable(name) && objectValue->isPointer(name)) { + const PropertyName name = property.first; + const QString nameAsString = QString::fromUtf8(name); + if (!objectValue->isWritable(nameAsString) && objectValue->isPointer(nameAsString)) { //dot property - const CppComponentValue * qmlValue = value_cast<CppComponentValue>(objectValue->lookupMember(name, context)); + const CppComponentValue * qmlValue = value_cast<CppComponentValue>(objectValue->lookupMember(nameAsString, context)); if (qmlValue) { QList<PropertyInfo> dotProperties = getQmlTypes(qmlValue, context, false, rec + 1); foreach (const PropertyInfo &propertyInfo, dotProperties) { @@ -408,8 +409,8 @@ QList<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const Cont } } } - if (isValueType(objectValue->propertyType(name))) { - const ObjectValue *dotObjectValue = value_cast<ObjectValue>(objectValue->lookupMember(name, context)); + if (isValueType(objectValue->propertyType(nameAsString).toUtf8())) { + const ObjectValue *dotObjectValue = value_cast<ObjectValue>(objectValue->lookupMember(nameAsString, context)); if (dotObjectValue) { QList<PropertyInfo> dotProperties = getObjectTypes(dotObjectValue, context, false, rec + 1); foreach (const PropertyInfo &propertyInfo, dotProperties) { @@ -421,8 +422,8 @@ QList<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const Cont } } TypeName type = property.second; - if (!objectValue->isPointer(name) && !objectValue->isListProperty(name)) - type = objectValue->propertyType(name).toUtf8(); + if (!objectValue->isPointer(nameAsString) && !objectValue->isListProperty(nameAsString)) + type = objectValue->propertyType(nameAsString).toUtf8(); propertyList.append(qMakePair(name, type)); } @@ -444,7 +445,7 @@ PropertyNameList getSignals(const ObjectValue *objectValue, const ContextPtr &co { PropertyNameList signalList; - if (!objectValue) + if (!objectValue) return signalList; if (objectValue->className().isEmpty()) return signalList; @@ -537,7 +538,7 @@ public: bool isPropertyEnum(const PropertyName &propertyName) const; QString propertyEnumScope(const PropertyName &propertyName) const; QStringList keysForEnum(const QString &enumName) const; - bool cleverCheckType(const QString &otherType) const; + bool cleverCheckType(const TypeName &otherType) const; QVariant::Type variantTypeId(const PropertyName &properyName) const; int majorVersion() const; @@ -545,7 +546,7 @@ public: TypeName qualfiedTypeName() const; Model *model() const; - QString cppPackageName() const; + QByteArray cppPackageName() const; QString componentSource() const; QString componentFileName() const; @@ -553,8 +554,8 @@ public: static Pointer create(Model *model, const TypeName &type, int maj = -1, int min = -1); - QSet<QString> &prototypeCachePositives(); - QSet<QString> &prototypeCacheNegatives(); + QSet<QByteArray> &prototypeCachePositives(); + QSet<QByteArray> &prototypeCacheNegatives(); static void clearCache(); @@ -582,18 +583,18 @@ private: PropertyNameList m_localProperties; PropertyName m_defaultPropertyName; QList<TypeDescription> m_prototypes; - QSet<QString> m_prototypeCachePositives; - QSet<QString> m_prototypeCacheNegatives; + QSet<QByteArray> m_prototypeCachePositives; + QSet<QByteArray> m_prototypeCacheNegatives; //storing the pointer would not be save ContextPtr context() const; const Document *document() const; QPointer<Model> m_model; - static QHash<QString, Pointer> m_nodeMetaInfoCache; + static QHash<TypeName, Pointer> m_nodeMetaInfoCache; }; -QHash<QString, NodeMetaInfoPrivate::Pointer> NodeMetaInfoPrivate::m_nodeMetaInfoCache; +QHash<TypeName, NodeMetaInfoPrivate::Pointer> NodeMetaInfoPrivate::m_nodeMetaInfoCache; bool NodeMetaInfoPrivate::isFileComponent() const { @@ -615,12 +616,12 @@ PropertyNameList NodeMetaInfoPrivate::signalNames() const return m_signals; } -QSet<QString> &NodeMetaInfoPrivate::prototypeCachePositives() +QSet<QByteArray> &NodeMetaInfoPrivate::prototypeCachePositives() { return m_prototypeCachePositives; } -QSet<QString> &NodeMetaInfoPrivate::prototypeCacheNegatives() +QSet<QByteArray> &NodeMetaInfoPrivate::prototypeCacheNegatives() { return m_prototypeCacheNegatives; } @@ -637,9 +638,9 @@ PropertyName NodeMetaInfoPrivate::defaultPropertyName() const return PropertyName("data"); } -static inline QString stringIdentifier( const QString &type, int maj, int min) +static inline TypeName stringIdentifier( const TypeName &type, int maj, int min) { - return type + QString::number(maj) + '_' + QString::number(min); + return type + QString::number(maj).toLatin1() + '_' + QString::number(min).toLatin1(); } NodeMetaInfoPrivate::Pointer NodeMetaInfoPrivate::create(Model *model, const TypeName &type, int major, int minor) @@ -748,7 +749,7 @@ const CppComponentValue *NodeMetaInfoPrivate::getCppComponentValue() const return value; // maybe 'type' is a cpp name - const CppComponentValue *cppValue = context()->valueOwner()->cppQmlTypes().objectByCppName(type); + const CppComponentValue *cppValue = context()->valueOwner()->cppQmlTypes().objectByCppName(QString::fromUtf8(type)); if (cppValue) { foreach (const LanguageUtils::FakeMetaObject::Export &exportValue, cppValue->metaObject()->exports()) { @@ -813,12 +814,12 @@ bool NodeMetaInfoPrivate::isPropertyWritable(const PropertyName &propertyName) c const PropertyNameList parts = propertyName.split('.'); const PropertyName objectName = parts.first(); const PropertyName rawPropertyName = parts.last(); - const QString objectType = propertyType(objectName); + const TypeName objectType = propertyType(objectName); if (isValueType(objectType)) return true; - QSharedPointer<NodeMetaInfoPrivate> objectInfo(create(m_model, objectType.toUtf8())); + QSharedPointer<NodeMetaInfoPrivate> objectInfo(create(m_model, objectType)); if (objectInfo->isValid()) return objectInfo->isPropertyWritable(rawPropertyName); else @@ -828,8 +829,8 @@ bool NodeMetaInfoPrivate::isPropertyWritable(const PropertyName &propertyName) c const CppComponentValue *qmlObjectValue = getNearestCppComponentValue(); if (!qmlObjectValue) return true; - if (qmlObjectValue->hasProperty(propertyName)) - return qmlObjectValue->isWritable(propertyName); + if (qmlObjectValue->hasProperty(QString::fromUtf8(propertyName))) + return qmlObjectValue->isWritable(QString::fromUtf8(propertyName)); else return true; //all properties of components are writable } @@ -844,12 +845,12 @@ bool NodeMetaInfoPrivate::isPropertyList(const PropertyName &propertyName) const const PropertyNameList parts = propertyName.split('.'); const PropertyName objectName = parts.first(); const PropertyName rawPropertyName = parts.last(); - const QString objectType = propertyType(objectName); + const TypeName objectType = propertyType(objectName); if (isValueType(objectType)) return false; - QSharedPointer<NodeMetaInfoPrivate> objectInfo(create(m_model, objectType.toUtf8())); + QSharedPointer<NodeMetaInfoPrivate> objectInfo(create(m_model, objectType)); if (objectInfo->isValid()) return objectInfo->isPropertyList(rawPropertyName); else @@ -859,7 +860,7 @@ bool NodeMetaInfoPrivate::isPropertyList(const PropertyName &propertyName) const const CppComponentValue *qmlObjectValue = getNearestCppComponentValue(); if (!qmlObjectValue) return false; - return qmlObjectValue->isListProperty(propertyName); + return qmlObjectValue->isListProperty(QString::fromUtf8(propertyName)); } bool NodeMetaInfoPrivate::isPropertyPointer(const PropertyName &propertyName) const @@ -871,12 +872,12 @@ bool NodeMetaInfoPrivate::isPropertyPointer(const PropertyName &propertyName) co const PropertyNameList parts = propertyName.split('.'); const PropertyName objectName = parts.first(); const PropertyName rawPropertyName = parts.last(); - const QString objectType = propertyType(objectName); + const TypeName objectType = propertyType(objectName); if (isValueType(objectType)) return false; - QSharedPointer<NodeMetaInfoPrivate> objectInfo(create(m_model, objectType.toUtf8())); + QSharedPointer<NodeMetaInfoPrivate> objectInfo(create(m_model, objectType)); if (objectInfo->isValid()) return objectInfo->isPropertyPointer(rawPropertyName); else @@ -886,7 +887,7 @@ bool NodeMetaInfoPrivate::isPropertyPointer(const PropertyName &propertyName) co const CppComponentValue *qmlObjectValue = getNearestCppComponentValue(); if (!qmlObjectValue) return false; - return qmlObjectValue->isPointer(propertyName); + return qmlObjectValue->isPointer(QString::fromUtf8(propertyName)); } bool NodeMetaInfoPrivate::isPropertyEnum(const PropertyName &propertyName) const @@ -901,12 +902,12 @@ bool NodeMetaInfoPrivate::isPropertyEnum(const PropertyName &propertyName) const const PropertyNameList parts = propertyName.split('.'); const PropertyName objectName = parts.first(); const PropertyName rawPropertyName = parts.last(); - const QString objectType = propertyType(objectName); + const TypeName objectType = propertyType(objectName); if (isValueType(objectType)) return false; - QSharedPointer<NodeMetaInfoPrivate> objectInfo(create(m_model, objectType.toUtf8())); + QSharedPointer<NodeMetaInfoPrivate> objectInfo(create(m_model, objectType)); if (objectInfo->isValid()) return objectInfo->isPropertyEnum(rawPropertyName); else @@ -916,7 +917,7 @@ bool NodeMetaInfoPrivate::isPropertyEnum(const PropertyName &propertyName) const const CppComponentValue *qmlObjectValue = getNearestCppComponentValue(); if (!qmlObjectValue) return false; - return qmlObjectValue->getEnum(propertyType(propertyName)).isValid(); + return qmlObjectValue->getEnum(QString::fromUtf8(propertyType(propertyName))).isValid(); } QString NodeMetaInfoPrivate::propertyEnumScope(const PropertyName &propertyName) const @@ -931,12 +932,12 @@ QString NodeMetaInfoPrivate::propertyEnumScope(const PropertyName &propertyName) const PropertyNameList parts = propertyName.split('.'); const PropertyName objectName = parts.first(); const PropertyName rawPropertyName = parts.last(); - const QString objectType = propertyType(objectName); + const TypeName objectType = propertyType(objectName); if (isValueType(objectType)) return QString(); - QSharedPointer<NodeMetaInfoPrivate> objectInfo(create(m_model, objectType.toUtf8())); + QSharedPointer<NodeMetaInfoPrivate> objectInfo(create(m_model, objectType)); if (objectInfo->isValid()) return objectInfo->propertyEnumScope(rawPropertyName); else @@ -947,7 +948,7 @@ QString NodeMetaInfoPrivate::propertyEnumScope(const PropertyName &propertyName) if (!qmlObjectValue) return QString(); const CppComponentValue *definedIn = 0; - qmlObjectValue->getEnum(propertyType(propertyName), &definedIn); + qmlObjectValue->getEnum(QString::fromUtf8(propertyType(propertyName)), &definedIn); if (definedIn) { QString nonCppPackage; foreach (const LanguageUtils::FakeMetaObject::Export &qmlExport, definedIn->metaObject()->exports()) { @@ -966,25 +967,25 @@ QString NodeMetaInfoPrivate::propertyEnumScope(const PropertyName &propertyName) return QString(); } -static QString getUnqualifiedName(const QString &name) +static QByteArray getUnqualifiedName(const QByteArray &name) { - const QStringList nameComponents = name.split('.'); + const QList<QByteArray> nameComponents = name.split('.'); if (nameComponents.size() < 2) return name; return nameComponents.last(); } -static QString getPackage(const QString &name) +static QByteArray getPackage(const QByteArray &name) { - QStringList nameComponents = name.split('.'); + QList<QByteArray> nameComponents = name.split('.'); if (nameComponents.size() < 2) - return QString(); + return QByteArray(); nameComponents.removeLast(); - return nameComponents.join(QLatin1Char('.')); + return nameComponents.join('.'); } -bool NodeMetaInfoPrivate::cleverCheckType(const QString &otherType) const +bool NodeMetaInfoPrivate::cleverCheckType(const TypeName &otherType) const { if (otherType == qualfiedTypeName()) return true; @@ -992,28 +993,28 @@ bool NodeMetaInfoPrivate::cleverCheckType(const QString &otherType) const if (isFileComponent()) return false; - const QString typeName = getUnqualifiedName(otherType); - const QString package = getPackage(otherType); + const QByteArray typeName = getUnqualifiedName(otherType); + const QByteArray package = getPackage(otherType); if (cppPackageName() == package) - return QString(package + '.' + typeName) == cppPackageName() + '.' + getUnqualifiedName(qualfiedTypeName()); + return QByteArray(package + '.' + typeName) == (cppPackageName() + '.' + getUnqualifiedName(qualfiedTypeName())); const CppComponentValue *qmlObjectValue = getCppComponentValue(); if (!qmlObjectValue) return false; const LanguageUtils::FakeMetaObject::Export exp = - qmlObjectValue->metaObject()->exportInPackage(package); + qmlObjectValue->metaObject()->exportInPackage(QString::fromUtf8(package)); QString convertedName = exp.type; if (convertedName.isEmpty()) convertedName = qmlObjectValue->className(); - return typeName == convertedName; + return typeName == convertedName.toUtf8(); } QVariant::Type NodeMetaInfoPrivate::variantTypeId(const PropertyName &properyName) const { - QString typeName = propertyType(properyName); + TypeName typeName = propertyType(properyName); if (typeName == "string") return QVariant::String; @@ -1044,7 +1045,7 @@ QVariant::Type NodeMetaInfoPrivate::variantTypeId(const PropertyName &properyNam if (typeName == "var") return QVariant::UserType; - return QVariant::nameToType(typeName.toUtf8().data()); + return QVariant::nameToType(typeName.data()); } int NodeMetaInfoPrivate::majorVersion() const @@ -1079,13 +1080,13 @@ QStringList NodeMetaInfoPrivate::keysForEnum(const QString &enumName) const return qmlObjectValue->getEnum(enumName).keys(); } -QString NodeMetaInfoPrivate::cppPackageName() const +QByteArray NodeMetaInfoPrivate::cppPackageName() const { if (!isFileComponent()) { if (const CppComponentValue *qmlObject = getCppComponentValue()) - return qmlObject->moduleName(); + return qmlObject->moduleName().toUtf8(); } - return QString(); + return QByteArray(); } QString NodeMetaInfoPrivate::componentSource() const @@ -1131,7 +1132,7 @@ QString NodeMetaInfoPrivate::importDirectoryPath() const if (QDir(targetPath).exists()) return targetPath; const QString targetPathVersion = QDir(importPath).filePath(importInfo.path() - + QLatin1Char('.') + + '.' + QString::number(importInfo.version().majorVersion())); if (QDir(targetPathVersion).exists()) return targetPathVersion; @@ -1147,10 +1148,10 @@ QString NodeMetaInfoPrivate::lookupName() const QString className = QString::fromUtf8(m_qualfiedTypeName); QString packageName; - QStringList packageClassName = className.split(QLatin1Char('.')); + QStringList packageClassName = className.split('.'); if (packageClassName.size() > 1) { className = packageClassName.takeLast(); - packageName = packageClassName.join(QLatin1Char('.')); + packageName = packageClassName.join('.'); } return CppQmlTypes::qualifiedName( @@ -1200,32 +1201,32 @@ void NodeMetaInfoPrivate::setupPrototypes() foreach (const ObjectValue *ov, objects) { TypeDescription description; - description.className = ov->className().toUtf8(); + description.className = ov->className(); description.minorVersion = -1; description.majorVersion = -1; if (const CppComponentValue * qmlValue = value_cast<CppComponentValue>(ov)) { description.minorVersion = qmlValue->componentVersion().minorVersion(); description.majorVersion = qmlValue->componentVersion().majorVersion(); - LanguageUtils::FakeMetaObject::Export qtquickExport = qmlValue->metaObject()->exportInPackage("QtQuick"); - LanguageUtils::FakeMetaObject::Export cppExport = qmlValue->metaObject()->exportInPackage("<cpp>"); + LanguageUtils::FakeMetaObject::Export qtquickExport = qmlValue->metaObject()->exportInPackage(QLatin1String("QtQuick")); + LanguageUtils::FakeMetaObject::Export cppExport = qmlValue->metaObject()->exportInPackage(QLatin1String("<cpp>")); if (qtquickExport.isValid()) { - description.className = qtquickExport.package.toUtf8() + '.' + qtquickExport.type.toUtf8(); + description.className = qtquickExport.package + '.' + qtquickExport.type; } else { bool found = false; if (cppExport.isValid()) { foreach (const LanguageUtils::FakeMetaObject::Export &exportValue, qmlValue->metaObject()->exports()) { if (exportValue.package.toUtf8() != "<cpp>") { found = true; - description.className = exportValue.package.toUtf8() + '.' + exportValue.type.toUtf8(); + description.className = exportValue.package + '.' + exportValue.type; } } } if (!found) { if (qmlValue->moduleName().isEmpty() && cppExport.isValid()) { - description.className = cppExport.package.toUtf8() + '.' + cppExport.type.toUtf8(); + description.className = cppExport.package + '.' + cppExport.type; } else if (!qmlValue->moduleName().isEmpty()) { - description.className = qmlValue->moduleName().toUtf8() + '.' + description.className; + description.className.prepend(qmlValue->moduleName() + QLatin1Char('.')); } } } @@ -1239,7 +1240,7 @@ void NodeMetaInfoPrivate::setupPrototypes() QString uri = importInfo.name(); uri.replace(QStringLiteral(","), QStringLiteral(".")); if (!uri.isEmpty()) - description.className = QString(uri + QString::fromLatin1(".") + QString::fromUtf8(description.className)).toUtf8(); + description.className = QString(uri + "." + description.className); } m_prototypes.append(description); @@ -1264,8 +1265,8 @@ const CppComponentValue *NodeMetaInfoPrivate::getNearestCppComponentValue() cons QString NodeMetaInfoPrivate::fullQualifiedImportAliasType() const { if (m_model && m_model->rewriterView()) - return model()->rewriterView()->convertTypeToImportAlias(m_qualfiedTypeName); - return m_qualfiedTypeName; + return model()->rewriterView()->convertTypeToImportAlias(QString::fromUtf8(m_qualfiedTypeName)); + return QString::fromUtf8(m_qualfiedTypeName); } } //namespace Internal @@ -1369,7 +1370,7 @@ QString NodeMetaInfo::propertyEnumScope(const PropertyName &propertyName) const QStringList NodeMetaInfo::propertyKeysForEnum(const PropertyName &propertyName) const { - return m_privateData->keysForEnum(propertyTypeName(propertyName)); + return m_privateData->keysForEnum(QString::fromUtf8(propertyTypeName(propertyName))); } QVariant NodeMetaInfo::propertyCastedValue(const PropertyName &propertyName, const QVariant &value) const @@ -1381,17 +1382,17 @@ QVariant NodeMetaInfo::propertyCastedValue(const PropertyName &propertyName, con || variant.canConvert<Enumeration>()) return variant; - const QString typeName = propertyTypeName(propertyName); + const TypeName typeName = propertyTypeName(propertyName); QVariant::Type typeId = m_privateData->variantTypeId(propertyName); if (variant.type() == QVariant::UserType && variant.userType() == ModelNode::variantUserType()) { return variant; - } else if (typeId == QVariant::UserType && typeName == QStringLiteral("QVariant")) { + } else if (typeId == QVariant::UserType && typeName == "QVariant") { return variant; - } else if (typeId == QVariant::UserType && typeName == QStringLiteral("variant")) { + } else if (typeId == QVariant::UserType && typeName == "variant") { return variant; - } else if (typeId == QVariant::UserType && typeName == QStringLiteral("var")) { + } else if (typeId == QVariant::UserType && typeName == "var") { return variant; } else if (variant.type() == QVariant::List) { // TODO: check the contents of the list @@ -1413,7 +1414,7 @@ QList<NodeMetaInfo> NodeMetaInfo::superClasses() const QList<NodeMetaInfo> list; foreach (const Internal::TypeDescription &type, m_privateData->prototypes()) { - list.append(NodeMetaInfo(m_privateData->model(), type.className, type.majorVersion, type.minorVersion)); + list.append(NodeMetaInfo(m_privateData->model(), type.className.toUtf8(), type.majorVersion, type.minorVersion)); } return list; } @@ -1426,9 +1427,9 @@ NodeMetaInfo NodeMetaInfo::directSuperClass() const return NodeMetaInfo(); } -QList<TypeName> NodeMetaInfo::superClassNames() const +QStringList NodeMetaInfo::superClassNames() const { - QList<TypeName> list; + QStringList list; foreach (const Internal::TypeDescription &type, m_privateData->prototypes()) { list.append(type.className); diff --git a/src/plugins/qmldesigner/designercore/model/abstractview.cpp b/src/plugins/qmldesigner/designercore/model/abstractview.cpp index 374797b250..91a0effec3 100644 --- a/src/plugins/qmldesigner/designercore/model/abstractview.cpp +++ b/src/plugins/qmldesigner/designercore/model/abstractview.cpp @@ -467,12 +467,12 @@ QString AbstractView::generateNewId(const QString &prefixName) const { int counter = 1; - QString newId = QString("%1%2").arg(firstCharToLower(prefixName)).arg(counter); + QString newId = QString(QStringLiteral("%1%2")).arg(firstCharToLower(prefixName)).arg(counter); newId.remove(QRegExp(QStringLiteral("[^a-zA-Z0-9_]"))); while (hasId(newId)) { counter += 1; - newId = QString("%1%2").arg(firstCharToLower(prefixName)).arg(counter); + newId = QString(QStringLiteral("%1%2")).arg(firstCharToLower(prefixName)).arg(counter); newId.remove(QRegExp(QStringLiteral("[^a-zA-Z0-9_]"))); } diff --git a/src/plugins/qmldesigner/designercore/model/bindingproperty.cpp b/src/plugins/qmldesigner/designercore/model/bindingproperty.cpp index 743de64e1d..0a7f3cfc38 100644 --- a/src/plugins/qmldesigner/designercore/model/bindingproperty.cpp +++ b/src/plugins/qmldesigner/designercore/model/bindingproperty.cpp @@ -96,7 +96,7 @@ static ModelNode resolveBinding(const QString &binding, ModelNode currentNode, A while (!element.isEmpty()) { if (currentNode.isValid()) { - if (element == "parent") { + if (element == QLatin1String("parent")) { if (currentNode.hasParentProperty()) currentNode = currentNode.parentProperty().toNodeAbstractProperty().parentModelNode(); else @@ -200,7 +200,7 @@ bool BindingProperty::isAliasExport() const return parentModelNode() == parentModelNode().view()->rootModelNode() && isDynamic() && dynamicTypeName() == "alias" - && name() == expression() + && name() == expression().toUtf8() && parentModelNode().view()->modelNodeForId(expression()).isValid(); } diff --git a/src/plugins/qmldesigner/designercore/model/internalbindingproperty.h b/src/plugins/qmldesigner/designercore/model/internalbindingproperty.h index 56ab2c5bd8..5cb82205fa 100644 --- a/src/plugins/qmldesigner/designercore/model/internalbindingproperty.h +++ b/src/plugins/qmldesigner/designercore/model/internalbindingproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INTERNALBINDINGPROPERTY_H -#define INTERNALBINDINGPROPERTY_H +#pragma once #include "internalproperty.h" @@ -57,5 +56,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // INTERNALBINDINGPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/model/internalnode_p.h b/src/plugins/qmldesigner/designercore/model/internalnode_p.h index 2e9ff3dcdf..f34cf6c03e 100644 --- a/src/plugins/qmldesigner/designercore/model/internalnode_p.h +++ b/src/plugins/qmldesigner/designercore/model/internalnode_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INTERNALNODE_H -#define INTERNALNODE_H +#pragma once #include <QMap> #include <QHash> @@ -158,5 +157,3 @@ uint qHash(const InternalNodePointer& node); bool operator <(const InternalNodePointer &firstNode, const InternalNodePointer &secondNode); } // Internal } // QtQmlDesigner - -#endif // INTERNALNODE_H diff --git a/src/plugins/qmldesigner/designercore/model/internalnodeabstractproperty.h b/src/plugins/qmldesigner/designercore/model/internalnodeabstractproperty.h index 0be05f5a22..0ea7d49eff 100644 --- a/src/plugins/qmldesigner/designercore/model/internalnodeabstractproperty.h +++ b/src/plugins/qmldesigner/designercore/model/internalnodeabstractproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INTERNALNODEABSTRACTPROPERTY_H -#define INTERNALNODEABSTRACTPROPERTY_H +#pragma once #include "internalproperty.h" @@ -61,5 +60,3 @@ protected: } // namespace Internal } // namespace QmlDesigner - -#endif // INTERNALNODEABSTRACTPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/model/internalnodelistproperty.h b/src/plugins/qmldesigner/designercore/model/internalnodelistproperty.h index c769219944..d58e44d08c 100644 --- a/src/plugins/qmldesigner/designercore/model/internalnodelistproperty.h +++ b/src/plugins/qmldesigner/designercore/model/internalnodelistproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INTERNALNODELISTPROPERTY_H -#define INTERNALNODELISTPROPERTY_H +#pragma once #include "internalnodeabstractproperty.h" @@ -66,5 +65,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // INTERNALNODELISTPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/model/internalnodeproperty.h b/src/plugins/qmldesigner/designercore/model/internalnodeproperty.h index 9e37ad5d3a..7da520b011 100644 --- a/src/plugins/qmldesigner/designercore/model/internalnodeproperty.h +++ b/src/plugins/qmldesigner/designercore/model/internalnodeproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INTERNALNODEPROPERTY_H -#define INTERNALNODEPROPERTY_H +#pragma once #include "internalnodeabstractproperty.h" @@ -61,5 +60,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // INTERNALNODEPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/model/internalproperty.h b/src/plugins/qmldesigner/designercore/model/internalproperty.h index 9ad33f2b17..df6896bf9a 100644 --- a/src/plugins/qmldesigner/designercore/model/internalproperty.h +++ b/src/plugins/qmldesigner/designercore/model/internalproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INTERNALPROPERTY_H -#define INTERNALPROPERTY_H +#pragma once #include "qmldesignercorelib_global.h" @@ -97,5 +96,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // INTERNALPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/model/internalsignalhandlerproperty.h b/src/plugins/qmldesigner/designercore/model/internalsignalhandlerproperty.h index f3aa86a69f..c0875f7e5b 100644 --- a/src/plugins/qmldesigner/designercore/model/internalsignalhandlerproperty.h +++ b/src/plugins/qmldesigner/designercore/model/internalsignalhandlerproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INTERNALSIGNALHANDLERPROPERTY_H -#define INTERNALSIGNALHANDLERPROPERTY_H +#pragma once #include "internalproperty.h" @@ -54,5 +53,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // INTERNALSIGNALHANDLERPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/model/internalvariantproperty.h b/src/plugins/qmldesigner/designercore/model/internalvariantproperty.h index 40af21e5e9..6edfe7a492 100644 --- a/src/plugins/qmldesigner/designercore/model/internalvariantproperty.h +++ b/src/plugins/qmldesigner/designercore/model/internalvariantproperty.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INTERNALVARIANTPROPERTY_H -#define INTERNALVARIANTPROPERTY_H +#pragma once #include "internalproperty.h" @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // INTERNALVARIANTPROPERTY_H diff --git a/src/plugins/qmldesigner/designercore/model/model.cpp b/src/plugins/qmldesigner/designercore/model/model.cpp index 7a5f453812..e1937b4544 100644 --- a/src/plugins/qmldesigner/designercore/model/model.cpp +++ b/src/plugins/qmldesigner/designercore/model/model.cpp @@ -311,16 +311,16 @@ void ModelPrivate::changeNodeId(const InternalNode::Pointer& internalNodePointer } } -void ModelPrivate::checkPropertyName(const QString &propertyName) +void ModelPrivate::checkPropertyName(const PropertyName &propertyName) { if (propertyName.isEmpty()) { Q_ASSERT_X(propertyName.isEmpty(), Q_FUNC_INFO, "empty property name"); throw InvalidPropertyException(__LINE__, __FUNCTION__, __FILE__, "<empty property name>"); } - if (propertyName == QLatin1String("id")) { - Q_ASSERT_X(propertyName != QLatin1String("id"), Q_FUNC_INFO, "cannot add property id"); - throw InvalidPropertyException(__LINE__, __FUNCTION__, __FILE__, propertyName.toUtf8()); + if (propertyName == "id") { + Q_ASSERT_X(propertyName != "id", Q_FUNC_INFO, "cannot add property id"); + throw InvalidPropertyException(__LINE__, __FUNCTION__, __FILE__, propertyName); } } diff --git a/src/plugins/qmldesigner/designercore/model/model_p.h b/src/plugins/qmldesigner/designercore/model/model_p.h index 9a4ae5da64..a8f8eae963 100644 --- a/src/plugins/qmldesigner/designercore/model/model_p.h +++ b/src/plugins/qmldesigner/designercore/model/model_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODEL_P_H -#define MODEL_P_H +#pragma once #include <QList> #include <QPointer> @@ -194,7 +193,7 @@ public: void setDynamicBindingProperty(const InternalNodePointer &internalNodePointer, const PropertyName &name, const TypeName &dynamicPropertyType, const QString &expression); void reparentNode(const InternalNodePointer &internalNodePointer, const PropertyName &name, const InternalNodePointer &internalNodeToBeAppended, bool list = true); void changeNodeOrder(const InternalNodePointer &internalParentNode, const PropertyName &listPropertyName, int from, int to); - void checkPropertyName(const QString &propertyName); + void checkPropertyName(const PropertyName &propertyName); void clearParent(const InternalNodePointer &internalNodePointer); void changeRootNodeType(const TypeName &type, int majorVersion, int minorVersion); void setScriptFunctions(const InternalNodePointer &internalNode, const QStringList &scriptFunctionList); @@ -254,4 +253,3 @@ private: } } -#endif // MODEL_P_H diff --git a/src/plugins/qmldesigner/designercore/model/modelnode.cpp b/src/plugins/qmldesigner/designercore/model/modelnode.cpp index 780eb2cdb7..8af40b27aa 100644 --- a/src/plugins/qmldesigner/designercore/model/modelnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/modelnode.cpp @@ -136,7 +136,7 @@ QString ModelNode::id() const QString ModelNode::validId() { if (id().isEmpty()) - setIdWithRefactoring(view()->generateNewId(QString::fromUtf8(simplifiedTypeName()))); + setIdWithRefactoring(view()->generateNewId(simplifiedTypeName())); return id(); } @@ -236,14 +236,14 @@ int ModelNode::majorVersion() const } /*! \return the short-hand type name of the node. */ -TypeName ModelNode::simplifiedTypeName() const +QString ModelNode::simplifiedTypeName() const { if (!isValid()) { Q_ASSERT_X(isValid(), Q_FUNC_INFO, "model node is invalid"); throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__); } - return type().split('.').last(); + return QString::fromUtf8(type().split('.').last()); } /*! \brief Returns whether the node is valid @@ -584,7 +584,7 @@ void ModelNode::removeProperty(const PropertyName &name) const if (!isValid()) throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__); - model()->d->checkPropertyName(QString::fromUtf8(name)); + model()->d->checkPropertyName(name); if (internalNode()->hasProperty(name)) model()->d->removeProperty(internalNode()->property(name)); diff --git a/src/plugins/qmldesigner/designercore/model/modelnodepositionrecalculator.h b/src/plugins/qmldesigner/designercore/model/modelnodepositionrecalculator.h index 9828132c4c..d71956df3e 100644 --- a/src/plugins/qmldesigner/designercore/model/modelnodepositionrecalculator.h +++ b/src/plugins/qmldesigner/designercore/model/modelnodepositionrecalculator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELNODEPOSITIONRECALCULATOR_H -#define MODELNODEPOSITIONRECALCULATOR_H +#pragma once #include <QMap> #include <QObject> @@ -62,5 +61,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // MODELNODEPOSITIONRECALCULATOR_H diff --git a/src/plugins/qmldesigner/designercore/model/modeltotextmerger.h b/src/plugins/qmldesigner/designercore/model/modeltotextmerger.h index 89abfee724..7405fcbca0 100644 --- a/src/plugins/qmldesigner/designercore/model/modeltotextmerger.h +++ b/src/plugins/qmldesigner/designercore/model/modeltotextmerger.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELTOTEXTMERGER_H -#define MODELTOTEXTMERGER_H +#pragma once #include "qmldesignercorelib_global.h" #include <modelnode.h> @@ -96,5 +95,3 @@ private: } //Internal } //QmlDesigner - -#endif // MODELTOTEXTMERGER_H diff --git a/src/plugins/qmldesigner/designercore/model/qmlanchors.cpp b/src/plugins/qmldesigner/designercore/model/qmlanchors.cpp index ae81fb33b6..4aad77f709 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlanchors.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlanchors.cpp @@ -48,25 +48,25 @@ static PropertyName lineTypeToString(AnchorLineType lineType) } } -static AnchorLineType propertyNameToLineType(const QString & string) +static AnchorLineType propertyNameToLineType(const PropertyName & name) { - if (string == QStringLiteral("left")) + if (name == "left") return AnchorLineLeft; - else if (string == QStringLiteral("top")) + else if (name == "top") return AnchorLineTop; - else if (string == QStringLiteral("right")) + else if (name == "right") return AnchorLineRight; - else if (string == QStringLiteral("bottom")) + else if (name == "bottom") return AnchorLineBottom; - else if (string == QStringLiteral("horizontalCenter")) + else if (name == "horizontalCenter") return AnchorLineHorizontalCenter; - else if (string == QStringLiteral("verticalCenter")) + else if (name == "verticalCenter") return AnchorLineVerticalCenter; - else if (string == QStringLiteral("baseline")) + else if (name == "baseline") return AnchorLineVerticalCenter; - else if (string == QStringLiteral("centerIn")) + else if (name == "centerIn") return AnchorLineCenter; - else if (string == QStringLiteral("fill")) + else if (name == "fill") return AnchorLineFill; return AnchorLineInvalid; @@ -173,9 +173,9 @@ void QmlAnchors::setAnchor(AnchorLineType sourceAnchorLine, ModelNode targetModelNode = targetQmlItemNode.modelNode(); QString targetExpression = targetModelNode.validId(); if (targetQmlItemNode.modelNode() == qmlItemNode().modelNode().parentProperty().parentModelNode()) - targetExpression = "parent"; + targetExpression = QLatin1String("parent"); if (sourceAnchorLine != AnchorLineCenter && sourceAnchorLine != AnchorLineFill) - targetExpression = targetExpression + QLatin1Char('.') + lineTypeToString(targetAnchorLine); + targetExpression = targetExpression + QLatin1Char('.') + QString::fromLatin1(lineTypeToString(targetAnchorLine)); qmlItemNode().modelNode().bindingProperty(propertyName).setExpression(targetExpression); } } @@ -321,15 +321,15 @@ void QmlAnchors::removeAnchor(AnchorLineType sourceAnchorLine) const PropertyName propertyName = anchorPropertyName(sourceAnchorLine); if (qmlItemNode().nodeInstance().hasAnchor("anchors.fill") && (sourceAnchorLine & AnchorLineFill)) { qmlItemNode().modelNode().removeProperty("anchors.fill"); - qmlItemNode().modelNode().bindingProperty("anchors.top").setExpression("parent.top"); - qmlItemNode().modelNode().bindingProperty("anchors.left").setExpression("parent.left"); - qmlItemNode().modelNode().bindingProperty("anchors.bottom").setExpression("parent.bottom"); - qmlItemNode().modelNode().bindingProperty("anchors.right").setExpression("parent.right"); + qmlItemNode().modelNode().bindingProperty("anchors.top").setExpression(QLatin1String("parent.top")); + qmlItemNode().modelNode().bindingProperty("anchors.left").setExpression(QLatin1String("parent.left")); + qmlItemNode().modelNode().bindingProperty("anchors.bottom").setExpression(QLatin1String("parent.bottom")); + qmlItemNode().modelNode().bindingProperty("anchors.right").setExpression(QLatin1String("parent.right")); } else if (qmlItemNode().nodeInstance().hasAnchor("anchors.centerIn") && (sourceAnchorLine & AnchorLineCenter)) { qmlItemNode().modelNode().removeProperty("anchors.centerIn"); - qmlItemNode().modelNode().bindingProperty("anchors.horizontalCenter").setExpression("parent.horizontalCenter"); - qmlItemNode().modelNode().bindingProperty("anchors.verticalCenter").setExpression("parent.verticalCenter"); + qmlItemNode().modelNode().bindingProperty("anchors.horizontalCenter").setExpression(QLatin1String("parent.horizontalCenter")); + qmlItemNode().modelNode().bindingProperty("anchors.verticalCenter").setExpression(QLatin1String("parent.verticalCenter")); } qmlItemNode().modelNode().removeProperty(propertyName); @@ -549,7 +549,7 @@ void QmlAnchors::fill() if (instanceHasAnchors()) removeAnchors(); - qmlItemNode().modelNode().bindingProperty("anchors.fill").setExpression("parent"); + qmlItemNode().modelNode().bindingProperty("anchors.fill").setExpression(QLatin1String("parent")); } void QmlAnchors::centerIn() @@ -557,7 +557,7 @@ void QmlAnchors::centerIn() if (instanceHasAnchors()) removeAnchors(); - qmlItemNode().modelNode().bindingProperty("anchors.centerIn").setExpression("parent"); + qmlItemNode().modelNode().bindingProperty("anchors.centerIn").setExpression(QLatin1String("parent")); } bool QmlAnchors::checkForCycle(AnchorLineType anchorLineTyp, const QmlItemNode &sourceItem) const diff --git a/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp index f86798b1c0..4503650c8d 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp @@ -488,7 +488,7 @@ QList<QmlModelState> QmlModelStateGroup::allStates() const return returnList; } -TypeName QmlItemNode::simplifiedTypeName() const +QString QmlItemNode::simplifiedTypeName() const { return modelNode().simplifiedTypeName(); } diff --git a/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp index f8141796f1..e2df00454c 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp @@ -315,9 +315,9 @@ void QmlObjectNode::ensureAliasExport() if (!isAliasExported()) { modelNode().validId(); - PropertyName modelNodeId = modelNode().id().toUtf8(); ModelNode rootModelNode = view()->rootModelNode(); - rootModelNode.bindingProperty(modelNodeId).setDynamicTypeNameAndExpression("alias", modelNodeId); + rootModelNode.bindingProperty(modelNode().id().toUtf8()). + setDynamicTypeNameAndExpression("alias", modelNode().id()); } } @@ -330,7 +330,7 @@ bool QmlObjectNode::isAliasExported() const Q_ASSERT(rootModelNode.isValid()); if (rootModelNode.hasBindingProperty(modelNodeId) && rootModelNode.bindingProperty(modelNodeId).isDynamic() - && rootModelNode.bindingProperty(modelNodeId).expression().toUtf8() == modelNodeId) + && rootModelNode.bindingProperty(modelNodeId).expression() == modelNode().id()) return true; } diff --git a/src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp b/src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp index 12ecbe274a..c8e5888aea 100644 --- a/src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp @@ -144,7 +144,7 @@ QString QmlTextGenerator::toQml(const AbstractProperty &property, int indentDept QString QmlTextGenerator::toQml(const ModelNode &node, int indentDepth) const { - QString type = node.type(); + QString type = QString::fromLatin1(node.type()); QString url; if (type.contains('.')) { QStringList nameComponents = type.split('.'); @@ -232,13 +232,16 @@ QString QmlTextGenerator::propertyToQml(const AbstractProperty &property, int in if (property.isDynamic()) { result = QString(indentDepth, QLatin1Char(' ')) + QStringLiteral("property ") - + property.dynamicTypeName() + + QString::fromUtf8(property.dynamicTypeName()) + QStringLiteral(" ") - + property.name() + + QString::fromUtf8(property.name()) + QStringLiteral(": ") + toQml(property, indentDepth); } else { - result = QString(indentDepth, QLatin1Char(' ')) + property.name() + QStringLiteral(": ") + toQml(property, indentDepth); + result = QString(indentDepth, QLatin1Char(' ')) + + QString::fromUtf8(property.name()) + + QStringLiteral(": ") + + toQml(property, indentDepth); } } diff --git a/src/plugins/qmldesigner/designercore/model/qmltextgenerator.h b/src/plugins/qmldesigner/designercore/model/qmltextgenerator.h index af7deb65d7..5c2823573e 100644 --- a/src/plugins/qmldesigner/designercore/model/qmltextgenerator.h +++ b/src/plugins/qmldesigner/designercore/model/qmltextgenerator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLTEXTGENERATOR_H -#define QMLTEXTGENERATOR_H +#pragma once #include <QString> @@ -60,5 +59,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // QMLTEXTGENERATOR_H diff --git a/src/plugins/qmldesigner/designercore/model/rewriteaction.cpp b/src/plugins/qmldesigner/designercore/model/rewriteaction.cpp index 32266c6d0b..9d620d24cf 100644 --- a/src/plugins/qmldesigner/designercore/model/rewriteaction.cpp +++ b/src/plugins/qmldesigner/designercore/model/rewriteaction.cpp @@ -119,7 +119,7 @@ bool AddPropertyRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePos QString AddPropertyRewriteAction::info() const { - return QStringLiteral("AddPropertyRewriteAction for property \"%1\" (type: %2)").arg(m_property.name(), toString(m_propertyType)); + return QStringLiteral("AddPropertyRewriteAction for property \"%1\" (type: %2)").arg(QString::fromUtf8(m_property.name()), toString(m_propertyType)); } bool ChangeIdRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) @@ -164,7 +164,7 @@ bool ChangeIdRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositi QString ChangeIdRewriteAction::info() const { - return QString("ChangeIdRewriteAction from \"%1\" to \"%2\"").arg(m_oldId, m_newId); + return QString(QStringLiteral("ChangeIdRewriteAction from \"%1\" to \"%2\"")).arg(m_oldId, m_newId); } bool ChangePropertyRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) @@ -209,12 +209,12 @@ bool ChangePropertyRewriteAction::execute(QmlRefactoring &refactoring, ModelNode QString ChangePropertyRewriteAction::info() const { - return QString("ChangePropertyRewriteAction for property \"%1\" (type: %2) of node \"%3\" with value >>%4<< and contained object \"%5\"") - .arg(m_property.name(), + return QString(QStringLiteral("ChangePropertyRewriteAction for property \"%1\" (type: %2) of node \"%3\" with value >>%4<< and contained object \"%5\"")) + .arg(QString::fromUtf8(m_property.name()), toString(m_propertyType), - (m_property.parentModelNode().isValid() ? m_property.parentModelNode().id() : "(invalid)"), - QString(m_valueText).replace('\n', "\\n"), - (m_containedModelNode.isValid() ? m_containedModelNode.id() : "(none)")); + (m_property.parentModelNode().isValid() ? m_property.parentModelNode().id() : QLatin1String("(invalid)")), + QString(m_valueText).replace(QLatin1Char('\n'), QLatin1String("\\n")), + (m_containedModelNode.isValid() ? m_containedModelNode.id() : QString(QStringLiteral("(none)")))); } bool ChangeTypeRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) @@ -240,7 +240,7 @@ bool ChangeTypeRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePosi QString ChangeTypeRewriteAction::info() const { - return QString("ChangeTypeRewriteAction"); + return QLatin1String("ChangeTypeRewriteAction"); } bool RemoveNodeRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) @@ -258,7 +258,7 @@ bool RemoveNodeRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePosi QString RemoveNodeRewriteAction::info() const { - return QString("RemoveNodeRewriteAction"); + return QLatin1String("RemoveNodeRewriteAction"); } bool RemovePropertyRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) @@ -277,7 +277,7 @@ bool RemovePropertyRewriteAction::execute(QmlRefactoring &refactoring, ModelNode QString RemovePropertyRewriteAction::info() const { - return QStringLiteral("RemovePropertyRewriteAction for property \"%1\"").arg(QLatin1String(m_property.name())); + return QStringLiteral("RemovePropertyRewriteAction for property \"%1\"").arg(QString::fromUtf8(m_property.name())); } bool ReparentNodeRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) @@ -307,12 +307,12 @@ bool ReparentNodeRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePo QString ReparentNodeRewriteAction::info() const { if (m_node.isValid()) - return QString("ReparentNodeRewriteAction for node \"%1\" into property \"%2\" of node \"%3\"") + return QString(QStringLiteral("ReparentNodeRewriteAction for node \"%1\" into property \"%2\" of node \"%3\"")) .arg(m_node.id(), - m_targetProperty.name(), + QString::fromUtf8(m_targetProperty.name()), m_targetProperty.parentModelNode().id()); else - return QString("ReparentNodeRewriteAction for an invalid node"); + return QLatin1String("ReparentNodeRewriteAction for an invalid node"); } bool MoveNodeRewriteAction::execute(QmlRefactoring &refactoring, @@ -339,11 +339,11 @@ QString MoveNodeRewriteAction::info() const { if (m_movingNode.isValid()) { if (m_newTrailingNode.isValid()) - return QString("MoveNodeRewriteAction for node \"%1\" before node \"%2\"").arg(m_movingNode.id(), m_newTrailingNode.id()); + return QString(QStringLiteral("MoveNodeRewriteAction for node \"%1\" before node \"%2\"")).arg(m_movingNode.id(), m_newTrailingNode.id()); else - return QString("MoveNodeRewriteAction for node \"%1\" to the end of its containing property").arg(m_movingNode.id()); + return QString(QStringLiteral("MoveNodeRewriteAction for node \"%1\" to the end of its containing property")).arg(m_movingNode.id()); } else { - return QString("MoveNodeRewriteAction for an invalid node"); + return QString(QStringLiteral("MoveNodeRewriteAction for an invalid node")); } } diff --git a/src/plugins/qmldesigner/designercore/model/rewriteaction.h b/src/plugins/qmldesigner/designercore/model/rewriteaction.h index 58cc56b41e..63cb8db2e7 100644 --- a/src/plugins/qmldesigner/designercore/model/rewriteaction.h +++ b/src/plugins/qmldesigner/designercore/model/rewriteaction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REWRITEACTION_H -#define REWRITEACTION_H +#pragma once #include "abstractproperty.h" #include "modelnodepositionstorage.h" @@ -301,5 +300,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // REWRITEACTION_H diff --git a/src/plugins/qmldesigner/designercore/model/rewriteactioncompressor.h b/src/plugins/qmldesigner/designercore/model/rewriteactioncompressor.h index 461238230c..2702ab0d60 100644 --- a/src/plugins/qmldesigner/designercore/model/rewriteactioncompressor.h +++ b/src/plugins/qmldesigner/designercore/model/rewriteactioncompressor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REWRITEACTIONCOMPRESSOR_H -#define REWRITEACTIONCOMPRESSOR_H +#pragma once #include "rewriteaction.h" @@ -54,5 +53,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // REWRITEACTIONCOMPRESSOR_H diff --git a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp index adb9f806c1..51ffd854eb 100644 --- a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp +++ b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp @@ -296,9 +296,9 @@ void RewriterView::importAdded(const Import &import) if (textToModelMerger()->isActive()) return; - if (import.url() == "Qt") + if (import.url() == QLatin1String("Qt")) foreach (const Import &import, model()->imports()) { - if (import.url() == "QtQuick") + if (import.url() == QLatin1String("QtQuick")) return; //QtQuick magic we do not have to add an import for Qt } @@ -470,7 +470,7 @@ void RewriterView::applyChanges() qDebug() << "Content:" << content; if (!errors().isEmpty()) qDebug() << "Error:" << errors().first().description(); - throw RewritingException(__LINE__, __FUNCTION__, __FILE__, m_rewritingErrorMessage.toUtf8(), content.toUtf8()); + throw RewritingException(__LINE__, __FUNCTION__, __FILE__, qPrintable(m_rewritingErrorMessage), content); } } @@ -611,7 +611,7 @@ bool RewriterView::renameId(const QString& oldId, const QString& newId) if (refactoring && hasAliasExport) { //Keep export alias properties rootModelNode().removeProperty(propertyName); PropertyName newPropertyName = newId.toUtf8(); - rootModelNode().bindingProperty(newPropertyName).setDynamicTypeNameAndExpression("alias", newPropertyName); + rootModelNode().bindingProperty(newPropertyName).setDynamicTypeNameAndExpression("alias", QString::fromUtf8(newPropertyName)); } return refactoring; } diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index 7d7f007a7a..b1750aaede 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -147,7 +147,7 @@ static inline bool isHexDigit(ushort c) static inline QString fixEscapedUnicodeChar(const QString &value) //convert "\u2939" { - if (value.count() == 6 && value.at(0) == '\\' && value.at(1) == 'u' && + if (value.count() == 6 && value.at(0) == QLatin1Char('\\') && value.at(1) == QLatin1Char('u') && isHexDigit(value.at(2).unicode()) && isHexDigit(value.at(3).unicode()) && isHexDigit(value.at(4).unicode()) && isHexDigit(value.at(5).unicode())) { return convertUnicode(value.at(2).unicode(), value.at(3).unicode(), value.at(4).unicode(), value.at(5).unicode()); @@ -169,9 +169,9 @@ static inline bool isSignalPropertyName(const QString &signalName) static inline QVariant cleverConvert(const QString &value) { - if (value == "true") + if (value == QLatin1String("true")) return QVariant(true); - if (value == "false") + if (value == QLatin1String("false")) return QVariant(false); bool flag; int i = value.toInt(&flag); @@ -273,7 +273,7 @@ static bool isComponentType(const QmlDesigner::TypeName &type) return type == "Component" || type == "Qt.Component" || type == "QtQuick.Component" || type == "<cpp>.QQmlComponent"; } -static bool isCustomParserType(const QString &type) +static bool isCustomParserType(const QmlDesigner::TypeName &type) { return type == "QtQuick.VisualItemModel" || type == "Qt.VisualItemModel" || type == "QtQuick.VisualDataModel" || type == "Qt.VisualDataModel" || @@ -307,7 +307,7 @@ static inline QString extractComponentFromQml(const QString &source) return QString(); QString result; - if (source.contains("Component")) { //explicit component + if (source.contains(QLatin1String("Component"))) { //explicit component QmlDesigner::FirstDefinitionFinder firstDefinitionFinder(source); int offset = firstDefinitionFinder(0); if (offset < 0) @@ -1100,7 +1100,7 @@ void TextToModelMerger::syncNode(ModelNode &modelNode, const TypeName &astType = property->memberType.toUtf8(); AbstractProperty modelProperty = modelNode.property(astName.toUtf8()); if (!property->statement || isLiteralValue(property->statement)) { - const QVariant variantValue = convertDynamicPropertyValueToVariant(astValue, astType); + const QVariant variantValue = convertDynamicPropertyValueToVariant(astValue, QString::fromLatin1(astType)); syncVariantProperty(modelProperty, variantValue, astType, differenceHandler); } else { syncExpressionProperty(modelProperty, astValue, astType, differenceHandler); @@ -1196,7 +1196,7 @@ QmlDesigner::PropertyName TextToModelMerger::syncScriptBinding(ModelNode &modelN { QString astPropertyName = toString(script->qualifiedId); if (!prefix.isEmpty()) - astPropertyName.prepend(prefix + QLatin1Char('.')); + astPropertyName.prepend(prefix + '.'); QString astValue; if (script->statement) { @@ -1490,7 +1490,7 @@ QStringList TextToModelMerger::syncGroupedProperties(ModelNode &modelNode, AST::UiObjectMember *member = iter->member; if (AST::UiScriptBinding *script = AST::cast<AST::UiScriptBinding *>(member)) { - const QString prop = syncScriptBinding(modelNode, name, script, context, differenceHandler); + const QString prop = QString::fromLatin1(syncScriptBinding(modelNode, name, script, context, differenceHandler)); if (!prop.isEmpty()) props.append(prop); } diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.h b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.h index cd543879ed..45e225b109 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.h +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTTOMODELMERGER_H -#define TEXTTOMODELMERGER_H +#pragma once #include "qmldesignercorelib_global.h" #include "import.h" @@ -308,5 +307,3 @@ public: } //Internal } //QmlDesigner - -#endif // TEXTTOMODELMERGER_H diff --git a/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginmanager.h b/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginmanager.h index 77108480a0..31d94a17c5 100644 --- a/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginmanager.h +++ b/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WIDGETPLUGINMANAGER_H -#define WIDGETPLUGINMANAGER_H +#pragma once #include <QObject> #include <QList> @@ -70,4 +69,3 @@ private: } // namespace Internal } // namespace QmlDesigner -#endif // WIDGETPLUGINMANAGER_H diff --git a/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.h b/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.h index 5354ae7217..391fe86fe9 100644 --- a/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.h +++ b/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WIDGETPLUGINPATH_H -#define WIDGETPLUGINPATH_H +#pragma once #include <QObject> #include <QPointer> @@ -94,4 +93,3 @@ private: } // namespace Internal } // namespace QmlDesigner -#endif // WIDGETPLUGINPATH_H diff --git a/src/plugins/qmldesigner/designercore/rewritertransaction.h b/src/plugins/qmldesigner/designercore/rewritertransaction.h index b983273258..213b9e5618 100644 --- a/src/plugins/qmldesigner/designercore/rewritertransaction.h +++ b/src/plugins/qmldesigner/designercore/rewritertransaction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REWRITERTRANSACTION_H -#define REWRITERTRANSACTION_H +#pragma once #include <qmldesignercorelib_global.h> @@ -59,5 +58,3 @@ private: }; } //QmlDesigner - -#endif // REWRITERTRANSACTION_H diff --git a/src/plugins/qmldesigner/designersettings.h b/src/plugins/qmldesigner/designersettings.h index cc93e4be55..b5e0b2fd29 100644 --- a/src/plugins/qmldesigner/designersettings.h +++ b/src/plugins/qmldesigner/designersettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNERSETTINGS_H -#define DESIGNERSETTINGS_H +#pragma once #include <QtGlobal> #include <QHash> @@ -74,5 +73,3 @@ private: }; } // namespace QmlDesigner - -#endif // DESIGNERSETTINGS_H diff --git a/src/plugins/qmldesigner/designmodecontext.h b/src/plugins/qmldesigner/designmodecontext.h index da8d545b11..aa89c619f3 100644 --- a/src/plugins/qmldesigner/designmodecontext.h +++ b/src/plugins/qmldesigner/designmodecontext.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNMODECONTEXT_H -#define DESIGNMODECONTEXT_H +#pragma once #include <coreplugin/icontext.h> @@ -57,5 +56,3 @@ public: } } - -#endif // DESIGNMODECONTEXT_H diff --git a/src/plugins/qmldesigner/designmodewidget.cpp b/src/plugins/qmldesigner/designmodewidget.cpp index 38d474626c..f26ca694dc 100644 --- a/src/plugins/qmldesigner/designmodewidget.cpp +++ b/src/plugins/qmldesigner/designmodewidget.cpp @@ -575,7 +575,7 @@ static Core::MiniSplitter *createCentralSplitter(const QList<WidgetInfo> &widget outputPlaceholderSplitter->setStretchFactor(1, 0); outputPlaceholderSplitter->setOrientation(Qt::Vertical); - StyledOutputpanePlaceHolder *outputPanePlaceholder = new StyledOutputpanePlaceHolder(Core::DesignMode::instance(), outputPlaceholderSplitter); + auto outputPanePlaceholder = new StyledOutputpanePlaceHolder(Core::Constants::MODE_DESIGN, outputPlaceholderSplitter); if (centralWidgetInfos.count() == 1) outputPlaceholderSplitter->addWidget(centralWidgetInfos.first().widget); diff --git a/src/plugins/qmldesigner/designmodewidget.h b/src/plugins/qmldesigner/designmodewidget.h index 41d9af758b..f1a68b3a9c 100644 --- a/src/plugins/qmldesigner/designmodewidget.h +++ b/src/plugins/qmldesigner/designmodewidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESIGNMODEWIDGET_H -#define DESIGNMODEWIDGET_H +#pragma once #include <coreplugin/minisplitter.h> #include <utils/faketooltip.h> @@ -158,5 +157,3 @@ private: // variables } // namespace Internal } // namespace Designer - -#endif // DESIGNMODEWIDGET_H diff --git a/src/plugins/qmldesigner/documentmanager.h b/src/plugins/qmldesigner/documentmanager.h index 21e9f5b62f..83d773d75f 100644 --- a/src/plugins/qmldesigner/documentmanager.h +++ b/src/plugins/qmldesigner/documentmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_DOCUMENTMANAGER_H -#define QMLDESIGNER_DOCUMENTMANAGER_H +#pragma once #include <QObject> #include <QList> @@ -71,5 +70,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_DOCUMENTMANAGER_H diff --git a/src/plugins/qmldesigner/qmldesignerconstants.h b/src/plugins/qmldesigner/qmldesignerconstants.h index 0deb1dcaf9..e0e8081d1f 100644 --- a/src/plugins/qmldesigner/qmldesignerconstants.h +++ b/src/plugins/qmldesigner/qmldesignerconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNERCONSTANTS_H -#define QMLDESIGNERCONSTANTS_H +#pragma once namespace QmlDesigner { namespace Constants { @@ -55,5 +54,3 @@ namespace Internal { } // Constants } // QmlDesigner - -#endif //QMLDESIGNERCONSTANTS_H diff --git a/src/plugins/qmldesigner/qmldesignerextension/colortool/colortool.h b/src/plugins/qmldesigner/qmldesignerextension/colortool/colortool.h index 889dfcb928..439971855e 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/colortool/colortool.h +++ b/src/plugins/qmldesigner/qmldesignerextension/colortool/colortool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COLORTOOL_H -#define COLORTOOL_H +#pragma once #include "abstractcustomtool.h" #include "selectionindicator.h" @@ -88,5 +87,3 @@ private: }; } -#endif // COLORTOOL_H - diff --git a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/bindingmodel.cpp b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/bindingmodel.cpp index 58f3a5fd28..25f31da04c 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/bindingmodel.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/bindingmodel.cpp @@ -152,7 +152,7 @@ QStringList BindingModel::possibleTargetProperties(const BindingProperty &bindin QStringList possibleProperties; foreach (const PropertyName &propertyName, metaInfo.propertyNames()) { if (metaInfo.propertyIsWritable(propertyName)) - possibleProperties << QString::fromLatin1(propertyName); + possibleProperties << QString::fromUtf8(propertyName); } return possibleProperties; @@ -189,18 +189,18 @@ QStringList BindingModel::possibleSourceProperties(const BindingProperty &bindin foreach (VariantProperty variantProperty, modelNode.variantProperties()) { if (variantProperty.isDynamic()) - possibleProperties << QString::fromLatin1((variantProperty.name())); + possibleProperties << QString::fromUtf8(variantProperty.name()); } foreach (BindingProperty bindingProperty, modelNode.bindingProperties()) { if (bindingProperty.isDynamic()) - possibleProperties << QString::fromLatin1((bindingProperty.name())); + possibleProperties << QString::fromUtf8((bindingProperty.name())); } if (metaInfo.isValid()) { foreach (const PropertyName &propertyName, metaInfo.propertyNames()) { if (metaInfo.propertyTypeName(propertyName) == typeName) //### todo proper check - possibleProperties << QString::fromLatin1(propertyName); + possibleProperties << QString::fromUtf8(propertyName); } } else { qWarning() << " BindingModel::possibleSourcePropertiesForRow no meta info for source node"; @@ -280,10 +280,10 @@ void BindingModel::addBindingProperty(const BindingProperty &property) QString idLabel = property.parentModelNode().id(); if (idLabel.isEmpty()) - idLabel = QString::fromLatin1(property.parentModelNode().simplifiedTypeName()); + idLabel = property.parentModelNode().simplifiedTypeName(); idItem = new QStandardItem(idLabel); updateCustomData(idItem, property); - targetPropertyNameItem = new QStandardItem(QString::fromLatin1(property.name())); + targetPropertyNameItem = new QStandardItem(QString::fromUtf8(property.name())); QList<QStandardItem*> items; items.append(idItem); @@ -306,7 +306,7 @@ void BindingModel::updateBindingProperty(int rowNumber) BindingProperty bindingProperty = bindingPropertyForRow(rowNumber); if (bindingProperty.isValid()) { - QString targetPropertyName = QString::fromLatin1(bindingProperty.name()); + QString targetPropertyName = QString::fromUtf8(bindingProperty.name()); updateDisplayRole(rowNumber, TargetPropertyNameRow, targetPropertyName); QString sourceNodeName; QString sourcePropertyName; @@ -352,7 +352,7 @@ void BindingModel::updatePropertyName(int rowNumber) { BindingProperty bindingProperty = bindingPropertyForRow(rowNumber); - const PropertyName newName = data(index(rowNumber, TargetPropertyNameRow)).toString().toLatin1(); + const PropertyName newName = data(index(rowNumber, TargetPropertyNameRow)).toString().toUtf8(); const QString expression = bindingProperty.expression(); const PropertyName dynamicPropertyType = bindingProperty.dynamicTypeName(); ModelNode targetNode = bindingProperty.parentModelNode(); diff --git a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/bindingmodel.h b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/bindingmodel.h index 9f1334c33c..51489a60d6 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/bindingmodel.h +++ b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/bindingmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BINDINGMODEL_H -#define BINDINGMODEL_H +#pragma once #include <modelnode.h> #include <nodemetainfo.h> @@ -118,5 +117,3 @@ public: } // namespace Internal } // namespace QmlDesigner - -#endif // BINDINGMODEL_H diff --git a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionmodel.cpp b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionmodel.cpp index d89f8f06f3..1322bf08c5 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionmodel.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionmodel.cpp @@ -60,7 +60,7 @@ QStringList propertyNameListToStringList(const QmlDesigner::PropertyNameList &pr { QStringList stringList; foreach (QmlDesigner::PropertyName propertyName, propertyNameList) { - stringList << QString::fromLatin1(propertyName); + stringList << QString::fromUtf8(propertyName); } return stringList; } @@ -124,7 +124,7 @@ SignalHandlerProperty ConnectionModel::signalHandlerPropertyForRow(int rowNumber ModelNode modelNode = connectionView()->modelNodeForInternalId(internalId); if (modelNode.isValid()) - return modelNode.signalHandlerProperty(targetPropertyName.toLatin1()); + return modelNode.signalHandlerProperty(targetPropertyName.toUtf8()); return SignalHandlerProperty(); } @@ -160,7 +160,7 @@ void ConnectionModel::addSignalHandler(const SignalHandlerProperty &signalHandle targetItem = new QStandardItem(idLabel); updateCustomData(targetItem, signalHandlerProperty); - const QString propertyName = QString::fromLatin1(signalHandlerProperty.name()); + const QString propertyName = QString::fromUtf8(signalHandlerProperty.name()); const QString source = signalHandlerProperty.source(); signalItem = new QStandardItem(propertyName); @@ -210,7 +210,7 @@ void ConnectionModel::updateSignalName(int rowNumber) { SignalHandlerProperty signalHandlerProperty = signalHandlerPropertyForRow(rowNumber); - const PropertyName newName = data(index(rowNumber, TargetPropertyNameRow)).toString().toLatin1(); + const PropertyName newName = data(index(rowNumber, TargetPropertyNameRow)).toString().toUtf8(); const QString source = signalHandlerProperty.source(); ModelNode connectionNode = signalHandlerProperty.parentModelNode(); diff --git a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionmodel.h b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionmodel.h index a4fb4b8a56..016ff66dd5 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionmodel.h +++ b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONNECTIONMODEL_H -#define CONNECTIONMODEL_H +#pragma once #include <modelnode.h> #include <nodemetainfo.h> @@ -119,5 +118,3 @@ public: } // namespace Internal } // namespace QmlDesigner - -#endif // CONNECTIONMODEL_H diff --git a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionview.h b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionview.h index 2b6b1d1535..cb122baf0b 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionview.h +++ b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONNECTIONVIEW_H -#define CONNECTIONVIEW_H +#pragma once #include <abstractview.h> #include <qmlitemnode.h> @@ -92,5 +91,3 @@ private: //variables } // namespace Internal } // namespace QmlDesigner - -#endif //CONNECTIONVIEW_H diff --git a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionviewwidget.h b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionviewwidget.h index 2fbb107e1c..fa5a88bbc4 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionviewwidget.h +++ b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionviewwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONNECTIONVIEWWIDGET_H -#define CONNECTIONVIEWWIDGET_H +#pragma once #include <QFrame> #include <QAbstractItemView> @@ -99,5 +98,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // CONNECTIONVIEWWIDGET_H diff --git a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/dynamicpropertiesmodel.cpp b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/dynamicpropertiesmodel.cpp index f7e5ac3609..e5a74b49ec 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/dynamicpropertiesmodel.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/dynamicpropertiesmodel.cpp @@ -74,7 +74,7 @@ QString idOrTypeNameForNode(const QmlDesigner::ModelNode &modelNode) { QString idLabel = modelNode.id(); if (idLabel.isEmpty()) - idLabel = QString::fromLatin1(modelNode.simplifiedTypeName()); + idLabel = modelNode.simplifiedTypeName(); return idLabel; } @@ -85,7 +85,7 @@ QmlDesigner::PropertyName unusedProperty(const QmlDesigner::ModelNode &modelNode int i = 0; if (modelNode.metaInfo().isValid()) { while (true) { - const QmlDesigner::PropertyName currentPropertyName = QString(QString::fromLatin1(propertyName) + QString::number(i)).toLatin1(); + const QmlDesigner::PropertyName currentPropertyName = propertyName + QString::number(i).toLatin1(); if (!modelNode.hasProperty(currentPropertyName) && !modelNode.metaInfo().hasProperty(currentPropertyName)) return currentPropertyName; i++; @@ -228,7 +228,7 @@ BindingProperty DynamicPropertiesModel::bindingPropertyForRow(int rowNumber) con ModelNode modelNode = connectionView()->modelNodeForInternalId(internalId); if (modelNode.isValid()) - return modelNode.bindingProperty(targetPropertyName.toLatin1()); + return modelNode.bindingProperty(targetPropertyName.toUtf8()); return BindingProperty(); } @@ -241,7 +241,7 @@ VariantProperty DynamicPropertiesModel::variantPropertyForRow(int rowNumber) con ModelNode modelNode = connectionView()->modelNodeForInternalId(internalId); if (modelNode.isValid()) - return modelNode.variantProperty(targetPropertyName.toLatin1()); + return modelNode.variantProperty(targetPropertyName.toUtf8()); return VariantProperty(); } @@ -261,7 +261,7 @@ QStringList DynamicPropertiesModel::possibleTargetProperties(const BindingProper QStringList possibleProperties; foreach (const PropertyName &propertyName, metaInfo.propertyNames()) { if (metaInfo.propertyIsWritable(propertyName)) - possibleProperties << QString::fromLatin1(propertyName); + possibleProperties << QString::fromUtf8(propertyName); } return possibleProperties; @@ -315,7 +315,7 @@ QStringList DynamicPropertiesModel::possibleSourceProperties(const BindingProper QStringList possibleProperties; foreach (const PropertyName &propertyName, metaInfo.propertyNames()) { if (metaInfo.propertyTypeName(propertyName) == typeName) //### todo proper check - possibleProperties << QString::fromLatin1(propertyName); + possibleProperties << QString::fromUtf8(propertyName); } return possibleProperties; @@ -377,7 +377,7 @@ void DynamicPropertiesModel::addProperty(const QVariant &propertyValue, idItem = new QStandardItem(idOrTypeNameForNode(abstractProperty.parentModelNode())); updateCustomData(idItem, abstractProperty); - propertyNameItem = new QStandardItem(QString::fromLatin1(abstractProperty.name())); + propertyNameItem = new QStandardItem(QString::fromUtf8(abstractProperty.name())); items.append(idItem); items.append(propertyNameItem); @@ -412,10 +412,10 @@ void DynamicPropertiesModel::updateBindingProperty(int rowNumber) BindingProperty bindingProperty = bindingPropertyForRow(rowNumber); if (bindingProperty.isValid()) { - QString propertyName = QString::fromLatin1(bindingProperty.name()); + QString propertyName = QString::fromUtf8(bindingProperty.name()); updateDisplayRole(rowNumber, PropertyNameRow, propertyName); QString value = bindingProperty.expression(); - QString type = QString::fromLatin1(bindingProperty.dynamicTypeName()); + QString type = QString::fromUtf8(bindingProperty.dynamicTypeName()); updateDisplayRole(rowNumber, PropertyTypeRow, type); updateDisplayRole(rowNumber, PropertyValueRow, value); } @@ -426,10 +426,10 @@ void DynamicPropertiesModel::updateVariantProperty(int rowNumber) VariantProperty variantProperty = variantPropertyForRow(rowNumber); if (variantProperty.isValid()) { - QString propertyName = QString::fromLatin1(variantProperty.name()); + QString propertyName = QString::fromUtf8(variantProperty.name()); updateDisplayRole(rowNumber, PropertyNameRow, propertyName); QVariant value = variantProperty.value(); - QString type = QString::fromLatin1(variantProperty.dynamicTypeName()); + QString type = QString::fromUtf8(variantProperty.dynamicTypeName()); updateDisplayRole(rowNumber, PropertyTypeRow, type); updateDisplayRoleFromVariant(rowNumber, PropertyValueRow, value); @@ -489,7 +489,7 @@ void DynamicPropertiesModel::updateValue(int row) void DynamicPropertiesModel::updatePropertyName(int rowNumber) { - const PropertyName newName = data(index(rowNumber, PropertyNameRow)).toString().toLatin1(); + const PropertyName newName = data(index(rowNumber, PropertyNameRow)).toString().toUtf8(); if (newName.isEmpty()) { qWarning() << "DynamicPropertiesModel::updatePropertyName invalid property name"; return; diff --git a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/dynamicpropertiesmodel.h b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/dynamicpropertiesmodel.h index 520985aafd..be0239b4f0 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/dynamicpropertiesmodel.h +++ b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/dynamicpropertiesmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DYNCAMICPROPERTIESMODEL_H -#define DYNCAMICPROPERTIESMODEL_H +#pragma once #include <modelnode.h> #include <nodemetainfo.h> @@ -130,7 +129,4 @@ public: }; } // namespace Internal - } // namespace QmlDesigner - -#endif // DYNCAMICPROPERTIESMODEL_Hs diff --git a/src/plugins/qmldesigner/qmldesignerextension/pathtool/controlpoint.h b/src/plugins/qmldesigner/qmldesignerextension/pathtool/controlpoint.h index fea74bdb5b..39dc184978 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/pathtool/controlpoint.h +++ b/src/plugins/qmldesigner/qmldesignerextension/pathtool/controlpoint.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_CONTROLPOINT_H -#define QMLDESIGNER_CONTROLPOINT_H +#pragma once #include <modelnode.h> @@ -92,5 +91,3 @@ bool operator ==(const ControlPoint& firstControlPoint, const ControlPoint& seco QDebug operator<<(QDebug debug, const ControlPoint &controlPoint); } // namespace QmlDesigner - -#endif // QMLDESIGNER_CONTROLPOINT_H diff --git a/src/plugins/qmldesigner/qmldesignerextension/pathtool/cubicsegment.h b/src/plugins/qmldesigner/qmldesignerextension/pathtool/cubicsegment.h index 7b8d0e8cd1..260dcd2a6d 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/pathtool/cubicsegment.h +++ b/src/plugins/qmldesigner/qmldesignerextension/pathtool/cubicsegment.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_CUBICSEGMENT_H -#define QMLDESIGNER_CUBICSEGMENT_H +#pragma once #include "controlpoint.h" @@ -126,5 +125,3 @@ bool operator ==(const CubicSegment& firstCubicSegment, const CubicSegment& seco QDebug operator<<(QDebug debug, const CubicSegment &cubicSegment); } // namespace QmlDesigner - -#endif // QMLDESIGNER_CUBICSEGMENT_H diff --git a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathitem.h b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathitem.h index f32a0162d7..d431262b39 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathitem.h +++ b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PATHITEM_H -#define PATHITEM_H +#pragma once #include <QGraphicsObject> #include <QWeakPointer> @@ -139,5 +138,3 @@ inline int PathItem::type() const return Type; } } - -#endif // PATHITEM_H diff --git a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathselectionmanipulator.h b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathselectionmanipulator.h index 6be7adb9a5..def0148367 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathselectionmanipulator.h +++ b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathselectionmanipulator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_PATHSELECTIONMANIPULATOR_H -#define QMLDESIGNER_PATHSELECTIONMANIPULATOR_H +#pragma once #include <QList> #include <QPair> @@ -99,5 +98,3 @@ private: bool operator ==(const SelectionPoint& firstSelectionPoint, const SelectionPoint& secondSelectionPoint); } // namespace QmlDesigner - -#endif // QMLDESIGNER_PATHSELECTIONMANIPULATOR_H diff --git a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtool.h b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtool.h index 260425282f..281577fff0 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtool.h +++ b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PATHTOOL_H -#define PATHTOOL_H +#pragma once #include "abstractcustomtool.h" #include "selectionindicator.h" @@ -90,5 +89,3 @@ private: }; } -#endif // PATHTOOL_H - diff --git a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtoolview.h b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtoolview.h index 860789cd68..46b688923e 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtoolview.h +++ b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtoolview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_PATHTOOLVIEW_H -#define QMLDESIGNER_PATHTOOLVIEW_H +#pragma once #include <abstractview.h> @@ -46,5 +45,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_PATHTOOLVIEW_H diff --git a/src/plugins/qmldesigner/qmldesignerextension/qmldesignerextension_global.h b/src/plugins/qmldesigner/qmldesignerextension/qmldesignerextension_global.h index 00d06e2b6a..82ed1b076c 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/qmldesignerextension_global.h +++ b/src/plugins/qmldesigner/qmldesignerextension/qmldesignerextension_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNEREXTENSION_GLOBAL_H -#define QMLDESIGNEREXTENSION_GLOBAL_H +#pragma once #include <QtGlobal> @@ -33,6 +32,3 @@ #else # define QMLDESIGNEREXTENSIONSHARED_EXPORT Q_DECL_IMPORT #endif - -#endif // QMLDESIGNEREXTENSION_GLOBAL_H - diff --git a/src/plugins/qmldesigner/qmldesignerextension/qmldesignerextensionconstants.h b/src/plugins/qmldesigner/qmldesignerextension/qmldesignerextensionconstants.h index 4a32df0bc4..9bf41a2f54 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/qmldesignerextensionconstants.h +++ b/src/plugins/qmldesigner/qmldesignerextension/qmldesignerextensionconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNEREXTENSIONCONSTANTS_H -#define QMLDESIGNEREXTENSIONCONSTANTS_H +#pragma once namespace QmlDesignerExtension { namespace Constants { @@ -34,6 +33,3 @@ const char MENU_ID[] = "QmlDesignerExtension.Menu"; } // namespace QmlDesignerExtension } // namespace Constants - -#endif // QMLDESIGNEREXTENSIONCONSTANTS_H - diff --git a/src/plugins/qmldesigner/qmldesignerextension/sourcetool/sourcetool.h b/src/plugins/qmldesigner/qmldesignerextension/sourcetool/sourcetool.h index 7d6a463a57..0757776d81 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/sourcetool/sourcetool.h +++ b/src/plugins/qmldesigner/qmldesignerextension/sourcetool/sourcetool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SOURCETOOL_H -#define SOURCETOOL_H +#pragma once #include <abstractcustomtool.h> #include "selectionindicator.h" @@ -89,4 +88,3 @@ private: }; } -#endif // SOURCETOOL_H diff --git a/src/plugins/qmldesigner/qmldesignerextension/texttool/texttool.h b/src/plugins/qmldesigner/qmldesignerextension/texttool/texttool.h index abbfb4444b..ba13cdbcce 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/texttool/texttool.h +++ b/src/plugins/qmldesigner/qmldesignerextension/texttool/texttool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTTOOL_H -#define TEXTTOOL_H +#pragma once #include "abstractcustomtool.h" #include "selectionindicator.h" @@ -86,5 +85,3 @@ private: }; } -#endif // TEXTTOOL_H - diff --git a/src/plugins/qmldesigner/qmldesignericons.h b/src/plugins/qmldesigner/qmldesignericons.h index e226143972..df1e1ca810 100644 --- a/src/plugins/qmldesigner/qmldesignericons.h +++ b/src/plugins/qmldesigner/qmldesignericons.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNERICONS_H -#define QMLDESIGNERICONS_H +#pragma once #include <utils/icon.h> @@ -54,5 +53,3 @@ const Utils::Icon RESET({ } // Icons } // QmlDesigner - -#endif // QMLDESIGNERICONS_H diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp index 03d29bac69..473c585520 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.cpp +++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp @@ -81,7 +81,7 @@ QmlDesignerPlugin *QmlDesignerPlugin::m_instance = 0; static bool isInDesignerMode() { - return Core::ModeManager::currentMode() == Core::DesignMode::instance(); + return Core::ModeManager::currentMode() == Core::Constants::MODE_DESIGN; } bool shouldAssertInException() @@ -203,9 +203,8 @@ void QmlDesignerPlugin::createDesignModeWidget() this, SLOT(onTextEditorsClosed(QList<Core::IEditor*>))); - connect(Core::ModeManager::instance(), - SIGNAL(currentModeChanged(Core::IMode*,Core::IMode*)), - SLOT(onCurrentModeChanged(Core::IMode*,Core::IMode*))); + connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged, + this, &QmlDesignerPlugin::onCurrentModeChanged); } @@ -392,21 +391,21 @@ void QmlDesignerPlugin::onCurrentEditorChanged(Core::IEditor *editor) } } -static bool isDesignerMode(Core::IMode *mode) +static bool isDesignerMode(Core::Id mode) { - return mode == Core::DesignMode::instance(); + return mode == Core::DesignMode::instance()->id(); } -static bool documentIsAlreadyOpen(DesignDocument *designDocument, Core::IEditor *editor, Core::IMode *newMode) +static bool documentIsAlreadyOpen(DesignDocument *designDocument, Core::IEditor *editor, Core::Id newMode) { return designDocument && editor == designDocument->editor() && isDesignerMode(newMode); } -void QmlDesignerPlugin::onCurrentModeChanged(Core::IMode *newMode, Core::IMode *oldMode) +void QmlDesignerPlugin::onCurrentModeChanged(Core::Id newMode, Core::Id oldMode) { if (data && Core::EditorManager::currentEditor() @@ -492,11 +491,11 @@ const DesignerActionManager &QmlDesignerPlugin::designerActionManager() const void QmlDesignerPlugin::switchTextDesign() { - if (Core::ModeManager::currentMode()->id() == Core::Constants::MODE_EDIT) { + if (Core::ModeManager::currentMode() == Core::Constants::MODE_EDIT) { Core::IEditor *editor = Core::EditorManager::currentEditor(); if (checkIfEditorIsQtQuick(editor)) Core::ModeManager::activateMode(Core::Constants::MODE_DESIGN); - } else if (Core::ModeManager::currentMode()->id() == Core::Constants::MODE_DESIGN) { + } else if (Core::ModeManager::currentMode() == Core::Constants::MODE_DESIGN) { Core::ModeManager::activateMode(Core::Constants::MODE_EDIT); } } diff --git a/src/plugins/qmldesigner/qmldesignerplugin.h b/src/plugins/qmldesigner/qmldesignerplugin.h index 9717d50203..e71f6d355d 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.h +++ b/src/plugins/qmldesigner/qmldesignerplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNERPLUGIN_H -#define QMLDESIGNERPLUGIN_H +#pragma once #include <qmldesigner/designersettings.h> #include <qmldesigner/components/pluginmanager/pluginmanager.h> @@ -45,7 +44,6 @@ QT_END_NAMESPACE namespace Core { class IEditor; - class IMode; } namespace QmlDesigner { @@ -91,7 +89,7 @@ private slots: void switschToTextMode(); void onTextEditorsClosed(QList<Core::IEditor *> editors); void onCurrentEditorChanged(Core::IEditor *editor); - void onCurrentModeChanged(Core::IMode *mode, Core::IMode *oldMode); + void onCurrentModeChanged(Core::Id mode, Core::Id oldMode); private: // functions void createDesignModeWidget(); @@ -113,5 +111,3 @@ private: // variables }; } // namespace QmlDesigner - -#endif // QMLDESIGNERPLUGIN_H diff --git a/src/plugins/qmldesigner/qmldesignerplugin.pro b/src/plugins/qmldesigner/qmldesignerplugin.pro index 273b9e5cd3..f74b5b0e91 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.pro +++ b/src/plugins/qmldesigner/qmldesignerplugin.pro @@ -23,7 +23,6 @@ include(components/importmanager/importmanager.pri) include(qmldesignerextension/qmldesignerextension.pri) include(qmldesignerplugin.pri) -DEFINES -= QT_NO_CAST_FROM_ASCII BUILD_PUPPET_IN_CREATOR_BINPATH = $$(BUILD_PUPPET_IN_CREATOR_BINPATH) !isEmpty(BUILD_PUPPET_IN_CREATOR_BINPATH) { diff --git a/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.h b/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.h index 10ed2066f6..08dc48a450 100644 --- a/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.h +++ b/src/plugins/qmldesigner/qtquickplugin/qtquickplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTQUICKPLUGIN_H -#define QTQUICKPLUGIN_H +#pragma once #include <iwidgetplugin.h> @@ -51,6 +50,3 @@ public: }; } // namespace QmlDesigner - - -#endif // QTQUICKPLUGIN_H diff --git a/src/plugins/qmldesigner/settingspage.h b/src/plugins/qmldesigner/settingspage.h index bcf8c130ab..c33a63b827 100644 --- a/src/plugins/qmldesigner/settingspage.h +++ b/src/plugins/qmldesigner/settingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SETTINGSPAGE_H -#define SETTINGSPAGE_H +#pragma once #include "ui_settingspage.h" @@ -75,5 +74,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // SETTINGSPAGE_H diff --git a/src/plugins/qmldesigner/shortcutmanager.h b/src/plugins/qmldesigner/shortcutmanager.h index fcd723b6ba..226babb987 100644 --- a/src/plugins/qmldesigner/shortcutmanager.h +++ b/src/plugins/qmldesigner/shortcutmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDESIGNER_SHORTCUTMANAGER_H -#define QMLDESIGNER_SHORTCUTMANAGER_H +#pragma once #include <QObject> #include <QAction> @@ -95,5 +94,3 @@ private: }; } // namespace QmlDesigner - -#endif // QMLDESIGNER_SHORTCUTMANAGER_H diff --git a/src/plugins/qmldesigner/styledoutputpaneplaceholder.cpp b/src/plugins/qmldesigner/styledoutputpaneplaceholder.cpp index 3163f271a6..5ea75c8236 100644 --- a/src/plugins/qmldesigner/styledoutputpaneplaceholder.cpp +++ b/src/plugins/qmldesigner/styledoutputpaneplaceholder.cpp @@ -33,7 +33,7 @@ namespace QmlDesigner { namespace Internal { -StyledOutputpanePlaceHolder::StyledOutputpanePlaceHolder(Core::IMode *mode, QSplitter *parent) +StyledOutputpanePlaceHolder::StyledOutputpanePlaceHolder(Core::Id mode, QSplitter *parent) : Core::OutputPanePlaceHolder(mode, parent) { QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/outputpane-style.css"); diff --git a/src/plugins/qmldesigner/styledoutputpaneplaceholder.h b/src/plugins/qmldesigner/styledoutputpaneplaceholder.h index 147b7192be..c55830115d 100644 --- a/src/plugins/qmldesigner/styledoutputpaneplaceholder.h +++ b/src/plugins/qmldesigner/styledoutputpaneplaceholder.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STYLEDOUTPUTPANEPLACEHOLDER_H -#define STYLEDOUTPUTPANEPLACEHOLDER_H +#pragma once #include <coreplugin/outputpane.h> @@ -34,7 +33,7 @@ namespace Internal { class StyledOutputpanePlaceHolder : public Core::OutputPanePlaceHolder { public: - explicit StyledOutputpanePlaceHolder(Core::IMode *mode, QSplitter *parent = 0); + explicit StyledOutputpanePlaceHolder(Core::Id mode, QSplitter *parent = 0); protected: void childEvent(QChildEvent *event) override;; @@ -45,5 +44,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // STYLEDOUTPUTPANEPLACEHOLDER_H diff --git a/src/plugins/qmljseditor/qmlexpressionundercursor.h b/src/plugins/qmljseditor/qmlexpressionundercursor.h index 5694716f17..7aab34ecdf 100644 --- a/src/plugins/qmljseditor/qmlexpressionundercursor.h +++ b/src/plugins/qmljseditor/qmlexpressionundercursor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLEXPRESSIONUNDERCURSOR_H -#define QMLEXPRESSIONUNDERCURSOR_H +#pragma once #include <qmljs/parser/qmljsastfwd_p.h> #include <qmljs/qmljsdocument.h> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace QmlJSEditor - -#endif // QMLEXPRESSIONUNDERCURSOR_H diff --git a/src/plugins/qmljseditor/qmljsautocompleter.cpp b/src/plugins/qmljseditor/qmljsautocompleter.cpp index 3965f6bc80..532760d15e 100644 --- a/src/plugins/qmljseditor/qmljsautocompleter.cpp +++ b/src/plugins/qmljseditor/qmljsautocompleter.cpp @@ -226,7 +226,7 @@ bool AutoCompleter::isInComment(const QTextCursor &cursor) const QString AutoCompleter::insertMatchingBrace(const QTextCursor &cursor, const QString &text, - QChar, + QChar la, int *skippedChars) const { if (text.length() != 1) @@ -235,8 +235,6 @@ QString AutoCompleter::insertMatchingBrace(const QTextCursor &cursor, if (! shouldInsertMatchingText(cursor)) return QString(); - const QChar la = cursor.document()->characterAt(cursor.position()); - const QChar ch = text.at(0); switch (ch.unicode()) { case '\'': diff --git a/src/plugins/qmljseditor/qmljsautocompleter.h b/src/plugins/qmljseditor/qmljsautocompleter.h index 3d23964d1b..701134dbd6 100644 --- a/src/plugins/qmljseditor/qmljsautocompleter.h +++ b/src/plugins/qmljseditor/qmljsautocompleter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSAUTOCOMPLETER_H -#define QMLJSAUTOCOMPLETER_H +#pragma once #include <texteditor/autocompleter.h> @@ -50,5 +49,3 @@ public: } // Internal } // QmlJSEditor - -#endif // QMLJSAUTOCOMPLETER_H diff --git a/src/plugins/qmljseditor/qmljscompletionassist.h b/src/plugins/qmljseditor/qmljscompletionassist.h index 62df082d7f..42dc8d4dd5 100644 --- a/src/plugins/qmljseditor/qmljscompletionassist.h +++ b/src/plugins/qmljseditor/qmljscompletionassist.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSCOMPLETIONASSIST_H -#define QMLJSCOMPLETIONASSIST_H +#pragma once #include "qmljseditor.h" @@ -136,5 +135,3 @@ private: }; } // QmlJSEditor - -#endif // QMLJSCOMPLETIONASSIST_H diff --git a/src/plugins/qmljseditor/qmljscomponentfromobjectdef.h b/src/plugins/qmljseditor/qmljscomponentfromobjectdef.h index c118de3a7e..f8734612e6 100644 --- a/src/plugins/qmljseditor/qmljscomponentfromobjectdef.h +++ b/src/plugins/qmljseditor/qmljscomponentfromobjectdef.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSCOMPONENTFROMOBJECTDEF_H -#define QMLJSCOMPONENTFROMOBJECTDEF_H +#pragma once #include "qmljsquickfix.h" @@ -39,5 +38,3 @@ public: } // namespace Internal } // namespace QmlJSEditor - -#endif // QMLJSCOMPONENTFROMOBJECTDEF_H diff --git a/src/plugins/qmljseditor/qmljscomponentnamedialog.h b/src/plugins/qmljseditor/qmljscomponentnamedialog.h index 0a52f06a38..b7c5a7335f 100644 --- a/src/plugins/qmljseditor/qmljscomponentnamedialog.h +++ b/src/plugins/qmljseditor/qmljscomponentnamedialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSCOMPONENTNAMEDIALOG_H -#define QMLJSCOMPONENTNAMEDIALOG_H +#pragma once #include <QDialog> @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace QmlJSEditor - -#endif // QMLJSCOMPONENTNAMEDIALOG_H diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index c5bcf747d3..b3ae499c2e 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -1036,9 +1036,8 @@ bool QmlJSEditor::isDesignModePreferred() const alwaysPreferDesignMode = true; // stay in design mode if we are there - IMode *mode = ModeManager::currentMode(); - return alwaysPreferDesignMode - || (mode && mode->id() == Core::Constants::MODE_DESIGN); + Id mode = ModeManager::currentMode(); + return alwaysPreferDesignMode || mode == Core::Constants::MODE_DESIGN; } diff --git a/src/plugins/qmljseditor/qmljseditor.h b/src/plugins/qmljseditor/qmljseditor.h index 1b7bd68bef..79d86dbb5a 100644 --- a/src/plugins/qmljseditor/qmljseditor.h +++ b/src/plugins/qmljseditor/qmljseditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSEDITOR_H -#define QMLJSEDITOR_H +#pragma once #include "qmljseditor_global.h" @@ -157,5 +156,3 @@ public: } // namespace Internal } // namespace QmlJSEditor - -#endif // QMLJSEDITOR_H diff --git a/src/plugins/qmljseditor/qmljseditor_global.h b/src/plugins/qmljseditor/qmljseditor_global.h index 0bb8f65d94..bd4a5139dc 100644 --- a/src/plugins/qmljseditor/qmljseditor_global.h +++ b/src/plugins/qmljseditor/qmljseditor_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSEDITOR_GLOBAL_H -#define QMLJSEDITOR_GLOBAL_H +#pragma once #include <QtGlobal> @@ -33,5 +32,3 @@ #else # define QMLJSEDITOR_EXPORT Q_DECL_IMPORT #endif - -#endif // QMLJSEDITOR_GLOBAL_H diff --git a/src/plugins/qmljseditor/qmljseditorconstants.h b/src/plugins/qmljseditor/qmljseditorconstants.h index f7fb506df6..3f22b6e1ef 100644 --- a/src/plugins/qmljseditor/qmljseditorconstants.h +++ b/src/plugins/qmljseditor/qmljseditorconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSEDITOR_CONSTANTS_H -#define QMLJSEDITOR_CONSTANTS_H +#pragma once #include <QtGlobal> @@ -60,5 +59,3 @@ const char QML_UI_FILE_WARNING[] = "QmlJSEditor.QmlUiFileWarning"; } // namespace Constants } // namespace QmlJSEditor - -#endif // QMLJSEDITOR_CONSTANTS_H diff --git a/src/plugins/qmljseditor/qmljseditordocument.h b/src/plugins/qmljseditor/qmljseditordocument.h index 8e22b6e402..05d9e09457 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.h +++ b/src/plugins/qmljseditor/qmljseditordocument.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSEDITORDOCUMENT_H -#define QMLJSEDITORDOCUMENT_H +#pragma once #include "qmljseditor_global.h" @@ -67,5 +66,3 @@ private: }; } // QmlJSEditor - -#endif // QMLJSEDITORDOCUMENT_H diff --git a/src/plugins/qmljseditor/qmljseditordocument_p.h b/src/plugins/qmljseditor/qmljseditordocument_p.h index f6185fcc29..46a6a36c65 100644 --- a/src/plugins/qmljseditor/qmljseditordocument_p.h +++ b/src/plugins/qmljseditor/qmljseditordocument_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSEDITORDOCUMENT_P_H -#define QMLJSEDITORDOCUMENT_P_H +#pragma once #include <qmljs/qmljsdocument.h> #include <qmljstools/qmljssemanticinfo.h> @@ -77,5 +76,3 @@ public: } // Internal } // QmlJSEditor - -#endif // QMLJSEDITORDOCUMENT_P_H diff --git a/src/plugins/qmljseditor/qmljseditorplugin.h b/src/plugins/qmljseditor/qmljseditorplugin.h index 3629f9bb21..e96e59163b 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.h +++ b/src/plugins/qmljseditor/qmljseditorplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSEDITORPLUGIN_H -#define QMLJSEDITORPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> #include <coreplugin/icontext.h> @@ -103,5 +102,3 @@ private: } // namespace Internal } // namespace QmlJSEditor - -#endif // QMLJSEDITORPLUGIN_H diff --git a/src/plugins/qmljseditor/qmljsfindreferences.h b/src/plugins/qmljseditor/qmljsfindreferences.h index 4fddc56bef..2d8cb9aaeb 100644 --- a/src/plugins/qmljseditor/qmljsfindreferences.h +++ b/src/plugins/qmljseditor/qmljsfindreferences.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSFINDREFERENCES_H -#define QMLJSFINDREFERENCES_H +#pragma once #include "qmljseditor_global.h" @@ -92,5 +91,3 @@ private: }; } // namespace QmlJSEditor - -#endif // QMLJSFINDREFERENCES_H diff --git a/src/plugins/qmljseditor/qmljshighlighter.h b/src/plugins/qmljseditor/qmljshighlighter.h index fd17751289..1b221aa181 100644 --- a/src/plugins/qmljseditor/qmljshighlighter.h +++ b/src/plugins/qmljseditor/qmljshighlighter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSHIGHLIGHTER_H -#define QMLJSHIGHLIGHTER_H +#pragma once #include "qmljseditor_global.h" @@ -82,5 +81,3 @@ private: }; } // namespace QmlJSEditor - -#endif // QMLJSHIGHLIGHTER_H diff --git a/src/plugins/qmljseditor/qmljshoverhandler.h b/src/plugins/qmljseditor/qmljshoverhandler.h index 4e54ecfde9..bf82bcd30b 100644 --- a/src/plugins/qmljseditor/qmljshoverhandler.h +++ b/src/plugins/qmljseditor/qmljshoverhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSHOVERHANDLER_H -#define QMLJSHOVERHANDLER_H +#pragma once #include <qmljs/qmljsmodelmanagerinterface.h> #include <texteditor/basehoverhandler.h> @@ -86,5 +85,3 @@ private: } // namespace Internal } // namespace QmlJSEditor - -#endif // QMLJSHOVERHANDLER_H diff --git a/src/plugins/qmljseditor/qmljsoutline.h b/src/plugins/qmljseditor/qmljsoutline.h index b0d5bdf185..fc475ed689 100644 --- a/src/plugins/qmljseditor/qmljsoutline.h +++ b/src/plugins/qmljseditor/qmljsoutline.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSOUTLINE_H -#define QMLJSOUTLINE_H +#pragma once #include "qmljseditor.h" @@ -104,5 +103,3 @@ public: } // namespace Internal } // namespace QmlJSEditor - -#endif // QMLJSOUTLINE_H diff --git a/src/plugins/qmljseditor/qmljsoutlinetreeview.h b/src/plugins/qmljseditor/qmljsoutlinetreeview.h index 22a2878b12..7b651f4c24 100644 --- a/src/plugins/qmljseditor/qmljsoutlinetreeview.h +++ b/src/plugins/qmljseditor/qmljsoutlinetreeview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSOUTLINETREEVIEW_H -#define QMLJSOUTLINETREEVIEW_H +#pragma once #include <utils/navigationtreeview.h> @@ -45,5 +44,3 @@ private slots: } // namespace Internal } // namespace QmlJSEditor - -#endif // QMLJSOUTLINETREEVIEW_H diff --git a/src/plugins/qmljseditor/qmljspreviewrunner.h b/src/plugins/qmljseditor/qmljspreviewrunner.h index 3885e9140c..631311cb96 100644 --- a/src/plugins/qmljseditor/qmljspreviewrunner.h +++ b/src/plugins/qmljseditor/qmljspreviewrunner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSPREVIEWRUNNER_H -#define QMLJSPREVIEWRUNNER_H +#pragma once #include <QObject> @@ -51,6 +50,3 @@ private: } // namespace Internal } // namespace QmlJSEditor - - -#endif // QMLJSPREVIEWRUNNER_H diff --git a/src/plugins/qmljseditor/qmljsquickfix.h b/src/plugins/qmljseditor/qmljsquickfix.h index 5347d3e940..fda4a25a48 100644 --- a/src/plugins/qmljseditor/qmljsquickfix.h +++ b/src/plugins/qmljseditor/qmljsquickfix.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSQUICKFIX_H -#define QMLJSQUICKFIX_H +#pragma once #include "qmljseditor.h" @@ -94,5 +93,3 @@ protected: }; } // namespace QmlJSEditor - -#endif // QMLJSQUICKFIX_H diff --git a/src/plugins/qmljseditor/qmljsquickfixassist.h b/src/plugins/qmljseditor/qmljsquickfixassist.h index 81784c5a74..c606737c55 100644 --- a/src/plugins/qmljseditor/qmljsquickfixassist.h +++ b/src/plugins/qmljseditor/qmljsquickfixassist.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSQUICKFIXASSIST_H -#define QMLJSQUICKFIXASSIST_H +#pragma once #include "qmljseditor.h" @@ -68,5 +67,3 @@ public: } // Internal } // QmlJSEditor - -#endif // QMLJSQUICKFIXASSIST_H diff --git a/src/plugins/qmljseditor/qmljsreuse.h b/src/plugins/qmljseditor/qmljsreuse.h index 3a51f155ce..5c370f8610 100644 --- a/src/plugins/qmljseditor/qmljsreuse.h +++ b/src/plugins/qmljseditor/qmljsreuse.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSREUSE_H -#define QMLJSREUSE_H +#pragma once #include <QtGlobal> #include <QIcon> @@ -46,5 +45,3 @@ QIcon iconForColor(const QColor &color); } // Internal } // QmlJSEditor - -#endif // QMLJSREUSE_H diff --git a/src/plugins/qmljseditor/qmljssemantichighlighter.h b/src/plugins/qmljseditor/qmljssemantichighlighter.h index 2acbc6f9a9..7491e71eed 100644 --- a/src/plugins/qmljseditor/qmljssemantichighlighter.h +++ b/src/plugins/qmljseditor/qmljssemantichighlighter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSSEMANTICHIGHLIGHTER_H -#define QMLJSSEMANTICHIGHLIGHTER_H +#pragma once #include <texteditor/semantichighlighter.h> #include <QFutureWatcher> @@ -98,5 +97,3 @@ private: } // namespace Internal } // namespace QmlJSEditor - -#endif // QMLJSSEMANTICHIGHLIGHTER_H diff --git a/src/plugins/qmljseditor/qmljssemanticinfoupdater.h b/src/plugins/qmljseditor/qmljssemanticinfoupdater.h index 4050145a7b..3d7696f466 100644 --- a/src/plugins/qmljseditor/qmljssemanticinfoupdater.h +++ b/src/plugins/qmljseditor/qmljssemanticinfoupdater.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SEMANTICINFOUPDATER_H -#define SEMANTICINFOUPDATER_H +#pragma once #include "qmljseditor.h" @@ -69,5 +68,3 @@ private: } // namespace Internal } // namespace QmlJSEditor - -#endif // SEMANTICINFOUPDATER_H diff --git a/src/plugins/qmljseditor/qmljssnippetprovider.h b/src/plugins/qmljseditor/qmljssnippetprovider.h index e33c41c0a2..0d0761b928 100644 --- a/src/plugins/qmljseditor/qmljssnippetprovider.h +++ b/src/plugins/qmljseditor/qmljssnippetprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSSNIPPETPROVIDER_H -#define QMLJSSNIPPETPROVIDER_H +#pragma once #include <texteditor/snippets/isnippetprovider.h> @@ -45,5 +44,3 @@ public: } // Internal } // QmlJSEditor - -#endif // QMLJSSNIPPETPROVIDER_H diff --git a/src/plugins/qmljseditor/qmljswrapinloader.h b/src/plugins/qmljseditor/qmljswrapinloader.h index 0cf629e03b..1e792b98fb 100644 --- a/src/plugins/qmljseditor/qmljswrapinloader.h +++ b/src/plugins/qmljseditor/qmljswrapinloader.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSWRAPINLOADER_H -#define QMLJSWRAPINLOADER_H +#pragma once #include "qmljsquickfix.h" @@ -38,5 +37,3 @@ class WrapInLoader: public QmlJSQuickFixFactory } // namespace Internal } // namespace QmlJSEditor - -#endif // QMLJSWRAPINLOADER_H diff --git a/src/plugins/qmljseditor/qmloutlinemodel.h b/src/plugins/qmljseditor/qmloutlinemodel.h index 8c679e6c52..86094c656a 100644 --- a/src/plugins/qmljseditor/qmloutlinemodel.h +++ b/src/plugins/qmljseditor/qmloutlinemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLOUTLINEMODEL_H -#define QMLOUTLINEMODEL_H +#pragma once #include "qmljseditordocument.h" #include <utils/changeset.h> @@ -165,5 +164,3 @@ private: } // namespace Internal } // namespace QmlJSEditor - -#endif // QMLOUTLINEMODEL_H diff --git a/src/plugins/qmljseditor/qmltaskmanager.h b/src/plugins/qmljseditor/qmltaskmanager.h index 5d6674c0bd..9c56e7a93b 100644 --- a/src/plugins/qmljseditor/qmltaskmanager.h +++ b/src/plugins/qmljseditor/qmltaskmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLTASKMANAGER_H -#define QMLTASKMANAGER_H +#pragma once #include <projectexplorer/task.h> #include <qmljs/qmljsdocument.h> @@ -85,5 +84,3 @@ private: } // Internal } // QmlJSEditor - -#endif // QMLTASKMANAGER_H diff --git a/src/plugins/qmljseditor/quicktoolbar.h b/src/plugins/qmljseditor/quicktoolbar.h index 2a7623bac8..df7a5e6514 100644 --- a/src/plugins/qmljseditor/quicktoolbar.h +++ b/src/plugins/qmljseditor/quicktoolbar.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QUICKTOOLBAR_H -#define QUICKTOOLBAR_H +#pragma once #include <qmljs/qmljsicontextpane.h> @@ -70,5 +69,3 @@ private: }; } //QmlDesigner - -#endif // QUICKTOOLBAR_H diff --git a/src/plugins/qmljseditor/quicktoolbarsettingspage.h b/src/plugins/qmljseditor/quicktoolbarsettingspage.h index 13b434e384..db0c5ee99b 100644 --- a/src/plugins/qmljseditor/quicktoolbarsettingspage.h +++ b/src/plugins/qmljseditor/quicktoolbarsettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QUICKTOOLBARSETTINGSPAGE_H -#define QUICKTOOLBARSETTINGSPAGE_H +#pragma once #include "ui_quicktoolbarsettingspage.h" #include <coreplugin/dialogs/ioptionspage.h> @@ -96,5 +95,3 @@ private: } // namespace Internal } // namespace QmlDesigner - -#endif // QUICKTOOLBARSETTINGSPAGE_H diff --git a/src/plugins/qmljstools/qmljsbundleprovider.h b/src/plugins/qmljstools/qmljsbundleprovider.h index c7303a8893..d3b01bbb22 100644 --- a/src/plugins/qmljstools/qmljsbundleprovider.h +++ b/src/plugins/qmljstools/qmljsbundleprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSBUNDLEPROVIDER_H -#define QMLJSBUNDLEPROVIDER_H +#pragma once #include <QObject> #include <QHash> @@ -75,5 +74,3 @@ public: }; } // end QmlJSTools namespace - -#endif // QMLJSBUNDLEPROVIDER_H diff --git a/src/plugins/qmljstools/qmljscodestylepreferencesfactory.h b/src/plugins/qmljstools/qmljscodestylepreferencesfactory.h index f30d832da8..e88ea1ef49 100644 --- a/src/plugins/qmljstools/qmljscodestylepreferencesfactory.h +++ b/src/plugins/qmljstools/qmljscodestylepreferencesfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSCODESTYLEPREFERENCESFACTORY_H -#define QMLJSCODESTYLEPREFERENCESFACTORY_H +#pragma once #include <texteditor/icodestylepreferencesfactory.h> @@ -46,5 +45,3 @@ public: }; } // namespace QmlJSTools - -#endif // QMLJSCODESTYLEPREFERENCESFACTORY_H diff --git a/src/plugins/qmljstools/qmljscodestylesettingspage.h b/src/plugins/qmljstools/qmljscodestylesettingspage.h index 0ed0e3b81a..cae3a9c2b4 100644 --- a/src/plugins/qmljstools/qmljscodestylesettingspage.h +++ b/src/plugins/qmljstools/qmljscodestylesettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSCODESTYLESETTINGSPAGE_H -#define QMLJSCODESTYLESETTINGSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> #include <QWidget> @@ -86,5 +85,3 @@ private: } // namespace Internal } // namespace CppTools - -#endif // QMLJSCODESTYLESETTINGSPAGE_H diff --git a/src/plugins/qmljstools/qmljsfunctionfilter.h b/src/plugins/qmljstools/qmljsfunctionfilter.h index 39041359fd..503343ea4a 100644 --- a/src/plugins/qmljstools/qmljsfunctionfilter.h +++ b/src/plugins/qmljstools/qmljsfunctionfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSFUNCTIONFILTER_H -#define QMLJSFUNCTIONFILTER_H +#pragma once #include <coreplugin/locator/ilocatorfilter.h> @@ -51,5 +50,3 @@ private: } // namespace Internal } // namespace QmlJSTools - -#endif // QMLJSFUNCTIONFILTER_H diff --git a/src/plugins/qmljstools/qmljsindenter.h b/src/plugins/qmljstools/qmljsindenter.h index 3a7ced9fd0..fb3f30c74f 100644 --- a/src/plugins/qmljstools/qmljsindenter.h +++ b/src/plugins/qmljstools/qmljsindenter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSINDENTER_H -#define QMLJSINDENTER_H +#pragma once #include "qmljstools_global.h" @@ -51,5 +50,3 @@ public: } // Internal } // QmlJSEditor - -#endif // QMLJSINDENTER_H diff --git a/src/plugins/qmljstools/qmljsinterpreter.h b/src/plugins/qmljstools/qmljsinterpreter.h index 2bfccb46ae..b3d1f8c717 100644 --- a/src/plugins/qmljstools/qmljsinterpreter.h +++ b/src/plugins/qmljstools/qmljsinterpreter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSINTERPRETER_H -#define QMLJSINTERPRETER_H +#pragma once #include <qmljs/parser/qmljslexer_p.h> #include <qmljs/parser/qmljsengine_p.h> @@ -55,5 +54,3 @@ private: } // namespace Internal } // namespace QmlJSTools - -#endif // QMLJSINTERPRETER_H diff --git a/src/plugins/qmljstools/qmljslocatordata.h b/src/plugins/qmljstools/qmljslocatordata.h index b24e4536e3..39b728d6f1 100644 --- a/src/plugins/qmljstools/qmljslocatordata.h +++ b/src/plugins/qmljstools/qmljslocatordata.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSLOCATORDATA_H -#define QMLJSLOCATORDATA_H +#pragma once #include <qmljs/qmljsdocument.h> @@ -72,5 +71,3 @@ private: } // namespace Internal } // namespace QmlJSTools - -#endif // QMLJSLOCATORDATA_H diff --git a/src/plugins/qmljstools/qmljsmodelmanager.h b/src/plugins/qmljstools/qmljsmodelmanager.h index 40da3f0c5f..6a0e630c1b 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.h +++ b/src/plugins/qmljstools/qmljsmodelmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSMODELMANAGER_H -#define QMLJSMODELMANAGER_H +#pragma once #include "qmljstools_global.h" @@ -68,5 +67,3 @@ private: QMLJSTOOLS_EXPORT void setupProjectInfoQmlBundles(QmlJS::ModelManagerInterface::ProjectInfo &projectInfo); } // namespace QmlJSTools - -#endif // QMLJSMODELMANAGER_H diff --git a/src/plugins/qmljstools/qmljsqtstylecodeformatter.h b/src/plugins/qmljstools/qmljsqtstylecodeformatter.h index 6f4c79a1a9..905c15bbe8 100644 --- a/src/plugins/qmljstools/qmljsqtstylecodeformatter.h +++ b/src/plugins/qmljstools/qmljsqtstylecodeformatter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSQTSTYLECODEFORMATTER_H -#define QMLJSQTSTYLECODEFORMATTER_H +#pragma once #include "qmljstools_global.h" @@ -57,5 +56,3 @@ private: }; } // namespace QmlJSTools - -#endif // QMLJSQTSTYLECODEFORMATTER_H diff --git a/src/plugins/qmljstools/qmljsrefactoringchanges.h b/src/plugins/qmljstools/qmljsrefactoringchanges.h index 330da42b5c..cce8e2d08f 100644 --- a/src/plugins/qmljstools/qmljsrefactoringchanges.h +++ b/src/plugins/qmljstools/qmljsrefactoringchanges.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSREFACTORINGCHANGES_H -#define QMLJSREFACTORINGCHANGES_H +#pragma once #include "qmljstools_global.h" @@ -86,5 +85,3 @@ private: }; } // namespace QmlJSTools - -#endif // QMLJSREFACTORINGCHANGES_H diff --git a/src/plugins/qmljstools/qmljssemanticinfo.h b/src/plugins/qmljstools/qmljssemanticinfo.h index 72f1b3fda4..3ba52b4b7c 100644 --- a/src/plugins/qmljstools/qmljssemanticinfo.h +++ b/src/plugins/qmljstools/qmljssemanticinfo.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSSEMANTICINFO_H -#define QMLJSSEMANTICINFO_H +#pragma once #include "qmljstools_global.h" @@ -101,5 +100,3 @@ private: } // namespace QmlJSTools Q_DECLARE_METATYPE(QmlJSTools::SemanticInfo) - -#endif // QMLJSSEMANTICINFO_H diff --git a/src/plugins/qmljstools/qmljstools_global.h b/src/plugins/qmljstools/qmljstools_global.h index b87409a5ff..4ea360e5fe 100644 --- a/src/plugins/qmljstools/qmljstools_global.h +++ b/src/plugins/qmljstools/qmljstools_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSTOOLS_GLOBAL_H -#define QMLJSTOOLS_GLOBAL_H +#pragma once #include <QtGlobal> @@ -35,5 +34,3 @@ #else # define QMLJSTOOLS_EXPORT Q_DECL_IMPORT #endif - -#endif // QMLJSTOOLS_GLOBAL_H diff --git a/src/plugins/qmljstools/qmljstoolsconstants.h b/src/plugins/qmljstools/qmljstoolsconstants.h index eecdcd075b..777321e81a 100644 --- a/src/plugins/qmljstools/qmljstoolsconstants.h +++ b/src/plugins/qmljstools/qmljstoolsconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSTOOLS_CONSTANTS_H -#define QMLJSTOOLS_CONSTANTS_H +#pragma once #include <QtGlobal> @@ -52,5 +51,3 @@ const char SETTINGS_CATEGORY_QML_ICON[] = ":/qmljstools/images/category_qml.png" } // namespace Constants } // namespace QmlJSTools - -#endif // QMLJSTOOLS_CONSTANTS_H diff --git a/src/plugins/qmljstools/qmljstoolsplugin.h b/src/plugins/qmljstools/qmljstoolsplugin.h index 6e48c9332d..02faedb505 100644 --- a/src/plugins/qmljstools/qmljstoolsplugin.h +++ b/src/plugins/qmljstools/qmljstoolsplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSTOOLS_H -#define QMLJSTOOLS_H +#pragma once #include <coreplugin/id.h> #include <extensionsystem/iplugin.h> @@ -77,5 +76,3 @@ private: } // namespace Internal } // namespace CppTools - -#endif // QMLJSTOOLS_H diff --git a/src/plugins/qmljstools/qmljstoolssettings.h b/src/plugins/qmljstools/qmljstoolssettings.h index e103dcaa4a..4af12eb909 100644 --- a/src/plugins/qmljstools/qmljstoolssettings.h +++ b/src/plugins/qmljstools/qmljstoolssettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLJSTOOLSSETTINGS_H -#define QMLJSTOOLSSETTINGS_H +#pragma once #include "qmljstools_global.h" @@ -49,5 +48,3 @@ public: }; } // namespace QmlJSTools - -#endif // QMLJSTOOLSSETTINGS_H diff --git a/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp b/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp index b79aa79e92..af137adcbf 100644 --- a/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp +++ b/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp @@ -51,16 +51,16 @@ QString LocalQmlProfilerRunner::findFreeSocket() } } -quint16 LocalQmlProfilerRunner::findFreePort(QString &host) +Utils::Port LocalQmlProfilerRunner::findFreePort(QString &host) { QTcpServer server; if (!server.listen(QHostAddress::LocalHost) && !server.listen(QHostAddress::LocalHostIPv6)) { qWarning() << "Cannot open port on host for QML profiling."; - return 0; + return Utils::Port(); } host = server.serverAddress().toString(); - return server.serverPort(); + return Utils::Port(server.serverPort()); } LocalQmlProfilerRunner::LocalQmlProfilerRunner(const Configuration &configuration, @@ -102,9 +102,12 @@ void LocalQmlProfilerRunner::start() runnable.runMode = ApplicationLauncher::Gui; if (QmlProfilerPlugin::debugOutput) { + QString portOrSocket = m_configuration.socket.isEmpty() ? + QString::number(m_configuration.port.isValid() ? + m_configuration.port.number() : -1) : + m_configuration.socket; qWarning("QmlProfiler: Launching %s:%s", qPrintable(m_configuration.debuggee.executable), - qPrintable(m_configuration.socket.isEmpty() ? - QString::number(m_configuration.port) : m_configuration.socket)); + qPrintable(portOrSocket)); } connect(&m_launcher, &ApplicationLauncher::processExited, diff --git a/src/plugins/qmlprofiler/localqmlprofilerrunner.h b/src/plugins/qmlprofiler/localqmlprofilerrunner.h index e156e21812..757f09f8ae 100644 --- a/src/plugins/qmlprofiler/localqmlprofilerrunner.h +++ b/src/plugins/qmlprofiler/localqmlprofilerrunner.h @@ -23,11 +23,11 @@ ** ****************************************************************************/ -#ifndef LOCALQMLPROFILERRUNNER_H -#define LOCALQMLPROFILERRUNNER_H +#pragma once #include "qmlprofiler_global.h" #include <utils/environment.h> +#include <utils/port.h> #include <projectexplorer/applicationlauncher.h> #include <projectexplorer/runnables.h> @@ -41,14 +41,14 @@ class QMLPROFILER_EXPORT LocalQmlProfilerRunner : public QObject public: struct Configuration { ProjectExplorer::StandardRunnable debuggee; - quint16 port; + Utils::Port port; QString socket; }; LocalQmlProfilerRunner(const Configuration &configuration, QmlProfilerRunControl *engine); ~LocalQmlProfilerRunner(); - static quint16 findFreePort(QString &host); + static Utils::Port findFreePort(QString &host); static QString findFreeSocket(); signals: @@ -66,5 +66,3 @@ private: }; } // namespace QmlProfiler - -#endif // LOCALQMLPROFILERRUNNER_H diff --git a/src/plugins/qmlprofiler/qmlprofiler_global.h b/src/plugins/qmlprofiler/qmlprofiler_global.h index b5621fb19d..2da08c0567 100644 --- a/src/plugins/qmlprofiler/qmlprofiler_global.h +++ b/src/plugins/qmlprofiler/qmlprofiler_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILER_GLOBAL_H -#define QMLPROFILER_GLOBAL_H +#pragma once #include <QtGlobal> @@ -33,6 +32,3 @@ #else # define QMLPROFILER_EXPORT Q_DECL_IMPORT #endif - -#endif // QMLPROFILER_GLOBAL_H - diff --git a/src/plugins/qmlprofiler/qmlprofileranimationsmodel.h b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.h index c07d545692..ba0b0f7ece 100644 --- a/src/plugins/qmlprofiler/qmlprofileranimationsmodel.h +++ b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERANIMATIONSMODEL_H -#define QMLPROFILERANIMATIONSMODEL_H +#pragma once #include <QObject> #include "qmlprofilertimelinemodel.h" @@ -83,5 +82,3 @@ private: } } - -#endif // QMLPROFILERANIMATIONSMODEL_H diff --git a/src/plugins/qmlprofiler/qmlprofilerattachdialog.h b/src/plugins/qmlprofiler/qmlprofilerattachdialog.h index 850c029326..c1167d39aa 100644 --- a/src/plugins/qmlprofiler/qmlprofilerattachdialog.h +++ b/src/plugins/qmlprofiler/qmlprofilerattachdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERATTACHDIALOG_H -#define QMLPROFILERATTACHDIALOG_H +#pragma once #include <QDialog> @@ -55,5 +54,3 @@ private: } // namespace Internal } // namespace QmlProfiler - -#endif // QMLPROFILERATTACHDIALOG_H diff --git a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.h b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.h index b547c8ed69..6cf3486aa3 100644 --- a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.h +++ b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERBINDINGLOOPSRENDERPASS_H -#define QMLPROFILERBINDINGLOOPSRENDERPASS_H +#pragma once #include "timeline/timelineabstractrenderer.h" #include "timeline/timelinerenderpass.h" @@ -49,6 +48,3 @@ protected: } } - -#endif // QMLPROFILERBINDINGLOOPSRENDERPASS_H - diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp index 9f9fcc8001..fc04703726 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp @@ -55,7 +55,7 @@ public: QString localSocket; QString tcpHost; - quint64 tcpPort; + Utils::Port tcpPort; QString sysroot; quint32 flushInterval; bool aggregateTraces; @@ -108,7 +108,7 @@ void QmlProfilerClientManager::setAggregateTraces(bool aggregateTraces) d->aggregateTraces = aggregateTraces; } -void QmlProfilerClientManager::setTcpConnection(QString host, quint64 port) +void QmlProfilerClientManager::setTcpConnection(QString host, Utils::Port port) { d->tcpHost = host; d->tcpPort = port; @@ -121,7 +121,7 @@ void QmlProfilerClientManager::setLocalSocket(QString file) { d->localSocket = file; d->tcpHost.clear(); - d->tcpPort = 0; + d->tcpPort = Utils::Port(); disconnectClient(); // We open the server and the application connects to it, so let's do that right away. connectLocalClient(file); @@ -138,7 +138,7 @@ void QmlProfilerClientManager::discardPendingData() clearBufferedData(); } -void QmlProfilerClientManager::connectTcpClient(quint16 port) +void QmlProfilerClientManager::connectTcpClient(Utils::Port port) { if (d->connection) { if (port == d->tcpPort) { @@ -152,7 +152,7 @@ void QmlProfilerClientManager::connectTcpClient(quint16 port) createConnection(); d->connectionTimer.start(); d->tcpPort = port; - d->connection->connectToHost(d->tcpHost, d->tcpPort); + d->connection->connectToHost(d->tcpHost, d->tcpPort.number()); } void QmlProfilerClientManager::connectLocalClient(const QString &file) @@ -274,7 +274,7 @@ void QmlProfilerClientManager::tryToConnect() d->connection = 0; connectTcpClient(d->tcpPort); } else if (!d->connection->isConnecting()) { - d->connection->connectToHost(d->tcpHost, d->tcpPort); + d->connection->connectToHost(d->tcpHost, d->tcpPort.number()); } } else if (d->connectionAttempts == 50) { d->connectionTimer.stop(); diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.h b/src/plugins/qmlprofiler/qmlprofilerclientmanager.h index 349e1d57ae..cc1490b684 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.h +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.h @@ -23,11 +23,11 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERCLIENTMANAGER_H -#define QMLPROFILERCLIENTMANAGER_H +#pragma once #include "qmlprofilerstatemanager.h" #include <qmldebug/qmlprofilereventlocation.h> +#include <utils/port.h> #include <QObject> #include <QStringList> @@ -46,7 +46,7 @@ public: ~QmlProfilerClientManager(); void registerProfilerStateManager(QmlProfilerStateManager *profilerState); - void setTcpConnection(QString host, quint64 port); + void setTcpConnection(QString host, Utils::Port port); void setLocalSocket(QString file); void clearBufferedData(); @@ -64,7 +64,7 @@ signals: void connectionClosed(); public slots: - void connectTcpClient(quint16 port); + void connectTcpClient(Utils::Port port); void connectLocalClient(const QString &file); void disconnectClient(); @@ -97,5 +97,3 @@ private: } } - -#endif // QMLPROFILERCLIENTMANAGER_H diff --git a/src/plugins/qmlprofiler/qmlprofilerconfigwidget.h b/src/plugins/qmlprofiler/qmlprofilerconfigwidget.h index 479900a07b..2f3b0022b7 100644 --- a/src/plugins/qmlprofiler/qmlprofilerconfigwidget.h +++ b/src/plugins/qmlprofiler/qmlprofilerconfigwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERCONFIGWIDGET_H -#define QMLPROFILERCONFIGWIDGET_H +#pragma once #include "qmlprofilersettings.h" #include <QWidget> @@ -55,5 +54,3 @@ private: } // Internal } // QmlProfiler - -#endif // QMLPROFILERCONFIGWIDGET_H diff --git a/src/plugins/qmlprofiler/qmlprofilerconstants.h b/src/plugins/qmlprofiler/qmlprofilerconstants.h index a4fa0fa046..4f48437d69 100644 --- a/src/plugins/qmlprofiler/qmlprofilerconstants.h +++ b/src/plugins/qmlprofiler/qmlprofilerconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERCONSTANTS_H -#define QMLPROFILERCONSTANTS_H +#pragma once namespace QmlProfiler { namespace Constants { @@ -53,5 +52,3 @@ const char QmlProfilerSaveActionId[] = } // namespace Constants } // namespace QmlProfiler - -#endif // QMLPROFILERCONSTANTS_H diff --git a/src/plugins/qmlprofiler/qmlprofilerdatamodel.h b/src/plugins/qmlprofiler/qmlprofilerdatamodel.h index 79521e7473..e3ffa78f50 100644 --- a/src/plugins/qmlprofiler/qmlprofilerdatamodel.h +++ b/src/plugins/qmlprofiler/qmlprofilerdatamodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERDATAMODEL_H -#define QMLPROFILERDATAMODEL_H +#pragma once #include "qmlprofilermodelmanager.h" @@ -237,5 +236,3 @@ private: }; } - -#endif diff --git a/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.h b/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.h index 5269190866..b80c0d8e38 100644 --- a/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.h +++ b/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERDETAILSREWRITER_H -#define QMLPROFILERDETAILSREWRITER_H +#pragma once #include <QObject> @@ -62,5 +61,3 @@ private: } // namespace Internal } // namespace QmlProfiler - -#endif // QMLPROFILERDETAILSREWRITER_H diff --git a/src/plugins/qmlprofiler/qmlprofilereventsview.h b/src/plugins/qmlprofiler/qmlprofilereventsview.h index 13c8143d9d..99efcd50d1 100644 --- a/src/plugins/qmlprofiler/qmlprofilereventsview.h +++ b/src/plugins/qmlprofiler/qmlprofilereventsview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILEREVENTSVIEW_H -#define QMLPROFILEREVENTSVIEW_H +#pragma once #include "qmlprofiler_global.h" #include "qmlprofilermodelmanager.h" @@ -63,5 +62,3 @@ public: }; } - -#endif // QMLPROFILEREVENTSVIEW_H diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h index 0c3574efb9..d0cfd34b24 100644 --- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h +++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERMODELMANAGER_H -#define QMLPROFILERMODELMANAGER_H +#pragma once #include "qmlprofiler_global.h" @@ -145,5 +144,3 @@ private: }; } - -#endif diff --git a/src/plugins/qmlprofiler/qmlprofilernotesmodel.h b/src/plugins/qmlprofiler/qmlprofilernotesmodel.h index d078c3ca07..c5bc56bb85 100644 --- a/src/plugins/qmlprofiler/qmlprofilernotesmodel.h +++ b/src/plugins/qmlprofiler/qmlprofilernotesmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERNOTESMODEL_H -#define QMLPROFILERNOTESMODEL_H +#pragma once #include "qmlprofilermodelmanager.h" #include "timeline/timelinenotesmodel.h" @@ -47,4 +46,3 @@ protected: int add(int typeId, qint64 startTime, qint64 duration, const QString &text); }; } // namespace QmlProfiler -#endif // QMLPROFILERNOTESMODEL_H diff --git a/src/plugins/qmlprofiler/qmlprofileroptionspage.h b/src/plugins/qmlprofiler/qmlprofileroptionspage.h index 61796c6fe9..62aeb68242 100644 --- a/src/plugins/qmlprofiler/qmlprofileroptionspage.h +++ b/src/plugins/qmlprofiler/qmlprofileroptionspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILEROPTIONSPAGE_H -#define QMLPROFILEROPTIONSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> #include <QPointer> @@ -48,5 +47,3 @@ private: } // Internal } // QmlProfiler - -#endif // QMLPROFILEROPTIONSPAGE_H diff --git a/src/plugins/qmlprofiler/qmlprofilerplugin.h b/src/plugins/qmlprofiler/qmlprofilerplugin.h index b7d29997c6..a3e2e147f7 100644 --- a/src/plugins/qmlprofiler/qmlprofilerplugin.h +++ b/src/plugins/qmlprofiler/qmlprofilerplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERPLUGIN_H -#define QMLPROFILERPLUGIN_H +#pragma once #include "qmlprofiler_global.h" #include "qmlprofilertimelinemodelfactory.h" @@ -60,6 +59,3 @@ private: } // namespace Internal } // namespace QmlProfiler - -#endif // QMLPROFILERPLUGIN_H - diff --git a/src/plugins/qmlprofiler/qmlprofilerrangemodel.h b/src/plugins/qmlprofiler/qmlprofilerrangemodel.h index 118047ad44..043f8773c4 100644 --- a/src/plugins/qmlprofiler/qmlprofilerrangemodel.h +++ b/src/plugins/qmlprofiler/qmlprofilerrangemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERRANGEMODEL_H -#define QMLPROFILERRANGEMODEL_H +#pragma once #include "qmlprofilertimelinemodel.h" #include <qmldebug/qmlprofilereventtypes.h> @@ -89,5 +88,3 @@ private: } } - -#endif // QMLPROFILERRANGEMODEL_H diff --git a/src/plugins/qmlprofiler/qmlprofilerrunconfigurationaspect.h b/src/plugins/qmlprofiler/qmlprofilerrunconfigurationaspect.h index 9bec1bc5de..ed6a97c488 100644 --- a/src/plugins/qmlprofiler/qmlprofilerrunconfigurationaspect.h +++ b/src/plugins/qmlprofiler/qmlprofilerrunconfigurationaspect.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERRUNCONFIGURATIONASPECT_H -#define QMLPROFILERRUNCONFIGURATIONASPECT_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -44,5 +43,3 @@ public: } // Internal } // QmlProfiler - -#endif // QMLPROFILERRUNCONFIGURATIONASPECT_H diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp index 2443e2eb38..072597556a 100644 --- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp @@ -86,15 +86,15 @@ QmlProfilerRunControl::QmlProfilerRunControl(RunConfiguration *runConfiguration, d->m_noDebugOutputTimer.setSingleShot(true); d->m_noDebugOutputTimer.setInterval(4000); connect(&d->m_noDebugOutputTimer, &QTimer::timeout, - this, [this](){processIsRunning(0);}); + this, [this](){processIsRunning(Utils::Port());}); d->m_outputParser.setNoOutputText(ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput()); connect(&d->m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort, this, &QmlProfilerRunControl::processIsRunning); connect(&d->m_outputParser, &QmlDebug::QmlOutputParser::noOutputMessage, - this, [this](){processIsRunning(0);}); + this, [this](){processIsRunning(Utils::Port());}); connect(&d->m_outputParser, &QmlDebug::QmlOutputParser::connectingToSocketMessage, - this, [this](){processIsRunning(0);}); + this, [this](){processIsRunning(Utils::Port());}); connect(&d->m_outputParser, &QmlDebug::QmlOutputParser::errorMessage, this, &QmlProfilerRunControl::wrongSetupMessageBox); } @@ -114,7 +114,7 @@ void QmlProfilerRunControl::start() QTC_ASSERT(connection().is<AnalyzerConnection>(), finished(); return); auto conn = connection().as<AnalyzerConnection>(); - if (conn.analyzerPort != 0) + if (conn.analyzerPort.isValid()) emit processRunning(conn.analyzerPort); else if (conn.analyzerSocket.isEmpty()) d->m_noDebugOutputTimer.start(); @@ -236,19 +236,19 @@ void QmlProfilerRunControl::wrongSetupMessageBoxFinished(int button) } } -void QmlProfilerRunControl::notifyRemoteSetupDone(quint16 port) +void QmlProfilerRunControl::notifyRemoteSetupDone(Utils::Port port) { d->m_noDebugOutputTimer.stop(); emit processRunning(port); } -void QmlProfilerRunControl::processIsRunning(quint16 port) +void QmlProfilerRunControl::processIsRunning(Utils::Port port) { d->m_noDebugOutputTimer.stop(); - if (port == 0) + if (!port.isValid()) port = connection().as<AnalyzerConnection>().analyzerPort; - if (port != 0) + if (port.isValid()) emit processRunning(port); } diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.h b/src/plugins/qmlprofiler/qmlprofilerruncontrol.h index a44e6c710a..c859ab3991 100644 --- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.h +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERRUNCONTROL_H -#define QMLPROFILERRUNCONTROL_H +#pragma once #include "qmlprofilerstatemanager.h" @@ -46,7 +45,7 @@ public: void registerProfilerStateManager( QmlProfilerStateManager *profilerState ); - void notifyRemoteSetupDone(quint16 port) override; + void notifyRemoteSetupDone(Utils::Port port) override; void start() override; StopResult stop() override; bool isRunning() const override; @@ -55,12 +54,12 @@ public: void logApplicationMessage(const QString &msg, Utils::OutputFormat format) override; signals: - void processRunning(quint16 port); + void processRunning(Utils::Port port); private: void wrongSetupMessageBox(const QString &errorMessage); void wrongSetupMessageBoxFinished(int); - void processIsRunning(quint16 port); + void processIsRunning(Utils::Port port); void profilerStateChanged(); class QmlProfilerRunControlPrivate; @@ -68,5 +67,3 @@ private: }; } // namespace QmlProfiler - -#endif // QMLPROFILERRUNCONTROL_H diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.h b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.h index af72840db1..5df3936673 100644 --- a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.h +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERRUNCONTROLFACTORY_H -#define QMLPROFILERRUNCONTROLFACTORY_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -51,5 +50,3 @@ public: } // namespace Internal } // namespace QmlProfiler - -#endif // QMLPROFILERRUNCONTROLFACTORY_H diff --git a/src/plugins/qmlprofiler/qmlprofilersettings.h b/src/plugins/qmlprofiler/qmlprofilersettings.h index 1c12b37fa6..b452b3e9b7 100644 --- a/src/plugins/qmlprofiler/qmlprofilersettings.h +++ b/src/plugins/qmlprofiler/qmlprofilersettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERSETTINGS_H -#define QMLPROFILERSETTINGS_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -69,5 +68,3 @@ private: } // Internal } // QmlProfiler - -#endif // QMLPROFILERSETTINGS_H diff --git a/src/plugins/qmlprofiler/qmlprofilerstatemanager.h b/src/plugins/qmlprofiler/qmlprofilerstatemanager.h index 0f577cf9e9..aa860b6b4e 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatemanager.h +++ b/src/plugins/qmlprofiler/qmlprofilerstatemanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERSTATEMANAGER_H -#define QMLPROFILERSTATEMANAGER_H +#pragma once #include <QObject> @@ -72,5 +71,3 @@ private: }; } - -#endif // QMLPROFILERSTATEMANAGER_H diff --git a/src/plugins/qmlprofiler/qmlprofilerstatewidget.h b/src/plugins/qmlprofiler/qmlprofilerstatewidget.h index 5064c70b0d..2f953a2973 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatewidget.h +++ b/src/plugins/qmlprofiler/qmlprofilerstatewidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERSTATEWIDGET_H -#define QMLPROFILERSTATEWIDGET_H +#pragma once #include <QWidget> @@ -57,5 +56,3 @@ private: } } - -#endif // QMLPROFILERSTATEWIDGET_H diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.h b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.h index 36c27da9cd..a709553fca 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.h +++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERSTATISTICSMODEL_H -#define QMLPROFILERSTATISTICSMODEL_H +#pragma once #include "qmlprofilerdatamodel.h" #include "qmlprofilernotesmodel.h" @@ -155,5 +154,3 @@ protected: }; } - -#endif // QMLPROFILERSTATISTICSMODEL_H diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsview.h b/src/plugins/qmlprofiler/qmlprofilerstatisticsview.h index 1d205b7dfd..8c5bedcebd 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatisticsview.h +++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERSTATISTICSVIEW_H -#define QMLPROFILERSTATISTICSVIEW_H +#pragma once #include "qmlprofilermodelmanager.h" #include "qmlprofilerstatisticsmodel.h" @@ -177,5 +176,3 @@ private: } // namespace Internal } // namespace QmlProfiler - -#endif // QMLPROFILERSTATISTICSVIEW_H diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodel.h b/src/plugins/qmlprofiler/qmlprofilertimelinemodel.h index 7e2d4a6f2c..8f4efd4429 100644 --- a/src/plugins/qmlprofiler/qmlprofilertimelinemodel.h +++ b/src/plugins/qmlprofiler/qmlprofilertimelinemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERTIMELINEMODEL_H -#define QMLPROFILERTIMELINEMODEL_H +#pragma once #include "qmlprofiler_global.h" #include "qmlprofilermodelmanager.h" @@ -74,5 +73,3 @@ private: }; } - -#endif // QMLPROFILERTIMELINEMODEL_H diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodelfactory.h b/src/plugins/qmlprofiler/qmlprofilertimelinemodelfactory.h index 8d507e95f8..6087c2d389 100644 --- a/src/plugins/qmlprofiler/qmlprofilertimelinemodelfactory.h +++ b/src/plugins/qmlprofiler/qmlprofilertimelinemodelfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERTIMELINEMODELFACTORY_H -#define QMLPROFILERTIMELINEMODELFACTORY_H +#pragma once #include "qmlprofilertimelinemodel.h" #include "qmlprofilermodelmanager.h" @@ -39,5 +38,3 @@ public: }; } - -#endif // QMLPROFILERTIMELINEMODELFACTORY_H diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 02410623ec..729083aafa 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -493,7 +493,7 @@ void QmlProfilerTool::updateTimeDisplay() void QmlProfilerTool::showTimeLineSearch() { d->m_viewContainer->raiseTimeline(); - Core::FindPlugin::instance()->openFindToolBar(Core::FindPlugin::FindForwardDirection); + Core::Find::openFindToolBar(Core::Find::FindForwardDirection); } void QmlProfilerTool::clearData() @@ -565,7 +565,7 @@ void QmlProfilerTool::startRemoteTool(ProjectExplorer::RunConfiguration *rc) connection.connParams = device->sshParameters(); connection.analyzerHost = device->qmlProfilerHost(); } - connection.analyzerPort = port; + connection.analyzerPort = Utils::Port(port); auto runControl = qobject_cast<QmlProfilerRunControl *>(createRunControl(rc)); runControl->setConnection(connection); diff --git a/src/plugins/qmlprofiler/qmlprofilertool.h b/src/plugins/qmlprofiler/qmlprofilertool.h index 34c7e21505..29ca5beb5f 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.h +++ b/src/plugins/qmlprofiler/qmlprofilertool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERTOOL_H -#define QMLPROFILERTOOL_H +#pragma once #include "qmlprofiler_global.h" #include "qmlprofilerconstants.h" @@ -111,5 +110,3 @@ private: } // namespace Internal } // namespace QmlProfiler - -#endif // QMLPROFILERTOOL_H diff --git a/src/plugins/qmlprofiler/qmlprofilertracefile.h b/src/plugins/qmlprofiler/qmlprofilertracefile.h index f29b04634d..433224d380 100644 --- a/src/plugins/qmlprofiler/qmlprofilertracefile.h +++ b/src/plugins/qmlprofiler/qmlprofilertracefile.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERTRACEFILE_H -#define QMLPROFILERTRACEFILE_H +#pragma once #include <QFutureInterface> #include <QObject> @@ -113,5 +112,3 @@ private: } // namespace Internal } // namespace QmlProfiler - -#endif // QMLPROFILERTRACEFILE_H diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.h b/src/plugins/qmlprofiler/qmlprofilertraceview.h index b7386ba15a..29e7915c20 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.h +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERTRACEVIEW_H -#define QMLPROFILERTRACEVIEW_H +#pragma once #include "qmlprofilermodelmanager.h" @@ -107,6 +106,3 @@ private: } // namespace Internal } // namespace QmlProfiler - -#endif // QMLPROFILERTRACEVIEW_H - diff --git a/src/plugins/qmlprofiler/qmlprofilerviewmanager.h b/src/plugins/qmlprofiler/qmlprofilerviewmanager.h index 191938f7f6..e7b5d9ee94 100644 --- a/src/plugins/qmlprofiler/qmlprofilerviewmanager.h +++ b/src/plugins/qmlprofiler/qmlprofilerviewmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILERVIEWMANAGER_H -#define QMLPROFILERVIEWMANAGER_H +#pragma once #include <QObject> @@ -71,5 +70,3 @@ private: } // namespace Internal } // namespace QmlProfiler - -#endif // QMLPROFILERVIEWMANAGER_H diff --git a/src/plugins/qmlprofilerextension/debugmessagesmodel.h b/src/plugins/qmlprofilerextension/debugmessagesmodel.h index e5934e204d..020b8a17b5 100644 --- a/src/plugins/qmlprofilerextension/debugmessagesmodel.h +++ b/src/plugins/qmlprofilerextension/debugmessagesmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEBUGMESSAGESMODEL_H -#define DEBUGMESSAGESMODEL_H +#pragma once #include "qmlprofiler/qmlprofilertimelinemodel.h" @@ -67,5 +66,3 @@ private: } } - -#endif // DEBUGMESSAGESMODEL_H diff --git a/src/plugins/qmlprofilerextension/flamegraph.h b/src/plugins/qmlprofilerextension/flamegraph.h index 832752c3b8..435a233a78 100644 --- a/src/plugins/qmlprofilerextension/flamegraph.h +++ b/src/plugins/qmlprofilerextension/flamegraph.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FLAMEGRAPH_H -#define FLAMEGRAPH_H +#pragma once #include <QQuickItem> #include <QAbstractItemModel> @@ -156,5 +155,3 @@ private: } QML_DECLARE_TYPEINFO(QmlProfilerExtension::Internal::FlameGraph, QML_HAS_ATTACHED_PROPERTIES) - -#endif // FLAMEGRAPH_H diff --git a/src/plugins/qmlprofilerextension/flamegraphmodel.h b/src/plugins/qmlprofilerextension/flamegraphmodel.h index e3e49b77a1..0063db7f43 100644 --- a/src/plugins/qmlprofilerextension/flamegraphmodel.h +++ b/src/plugins/qmlprofilerextension/flamegraphmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILEREVENTSMODEL_H -#define QMLPROFILEREVENTSMODEL_H +#pragma once #include <qmlprofiler/qmlprofilerdatamodel.h> #include <qmlprofiler/qmlprofilernotesmodel.h> @@ -110,5 +109,3 @@ private: } // namespace Internal } // namespace QmlprofilerExtension - -#endif // QMLPROFILEREVENTSMODEL_H diff --git a/src/plugins/qmlprofilerextension/flamegraphview.h b/src/plugins/qmlprofilerextension/flamegraphview.h index b98b673152..cd91775979 100644 --- a/src/plugins/qmlprofilerextension/flamegraphview.h +++ b/src/plugins/qmlprofilerextension/flamegraphview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FLAMEGRAPHVIEW_H -#define FLAMEGRAPHVIEW_H +#pragma once #include "flamegraphmodel.h" @@ -60,5 +59,3 @@ private: } } - -#endif // FLAMEGRAPHVIEW_H diff --git a/src/plugins/qmlprofilerextension/inputeventsmodel.h b/src/plugins/qmlprofilerextension/inputeventsmodel.h index 72a58642dc..4ee69ffbe6 100644 --- a/src/plugins/qmlprofilerextension/inputeventsmodel.h +++ b/src/plugins/qmlprofilerextension/inputeventsmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INPUTEVENTSMODEL_H -#define INPUTEVENTSMODEL_H +#pragma once #include "qmlprofiler/qmlprofilertimelinemodel.h" @@ -68,4 +67,3 @@ private: } } -#endif // INPUTEVENTSMODEL_H diff --git a/src/plugins/qmlprofilerextension/memoryusagemodel.h b/src/plugins/qmlprofilerextension/memoryusagemodel.h index bf7b557afa..bc945c64f8 100644 --- a/src/plugins/qmlprofilerextension/memoryusagemodel.h +++ b/src/plugins/qmlprofilerextension/memoryusagemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MEMORYUSAGEMODEL_H -#define MEMORYUSAGEMODEL_H +#pragma once #include "qmlprofiler/qmlprofilertimelinemodel.h" #include "qmlprofiler/qmlprofilerdatamodel.h" @@ -81,5 +80,3 @@ private: } // namespace Internal } // namespace QmlProfilerExtension - -#endif // MEMORYUSAGEMODEL_H diff --git a/src/plugins/qmlprofilerextension/pixmapcachemodel.h b/src/plugins/qmlprofilerextension/pixmapcachemodel.h index 4d9fac2763..b5a8dc42c9 100644 --- a/src/plugins/qmlprofilerextension/pixmapcachemodel.h +++ b/src/plugins/qmlprofilerextension/pixmapcachemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PIXMAPCACHEMODEL_H -#define PIXMAPCACHEMODEL_H +#pragma once #include "qmlprofiler/qmlprofilertimelinemodel.h" #include "qmlprofiler/qmlprofilerdatamodel.h" @@ -126,5 +125,3 @@ private: } // namespace Internal } // namespace QmlProfilerExtension - -#endif // PIXMAPCACHEMODEL_H diff --git a/src/plugins/qmlprofilerextension/qmlprofilerextension_global.h b/src/plugins/qmlprofilerextension/qmlprofilerextension_global.h index a8faba9971..e98fdae737 100644 --- a/src/plugins/qmlprofilerextension/qmlprofilerextension_global.h +++ b/src/plugins/qmlprofilerextension/qmlprofilerextension_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILEREXTENSION_GLOBAL_H -#define QMLPROFILEREXTENSION_GLOBAL_H +#pragma once #include <QtGlobal> @@ -33,6 +32,3 @@ #else # define QMLPROFILEREXTENSIONSHARED_EXPORT Q_DECL_IMPORT #endif - -#endif // QMLPROFILEREXTENSION_GLOBAL_H - diff --git a/src/plugins/qmlprofilerextension/qmlprofilerextensionconstants.h b/src/plugins/qmlprofilerextension/qmlprofilerextensionconstants.h index e7c730c9d5..198e8c737b 100644 --- a/src/plugins/qmlprofilerextension/qmlprofilerextensionconstants.h +++ b/src/plugins/qmlprofilerextension/qmlprofilerextensionconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILEREXTENSIONCONSTANTS_H -#define QMLPROFILEREXTENSIONCONSTANTS_H +#pragma once namespace QmlProfilerExtension { namespace Constants { @@ -34,6 +33,3 @@ const char MENU_ID[] = "QmlProfilerExtension.Menu"; } // namespace QmlProfilerExtension } // namespace Constants - -#endif // QMLPROFILEREXTENSIONCONSTANTS_H - diff --git a/src/plugins/qmlprofilerextension/qmlprofilerextensionplugin.h b/src/plugins/qmlprofilerextension/qmlprofilerextensionplugin.h index 63571cde69..45024e033c 100644 --- a/src/plugins/qmlprofilerextension/qmlprofilerextensionplugin.h +++ b/src/plugins/qmlprofilerextension/qmlprofilerextensionplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROFILEREXTENSION_H -#define QMLPROFILEREXTENSION_H +#pragma once #include "qmlprofilerextension_global.h" @@ -52,6 +51,3 @@ private slots: } // namespace Internal } // namespace QmlProfilerExtension - -#endif // QMLPROFILEREXTENSION_H - diff --git a/src/plugins/qmlprofilerextension/scenegraphtimelinemodel.h b/src/plugins/qmlprofilerextension/scenegraphtimelinemodel.h index 59782769dd..6e8aaf8d8e 100644 --- a/src/plugins/qmlprofilerextension/scenegraphtimelinemodel.h +++ b/src/plugins/qmlprofilerextension/scenegraphtimelinemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SCENEGRAPHTIMELINEMODEL_H -#define SCENEGRAPHTIMELINEMODEL_H +#pragma once #include "qmlprofiler/qmlprofilertimelinemodel.h" #include "qmlprofiler/qmlprofilermodelmanager.h" @@ -110,5 +109,3 @@ private: } // namespace Internal } // namespace QmlProfilerExtension - -#endif // SCENEGRAPHTIMELINEMODEL_H diff --git a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.h b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.h index 6a5f439d40..89e41b3834 100644 --- a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.h +++ b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILEFILTERITEMS_H -#define FILEFILTERITEMS_H +#pragma once #include "qmlprojectitem.h" @@ -172,5 +171,3 @@ public: }; } // namespace QmlProjectManager - -#endif // FILEFILTERITEMS_HPROJECTITEM_H diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.h b/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.h index f1cf42ba6d..12a152b125 100644 --- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.h +++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTFILEFORMAT_H -#define QMLPROJECTFILEFORMAT_H +#pragma once #include <utils/fileutils.h> @@ -44,5 +43,3 @@ public: }; } // namespace QmlProjectManager - -#endif // QMLPROJECTFILEFORMAT_H diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h index d114eb75f9..673f4ced48 100644 --- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h +++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTITEM_H -#define QMLPROJECTITEM_H +#pragma once #include <QObject> #include <QSet> @@ -80,5 +79,3 @@ protected: }; } // namespace QmlProjectManager - -#endif // QMLPROJECTITEM_H diff --git a/src/plugins/qmlprojectmanager/qmlproject.h b/src/plugins/qmlprojectmanager/qmlproject.h index 1af818da0d..41fdcff8e0 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.h +++ b/src/plugins/qmlprojectmanager/qmlproject.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECT_H -#define QMLPROJECT_H +#pragma once #include "qmlprojectmanager_global.h" @@ -116,5 +115,3 @@ private: } // namespace QmlProjectManager Q_DECLARE_OPERATORS_FOR_FLAGS(QmlProjectManager::QmlProject::RefreshOptions) - -#endif // QMLPROJECT_H diff --git a/src/plugins/qmlprojectmanager/qmlprojectconstants.h b/src/plugins/qmlprojectmanager/qmlprojectconstants.h index 72ba2dcfc8..bc2d63cf64 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectconstants.h +++ b/src/plugins/qmlprojectmanager/qmlprojectconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTCONSTANTS_H -#define QMLPROJECTCONSTANTS_H +#pragma once #include <qmljstools/qmljstoolsconstants.h> @@ -36,5 +35,3 @@ const char * const QMLPROJECT_MIMETYPE = QmlJSTools::Constants::QMLPROJECT_MIMET } // namespace Constants } // namespace QmlProjectManager - -#endif // QMLPROJECTCONSTANTS_H diff --git a/src/plugins/qmlprojectmanager/qmlprojectenvironmentaspect.h b/src/plugins/qmlprojectmanager/qmlprojectenvironmentaspect.h index 78e34cb789..177d2d89cd 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectenvironmentaspect.h +++ b/src/plugins/qmlprojectmanager/qmlprojectenvironmentaspect.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTENVIRONMENTASPECT_H -#define QMLPROJECTENVIRONMENTASPECT_H +#pragma once #include <projectexplorer/environmentaspect.h> @@ -50,5 +49,3 @@ private: }; } // namespace QmlProjectManager - -#endif // QMLPROJECTENVIRONMENTASPECT_H diff --git a/src/plugins/qmlprojectmanager/qmlprojectfile.h b/src/plugins/qmlprojectmanager/qmlprojectfile.h index bd9077397e..90805fa018 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectfile.h +++ b/src/plugins/qmlprojectmanager/qmlprojectfile.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTFILE_H -#define QMLPROJECTFILE_H +#pragma once #include <coreplugin/idocument.h> @@ -36,7 +35,6 @@ namespace Internal { class QmlProjectFile : public Core::IDocument { - Q_OBJECT public: QmlProjectFile(QmlProject *parent, const Utils::FileName &fileName); @@ -49,5 +47,3 @@ private: } // namespace Internal } // namespace QmlProjectManager - -#endif // QMLPROJECTFILE_H diff --git a/src/plugins/qmlprojectmanager/qmlprojectmanager.h b/src/plugins/qmlprojectmanager/qmlprojectmanager.h index 24be9c12e5..bf42681439 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectmanager.h +++ b/src/plugins/qmlprojectmanager/qmlprojectmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTMANAGER_H -#define QMLPROJECTMANAGER_H +#pragma once #include <projectexplorer/iprojectmanager.h> #include <coreplugin/icontext.h> @@ -42,8 +41,8 @@ class Manager: public ProjectExplorer::IProjectManager public: Manager(); - virtual QString mimeType() const; - virtual ProjectExplorer::Project *openProject(const QString &fileName, QString *errorString); + QString mimeType() const override; + ProjectExplorer::Project *openProject(const QString &fileName, QString *errorString) override; void notifyChanged(const QString &fileName); @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace QmlProjectManager - -#endif // QMLPROJECTMANAGER_H diff --git a/src/plugins/qmlprojectmanager/qmlprojectmanager_global.h b/src/plugins/qmlprojectmanager/qmlprojectmanager_global.h index d69d30ea51..0d30f82da9 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectmanager_global.h +++ b/src/plugins/qmlprojectmanager/qmlprojectmanager_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTMANAGER_GLOBAL_H -#define QMLPROJECTMANAGER_GLOBAL_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define QMLPROJECTMANAGER_EXPORT Q_DECL_IMPORT #endif - -#endif // QMLPROJECTMANAGER_GLOBAL_H diff --git a/src/plugins/qmlprojectmanager/qmlprojectmanagerconstants.h b/src/plugins/qmlprojectmanager/qmlprojectmanagerconstants.h index 0b73aaebee..783a067b74 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectmanagerconstants.h +++ b/src/plugins/qmlprojectmanager/qmlprojectmanagerconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTMANAGERCONSTANTS_H -#define QMLPROJECTMANAGERCONSTANTS_H +#pragma once #include <qglobal.h> @@ -40,5 +39,3 @@ const char USER_ENVIRONMENT_CHANGES_KEY[] = "QmlProjectManager.QmlRunConfigurati } // namespace Constants } // namespace QmlProjectManager - -#endif // QMLPROJECTMANAGERCONSTANTS_H diff --git a/src/plugins/qmlprojectmanager/qmlprojectnodes.h b/src/plugins/qmlprojectmanager/qmlprojectnodes.h index c8239e4d64..6198cd10ea 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectnodes.h +++ b/src/plugins/qmlprojectmanager/qmlprojectnodes.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTNODES_H -#define QMLPROJECTNODES_H +#pragma once #include <projectexplorer/projectnodes.h> @@ -66,5 +65,3 @@ private: } // namespace Internal } // namespace QmlProjectManager - -#endif // QMLPROJECTNODES_H diff --git a/src/plugins/qmlprojectmanager/qmlprojectplugin.h b/src/plugins/qmlprojectmanager/qmlprojectplugin.h index 47a94f6cb1..52065a3b86 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectplugin.h +++ b/src/plugins/qmlprojectmanager/qmlprojectplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTPLUGIN_H -#define QMLPROJECTPLUGIN_H +#pragma once #include "qmlprojectmanager_global.h" @@ -46,5 +45,3 @@ public: }; } // namespace QmlProject - -#endif // QMLPROJECTPLUGIN_H diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h index e271d84fa6..196bdc28e0 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTRUNCONFIGURATION_H -#define QMLPROJECTRUNCONFIGURATION_H +#pragma once #include "qmlprojectmanager_global.h" @@ -113,5 +112,3 @@ private: }; } // namespace QmlProjectManager - -#endif // QMLPROJECTRUNCONFIGURATION_H diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationfactory.h b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationfactory.h index e042060d63..b084341b97 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationfactory.h +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTRUNCONFIGURATIONFACTORY_H -#define QMLPROJECTRUNCONFIGURATIONFACTORY_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -56,6 +55,3 @@ private: } // namespace Internal } // namespace QmlProjectManager - - -#endif // QMLPROJECTRUNCONFIGURATIONFACTORY_H diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.h b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.h index 260b1a405b..efa3528764 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.h +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLPROJECTRUNCONFIGURATIONWIDGET_H -#define QMLPROJECTRUNCONFIGURATIONWIDGET_H +#pragma once #include <QWidget> @@ -59,5 +58,3 @@ private: } // namespace Internal } // namespace QmlProjectManager - -#endif // QMLPROJECTRUNCONFIGURATIONWIDGET_H diff --git a/src/plugins/qnx/pathchooserdelegate.cpp b/src/plugins/qnx/pathchooserdelegate.cpp index 4b99171548..d934e0a88e 100644 --- a/src/plugins/qnx/pathchooserdelegate.cpp +++ b/src/plugins/qnx/pathchooserdelegate.cpp @@ -28,8 +28,8 @@ #include <utils/pathchooser.h> #include <utils/fancylineedit.h> -using namespace Qnx; -using namespace Qnx::Internal; +namespace Qnx { +namespace Internal { PathChooserDelegate::PathChooserDelegate(QObject *parent) : QStyledItemDelegate(parent) @@ -58,7 +58,7 @@ QWidget *PathChooserDelegate::createEditor(QWidget *parent, const QStyleOptionVi editor->setAutoFillBackground(true); // To hide the text beneath the editor widget editor->lineEdit()->setMinimumWidth(0); - connect(editor, SIGNAL(browsingFinished()), this, SLOT(emitCommitData())); + connect(editor, &Utils::PathChooser::browsingFinished, this, &PathChooserDelegate::emitCommitData); return editor; } @@ -101,3 +101,6 @@ void PathChooserDelegate::emitCommitData() { emit commitData(qobject_cast<QWidget*>(sender())); } + +} // namespace Internal +} // namespace Qnx diff --git a/src/plugins/qnx/pathchooserdelegate.h b/src/plugins/qnx/pathchooserdelegate.h index cc2960756b..fca0fe1412 100644 --- a/src/plugins/qnx/pathchooserdelegate.h +++ b/src/plugins/qnx/pathchooserdelegate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_PATHCHOOSERDELEGATE_H -#define QNX_INTERNAL_PATHCHOOSERDELEGATE_H +#pragma once #include <QStyledItemDelegate> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_PATHCHOOSERDELEGATE_H diff --git a/src/plugins/qnx/qnx.pro b/src/plugins/qnx/qnx.pro index d4bfe94e9e..6b36ef7a2c 100644 --- a/src/plugins/qnx/qnx.pro +++ b/src/plugins/qnx/qnx.pro @@ -79,7 +79,7 @@ FORMS += \ qnxdeployqtlibrariesdialog.ui -DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII QNX_LIBRARY +DEFINES += QNX_LIBRARY RESOURCES += \ qnx.qrc diff --git a/src/plugins/qnx/qnx_export.h b/src/plugins/qnx/qnx_export.h index 32c32b8f7e..1fda4c0a29 100644 --- a/src/plugins/qnx/qnx_export.h +++ b/src/plugins/qnx/qnx_export.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_EXPORT_H -#define QNX_EXPORT_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define QNX_EXPORT Q_DECL_IMPORT #endif - -#endif // QNX_EXPORT_H diff --git a/src/plugins/qnx/qnxabstractrunsupport.cpp b/src/plugins/qnx/qnxabstractrunsupport.cpp index 7e2e156983..a7eba6235e 100644 --- a/src/plugins/qnx/qnxabstractrunsupport.cpp +++ b/src/plugins/qnx/qnxabstractrunsupport.cpp @@ -36,8 +36,8 @@ using namespace ProjectExplorer; using namespace RemoteLinux; -using namespace Qnx; -using namespace Qnx::Internal; +namespace Qnx { +namespace Internal { QnxAbstractRunSupport::QnxAbstractRunSupport(QnxRunConfiguration *runConfig, QObject *parent) : QObject(parent) @@ -47,8 +47,10 @@ QnxAbstractRunSupport::QnxAbstractRunSupport(QnxRunConfiguration *runConfig, QOb m_runner = new DeviceApplicationRunner(this); m_portsGatherer = new DeviceUsedPortsGatherer(this); - connect(m_portsGatherer, SIGNAL(error(QString)), SLOT(handleError(QString))); - connect(m_portsGatherer, SIGNAL(portListReady()), SLOT(handlePortListReady())); + connect(m_portsGatherer, &DeviceUsedPortsGatherer::error, + this, &QnxAbstractRunSupport::handleError); + connect(m_portsGatherer, &DeviceUsedPortsGatherer::portListReady, + this, &QnxAbstractRunSupport::handlePortListReady); } void QnxAbstractRunSupport::handleAdapterSetupRequested() @@ -115,12 +117,15 @@ void QnxAbstractRunSupport::handleError(const QString &) { } -bool QnxAbstractRunSupport::setPort(int &port) +bool QnxAbstractRunSupport::setPort(Utils::Port &port) { port = m_portsGatherer->getNextFreePort(&m_portList); - if (port == -1) { + if (!port.isValid()) { handleError(tr("Not enough free ports on device for debugging.")); return false; } return true; } + +} // namespace Internal +} // namespace Qnx diff --git a/src/plugins/qnx/qnxabstractrunsupport.h b/src/plugins/qnx/qnxabstractrunsupport.h index 18658712ff..67cd7f6466 100644 --- a/src/plugins/qnx/qnxabstractrunsupport.h +++ b/src/plugins/qnx/qnxabstractrunsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNXABSTRACTRUNSUPPORT_H -#define QNXABSTRACTRUNSUPPORT_H +#pragma once #include <projectexplorer/devicesupport/idevice.h> #include <utils/environment.h> @@ -57,7 +56,7 @@ public: QnxAbstractRunSupport(QnxRunConfiguration *runConfig, QObject *parent = 0); protected: - bool setPort(int &port); + bool setPort(Utils::Port &port); virtual void startExecution() = 0; void setFinished(); @@ -90,5 +89,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNXABSTRACTRUNSUPPORT_H diff --git a/src/plugins/qnx/qnxanalyzesupport.cpp b/src/plugins/qnx/qnxanalyzesupport.cpp index 289d7d1756..61a6c26391 100644 --- a/src/plugins/qnx/qnxanalyzesupport.cpp +++ b/src/plugins/qnx/qnxanalyzesupport.cpp @@ -97,7 +97,7 @@ void QnxAnalyzeSupport::startExecution() if (state() == Inactive) return; - if (!setPort(m_qmlPort) && m_qmlPort == -1) + if (!setPort(m_qmlPort) && !m_qmlPort.isValid()) return; setState(StartingRemoteProcess); @@ -105,8 +105,8 @@ void QnxAnalyzeSupport::startExecution() StandardRunnable r = m_runnable; if (!r.commandLineArguments.isEmpty()) r.commandLineArguments += QLatin1Char(' '); - r.commandLineArguments - += QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, m_qmlPort); + r.commandLineArguments += QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, + m_qmlPort); appRunner()->start(device(), r); } diff --git a/src/plugins/qnx/qnxanalyzesupport.h b/src/plugins/qnx/qnxanalyzesupport.h index d1361fff3a..19165a1686 100644 --- a/src/plugins/qnx/qnxanalyzesupport.h +++ b/src/plugins/qnx/qnxanalyzesupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNXANALYZESUPPORT_H -#define QNXANALYZESUPPORT_H +#pragma once #include "qnxabstractrunsupport.h" @@ -50,12 +49,12 @@ public slots: void handleProfilingFinished(); private slots: - void handleAdapterSetupRequested(); + void handleAdapterSetupRequested() override; - void handleRemoteProcessFinished(bool success); - void handleProgressReport(const QString &progressOutput); - void handleRemoteOutput(const QByteArray &output); - void handleError(const QString &error); + void handleRemoteProcessFinished(bool success) override; + void handleProgressReport(const QString &progressOutput) override; + void handleRemoteOutput(const QByteArray &output) override; + void handleError(const QString &error) override; void showMessage(const QString &, Utils::OutputFormat); void printMissingWarning(); @@ -63,17 +62,15 @@ private slots: void remoteIsRunning(); private: - void startExecution(); + void startExecution() override; ProjectExplorer::StandardRunnable m_runnable; Debugger::AnalyzerRunControl *m_runControl; QmlDebug::QmlOutputParser m_outputParser; - int m_qmlPort; + Utils::Port m_qmlPort; Slog2InfoRunner *m_slog2Info; }; } // namespace Internal } // namespace Qnx - -#endif // QNXANALYZESUPPORT_H diff --git a/src/plugins/qnx/qnxattachdebugdialog.h b/src/plugins/qnx/qnxattachdebugdialog.h index 4b1bed635a..ef124555ff 100644 --- a/src/plugins/qnx/qnxattachdebugdialog.h +++ b/src/plugins/qnx/qnxattachdebugdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXATTACHDEBUGDIALOG_H -#define QNX_INTERNAL_QNXATTACHDEBUGDIALOG_H +#pragma once #include <projectexplorer/devicesupport/deviceprocessesdialog.h> @@ -50,5 +49,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXATTACHDEBUGDIALOG_H diff --git a/src/plugins/qnx/qnxattachdebugsupport.cpp b/src/plugins/qnx/qnxattachdebugsupport.cpp index 9eea7bf482..87ded8d789 100644 --- a/src/plugins/qnx/qnxattachdebugsupport.cpp +++ b/src/plugins/qnx/qnxattachdebugsupport.cpp @@ -105,14 +105,14 @@ void QnxAttachDebugSupport::launchPDebug() { Utils::PortList portList = m_device->freePorts(); m_pdebugPort = m_portsGatherer->getNextFreePort(&portList); - if (m_pdebugPort == -1) { + if (!m_pdebugPort.isValid()) { handleError(tr("No free ports for debugging.")); return; } StandardRunnable r; r.executable = QLatin1String("pdebug"); - r.commandLineArguments = QString::number(m_pdebugPort); + r.commandLineArguments = QString::number(m_pdebugPort.number()); m_runner->start(m_device, r); } @@ -122,9 +122,11 @@ void QnxAttachDebugSupport::attachToProcess() sp.attachPID = m_process.pid; sp.startMode = Debugger::AttachToRemoteServer; sp.closeMode = Debugger::DetachAtClose; - sp.connParams.port = m_pdebugPort; - sp.remoteChannel = m_device->sshParameters().host + QLatin1Char(':') + QString::number(m_pdebugPort); - sp.displayName = tr("Remote: \"%1:%2\" - Process %3").arg(sp.connParams.host).arg(m_pdebugPort).arg(m_process.pid); + sp.connParams.port = m_pdebugPort.number(); + sp.remoteChannel = m_device->sshParameters().host + QLatin1Char(':') + + QString::number(m_pdebugPort.number()); + sp.displayName = tr("Remote: \"%1:%2\" - Process %3").arg(sp.connParams.host) + .arg(m_pdebugPort.number()).arg(m_process.pid); sp.inferior.executable = m_localExecutablePath; sp.useCtrlCStub = true; diff --git a/src/plugins/qnx/qnxattachdebugsupport.h b/src/plugins/qnx/qnxattachdebugsupport.h index 2044a2d833..3ce4d2fe0a 100644 --- a/src/plugins/qnx/qnxattachdebugsupport.h +++ b/src/plugins/qnx/qnxattachdebugsupport.h @@ -23,12 +23,12 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXATTACHDEBUGSUPPORT_H -#define QNX_INTERNAL_QNXATTACHDEBUGSUPPORT_H +#pragma once #include <debugger/debuggerconstants.h> #include <projectexplorer/devicesupport/deviceprocesslist.h> #include <projectexplorer/devicesupport/idevice.h> +#include <utils/port.h> #include <QObject> @@ -72,12 +72,10 @@ private: ProjectExplorer::DeviceUsedPortsGatherer *m_portsGatherer; Debugger::DebuggerRunControl *m_runControl = 0; - int m_pdebugPort = -1; + Utils::Port m_pdebugPort; QString m_projectSourceDirectory; QString m_localExecutablePath; }; } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXATTACHDEBUGSUPPORT_H diff --git a/src/plugins/qnx/qnxbaseqtconfigwidget.h b/src/plugins/qnx/qnxbaseqtconfigwidget.h index 7c1788dc0b..1dacb1ad39 100644 --- a/src/plugins/qnx/qnxbaseqtconfigwidget.h +++ b/src/plugins/qnx/qnxbaseqtconfigwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXBASEQTCONFIGWIDGET_H -#define QNX_INTERNAL_QNXBASEQTCONFIGWIDGET_H +#pragma once #include <qtsupport/qtconfigwidget.h> @@ -52,5 +51,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXBASEQTCONFIGWIDGET_H diff --git a/src/plugins/qnx/qnxconfiguration.h b/src/plugins/qnx/qnxconfiguration.h index 22836dfb02..5212560394 100644 --- a/src/plugins/qnx/qnxconfiguration.h +++ b/src/plugins/qnx/qnxconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNXCONFIGURATION_H -#define QNXCONFIGURATION_H +#pragma once #include "qnxconstants.h" #include "qnxutils.h" @@ -108,5 +107,3 @@ private: } // Internal } // Qnx - -#endif // QNXCONFIGURATION_H diff --git a/src/plugins/qnx/qnxconfigurationmanager.cpp b/src/plugins/qnx/qnxconfigurationmanager.cpp index d69f1e46c8..207aab9ee9 100644 --- a/src/plugins/qnx/qnxconfigurationmanager.cpp +++ b/src/plugins/qnx/qnxconfigurationmanager.cpp @@ -32,7 +32,6 @@ namespace Qnx { namespace Internal { - const QLatin1String QNXConfigDataKey("QNXConfiguration."); const QLatin1String QNXConfigCountKey("QNXConfiguration.Count"); const QLatin1String QNXConfigsFileVersionKey("Version"); @@ -52,8 +51,8 @@ QnxConfigurationManager::QnxConfigurationManager(QObject *parent) m_writer = new Utils::PersistentSettingsWriter(qnxConfigSettingsFileName(), QLatin1String("QnxConfigurations")); restoreConfigurations(); - connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()), - this, SLOT(saveConfigs())); + connect(Core::ICore::instance(), &Core::ICore::saveSettingsRequested, + this, &QnxConfigurationManager::saveConfigs); } QnxConfigurationManager *QnxConfigurationManager::instance() diff --git a/src/plugins/qnx/qnxconfigurationmanager.h b/src/plugins/qnx/qnxconfigurationmanager.h index 9bbcf774d2..ee8d91624a 100644 --- a/src/plugins/qnx/qnxconfigurationmanager.h +++ b/src/plugins/qnx/qnxconfigurationmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNXCONFIGURATIONMANAGER_H -#define QNXCONFIGURATIONMANAGER_H +#pragma once #include <utils/fileutils.h> @@ -64,5 +63,3 @@ private: } } - -#endif // QNXCONFIGURATIONMANAGER_H diff --git a/src/plugins/qnx/qnxconstants.h b/src/plugins/qnx/qnxconstants.h index 795e4560c2..c77dbc21e5 100644 --- a/src/plugins/qnx/qnxconstants.h +++ b/src/plugins/qnx/qnxconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_QNXCONSTANTS_H -#define QNX_QNXCONSTANTS_H +#pragma once #include <QtGlobal> @@ -67,5 +66,3 @@ const char QNX_DEBUGGING_GROUP[] = "Debugger.Group.Qnx"; } // namespace Constants } // namespace Qnx - -#endif // QNX_QNXCONSTANTS_H diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index 21f988f19f..1f3f2ed9a0 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -44,8 +44,8 @@ using namespace ProjectExplorer; using namespace RemoteLinux; -using namespace Qnx; -using namespace Qnx::Internal; +namespace Qnx { +namespace Internal { QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::DebuggerRunControl *runControl) : QnxAbstractRunSupport(runConfig, runControl) @@ -57,12 +57,12 @@ QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::Debug , m_useQmlDebugger(runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useQmlDebugger()) { const DeviceApplicationRunner *runner = appRunner(); - connect(runner, SIGNAL(reportError(QString)), SLOT(handleError(QString))); - connect(runner, SIGNAL(remoteProcessStarted()), SLOT(handleRemoteProcessStarted())); - connect(runner, SIGNAL(finished(bool)), SLOT(handleRemoteProcessFinished(bool))); - connect(runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString))); - connect(runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); - connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); + connect(runner, &DeviceApplicationRunner::reportError, this, &QnxDebugSupport::handleError); + connect(runner, &DeviceApplicationRunner::remoteProcessStarted, this, &QnxDebugSupport::handleRemoteProcessStarted); + connect(runner, &DeviceApplicationRunner::finished, this, &QnxDebugSupport::handleRemoteProcessFinished); + connect(runner, &DeviceApplicationRunner::reportProgress, this, &QnxDebugSupport::handleProgressReport); + connect(runner, &DeviceApplicationRunner::remoteStdout, this, &QnxDebugSupport::handleRemoteOutput); + connect(runner, &DeviceApplicationRunner::remoteStderr, this, &QnxDebugSupport::handleRemoteOutput); connect(m_runControl, &Debugger::DebuggerRunControl::requestRemoteSetup, this, &QnxDebugSupport::handleAdapterSetupRequested); @@ -72,10 +72,10 @@ QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::Debug QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast<const QnxDeviceConfiguration>(); m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this); - connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(handleApplicationOutput(QString,Utils::OutputFormat))); - connect(runner, SIGNAL(remoteProcessStarted()), m_slog2Info, SLOT(start())); + connect(m_slog2Info, &Slog2InfoRunner::output, this, &QnxDebugSupport::handleApplicationOutput); + connect(runner, &DeviceApplicationRunner::remoteProcessStarted, m_slog2Info, &Slog2InfoRunner::start); if (qnxDevice->qnxVersion() > 0x060500) - connect(m_slog2Info, SIGNAL(commandMissing()), this, SLOT(printMissingWarning())); + connect(m_slog2Info, &Slog2InfoRunner::commandMissing, this, &QnxDebugSupport::printMissingWarning); } void QnxDebugSupport::handleAdapterSetupRequested() @@ -105,7 +105,7 @@ void QnxDebugSupport::startExecution() QStringList arguments; if (m_useCppDebugger) - arguments << QString::number(m_pdebugPort); + arguments << QString::number(m_pdebugPort.number()); else if (m_useQmlDebugger && !m_useCppDebugger) arguments = Utils::QtcProcess::splitArgs( m_runControl->startParameters().inferior.commandLineArguments); @@ -210,3 +210,6 @@ void QnxDebugSupport::handleApplicationOutput(const QString &msg, Utils::OutputF if (m_runControl) m_runControl->showMessage(msg, Debugger::AppOutput); } + +} // namespace Internal +} // namespace Qnx diff --git a/src/plugins/qnx/qnxdebugsupport.h b/src/plugins/qnx/qnxdebugsupport.h index ad4196d7ee..f389c3ee49 100644 --- a/src/plugins/qnx/qnxdebugsupport.h +++ b/src/plugins/qnx/qnxdebugsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXDEBUGSUPPORT_H -#define QNX_INTERNAL_QNXDEBUGSUPPORT_H +#pragma once #include "qnxabstractrunsupport.h" @@ -52,19 +51,19 @@ public slots: void handleDebuggingFinished(); private slots: - void handleAdapterSetupRequested(); + void handleAdapterSetupRequested() override; - void handleRemoteProcessStarted(); - void handleRemoteProcessFinished(bool success); - void handleProgressReport(const QString &progressOutput); - void handleRemoteOutput(const QByteArray &output); - void handleError(const QString &error); + void handleRemoteProcessStarted() override; + void handleRemoteProcessFinished(bool success) override; + void handleProgressReport(const QString &progressOutput) override; + void handleRemoteOutput(const QByteArray &output) override; + void handleError(const QString &error) override; void printMissingWarning(); void handleApplicationOutput(const QString &msg, Utils::OutputFormat outputFormat); private: - void startExecution(); + void startExecution() override; QString processExecutable() const; @@ -74,8 +73,8 @@ private: Slog2InfoRunner *m_slog2Info; Debugger::DebuggerRunControl *m_runControl; - int m_pdebugPort; - int m_qmlPort; + Utils::Port m_pdebugPort; + Utils::Port m_qmlPort; bool m_useCppDebugger; bool m_useQmlDebugger; @@ -83,5 +82,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXDEBUGSUPPORT_H diff --git a/src/plugins/qnx/qnxdeployconfiguration.h b/src/plugins/qnx/qnxdeployconfiguration.h index 8ffedb896c..0af2552c0d 100644 --- a/src/plugins/qnx/qnxdeployconfiguration.h +++ b/src/plugins/qnx/qnxdeployconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXDEPLOYCONFIGURATION_H -#define QNX_INTERNAL_QNXDEPLOYCONFIGURATION_H +#pragma once #include <remotelinux/remotelinuxdeployconfiguration.h> @@ -47,5 +46,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXDEPLOYCONFIGURATION_H diff --git a/src/plugins/qnx/qnxdeployconfigurationfactory.h b/src/plugins/qnx/qnxdeployconfigurationfactory.h index f6a7edd509..6564470c19 100644 --- a/src/plugins/qnx/qnxdeployconfigurationfactory.h +++ b/src/plugins/qnx/qnxdeployconfigurationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXDEPLOYCONFIGURATIONFACTORY_H -#define QNX_INTERNAL_QNXDEPLOYCONFIGURATIONFACTORY_H +#pragma once #include <projectexplorer/deployconfiguration.h> @@ -57,5 +56,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXDEPLOYCONFIGURATIONFACTORY_H diff --git a/src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp b/src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp index a5ce49693f..d90b1bc18c 100644 --- a/src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp +++ b/src/plugins/qnx/qnxdeployqtlibrariesdialog.cpp @@ -38,11 +38,13 @@ #include <QMessageBox> using namespace QtSupport; +using namespace ProjectExplorer; +using namespace RemoteLinux; namespace Qnx { namespace Internal { -QnxDeployQtLibrariesDialog::QnxDeployQtLibrariesDialog(const ProjectExplorer::IDevice::ConstPtr &device, +QnxDeployQtLibrariesDialog::QnxDeployQtLibrariesDialog(const IDevice::ConstPtr &device, QWidget *parent) : QDialog(parent), m_ui(new Ui::QnxDeployQtLibrariesDialog), @@ -67,27 +69,31 @@ QnxDeployQtLibrariesDialog::QnxDeployQtLibrariesDialog(const ProjectExplorer::ID m_uploadService = new RemoteLinux::GenericDirectUploadService(this); m_uploadService->setDevice(m_device); - connect(m_uploadService, SIGNAL(progressMessage(QString)), this, SLOT(updateProgress(QString))); - connect(m_uploadService, SIGNAL(progressMessage(QString)), - m_ui->deployLogWindow, SLOT(appendPlainText(QString))); - connect(m_uploadService, SIGNAL(errorMessage(QString)), - m_ui->deployLogWindow, SLOT(appendPlainText(QString))); - connect(m_uploadService, SIGNAL(warningMessage(QString)), - m_ui->deployLogWindow, SLOT(appendPlainText(QString))); - connect(m_uploadService, SIGNAL(stdOutData(QString)), - m_ui->deployLogWindow, SLOT(appendPlainText(QString))); - connect(m_uploadService, SIGNAL(stdErrData(QString)), - m_ui->deployLogWindow, SLOT(appendPlainText(QString))); - connect(m_uploadService, SIGNAL(finished()), this, SLOT(handleUploadFinished())); + connect(m_uploadService, &AbstractRemoteLinuxDeployService::progressMessage, + this, &QnxDeployQtLibrariesDialog::updateProgress); + connect(m_uploadService, &AbstractRemoteLinuxDeployService::progressMessage, + m_ui->deployLogWindow, &QPlainTextEdit::appendPlainText); + connect(m_uploadService, &AbstractRemoteLinuxDeployService::errorMessage, + m_ui->deployLogWindow, &QPlainTextEdit::appendPlainText); + connect(m_uploadService, &AbstractRemoteLinuxDeployService::warningMessage, + m_ui->deployLogWindow, &QPlainTextEdit::appendPlainText); + connect(m_uploadService, &AbstractRemoteLinuxDeployService::stdOutData, + m_ui->deployLogWindow, &QPlainTextEdit::appendPlainText); + connect(m_uploadService, &AbstractRemoteLinuxDeployService::stdErrData, + m_ui->deployLogWindow, &QPlainTextEdit::appendPlainText); + connect(m_uploadService, &AbstractRemoteLinuxDeployService::finished, + this, &QnxDeployQtLibrariesDialog::handleUploadFinished); m_processRunner = new QSsh::SshRemoteProcessRunner(this); - connect(m_processRunner, SIGNAL(connectionError()), - this, SLOT(handleRemoteProcessError())); - connect(m_processRunner, SIGNAL(processClosed(int)), - this, SLOT(handleRemoteProcessCompleted())); - - connect(m_ui->deployButton, SIGNAL(clicked()), this, SLOT(deployLibraries())); - connect(m_ui->closeButton, SIGNAL(clicked()), this, SLOT(close())); + connect(m_processRunner, &QSsh::SshRemoteProcessRunner::connectionError, + this, &QnxDeployQtLibrariesDialog::handleRemoteProcessError); + connect(m_processRunner, &QSsh::SshRemoteProcessRunner::processClosed, + this, &QnxDeployQtLibrariesDialog::handleRemoteProcessCompleted); + + connect(m_ui->deployButton, &QAbstractButton::clicked, + this, &QnxDeployQtLibrariesDialog::deployLibraries); + connect(m_ui->closeButton, &QAbstractButton::clicked, + this, &QWidget::close); } QnxDeployQtLibrariesDialog::~QnxDeployQtLibrariesDialog() @@ -147,7 +153,7 @@ void QnxDeployQtLibrariesDialog::startUpload() m_state = Uploading; - QList<ProjectExplorer::DeployableFile> filesToUpload = gatherFiles(); + QList<DeployableFile> filesToUpload = gatherFiles(); m_ui->deployProgress->setRange(0, filesToUpload.count()); @@ -214,9 +220,9 @@ void QnxDeployQtLibrariesDialog::handleRemoteProcessCompleted() } } -QList<ProjectExplorer::DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles() +QList<DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles() { - QList<ProjectExplorer::DeployableFile> result; + QList<DeployableFile> result; const int qtVersionId = m_ui->qtLibraryCombo->itemData(m_ui->qtLibraryCombo->currentIndex()).toInt(); @@ -243,10 +249,10 @@ QList<ProjectExplorer::DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles() return result; } -QList<ProjectExplorer::DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles( +QList<DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles( const QString &dirPath, const QString &baseDirPath, const QStringList &nameFilters) { - QList<ProjectExplorer::DeployableFile> result; + QList<DeployableFile> result; if (dirPath.isEmpty()) return result; @@ -270,7 +276,7 @@ QList<ProjectExplorer::DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles( remoteDir = fullRemoteDirectory() + QLatin1Char('/') + baseDir.relativeFilePath(dirPath); } - result.append(ProjectExplorer::DeployableFile(fileInfo.absoluteFilePath(), remoteDir)); + result.append(DeployableFile(fileInfo.absoluteFilePath(), remoteDir)); } } diff --git a/src/plugins/qnx/qnxdeployqtlibrariesdialog.h b/src/plugins/qnx/qnxdeployqtlibrariesdialog.h index 29d3496c0b..fa6dc6d6ec 100644 --- a/src/plugins/qnx/qnxdeployqtlibrariesdialog.h +++ b/src/plugins/qnx/qnxdeployqtlibrariesdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXDEPLOYQTLIBRARIESDIALOG_H -#define QNX_INTERNAL_QNXDEPLOYQTLIBRARIESDIALOG_H +#pragma once #include <QDialog> @@ -100,4 +99,3 @@ private: } // namespace Internal } // namespace Qnx -#endif // QNX_INTERNAL_QNXDEPLOYQTLIBRARIESDIALOG_H diff --git a/src/plugins/qnx/qnxdeploystepfactory.h b/src/plugins/qnx/qnxdeploystepfactory.h index 1e3d2702c6..dc9d6e98a6 100644 --- a/src/plugins/qnx/qnxdeploystepfactory.h +++ b/src/plugins/qnx/qnxdeploystepfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXDEPLOYSTEPFACTORY_H -#define QNX_INTERNAL_QNXDEPLOYSTEPFACTORY_H +#pragma once #include <projectexplorer/buildstep.h> @@ -55,5 +54,3 @@ public: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXDEPLOYSTEPFACTORY_H diff --git a/src/plugins/qnx/qnxdeviceconfiguration.cpp b/src/plugins/qnx/qnxdeviceconfiguration.cpp index ce09301433..1215b39993 100644 --- a/src/plugins/qnx/qnxdeviceconfiguration.cpp +++ b/src/plugins/qnx/qnxdeviceconfiguration.cpp @@ -33,6 +33,7 @@ #include <projectexplorer/devicesupport/sshdeviceprocess.h> #include <projectexplorer/runnables.h> #include <ssh/sshconnection.h> +#include <utils/port.h> #include <utils/qtcassert.h> #include <QApplication> @@ -66,16 +67,16 @@ class QnxPortsGatheringMethod : public PortsGatheringMethod "done"; } - QList<int> usedPorts(const QByteArray &output) const + QList<Port> usedPorts(const QByteArray &output) const { - QList<int> ports; + QList<Port> ports; QList<QByteArray> portStrings = output.split('\n'); portStrings.removeFirst(); foreach (const QByteArray &portString, portStrings) { if (portString.isEmpty()) continue; bool ok; - const int port = portString.toInt(&ok, 16); + const Port port(portString.toInt(&ok, 16)); if (ok) { if (!ports.contains(port)) ports << port; @@ -133,8 +134,8 @@ void QnxDeviceConfiguration::updateVersionNumber() const { QEventLoop eventLoop; SshDeviceProcess versionNumberProcess(sharedFromThis()); - QObject::connect(&versionNumberProcess, SIGNAL(finished()), &eventLoop, SLOT(quit())); - QObject::connect(&versionNumberProcess, SIGNAL(error(QProcess::ProcessError)), &eventLoop, SLOT(quit())); + QObject::connect(&versionNumberProcess, &SshDeviceProcess::finished, &eventLoop, &QEventLoop::quit); + QObject::connect(&versionNumberProcess, &DeviceProcess::error, &eventLoop, &QEventLoop::quit); StandardRunnable r; r.executable = QLatin1String("uname"); diff --git a/src/plugins/qnx/qnxdeviceconfiguration.h b/src/plugins/qnx/qnxdeviceconfiguration.h index e77813fd74..ca42b013bd 100644 --- a/src/plugins/qnx/qnxdeviceconfiguration.h +++ b/src/plugins/qnx/qnxdeviceconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXDEVICECONFIGURATION_H -#define QNX_INTERNAL_QNXDEVICECONFIGURATION_H +#pragma once #include "qnx_export.h" @@ -43,25 +42,25 @@ public: static Ptr create(); static Ptr create(const QString &name, Core::Id type, MachineType machineType, Origin origin = ManuallyAdded, Core::Id id = Core::Id()); - ProjectExplorer::IDevice::Ptr clone() const; + ProjectExplorer::IDevice::Ptr clone() const override; - ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const; - ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const; - ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const; + ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const override; + ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const override; + ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override; - ProjectExplorer::DeviceTester *createDeviceTester() const; - ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const; + ProjectExplorer::DeviceTester *createDeviceTester() const override; + ProjectExplorer::DeviceProcess *createProcess(QObject *parent) const override; - QList<Core::Id> actionIds() const; - QString displayNameForActionId(Core::Id actionId) const; - void executeAction(Core::Id actionId, QWidget *parent); + QList<Core::Id> actionIds() const override; + QString displayNameForActionId(Core::Id actionId) const override; + void executeAction(Core::Id actionId, QWidget *parent) override; - QString displayType() const; + QString displayType() const override; int qnxVersion() const; - void fromMap(const QVariantMap &map); - QVariantMap toMap() const; + void fromMap(const QVariantMap &map) override; + QVariantMap toMap() const override; protected: QnxDeviceConfiguration(); @@ -79,5 +78,3 @@ private: }; } // namespace Qnx - -#endif // QNX_INTERNAL_QNXDEVICECONFIGURATION_H diff --git a/src/plugins/qnx/qnxdeviceconfigurationfactory.h b/src/plugins/qnx/qnxdeviceconfigurationfactory.h index a683c18bdd..cfa5b97f15 100644 --- a/src/plugins/qnx/qnxdeviceconfigurationfactory.h +++ b/src/plugins/qnx/qnxdeviceconfigurationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXDEVICECONFIGURATIONFACTORY_H -#define QNX_INTERNAL_QNXDEVICECONFIGURATIONFACTORY_H +#pragma once #include <projectexplorer/devicesupport/idevicefactory.h> @@ -51,5 +50,3 @@ public: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXDEVICECONFIGURATIONFACTORY_H diff --git a/src/plugins/qnx/qnxdeviceconfigurationwizard.h b/src/plugins/qnx/qnxdeviceconfigurationwizard.h index a32c15337b..83e8857639 100644 --- a/src/plugins/qnx/qnxdeviceconfigurationwizard.h +++ b/src/plugins/qnx/qnxdeviceconfigurationwizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARD_H -#define QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARD_H +#pragma once #include <projectexplorer/devicesupport/idevice.h> #include <utils/wizard.h> @@ -57,5 +56,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARD_H diff --git a/src/plugins/qnx/qnxdeviceconfigurationwizardpages.h b/src/plugins/qnx/qnxdeviceconfigurationwizardpages.h index 2791632ce5..fcd31884f7 100644 --- a/src/plugins/qnx/qnxdeviceconfigurationwizardpages.h +++ b/src/plugins/qnx/qnxdeviceconfigurationwizardpages.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARDPAGES_H -#define QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARDPAGES_H +#pragma once #include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h> @@ -42,5 +41,3 @@ public: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARDPAGES_H diff --git a/src/plugins/qnx/qnxdeviceprocess.h b/src/plugins/qnx/qnxdeviceprocess.h index d425b0600c..6fbb6ac8eb 100644 --- a/src/plugins/qnx/qnxdeviceprocess.h +++ b/src/plugins/qnx/qnxdeviceprocess.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNXDEVICEPROCESS_H -#define QNXDEVICEPROCESS_H +#pragma once #include "qnx_export.h" #include <remotelinux/linuxdevice.h> @@ -50,5 +49,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNXDEVICEPROCESS_H diff --git a/src/plugins/qnx/qnxdeviceprocesslist.h b/src/plugins/qnx/qnxdeviceprocesslist.h index 000d4717ff..47c279e2e9 100644 --- a/src/plugins/qnx/qnxdeviceprocesslist.h +++ b/src/plugins/qnx/qnxdeviceprocesslist.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXDEVICEPROCESSLIST_H -#define QNX_INTERNAL_QNXDEVICEPROCESSLIST_H +#pragma once #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/devicesupport/sshdeviceprocesslist.h> @@ -47,5 +46,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXDEVICEPROCESSLIST_H diff --git a/src/plugins/qnx/qnxdeviceprocesssignaloperation.h b/src/plugins/qnx/qnxdeviceprocesssignaloperation.h index f161a5167f..9e528a800e 100644 --- a/src/plugins/qnx/qnxdeviceprocesssignaloperation.h +++ b/src/plugins/qnx/qnxdeviceprocesssignaloperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNXDEVICEPROCESSSIGNALOPERATION_H -#define QNXDEVICEPROCESSSIGNALOPERATION_H +#pragma once #include <remotelinux/remotelinuxsignaloperation.h> @@ -48,5 +47,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNXDEVICEPROCESSSIGNALOPERATION_H diff --git a/src/plugins/qnx/qnxdevicetester.cpp b/src/plugins/qnx/qnxdevicetester.cpp index 759458722b..fd23937126 100644 --- a/src/plugins/qnx/qnxdevicetester.cpp +++ b/src/plugins/qnx/qnxdevicetester.cpp @@ -29,8 +29,8 @@ #include <ssh/sshremoteprocessrunner.h> #include <utils/qtcassert.h> -using namespace Qnx; -using namespace Qnx::Internal; +namespace Qnx { +namespace Internal { QnxDeviceTester::QnxDeviceTester(QObject *parent) : ProjectExplorer::DeviceTester(parent) @@ -39,14 +39,18 @@ QnxDeviceTester::QnxDeviceTester(QObject *parent) , m_currentCommandIndex(-1) { m_genericTester = new RemoteLinux::GenericLinuxDeviceTester(this); - connect(m_genericTester, SIGNAL(progressMessage(QString)), SIGNAL(progressMessage(QString))); - connect(m_genericTester, SIGNAL(errorMessage(QString)), SIGNAL(errorMessage(QString))); - connect(m_genericTester, SIGNAL(finished(ProjectExplorer::DeviceTester::TestResult)), - SLOT(handleGenericTestFinished(ProjectExplorer::DeviceTester::TestResult))); + connect(m_genericTester, &DeviceTester::progressMessage, + this, &DeviceTester::progressMessage); + connect(m_genericTester, &DeviceTester::errorMessage, + this, &DeviceTester::errorMessage); + connect(m_genericTester, &DeviceTester::finished, + this, &QnxDeviceTester::handleGenericTestFinished); m_processRunner = new QSsh::SshRemoteProcessRunner(this); - connect(m_processRunner, SIGNAL(connectionError()), SLOT(handleConnectionError())); - connect(m_processRunner, SIGNAL(processClosed(int)), SLOT(handleProcessFinished(int))); + connect(m_processRunner, &QSsh::SshRemoteProcessRunner::connectionError, + this, &QnxDeviceTester::handleConnectionError); + connect(m_processRunner, &QSsh::SshRemoteProcessRunner::processClosed, + this, &QnxDeviceTester::handleProcessFinished); m_commandsToTest << QLatin1String("awk") << QLatin1String("grep") @@ -168,3 +172,6 @@ QStringList QnxDeviceTester::versionSpecificCommandsToTest(int versionNumber) co return result; } + +} // namespace Internal +} // namespace Qnx diff --git a/src/plugins/qnx/qnxdevicetester.h b/src/plugins/qnx/qnxdevicetester.h index 444723e3a1..90da0599e4 100644 --- a/src/plugins/qnx/qnxdevicetester.h +++ b/src/plugins/qnx/qnxdevicetester.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXDEVICETESTER_H -#define QNX_INTERNAL_QNXDEVICETESTER_H +#pragma once #include <remotelinux/linuxdevicetester.h> @@ -41,8 +40,8 @@ class QnxDeviceTester : public ProjectExplorer::DeviceTester public: explicit QnxDeviceTester(QObject *parent = 0); - void testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration); - void stopTest(); + void testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration) override; + void stopTest() override; private slots: void handleGenericTestFinished(ProjectExplorer::DeviceTester::TestResult result); @@ -74,5 +73,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXDEVICETESTER_H diff --git a/src/plugins/qnx/qnxplugin.cpp b/src/plugins/qnx/qnxplugin.cpp index 82459c53d6..6c28cbbd21 100644 --- a/src/plugins/qnx/qnxplugin.cpp +++ b/src/plugins/qnx/qnxplugin.cpp @@ -86,7 +86,7 @@ void QnxPlugin::extensionsInitialized() m_attachToQnxApplication = new QAction(this); m_attachToQnxApplication->setText(tr("Attach to remote QNX application...")); - connect(m_attachToQnxApplication, SIGNAL(triggered()), debugSupport, SLOT(showProcessesDialog())); + connect(m_attachToQnxApplication, &QAction::triggered, debugSupport, &QnxAttachDebugSupport::showProcessesDialog); Core::ActionContainer *mstart = Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING); mstart->appendGroup(Constants::QNX_DEBUGGING_GROUP); @@ -95,7 +95,7 @@ void QnxPlugin::extensionsInitialized() Core::Command *cmd = Core::ActionManager::registerAction(m_attachToQnxApplication, "Debugger.AttachToQnxApplication"); mstart->addAction(cmd, Constants::QNX_DEBUGGING_GROUP); - connect(KitManager::instance(), SIGNAL(kitsChanged()), this, SLOT(updateDebuggerActions())); + connect(KitManager::instance(), &KitManager::kitsChanged, this, &QnxPlugin::updateDebuggerActions); } ExtensionSystem::IPlugin::ShutdownFlag QnxPlugin::aboutToShutdown() diff --git a/src/plugins/qnx/qnxplugin.h b/src/plugins/qnx/qnxplugin.h index 9859ddb7dc..1fd1367cb8 100644 --- a/src/plugins/qnx/qnxplugin.h +++ b/src/plugins/qnx/qnxplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXPLUGIN_H -#define QNX_INTERNAL_QNXPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -57,5 +56,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXPLUGIN_H diff --git a/src/plugins/qnx/qnxqtversion.h b/src/plugins/qnx/qnxqtversion.h index 04824849d8..225af67867 100644 --- a/src/plugins/qnx/qnxqtversion.h +++ b/src/plugins/qnx/qnxqtversion.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXQTVERSION_H -#define QNX_INTERNAL_QNXQTVERSION_H +#pragma once #include "qnxconstants.h" #include "qnxqtversion.h" @@ -88,5 +87,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXQTVERSION_H diff --git a/src/plugins/qnx/qnxqtversionfactory.h b/src/plugins/qnx/qnxqtversionfactory.h index 7904859ece..6f565b0184 100644 --- a/src/plugins/qnx/qnxqtversionfactory.h +++ b/src/plugins/qnx/qnxqtversionfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXQTVERSIONFACTORY_H -#define QNX_INTERNAL_QNXQTVERSIONFACTORY_H +#pragma once #include <qtsupport/qtversionfactory.h> @@ -50,5 +49,3 @@ public: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXQTVERSIONFACTORY_H diff --git a/src/plugins/qnx/qnxrunconfiguration.h b/src/plugins/qnx/qnxrunconfiguration.h index 7eadf342fe..f897aefa2a 100644 --- a/src/plugins/qnx/qnxrunconfiguration.h +++ b/src/plugins/qnx/qnxrunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXRUNCONFIGURATION_H -#define QNX_INTERNAL_QNXRUNCONFIGURATION_H +#pragma once #include <remotelinux/remotelinuxrunconfiguration.h> @@ -55,5 +54,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXRUNCONFIGURATION_H diff --git a/src/plugins/qnx/qnxrunconfigurationfactory.h b/src/plugins/qnx/qnxrunconfigurationfactory.h index 8d1e15d907..5bf5e538be 100644 --- a/src/plugins/qnx/qnxrunconfigurationfactory.h +++ b/src/plugins/qnx/qnxrunconfigurationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXRUNCONFIGURATIONFACTORY_H -#define QNX_INTERNAL_QNXRUNCONFIGURATIONFACTORY_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -60,5 +59,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXRUNCONFIGURATIONFACTORY_H diff --git a/src/plugins/qnx/qnxruncontrol.cpp b/src/plugins/qnx/qnxruncontrol.cpp index 187e2a30d4..67ea7a88fe 100644 --- a/src/plugins/qnx/qnxruncontrol.cpp +++ b/src/plugins/qnx/qnxruncontrol.cpp @@ -32,29 +32,33 @@ #include <projectexplorer/runconfiguration.h> #include <projectexplorer/target.h> -using namespace Qnx; -using namespace Qnx::Internal; +using namespace ProjectExplorer; using namespace RemoteLinux; +using namespace Utils; -QnxRunControl::QnxRunControl(ProjectExplorer::RunConfiguration *runConfig) +namespace Qnx { +namespace Internal { + +QnxRunControl::QnxRunControl(RunConfiguration *runConfig) : RemoteLinuxRunControl(runConfig) , m_slog2Info(0) { - ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit()); + IDevice::ConstPtr dev = DeviceKitInformation::device(runConfig->target()->kit()); QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast<const QnxDeviceConfiguration>(); QnxRunConfiguration *qnxRunConfig = qobject_cast<QnxRunConfiguration *>(runConfig); QTC_CHECK(qnxRunConfig); - const QString applicationId = Utils::FileName::fromString(qnxRunConfig->remoteExecutableFilePath()).fileName(); + const QString applicationId = FileName::fromString(qnxRunConfig->remoteExecutableFilePath()).fileName(); m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this); - connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(appendMessage(QString,Utils::OutputFormat))); - connect(this, SIGNAL(started()), m_slog2Info, SLOT(start())); + connect(m_slog2Info, &Slog2InfoRunner::output, + this, static_cast<void(RunControl::*)(const QString &, OutputFormat)>(&RunControl::appendMessage)); + connect(this, &RunControl::started, m_slog2Info, &Slog2InfoRunner::start); if (qnxDevice->qnxVersion() > 0x060500) - connect(m_slog2Info, SIGNAL(commandMissing()), this, SLOT(printMissingWarning())); + connect(m_slog2Info, &Slog2InfoRunner::commandMissing, this, &QnxRunControl::printMissingWarning); } -ProjectExplorer::RunControl::StopResult QnxRunControl::stop() +RunControl::StopResult QnxRunControl::stop() { m_slog2Info->stop(); return RemoteLinuxRunControl::stop(); @@ -62,5 +66,8 @@ ProjectExplorer::RunControl::StopResult QnxRunControl::stop() void QnxRunControl::printMissingWarning() { - appendMessage(tr("Warning: \"slog2info\" is not found on the device, debug output not available."), Utils::ErrorMessageFormat); + appendMessage(tr("Warning: \"slog2info\" is not found on the device, debug output not available."), ErrorMessageFormat); } + +} // namespace Internal +} // namespace Qnx diff --git a/src/plugins/qnx/qnxruncontrol.h b/src/plugins/qnx/qnxruncontrol.h index 39b2902091..61985f6daa 100644 --- a/src/plugins/qnx/qnxruncontrol.h +++ b/src/plugins/qnx/qnxruncontrol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXRUNCONTROL_H -#define QNX_INTERNAL_QNXRUNCONTROL_H +#pragma once #include <remotelinux/remotelinuxruncontrol.h> @@ -50,5 +49,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXRUNCONTROL_H diff --git a/src/plugins/qnx/qnxruncontrolfactory.cpp b/src/plugins/qnx/qnxruncontrolfactory.cpp index 0b95af65b1..b65ded3e80 100644 --- a/src/plugins/qnx/qnxruncontrolfactory.cpp +++ b/src/plugins/qnx/qnxruncontrolfactory.cpp @@ -75,7 +75,7 @@ static DebuggerStartParameters createDebuggerStartParameters(QnxRunConfiguration auto aspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>(); if (aspect->useQmlDebugger()) { params.qmlServerAddress = device->sshParameters().host; - params.qmlServerPort = 0; // QML port is handed out later + params.qmlServerPort = Utils::Port(); // QML port is handed out later } auto qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitInformation::qtVersion(k)); @@ -147,7 +147,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, Core::Id m AnalyzerConnection connection; connection.connParams = device->sshParameters(); connection.analyzerHost = connection.connParams.host; - connection.analyzerPort = connection.connParams.port; + connection.analyzerPort = Utils::Port(connection.connParams.port); runControl->setConnection(connection); auto analyzeSupport = new QnxAnalyzeSupport(rc, runControl); connect(runControl, &RunControl::finished, analyzeSupport, &QnxAnalyzeSupport::handleProfilingFinished); diff --git a/src/plugins/qnx/qnxruncontrolfactory.h b/src/plugins/qnx/qnxruncontrolfactory.h index 003b523e75..af19a7f3dd 100644 --- a/src/plugins/qnx/qnxruncontrolfactory.h +++ b/src/plugins/qnx/qnxruncontrolfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXRUNCONTROLFACTORY_H -#define QNX_INTERNAL_QNXRUNCONTROLFACTORY_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -46,5 +45,3 @@ public: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXRUNCONTROLFACTORY_H diff --git a/src/plugins/qnx/qnxsettingspage.h b/src/plugins/qnx/qnxsettingspage.h index e23d59ae94..6358f7a25b 100644 --- a/src/plugins/qnx/qnxsettingspage.h +++ b/src/plugins/qnx/qnxsettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNXSETTINGSPAGE_H -#define QNXSETTINGSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> @@ -50,5 +49,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNXSETTINGSPAGE_H diff --git a/src/plugins/qnx/qnxsettingswidget.cpp b/src/plugins/qnx/qnxsettingswidget.cpp index f9f337b5ae..6ca598db6a 100644 --- a/src/plugins/qnx/qnxsettingswidget.cpp +++ b/src/plugins/qnx/qnxsettingswidget.cpp @@ -34,8 +34,6 @@ #include <QFileDialog> #include <QMessageBox> -#include <qdebug.h> - namespace Qnx { namespace Internal { @@ -47,19 +45,19 @@ QnxSettingsWidget::QnxSettingsWidget(QWidget *parent) : m_ui->setupUi(this); populateConfigsCombo(); - connect(m_ui->addButton, SIGNAL(clicked()), - this, SLOT(addConfiguration())); - connect(m_ui->removeButton, SIGNAL(clicked()), - this, SLOT(removeConfiguration())); - connect(m_ui->configsCombo, SIGNAL(currentIndexChanged(QString)), - this, SLOT(updateInformation())); - connect(m_ui->generateKitsCheckBox, SIGNAL(toggled(bool)), - this, SLOT(generateKits(bool))); - connect(m_qnxConfigManager, SIGNAL(configurationsListUpdated()), - this, SLOT(populateConfigsCombo())); + connect(m_ui->addButton, &QAbstractButton::clicked, + this, &QnxSettingsWidget::addConfiguration); + connect(m_ui->removeButton, &QAbstractButton::clicked, + this, &QnxSettingsWidget::removeConfiguration); + connect(m_ui->configsCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), + this, &QnxSettingsWidget::updateInformation); + connect(m_ui->generateKitsCheckBox, &QAbstractButton::toggled, + this, &QnxSettingsWidget::generateKits); + connect(m_qnxConfigManager, &QnxConfigurationManager::configurationsListUpdated, + this, &QnxSettingsWidget::populateConfigsCombo); connect(QtSupport::QtVersionManager::instance(), - SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), - this, SLOT(updateInformation())); + &QtSupport::QtVersionManager::qtVersionsChanged, + this, &QnxSettingsWidget::updateInformation); } QnxSettingsWidget::~QnxSettingsWidget() diff --git a/src/plugins/qnx/qnxsettingswidget.h b/src/plugins/qnx/qnxsettingswidget.h index 999417a867..879697f688 100644 --- a/src/plugins/qnx/qnxsettingswidget.h +++ b/src/plugins/qnx/qnxsettingswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNXSETTINGSWIDGET_H -#define QNXSETTINGSWIDGET_H +#pragma once #include <QWidget> @@ -89,5 +88,3 @@ private: } } - -#endif // QNXSETTINGSWIDGET_H diff --git a/src/plugins/qnx/qnxtoolchain.cpp b/src/plugins/qnx/qnxtoolchain.cpp index 3224521977..ad0cd53e18 100644 --- a/src/plugins/qnx/qnxtoolchain.cpp +++ b/src/plugins/qnx/qnxtoolchain.cpp @@ -32,6 +32,8 @@ #include <QFormLayout> using namespace ProjectExplorer; +using namespace Utils; + namespace Qnx { namespace Internal { @@ -46,10 +48,10 @@ static const QList<Abi> qccSupportedAbis() return abis; } -static void setQnxEnvironment(Utils::Environment &env, const QList<Utils::EnvironmentItem> &qnxEnv) +static void setQnxEnvironment(Environment &env, const QList<EnvironmentItem> &qnxEnv) { // We only need to set QNX_HOST and QNX_TARGET needed when running qcc - foreach (const Utils::EnvironmentItem &item, qnxEnv) { + foreach (const EnvironmentItem &item, qnxEnv) { if (item.name == QLatin1String("QNX_HOST") || item.name == QLatin1String("QNX_TARGET") ) env.set(item.name, item.value); @@ -70,7 +72,7 @@ ToolChainConfigWidget *QnxToolChain::configurationWidget() return new QnxToolChainConfigWidget(this); } -void QnxToolChain::addToEnvironment(Utils::Environment &env) const +void QnxToolChain::addToEnvironment(Environment &env) const { if (env.value(QLatin1String("QNX_HOST")).isEmpty() || env.value(QLatin1String("QNX_TARGET")).isEmpty()) @@ -79,12 +81,12 @@ void QnxToolChain::addToEnvironment(Utils::Environment &env) const GccToolChain::addToEnvironment(env); } -Utils::FileNameList QnxToolChain::suggestedMkspecList() const +FileNameList QnxToolChain::suggestedMkspecList() const { - Utils::FileNameList mkspecList; - mkspecList << Utils::FileName::fromLatin1("qnx-armv7le-qcc"); - mkspecList << Utils::FileName::fromLatin1("qnx-armle-v7-qcc"); - mkspecList << Utils::FileName::fromLatin1("qnx-x86-qcc"); + FileNameList mkspecList; + mkspecList << FileName::fromLatin1("qnx-armv7le-qcc"); + mkspecList << FileName::fromLatin1("qnx-armle-v7-qcc"); + mkspecList << FileName::fromLatin1("qnx-x86-qcc"); return mkspecList; } @@ -179,16 +181,16 @@ ToolChain *QnxToolChainFactory::create() QnxToolChainConfigWidget::QnxToolChainConfigWidget(QnxToolChain *tc) : ToolChainConfigWidget(tc) - , m_compilerCommand(new Utils::PathChooser) - , m_ndkPath(new Utils::PathChooser) + , m_compilerCommand(new PathChooser) + , m_ndkPath(new PathChooser) , m_abiWidget(new AbiWidget) { - m_compilerCommand->setExpectedKind(Utils::PathChooser::ExistingCommand); + m_compilerCommand->setExpectedKind(PathChooser::ExistingCommand); m_compilerCommand->setHistoryCompleter(QLatin1String("Qnx.ToolChain.History")); m_compilerCommand->setFileName(tc->compilerCommand()); m_compilerCommand->setEnabled(!tc->isAutoDetected()); - m_ndkPath->setExpectedKind(Utils::PathChooser::ExistingDirectory); + m_ndkPath->setExpectedKind(PathChooser::ExistingDirectory); m_ndkPath->setHistoryCompleter(QLatin1String("Qnx.Ndk.History")); m_ndkPath->setPath(tc->ndkPath()); m_ndkPath->setEnabled(!tc->isAutoDetected()); @@ -201,9 +203,9 @@ QnxToolChainConfigWidget::QnxToolChainConfigWidget(QnxToolChain *tc) m_mainLayout->addRow(tr("NDK/SDP path:"), m_ndkPath); m_mainLayout->addRow(tr("&ABI:"), m_abiWidget); - connect(m_compilerCommand, SIGNAL(rawPathChanged(QString)), this, SIGNAL(dirty())); - connect(m_ndkPath, SIGNAL(rawPathChanged(QString)), this, SIGNAL(dirty())); - connect(m_abiWidget, SIGNAL(abiChanged()), this, SIGNAL(dirty())); + connect(m_compilerCommand, &PathChooser::rawPathChanged, this, &ToolChainConfigWidget::dirty); + connect(m_ndkPath, &PathChooser::rawPathChanged, this, &ToolChainConfigWidget::dirty); + connect(m_abiWidget, &AbiWidget::abiChanged, this, &ToolChainConfigWidget::dirty); } void QnxToolChainConfigWidget::applyImpl() diff --git a/src/plugins/qnx/qnxtoolchain.h b/src/plugins/qnx/qnxtoolchain.h index 2e989c7374..193e7e36f8 100644 --- a/src/plugins/qnx/qnxtoolchain.h +++ b/src/plugins/qnx/qnxtoolchain.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNXTOOLCHAIN_H -#define QNXTOOLCHAIN_H +#pragma once #include <projectexplorer/gcctoolchain.h> #include <projectexplorer/gcctoolchainfactories.h> @@ -102,5 +101,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNXTOOLCHAIN_H diff --git a/src/plugins/qnx/qnxutils.h b/src/plugins/qnx/qnxutils.h index 9169ea8b3a..f62c50ed37 100644 --- a/src/plugins/qnx/qnxutils.h +++ b/src/plugins/qnx/qnxutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_QNXUTILS_H -#define QNX_INTERNAL_QNXUTILS_H +#pragma once #include "qnxconstants.h" @@ -74,5 +73,3 @@ public: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_QNXUTILS_H diff --git a/src/plugins/qnx/qnxversionnumber.h b/src/plugins/qnx/qnxversionnumber.h index 5dfa93c09b..9b619df651 100644 --- a/src/plugins/qnx/qnxversionnumber.h +++ b/src/plugins/qnx/qnxversionnumber.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_VERSION_NUMBER_H -#define QNX_VERSION_NUMBER_H +#pragma once #include <QStringList> @@ -54,5 +53,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_VERSION_NUMBER_H diff --git a/src/plugins/qnx/slog2inforunner.cpp b/src/plugins/qnx/slog2inforunner.cpp index befca6f9ae..43ad13beee 100644 --- a/src/plugins/qnx/slog2inforunner.cpp +++ b/src/plugins/qnx/slog2inforunner.cpp @@ -47,17 +47,17 @@ Slog2InfoRunner::Slog2InfoRunner(const QString &applicationId, m_applicationId.truncate(63); m_testProcess = new QnxDeviceProcess(device, this); - connect(m_testProcess, &ProjectExplorer::DeviceProcess::finished, this, &Slog2InfoRunner::handleTestProcessCompleted); + connect(m_testProcess, &DeviceProcess::finished, this, &Slog2InfoRunner::handleTestProcessCompleted); - m_launchDateTimeProcess = new ProjectExplorer::SshDeviceProcess(device, this); - connect(m_launchDateTimeProcess, &ProjectExplorer::DeviceProcess::finished, this, &Slog2InfoRunner::launchSlog2Info); + m_launchDateTimeProcess = new SshDeviceProcess(device, this); + connect(m_launchDateTimeProcess, &DeviceProcess::finished, this, &Slog2InfoRunner::launchSlog2Info); m_logProcess = new QnxDeviceProcess(device, this); - connect(m_logProcess, &ProjectExplorer::DeviceProcess::readyReadStandardOutput, this, &Slog2InfoRunner::readLogStandardOutput); - connect(m_logProcess, &ProjectExplorer::DeviceProcess::readyReadStandardError, this, &Slog2InfoRunner::readLogStandardError); - connect(m_logProcess, &ProjectExplorer::DeviceProcess::error, this, &Slog2InfoRunner::handleLogError); - connect(m_logProcess, &ProjectExplorer::DeviceProcess::started, this, &Slog2InfoRunner::started); - connect(m_logProcess, &ProjectExplorer::DeviceProcess::finished, this, &Slog2InfoRunner::finished); + connect(m_logProcess, &DeviceProcess::readyReadStandardOutput, this, &Slog2InfoRunner::readLogStandardOutput); + connect(m_logProcess, &DeviceProcess::readyReadStandardError, this, &Slog2InfoRunner::readLogStandardError); + connect(m_logProcess, &DeviceProcess::error, this, &Slog2InfoRunner::handleLogError); + connect(m_logProcess, &DeviceProcess::started, this, &Slog2InfoRunner::started); + connect(m_logProcess, &DeviceProcess::finished, this, &Slog2InfoRunner::finished); } void Slog2InfoRunner::start() diff --git a/src/plugins/qnx/slog2inforunner.h b/src/plugins/qnx/slog2inforunner.h index 4fbcfaa672..4e08b5f950 100644 --- a/src/plugins/qnx/slog2inforunner.h +++ b/src/plugins/qnx/slog2inforunner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QNX_INTERNAL_SLOG2INFORUNNER_H -#define QNX_INTERNAL_SLOG2INFORUNNER_H +#pragma once #include <QObject> @@ -86,5 +85,3 @@ private: } // namespace Internal } // namespace Qnx - -#endif // QNX_INTERNAL_SLOG2INFORUNNER_H diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index d2529d527c..4418c9cde7 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -1122,14 +1122,15 @@ void BaseQtVersion::updateVersionInfo() const } m_qmakeIsExecutable = true; - const QString qtInstallData = qmakeProperty(m_versionInfo, "QT_INSTALL_DATA"); + const QString qtInstallBins = qmakeProperty(m_versionInfo, "QT_INSTALL_BINS"); const QString qtHeaderData = qmakeProperty(m_versionInfo, "QT_INSTALL_HEADERS"); - if (!qtInstallData.isNull()) { - if (!qtInstallData.isEmpty()) { + + if (!qtInstallBins.isNull()) { + if (!qtInstallBins.isEmpty()) { m_hasQmlDump - = !QmlDumpTool::toolForQtPaths(qtInstallData, qtInstallBins, qtHeaderData, false).isEmpty() - || !QmlDumpTool::toolForQtPaths(qtInstallData, qtInstallBins, qtHeaderData, true).isEmpty(); + = !QmlDumpTool::toolForQtPaths(qtInstallBins, false).isEmpty() + || !QmlDumpTool::toolForQtPaths(qtInstallBins, true).isEmpty(); } } @@ -1300,12 +1301,8 @@ Environment BaseQtVersion::qmlToolsEnvironment() const QString BaseQtVersion::qmlDumpTool(bool debugVersion) const { - const QString qtInstallData = qmakeProperty("QT_INSTALL_DATA"); - if (qtInstallData.isEmpty()) - return QString(); const QString qtInstallBins = qmakeProperty("QT_INSTALL_BINS"); - const QString qtHeaderData = qmakeProperty("QT_INSTALL_HEADERS"); - return QmlDumpTool::toolForQtPaths(qtInstallData, qtInstallBins, qtHeaderData, debugVersion); + return QmlDumpTool::toolForQtPaths(qtInstallBins, debugVersion); } void BaseQtVersion::recheckDumper() diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index 5bada03e60..c50497601d 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASEQTVERSION_H -#define BASEQTVERSION_H +#pragma once #include "qtsupport_global.h" @@ -304,4 +303,3 @@ private: } Q_DECLARE_OPERATORS_FOR_FLAGS(QtSupport::BaseQtVersion::QmakeBuildConfigs) -#endif // BASEQTVERSION_H diff --git a/src/plugins/qtsupport/codegenerator.h b/src/plugins/qtsupport/codegenerator.h index d52da62a6d..dd916518cb 100644 --- a/src/plugins/qtsupport/codegenerator.h +++ b/src/plugins/qtsupport/codegenerator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CODEGENERATOR_H -#define CODEGENERATOR_H +#pragma once #include "qtsupport_global.h" @@ -54,5 +53,3 @@ public: }; } // namespace QtSupport - -#endif // CODEGENERATOR_H diff --git a/src/plugins/qtsupport/codegensettings.h b/src/plugins/qtsupport/codegensettings.h index b9d0e78a57..a5973683a2 100644 --- a/src/plugins/qtsupport/codegensettings.h +++ b/src/plugins/qtsupport/codegensettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CODEGENSETTINGS_H -#define CODEGENSETTINGS_H +#pragma once #include "qtsupport_global.h" @@ -59,5 +58,3 @@ inline bool operator==(const CodeGenSettings &p1, const CodeGenSettings &p2) { r inline bool operator!=(const CodeGenSettings &p1, const CodeGenSettings &p2) { return !p1.equals(p2); } } // namespace QtSupport - -#endif // CODEGENSETTINGS_H diff --git a/src/plugins/qtsupport/codegensettingspage.h b/src/plugins/qtsupport/codegensettingspage.h index 83a9c3a584..73a053ca5b 100644 --- a/src/plugins/qtsupport/codegensettingspage.h +++ b/src/plugins/qtsupport/codegensettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CODEGENSETTINGSPAGE_H -#define CODEGENSETTINGSPAGE_H +#pragma once #include "ui_codegensettingspagewidget.h" @@ -69,5 +68,3 @@ private: } // namespace Internal } // namespace QtSupport - -#endif // CODEGENSETTINGSPAGE_H diff --git a/src/plugins/qtsupport/customexecutableconfigurationwidget.h b/src/plugins/qtsupport/customexecutableconfigurationwidget.h index 10e3a031ec..fe247de069 100644 --- a/src/plugins/qtsupport/customexecutableconfigurationwidget.h +++ b/src/plugins/qtsupport/customexecutableconfigurationwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMEXECUTABLECONFIGURATIONWIDGET_H -#define CUSTOMEXECUTABLECONFIGURATIONWIDGET_H +#pragma once #include <QWidget> @@ -83,5 +82,3 @@ private: } // namespace Internal } // namespace QtSupport - -#endif // CUSTOMEXECUTABLECONFIGURATIONWIDGET_H diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.h b/src/plugins/qtsupport/customexecutablerunconfiguration.h index 0b980ded78..b7370a0911 100644 --- a/src/plugins/qtsupport/customexecutablerunconfiguration.h +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMEXECUTABLERUNCONFIGURATION_H -#define CUSTOMEXECUTABLERUNCONFIGURATION_H +#pragma once #include "qtsupport_global.h" @@ -123,5 +122,3 @@ private: }; } // namespace QtSupport - -#endif // CUSTOMEXECUTABLERUNCONFIGURATION_H diff --git a/src/plugins/qtsupport/desktopqtversion.h b/src/plugins/qtsupport/desktopqtversion.h index 9aff38fe53..9ce26f74c5 100644 --- a/src/plugins/qtsupport/desktopqtversion.h +++ b/src/plugins/qtsupport/desktopqtversion.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESKTOPQTVERSION_H -#define DESKTOPQTVERSION_H +#pragma once #include "baseqtversion.h" @@ -52,5 +51,3 @@ public: } // Internal } // QtSupport - -#endif // DESKTOPQTVERSION_H diff --git a/src/plugins/qtsupport/desktopqtversionfactory.h b/src/plugins/qtsupport/desktopqtversionfactory.h index 332498eb4d..6c29ceb886 100644 --- a/src/plugins/qtsupport/desktopqtversionfactory.h +++ b/src/plugins/qtsupport/desktopqtversionfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DESKTOPQTVERSIONFACTORY_H -#define DESKTOPQTVERSIONFACTORY_H +#pragma once #include "qtversionfactory.h" @@ -46,5 +45,3 @@ public: } // Internal } // QtSupport - -#endif // DESKTOPQTVERSIONFACTORY_H diff --git a/src/plugins/qtsupport/exampleslistmodel.h b/src/plugins/qtsupport/exampleslistmodel.h index 228aafc676..1c25b3a642 100644 --- a/src/plugins/qtsupport/exampleslistmodel.h +++ b/src/plugins/qtsupport/exampleslistmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EXAMPLESLISTMODEL_H -#define EXAMPLESLISTMODEL_H +#pragma once #include <QAbstractListModel> #include <QSortFilterProxyModel> @@ -236,7 +235,3 @@ private: } // namespace Internal } // namespace QtSupport - -#endif // EXAMPLESLISTMODEL_H - - diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.h b/src/plugins/qtsupport/gettingstartedwelcomepage.h index 72a75634bf..689e75fb4a 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.h +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GETTINGSTARTEDWELCOMEPAGE_H -#define GETTINGSTARTEDWELCOMEPAGE_H +#pragma once #include <coreplugin/iwelcomepage.h> @@ -72,5 +71,3 @@ private: } // namespace Internal } // namespace QtSupport - -#endif // GETTINGSTARTEDWELCOMEPAGE_H diff --git a/src/plugins/qtsupport/profilereader.h b/src/plugins/qtsupport/profilereader.h index 890463bd73..9c750c60b9 100644 --- a/src/plugins/qtsupport/profilereader.h +++ b/src/plugins/qtsupport/profilereader.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROFILEREADER_H -#define PROFILEREADER_H +#pragma once #include "qtsupport_global.h" @@ -113,5 +112,3 @@ private: }; } // namespace QtSupport - -#endif // PROFILEREADER_H diff --git a/src/plugins/qtsupport/qmldumptool.cpp b/src/plugins/qtsupport/qmldumptool.cpp index 60777ac212..4f35679942 100644 --- a/src/plugins/qtsupport/qmldumptool.cpp +++ b/src/plugins/qtsupport/qmldumptool.cpp @@ -44,19 +44,6 @@ namespace QtSupport { -static inline QStringList validBinaryFilenames(bool debugBuild) -{ - QStringList list = QStringList() - << QLatin1String("qmldump.exe") - << QLatin1String("qmldump") - << QLatin1String("qmldump.app/Contents/MacOS/qmldump"); - if (debugBuild) - list.prepend(QLatin1String("debug/qmldump.exe")); - else - list.prepend(QLatin1String("release/qmldump.exe")); - return list; -} - static inline QStringList validPrebuiltFilenames(bool debugBuild) { QStringList list = QStringList(QLatin1String("qmlplugindump")); @@ -68,74 +55,18 @@ static inline QStringList validPrebuiltFilenames(bool debugBuild) return list; } -static bool hasPrivateHeaders(const QString &qtInstallHeaders) { - const QString header = qtInstallHeaders - + QLatin1String("/QtDeclarative/private/qdeclarativemetatype_p.h"); - return QFile::exists(header); -} - -bool QmlDumpTool::canBuild(const BaseQtVersion *qtVersion, QString *reason) -{ - const QString installHeaders = qtVersion->qmakeProperty("QT_INSTALL_HEADERS"); - - if (qtVersion->type() != QLatin1String(Constants::DESKTOPQT)) { - if (reason) - *reason = QCoreApplication::translate("QmakeProjectManager::QmlDumpTool", "Only available for Qt for Desktop."); - return false; - } - if (qtVersion->qtVersion() < QtVersionNumber(4, 7, 1)) { - if (reason) - *reason = QCoreApplication::translate("QmakeProjectManager::QmlDumpTool", "Only available for Qt 4.7.1 or newer."); - return false; - } - if (qtVersion->qtVersion() >= QtVersionNumber(4, 8, 0)) { - if (reason) - *reason = QCoreApplication::translate("QmakeProjectManager::QmlDumpTool", "Not needed."); - return false; - } - - - if (!hasPrivateHeaders(installHeaders)) { - if (reason) - *reason = QCoreApplication::translate("QmakeProjectManager::QmlDumpTool", "Private headers are missing for this Qt version."); - return false; - } - return true; -} - QString QmlDumpTool::toolForVersion(BaseQtVersion *version, bool debugDump) { if (version) { - const QString qtInstallData = version->qmakeProperty("QT_INSTALL_DATA"); const QString qtInstallBins = version->qmakeProperty("QT_INSTALL_BINS"); - const QString qtInstallHeaders = version->qmakeProperty("QT_INSTALL_HEADERS"); - return toolForQtPaths(qtInstallData, qtInstallBins, qtInstallHeaders, debugDump); + return toolForQtPaths(qtInstallBins, debugDump); } return QString(); } -static QString sourcePath() -{ - return Core::ICore::resourcePath() + QLatin1String("/qml/qmldump/"); -} - -static QStringList sourceFileNames() -{ - QStringList files; - files << QLatin1String("main.cpp") << QLatin1String("qmldump.pro") - << QLatin1String("qmlstreamwriter.cpp") << QLatin1String("qmlstreamwriter.h") - << QLatin1String("LICENSE.LGPLv21") << QLatin1String("LICENSE.LGPLv3") - << QLatin1String("LGPL_EXCEPTION.TXT"); - if (Utils::HostOsInfo::isMacHost()) - files << QLatin1String("Info.plist"); - return files; -} - -QString QmlDumpTool::toolForQtPaths(const QString &qtInstallData, - const QString &qtInstallBins, - const QString &qtInstallHeaders, - bool debugDump) +QString QmlDumpTool::toolForQtPaths(const QString &qtInstallBins, + bool debugDump) { if (!Core::ICore::instance()) return QString(); @@ -145,59 +76,9 @@ QString QmlDumpTool::toolForQtPaths(const QString &qtInstallData, if (getHelperFileInfoFor(validPrebuiltFilenames(debugDump), qtInstallBins + QLatin1Char('/'), &fileInfo)) return fileInfo.absoluteFilePath(); - const QStringList directories = installDirectories(qtInstallData); - const QStringList binFilenames = validBinaryFilenames(debugDump); - - return byInstallDataHelper(sourcePath(), sourceFileNames(), directories, binFilenames, - !hasPrivateHeaders(qtInstallHeaders)); -} - -QStringList QmlDumpTool::locationsByInstallData(const QString &qtInstallData, bool debugDump) -{ - QStringList result; - QFileInfo fileInfo; - const QStringList binFilenames = validBinaryFilenames(debugDump); - foreach (const QString &directory, installDirectories(qtInstallData)) { - if (getHelperFileInfoFor(binFilenames, directory, &fileInfo)) - result << fileInfo.filePath(); - } - return result; -} - -bool QmlDumpTool::build(BuildHelperArguments arguments, QString *log, QString *errorMessage) -{ - arguments.helperName = QCoreApplication::translate("QmakeProjectManager::QmlDumpTool", "qmldump"); - arguments.proFilename = QLatin1String("qmldump.pro"); - return buildHelper(arguments, log, errorMessage); -} - -QString QmlDumpTool::copy(const QString &qtInstallData, QString *errorMessage) -{ - const QStringList directories = QmlDumpTool::installDirectories(qtInstallData); - - // Try to find a writeable directory. - foreach (const QString &directory, directories) { - if (copyFiles(sourcePath(), sourceFileNames(), directory, errorMessage)) - return directory; - } - *errorMessage = QCoreApplication::translate("ProjectExplorer::QmlDumpTool", - "qmldump could not be built in any of the directories:\n- %1\n\nReason: %2") - .arg(directories.join(QLatin1String("\n- ")), *errorMessage); return QString(); } -QStringList QmlDumpTool::installDirectories(const QString &qtInstallData) -{ - const QChar slash = QLatin1Char('/'); - const uint hash = qHash(qtInstallData); - QStringList directories; - directories - << (qtInstallData + QLatin1String("/qtc-qmldump/")) - << QDir::cleanPath((QCoreApplication::applicationDirPath() + QLatin1String("/../qtc-qmldump/") + QString::number(hash))) + slash - << (QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/data/qtc-qmldump/") + QString::number(hash)) + slash; - return directories; -} - void QmlDumpTool::pathAndEnvironment(BaseQtVersion *version, bool preferDebug, QString *dumperPath, Utils::Environment *env) { diff --git a/src/plugins/qtsupport/qmldumptool.h b/src/plugins/qtsupport/qmldumptool.h index 1458021f13..a3568475cc 100644 --- a/src/plugins/qtsupport/qmldumptool.h +++ b/src/plugins/qtsupport/qmldumptool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMLDUMPTOOL_H -#define QMLDUMPTOOL_H +#pragma once #include "qtsupport_global.h" @@ -43,28 +42,12 @@ class BaseQtVersion; class QTSUPPORT_EXPORT QmlDumpTool : public Utils::BuildableHelperLibrary { public: - static bool canBuild(const BaseQtVersion *qtVersion, QString *reason = 0); static QString toolForVersion(BaseQtVersion *version, bool debugDump); - static QString toolForQtPaths(const QString &qtInstallData, - const QString &qtInstallBins, - const QString &qtInstallHeaders, + static QString toolForQtPaths(const QString &qtInstallBins, bool debugDump); - static QStringList locationsByInstallData(const QString &qtInstallData, bool debugDump); - - // Build the helpers and return the output log/errormessage. - static bool build(BuildHelperArguments arguments, QString *log, QString *errorMessage); - - // Copy the source files to a target location and return the chosen target location. - static QString copy(const QString &qtInstallData, QString *errorMessage); static void pathAndEnvironment(BaseQtVersion *version, bool preferDebug, QString *path, Utils::Environment *env); - -private: - static QStringList installDirectories(const QString &qtInstallData); - }; } // namespace - -#endif // QMLDUMPTOOL_H diff --git a/src/plugins/qtsupport/qtconfigwidget.h b/src/plugins/qtsupport/qtconfigwidget.h index d81f95c35d..1518463829 100644 --- a/src/plugins/qtsupport/qtconfigwidget.h +++ b/src/plugins/qtsupport/qtconfigwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTCONFIGWIDGET_H -#define QTCONFIGWIDGET_H +#pragma once #include "qtsupport_global.h" @@ -41,5 +40,3 @@ signals: void changed(); }; } // namespace QtSupport - -#endif // QTCONFIGWIDGET_H diff --git a/src/plugins/qtsupport/qtkitconfigwidget.h b/src/plugins/qtsupport/qtkitconfigwidget.h index 9035b2b86e..8ab1a950a9 100644 --- a/src/plugins/qtsupport/qtkitconfigwidget.h +++ b/src/plugins/qtsupport/qtkitconfigwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTSUPPORT_QTKITCONFIGWIDGET_H -#define QTSUPPORT_QTKITCONFIGWIDGET_H +#pragma once #include <projectexplorer/kitconfigwidget.h> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace Debugger - -#endif // QTSUPPORT_QTYSTEMCONFIGWIDGET_H diff --git a/src/plugins/qtsupport/qtkitinformation.h b/src/plugins/qtsupport/qtkitinformation.h index 2dd7ecc55a..2dd08ca4fd 100644 --- a/src/plugins/qtsupport/qtkitinformation.h +++ b/src/plugins/qtsupport/qtkitinformation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTSUPPORT_QTKITINFORMATION_H -#define QTSUPPORT_QTKITINFORMATION_H +#pragma once #include "qtsupport_global.h" @@ -80,5 +79,3 @@ private slots: }; } // namespace QtSupport - -#endif // QTSUPPORT_QTKITINFORMATION_H diff --git a/src/plugins/qtsupport/qtoptionspage.h b/src/plugins/qtsupport/qtoptionspage.h index 710f5f37ae..99c3804a7e 100644 --- a/src/plugins/qtsupport/qtoptionspage.h +++ b/src/plugins/qtsupport/qtoptionspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTOPTIONSPAGE_H -#define QTOPTIONSPAGE_H +#pragma once #include <coreplugin/dialogs/ioptionspage.h> #include <utils/fileutils.h> @@ -141,6 +140,3 @@ private: } //namespace Internal } //namespace QtSupport - - -#endif // QTOPTIONSPAGE_H diff --git a/src/plugins/qtsupport/qtoutputformatter.h b/src/plugins/qtsupport/qtoutputformatter.h index 3c0daaaef6..0d184ad8d8 100644 --- a/src/plugins/qtsupport/qtoutputformatter.h +++ b/src/plugins/qtsupport/qtoutputformatter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTOUTPUTFORMATTER_H -#define QTOUTPUTFORMATTER_H +#pragma once #include "qtsupport_global.h" @@ -83,5 +82,3 @@ private: } // namespace QtSupport - -#endif // QTOUTPUTFORMATTER_H diff --git a/src/plugins/qtsupport/qtparser.h b/src/plugins/qtsupport/qtparser.h index 20bfff9293..91b74a4aaa 100644 --- a/src/plugins/qtsupport/qtparser.h +++ b/src/plugins/qtsupport/qtparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTPARSER_H -#define QTPARSER_H +#pragma once #include "qtsupport_global.h" #include <projectexplorer/ioutputparser.h> @@ -47,5 +46,3 @@ private: }; } // namespace ProjectExplorer - -#endif // QTPARSER_H diff --git a/src/plugins/qtsupport/qtsupport_global.h b/src/plugins/qtsupport/qtsupport_global.h index fec90a4c85..993bfcdb08 100644 --- a/src/plugins/qtsupport/qtsupport_global.h +++ b/src/plugins/qtsupport/qtsupport_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTSUPPORT_GLOBAL_H -#define QTSUPPORT_GLOBAL_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define QTSUPPORT_EXPORT Q_DECL_IMPORT #endif - -#endif diff --git a/src/plugins/qtsupport/qtsupportconstants.h b/src/plugins/qtsupport/qtsupportconstants.h index 551e201c2e..e9c0c61005 100644 --- a/src/plugins/qtsupport/qtsupportconstants.h +++ b/src/plugins/qtsupport/qtsupportconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTSUPPORTCONSTANTS_H -#define QTSUPPORTCONSTANTS_H +#pragma once namespace QtSupport { namespace Constants { @@ -64,5 +63,3 @@ const char ICON_QT_PROJECT[] = ":/qtsupport/images/qt_project.png"; } // namepsace Constants } // namepsace QtSupport - -#endif // QTSUPPORTCONSTANTS_H diff --git a/src/plugins/qtsupport/qtsupportplugin.h b/src/plugins/qtsupport/qtsupportplugin.h index d8f9247143..e62791533b 100644 --- a/src/plugins/qtsupport/qtsupportplugin.h +++ b/src/plugins/qtsupport/qtsupportplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTSUPPORTPLUGIN_H -#define QTSUPPORTPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -56,5 +55,3 @@ private slots: } // namespace Internal } // namespace QtSupport - -#endif // QTSUPPORTPLUGIN_H diff --git a/src/plugins/qtsupport/qtversionfactory.h b/src/plugins/qtsupport/qtversionfactory.h index e2c5ebc3c0..d789717408 100644 --- a/src/plugins/qtsupport/qtversionfactory.h +++ b/src/plugins/qtsupport/qtversionfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTVERSIONFACTORY_H -#define QTVERSIONFACTORY_H +#pragma once #include "qtsupport_global.h" @@ -63,5 +62,3 @@ public: }; } // namespace QtSupport - -#endif // QTVERSIONFACTORY_H diff --git a/src/plugins/qtsupport/qtversionmanager.h b/src/plugins/qtsupport/qtversionmanager.h index 6333083878..eedbcc0823 100644 --- a/src/plugins/qtsupport/qtversionmanager.h +++ b/src/plugins/qtsupport/qtversionmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTVERSIONMANAGER_H -#define QTVERSIONMANAGER_H +#pragma once #include "qtsupport_global.h" #include "baseqtversion.h" @@ -86,5 +85,3 @@ private: }; } // namespace QtSupport - -#endif // QTVERSIONMANAGER_H diff --git a/src/plugins/qtsupport/screenshotcropper.h b/src/plugins/qtsupport/screenshotcropper.h index 75508538d9..5fb493bc7d 100644 --- a/src/plugins/qtsupport/screenshotcropper.h +++ b/src/plugins/qtsupport/screenshotcropper.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SCREENSHOTCROPPER_H -#define SCREENSHOTCROPPER_H +#pragma once #include <QMap> #include <QRect> @@ -43,5 +42,3 @@ public: } // namespace Internal } // namespace QtSupport - -#endif // SCREENSHOTCROPPER_H diff --git a/src/plugins/qtsupport/uicgenerator.h b/src/plugins/qtsupport/uicgenerator.h index c7ce3d58c4..b0253eb73c 100644 --- a/src/plugins/qtsupport/uicgenerator.h +++ b/src/plugins/qtsupport/uicgenerator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UICGENERATOR_H -#define UICGENERATOR_H +#pragma once #include <projectexplorer/extracompiler.h> #include <utils/fileutils.h> @@ -62,4 +61,3 @@ public: }; } // QtSupport -#endif // UICGENERATOR_H diff --git a/src/plugins/qtsupport/winceqtversion.h b/src/plugins/qtsupport/winceqtversion.h index 954202c0c7..42ff5bd749 100644 --- a/src/plugins/qtsupport/winceqtversion.h +++ b/src/plugins/qtsupport/winceqtversion.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINCEQTVERSION_H -#define WINCEQTVERSION_H +#pragma once #include "baseqtversion.h" @@ -56,5 +55,3 @@ private: } // Internal } // QtSupport - -#endif // WINCEQTVERSION_H diff --git a/src/plugins/qtsupport/winceqtversionfactory.h b/src/plugins/qtsupport/winceqtversionfactory.h index 93937c36ac..0199f28ab6 100644 --- a/src/plugins/qtsupport/winceqtversionfactory.h +++ b/src/plugins/qtsupport/winceqtversionfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINCEQTVERSIONFACTORY_H -#define WINCEQTVERSIONFACTORY_H +#pragma once #include "qtversionfactory.h" @@ -49,5 +48,3 @@ public: } // Internal } // QtSupport - -#endif // WINCEQTVERSIONFACTORY_H diff --git a/src/plugins/remotelinux/abstractpackagingstep.h b/src/plugins/remotelinux/abstractpackagingstep.h index fbf8575d51..5b3dfb9cc0 100644 --- a/src/plugins/remotelinux/abstractpackagingstep.h +++ b/src/plugins/remotelinux/abstractpackagingstep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ABSTRACTPACKAGINGSTEP_H -#define ABSTRACTPACKAGINGSTEP_H +#pragma once #include "remotelinux_export.h" @@ -77,5 +76,3 @@ private: }; } // namespace RemoteLinux - -#endif // ABSTRACTPACKAGINGSTEP_H diff --git a/src/plugins/remotelinux/abstractremotelinuxdeployservice.h b/src/plugins/remotelinux/abstractremotelinuxdeployservice.h index d21f9e25d7..8efb793953 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeployservice.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeployservice.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ABSTRACTREMOTELINUXDEPLOYSERVICE_H -#define ABSTRACTREMOTELINUXDEPLOYSERVICE_H +#pragma once #include "remotelinux_export.h" @@ -69,6 +68,7 @@ signals: void warningMessage(const QString &message); void stdOutData(const QString &data); void stdErrData(const QString &data); + void finished(); // Used by Qnx. protected: const ProjectExplorer::Target *target() const; @@ -87,8 +87,6 @@ private slots: void handleConnectionFailure(); private: - Q_SIGNAL void finished(); - virtual bool isDeploymentNecessary() const = 0; // Should do things needed *before* connecting. Call handleDeviceSetupDone() afterwards. @@ -104,5 +102,3 @@ private: }; } // namespace RemoteLinux - -#endif // ABSTRACTREMOTELINUXDEPLOYSERVICE_H diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h index 65534555d1..12d8fd547c 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ABSTRACTREMOTELINUXDEPLOYSTEP_H -#define ABSTRACTREMOTELINUXDEPLOYSTEP_H +#pragma once #include "remotelinux_export.h" @@ -74,5 +73,3 @@ private: }; } // namespace RemoteLinux - -#endif // ABSTRACTREMOTELINUXDEPLOYSTEP_H diff --git a/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp b/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp index ca93f69617..5277e73841 100644 --- a/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp @@ -128,10 +128,10 @@ void AbstractRemoteLinuxRunSupport::setFinished() d->state = Inactive; } -bool AbstractRemoteLinuxRunSupport::setPort(int &port) +bool AbstractRemoteLinuxRunSupport::setPort(Utils::Port &port) { port = d->portsGatherer.getNextFreePort(&d->portList); - if (port == -1) { + if (!port.isValid()) { handleAdapterSetupFailed(tr("Not enough free ports on device for debugging.")); return false; } diff --git a/src/plugins/remotelinux/abstractremotelinuxrunsupport.h b/src/plugins/remotelinux/abstractremotelinuxrunsupport.h index 7db1a6f7a1..71745b5f3e 100644 --- a/src/plugins/remotelinux/abstractremotelinuxrunsupport.h +++ b/src/plugins/remotelinux/abstractremotelinuxrunsupport.h @@ -23,12 +23,12 @@ ** ****************************************************************************/ -#ifndef ABSTRACTREMOTELINUXRUNSUPPORT_H -#define ABSTRACTREMOTELINUXRUNSUPPORT_H +#pragma once #include "remotelinux_export.h" #include <projectexplorer/devicesupport/idevice.h> +#include <utils/port.h> #include <QObject> @@ -69,7 +69,7 @@ protected: virtual void handleAdapterSetupDone(); void setFinished(); - bool setPort(int &port); + bool setPort(Utils::Port &port); const ProjectExplorer::IDevice::ConstPtr device() const; const ProjectExplorer::StandardRunnable &runnable() const; @@ -94,5 +94,3 @@ private: }; } // namespace RemoteLinux - -#endif // ABSTRACTREMOTELINUXRUNSUPPORT_H diff --git a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.h b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.h index c24349a883..d646323639 100644 --- a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.h +++ b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ABSTRACTUPLOADANDINSTALLPACKAGESERVICE_H -#define ABSTRACTUPLOADANDINSTALLPACKAGESERVICE_H +#pragma once #include "abstractremotelinuxdeployservice.h" #include "remotelinux_export.h" @@ -67,5 +66,3 @@ private: }; } // namespace RemoteLinux - -#endif // ABSTRACTUPLOADANDINSTALLPACKAGESERVICE_H diff --git a/src/plugins/remotelinux/embeddedlinuxqtversion.h b/src/plugins/remotelinux/embeddedlinuxqtversion.h index 72520dd712..6bad126f28 100644 --- a/src/plugins/remotelinux/embeddedlinuxqtversion.h +++ b/src/plugins/remotelinux/embeddedlinuxqtversion.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EMBEDDEDLINUXQTVERSION_H -#define EMBEDDEDLINUXQTVERSION_H +#pragma once #include <qtsupport/baseqtversion.h> @@ -50,5 +49,3 @@ public: } // namespace Internal } // namespace RemoteLinux - -#endif // EMBEDDEDLINUXQTVERSION_H diff --git a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h index e6248aecb4..2c48501941 100644 --- a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h +++ b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef EMBEDDEDLINUXQTVERSIONFACTORY_H -#define EMBEDDEDLINUXQTVERSIONFACTORY_H +#pragma once #include <qtsupport/qtversionfactory.h> @@ -48,5 +47,3 @@ public: } // Internal } // RemoteLinux - -#endif // EMBEDDEDLINUXQTVERSIONFACTORY_H diff --git a/src/plugins/remotelinux/genericdirectuploadservice.h b/src/plugins/remotelinux/genericdirectuploadservice.h index 1b9b63c179..a015bc6500 100644 --- a/src/plugins/remotelinux/genericdirectuploadservice.h +++ b/src/plugins/remotelinux/genericdirectuploadservice.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GERNERICDIRECTDEVICEUPLOADSERVICE_H -#define GERNERICDIRECTDEVICEUPLOADSERVICE_H +#pragma once #include "abstractremotelinuxdeployservice.h" #include "remotelinux_export.h" @@ -79,5 +78,3 @@ private: }; } //namespace RemoteLinux - -#endif // GERNERICDIRECTDEVICEUPLOADSERVICE_H diff --git a/src/plugins/remotelinux/genericdirectuploadstep.h b/src/plugins/remotelinux/genericdirectuploadstep.h index 0169ca1136..2ed99b2c18 100644 --- a/src/plugins/remotelinux/genericdirectuploadstep.h +++ b/src/plugins/remotelinux/genericdirectuploadstep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIRECTUPLOADSTEP_H -#define DIRECTUPLOADSTEP_H +#pragma once #include "abstractremotelinuxdeploystep.h" #include "genericdirectuploadservice.h" @@ -65,5 +64,3 @@ private: }; } //namespace RemoteLinux - -#endif // DIRECTUPLOADSTEP_H diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationfactory.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationfactory.h index a82e1de00d..e00bbebf56 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationfactory.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GENERICLINUXDEVICECONFIGURATIONFACTORY_H -#define GENERICLINUXDEVICECONFIGURATIONFACTORY_H +#pragma once #include "remotelinux_export.h" @@ -49,5 +48,3 @@ public: }; } // namespace RemoteLinux - -#endif // GENERICLINUXDEVICECONFIGURATIONFACTORY_H diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h index a45b8f6b16..5017439cfe 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUX_GENERICLINUXDEVICECONFIGURATIONWIDGET_H -#define REMOTELINUX_GENERICLINUXDEVICECONFIGURATIONWIDGET_H +#pragma once #include <projectexplorer/devicesupport/idevicewidget.h> @@ -68,5 +67,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUX_GENERICLINUXDEVICECONFIGURATIONWIDGET_H diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h index 64a3581515..5db089bb6a 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GENERICLINUXDEVICECONFIGURATIONWIZARD_H -#define GENERICLINUXDEVICECONFIGURATIONWIZARD_H +#pragma once #include "remotelinux_export.h" @@ -49,5 +48,3 @@ private: }; } // namespace RemoteLinux - -#endif // GENERICLINUXDEVICECONFIGURATIONWIZARD_H diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h index 93af5921d0..88e5ea315e 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GENERICLINUXDEVICECONFIGURATIONWIZARDPAGES_H -#define GENERICLINUXDEVICECONFIGURATIONWIZARDPAGES_H +#pragma once #include "remotelinux_export.h" @@ -85,5 +84,3 @@ private: }; } // namespace RemoteLinux - -#endif // GENERICLINUXDEVICECONFIGURATIONWIZARDPAGES_H diff --git a/src/plugins/remotelinux/genericremotelinuxdeploystepfactory.h b/src/plugins/remotelinux/genericremotelinuxdeploystepfactory.h index 812a2c9e91..939f071b1f 100644 --- a/src/plugins/remotelinux/genericremotelinuxdeploystepfactory.h +++ b/src/plugins/remotelinux/genericremotelinuxdeploystepfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GENERICREMOTELINUXDEPLOYSTEPFACTORY_H -#define GENERICREMOTELINUXDEPLOYSTEPFACTORY_H +#pragma once #include <projectexplorer/buildstep.h> @@ -52,5 +51,3 @@ public: } // namespace Internal } // namespace RemoteLinux - -#endif // GENERICREMOTELINUXDEPLOYSTEPFACTORY_H diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 6675a2aeb4..c3ad42f3b2 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -37,6 +37,7 @@ #include <projectexplorer/devicesupport/sshdeviceprocesslist.h> #include <ssh/sshremoteprocessrunner.h> #include <utils/algorithm.h> +#include <utils/port.h> #include <utils/qtcassert.h> #include <QTimer> @@ -137,15 +138,15 @@ class LinuxPortsGatheringMethod : public PortsGatheringMethod return "sed -e 's/.*: [[:xdigit:]]*:\\([[:xdigit:]]\\{4\\}\\).*/\\1/g' /proc/net/tcp*"; } - QList<int> usedPorts(const QByteArray &output) const + QList<Utils::Port> usedPorts(const QByteArray &output) const { - QList<int> ports; + QList<Utils::Port> ports; QList<QByteArray> portStrings = output.split('\n'); foreach (const QByteArray &portString, portStrings) { if (portString.size() != 4) continue; bool ok; - const int port = portString.toInt(&ok, 16); + const Utils::Port port(portString.toInt(&ok, 16)); if (ok) { if (!ports.contains(port)) ports << port; diff --git a/src/plugins/remotelinux/linuxdevice.h b/src/plugins/remotelinux/linuxdevice.h index 4f18a17704..f9469abeb5 100644 --- a/src/plugins/remotelinux/linuxdevice.h +++ b/src/plugins/remotelinux/linuxdevice.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LINUXDEVICECONFIGURATION_H -#define LINUXDEVICECONFIGURATION_H +#pragma once #include "remotelinux_export.h" @@ -79,5 +78,3 @@ private: }; } // namespace RemoteLinux - -#endif // LINUXDEVICECONFIGURATION_H diff --git a/src/plugins/remotelinux/linuxdeviceprocess.h b/src/plugins/remotelinux/linuxdeviceprocess.h index 8f1e2acfcb..9948d6ad07 100644 --- a/src/plugins/remotelinux/linuxdeviceprocess.h +++ b/src/plugins/remotelinux/linuxdeviceprocess.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTC_LINUXDEVICEPROCESS_H -#define QTC_LINUXDEVICEPROCESS_H +#pragma once #include "remotelinux_export.h" @@ -53,5 +52,3 @@ private: }; } // namespace RemoteLinux - -#endif // Include guard. diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp index 4a0e9fa35b..56e2e290dc 100644 --- a/src/plugins/remotelinux/linuxdevicetester.cpp +++ b/src/plugins/remotelinux/linuxdevicetester.cpp @@ -26,6 +26,7 @@ #include "linuxdevicetester.h" #include <projectexplorer/devicesupport/deviceusedportsgatherer.h> +#include <utils/port.h> #include <utils/qtcassert.h> #include <ssh/sshremoteprocess.h> #include <ssh/sshconnection.h> @@ -169,8 +170,8 @@ void GenericLinuxDeviceTester::handlePortListReady() emit progressMessage(tr("All specified ports are available.") + QLatin1Char('\n')); } else { QString portList; - foreach (const int port, d->portsGatherer.usedPorts()) - portList += QString::number(port) + QLatin1String(", "); + foreach (const Utils::Port port, d->portsGatherer.usedPorts()) + portList += QString::number(port.number()) + QLatin1String(", "); portList.remove(portList.count() - 2, 2); emit errorMessage(tr("The following specified ports are currently in use: %1") .arg(portList) + QLatin1Char('\n')); diff --git a/src/plugins/remotelinux/linuxdevicetester.h b/src/plugins/remotelinux/linuxdevicetester.h index bf055e3127..e06e4d5448 100644 --- a/src/plugins/remotelinux/linuxdevicetester.h +++ b/src/plugins/remotelinux/linuxdevicetester.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LINUXDEVICETESTER_H -#define LINUXDEVICETESTER_H +#pragma once #include "remotelinux_export.h" @@ -65,5 +64,3 @@ private: }; } // namespace RemoteLinux - -#endif // LINUXDEVICETESTER_H diff --git a/src/plugins/remotelinux/packageuploader.h b/src/plugins/remotelinux/packageuploader.h index 74e3b514a6..dce0d864ba 100644 --- a/src/plugins/remotelinux/packageuploader.h +++ b/src/plugins/remotelinux/packageuploader.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PACKAGEUPLOADER_H -#define PACKAGEUPLOADER_H +#pragma once #include <QObject> #include <QSharedPointer> @@ -77,5 +76,3 @@ private: } // namespace Internal } // namespace RemoteLinux - -#endif // PACKAGEUPLOADER_H diff --git a/src/plugins/remotelinux/publickeydeploymentdialog.h b/src/plugins/remotelinux/publickeydeploymentdialog.h index 2c0b7a1278..94e5c4b3f4 100644 --- a/src/plugins/remotelinux/publickeydeploymentdialog.h +++ b/src/plugins/remotelinux/publickeydeploymentdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PUBLICKEYDEPLOYMENTDIALOG_H -#define PUBLICKEYDEPLOYMENTDIALOG_H +#pragma once #include "remotelinux_export.h" @@ -59,5 +58,3 @@ private: }; } // namespace RemoteLinux - -#endif // PUBLICKEYDEPLOYMENTDIALOG_H diff --git a/src/plugins/remotelinux/remotelinux_constants.h b/src/plugins/remotelinux/remotelinux_constants.h index 37914faf30..43bd85fe87 100644 --- a/src/plugins/remotelinux/remotelinux_constants.h +++ b/src/plugins/remotelinux/remotelinux_constants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUX_CONSTANTS_H -#define REMOTELINUX_CONSTANTS_H +#pragma once namespace RemoteLinux { namespace Constants { @@ -37,5 +36,3 @@ const char EMBEDDED_LINUX_QT[] = "RemoteLinux.EmbeddedLinuxQt"; } // Constants } // RemoteLinux - -#endif // REMOTELINUX_CONSTANTS_H diff --git a/src/plugins/remotelinux/remotelinux_export.h b/src/plugins/remotelinux/remotelinux_export.h index 46b3b17c0a..e9df11a1f0 100644 --- a/src/plugins/remotelinux/remotelinux_export.h +++ b/src/plugins/remotelinux/remotelinux_export.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTE_LINUX_EXPORT_H -#define REMOTE_LINUX_EXPORT_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define REMOTELINUX_EXPORT Q_DECL_IMPORT #endif - -#endif // REMOTE_LINUX_EXPORT_H diff --git a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp index e63baf8949..a1d963786e 100644 --- a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp +++ b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp @@ -57,14 +57,13 @@ class RemoteLinuxAnalyzeSupportPrivate public: RemoteLinuxAnalyzeSupportPrivate(AnalyzerRunControl *rc, Core::Id runMode) : runControl(rc), - qmlProfiling(runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE), - qmlPort(-1) + qmlProfiling(runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) { } const QPointer<AnalyzerRunControl> runControl; bool qmlProfiling; - int qmlPort; + Utils::Port qmlPort; QmlDebug::QmlOutputParser outputParser; }; @@ -135,8 +134,8 @@ void RemoteLinuxAnalyzeSupport::startExecution() auto r = runnable(); if (!r.commandLineArguments.isEmpty()) r.commandLineArguments.append(QLatin1Char(' ')); - r.commandLineArguments - += QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, d->qmlPort); + r.commandLineArguments += QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, + d->qmlPort); runner->start(device(), r); } diff --git a/src/plugins/remotelinux/remotelinuxanalyzesupport.h b/src/plugins/remotelinux/remotelinuxanalyzesupport.h index de083d38bc..ca93bcdda5 100644 --- a/src/plugins/remotelinux/remotelinuxanalyzesupport.h +++ b/src/plugins/remotelinux/remotelinuxanalyzesupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXANALYZESUPPORT_H -#define REMOTELINUXANALYZESUPPORT_H +#pragma once #include "abstractremotelinuxrunsupport.h" @@ -71,5 +70,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUXANALYZESUPPORT_H diff --git a/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.h b/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.h index 0c016c0a22..945cf564e5 100644 --- a/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.h +++ b/src/plugins/remotelinux/remotelinuxcheckforfreediskspaceservice.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXCHECKFORFREEDISKSPACESERVICE_H -#define REMOTELINUXCHECKFORFREEDISKSPACESERVICE_H +#pragma once #include "abstractremotelinuxdeployservice.h" @@ -60,5 +59,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUXCHECKFORFREEDISKSPACESERVICE_H diff --git a/src/plugins/remotelinux/remotelinuxcheckforfreediskspacestep.h b/src/plugins/remotelinux/remotelinuxcheckforfreediskspacestep.h index 1e78f5ba76..102e494be9 100644 --- a/src/plugins/remotelinux/remotelinuxcheckforfreediskspacestep.h +++ b/src/plugins/remotelinux/remotelinuxcheckforfreediskspacestep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXCHECKFORFREEDISKSPACESTEP_H -#define REMOTELINUXCHECKFORFREEDISKSPACESTEP_H +#pragma once #include "abstractremotelinuxdeploystep.h" @@ -65,5 +64,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUXCHECKFORFREEDISKSPACESTEP_H diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h index 7bfdc70af4..fd2ca29e87 100644 --- a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h +++ b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXCUSTOMCOMMANDDEPLOYMENTSTEP_H -#define REMOTELINUXCUSTOMCOMMANDDEPLOYMENTSTEP_H +#pragma once #include "abstractremotelinuxdeploystep.h" #include "remotelinuxcustomcommanddeployservice.h" @@ -87,5 +86,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUXCUSTOMCOMMANDDEPLOYMENTSTEP_H diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.h b/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.h index 5c17efd5f1..ddb84698d9 100644 --- a/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.h +++ b/src/plugins/remotelinux/remotelinuxcustomcommanddeployservice.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXCUSTOMCOMMANDDEPLOYSERVICE_H -#define REMOTELINUXCUSTOMCOMMANDDEPLOYSERVICE_H +#pragma once #include "abstractremotelinuxdeployservice.h" @@ -60,5 +59,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUXCUSTOMCOMMANDDEPLOYSERVICE_H diff --git a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h index 2bd4ebcbc4..be97dad96c 100644 --- a/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h +++ b/src/plugins/remotelinux/remotelinuxcustomrunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXCUSTOMRUNCONFIGURATION_H -#define REMOTELINUXCUSTOMRUNCONFIGURATION_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -69,5 +68,3 @@ private: } // namespace Internal } // namespace RemoteLinux - -#endif // Include guard. diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index 8316dbfedc..9981efbe27 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp @@ -60,8 +60,7 @@ public: LinuxDeviceDebugSupportPrivate(const RunConfiguration *runConfig, DebuggerRunControl *runControl) : runControl(runControl), qmlDebugging(runConfig->extraAspect<DebuggerRunConfigurationAspect>()->useQmlDebugger()), - cppDebugging(runConfig->extraAspect<DebuggerRunConfigurationAspect>()->useCppDebugger()), - gdbServerPort(-1), qmlPort(-1) + cppDebugging(runConfig->extraAspect<DebuggerRunConfigurationAspect>()->useCppDebugger()) { } @@ -69,8 +68,8 @@ public: bool qmlDebugging; bool cppDebugging; QByteArray gdbserverOutput; - int gdbServerPort; - int qmlPort; + Port gdbServerPort; + Port qmlPort; }; } // namespace Internal @@ -149,7 +148,7 @@ void LinuxDeviceDebugSupport::startExecution() command = QLatin1String("gdbserver"); args.clear(); args.append(QString::fromLatin1("--multi")); - args.append(QString::fromLatin1(":%1").arg(d->gdbServerPort)); + args.append(QString::fromLatin1(":%1").arg(d->gdbServerPort.number())); } r.executable = command; r.commandLineArguments = QtcProcess::joinArgs(args, OsTypeLinux); diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.h b/src/plugins/remotelinux/remotelinuxdebugsupport.h index 390cac3379..a9f03f42de 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.h +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXDEBUGSUPPORT_H -#define REMOTELINUXDEBUGSUPPORT_H +#pragma once #include "abstractremotelinuxrunsupport.h" @@ -66,5 +65,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUXDEBUGSUPPORT_H diff --git a/src/plugins/remotelinux/remotelinuxdeployconfiguration.h b/src/plugins/remotelinux/remotelinuxdeployconfiguration.h index eada2371a2..409113ee2a 100644 --- a/src/plugins/remotelinux/remotelinuxdeployconfiguration.h +++ b/src/plugins/remotelinux/remotelinuxdeployconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXDEPLOYCONFIGURATION_H -#define REMOTELINUXDEPLOYCONFIGURATION_H +#pragma once #include "remotelinux_export.h" @@ -64,5 +63,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUXDEPLOYCONFIGURATION_H diff --git a/src/plugins/remotelinux/remotelinuxdeployconfigurationfactory.h b/src/plugins/remotelinux/remotelinuxdeployconfigurationfactory.h index 485d4bd279..762d981f2a 100644 --- a/src/plugins/remotelinux/remotelinuxdeployconfigurationfactory.h +++ b/src/plugins/remotelinux/remotelinuxdeployconfigurationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXDEPLOYCONFIGURATIONFACTORY_H -#define REMOTELINUXDEPLOYCONFIGURATIONFACTORY_H +#pragma once #include <projectexplorer/deployconfiguration.h> @@ -53,5 +52,3 @@ public: } // namespace Internal } // namespace RemoteLinux - -#endif // REMOTELINUXDEPLOYCONFIGURATIONFACTORY_H diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h index 5e431afec6..02a4cbf119 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXENVIRONMENTASPECT_H -#define REMOTELINUXENVIRONMENTASPECT_H +#pragma once #include "remotelinux_export.h" @@ -61,5 +60,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUXENVIRONMENTASPECT_H diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.h b/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.h index f7d6c7e081..92bfe29628 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXENVIRONMENTASPECTWIDGET_H -#define REMOTELINUXENVIRONMENTASPECTWIDGET_H +#pragma once #include "remotelinuxenvironmentaspect.h" @@ -57,5 +56,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUXENVIRONMENTASPECTWIDGET_H diff --git a/src/plugins/remotelinux/remotelinuxenvironmentreader.h b/src/plugins/remotelinux/remotelinuxenvironmentreader.h index ab1e49b52f..3642a556e0 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentreader.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentreader.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXENVIRONMENTREADER_H -#define REMOTELINUXENVIRONMENTREADER_H +#pragma once #include <projectexplorer/devicesupport/idevice.h> #include <utils/environment.h> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace RemoteLinux - -#endif // REMOTELINUXENVIRONMENTREADER_H diff --git a/src/plugins/remotelinux/remotelinuxpackageinstaller.h b/src/plugins/remotelinux/remotelinuxpackageinstaller.h index 53533247ca..aa4a836df1 100644 --- a/src/plugins/remotelinux/remotelinuxpackageinstaller.h +++ b/src/plugins/remotelinux/remotelinuxpackageinstaller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXPACKAGEINSTALLER_H -#define REMOTELINUXPACKAGEINSTALLER_H +#pragma once #include "remotelinux_export.h" @@ -85,5 +84,3 @@ private: } // namespace RemoteLinux - -#endif // REMOTELINUXPACKAGEINSTALLER_H diff --git a/src/plugins/remotelinux/remotelinuxplugin.h b/src/plugins/remotelinux/remotelinuxplugin.h index 83b1161129..aa35482d2f 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.h +++ b/src/plugins/remotelinux/remotelinuxplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXPLUGIN_H -#define REMOTELINUXPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -46,5 +45,3 @@ public: } // namespace Internal } // namespace RemoteLinux - -#endif // REMOTELINUXPLUGIN_H diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.h b/src/plugins/remotelinux/remotelinuxrunconfiguration.h index 2b16107527..ab23002b8f 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.h +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXRUNCONFIGURATION_H -#define REMOTELINUXRUNCONFIGURATION_H +#pragma once #include "remotelinux_export.h" @@ -103,5 +102,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUXRUNCONFIGURATION_H diff --git a/src/plugins/remotelinux/remotelinuxrunconfigurationfactory.h b/src/plugins/remotelinux/remotelinuxrunconfigurationfactory.h index a6ed022327..88cbee3d28 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfigurationfactory.h +++ b/src/plugins/remotelinux/remotelinuxrunconfigurationfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXRUNCONFIGURATIONFACTORY_H -#define REMOTELINUXRUNCONFIGURATIONFACTORY_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -59,5 +58,3 @@ private: } // namespace Internal } // namespace RemoteLinux - -#endif // REMOTELINUXRUNCONFIGURATIONFACTORY_H diff --git a/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h b/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h index e8544bad76..18ae8ef2b3 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h +++ b/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXRUNCONFIGURATIONWIDGET_H -#define REMOTELINUXRUNCONFIGURATIONWIDGET_H +#pragma once #include "remotelinux_export.h" @@ -69,5 +68,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUXRUNCONFIGURATIONWIDGET_H diff --git a/src/plugins/remotelinux/remotelinuxruncontrol.h b/src/plugins/remotelinux/remotelinuxruncontrol.h index 2f5fe92551..b8b680b628 100644 --- a/src/plugins/remotelinux/remotelinuxruncontrol.h +++ b/src/plugins/remotelinux/remotelinuxruncontrol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXRUNCONTROL_H -#define REMOTELINUXRUNCONTROL_H +#pragma once #include "remotelinux_export.h" @@ -58,5 +57,3 @@ private: }; } // namespace RemoteLinux - -#endif // REMOTELINUXRUNCONTROL_H diff --git a/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp b/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp index 3439c977b4..15c7a5a368 100644 --- a/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp +++ b/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp @@ -116,7 +116,7 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Co if (aspect->useQmlDebugger()) { params.qmlServerAddress = dev->sshParameters().host; - params.qmlServerPort = 0; // port is selected later on + params.qmlServerPort = Utils::Port(); // port is selected later on } if (aspect->useCppDebugger()) { aspect->setUseMultiProcess(true); diff --git a/src/plugins/remotelinux/remotelinuxruncontrolfactory.h b/src/plugins/remotelinux/remotelinuxruncontrolfactory.h index effffcc235..6256fa80a8 100644 --- a/src/plugins/remotelinux/remotelinuxruncontrolfactory.h +++ b/src/plugins/remotelinux/remotelinuxruncontrolfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXRUNCONTROLFACTORY_H -#define REMOTELINUXRUNCONTROLFACTORY_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -45,5 +44,3 @@ public: } // namespace Internal } // namespace RemoteLinux - -#endif // REMOTELINUXRUNCONTROLFACTORY_H diff --git a/src/plugins/remotelinux/remotelinuxsignaloperation.cpp b/src/plugins/remotelinux/remotelinuxsignaloperation.cpp index 3191ca96f3..446a83448e 100644 --- a/src/plugins/remotelinux/remotelinuxsignaloperation.cpp +++ b/src/plugins/remotelinux/remotelinuxsignaloperation.cpp @@ -58,8 +58,10 @@ void RemoteLinuxSignalOperation::run(const QString &command) { QTC_ASSERT(!m_runner, return); m_runner = new QSsh::SshRemoteProcessRunner(); - connect(m_runner, SIGNAL(processClosed(int)), SLOT(runnerProcessFinished())); - connect(m_runner, SIGNAL(connectionError()), SLOT(runnerConnectionError())); + connect(m_runner, &QSsh::SshRemoteProcessRunner::processClosed, + this, &RemoteLinuxSignalOperation::runnerProcessFinished); + connect(m_runner, &QSsh::SshRemoteProcessRunner::connectionError, + this, &RemoteLinuxSignalOperation::runnerConnectionError); m_runner->run(command.toLatin1(), m_sshParameters); } diff --git a/src/plugins/remotelinux/remotelinuxsignaloperation.h b/src/plugins/remotelinux/remotelinuxsignaloperation.h index 342fa101d4..e52c15cf41 100644 --- a/src/plugins/remotelinux/remotelinuxsignaloperation.h +++ b/src/plugins/remotelinux/remotelinuxsignaloperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXSIGNALOPERATION_H -#define REMOTELINUXSIGNALOPERATION_H +#pragma once #include "remotelinux_export.h" @@ -42,23 +41,22 @@ class REMOTELINUX_EXPORT RemoteLinuxSignalOperation { Q_OBJECT public: - virtual ~RemoteLinuxSignalOperation(); + ~RemoteLinuxSignalOperation() override; - void killProcess(qint64 pid); - void killProcess(const QString &filePath); - void interruptProcess(qint64 pid); - void interruptProcess(const QString &filePath); + void killProcess(qint64 pid) override; + void killProcess(const QString &filePath) override; + void interruptProcess(qint64 pid) override; + void interruptProcess(const QString &filePath) override; protected: RemoteLinuxSignalOperation(const QSsh::SshConnectionParameters &sshParameters); -private slots: - void runnerProcessFinished(); - void runnerConnectionError(); - private: virtual QString killProcessByNameCommandLine(const QString &filePath) const; virtual QString interruptProcessByNameCommandLine(const QString &filePath) const; + + void runnerProcessFinished(); + void runnerConnectionError(); void run(const QString &command); void finish(); @@ -69,5 +67,3 @@ private: }; } - -#endif // REMOTELINUXSIGNALOPERATION_H diff --git a/src/plugins/remotelinux/remotelinuxutils.h b/src/plugins/remotelinux/remotelinuxutils.h index 69332d8162..57aec1d442 100644 --- a/src/plugins/remotelinux/remotelinuxutils.h +++ b/src/plugins/remotelinux/remotelinuxutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTELINUXUTILS_H -#define REMOTELINUXUTILS_H +#pragma once #include "remotelinux_export.h" @@ -36,5 +35,3 @@ public: }; } // namespace RemoteLinux - -#endif // REMOTELINUXUTILS_H diff --git a/src/plugins/remotelinux/sshkeydeployer.h b/src/plugins/remotelinux/sshkeydeployer.h index d671e94d87..8da128006a 100644 --- a/src/plugins/remotelinux/sshkeydeployer.h +++ b/src/plugins/remotelinux/sshkeydeployer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SSHKEYDEPLOYER_H -#define SSHKEYDEPLOYER_H +#pragma once #include "remotelinux_export.h" @@ -62,5 +61,3 @@ private: }; } // namespace RemoteLinux - -#endif // SSHKEYDEPLOYER_H diff --git a/src/plugins/remotelinux/tarpackagecreationstep.h b/src/plugins/remotelinux/tarpackagecreationstep.h index d0d313100f..cef63817b1 100644 --- a/src/plugins/remotelinux/tarpackagecreationstep.h +++ b/src/plugins/remotelinux/tarpackagecreationstep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TARPACKAGECREATIONSTEP_H -#define TARPACKAGECREATIONSTEP_H +#pragma once #include "abstractpackagingstep.h" #include "remotelinux_export.h" @@ -74,5 +73,3 @@ private: }; } // namespace RemoteLinux - -#endif // TARPACKAGECREATIONSTEP_H diff --git a/src/plugins/remotelinux/typespecificdeviceconfigurationlistmodel.h b/src/plugins/remotelinux/typespecificdeviceconfigurationlistmodel.h index 74f445378d..69ded3a6d6 100644 --- a/src/plugins/remotelinux/typespecificdeviceconfigurationlistmodel.h +++ b/src/plugins/remotelinux/typespecificdeviceconfigurationlistmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TYPESPECIFICDEVICECONFIGURATIONLISTMODEL_H -#define TYPESPECIFICDEVICECONFIGURATIONLISTMODEL_H +#pragma once #include <projectexplorer/devicesupport/idevice.h> @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace RemoteLinux - -#endif // TYPESPECIFICDEVICECONFIGURATIONLISTMODEL_H diff --git a/src/plugins/remotelinux/uploadandinstalltarpackagestep.h b/src/plugins/remotelinux/uploadandinstalltarpackagestep.h index 846bbf21bc..5ac669de4a 100644 --- a/src/plugins/remotelinux/uploadandinstalltarpackagestep.h +++ b/src/plugins/remotelinux/uploadandinstalltarpackagestep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UPLOADANDINSTALLTARPACKAGESTEP_H -#define UPLOADANDINSTALLTARPACKAGESTEP_H +#pragma once #include "abstractuploadandinstallpackageservice.h" #include "abstractremotelinuxdeploystep.h" @@ -74,5 +73,3 @@ private: }; } //namespace RemoteLinux - -#endif // UPLOADANDINSTALLTARPACKAGESTEP_H diff --git a/src/plugins/resourceeditor/qrceditor/qrceditor.h b/src/plugins/resourceeditor/qrceditor/qrceditor.h index 235758368b..512d35a2ac 100644 --- a/src/plugins/resourceeditor/qrceditor/qrceditor.h +++ b/src/plugins/resourceeditor/qrceditor/qrceditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QRCEDITOR_H -#define QRCEDITOR_H +#pragma once #include "ui_qrceditor.h" #include "resourceview.h" @@ -95,5 +94,3 @@ private: } // namespace Internal } // namespace ResourceEditor - -#endif diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h index d4b2b2827a..3e58cb4133 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h +++ b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RESOURCEFILE_P_H -#define RESOURCEFILE_P_H +#pragma once #include <QAbstractItemModel> #include <QCoreApplication> @@ -328,5 +327,3 @@ private: } // namespace Internal } // namespace ResourceEditor - -#endif // RESOURCEFILE_P_H diff --git a/src/plugins/resourceeditor/qrceditor/resourceview.h b/src/plugins/resourceeditor/qrceditor/resourceview.h index ba0f0c61a3..59e4d43418 100644 --- a/src/plugins/resourceeditor/qrceditor/resourceview.h +++ b/src/plugins/resourceeditor/qrceditor/resourceview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RESOURCEVIEW_H -#define RESOURCEVIEW_H +#pragma once #include "resourcefile_p.h" @@ -116,5 +115,3 @@ private: } // namespace Internal } // namespace ResourceEditor - -#endif // RESOURCEVIEW_H diff --git a/src/plugins/resourceeditor/qrceditor/test/mainwindow.h b/src/plugins/resourceeditor/qrceditor/test/mainwindow.h index 3ffff967b8..a6e619c7e0 100644 --- a/src/plugins/resourceeditor/qrceditor/test/mainwindow.h +++ b/src/plugins/resourceeditor/qrceditor/test/mainwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#pragma once #include <QMainWindow> @@ -44,5 +43,3 @@ private slots: private: SharedTools::QrcEditor *m_qrcEditor; }; - -#endif // MAINWINDOW_H diff --git a/src/plugins/resourceeditor/qrceditor/undocommands_p.h b/src/plugins/resourceeditor/qrceditor/undocommands_p.h index ea85282da4..fac2a2d05d 100644 --- a/src/plugins/resourceeditor/qrceditor/undocommands_p.h +++ b/src/plugins/resourceeditor/qrceditor/undocommands_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UNDO_COMMANDS_H -#define UNDO_COMMANDS_H +#pragma once #include "resourceview.h" @@ -173,5 +172,3 @@ private: } // namespace Internal } // namespace ResourceEditor - -#endif // UNDO_COMMANDS_H diff --git a/src/plugins/resourceeditor/resource_global.h b/src/plugins/resourceeditor/resource_global.h index ac19f427fb..7fffa85432 100644 --- a/src/plugins/resourceeditor/resource_global.h +++ b/src/plugins/resourceeditor/resource_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RESOUCE_GLOBAL_H -#define RESOUCE_GLOBAL_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define RESOURCE_EXPORT Q_DECL_IMPORT #endif - -#endif // RESOUCE_GLOBAL_H diff --git a/src/plugins/resourceeditor/resourceeditorconstants.h b/src/plugins/resourceeditor/resourceeditorconstants.h index 2713320c73..b0f9b3ebf5 100644 --- a/src/plugins/resourceeditor/resourceeditorconstants.h +++ b/src/plugins/resourceeditor/resourceeditorconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RESOURCEEDITOR_CONSTANTS_H -#define RESOURCEEDITOR_CONSTANTS_H +#pragma once namespace ResourceEditor { namespace Constants { @@ -50,8 +49,5 @@ const char C_OPEN_EDITOR[] = "ResourceEditor.OpenEditor"; const char C_COPY_PATH[] = "ResourceEditor.CopyPath"; const char C_COPY_URL[] = "ResourceEditor.CopyUrl"; - } // namespace Constants } // namespace ResourceEditor - -#endif // RESOURCEEDITOR_CONSTANTS_H diff --git a/src/plugins/resourceeditor/resourceeditorfactory.h b/src/plugins/resourceeditor/resourceeditorfactory.h index 7ea0c587e4..3b954df68f 100644 --- a/src/plugins/resourceeditor/resourceeditorfactory.h +++ b/src/plugins/resourceeditor/resourceeditorfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RRESOURCEEDITORFACTORY_H -#define RRESOURCEEDITORFACTORY_H +#pragma once #include <coreplugin/editormanager/ieditorfactory.h> #include <coreplugin/icontext.h> @@ -51,5 +50,3 @@ private: } // namespace Internal } // namespace ResourceEditor - -#endif // RRESOURCEEDITORFACTORY_H diff --git a/src/plugins/resourceeditor/resourceeditorplugin.h b/src/plugins/resourceeditor/resourceeditorplugin.h index 4f8202f6dd..d8cb020654 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.h +++ b/src/plugins/resourceeditor/resourceeditorplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RESOURCEEDITORPLUGIN_H -#define RESOURCEEDITORPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -108,5 +107,3 @@ private: } // namespace Internal } // namespace ResourceEditor - -#endif // RESOURCEEDITORPLUGIN_H diff --git a/src/plugins/resourceeditor/resourceeditorw.h b/src/plugins/resourceeditor/resourceeditorw.h index 0ba85ca38e..3d8d139e3c 100644 --- a/src/plugins/resourceeditor/resourceeditorw.h +++ b/src/plugins/resourceeditor/resourceeditorw.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RESOURCEEDITORW_H -#define RESOURCEEDITORW_H +#pragma once #include <coreplugin/idocument.h> #include <coreplugin/editormanager/ieditor.h> @@ -127,5 +126,3 @@ public: } // namespace Internal } // namespace ResourceEditor - -#endif // RESOURCEEDITORW_H diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index c77c2632b7..cbc6286d73 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -385,6 +385,7 @@ QList<ProjectExplorer::ProjectAction> ResourceFolderNode::supportedActions(Proje << ProjectExplorer::AddExistingFile << ProjectExplorer::AddExistingDirectory << ProjectExplorer::RemoveFile + << ProjectExplorer::DuplicateFile << ProjectExplorer::Rename // Note: only works for the filename, works akwardly for relative file paths << ProjectExplorer::HidePathActions; // hides open terminal etc. @@ -427,6 +428,27 @@ bool ResourceFolderNode::removeFiles(const QStringList &filePaths, QStringList * return true; } +// QTCREATORBUG-15280 +bool ResourceFolderNode::canRenameFile(const QString &filePath, const QString &newFilePath) +{ + Q_UNUSED(newFilePath) + + bool fileEntryExists = false; + ResourceFile file(m_topLevelNode->filePath().toString()); + + int index = (file.load() != Core::IDocument::OpenResult::Success) ? -1 :file.indexOfPrefix(m_prefix, m_lang); + if (index != -1) { + for (int j = 0; j < file.fileCount(index); ++j) { + if (file.file(index, j) == filePath) { + fileEntryExists = true; + break; + } + } + } + + return fileEntryExists; +} + bool ResourceFolderNode::renameFile(const QString &filePath, const QString &newFilePath) { ResourceFile file(m_topLevelNode->filePath().toString()); @@ -622,6 +644,7 @@ QList<ProjectExplorer::ProjectAction> SimpleResourceFolderNode::supportedActions << ProjectExplorer::AddExistingFile << ProjectExplorer::AddExistingDirectory << ProjectExplorer::RemoveFile + << ProjectExplorer::DuplicateFile << ProjectExplorer::Rename // Note: only works for the filename, works akwardly for relative file paths << ProjectExplorer::InheritedFromParent; // do not add to list of projects when adding new file diff --git a/src/plugins/resourceeditor/resourcenode.h b/src/plugins/resourceeditor/resourcenode.h index 7d1fce7ebf..d3d56becb9 100644 --- a/src/plugins/resourceeditor/resourcenode.h +++ b/src/plugins/resourceeditor/resourcenode.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RESOURCENODE_H -#define RESOURCENODE_H +#pragma once #include "resource_global.h" #include <projectexplorer/projectnodes.h> @@ -101,6 +100,7 @@ public: bool addFiles(const QStringList &filePaths, QStringList *notAdded) override; bool removeFiles(const QStringList &filePaths, QStringList *notRemoved) override; + bool canRenameFile(const QString &filePath, const QString &newFilePath) override; bool renameFile(const QString &filePath, const QString &newFilePath) override; bool renamePrefix(const QString &prefix, const QString &lang); @@ -165,7 +165,6 @@ private: class ResourceFileWatcher : public Core::IDocument { - Q_OBJECT public: ResourceFileWatcher(ResourceTopLevelNode *node); @@ -176,5 +175,3 @@ private: }; } // namespace Internal } // namespace ResourceEditor - -#endif // RESOUCENODE_H diff --git a/src/plugins/subversion/annotationhighlighter.h b/src/plugins/subversion/annotationhighlighter.h index f9c471367c..44cbeff72f 100644 --- a/src/plugins/subversion/annotationhighlighter.h +++ b/src/plugins/subversion/annotationhighlighter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ANNOTATIONHIGHLIGHTER_H -#define ANNOTATIONHIGHLIGHTER_H +#pragma once #include <vcsbase/baseannotationhighlighter.h> @@ -47,5 +46,3 @@ private: } // namespace Internal } // namespace Subversion - -#endif // ANNOTATIONHIGHLIGHTER_H diff --git a/src/plugins/subversion/settingspage.h b/src/plugins/subversion/settingspage.h index bd81e3c9ef..afb0c6a879 100644 --- a/src/plugins/subversion/settingspage.h +++ b/src/plugins/subversion/settingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SETTINGSPAGE_H -#define SETTINGSPAGE_H +#pragma once #include "ui_settingspage.h" @@ -66,5 +65,3 @@ public: } // namespace Subversion } // namespace Internal - -#endif // SETTINGSPAGE_H diff --git a/src/plugins/subversion/subversionclient.h b/src/plugins/subversion/subversionclient.h index 604de6d415..a5e3d98277 100644 --- a/src/plugins/subversion/subversionclient.h +++ b/src/plugins/subversion/subversionclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SUBVERSIONCLIENT_H -#define SUBVERSIONCLIENT_H +#pragma once #include "subversionsettings.h" #include <vcsbase/vcsbaseclient.h> @@ -85,5 +84,3 @@ private: } // namespace Internal } // namespace Subversion - -#endif // SUBVERSIONCLIENT_H diff --git a/src/plugins/subversion/subversionconstants.h b/src/plugins/subversion/subversionconstants.h index 60afd37a2b..5b52cbbb90 100644 --- a/src/plugins/subversion/subversionconstants.h +++ b/src/plugins/subversion/subversionconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SUBVERSION_CONSTANTS_H -#define SUBVERSION_CONSTANTS_H +#pragma once #include <QtGlobal> @@ -53,5 +52,3 @@ const char DIFF_SELECTED[] = "Subversion.DiffSelectedFilesInLog"; } // namespace Constants } // namespace Subversion - -#endif // SUBVERSION_CONSTANTS_H diff --git a/src/plugins/subversion/subversioncontrol.h b/src/plugins/subversion/subversioncontrol.h index 73c62bad28..9f244fd529 100644 --- a/src/plugins/subversion/subversioncontrol.h +++ b/src/plugins/subversion/subversioncontrol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SUBVERSIONCONTROL_H -#define SUBVERSIONCONTROL_H +#pragma once #include <coreplugin/iversioncontrol.h> @@ -69,5 +68,3 @@ private: } // namespace Internal } // namespace Subversion - -#endif // SUBVERSIONCONTROL_H diff --git a/src/plugins/subversion/subversioneditor.h b/src/plugins/subversion/subversioneditor.h index 119cdb2c0f..6b2446ffde 100644 --- a/src/plugins/subversion/subversioneditor.h +++ b/src/plugins/subversion/subversioneditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SUBVERSIONEDITOR_H -#define SUBVERSIONEDITOR_H +#pragma once #include <vcsbase/vcsbaseeditor.h> @@ -53,5 +52,3 @@ private: } // namespace Internal } // namespace Subversion - -#endif // SUBVERSIONEDITOR_H diff --git a/src/plugins/subversion/subversionplugin.h b/src/plugins/subversion/subversionplugin.h index 9c537d77d1..f06a1a9201 100644 --- a/src/plugins/subversion/subversionplugin.h +++ b/src/plugins/subversion/subversionplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SUBVERSIONPLUGIN_H -#define SUBVERSIONPLUGIN_H +#pragma once #include "subversionsettings.h" @@ -181,5 +180,3 @@ private: } // namespace Subversion } // namespace Internal - -#endif // SUBVERSIONPLUGIN_H diff --git a/src/plugins/subversion/subversionsettings.h b/src/plugins/subversion/subversionsettings.h index f2f94ef7fb..81dbeb15f8 100644 --- a/src/plugins/subversion/subversionsettings.h +++ b/src/plugins/subversion/subversionsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SUBVERSIONSETTINGS_H -#define SUBVERSIONSETTINGS_H +#pragma once #include <vcsbase/vcsbaseclientsettings.h> @@ -50,5 +49,3 @@ protected: } // namespace Internal } // namespace Subversion - -#endif // SUBVERSIONSETTINGS_H diff --git a/src/plugins/subversion/subversionsubmiteditor.h b/src/plugins/subversion/subversionsubmiteditor.h index 860af1a843..27b0918cef 100644 --- a/src/plugins/subversion/subversionsubmiteditor.h +++ b/src/plugins/subversion/subversionsubmiteditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SUBVERSIONSUBMITEDITOR_H -#define SUBVERSIONSUBMITEDITOR_H +#pragma once #include <vcsbase/vcsbasesubmiteditor.h> @@ -52,5 +51,3 @@ public: } // namespace Internal } // namespace Subversion - -#endif // SUBVERSIONSUBMITEDITOR_H diff --git a/src/plugins/tasklist/stopmonitoringhandler.h b/src/plugins/tasklist/stopmonitoringhandler.h index af9be37ee4..ebf8a4e8e7 100644 --- a/src/plugins/tasklist/stopmonitoringhandler.h +++ b/src/plugins/tasklist/stopmonitoringhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STOPMONITORINGHANDLER_H -#define STOPMONITORINGHANDLER_H +#pragma once #include <projectexplorer/itaskhandler.h> @@ -34,14 +33,10 @@ namespace Internal { class StopMonitoringHandler : public ProjectExplorer::ITaskHandler { public: - StopMonitoringHandler() {} - - bool canHandle(const ProjectExplorer::Task &) const; - void handle(const ProjectExplorer::Task &); - QAction *createAction(QObject *parent) const; + bool canHandle(const ProjectExplorer::Task &) const override; + void handle(const ProjectExplorer::Task &) override; + QAction *createAction(QObject *parent) const override; }; } // namespace Internal } // namespace TaskList - -#endif // STOPMONITORINGHANDLER_H diff --git a/src/plugins/tasklist/taskfile.h b/src/plugins/tasklist/taskfile.h index 11bfce115b..eaaf638829 100644 --- a/src/plugins/tasklist/taskfile.h +++ b/src/plugins/tasklist/taskfile.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TASKFILE_H -#define TASKFILE_H +#pragma once #include <coreplugin/idocument.h> @@ -46,5 +45,3 @@ public: } // namespace Internal } // namespace TaskList - -#endif // TASKFILE_H diff --git a/src/plugins/tasklist/tasklistconstants.h b/src/plugins/tasklist/tasklistconstants.h index 0b6a1c2174..77b44f7766 100644 --- a/src/plugins/tasklist/tasklistconstants.h +++ b/src/plugins/tasklist/tasklistconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TASKLIST_TASKLISTCONSTANTS_H -#define TASKLIST_TASKLISTCONSTANTS_H +#pragma once namespace TaskList { namespace Constants { @@ -33,5 +32,3 @@ const char TASKLISTTASK_ID[] = "TaskList.TaskListTaskId"; } // namespace Constants } // namespace TaskList - -#endif // TASKLIST_TASKLISTCONSTANTS_H diff --git a/src/plugins/tasklist/tasklistplugin.h b/src/plugins/tasklist/tasklistplugin.h index ef79914ac5..ec6bbd2af8 100644 --- a/src/plugins/tasklist/tasklistplugin.h +++ b/src/plugins/tasklist/tasklistplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TASKLISTPLUGIN_H -#define TASKLISTPLUGIN_H +#pragma once #include <coreplugin/idocumentfactory.h> #include <extensionsystem/iplugin.h> @@ -64,5 +63,3 @@ private: } // namespace Internal } // namespace TaskList - -#endif // TASKLISTPLUGIN_H diff --git a/src/plugins/texteditor/autocompleter.h b/src/plugins/texteditor/autocompleter.h index 6122b4d8e3..49c6586abe 100644 --- a/src/plugins/texteditor/autocompleter.h +++ b/src/plugins/texteditor/autocompleter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef AUTOCOMPLETER_H -#define AUTOCOMPLETER_H +#pragma once #include "texteditor_global.h" @@ -90,5 +89,3 @@ private: }; } // TextEditor - -#endif // AUTOCOMPLETER_H diff --git a/src/plugins/texteditor/basefilefind.h b/src/plugins/texteditor/basefilefind.h index a39d1f3643..428296c3ec 100644 --- a/src/plugins/texteditor/basefilefind.h +++ b/src/plugins/texteditor/basefilefind.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASEFILEFIND_H -#define BASEFILEFIND_H +#pragma once #include "texteditor_global.h" #include "utils/filesearch.h" @@ -139,5 +138,3 @@ private: } // namespace TextEditor Q_DECLARE_METATYPE(TextEditor::FileFindParameters) - -#endif // BASEFILEFIND_H diff --git a/src/plugins/texteditor/basehoverhandler.h b/src/plugins/texteditor/basehoverhandler.h index 91e5e4e38d..7a5334e3a8 100644 --- a/src/plugins/texteditor/basehoverhandler.h +++ b/src/plugins/texteditor/basehoverhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASEHOVERHANDLER_H -#define BASEHOVERHANDLER_H +#pragma once #include "texteditor_global.h" #include "helpitem.h" @@ -86,5 +85,3 @@ private: }; } // namespace TextEditor - -#endif // BASEHOVERHANDLER_H diff --git a/src/plugins/texteditor/behaviorsettings.h b/src/plugins/texteditor/behaviorsettings.h index f45fd4a9c0..a6818d0479 100644 --- a/src/plugins/texteditor/behaviorsettings.h +++ b/src/plugins/texteditor/behaviorsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEHAVIORSETTINGS_H -#define BEHAVIORSETTINGS_H +#pragma once #include "texteditor_global.h" @@ -66,5 +65,3 @@ inline bool operator==(const BehaviorSettings &t1, const BehaviorSettings &t2) { inline bool operator!=(const BehaviorSettings &t1, const BehaviorSettings &t2) { return !t1.equals(t2); } } // namespace TextEditor - -#endif // BEHAVIORSETTINGS_H diff --git a/src/plugins/texteditor/behaviorsettingspage.h b/src/plugins/texteditor/behaviorsettingspage.h index fe7cdae09b..42e70f6972 100644 --- a/src/plugins/texteditor/behaviorsettingspage.h +++ b/src/plugins/texteditor/behaviorsettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEHAVIORSETTINGSPAGE_H -#define BEHAVIORSETTINGSPAGE_H +#pragma once #include "texteditor_global.h" @@ -90,5 +89,3 @@ private: }; } // namespace TextEditor - -#endif // BEHAVIORSETTINGSPAGE_H diff --git a/src/plugins/texteditor/behaviorsettingswidget.h b/src/plugins/texteditor/behaviorsettingswidget.h index 6e8f33fd0b..12c4b7eedd 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.h +++ b/src/plugins/texteditor/behaviorsettingswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BEHAVIORSETTINGSWIDGET_H -#define BEHAVIORSETTINGSWIDGET_H +#pragma once #include "texteditor_global.h" @@ -93,5 +92,3 @@ private: }; } // TextEditor - -#endif // BEHAVIORSETTINGSWIDGET_H diff --git a/src/plugins/texteditor/blockrange.h b/src/plugins/texteditor/blockrange.h index 9f821031f3..43449cdc6c 100644 --- a/src/plugins/texteditor/blockrange.h +++ b/src/plugins/texteditor/blockrange.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BLOCKRANGE_H -#define BLOCKRANGE_H +#pragma once namespace TextEditor { @@ -58,5 +57,3 @@ private: }; } // namespace TextEditor - -#endif // BLOCKRANGE_H diff --git a/src/plugins/texteditor/circularclipboard.h b/src/plugins/texteditor/circularclipboard.h index 23178ac5a1..e888f32c2f 100644 --- a/src/plugins/texteditor/circularclipboard.h +++ b/src/plugins/texteditor/circularclipboard.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CIRCULARCLIPBOARD_H -#define CIRCULARCLIPBOARD_H +#pragma once #include <QList> #include <QMimeData> @@ -55,5 +54,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // CIRCULARCLIPBOARD_H diff --git a/src/plugins/texteditor/circularclipboardassist.h b/src/plugins/texteditor/circularclipboardassist.h index 4064cd4a45..d8d37c72cc 100644 --- a/src/plugins/texteditor/circularclipboardassist.h +++ b/src/plugins/texteditor/circularclipboardassist.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CIRCULARCLIPBOARDASSIST_H -#define CIRCULARCLIPBOARDASSIST_H +#pragma once #include "codeassist/iassistprovider.h" @@ -42,5 +41,3 @@ public: } // namespace Internal } // namespace TextEditor - -#endif // CIRCULARCLIPBOARDASSIST_H diff --git a/src/plugins/texteditor/codeassist/assistenums.h b/src/plugins/texteditor/codeassist/assistenums.h index d1e068c7f3..2a5995526d 100644 --- a/src/plugins/texteditor/codeassist/assistenums.h +++ b/src/plugins/texteditor/codeassist/assistenums.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ASSISTENUMS_H -#define ASSISTENUMS_H +#pragma once namespace TextEditor { @@ -43,5 +42,3 @@ enum AssistReason }; } // TextEditor - -#endif // ASSISTENUMS_H diff --git a/src/plugins/texteditor/codeassist/assistinterface.h b/src/plugins/texteditor/codeassist/assistinterface.h index 77d1548c4b..340713fc24 100644 --- a/src/plugins/texteditor/codeassist/assistinterface.h +++ b/src/plugins/texteditor/codeassist/assistinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IASSISTINTERFACE_H -#define IASSISTINTERFACE_H +#pragma once #include "assistenums.h" @@ -68,5 +67,3 @@ private: }; } // namespace TextEditor - -#endif // IASSISTINTERFACE_H diff --git a/src/plugins/texteditor/codeassist/assistproposalitem.h b/src/plugins/texteditor/codeassist/assistproposalitem.h index 914115bd21..8d957a2f81 100644 --- a/src/plugins/texteditor/codeassist/assistproposalitem.h +++ b/src/plugins/texteditor/codeassist/assistproposalitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IASSISTPROPOSALITEM_H -#define IASSISTPROPOSALITEM_H +#pragma once #include <texteditor/texteditor_global.h> @@ -74,5 +73,3 @@ private: }; } // namespace TextEditor - -#endif // BASICPROPOSALITEM_H diff --git a/src/plugins/texteditor/codeassist/assistproposaliteminterface.h b/src/plugins/texteditor/codeassist/assistproposaliteminterface.h index a195cd9585..d85c7a2ccc 100644 --- a/src/plugins/texteditor/codeassist/assistproposaliteminterface.h +++ b/src/plugins/texteditor/codeassist/assistproposaliteminterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITOR_ASSISTPROPOSALITEMINTERFACE_H -#define TEXTEDITOR_ASSISTPROPOSALITEMINTERFACE_H +#pragma once #include "textdocumentmanipulatorinterface.h" @@ -68,5 +67,3 @@ private: }; } // namespace TextEditor - -#endif // TEXTEDITOR_ASSISTPROPOSALITEMINTERFACE_H diff --git a/src/plugins/texteditor/codeassist/codeassistant.h b/src/plugins/texteditor/codeassist/codeassistant.h index c6f327617c..f1babd4582 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.h +++ b/src/plugins/texteditor/codeassist/codeassistant.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CODEASSISTANT_H -#define CODEASSISTANT_H +#pragma once #include "assistenums.h" @@ -65,5 +64,3 @@ private: }; } //TextEditor - -#endif // CODEASSISTANT_H diff --git a/src/plugins/texteditor/codeassist/completionassistprovider.h b/src/plugins/texteditor/codeassist/completionassistprovider.h index 29061312b2..c0c150b3ea 100644 --- a/src/plugins/texteditor/codeassist/completionassistprovider.h +++ b/src/plugins/texteditor/codeassist/completionassistprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPLETIONASSISTPROVIDER_H -#define COMPLETIONASSISTPROVIDER_H +#pragma once #include "iassistprovider.h" @@ -46,5 +45,3 @@ public: }; } // TextEditor - -#endif // COMPLETIONASSISTPROVIDER_H diff --git a/src/plugins/texteditor/codeassist/functionhintproposal.h b/src/plugins/texteditor/codeassist/functionhintproposal.h index 87b77e771a..fc3fd2dad7 100644 --- a/src/plugins/texteditor/codeassist/functionhintproposal.h +++ b/src/plugins/texteditor/codeassist/functionhintproposal.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FUNCTIONHINTPROPOSAL_H -#define FUNCTIONHINTPROPOSAL_H +#pragma once #include "iassistproposal.h" @@ -52,5 +51,3 @@ private: }; } // TextEditor - -#endif // FUNCTIONHINTPROPOSAL_H diff --git a/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp b/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp index 0c9cf5911d..7074ecd9f6 100644 --- a/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp +++ b/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp @@ -221,8 +221,7 @@ bool FunctionHintProposalWidget::eventFilter(QObject *obj, QEvent *e) if (d->m_model && d->m_model->size() > 1) return false; } - QTC_CHECK(d->m_assistant); - if (d->m_assistant) + if (QTC_GUARD(d->m_assistant)) d->m_assistant->notifyChange(); } break; diff --git a/src/plugins/texteditor/codeassist/functionhintproposalwidget.h b/src/plugins/texteditor/codeassist/functionhintproposalwidget.h index cb9e284b4c..d42d1e3e69 100644 --- a/src/plugins/texteditor/codeassist/functionhintproposalwidget.h +++ b/src/plugins/texteditor/codeassist/functionhintproposalwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FUNCTIONHINTPROPOSALWIDGET_H -#define FUNCTIONHINTPROPOSALWIDGET_H +#pragma once #include "iassistproposalwidget.h" @@ -69,5 +68,3 @@ private: }; } // TextEditor - -#endif // FUNCTIONHINTPROPOSALWIDGET_H diff --git a/src/plugins/texteditor/codeassist/genericproposal.h b/src/plugins/texteditor/codeassist/genericproposal.h index 87da2ec56b..50b6a8e594 100644 --- a/src/plugins/texteditor/codeassist/genericproposal.h +++ b/src/plugins/texteditor/codeassist/genericproposal.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GENERICPROPOSAL_H -#define GENERICPROPOSAL_H +#pragma once #include "iassistproposal.h" @@ -57,5 +56,3 @@ private: }; } // TextEditor - -#endif // GENERICPROPOSAL_H diff --git a/src/plugins/texteditor/codeassist/genericproposalmodel.h b/src/plugins/texteditor/codeassist/genericproposalmodel.h index 0f27ca4659..07f04209fe 100644 --- a/src/plugins/texteditor/codeassist/genericproposalmodel.h +++ b/src/plugins/texteditor/codeassist/genericproposalmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IGENERICPROPOSALMODEL_H -#define IGENERICPROPOSALMODEL_H +#pragma once #include "iassistproposalmodel.h" #include "assistenums.h" @@ -75,5 +74,3 @@ private: QList<AssistProposalItemInterface *> m_originalItems; }; } // TextEditor - -#endif // IGENERICPROPOSALMODEL_H diff --git a/src/plugins/texteditor/codeassist/genericproposalwidget.h b/src/plugins/texteditor/codeassist/genericproposalwidget.h index d160627bb1..016a3b952b 100644 --- a/src/plugins/texteditor/codeassist/genericproposalwidget.h +++ b/src/plugins/texteditor/codeassist/genericproposalwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GENERICPROPOSALWIDGET_H -#define GENERICPROPOSALWIDGET_H +#pragma once #include "iassistproposalwidget.h" @@ -75,5 +74,3 @@ private: }; } // TextEditor - -#endif // GENERICPROPOSALWIDGET_H diff --git a/src/plugins/texteditor/codeassist/iassistprocessor.h b/src/plugins/texteditor/codeassist/iassistprocessor.h index 95ac3371d3..d2c618ac4b 100644 --- a/src/plugins/texteditor/codeassist/iassistprocessor.h +++ b/src/plugins/texteditor/codeassist/iassistprocessor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IASSISTPROCESSOR_H -#define IASSISTPROCESSOR_H +#pragma once #include <texteditor/texteditor_global.h> @@ -60,5 +59,3 @@ private: }; } // TextEditor - -#endif // IASSISTPROCESSOR_H diff --git a/src/plugins/texteditor/codeassist/iassistproposal.h b/src/plugins/texteditor/codeassist/iassistproposal.h index c74710b122..c4ce1299a5 100644 --- a/src/plugins/texteditor/codeassist/iassistproposal.h +++ b/src/plugins/texteditor/codeassist/iassistproposal.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IASSISTPROPOSAL_H -#define IASSISTPROPOSAL_H +#pragma once #include <texteditor/texteditor_global.h> @@ -49,5 +48,3 @@ public: }; } // TextEditor - -#endif // IASSISTPROPOSAL_H diff --git a/src/plugins/texteditor/codeassist/iassistproposalmodel.h b/src/plugins/texteditor/codeassist/iassistproposalmodel.h index 32f4d2bee2..7519636393 100644 --- a/src/plugins/texteditor/codeassist/iassistproposalmodel.h +++ b/src/plugins/texteditor/codeassist/iassistproposalmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IASSISTPROPOSALMODEL_H -#define IASSISTPROPOSALMODEL_H +#pragma once #include <texteditor/texteditor_global.h> @@ -46,5 +45,3 @@ public: }; } // TextEditor - -#endif // IASSISTPROPOSALMODEL_H diff --git a/src/plugins/texteditor/codeassist/iassistproposalwidget.h b/src/plugins/texteditor/codeassist/iassistproposalwidget.h index c64147d78d..2f2f6e8bf6 100644 --- a/src/plugins/texteditor/codeassist/iassistproposalwidget.h +++ b/src/plugins/texteditor/codeassist/iassistproposalwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IASSISTPROPOSALWIDGET_H -#define IASSISTPROPOSALWIDGET_H +#pragma once #include "assistenums.h" @@ -65,5 +64,3 @@ signals: }; } // TextEditor - -#endif // IASSISTPROPOSALWIDGET_H diff --git a/src/plugins/texteditor/codeassist/iassistprovider.h b/src/plugins/texteditor/codeassist/iassistprovider.h index eef1fded0f..3be7a77cd0 100644 --- a/src/plugins/texteditor/codeassist/iassistprovider.h +++ b/src/plugins/texteditor/codeassist/iassistprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IASSISTPROVIDER_H -#define IASSISTPROVIDER_H +#pragma once #include <texteditor/texteditor_global.h> @@ -54,5 +53,3 @@ public: }; } // TextEditor - -#endif // IASSISTPROVIDER_H diff --git a/src/plugins/texteditor/codeassist/ifunctionhintproposalmodel.h b/src/plugins/texteditor/codeassist/ifunctionhintproposalmodel.h index 6a9b9b3ac0..1af6bf1219 100644 --- a/src/plugins/texteditor/codeassist/ifunctionhintproposalmodel.h +++ b/src/plugins/texteditor/codeassist/ifunctionhintproposalmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IFUNCTIONHINTPROPOSALMODEL_H -#define IFUNCTIONHINTPROPOSALMODEL_H +#pragma once #include "iassistproposalmodel.h" @@ -42,5 +41,3 @@ public: }; } // TextEditor - -#endif // IFUNCTIONHINTPROPOSALMODEL_H diff --git a/src/plugins/texteditor/codeassist/keywordscompletionassist.h b/src/plugins/texteditor/codeassist/keywordscompletionassist.h index 68e7246e68..30a22336e3 100644 --- a/src/plugins/texteditor/codeassist/keywordscompletionassist.h +++ b/src/plugins/texteditor/codeassist/keywordscompletionassist.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef KEYWORDSCOMPLETIONASSIST_H -#define KEYWORDSCOMPLETIONASSIST_H +#pragma once #include "iassistprocessor.h" #include "assistproposalitem.h" @@ -105,5 +104,3 @@ private: }; } // TextEditor - -#endif // KEYWORDSCOMPLETIONASSISTPROCESSOR_H diff --git a/src/plugins/texteditor/codeassist/quickfixassistprocessor.h b/src/plugins/texteditor/codeassist/quickfixassistprocessor.h index 0ff320c9da..c418cfb02c 100644 --- a/src/plugins/texteditor/codeassist/quickfixassistprocessor.h +++ b/src/plugins/texteditor/codeassist/quickfixassistprocessor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QUICKFIXASSISTPROCESSOR_H -#define QUICKFIXASSISTPROCESSOR_H +#pragma once #include "iassistprocessor.h" @@ -45,5 +44,3 @@ private: }; } // TextEditor - -#endif // QUICKFIXASSISTPROCESSOR_H diff --git a/src/plugins/texteditor/codeassist/quickfixassistprovider.h b/src/plugins/texteditor/codeassist/quickfixassistprovider.h index 01214d2d90..6a480ca2c9 100644 --- a/src/plugins/texteditor/codeassist/quickfixassistprovider.h +++ b/src/plugins/texteditor/codeassist/quickfixassistprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QUICKFIXASSISTPROVIDER_H -#define QUICKFIXASSISTPROVIDER_H +#pragma once #include "iassistprovider.h" @@ -46,5 +45,3 @@ public: }; } // TextEditor - -#endif // QUICKFIXASSISTPROVIDER_H diff --git a/src/plugins/texteditor/codeassist/runner.h b/src/plugins/texteditor/codeassist/runner.h index 05aebaf929..2c33eeed6c 100644 --- a/src/plugins/texteditor/codeassist/runner.h +++ b/src/plugins/texteditor/codeassist/runner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROCESSORRUNNER_H -#define PROCESSORRUNNER_H +#pragma once #include "iassistproposalwidget.h" @@ -68,5 +67,3 @@ private: } // Internal } // TextEditor - -#endif // PROCESSORRUNNER_H diff --git a/src/plugins/texteditor/codeassist/textdocumentmanipulator.h b/src/plugins/texteditor/codeassist/textdocumentmanipulator.h index 9ca59576aa..8b4547f113 100644 --- a/src/plugins/texteditor/codeassist/textdocumentmanipulator.h +++ b/src/plugins/texteditor/codeassist/textdocumentmanipulator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTDOCUMENTMANIPULATOR_H -#define TEXTDOCUMENTMANIPULATOR_H +#pragma once #include "textdocumentmanipulatorinterface.h" @@ -59,5 +58,3 @@ private: }; } // namespace TextEditor - -#endif // TEXTDOCUMENTMANIPULATOR_H diff --git a/src/plugins/texteditor/codeassist/textdocumentmanipulatorinterface.h b/src/plugins/texteditor/codeassist/textdocumentmanipulatorinterface.h index 400214c1f6..62c6489fb5 100644 --- a/src/plugins/texteditor/codeassist/textdocumentmanipulatorinterface.h +++ b/src/plugins/texteditor/codeassist/textdocumentmanipulatorinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTDOCUMENTMANIPULATORINTERFACE_H -#define TEXTDOCUMENTMANIPULATORINTERFACE_H +#pragma once #include <texteditor/texteditor_global.h> @@ -56,5 +55,3 @@ public: }; } // namespace TextEditor - -#endif // TEXTDOCUMENTMANIPULATORINTERFACE_H diff --git a/src/plugins/texteditor/codecselector.h b/src/plugins/texteditor/codecselector.h index a7e28be9e6..4bd84eb4c4 100644 --- a/src/plugins/texteditor/codecselector.h +++ b/src/plugins/texteditor/codecselector.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CODECSELECTOR_H -#define CODECSELECTOR_H +#pragma once #include <QDialog> #include <QLabel> @@ -70,5 +69,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // CODECSELECTOR_H diff --git a/src/plugins/texteditor/codestyleeditor.h b/src/plugins/texteditor/codestyleeditor.h index a2473c29f7..e76e343953 100644 --- a/src/plugins/texteditor/codestyleeditor.h +++ b/src/plugins/texteditor/codestyleeditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CODESTYLEEDITOR_H -#define CODESTYLEEDITOR_H +#pragma once #include "texteditor_global.h" @@ -59,5 +58,3 @@ private: }; } // namespace TextEditor - -#endif // CODESTYLEEDITOR_H diff --git a/src/plugins/texteditor/codestylepool.h b/src/plugins/texteditor/codestylepool.h index b131b0ea1e..4c8727ab05 100644 --- a/src/plugins/texteditor/codestylepool.h +++ b/src/plugins/texteditor/codestylepool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CODESTYLEPOOL_H -#define CODESTYLEPOOL_H +#pragma once #include "texteditor_global.h" @@ -81,5 +80,3 @@ private: }; } // namespace TextEditor - -#endif // CODESTYLEPOOL_H diff --git a/src/plugins/texteditor/codestyleselectorwidget.h b/src/plugins/texteditor/codestyleselectorwidget.h index 4bae78938a..05ae0c41d8 100644 --- a/src/plugins/texteditor/codestyleselectorwidget.h +++ b/src/plugins/texteditor/codestyleselectorwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CODESTYLESELECTORWIDGET_H -#define CODESTYLESELECTORWIDGET_H +#pragma once #include "texteditor_global.h" @@ -78,5 +77,3 @@ private: }; } // namespace TextEditor - -#endif // CODESTYLESELECTORWIDGET_H diff --git a/src/plugins/texteditor/colorpreviewhoverhandler.h b/src/plugins/texteditor/colorpreviewhoverhandler.h index 2ab4e83f1d..eaa701c287 100644 --- a/src/plugins/texteditor/colorpreviewhoverhandler.h +++ b/src/plugins/texteditor/colorpreviewhoverhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COLORPREVIEWHOVERHANDLER_H -#define COLORPREVIEWHOVERHANDLER_H +#pragma once #include "texteditor_global.h" #include "basehoverhandler.h" @@ -50,5 +49,3 @@ private: }; } // namespace TextEditor - -#endif // COLORPREVIEWHOVERHANDLER_H diff --git a/src/plugins/texteditor/colorscheme.h b/src/plugins/texteditor/colorscheme.h index 3325f300e0..f065b18648 100644 --- a/src/plugins/texteditor/colorscheme.h +++ b/src/plugins/texteditor/colorscheme.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COLORSCHEME_H -#define COLORSCHEME_H +#pragma once #include "texteditor_global.h" #include "texteditorconstants.h" @@ -127,5 +126,3 @@ inline bool operator==(const ColorScheme &cs1, const ColorScheme &cs2) { return inline bool operator!=(const ColorScheme &cs1, const ColorScheme &cs2) { return !cs1.equals(cs2); } } // namespace TextEditor - -#endif // COLORSCHEME_H diff --git a/src/plugins/texteditor/colorschemeedit.h b/src/plugins/texteditor/colorschemeedit.h index b97470cd3d..eb2f50fd3f 100644 --- a/src/plugins/texteditor/colorschemeedit.h +++ b/src/plugins/texteditor/colorschemeedit.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COLORSCHEMEEDIT_H -#define COLORSCHEMEEDIT_H +#pragma once #include "colorscheme.h" #include "fontsettingspage.h" @@ -91,5 +90,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // COLORSCHEMEEDIT_H diff --git a/src/plugins/texteditor/completionsettings.h b/src/plugins/texteditor/completionsettings.h index 5d9ebe3ddb..0b948baf56 100644 --- a/src/plugins/texteditor/completionsettings.h +++ b/src/plugins/texteditor/completionsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef COMPLETIONSETTINGS_H -#define COMPLETIONSETTINGS_H +#pragma once #include "texteditor_global.h" @@ -73,5 +72,3 @@ inline bool operator==(const CompletionSettings &t1, const CompletionSettings &t inline bool operator!=(const CompletionSettings &t1, const CompletionSettings &t2) { return !t1.equals(t2); } } // namespace TextEditor - -#endif // COMPLETIONSETTINGS_H diff --git a/src/plugins/texteditor/convenience.h b/src/plugins/texteditor/convenience.h index 49a4f58130..65dcd6be46 100644 --- a/src/plugins/texteditor/convenience.h +++ b/src/plugins/texteditor/convenience.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONVENIENCE_H -#define CONVENIENCE_H +#pragma once #include "texteditor_global.h" @@ -48,5 +47,3 @@ TEXTEDITOR_EXPORT QTextCursor flippedCursor(const QTextCursor &cursor); } // Util } // TextEditor - -#endif // CONVENIENCE_H diff --git a/src/plugins/texteditor/displaysettings.h b/src/plugins/texteditor/displaysettings.h index d93312bc71..1bb2bd8273 100644 --- a/src/plugins/texteditor/displaysettings.h +++ b/src/plugins/texteditor/displaysettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DISPLAYSETTINGS_H -#define DISPLAYSETTINGS_H +#pragma once #include "texteditor_global.h" @@ -65,5 +64,3 @@ inline bool operator==(const DisplaySettings &t1, const DisplaySettings &t2) { r inline bool operator!=(const DisplaySettings &t1, const DisplaySettings &t2) { return !t1.equals(t2); } } // namespace TextEditor - -#endif // DISPLAYSETTINGS_H diff --git a/src/plugins/texteditor/displaysettingspage.h b/src/plugins/texteditor/displaysettingspage.h index 26f5d9375f..8370f840cc 100644 --- a/src/plugins/texteditor/displaysettingspage.h +++ b/src/plugins/texteditor/displaysettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DISPLAYSETTINGSPAGE_H -#define DISPLAYSETTINGSPAGE_H +#pragma once #include "texteditor_global.h" @@ -73,5 +72,3 @@ private: }; } // namespace TextEditor - -#endif // DISPLAYSETTINGSPAGE_H diff --git a/src/plugins/texteditor/extraencodingsettings.h b/src/plugins/texteditor/extraencodingsettings.h index ffbb26f5ba..1361760b05 100644 --- a/src/plugins/texteditor/extraencodingsettings.h +++ b/src/plugins/texteditor/extraencodingsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ENCODINGSETTINGS_H -#define ENCODINGSETTINGS_H +#pragma once #include "texteditor_global.h" @@ -65,5 +64,3 @@ inline bool operator!=(const ExtraEncodingSettings &a, const ExtraEncodingSettin { return !a.equals(b); } } // TextEditor - -#endif // ENCODINGSETTINGS_H diff --git a/src/plugins/texteditor/findincurrentfile.h b/src/plugins/texteditor/findincurrentfile.h index e7cf3c0122..354680d63d 100644 --- a/src/plugins/texteditor/findincurrentfile.h +++ b/src/plugins/texteditor/findincurrentfile.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDINCURRENTFILE_H -#define FINDINCURRENTFILE_H +#pragma once #include "basefilefind.h" @@ -66,5 +65,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // FINDINCURRENTFILE_H diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index 06c21c1276..3fa85c07ed 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -194,7 +194,7 @@ void FindInFiles::findOnFileSystem(const QString &path) const QFileInfo fi(path); const QString folder = fi.isDir() ? fi.absoluteFilePath() : fi.absolutePath(); m_instance->setDirectory(FileName::fromString(folder)); - FindPlugin::instance()->openFindDialog(m_instance); + Find::openFindDialog(m_instance); } FindInFiles *FindInFiles::instance() diff --git a/src/plugins/texteditor/findinfiles.h b/src/plugins/texteditor/findinfiles.h index c049820311..71416aba22 100644 --- a/src/plugins/texteditor/findinfiles.h +++ b/src/plugins/texteditor/findinfiles.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDINFILES_H -#define FINDINFILES_H +#pragma once #include "basefilefind.h" @@ -77,5 +76,3 @@ private: }; } // namespace TextEditor - -#endif // FINDINFILES_H diff --git a/src/plugins/texteditor/findinopenfiles.h b/src/plugins/texteditor/findinopenfiles.h index ecd792f822..759636c1ae 100644 --- a/src/plugins/texteditor/findinopenfiles.h +++ b/src/plugins/texteditor/findinopenfiles.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDINOPENFILES_H -#define FINDINOPENFILES_H +#pragma once #include "basefilefind.h" @@ -57,5 +56,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // FINDINOPENFILES_H diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp index 6be14966d2..5b3402e4b5 100644 --- a/src/plugins/texteditor/fontsettings.cpp +++ b/src/plugins/texteditor/fontsettings.cpp @@ -68,6 +68,7 @@ void FontSettings::clear() m_antialias = DEFAULT_ANTIALIAS; m_scheme.clear(); m_formatCache.clear(); + m_textCharFormatCache.clear(); } void FontSettings::toSettings(const QString &category, @@ -218,7 +219,7 @@ void FontSettings::addMixinStyle(QTextCharFormat &textCharFormat, }; } -QTextCharFormat FontSettings::toTextCharFormat(const TextStyles textStyles) const +QTextCharFormat FontSettings::toTextCharFormat(const TextStyles &textStyles) const { auto textCharFormatIterator = m_textCharFormatCache.find(textStyles); if (textCharFormatIterator != m_textCharFormatCache.end()) @@ -259,6 +260,7 @@ void FontSettings::setFamily(const QString &family) { m_family = family; m_formatCache.clear(); + m_textCharFormatCache.clear(); } /** @@ -273,6 +275,7 @@ void FontSettings::setFontSize(int size) { m_fontSize = size; m_formatCache.clear(); + m_textCharFormatCache.clear(); } /** @@ -287,6 +290,7 @@ void FontSettings::setFontZoom(int zoom) { m_fontZoom = zoom; m_formatCache.clear(); + m_textCharFormatCache.clear(); } QFont FontSettings::font() const @@ -308,6 +312,7 @@ void FontSettings::setAntialias(bool antialias) { m_antialias = antialias; m_formatCache.clear(); + m_textCharFormatCache.clear(); } /** @@ -345,6 +350,7 @@ bool FontSettings::loadColorScheme(const QString &fileName, const FormatDescriptions &descriptions) { m_formatCache.clear(); + m_textCharFormatCache.clear(); bool loaded = true; m_schemeFileName = fileName; @@ -392,6 +398,7 @@ void FontSettings::setColorScheme(const ColorScheme &scheme) { m_scheme = scheme; m_formatCache.clear(); + m_textCharFormatCache.clear(); } static QString defaultFontFamily() diff --git a/src/plugins/texteditor/fontsettings.h b/src/plugins/texteditor/fontsettings.h index fea0ca5fd4..dbecc31a3e 100644 --- a/src/plugins/texteditor/fontsettings.h +++ b/src/plugins/texteditor/fontsettings.h @@ -23,14 +23,12 @@ ** ****************************************************************************/ -#ifndef FONTSETTINGS_H -#define FONTSETTINGS_H +#pragma once #include "texteditor_global.h" #include "colorscheme.h" - -#include <utils/sizedarray.h> +#include "textstyles.h" #include <QHash> #include <QList> @@ -47,13 +45,6 @@ namespace TextEditor { class FormatDescription; -using MixinTextStyles = Utils::SizedArray<TextStyle, 6>; - -struct TextStyles { - TextStyle mainStyle; - MixinTextStyles mixinStyles; -}; - /** * Font settings (default font and enumerated list of formats). */ @@ -75,7 +66,7 @@ public: QVector<QTextCharFormat> toTextCharFormats(const QVector<TextStyle> &categories) const; QTextCharFormat toTextCharFormat(TextStyle category) const; - QTextCharFormat toTextCharFormat(const TextStyles textStyles) const; + QTextCharFormat toTextCharFormat(const TextStyles &textStyles) const; QString family() const; void setFamily(const QString &family); @@ -127,5 +118,3 @@ inline bool operator==(const FontSettings &f1, const FontSettings &f2) { return inline bool operator!=(const FontSettings &f1, const FontSettings &f2) { return !f1.equals(f2); } } // namespace TextEditor - -#endif // FONTSETTINGS_H diff --git a/src/plugins/texteditor/fontsettingspage.h b/src/plugins/texteditor/fontsettingspage.h index 1d3d676def..fccc072e48 100644 --- a/src/plugins/texteditor/fontsettingspage.h +++ b/src/plugins/texteditor/fontsettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FONTSETTINGSPAGE_H -#define FONTSETTINGSPAGE_H +#pragma once #include "texteditor_global.h" @@ -57,6 +56,7 @@ public: ShowBackgroundControl = 0x2, ShowFontControls = 0x4, ShowUnderlineControl = 0x8, + ShowFontAndUnderlineControls = ShowFontControls | ShowUnderlineControl, AllControls = 0xF, AllControlsExceptUnderline = AllControls & ~ShowUnderlineControl, }; @@ -151,5 +151,3 @@ private: }; } // namespace TextEditor - -#endif // FONTSETTINGSPAGE_H diff --git a/src/plugins/texteditor/generichighlighter/context.h b/src/plugins/texteditor/generichighlighter/context.h index 93bd1f4775..79b0b280cb 100644 --- a/src/plugins/texteditor/generichighlighter/context.h +++ b/src/plugins/texteditor/generichighlighter/context.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONTEXT_H -#define CONTEXT_H +#pragma once #include "includerulesinstruction.h" @@ -102,5 +101,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // CONTEXT_H diff --git a/src/plugins/texteditor/generichighlighter/definitiondownloader.h b/src/plugins/texteditor/generichighlighter/definitiondownloader.h index 069675aa25..f9010fd873 100644 --- a/src/plugins/texteditor/generichighlighter/definitiondownloader.h +++ b/src/plugins/texteditor/generichighlighter/definitiondownloader.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DEFINITIONDOWNLOADER_H -#define DEFINITIONDOWNLOADER_H +#pragma once #include <QObject> #include <QString> @@ -77,5 +76,3 @@ struct DownloaderStarter } // namespace Internal } // namespace TextEditor - -#endif // DEFINITIONDOWNLOADER_H diff --git a/src/plugins/texteditor/generichighlighter/dynamicrule.h b/src/plugins/texteditor/generichighlighter/dynamicrule.h index 2014112eeb..c78b06f544 100644 --- a/src/plugins/texteditor/generichighlighter/dynamicrule.h +++ b/src/plugins/texteditor/generichighlighter/dynamicrule.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DYNAMICRULE_H -#define DYNAMICRULE_H +#pragma once #include "rule.h" @@ -56,5 +55,3 @@ void updateDynamicRules(const QList<QSharedPointer<Rule> > &rules, const QString } // namespace Internal } // namespace TextEditor - -#endif // DYNAMICRULE_H diff --git a/src/plugins/texteditor/generichighlighter/highlightdefinition.h b/src/plugins/texteditor/generichighlighter/highlightdefinition.h index c795f3900e..f39373df18 100644 --- a/src/plugins/texteditor/generichighlighter/highlightdefinition.h +++ b/src/plugins/texteditor/generichighlighter/highlightdefinition.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HIGHLIGHTDEFINITION_H -#define HIGHLIGHTDEFINITION_H +#pragma once #include <QString> #include <QHash> @@ -107,5 +106,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // HIGHLIGHTDEFINITION_H diff --git a/src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.h b/src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.h index 6f1ffb1ebc..44f5b3004e 100644 --- a/src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.h +++ b/src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HIGHLIGHTDEFINITIONHANDLER_H -#define HIGHLIGHTDEFINITIONHANDLER_H +#pragma once #include <QString> #include <QSharedPointer> @@ -98,5 +97,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // HIGHLIGHTDEFINITIONHANDLER_H diff --git a/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h b/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h index 030bdb9418..d6baff3d39 100644 --- a/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h +++ b/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HIGHLIGHTDEFINITIONMETADATA_H -#define HIGHLIGHTDEFINITIONMETADATA_H +#pragma once #include <QSharedPointer> #include <QStringList> @@ -53,5 +52,3 @@ typedef QSharedPointer<HighlightDefinitionMetaData> DefinitionMetaDataPtr; } // namespace Internal } // namespace TextEditor - -#endif // HIGHLIGHTDEFINITIONMETADATA_H diff --git a/src/plugins/texteditor/generichighlighter/highlighter.h b/src/plugins/texteditor/generichighlighter/highlighter.h index c3eab63439..af921cdccd 100644 --- a/src/plugins/texteditor/generichighlighter/highlighter.h +++ b/src/plugins/texteditor/generichighlighter/highlighter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HIGHLIGHTER_H -#define HIGHLIGHTER_H +#pragma once #include "context.h" @@ -192,5 +191,3 @@ private: }; } // namespace TextEditor - -#endif // HIGHLIGHTER_H diff --git a/src/plugins/texteditor/generichighlighter/highlighterexception.h b/src/plugins/texteditor/generichighlighter/highlighterexception.h index a0287b6957..0850656966 100644 --- a/src/plugins/texteditor/generichighlighter/highlighterexception.h +++ b/src/plugins/texteditor/generichighlighter/highlighterexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HIGHLIGHTEREXCEPTION_H -#define HIGHLIGHTEREXCEPTION_H +#pragma once #include <QString> @@ -41,5 +40,3 @@ private: }; } } // namespace TextEditor - -#endif // HIGHLIGHTEREXCEPTION_H diff --git a/src/plugins/texteditor/generichighlighter/highlightersettings.h b/src/plugins/texteditor/generichighlighter/highlightersettings.h index e06bd2a8c6..3323b5bd39 100644 --- a/src/plugins/texteditor/generichighlighter/highlightersettings.h +++ b/src/plugins/texteditor/generichighlighter/highlightersettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HIGHLIGHTERSETTINGS_H -#define HIGHLIGHTERSETTINGS_H +#pragma once #include <QString> #include <QStringList> @@ -84,5 +83,3 @@ QString findFallbackDefinitionsLocation(); } } // namespace TextEditor - -#endif // HIGHLIGHTERSETTINGS_H diff --git a/src/plugins/texteditor/generichighlighter/highlightersettingspage.h b/src/plugins/texteditor/generichighlighter/highlightersettingspage.h index d1d407fc20..ca7b62aaf2 100644 --- a/src/plugins/texteditor/generichighlighter/highlightersettingspage.h +++ b/src/plugins/texteditor/generichighlighter/highlightersettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HIGHLIGHTERSETTINGSPAGE_H -#define HIGHLIGHTERSETTINGSPAGE_H +#pragma once #include "highlightdefinitionmetadata.h" #include "../texteditoroptionspage.h" @@ -72,5 +71,3 @@ private: }; } // namespace TextEditor - -#endif // HIGHLIGHTERSETTINGSPAGE_H diff --git a/src/plugins/texteditor/generichighlighter/includerulesinstruction.h b/src/plugins/texteditor/generichighlighter/includerulesinstruction.h index 0a019555ac..aefdc42bb7 100644 --- a/src/plugins/texteditor/generichighlighter/includerulesinstruction.h +++ b/src/plugins/texteditor/generichighlighter/includerulesinstruction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INCLUDERULESINSTRUCTION_H -#define INCLUDERULESINSTRUCTION_H +#pragma once #include <QString> @@ -48,5 +47,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // INCLUDERULESINSTRUCTION_H diff --git a/src/plugins/texteditor/generichighlighter/itemdata.h b/src/plugins/texteditor/generichighlighter/itemdata.h index cbc5c8ae35..538d61ebde 100644 --- a/src/plugins/texteditor/generichighlighter/itemdata.h +++ b/src/plugins/texteditor/generichighlighter/itemdata.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ITEMDATA_H -#define ITEMDATA_H +#pragma once #include <QString> #include <QColor> @@ -81,5 +80,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // ITEMDATA_H diff --git a/src/plugins/texteditor/generichighlighter/keywordlist.h b/src/plugins/texteditor/generichighlighter/keywordlist.h index a6fc0d652f..f111afa4e0 100644 --- a/src/plugins/texteditor/generichighlighter/keywordlist.h +++ b/src/plugins/texteditor/generichighlighter/keywordlist.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef KEYWORDLIST_H -#define KEYWORDLIST_H +#pragma once #include <QString> #include <QSet> @@ -45,5 +44,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // KEYWORDLIST_H diff --git a/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.h b/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.h index 7afd0aed5c..2a6d1c0308 100644 --- a/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.h +++ b/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MANAGEDEFINITIONSDIALOG_H -#define MANAGEDEFINITIONSDIALOG_H +#pragma once #include "ui_managedefinitionsdialog.h" #include "highlightdefinitionmetadata.h" @@ -54,5 +53,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // MANAGEDEFINITIONSDIALOG_H diff --git a/src/plugins/texteditor/generichighlighter/manager.h b/src/plugins/texteditor/generichighlighter/manager.h index 0a6dfeb70a..5b602d2e03 100644 --- a/src/plugins/texteditor/generichighlighter/manager.h +++ b/src/plugins/texteditor/generichighlighter/manager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MANAGER_H -#define MANAGER_H +#pragma once #include "highlightdefinitionmetadata.h" @@ -118,5 +117,3 @@ signals: } // namespace Internal } // namespace TextEditor - -#endif // MANAGER_H diff --git a/src/plugins/texteditor/generichighlighter/progressdata.h b/src/plugins/texteditor/generichighlighter/progressdata.h index 947507b282..9563a1601e 100644 --- a/src/plugins/texteditor/generichighlighter/progressdata.h +++ b/src/plugins/texteditor/generichighlighter/progressdata.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROGRESSDATA_H -#define PROGRESSDATA_H +#pragma once #include <QStringList> @@ -80,5 +79,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // PROGRESSDATA_H diff --git a/src/plugins/texteditor/generichighlighter/reuse.h b/src/plugins/texteditor/generichighlighter/reuse.h index 4ce6236f11..d8d21f35c6 100644 --- a/src/plugins/texteditor/generichighlighter/reuse.h +++ b/src/plugins/texteditor/generichighlighter/reuse.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REUSE_H -#define REUSE_H +#pragma once #include <Qt> #include <QString> @@ -92,5 +91,3 @@ inline void setStartCharacter(QChar *c, const QString &character) } // namespace Internal } // namespace TextEditor - -#endif // REUSE_H diff --git a/src/plugins/texteditor/generichighlighter/rule.h b/src/plugins/texteditor/generichighlighter/rule.h index 8d87c491e8..4e25bef11a 100644 --- a/src/plugins/texteditor/generichighlighter/rule.h +++ b/src/plugins/texteditor/generichighlighter/rule.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RULE_H -#define RULE_H +#pragma once #include <QString> #include <QList> @@ -156,5 +155,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // RULE_H diff --git a/src/plugins/texteditor/generichighlighter/specificrules.h b/src/plugins/texteditor/generichighlighter/specificrules.h index 0507128a05..674c3fbd7b 100644 --- a/src/plugins/texteditor/generichighlighter/specificrules.h +++ b/src/plugins/texteditor/generichighlighter/specificrules.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SPECIFICRULES_H -#define SPECIFICRULES_H +#pragma once #include "rule.h" #include "dynamicrule.h" @@ -289,5 +288,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // SPECIFICRULES_H diff --git a/src/plugins/texteditor/helpitem.h b/src/plugins/texteditor/helpitem.h index db40390c12..f7ea8ee4f3 100644 --- a/src/plugins/texteditor/helpitem.h +++ b/src/plugins/texteditor/helpitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITORHELPITEM_H -#define TEXTEDITORHELPITEM_H +#pragma once #include "texteditor_global.h" @@ -81,5 +80,3 @@ private: }; } // namespace TextEditor - -#endif // TEXTEDITORHELPITEM_H diff --git a/src/plugins/texteditor/highlighterutils.h b/src/plugins/texteditor/highlighterutils.h index 2d07ffbbaf..cab592cacf 100644 --- a/src/plugins/texteditor/highlighterutils.h +++ b/src/plugins/texteditor/highlighterutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HIGHLIGHTERUTILS_H -#define HIGHLIGHTERUTILS_H +#pragma once #include <QString> #include "texteditor_global.h" @@ -44,5 +43,3 @@ void setMimeTypeForHighlighter(Highlighter *highlighter, const Utils::MimeType & QString *foundDefinitionId = 0); } // namespace TextEditor - -#endif // HIGHLIGHTERUTILS_H diff --git a/src/plugins/texteditor/icodestylepreferences.h b/src/plugins/texteditor/icodestylepreferences.h index 2da03c7dfb..91dd72d9e3 100644 --- a/src/plugins/texteditor/icodestylepreferences.h +++ b/src/plugins/texteditor/icodestylepreferences.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ICODESTYLEPREFERENCES_H -#define ICODESTYLEPREFERENCES_H +#pragma once #include "texteditor_global.h" @@ -107,5 +106,3 @@ private: } // namespace TextEditor - -#endif // ICODESTYLEPREFERENCES_H diff --git a/src/plugins/texteditor/icodestylepreferencesfactory.h b/src/plugins/texteditor/icodestylepreferencesfactory.h index bc00f1aa7e..de4dc8de17 100644 --- a/src/plugins/texteditor/icodestylepreferencesfactory.h +++ b/src/plugins/texteditor/icodestylepreferencesfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ICODESTYLEPREFERENCESFACTORY_H -#define ICODESTYLEPREFERENCESFACTORY_H +#pragma once #include "texteditor_global.h" @@ -54,5 +53,3 @@ public: }; } // namespace TextEditor - -#endif // ICODESTYLEPREFERENCESFACTORY_H diff --git a/src/plugins/texteditor/indenter.h b/src/plugins/texteditor/indenter.h index 8f5093c9dd..08286b33f5 100644 --- a/src/plugins/texteditor/indenter.h +++ b/src/plugins/texteditor/indenter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INDENTER_H -#define INDENTER_H +#pragma once #include "texteditor_global.h" @@ -73,5 +72,3 @@ public: }; } // namespace TextEditor - -#endif // INDENTER_H diff --git a/src/plugins/texteditor/ioutlinewidget.h b/src/plugins/texteditor/ioutlinewidget.h index 1306227b5f..d6aa32fa03 100644 --- a/src/plugins/texteditor/ioutlinewidget.h +++ b/src/plugins/texteditor/ioutlinewidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOUTLINEWIDGET_H -#define IOUTLINEWIDGET_H +#pragma once #include <texteditor/texteditor_global.h> #include <QWidget> @@ -55,5 +54,3 @@ public: }; } // namespace TextEditor - -#endif // IOUTLINEWIDGET_H diff --git a/src/plugins/texteditor/linenumberfilter.h b/src/plugins/texteditor/linenumberfilter.h index b482b086c9..8a8954cadf 100644 --- a/src/plugins/texteditor/linenumberfilter.h +++ b/src/plugins/texteditor/linenumberfilter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LINENUMBERFILTER_H -#define LINENUMBERFILTER_H +#pragma once #include <coreplugin/locator/ilocatorfilter.h> @@ -55,5 +54,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // LINENUMBERFILTER_H diff --git a/src/plugins/texteditor/marginsettings.h b/src/plugins/texteditor/marginsettings.h index 087d0f3b9e..ff8be7bcde 100644 --- a/src/plugins/texteditor/marginsettings.h +++ b/src/plugins/texteditor/marginsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITOR_MARGINSETTINGS_H -#define TEXTEDITOR_MARGINSETTINGS_H +#pragma once #include "texteditor_global.h" @@ -59,5 +58,3 @@ inline bool operator!=(const MarginSettings &one, const MarginSettings &two) { return !one.equals(two); } } // namespace TextEditor - -#endif // TEXTEDITOR_MARGINSETTINGS_H diff --git a/src/plugins/texteditor/normalindenter.h b/src/plugins/texteditor/normalindenter.h index 3cbbb6fd98..ca2a52c1d9 100644 --- a/src/plugins/texteditor/normalindenter.h +++ b/src/plugins/texteditor/normalindenter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef NORMALINDENTER_H -#define NORMALINDENTER_H +#pragma once #include "indenter.h" @@ -40,5 +39,3 @@ public: }; } // namespace TextEditor - -#endif // NORMALINDENTER_H diff --git a/src/plugins/texteditor/outlinefactory.h b/src/plugins/texteditor/outlinefactory.h index 09421f1253..05f60a7859 100644 --- a/src/plugins/texteditor/outlinefactory.h +++ b/src/plugins/texteditor/outlinefactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OUTLINE_H -#define OUTLINE_H +#pragma once #include <texteditor/ioutlinewidget.h> #include <coreplugin/inavigationwidgetfactory.h> @@ -86,5 +85,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // OUTLINE_H diff --git a/src/plugins/texteditor/plaintexteditorfactory.h b/src/plugins/texteditor/plaintexteditorfactory.h index b060b1ca9f..38b0194895 100644 --- a/src/plugins/texteditor/plaintexteditorfactory.h +++ b/src/plugins/texteditor/plaintexteditorfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLAINTEXTEDITORFACTORY_H -#define PLAINTEXTEDITORFACTORY_H +#pragma once #include <texteditor/texteditor.h> @@ -41,5 +40,3 @@ public: }; } // namespace TextEditor - -#endif // PLAINTEXTEDITORFACTORY_H diff --git a/src/plugins/texteditor/quickfix.h b/src/plugins/texteditor/quickfix.h index 56a1cb80b1..efb9f10619 100644 --- a/src/plugins/texteditor/quickfix.h +++ b/src/plugins/texteditor/quickfix.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITORQUICKFIX_H -#define TEXTEDITORQUICKFIX_H +#pragma once #include "texteditor_global.h" @@ -120,5 +119,3 @@ public: } // namespace TextEditor Q_DECLARE_METATYPE(TextEditor::QuickFixOperation::Ptr) - -#endif // TEXTEDITORQUICKFIX_H diff --git a/src/plugins/texteditor/refactoringchanges.h b/src/plugins/texteditor/refactoringchanges.h index aa842b34bd..737728a931 100644 --- a/src/plugins/texteditor/refactoringchanges.h +++ b/src/plugins/texteditor/refactoringchanges.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REFACTORINGCHANGES_H -#define REFACTORINGCHANGES_H +#pragma once #include <utils/changeset.h> #include <utils/textfileformat.h> @@ -163,5 +162,3 @@ public: }; } // namespace TextEditor - -#endif // REFACTORINGCHANGES_H diff --git a/src/plugins/texteditor/refactoroverlay.h b/src/plugins/texteditor/refactoroverlay.h index d6eb3f2641..aceb55bb54 100644 --- a/src/plugins/texteditor/refactoroverlay.h +++ b/src/plugins/texteditor/refactoroverlay.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REFACTOROVERLAY_H -#define REFACTOROVERLAY_H +#pragma once #include "texteditor_global.h" @@ -70,5 +69,3 @@ private: }; } // namespace TextEditor - -#endif // REFACTOROVERLAY_H diff --git a/src/plugins/texteditor/semantichighlighter.cpp b/src/plugins/texteditor/semantichighlighter.cpp index 1837d5d10f..0af085b082 100644 --- a/src/plugins/texteditor/semantichighlighter.cpp +++ b/src/plugins/texteditor/semantichighlighter.cpp @@ -26,6 +26,7 @@ #include "semantichighlighter.h" #include "syntaxhighlighter.h" +#include "texteditorsettings.h" #include <utils/qtcassert.h> @@ -35,6 +36,19 @@ using namespace TextEditor; using namespace TextEditor::SemanticHighlighter; +namespace { + +QTextCharFormat textCharFormatForResult(const HighlightingResult &result, + const QHash<int, QTextCharFormat> &kindToFormat) +{ + if (result.useTextSyles) + return TextEditorSettings::fontSettings().toTextCharFormat(result.textStyles); + else + return kindToFormat.value(result.kind); +} + +} + void SemanticHighlighter::incrementalApplyExtraAdditionalFormats( SyntaxHighlighter *highlighter, const QFuture<HighlightingResult> &future, @@ -84,7 +98,7 @@ void SemanticHighlighter::incrementalApplyExtraAdditionalFormats( forever { QTextLayout::FormatRange formatRange; - formatRange.format = kindToFormat.value(result.kind); + formatRange.format = textCharFormatForResult(result, kindToFormat); if (formatRange.format.isValid()) { formatRange.start = result.column - 1; formatRange.length = result.length; diff --git a/src/plugins/texteditor/semantichighlighter.h b/src/plugins/texteditor/semantichighlighter.h index 267e9d092d..d0e0b97a71 100644 --- a/src/plugins/texteditor/semantichighlighter.h +++ b/src/plugins/texteditor/semantichighlighter.h @@ -23,11 +23,12 @@ ** ****************************************************************************/ -#ifndef TEXTEDITOR_SEMANTICHIGHLIGHTER_H -#define TEXTEDITOR_SEMANTICHIGHLIGHTER_H +#pragma once #include "texteditor_global.h" +#include "fontsettings.h" + #include <QHash> #include <QFuture> #include <QTextCharFormat> @@ -45,7 +46,9 @@ public: unsigned line; // 1-based unsigned column; // 1-based unsigned length; + TextStyles textStyles; int kind; /// The various highlighters can define their own kind of results. + bool useTextSyles; bool isValid() const { return line != 0; } @@ -58,7 +61,11 @@ public: {} HighlightingResult(unsigned line, unsigned column, unsigned length, int kind) - : line(line), column(column), length(length), kind(kind) + : line(line), column(column), length(length), kind(kind), useTextSyles(false) + {} + + HighlightingResult(unsigned line, unsigned column, unsigned length, TextStyles textStyles) + : line(line), column(column), length(length), textStyles(textStyles), useTextSyles(true) {} bool operator==(const HighlightingResult& other) const @@ -95,5 +102,3 @@ void TEXTEDITOR_EXPORT clearExtraAdditionalFormatsUntilEnd( } // namespace SemanticHighlighter } // namespace TextEditor - -#endif // TEXTEDITOR_SEMANTICHIGHLIGHTER_H diff --git a/src/plugins/texteditor/simplecodestylepreferences.h b/src/plugins/texteditor/simplecodestylepreferences.h index 1f974f0ed9..2f4c5680d0 100644 --- a/src/plugins/texteditor/simplecodestylepreferences.h +++ b/src/plugins/texteditor/simplecodestylepreferences.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SIMPLECODESTYLEPREFERENCES_H -#define SIMPLECODESTYLEPREFERENCES_H +#pragma once #include "icodestylepreferences.h" @@ -45,5 +44,3 @@ protected: }; } // namespace TextEditor - -#endif // SIMPLECODESTYLEPREFERENCES_H diff --git a/src/plugins/texteditor/simplecodestylepreferenceswidget.h b/src/plugins/texteditor/simplecodestylepreferenceswidget.h index 79f0135cee..9d4571fd33 100644 --- a/src/plugins/texteditor/simplecodestylepreferenceswidget.h +++ b/src/plugins/texteditor/simplecodestylepreferenceswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SIMPLECODESTYLEPREFERENCESWIDGET_H -#define SIMPLECODESTYLEPREFERENCESWIDGET_H +#pragma once #include "texteditor_global.h" @@ -59,4 +58,3 @@ private: }; } // namespace TextEditor -#endif // SIMPLECODESTYLEPREFERENCESWIDGET_H diff --git a/src/plugins/texteditor/snippets/isnippetprovider.h b/src/plugins/texteditor/snippets/isnippetprovider.h index 23461c6c2b..0001b0089c 100644 --- a/src/plugins/texteditor/snippets/isnippetprovider.h +++ b/src/plugins/texteditor/snippets/isnippetprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ISNIPPETPROVIDER_H -#define ISNIPPETPROVIDER_H +#pragma once #include <texteditor/texteditor_global.h> @@ -49,5 +48,3 @@ protected: }; } // TextEditor - -#endif // ISNIPPETPROVIDER_H diff --git a/src/plugins/texteditor/snippets/plaintextsnippetprovider.h b/src/plugins/texteditor/snippets/plaintextsnippetprovider.h index e7a647755f..a3a3d949da 100644 --- a/src/plugins/texteditor/snippets/plaintextsnippetprovider.h +++ b/src/plugins/texteditor/snippets/plaintextsnippetprovider.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLAINTEXTSNIPPETPROVIDER_H -#define PLAINTEXTSNIPPETPROVIDER_H +#pragma once #include "isnippetprovider.h" @@ -45,5 +44,3 @@ public: } // Internal } // TextEditor - -#endif // PLAINTEXTSNIPPETPROVIDER_H diff --git a/src/plugins/texteditor/snippets/reuse.h b/src/plugins/texteditor/snippets/reuse.h index 77832e1628..60ab7d6f17 100644 --- a/src/plugins/texteditor/snippets/reuse.h +++ b/src/plugins/texteditor/snippets/reuse.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REUSE_H -#define REUSE_H +#pragma once #include <QString> #include <QLatin1String> @@ -51,5 +50,3 @@ inline QString fromBool(bool b) } // Internal } // TextEditor - -#endif // REUSE_H diff --git a/src/plugins/texteditor/snippets/snippet.h b/src/plugins/texteditor/snippets/snippet.h index ef802de519..7b95169a1f 100644 --- a/src/plugins/texteditor/snippets/snippet.h +++ b/src/plugins/texteditor/snippets/snippet.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SNIPPET_H -#define SNIPPET_H +#pragma once #include <texteditor/texteditor_global.h> @@ -103,5 +102,3 @@ private: }; } // TextEditor - -#endif // SNIPPET_H diff --git a/src/plugins/texteditor/snippets/snippetassistcollector.h b/src/plugins/texteditor/snippets/snippetassistcollector.h index 59f4df8e91..9cd2320435 100644 --- a/src/plugins/texteditor/snippets/snippetassistcollector.h +++ b/src/plugins/texteditor/snippets/snippetassistcollector.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SNIPPETASSISTCOLLECTOR_H -#define SNIPPETASSISTCOLLECTOR_H +#pragma once #include <texteditor/texteditor_global.h> @@ -51,5 +50,3 @@ private: }; } // TextEditor - -#endif // SNIPPETASSISTCOLLECTOR_H diff --git a/src/plugins/texteditor/snippets/snippeteditor.h b/src/plugins/texteditor/snippets/snippeteditor.h index bb18c13bc9..d27a38baa1 100644 --- a/src/plugins/texteditor/snippets/snippeteditor.h +++ b/src/plugins/texteditor/snippets/snippeteditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SNIPPETEDITOR_H -#define SNIPPETEDITOR_H +#pragma once #include <texteditor/texteditor_global.h> #include <texteditor/texteditor.h> @@ -48,5 +47,3 @@ protected: }; } // namespace TextEditor - -#endif // SNIPPETEDITOR_H diff --git a/src/plugins/texteditor/snippets/snippetscollection.h b/src/plugins/texteditor/snippets/snippetscollection.h index c0450ff66d..98e9d80f24 100644 --- a/src/plugins/texteditor/snippets/snippetscollection.h +++ b/src/plugins/texteditor/snippets/snippetscollection.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SNIPPETSCOLLECTION_H -#define SNIPPETSCOLLECTION_H +#pragma once #include "snippet.h" @@ -137,5 +136,3 @@ private: } // Internal } // TextEditor - -#endif // SNIPPETSCOLLECTION_H diff --git a/src/plugins/texteditor/snippets/snippetssettings.h b/src/plugins/texteditor/snippets/snippetssettings.h index 5aa778f31d..d193478440 100644 --- a/src/plugins/texteditor/snippets/snippetssettings.h +++ b/src/plugins/texteditor/snippets/snippetssettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SNIPPETSSETTINGS_H -#define SNIPPETSSETTINGS_H +#pragma once #include <QString> @@ -58,5 +57,3 @@ inline bool operator!=(const SnippetsSettings &a, const SnippetsSettings &b) { return !a.equals(b); } } // TextEditor - -#endif // SNIPPETSSETTINGS_H diff --git a/src/plugins/texteditor/snippets/snippetssettingspage.h b/src/plugins/texteditor/snippets/snippetssettingspage.h index d50184e3c3..10e480bdad 100644 --- a/src/plugins/texteditor/snippets/snippetssettingspage.h +++ b/src/plugins/texteditor/snippets/snippetssettingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SNIPPETSSETTINGSPAGE_H -#define SNIPPETSSETTINGSPAGE_H +#pragma once #include "../texteditoroptionspage.h" @@ -51,5 +50,3 @@ private: } // Internal } // TextEditor - -#endif // SNIPPETSSETTINGSPAGE_H diff --git a/src/plugins/texteditor/storagesettings.h b/src/plugins/texteditor/storagesettings.h index b8684e7dfc..ffe7823f0f 100644 --- a/src/plugins/texteditor/storagesettings.h +++ b/src/plugins/texteditor/storagesettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef STORAGESETTINGS_H -#define STORAGESETTINGS_H +#pragma once #include "texteditor_global.h" @@ -59,5 +58,3 @@ inline bool operator==(const StorageSettings &t1, const StorageSettings &t2) { r inline bool operator!=(const StorageSettings &t1, const StorageSettings &t2) { return !t1.equals(t2); } } // namespace TextEditor - -#endif // STORAGESETTINGS_H diff --git a/src/plugins/texteditor/syntaxhighlighter.h b/src/plugins/texteditor/syntaxhighlighter.h index 32480f0ee5..8da2a908c7 100644 --- a/src/plugins/texteditor/syntaxhighlighter.h +++ b/src/plugins/texteditor/syntaxhighlighter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITOR_SYNTAXHIGHLIGHTER_H -#define TEXTEDITOR_SYNTAXHIGHLIGHTER_H +#pragma once #include "texteditor_global.h" #include <texteditor/texteditorconstants.h> @@ -98,5 +97,3 @@ private: }; } // namespace TextEditor - -#endif // TEXTEDITOR_SYNTAXHIGHLIGHTER_H diff --git a/src/plugins/texteditor/tabsettings.h b/src/plugins/texteditor/tabsettings.h index f0b60584b7..01ea77c5bb 100644 --- a/src/plugins/texteditor/tabsettings.h +++ b/src/plugins/texteditor/tabsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TABSETTINGS_H -#define TABSETTINGS_H +#pragma once #include "texteditor_global.h" @@ -104,5 +103,3 @@ inline bool operator!=(const TabSettings &t1, const TabSettings &t2) { return !t Q_DECLARE_METATYPE(TextEditor::TabSettings) Q_DECLARE_METATYPE(TextEditor::TabSettings::TabPolicy) Q_DECLARE_METATYPE(TextEditor::TabSettings::ContinuationAlignBehavior) - -#endif // TABSETTINGS_H diff --git a/src/plugins/texteditor/tabsettingswidget.h b/src/plugins/texteditor/tabsettingswidget.h index 942d4d872e..99ed5f0cc2 100644 --- a/src/plugins/texteditor/tabsettingswidget.h +++ b/src/plugins/texteditor/tabsettingswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITOR_TABSETTINGSWIDGET_H -#define TEXTEDITOR_TABSETTINGSWIDGET_H +#pragma once #include "texteditor_global.h" @@ -67,4 +66,3 @@ private: }; } // namespace TextEditor -#endif // TEXTEDITOR_TABSETTINGSWIDGET_H diff --git a/src/plugins/texteditor/textdocument.h b/src/plugins/texteditor/textdocument.h index f4eebcc46e..87a7d6ac2a 100644 --- a/src/plugins/texteditor/textdocument.h +++ b/src/plugins/texteditor/textdocument.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASETEXTDOCUMENT_H -#define BASETEXTDOCUMENT_H +#pragma once #include "texteditor_global.h" @@ -157,5 +156,3 @@ private: typedef QSharedPointer<TextDocument> TextDocumentPtr; } // namespace TextEditor - -#endif // BASETEXTDOCUMENT_H diff --git a/src/plugins/texteditor/textdocumentlayout.h b/src/plugins/texteditor/textdocumentlayout.h index e746aa8461..928ed7dbb6 100644 --- a/src/plugins/texteditor/textdocumentlayout.h +++ b/src/plugins/texteditor/textdocumentlayout.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTDOCUMENTLAYOUT_H -#define TEXTDOCUMENTLAYOUT_H +#pragma once #include "texteditor_global.h" @@ -223,5 +222,3 @@ signals: }; } // namespace TextEditor - -#endif // TEXTDOCUMENTLAYOUT_H diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 71733bc377..d9e03133b8 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -2389,6 +2389,7 @@ void TextEditorWidget::keyPressEvent(QKeyEvent *e) // because AltGr maps to Alt + Ctrl QTextCursor cursor = textCursor(); const QString &autoText = d->m_autoCompleter->autoComplete(cursor, eventText); + const bool cursorWithinSnippet = d->snippetCheckCursor(cursor); QChar electricChar; if (d->m_document->typingSettings().m_autoIndent) { @@ -2400,10 +2401,6 @@ void TextEditorWidget::keyPressEvent(QKeyEvent *e) } } - bool cursorWithinSnippet = false; - if (d->m_snippetOverlay->isVisible()) - cursorWithinSnippet = d->snippetCheckCursor(cursor); - bool doEditBlock = !electricChar.isNull() || !autoText.isEmpty() || cursorWithinSnippet; if (doEditBlock) cursor.beginEditBlock(); diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index d29c325014..4e97b6396d 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITOR_H -#define TEXTEDITOR_H +#pragma once #include "texteditor_global.h" #include "blockrange.h" @@ -666,5 +665,3 @@ private: } // namespace TextEditor Q_DECLARE_METATYPE(TextEditor::TextEditorWidget::Link) - -#endif // TEXTEDITOR_H diff --git a/src/plugins/texteditor/texteditor.pro b/src/plugins/texteditor/texteditor.pro index 16a791de0b..49da0c3e1a 100644 --- a/src/plugins/texteditor/texteditor.pro +++ b/src/plugins/texteditor/texteditor.pro @@ -216,7 +216,8 @@ HEADERS += texteditorplugin.h \ codeassist/keywordscompletionassist.h \ textmarkregistry.h \ marginsettings.h \ - blockrange.h + blockrange.h \ + textstyles.h FORMS += \ displaysettingspage.ui \ diff --git a/src/plugins/texteditor/texteditor.qbs b/src/plugins/texteditor/texteditor.qbs index 532cdc03e2..a54d635201 100644 --- a/src/plugins/texteditor/texteditor.qbs +++ b/src/plugins/texteditor/texteditor.qbs @@ -135,6 +135,7 @@ QtcPlugin { "textmark.cpp", "textmark.h", "textmarkregistry.h", + "textstyles.h", "typingsettings.cpp", "typingsettings.h", ] diff --git a/src/plugins/texteditor/texteditor_global.h b/src/plugins/texteditor/texteditor_global.h index baceabf108..08f7adc5eb 100644 --- a/src/plugins/texteditor/texteditor_global.h +++ b/src/plugins/texteditor/texteditor_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITOR_GLOBAL_H -#define TEXTEDITOR_GLOBAL_H +#pragma once #include <qglobal.h> @@ -46,5 +45,3 @@ enum TextPositionOperation }; } // namespace TextEditor - -#endif // TEXTEDITOR_GLOBAL_H diff --git a/src/plugins/texteditor/texteditor_p.h b/src/plugins/texteditor/texteditor_p.h index 6d7a2955db..ec2ad4ab7f 100644 --- a/src/plugins/texteditor/texteditor_p.h +++ b/src/plugins/texteditor/texteditor_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITOR_P_H -#define TEXTEDITOR_P_H +#pragma once #include "texteditor_global.h" @@ -91,5 +90,3 @@ struct TextEditorPrivateHighlightBlocks } // namespace Internal } // namespace TextEditor - -#endif // TEXTEDITOR_P_H diff --git a/src/plugins/texteditor/texteditoractionhandler.h b/src/plugins/texteditor/texteditoractionhandler.h index 710206734d..02067ae12d 100644 --- a/src/plugins/texteditor/texteditoractionhandler.h +++ b/src/plugins/texteditor/texteditoractionhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITORACTIONHANDLER_H -#define TEXTEDITORACTIONHANDLER_H +#pragma once #include "texteditor_global.h" @@ -68,5 +67,3 @@ private: }; } // namespace TextEditor - -#endif // TEXTEDITORACTIONHANDLER_H diff --git a/src/plugins/texteditor/texteditorconstants.cpp b/src/plugins/texteditor/texteditorconstants.cpp index 5d137a1e27..7325030306 100644 --- a/src/plugins/texteditor/texteditorconstants.cpp +++ b/src/plugins/texteditor/texteditorconstants.cpp @@ -52,6 +52,7 @@ const char *nameForStyle(TextStyle style) case C_STRING: return "String"; case C_TYPE: return "Type"; case C_LOCAL: return "Local"; + case C_GLOBAL: return "Global"; case C_FIELD: return "Field"; // TODO: Rename "Static" to "Enumeration" in next major update, // because renaming here would break styles defined by the user. @@ -99,6 +100,7 @@ const char *nameForStyle(TextStyle style) case C_WARNING: return "Warning"; case C_WARNING_CONTEXT: return "WarningContext"; + case C_DECLARATION: return "Declaration"; case C_LAST_STYLE_SENTINEL: return "LastStyleSentinel"; } diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index 19cf640957..0be947fc9a 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITORCONSTANTS_H -#define TEXTEDITORCONSTANTS_H +#pragma once #include <QtGlobal> @@ -51,6 +50,7 @@ enum TextStyle : quint8 { C_STRING, C_TYPE, C_LOCAL, + C_GLOBAL, C_FIELD, C_ENUMERATION, C_VIRTUAL_METHOD, @@ -98,6 +98,8 @@ enum TextStyle : quint8 { C_ERROR, C_ERROR_CONTEXT, + C_DECLARATION, + C_LAST_STYLE_SENTINEL }; @@ -205,5 +207,3 @@ const unsigned COMPLETION_ASSIST_TOOLTIP_DELAY = 100; } // namespace Constants } // namespace TextEditor - -#endif // TEXTEDITORCONSTANTS_H diff --git a/src/plugins/texteditor/texteditoroptionspage.h b/src/plugins/texteditor/texteditoroptionspage.h index 51b623545f..9bd8a1aaa0 100644 --- a/src/plugins/texteditor/texteditoroptionspage.h +++ b/src/plugins/texteditor/texteditoroptionspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITOROPTIONSPAGE_H -#define TEXTEDITOROPTIONSPAGE_H +#pragma once #include "texteditor_global.h" @@ -44,5 +43,3 @@ public: }; } // namespace TextEditor - -#endif // TEXTEDITOROPTIONSPAGE_H diff --git a/src/plugins/texteditor/texteditoroverlay.h b/src/plugins/texteditor/texteditoroverlay.h index 5ee122690a..08a508f1da 100644 --- a/src/plugins/texteditor/texteditoroverlay.h +++ b/src/plugins/texteditor/texteditoroverlay.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITOROVERLAY_H -#define TEXTEDITOROVERLAY_H +#pragma once #include <QObject> #include <QList> @@ -124,5 +123,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // TEXTEDITOROVERLAY_H diff --git a/src/plugins/texteditor/texteditorplugin.h b/src/plugins/texteditor/texteditorplugin.h index f8486caa67..5cabb2fc95 100644 --- a/src/plugins/texteditor/texteditorplugin.h +++ b/src/plugins/texteditor/texteditorplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITORPLUGIN_H -#define TEXTEDITORPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -88,5 +87,3 @@ private slots: } // namespace Internal } // namespace TextEditor - -#endif // TEXTEDITORPLUGIN_H diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index f5d45c04fa..b1188bf30f 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -157,6 +157,7 @@ TextEditorSettings::TextEditorSettings(QObject *parent) formatDescr.emplace_back(C_LOCAL, tr("Local"), tr("Local variables.")); formatDescr.emplace_back(C_FIELD, tr("Field"), tr("Class' data members."), Qt::darkRed); + formatDescr.emplace_back(C_GLOBAL, tr("Global"), tr("Global variables.")); formatDescr.emplace_back(C_ENUMERATION, tr("Enumeration"), tr("Applied to enumeration items."), Qt::darkMagenta); @@ -305,7 +306,10 @@ TextEditorSettings::TextEditorSettings(QObject *parent) QColor(255, 190, 0), QTextCharFormat::DotLine, FormatDescription::ShowUnderlineControl); - + formatDescr.emplace_back(C_DECLARATION, + tr("Declaration"), + tr("Declaration of a function, variable, and so on."), + FormatDescription::ShowFontAndUnderlineControls); d->m_fontSettingsPage = new FontSettingsPage(formatDescr, Constants::TEXT_EDITOR_FONT_SETTINGS, diff --git a/src/plugins/texteditor/texteditorsettings.h b/src/plugins/texteditor/texteditorsettings.h index dd810de9d2..abbba3d314 100644 --- a/src/plugins/texteditor/texteditorsettings.h +++ b/src/plugins/texteditor/texteditorsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITORSETTINGS_H -#define TEXTEDITORSETTINGS_H +#pragma once #include "texteditor_global.h" @@ -113,5 +112,3 @@ signals: }; } // namespace TextEditor - -#endif // TEXTEDITORSETTINGS_H diff --git a/src/plugins/texteditor/textmark.h b/src/plugins/texteditor/textmark.h index 115f6c3cb3..8387de8c71 100644 --- a/src/plugins/texteditor/textmark.h +++ b/src/plugins/texteditor/textmark.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TextMark_H -#define TextMark_H +#pragma once #include "texteditor_global.h" @@ -110,5 +109,3 @@ private: }; } // namespace TextEditor - -#endif // TextMark_H diff --git a/src/plugins/texteditor/textmarkregistry.h b/src/plugins/texteditor/textmarkregistry.h index aa0acbbec1..33aa5edc40 100644 --- a/src/plugins/texteditor/textmarkregistry.h +++ b/src/plugins/texteditor/textmarkregistry.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BASETEXTMARKREGISTRY_H -#define BASETEXTMARKREGISTRY_H +#pragma once #include <utils/fileutils.h> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace TextEditor - -#endif // BASETEXTMARKREGISTRY_H diff --git a/src/plugins/android/javaautocompleter.h b/src/plugins/texteditor/textstyles.h index 6372d15695..f7d591b832 100644 --- a/src/plugins/android/javaautocompleter.h +++ b/src/plugins/texteditor/textstyles.h @@ -23,25 +23,18 @@ ** ****************************************************************************/ -#ifndef JAVAAUTOCOMPLETER_H -#define JAVAAUTOCOMPLETER_H +#pragma once -#include <texteditor/autocompleter.h> +#include "texteditorconstants.h" -namespace Android { -namespace Internal { +#include <utils/sizedarray.h> -class JavaAutoCompleter : public TextEditor::AutoCompleter -{ -public: - // TODO What does the base class do? - // I only need the contextAllowsAutoParenthses change - JavaAutoCompleter(); - bool contextAllowsAutoParentheses(const QTextCursor &cursor, - const QString &textToInsert = QString()) const; -}; -} -} +namespace TextEditor { +using MixinTextStyles = Utils::SizedArray<TextStyle, 6>; +struct TextStyles { + TextStyle mainStyle; + MixinTextStyles mixinStyles; +}; -#endif // JAVAAUTOCOMPLETER_H +} // namespace TextEditor diff --git a/src/plugins/texteditor/typingsettings.h b/src/plugins/texteditor/typingsettings.h index 50dfaf9389..f71fb3c6cc 100644 --- a/src/plugins/texteditor/typingsettings.h +++ b/src/plugins/texteditor/typingsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TYPINGSETTINGS_H -#define TYPINGSETTINGS_H +#pragma once #include "texteditor_global.h" @@ -78,5 +77,3 @@ inline bool operator!=(const TypingSettings &t1, const TypingSettings &t2) { ret } // namespace TextEditor Q_DECLARE_METATYPE(TextEditor::TypingSettings) - -#endif // TYPINGSETTINGS_H diff --git a/src/plugins/todo/constants.h b/src/plugins/todo/constants.h index 4a4ab5ac00..b4598dd0b9 100644 --- a/src/plugins/todo/constants.h +++ b/src/plugins/todo/constants.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef CONSTANTS_H -#define CONSTANTS_H +#pragma once #include <QtGlobal> @@ -71,5 +70,3 @@ const char OUTPUT_PANE_TITLE[] = QT_TRANSLATE_NOOP("Todo::Internal::TodoOutputPa } // namespace Constants } // namespace Todo - -#endif // CONSTANTS_H diff --git a/src/plugins/todo/cpptodoitemsscanner.h b/src/plugins/todo/cpptodoitemsscanner.h index 8d02420b14..966976d054 100644 --- a/src/plugins/todo/cpptodoitemsscanner.h +++ b/src/plugins/todo/cpptodoitemsscanner.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef CPPTODOITEMSSCANNER_H -#define CPPTODOITEMSSCANNER_H +#pragma once #include "todoitemsscanner.h" @@ -53,5 +52,3 @@ private: } } - -#endif // CPPTODOITEMSSCANNER_H diff --git a/src/plugins/todo/keyword.h b/src/plugins/todo/keyword.h index f763f38a35..170cbfa5f2 100644 --- a/src/plugins/todo/keyword.h +++ b/src/plugins/todo/keyword.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef KEYWORD_H -#define KEYWORD_H +#pragma once #include "todoicons.h" @@ -55,5 +54,3 @@ bool operator !=(Keyword &k1, Keyword &k2); } // namespace Internal } // namespace Todo - -#endif // KEYWORD_H diff --git a/src/plugins/todo/keyworddialog.h b/src/plugins/todo/keyworddialog.h index a0e5005a92..b6e8a775d0 100644 --- a/src/plugins/todo/keyworddialog.h +++ b/src/plugins/todo/keyworddialog.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef KEYWORDDIALOG_H -#define KEYWORDDIALOG_H +#pragma once #include <QDialog> #include <QSet> @@ -67,5 +66,3 @@ private: } // namespace Internal } // namespace Todo - -#endif // KEYWORDDIALOG_H diff --git a/src/plugins/todo/lineparser.h b/src/plugins/todo/lineparser.h index 12c20ba52f..8d5c3bed1e 100644 --- a/src/plugins/todo/lineparser.h +++ b/src/plugins/todo/lineparser.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef LINEPARSER_H -#define LINEPARSER_H +#pragma once #include "keyword.h" #include "todoitem.h" @@ -71,5 +70,3 @@ private: } // namespace Internal } // namespace Todo - -#endif // LINEPARSER_H diff --git a/src/plugins/todo/optionsdialog.h b/src/plugins/todo/optionsdialog.h index 41f774a303..7754caae8d 100644 --- a/src/plugins/todo/optionsdialog.h +++ b/src/plugins/todo/optionsdialog.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef OPTIONSDIALOG_H -#define OPTIONSDIALOG_H +#pragma once #include <QWidget> @@ -71,5 +70,3 @@ private: } // namespace Internal } // namespace Todo - -#endif // OPTIONSDIALOG_H diff --git a/src/plugins/todo/optionspage.h b/src/plugins/todo/optionspage.h index d1afe9eeba..f38f778787 100644 --- a/src/plugins/todo/optionspage.h +++ b/src/plugins/todo/optionspage.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef OPTIONSPAGE_H -#define OPTIONSPAGE_H +#pragma once #include "settings.h" @@ -61,5 +60,3 @@ private: } // namespace Internal } // namespace Todo - -#endif // OPTIONSPAGE_H diff --git a/src/plugins/todo/qmljstodoitemsscanner.h b/src/plugins/todo/qmljstodoitemsscanner.h index c8d9e10e0e..91b4aed678 100644 --- a/src/plugins/todo/qmljstodoitemsscanner.h +++ b/src/plugins/todo/qmljstodoitemsscanner.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef QMLJSTODOITEMSSCANNER_H -#define QMLJSTODOITEMSSCANNER_H +#pragma once #include "todoitemsscanner.h" @@ -54,4 +53,3 @@ private: } } -#endif // QMLJSTODOITEMSSCANNER_H diff --git a/src/plugins/todo/settings.h b/src/plugins/todo/settings.h index 8b8e11e236..2966206633 100644 --- a/src/plugins/todo/settings.h +++ b/src/plugins/todo/settings.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef SETTINGS_H -#define SETTINGS_H +#pragma once #include "keyword.h" @@ -57,5 +56,3 @@ bool operator !=(Settings &s1, Settings &s2); } // namespace Todo Q_DECLARE_METATYPE(Todo::Internal::ScanningScope) - -#endif // SETTINGS_H diff --git a/src/plugins/todo/todoicons.h b/src/plugins/todo/todoicons.h index 8889de45c9..721c81df82 100644 --- a/src/plugins/todo/todoicons.h +++ b/src/plugins/todo/todoicons.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef TODOICONS_H -#define TODOICONS_H +#pragma once #include <QIcon> @@ -42,5 +41,3 @@ QIcon icon(IconType type); } // namespace Internal } // namespace Todo - -#endif // TODOICONS_H diff --git a/src/plugins/todo/todoitem.h b/src/plugins/todo/todoitem.h index 7af3712050..0d17e1068e 100644 --- a/src/plugins/todo/todoitem.h +++ b/src/plugins/todo/todoitem.h @@ -24,12 +24,13 @@ ** ****************************************************************************/ -#ifndef TODOITEM_H -#define TODOITEM_H +#pragma once #include "constants.h" #include "todoicons.h" +#include <utils/fileutils.h> + #include <QMetaType> #include <QString> #include <QColor> @@ -43,7 +44,7 @@ public: TodoItem() : line(-1) {} QString text; - QString file; + Utils::FileName file; int line; IconType iconType; QColor color; @@ -92,5 +93,3 @@ private: } // namespace Todo Q_DECLARE_METATYPE(Todo::Internal::TodoItem) - -#endif // TODOITEM_H diff --git a/src/plugins/todo/todoitemsmodel.cpp b/src/plugins/todo/todoitemsmodel.cpp index 1f8c7bb29a..5cd1cca36e 100644 --- a/src/plugins/todo/todoitemsmodel.cpp +++ b/src/plugins/todo/todoitemsmodel.cpp @@ -100,7 +100,7 @@ QVariant TodoItemsModel::data(const QModelIndex &index, int role) const case Constants::OUTPUT_COLUMN_FILE: if (role == Qt::DisplayRole) - return item.file; + return item.file.toUserOutput(); break; case Constants::OUTPUT_COLUMN_LINE: diff --git a/src/plugins/todo/todoitemsmodel.h b/src/plugins/todo/todoitemsmodel.h index 10abbf5a28..e16422ee3a 100644 --- a/src/plugins/todo/todoitemsmodel.h +++ b/src/plugins/todo/todoitemsmodel.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef TODOITEMSMODEL_H -#define TODOITEMSMODEL_H +#pragma once #include "todoitem.h" @@ -62,5 +61,3 @@ private: } } - -#endif // TODOITEMSMODEL_H diff --git a/src/plugins/todo/todoitemsprovider.h b/src/plugins/todo/todoitemsprovider.h index 4525df9262..2e946a7512 100644 --- a/src/plugins/todo/todoitemsprovider.h +++ b/src/plugins/todo/todoitemsprovider.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef TODOITEMSPROVIDER_H -#define TODOITEMSPROVIDER_H +#pragma once #include "todoitem.h" #include "settings.h" @@ -93,5 +92,3 @@ private slots: } } - -#endif // TODOITEMSPROVIDER_H diff --git a/src/plugins/todo/todoitemsscanner.cpp b/src/plugins/todo/todoitemsscanner.cpp index eab818a2a5..9b3a25dbfa 100644 --- a/src/plugins/todo/todoitemsscanner.cpp +++ b/src/plugins/todo/todoitemsscanner.cpp @@ -54,7 +54,7 @@ void TodoItemsScanner::processCommentLine(const QString &fileName, const QString for (int i = 0; i < newItemList.count(); ++i) { newItemList[i].line = lineNumber; - newItemList[i].file = fileName; + newItemList[i].file = Utils::FileName::fromString(fileName); } outItemList << newItemList; diff --git a/src/plugins/todo/todoitemsscanner.h b/src/plugins/todo/todoitemsscanner.h index b56d401bf7..75f1c6ac4c 100644 --- a/src/plugins/todo/todoitemsscanner.h +++ b/src/plugins/todo/todoitemsscanner.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef TODOITEMSSCANNER_H -#define TODOITEMSSCANNER_H +#pragma once #include "todoitem.h" #include "keyword.h" @@ -60,5 +59,3 @@ protected: } } - -#endif // TODOITEMSSCANNER_H diff --git a/src/plugins/todo/todooutputpane.cpp b/src/plugins/todo/todooutputpane.cpp index 4ab9282194..85ccce27bf 100644 --- a/src/plugins/todo/todooutputpane.cpp +++ b/src/plugins/todo/todooutputpane.cpp @@ -170,7 +170,7 @@ void TodoOutputPane::todoTreeViewClicked(const QModelIndex &index) TodoItem item; item.text = index.sibling(row, Constants::OUTPUT_COLUMN_TEXT).data().toString(); - item.file = index.sibling(row, Constants::OUTPUT_COLUMN_FILE).data().toString(); + item.file = Utils::FileName::fromUserInput(index.sibling(row, Constants::OUTPUT_COLUMN_FILE).data().toString()); item.line = index.sibling(row, Constants::OUTPUT_COLUMN_LINE).data().toInt(); item.color = index.data(Qt::BackgroundColorRole).value<QColor>(); item.iconType = static_cast<IconType>(index.sibling(row, Constants::OUTPUT_COLUMN_TEXT) diff --git a/src/plugins/todo/todooutputpane.h b/src/plugins/todo/todooutputpane.h index c8e5d88439..91a05eea31 100644 --- a/src/plugins/todo/todooutputpane.h +++ b/src/plugins/todo/todooutputpane.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef TODOOUTPUTPANE_H -#define TODOOUTPUTPANE_H +#pragma once #include "settings.h" @@ -101,5 +100,3 @@ private: } // namespace Internal } // namespace Todo - -#endif // TODOOUTPUTPANE_H diff --git a/src/plugins/todo/todooutputtreeview.h b/src/plugins/todo/todooutputtreeview.h index 4e47f2f411..50329c5e57 100644 --- a/src/plugins/todo/todooutputtreeview.h +++ b/src/plugins/todo/todooutputtreeview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TODO_INTERNAL_TODOOUTPUTTREEVIEW_H -#define TODO_INTERNAL_TODOOUTPUTTREEVIEW_H +#pragma once #include <utils/itemviews.h> @@ -53,5 +52,3 @@ private: } // namespace Internal } // namespace Todo - -#endif // TODO_INTERNAL_TODOOUTPUTTREEVIEW_H diff --git a/src/plugins/todo/todooutputtreeviewdelegate.h b/src/plugins/todo/todooutputtreeviewdelegate.h index 605745dca7..28f1fa8db6 100644 --- a/src/plugins/todo/todooutputtreeviewdelegate.h +++ b/src/plugins/todo/todooutputtreeviewdelegate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TODO_INTERNAL_TODOOUTPUTTREEVIEWDELEGATE_H -#define TODO_INTERNAL_TODOOUTPUTTREEVIEWDELEGATE_H +#pragma once #include <QStyledItemDelegate> @@ -41,5 +40,3 @@ public: } // namespace Internal } // namespace Todo - -#endif // TODO_INTERNAL_TODOOUTPUTTREEVIEWDELEGATE_H diff --git a/src/plugins/todo/todoplugin.cpp b/src/plugins/todo/todoplugin.cpp index bff4b611b9..475c04cc42 100644 --- a/src/plugins/todo/todoplugin.cpp +++ b/src/plugins/todo/todoplugin.cpp @@ -111,8 +111,8 @@ void TodoPlugin::scanningScopeChanged(ScanningScope scanningScope) void TodoPlugin::todoItemClicked(const TodoItem &item) { - if (QFileInfo::exists(item.file)) { - Core::IEditor *editor = Core::EditorManager::openEditor(item.file); + if (item.file.exists()) { + Core::IEditor *editor = Core::EditorManager::openEditor(item.file.toString()); editor->gotoLine(item.line); } } diff --git a/src/plugins/todo/todoplugin.h b/src/plugins/todo/todoplugin.h index 9a61487121..8733f3bfc9 100644 --- a/src/plugins/todo/todoplugin.h +++ b/src/plugins/todo/todoplugin.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef TODOPLUGIN_H -#define TODOPLUGIN_H +#pragma once #include "settings.h" @@ -69,6 +68,3 @@ private: } // namespace Internal } // namespace Todo - -#endif // TODOPLUGIN_H - diff --git a/src/plugins/todo/todoprojectsettingswidget.h b/src/plugins/todo/todoprojectsettingswidget.h index fbf5c89b87..c6e7204df6 100644 --- a/src/plugins/todo/todoprojectsettingswidget.h +++ b/src/plugins/todo/todoprojectsettingswidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TODO_INTERNAL_TODOPROJECTSETTINGSWIDGET_H -#define TODO_INTERNAL_TODOPROJECTSETTINGSWIDGET_H +#pragma once #include <QWidget> @@ -73,4 +72,3 @@ private: } // namespace Internal } // namespace Todo -#endif // TODO_INTERNAL_TODOPROJECTSETTINGSWIDGET_H diff --git a/src/plugins/updateinfo/settingspage.h b/src/plugins/updateinfo/settingspage.h index 927cd3659d..bb2c7adaa9 100644 --- a/src/plugins/updateinfo/settingspage.h +++ b/src/plugins/updateinfo/settingspage.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SETTINGSPAGE_H -#define SETTINGSPAGE_H +#pragma once #include "ui_settingspage.h" #include "updateinfoplugin.h" @@ -66,5 +65,3 @@ private: } // namespace Internal } // namespace UpdateInfo - -#endif // SETTINGSPAGE_H diff --git a/src/plugins/updateinfo/updateinfoplugin.h b/src/plugins/updateinfo/updateinfoplugin.h index 0c0e3af7ae..689d1baecf 100644 --- a/src/plugins/updateinfo/updateinfoplugin.h +++ b/src/plugins/updateinfo/updateinfoplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UPDATEINFOPLUGIN_H -#define UPDATEINFOPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -97,5 +96,3 @@ private: } // namespace Internal } // namespace UpdateInfo - -#endif // UPDATEINFOPLUGIN_H diff --git a/src/plugins/valgrind/callgrind/callgrindabstractmodel.h b/src/plugins/valgrind/callgrind/callgrindabstractmodel.h index 8aa8866af6..4730308c08 100644 --- a/src/plugins/valgrind/callgrind/callgrindabstractmodel.h +++ b/src/plugins/valgrind/callgrind/callgrindabstractmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_CALLGRINDABSTRACTMODEL_H -#define LIBVALGRIND_CALLGRINDABSTRACTMODEL_H +#pragma once #include <QAbstractItemView> @@ -43,5 +42,3 @@ enum AbstractModelRoles } // Callgrind } // Valgrind - -#endif // LIBVALGRIND_CALLGRINDABSTRACTMODEL_H diff --git a/src/plugins/valgrind/callgrind/callgrindcallmodel.h b/src/plugins/valgrind/callgrind/callgrindcallmodel.h index a297f7f9de..d420abb33b 100644 --- a/src/plugins/valgrind/callgrind/callgrindcallmodel.h +++ b/src/plugins/valgrind/callgrind/callgrindcallmodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef VALGRIND_CALLGRIND_CALLGRINDCALLMODEL_H -#define VALGRIND_CALLGRIND_CALLGRINDCALLMODEL_H +#pragma once #include <QAbstractItemModel> @@ -86,5 +85,3 @@ private: } // namespace Callgrind } // namespace Valgrind - -#endif // VALGRIND_CALLGRIND_CALLGRINDCALLMODEL_H diff --git a/src/plugins/valgrind/callgrind/callgrindcontroller.h b/src/plugins/valgrind/callgrind/callgrindcontroller.h index 4e73c12f1c..373b4c87a0 100644 --- a/src/plugins/valgrind/callgrind/callgrindcontroller.h +++ b/src/plugins/valgrind/callgrind/callgrindcontroller.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CALLGRINDCONTROLLER_H -#define CALLGRINDCONTROLLER_H +#pragma once #include <QObject> @@ -105,5 +104,3 @@ private: } // namespace Callgrind } // namespace Valgrind - -#endif // CALLGRINDCONTROLLER_H diff --git a/src/plugins/valgrind/callgrind/callgrindcostitem.h b/src/plugins/valgrind/callgrind/callgrindcostitem.h index d50d861b25..68843f44b7 100644 --- a/src/plugins/valgrind/callgrind/callgrindcostitem.h +++ b/src/plugins/valgrind/callgrind/callgrindcostitem.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_CALLGRIND_COSTITEM_H -#define LIBVALGRIND_CALLGRIND_COSTITEM_H +#pragma once #include <QtGlobal> @@ -92,5 +91,3 @@ private: } // namespace Callgrind } // namespace Valgrind - -#endif // LIBVALGRIND_CALLGRIND_COSTITEM_H diff --git a/src/plugins/valgrind/callgrind/callgrindcycledetection.h b/src/plugins/valgrind/callgrind/callgrindcycledetection.h index 07b0281384..4894e7227f 100644 --- a/src/plugins/valgrind/callgrind/callgrindcycledetection.h +++ b/src/plugins/valgrind/callgrind/callgrindcycledetection.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_CALLGRINDCYCLEDETECTION_H -#define LIBVALGRIND_CALLGRINDCYCLEDETECTION_H +#pragma once #include <QHash> #include <QStack> @@ -75,5 +74,3 @@ private: } // namespace Callgrind } // namespace Valgrind - -#endif // LIBVALGRIND_CALLGRINDCYCLEDETECTION_H diff --git a/src/plugins/valgrind/callgrind/callgrinddatamodel.h b/src/plugins/valgrind/callgrind/callgrinddatamodel.h index 43b8dbef23..3daaf77d39 100644 --- a/src/plugins/valgrind/callgrind/callgrinddatamodel.h +++ b/src/plugins/valgrind/callgrind/callgrinddatamodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef VALGRIND_CALLGRIND_CALLGRINDDATAMODEL_H -#define VALGRIND_CALLGRIND_CALLGRINDDATAMODEL_H +#pragma once #include "callgrindabstractmodel.h" @@ -95,5 +94,3 @@ private: } // namespace Callgrind } // namespace Valgrind - -#endif // VALGRIND_CALLGRIND_CALLGRINDDATAMODEL_H diff --git a/src/plugins/valgrind/callgrind/callgrindfunction.h b/src/plugins/valgrind/callgrind/callgrindfunction.h index 5d0e9faefe..fd35b5b7e7 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunction.h +++ b/src/plugins/valgrind/callgrind/callgrindfunction.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_CALLGRIND_FUNCTION_H -#define LIBVALGRIND_CALLGRIND_FUNCTION_H +#pragma once #include <QMetaType> #include <QVector> @@ -145,5 +144,3 @@ private: } // namespace Valgrind Q_DECLARE_METATYPE(const Valgrind::Callgrind::Function *) - -#endif // LIBVALGRIND_CALLGRIND_FUNCTION_H diff --git a/src/plugins/valgrind/callgrind/callgrindfunction_p.h b/src/plugins/valgrind/callgrind/callgrindfunction_p.h index 9563d42650..8bcc2d246c 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunction_p.h +++ b/src/plugins/valgrind/callgrind/callgrindfunction_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_CALLGRINDFUNCTION_P_H -#define LIBVALGRIND_CALLGRINDFUNCTION_P_H +#pragma once #include "callgrindfunction.h" #include "callgrindparsedata.h" @@ -71,5 +70,3 @@ public: } // namespace Callgrind } // namespace Valgrind - -#endif // LIBVALGRIND_CALLGRINDFUNCTION_P_H diff --git a/src/plugins/valgrind/callgrind/callgrindfunctioncall.h b/src/plugins/valgrind/callgrind/callgrindfunctioncall.h index 2f45cb1a26..0c860308aa 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunctioncall.h +++ b/src/plugins/valgrind/callgrind/callgrindfunctioncall.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CALLGRINDFUNCTIONCALL_H -#define CALLGRINDFUNCTIONCALL_H +#pragma once #include <QMetaType> @@ -85,5 +84,3 @@ private: } // namespace Valgrind Q_DECLARE_METATYPE(const Valgrind::Callgrind::FunctionCall *) - -#endif // CALLGRINDFUNCTIONCALL_H diff --git a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.h b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.h index 4a0218cc9a..38221b998d 100644 --- a/src/plugins/valgrind/callgrind/callgrindfunctioncycle.h +++ b/src/plugins/valgrind/callgrind/callgrindfunctioncycle.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_CALLGRINDFUNCTIONCYCLE_H -#define LIBVALGRIND_CALLGRINDFUNCTIONCYCLE_H +#pragma once #include "callgrindfunction.h" @@ -57,5 +56,3 @@ private: } // namespace Callgrind } // namespace Valgrind - -#endif // LIBVALGRIND_CALLGRINDFUNCTIONCYCLE_H diff --git a/src/plugins/valgrind/callgrind/callgrindparsedata.h b/src/plugins/valgrind/callgrind/callgrindparsedata.h index 8943a231d7..4c1ba186f9 100644 --- a/src/plugins/valgrind/callgrind/callgrindparsedata.h +++ b/src/plugins/valgrind/callgrind/callgrindparsedata.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_CALLGRIND_PARSEDATA_P_H -#define LIBVALGRIND_CALLGRIND_PARSEDATA_P_H +#pragma once #include <QtGlobal> @@ -135,5 +134,3 @@ private: } // namespace Callgrind } // namespace Valgrind - -#endif // LIBVALGRIND_CALLGRIND_PARSEDATA_P_H diff --git a/src/plugins/valgrind/callgrind/callgrindparser.h b/src/plugins/valgrind/callgrind/callgrindparser.h index a5c8072563..2b36da5e4c 100644 --- a/src/plugins/valgrind/callgrind/callgrindparser.h +++ b/src/plugins/valgrind/callgrind/callgrindparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_CALLGRIND_PARSER_H -#define LIBVALGRIND_CALLGRIND_PARSER_H +#pragma once #include <QObject> @@ -71,5 +70,3 @@ private: } // Callgrind } // Valgrind - -#endif // LIBVALGRIND_CALLGRIND_PARSER_H diff --git a/src/plugins/valgrind/callgrind/callgrindproxymodel.h b/src/plugins/valgrind/callgrind/callgrindproxymodel.h index 2dceeb1497..d8f17d883f 100644 --- a/src/plugins/valgrind/callgrind/callgrindproxymodel.h +++ b/src/plugins/valgrind/callgrind/callgrindproxymodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef VALGRIND_CALLGRIND_CALLGRINDPROXYMODEL_H -#define VALGRIND_CALLGRIND_CALLGRINDPROXYMODEL_H +#pragma once #include <QSortFilterProxyModel> @@ -78,5 +77,3 @@ private: } // namespace Callgrind } // namespace Valgrind - -#endif // VALGRIND_CALLGRIND_CALLGRINDPROXYMODEL_H diff --git a/src/plugins/valgrind/callgrind/callgrindrunner.h b/src/plugins/valgrind/callgrind/callgrindrunner.h index b8299c5485..81c3e76da3 100644 --- a/src/plugins/valgrind/callgrind/callgrindrunner.h +++ b/src/plugins/valgrind/callgrind/callgrindrunner.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef VALGRIND_CALLGRIND_CALLGRINDRUNNER_H -#define VALGRIND_CALLGRIND_CALLGRINDRUNNER_H +#pragma once #include "../valgrindrunner.h" @@ -68,5 +67,3 @@ private: } // namespace Callgrind } // namespace Valgrind - -#endif // VALGRIND_CALLGRIND_CALLGRINDRUNNER_H diff --git a/src/plugins/valgrind/callgrind/callgrindstackbrowser.h b/src/plugins/valgrind/callgrind/callgrindstackbrowser.h index a61a522920..35f91bc5ca 100644 --- a/src/plugins/valgrind/callgrind/callgrindstackbrowser.h +++ b/src/plugins/valgrind/callgrind/callgrindstackbrowser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CALLGRINDSTACKBROWSER_H -#define CALLGRINDSTACKBROWSER_H +#pragma once #include <QObject> #include <QStack> @@ -61,5 +60,3 @@ private: } // namespace Callgrind } // namespace Valgrind - -#endif // CALLGRINDSTACKBROWSER_H diff --git a/src/plugins/valgrind/callgrindcostdelegate.h b/src/plugins/valgrind/callgrindcostdelegate.h index 851e5ac08f..3c0e453b92 100644 --- a/src/plugins/valgrind/callgrindcostdelegate.h +++ b/src/plugins/valgrind/callgrindcostdelegate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CALLGRINDCOSTDELEGATE_H -#define CALLGRINDCOSTDELEGATE_H +#pragma once #include <QStyledItemDelegate> @@ -64,5 +63,3 @@ private: } // namespace Valgrind Q_DECLARE_METATYPE(Valgrind::Internal::CostDelegate::CostFormat) - -#endif // CALLGRINDCOSTDELEGATE_H diff --git a/src/plugins/valgrind/callgrindcostview.h b/src/plugins/valgrind/callgrindcostview.h index 963a2b15d3..fb4b2a72ae 100644 --- a/src/plugins/valgrind/callgrindcostview.h +++ b/src/plugins/valgrind/callgrindcostview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CALLGRINDCOSTVIEW_H -#define CALLGRINDCOSTVIEW_H +#pragma once #include "callgrindcostdelegate.h" @@ -63,5 +62,3 @@ private: } // namespace Internal } // namespace Valgrind - -#endif // CALLGRINDCOSTVIEW_H diff --git a/src/plugins/valgrind/callgrindengine.h b/src/plugins/valgrind/callgrindengine.h index 19e91a95b4..ae5696e157 100644 --- a/src/plugins/valgrind/callgrindengine.h +++ b/src/plugins/valgrind/callgrindengine.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CALLGRINDENGINE_H -#define CALLGRINDENGINE_H +#pragma once #include <valgrind/valgrindengine.h> @@ -79,5 +78,3 @@ private: } // namespace Internal } // namespace Valgrind - -#endif // CALLGRINDENGINE_H diff --git a/src/plugins/valgrind/callgrindhelper.h b/src/plugins/valgrind/callgrindhelper.h index 92fa9a81ff..8d5898a2c5 100644 --- a/src/plugins/valgrind/callgrindhelper.h +++ b/src/plugins/valgrind/callgrindhelper.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CALLGRINDHELPER_H -#define CALLGRINDHELPER_H +#pragma once #include <QLocale> @@ -57,5 +56,3 @@ namespace CallgrindHelper } // namespace Internal } // namespace Valgrind - -#endif // CALLGRINDHELPER_H diff --git a/src/plugins/valgrind/callgrindnamedelegate.h b/src/plugins/valgrind/callgrindnamedelegate.h index 4e168fb8cf..2533e46a94 100644 --- a/src/plugins/valgrind/callgrindnamedelegate.h +++ b/src/plugins/valgrind/callgrindnamedelegate.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CALLGRINDNAMEDELEGATE_H -#define CALLGRINDNAMEDELEGATE_H +#pragma once #include <QStyledItemDelegate> @@ -42,5 +41,3 @@ public: } // namespace Internal } // namespace Valgrind - -#endif // CALLGRINDNAMEDELEGATE_H diff --git a/src/plugins/valgrind/callgrindtextmark.h b/src/plugins/valgrind/callgrindtextmark.h index 495ab5fc82..f5f1699a25 100644 --- a/src/plugins/valgrind/callgrindtextmark.h +++ b/src/plugins/valgrind/callgrindtextmark.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CALLGRINDTEXTMARK_H -#define CALLGRINDTEXTMARK_H +#pragma once #include <texteditor/textmark.h> @@ -58,5 +57,3 @@ private: } // namespace Internal } // namespace Valgrind - -#endif // CALLGRINDTEXTMARK_H diff --git a/src/plugins/valgrind/callgrindtool.h b/src/plugins/valgrind/callgrindtool.h index e7df17db86..c0618366c7 100644 --- a/src/plugins/valgrind/callgrindtool.h +++ b/src/plugins/valgrind/callgrindtool.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CALLGRINDTOOL_H -#define CALLGRINDTOOL_H +#pragma once #include <QObject> @@ -46,5 +45,3 @@ void destroyCallgrindTool(); } // namespace Internal } // namespace Valgrind - -#endif // CALLGRINDTOOL_H diff --git a/src/plugins/valgrind/callgrindvisualisation.h b/src/plugins/valgrind/callgrindvisualisation.h index a1763c8259..ee920b7470 100644 --- a/src/plugins/valgrind/callgrindvisualisation.h +++ b/src/plugins/valgrind/callgrindvisualisation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CALLGRINDVISUALISATION_H -#define CALLGRINDVISUALISATION_H +#pragma once #include <QGraphicsView> @@ -80,5 +79,3 @@ private: } // namespace Internal } // namespace Valgrind - -#endif // VALGRIND_CALLGRIND_CALLGRINDVISUALISATION_H diff --git a/src/plugins/valgrind/memcheck/memcheckrunner.h b/src/plugins/valgrind/memcheck/memcheckrunner.h index 7bdef65d3e..ec092ffc13 100644 --- a/src/plugins/valgrind/memcheck/memcheckrunner.h +++ b/src/plugins/valgrind/memcheck/memcheckrunner.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef VALGRIND_PROTOCOL_MEMCHECKRUNNER_H -#define VALGRIND_PROTOCOL_MEMCHECKRUNNER_H +#pragma once #include "../valgrindrunner.h" @@ -69,5 +68,3 @@ private: } // namespace Memcheck } // namespace Valgrind - -#endif // VALGRIND_PROTOCOL_MEMCHECKRUNNER_H diff --git a/src/plugins/valgrind/memcheckengine.h b/src/plugins/valgrind/memcheckengine.h index b619aa9669..6455065d35 100644 --- a/src/plugins/valgrind/memcheckengine.h +++ b/src/plugins/valgrind/memcheckengine.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef MEMCHECKENGINE_H -#define MEMCHECKENGINE_H +#pragma once #include "valgrindengine.h" @@ -78,5 +77,3 @@ protected: } // namespace Internal } // namespace Valgrind - -#endif // MEMCHECKENGINE_H diff --git a/src/plugins/valgrind/memcheckerrorview.h b/src/plugins/valgrind/memcheckerrorview.h index 205c723841..244f7df157 100644 --- a/src/plugins/valgrind/memcheckerrorview.h +++ b/src/plugins/valgrind/memcheckerrorview.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef MEMCHECKERRORVIEW_H -#define MEMCHECKERRORVIEW_H +#pragma once #include <debugger/analyzer/detailederrorview.h> @@ -64,5 +63,3 @@ private: } // namespace Internal } // namespace Valgrind - -#endif // MEMCHECKERRORVIEW_H diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 412418d202..5ed8152098 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -89,32 +89,32 @@ using namespace Debugger; using namespace ProjectExplorer; using namespace Utils; using namespace Valgrind::XmlProtocol; +using namespace std::placeholders; namespace Valgrind { namespace Internal { -class FrameFinder : public ErrorListModel::RelevantFrameFinder +static ErrorListModel::RelevantFrameFinder makeFrameFinder(const QStringList &projectFiles) { -public: - Frame findRelevant(const Error &error) const - { + return [projectFiles](const Error &error) { + const Frame defaultFrame = Frame(); const QVector<Stack> stacks = error.stacks(); if (stacks.isEmpty()) - return Frame(); + return defaultFrame; const Stack &stack = stacks[0]; const QVector<Frame> frames = stack.frames(); if (frames.isEmpty()) - return Frame(); + return defaultFrame; //find the first frame belonging to the project - if (!m_projectFiles.isEmpty()) { + if (!projectFiles.isEmpty()) { foreach (const Frame &frame, frames) { if (frame.directory().isEmpty() || frame.fileName().isEmpty()) continue; //filepaths can contain "..", clean them: const QString f = QFileInfo(frame.filePath()).absoluteFilePath(); - if (m_projectFiles.contains(f)) + if (projectFiles.contains(f)) return frame; } } @@ -130,37 +130,22 @@ public: //else fallback to the first frame return frames.first(); - } - void setFiles(const QStringList &files) - { - m_projectFiles = files; - } -private: - QStringList m_projectFiles; -}; + }; +} class MemcheckErrorFilterProxyModel : public QSortFilterProxyModel { public: - MemcheckErrorFilterProxyModel(QObject *parent = 0); - -public: void setAcceptedKinds(const QList<int> &acceptedKinds); void setFilterExternalIssues(bool filter); bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; private: QList<int> m_acceptedKinds; - bool m_filterExternalIssues; + bool m_filterExternalIssues = false; }; -MemcheckErrorFilterProxyModel::MemcheckErrorFilterProxyModel(QObject *parent) - : QSortFilterProxyModel(parent), - m_filterExternalIssues(false) -{ -} - void MemcheckErrorFilterProxyModel::setAcceptedKinds(const QList<int> &acceptedKinds) { if (m_acceptedKinds != acceptedKinds) { @@ -275,12 +260,11 @@ private: private: ValgrindBaseSettings *m_settings; - QMenu *m_filterMenu; + QMenu *m_filterMenu = 0; - FrameFinder *m_frameFinder; - Valgrind::XmlProtocol::ErrorListModel *m_errorModel; - MemcheckErrorFilterProxyModel *m_errorProxyModel; - MemcheckErrorView *m_errorView; + Valgrind::XmlProtocol::ErrorListModel m_errorModel; + MemcheckErrorFilterProxyModel m_errorProxyModel; + MemcheckErrorView *m_errorView = 0; QList<QAction *> m_errorFilterActions; QAction *m_filterProjectAction; @@ -299,10 +283,6 @@ MemcheckTool::MemcheckTool(QObject *parent) : QObject(parent) { m_settings = ValgrindPlugin::globalSettings(); - m_errorModel = 0; - m_errorProxyModel = 0; - m_errorView = 0; - m_filterMenu = 0; setObjectName(QLatin1String("MemcheckTool")); @@ -334,22 +314,14 @@ MemcheckTool::MemcheckTool(QObject *parent) initKindFilterAction(a, { InvalidFree, MismatchedFree }); m_errorFilterActions.append(a); - - using namespace std::placeholders; - - QTC_ASSERT(!m_errorView, return); - m_errorView = new MemcheckErrorView; m_errorView->setObjectName(QLatin1String("MemcheckErrorView")); m_errorView->setFrameStyle(QFrame::NoFrame); m_errorView->setAttribute(Qt::WA_MacShowFocusRect, false); - m_errorModel = new ErrorListModel(m_errorView); - m_frameFinder = new Internal::FrameFinder; - m_errorModel->setRelevantFrameFinder(QSharedPointer<Internal::FrameFinder>(m_frameFinder)); - m_errorProxyModel = new MemcheckErrorFilterProxyModel(m_errorView); - m_errorProxyModel->setSourceModel(m_errorModel); - m_errorProxyModel->setDynamicSortFilter(true); - m_errorView->setModel(m_errorProxyModel); + m_errorModel.setRelevantFrameFinder(makeFrameFinder(QStringList())); + m_errorProxyModel.setSourceModel(&m_errorModel); + m_errorProxyModel.setDynamicSortFilter(true); + m_errorView->setModel(&m_errorProxyModel); m_errorView->setSelectionMode(QAbstractItemView::ExtendedSelection); // make m_errorView->selectionModel()->selectedRows() return something m_errorView->setSelectionBehavior(QAbstractItemView::SelectRows); @@ -513,12 +485,12 @@ void MemcheckTool::updateFromSettings() m_errorView->settingsChanged(m_settings); connect(m_settings, &ValgrindBaseSettings::visibleErrorKindsChanged, - m_errorProxyModel, &MemcheckErrorFilterProxyModel::setAcceptedKinds); - m_errorProxyModel->setAcceptedKinds(m_settings->visibleErrorKinds()); + &m_errorProxyModel, &MemcheckErrorFilterProxyModel::setAcceptedKinds); + m_errorProxyModel.setAcceptedKinds(m_settings->visibleErrorKinds()); connect(m_settings, &ValgrindBaseSettings::filterExternalIssuesChanged, - m_errorProxyModel, &MemcheckErrorFilterProxyModel::setFilterExternalIssues); - m_errorProxyModel->setFilterExternalIssues(m_settings->filterExternalIssues()); + &m_errorProxyModel, &MemcheckErrorFilterProxyModel::setFilterExternalIssues); + m_errorProxyModel.setFilterExternalIssues(m_settings->filterExternalIssues()); } void MemcheckTool::maybeActiveRunConfigurationChanged() @@ -541,7 +513,7 @@ void MemcheckTool::maybeActiveRunConfigurationChanged() // disconnect old settings class if any if (m_settings) { m_settings->disconnect(this); - m_settings->disconnect(m_errorProxyModel); + m_settings->disconnect(&m_errorProxyModel); } // now make the new settings current, update and connect input widgets @@ -555,8 +527,8 @@ void MemcheckTool::maybeActiveRunConfigurationChanged() MemcheckRunControl *MemcheckTool::createRunControl(RunConfiguration *runConfiguration, Core::Id runMode) { - m_frameFinder->setFiles(runConfiguration ? runConfiguration->target() - ->project()->files(Project::AllFiles) : QStringList()); + m_errorModel.setRelevantFrameFinder(makeFrameFinder(runConfiguration + ? runConfiguration->target()->project()->files(Project::AllFiles) : QStringList())); MemcheckRunControl *runControl = 0; if (runMode == MEMCHECK_RUN_MODE) @@ -640,7 +612,7 @@ void MemcheckTool::loadExternalXmlLogFile() void MemcheckTool::parserError(const Error &error) { - m_errorModel->addError(error); + m_errorModel.addError(error); } void MemcheckTool::internalParserError(const QString &errorString) @@ -652,7 +624,7 @@ void MemcheckTool::internalParserError(const QString &errorString) void MemcheckTool::clearErrorView() { QTC_ASSERT(m_errorView, return); - m_errorModel->clear(); + m_errorModel.clear(); qDeleteAll(m_suppressionActions); m_suppressionActions.clear(); @@ -682,7 +654,7 @@ void MemcheckTool::updateErrorFilter() int MemcheckTool::updateUiAfterFinishedHelper() { - const int issuesFound = m_errorModel->rowCount(); + const int issuesFound = m_errorModel.rowCount(); m_goBack->setEnabled(issuesFound > 1); m_goNext->setEnabled(issuesFound > 1); m_loadExternalLogFile->setEnabled(true); diff --git a/src/plugins/valgrind/memchecktool.h b/src/plugins/valgrind/memchecktool.h index 1ea57b9778..8a6bdd95f3 100644 --- a/src/plugins/valgrind/memchecktool.h +++ b/src/plugins/valgrind/memchecktool.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef MEMCHECKTOOL_H -#define MEMCHECKTOOL_H +#pragma once #include <QObject> @@ -44,5 +43,3 @@ void destroyMemcheckTool(); } // namespace Internal } // namespace Valgrind - -#endif // MEMCHECKTOOL_H diff --git a/src/plugins/valgrind/suppressiondialog.h b/src/plugins/valgrind/suppressiondialog.h index b4effe3324..70a5ee7ff2 100644 --- a/src/plugins/valgrind/suppressiondialog.h +++ b/src/plugins/valgrind/suppressiondialog.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef ANALYZER_VALGRIND_SUPPRESSIONDIALOG_H -#define ANALYZER_VALGRIND_SUPPRESSIONDIALOG_H +#pragma once #include "xmlprotocol/error.h" @@ -72,5 +71,3 @@ private: } // namespace Internal } // namespace Valgrind - -#endif // ANALYZER_VALGRIND_SUPPRESSIONDIALOG_H diff --git a/src/plugins/valgrind/valgrindconfigwidget.h b/src/plugins/valgrind/valgrindconfigwidget.h index 7352bc22bd..5f31a28d4e 100644 --- a/src/plugins/valgrind/valgrindconfigwidget.h +++ b/src/plugins/valgrind/valgrindconfigwidget.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef ANALYZER_VALGRINDCONFIGWIDGET_H -#define ANALYZER_VALGRINDCONFIGWIDGET_H +#pragma once #include <QWidget> @@ -69,5 +68,3 @@ private: } // namespace Internal } // namespace Valgrind - -#endif // ANALYZER_VALGRINDCONFIGWIDGET_H diff --git a/src/plugins/valgrind/valgrindengine.h b/src/plugins/valgrind/valgrindengine.h index fa9ffcc91a..28eab84efb 100644 --- a/src/plugins/valgrind/valgrindengine.h +++ b/src/plugins/valgrind/valgrindengine.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef VALGRINDENGINE_H -#define VALGRINDENGINE_H +#pragma once #include <debugger/analyzer/analyzerruncontrol.h> #include <utils/environment.h> @@ -77,5 +76,3 @@ private: } // namespace Internal } // namespace Valgrind - -#endif // VALGRINDENGINE_H diff --git a/src/plugins/valgrind/valgrindplugin.h b/src/plugins/valgrind/valgrindplugin.h index f402e4c2ba..b3f8cd2bd6 100644 --- a/src/plugins/valgrind/valgrindplugin.h +++ b/src/plugins/valgrind/valgrindplugin.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef VALGRINDPLUGIN_H -#define VALGRINDPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> #include <projectexplorer/projectexplorer.h> @@ -53,5 +52,3 @@ public: } // namespace Internal } // namespace Valgrind - -#endif // VALGRINDPLUGIN_H diff --git a/src/plugins/valgrind/valgrindprocess.h b/src/plugins/valgrind/valgrindprocess.h index 0d04a4093e..44da14afa2 100644 --- a/src/plugins/valgrind/valgrindprocess.h +++ b/src/plugins/valgrind/valgrindprocess.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef VALGRINDPROCESS_H -#define VALGRINDPROCESS_H +#pragma once #include <projectexplorer/applicationlauncher.h> #include <projectexplorer/devicesupport/idevice.h> @@ -108,5 +107,3 @@ private: }; } // namespace Valgrind - -#endif // VALGRINDPROCESS_H diff --git a/src/plugins/valgrind/valgrindruncontrolfactory.h b/src/plugins/valgrind/valgrindruncontrolfactory.h index 65d618dae0..b3e74646d1 100644 --- a/src/plugins/valgrind/valgrindruncontrolfactory.h +++ b/src/plugins/valgrind/valgrindruncontrolfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef VALGRINDRUNCONTROLFACTORY_H -#define VALGRINDRUNCONTROLFACTORY_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -49,5 +48,3 @@ public: } // namespace Internal } // namespace Valgrind - -#endif // VALGRINDRUNCONTROLFACTORY_H diff --git a/src/plugins/valgrind/valgrindrunner.h b/src/plugins/valgrind/valgrindrunner.h index 637f436ad0..6446209219 100644 --- a/src/plugins/valgrind/valgrindrunner.h +++ b/src/plugins/valgrind/valgrindrunner.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef VALGRIND_RUNNER_H -#define VALGRIND_RUNNER_H +#pragma once #include <debugger/analyzer/analyzerconstants.h> @@ -87,5 +86,3 @@ private: }; } // namespace Valgrind - -#endif // VALGRIND_RUNNER_H diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index c66a28c51f..252b819134 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef ANALYZER_INTERNAL_VALGRINDSETTINGS_H -#define ANALYZER_INTERNAL_VALGRINDSETTINGS_H +#pragma once #include "callgrindcostdelegate.h" #include <projectexplorer/runconfiguration.h> @@ -275,5 +274,3 @@ private: } // namespace Internal } // namespace Valgrind - -#endif // VALGRIND_INTERNAL_ANALZYZERSETTINGS_H diff --git a/src/plugins/valgrind/workarounds.h b/src/plugins/valgrind/workarounds.h index ff2c4cff3b..e65c8cca69 100644 --- a/src/plugins/valgrind/workarounds.h +++ b/src/plugins/valgrind/workarounds.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WORKAROUNDS_H -#define WORKAROUNDS_H +#pragma once #include <qglobal.h> @@ -34,5 +33,3 @@ QT_END_NAMESPACE ///FIXME: remove this once https://bugreports.qt.io/browse/QTCREATORBUG-3247 gets fixed QPalette panelPalette(const QPalette &oldPalette, bool lightColored = false); - -#endif // WORKAROUNDS_H diff --git a/src/plugins/valgrind/xmlprotocol/announcethread.h b/src/plugins/valgrind/xmlprotocol/announcethread.h index 7be6ca5f05..6219c98a48 100644 --- a/src/plugins/valgrind/xmlprotocol/announcethread.h +++ b/src/plugins/valgrind/xmlprotocol/announcethread.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_PROTOCOL_ANNOUNCETHREAD_H -#define LIBVALGRIND_PROTOCOL_ANNOUNCETHREAD_H +#pragma once #include <QSharedDataPointer> @@ -60,5 +59,3 @@ private: } // namespace XmlProtocol } // namespace Valgrind - -#endif // LIBVALGRIND_PROTOCOL_ANNOUNCETHREAD_H diff --git a/src/plugins/valgrind/xmlprotocol/error.h b/src/plugins/valgrind/xmlprotocol/error.h index 67fbca5953..f7b56f301f 100644 --- a/src/plugins/valgrind/xmlprotocol/error.h +++ b/src/plugins/valgrind/xmlprotocol/error.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_PROTOCOL_ERROR_H -#define LIBVALGRIND_PROTOCOL_ERROR_H +#pragma once #include <QMetaType> #include <QSharedDataPointer> @@ -138,5 +137,3 @@ private: } // namespace Valgrind Q_DECLARE_METATYPE(Valgrind::XmlProtocol::Error) - -#endif // LIBVALGRIND_PROTOCOL_ERROR_H diff --git a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp index 915b0ab4e8..a5f0a765dd 100644 --- a/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp +++ b/src/plugins/valgrind/xmlprotocol/errorlistmodel.cpp @@ -42,27 +42,18 @@ namespace Valgrind { namespace XmlProtocol { -class ErrorListModelPrivate -{ -public: - QVariant errorData(const QModelIndex &index, int role) const; - QSharedPointer<const ErrorListModel::RelevantFrameFinder> relevantFrameFinder; - Frame findRelevantFrame(const Error &error) const; - QString errorLocation(const Error &error) const; -}; - class ErrorItem : public Utils::TreeItem { public: - ErrorItem(const ErrorListModelPrivate *modelPrivate, const Error &error); + ErrorItem(const ErrorListModel *model, const Error &error); - const ErrorListModelPrivate *modelPrivate() const { return m_modelPrivate; } + const ErrorListModel *modelPrivate() const { return m_model; } Error error() const { return m_error; } private: QVariant data(int column, int role) const override; - const ErrorListModelPrivate * const m_modelPrivate; + const ErrorListModel * const m_model; const Error m_error; }; @@ -95,30 +86,14 @@ private: ErrorListModel::ErrorListModel(QObject *parent) : Utils::TreeModel(parent) - , d(new ErrorListModelPrivate) { setHeader(QStringList() << tr("Issue") << tr("Location")); } -ErrorListModel::~ErrorListModel() -{ - delete d; -} - -QSharedPointer<const ErrorListModel::RelevantFrameFinder> ErrorListModel::relevantFrameFinder() const -{ - return d->relevantFrameFinder; -} - -void ErrorListModel::setRelevantFrameFinder(const QSharedPointer<const RelevantFrameFinder> &finder) +Frame ErrorListModel::findRelevantFrame(const Error &error) const { - d->relevantFrameFinder = finder; -} - -Frame ErrorListModelPrivate::findRelevantFrame(const Error &error) const -{ - if (relevantFrameFinder) - return relevantFrameFinder->findRelevant(error); + if (m_relevantFrameFinder) + return m_relevantFrameFinder(error); const QVector<Stack> stacks = error.stacks(); if (stacks.isEmpty()) return Frame(); @@ -158,7 +133,7 @@ static QString makeFrameName(const Frame &frame, bool withLocation) return QString::fromLatin1("0x%1").arg(frame.instructionPointer(), 0, 16); } -QString ErrorListModelPrivate::errorLocation(const Error &error) const +QString ErrorListModel::errorLocation(const Error &error) const { return QCoreApplication::translate("Valgrind::Internal", "in %1"). arg(makeFrameName(findRelevantFrame(error), true)); @@ -166,12 +141,22 @@ QString ErrorListModelPrivate::errorLocation(const Error &error) const void ErrorListModel::addError(const Error &error) { - rootItem()->appendChild(new ErrorItem(d, error)); + rootItem()->appendChild(new ErrorItem(this, error)); +} + +ErrorListModel::RelevantFrameFinder ErrorListModel::relevantFrameFinder() const +{ + return m_relevantFrameFinder; +} + +void ErrorListModel::setRelevantFrameFinder(const RelevantFrameFinder &relevantFrameFinder) +{ + m_relevantFrameFinder = relevantFrameFinder; } -ErrorItem::ErrorItem(const ErrorListModelPrivate *modelPrivate, const Error &error) - : m_modelPrivate(modelPrivate), m_error(error) +ErrorItem::ErrorItem(const ErrorListModel *model, const Error &error) + : m_model(model), m_error(error) { QTC_ASSERT(!m_error.stacks().isEmpty(), return); @@ -203,7 +188,7 @@ static QVariant location(const Frame &frame, int role) QVariant ErrorItem::data(int column, int role) const { if (column == Debugger::DetailedErrorView::LocationColumn) { - const Frame frame = m_modelPrivate->findRelevantFrame(m_error); + const Frame frame = m_model->findRelevantFrame(m_error); return location(frame, role); } @@ -215,7 +200,7 @@ QVariant ErrorItem::data(int column, int role) const stream << m_error.what() << "\n"; stream << " " - << m_modelPrivate->errorLocation(m_error) + << m_model->errorLocation(m_error) << "\n"; foreach (const Stack &stack, m_error.stacks()) { @@ -241,7 +226,7 @@ QVariant ErrorItem::data(int column, int role) const return ErrorListModel::tr("%1 in function %2") .arg(m_error.what(), m_error.stacks().first().frames().first().functionName()); case Qt::ToolTipRole: - return toolTipForFrame(m_modelPrivate->findRelevantFrame(m_error)); + return toolTipForFrame(m_model->findRelevantFrame(m_error)); default: return QVariant(); } diff --git a/src/plugins/valgrind/xmlprotocol/errorlistmodel.h b/src/plugins/valgrind/xmlprotocol/errorlistmodel.h index ec7f5de61c..6112d152a8 100644 --- a/src/plugins/valgrind/xmlprotocol/errorlistmodel.h +++ b/src/plugins/valgrind/xmlprotocol/errorlistmodel.h @@ -24,19 +24,17 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_PROTOCOL_ERRORLISTMODEL_H -#define LIBVALGRIND_PROTOCOL_ERRORLISTMODEL_H +#pragma once #include <debugger/analyzer/detailederrorview.h> #include <utils/treemodel.h> -#include <QSharedPointer> +#include <functional> namespace Valgrind { namespace XmlProtocol { class Error; -class ErrorListModelPrivate; class Frame; class ErrorListModel : public Utils::TreeModel @@ -48,27 +46,23 @@ public: ErrorRole = Debugger::DetailedErrorView::FullTextRole + 1, }; - class RelevantFrameFinder - { - public: - virtual ~RelevantFrameFinder() {} - virtual Frame findRelevant(const Error &error) const = 0; - }; - explicit ErrorListModel(QObject *parent = 0); - ~ErrorListModel(); - QSharedPointer<const RelevantFrameFinder> relevantFrameFinder() const; - void setRelevantFrameFinder(const QSharedPointer<const RelevantFrameFinder> &finder); + typedef std::function<Frame(const Error &)> RelevantFrameFinder; + RelevantFrameFinder relevantFrameFinder() const; + void setRelevantFrameFinder(const RelevantFrameFinder &relevantFrameFinder); -public slots: void addError(const Valgrind::XmlProtocol::Error &error); private: - ErrorListModelPrivate *const d; + friend class ErrorItem; + friend class StackItem; + QVariant errorData(const QModelIndex &index, int role) const; + Frame findRelevantFrame(const Error &error) const; + QString errorLocation(const Error &error) const; + + RelevantFrameFinder m_relevantFrameFinder; }; } // namespace XmlProtocol } // namespace Valgrind - -#endif // LIBVALGRIND_PROTOCOL_ERRORLISTMODEL_H diff --git a/src/plugins/valgrind/xmlprotocol/frame.h b/src/plugins/valgrind/xmlprotocol/frame.h index 4cd9836ce6..151c815898 100644 --- a/src/plugins/valgrind/xmlprotocol/frame.h +++ b/src/plugins/valgrind/xmlprotocol/frame.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_PROTOCOL_FRAME_H -#define LIBVALGRIND_PROTOCOL_FRAME_H +#pragma once #include <QSharedDataPointer> @@ -72,5 +71,3 @@ private: } // namespace XmlProtocol } // namespace Valgrind - -#endif diff --git a/src/plugins/valgrind/xmlprotocol/modelhelpers.h b/src/plugins/valgrind/xmlprotocol/modelhelpers.h index 2c1bdba79c..7f0bef922a 100644 --- a/src/plugins/valgrind/xmlprotocol/modelhelpers.h +++ b/src/plugins/valgrind/xmlprotocol/modelhelpers.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_PROTOCOL_MODELHELPERS_H -#define LIBVALGRIND_PROTOCOL_MODELHELPERS_H +#pragma once #include <QtGlobal> @@ -42,5 +41,3 @@ QString toolTipForFrame(const Frame &frame); } // namespace XmlProtocol } // namespace Valgrind - -#endif // LIBVALGRIND_PROTOCOL_MODELHELPERS_H diff --git a/src/plugins/valgrind/xmlprotocol/parser.h b/src/plugins/valgrind/xmlprotocol/parser.h index 76eea29135..4ed7d82028 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.h +++ b/src/plugins/valgrind/xmlprotocol/parser.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_PROTOCOL_PARSER_H -#define LIBVALGRIND_PROTOCOL_PARSER_H +#pragma once #include <QObject> @@ -79,5 +78,3 @@ private: } // XmlProtocol } // Valgrind - -#endif //LIBVALGRIND_PROTOCOL_PARSER_H diff --git a/src/plugins/valgrind/xmlprotocol/stack.h b/src/plugins/valgrind/xmlprotocol/stack.h index daec25b94a..5fd5d3c070 100644 --- a/src/plugins/valgrind/xmlprotocol/stack.h +++ b/src/plugins/valgrind/xmlprotocol/stack.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef VALGRIND_PROTOCOL_STACK_H -#define VALGRIND_PROTOCOL_STACK_H +#pragma once #include <QSharedDataPointer> @@ -75,5 +74,3 @@ private: } // namespace XmlProtocol } // namespace Stack - -#endif // VALGRIND_PROTOCOL_STACK_H diff --git a/src/plugins/valgrind/xmlprotocol/stackmodel.h b/src/plugins/valgrind/xmlprotocol/stackmodel.h index 425a8468e0..a948b13bdc 100644 --- a/src/plugins/valgrind/xmlprotocol/stackmodel.h +++ b/src/plugins/valgrind/xmlprotocol/stackmodel.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_PROTOCOL_STACKMODEL_H -#define LIBVALGRIND_PROTOCOL_STACKMODEL_H +#pragma once #include <QAbstractItemModel> @@ -79,5 +78,3 @@ private: } // namespace XmlProtocol } // namespace Valgrind - -#endif // LIBVALGRIND_PROTOCOL_STACKMODEL_H diff --git a/src/plugins/valgrind/xmlprotocol/status.h b/src/plugins/valgrind/xmlprotocol/status.h index 9721a0ea79..b0ea47de09 100644 --- a/src/plugins/valgrind/xmlprotocol/status.h +++ b/src/plugins/valgrind/xmlprotocol/status.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_PROTOCOL_STATUS_H -#define LIBVALGRIND_PROTOCOL_STATUS_H +#pragma once #include <QMetaType> #include <QSharedDataPointer> @@ -63,5 +62,3 @@ private: } // namespace Valgrind Q_DECLARE_METATYPE(Valgrind::XmlProtocol::Status) - -#endif // LIBVALGRIND_PROTOCOL_STATUS_H diff --git a/src/plugins/valgrind/xmlprotocol/suppression.h b/src/plugins/valgrind/xmlprotocol/suppression.h index 7712c71bb1..3536db1a94 100644 --- a/src/plugins/valgrind/xmlprotocol/suppression.h +++ b/src/plugins/valgrind/xmlprotocol/suppression.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_PROTOCOL_SUPPRESSION_H -#define LIBVALGRIND_PROTOCOL_SUPPRESSION_H +#pragma once #include <QSharedDataPointer> @@ -103,5 +102,3 @@ private: } // namespace XmlProtocol } // namespace Valgrind - -#endif // LIBVALGRIND_PROTOCOL_SUPPRESSION_H diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.h b/src/plugins/valgrind/xmlprotocol/threadedparser.h index 3bd6817c8a..5e74949474 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.h +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_PROTOCOL_THREADEDPARSER_H -#define LIBVALGRIND_PROTOCOL_THREADEDPARSER_H +#pragma once #include <QObject> @@ -79,5 +78,3 @@ private: } // XmlProtocol } // Valgrind - -#endif //LIBVALGRIND_PROTOCOL_THREADEDPARSER_H diff --git a/src/plugins/vcsbase/submiteditorfile.h b/src/plugins/vcsbase/submiteditorfile.h index 3961eecdda..e2da2f72fa 100644 --- a/src/plugins/vcsbase/submiteditorfile.h +++ b/src/plugins/vcsbase/submiteditorfile.h @@ -36,7 +36,6 @@ namespace Internal { class SubmitEditorFile : public Core::IDocument { - Q_OBJECT public: explicit SubmitEditorFile(const VcsBaseSubmitEditorParameters *parameters, VcsBaseSubmitEditor *parent = 0); diff --git a/src/plugins/vcsbase/submitfilemodel.h b/src/plugins/vcsbase/submitfilemodel.h index 31ef8cf267..d32345d5df 100644 --- a/src/plugins/vcsbase/submitfilemodel.h +++ b/src/plugins/vcsbase/submitfilemodel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SUBMITFILEMODEL_H -#define SUBMITFILEMODEL_H +#pragma once #include "vcsbase_global.h" @@ -94,5 +93,3 @@ private: }; } // namespace VcsBase - -#endif // SUBMITFILEMODEL_H diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index c21ea9ae22..970225765f 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -51,17 +51,6 @@ #include <QVariant> #include <QProcessEnvironment> -static void commandFinished(VcsBase::VcsBaseEditorWidget *editor, VcsBase::VcsCommand *cmd) -{ - if (!cmd->lastExecutionSuccess()) { - editor->reportCommandFinished(false, cmd->lastExecutionExitCode(), cmd->cookie()); - } else if (cmd->cookie().type() == QVariant::Int) { - const int line = cmd->cookie().toInt(); - if (line >= 0) - editor->gotoLine(line); - } -} - /*! \class VcsBase::VcsBaseClient @@ -131,12 +120,8 @@ VcsCommand *VcsBaseClientImpl::createCommand(const QString &workingDirectory, { auto cmd = new VcsCommand(workingDirectory, processEnvironment()); cmd->setDefaultTimeoutS(vcsTimeoutS()); - if (editor) { + if (editor) editor->setCommand(cmd); - connect(editor, &QObject::destroyed, cmd, &VcsCommand::abort); - connect(cmd, &VcsCommand::finished, - editor, [editor, cmd]() { commandFinished(editor, cmd); }); - } if (mode == VcsWindowOutputBind) { cmd->addFlags(VcsCommand::ShowStdOut); if (editor) // assume that the commands output is the important thing diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 5ffee0cf91..1508e66cef 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -553,43 +553,34 @@ public: QComboBox *entriesComboBox(); TextEditorWidget *q; - const VcsBaseEditorParameters *m_parameters; + const VcsBaseEditorParameters *m_parameters = nullptr; QString m_workingDirectory; QRegExp m_diffFilePattern; QRegExp m_logEntryPattern; QList<int> m_entrySections; // line number where this section starts - int m_cursorLine; + int m_cursorLine = -1; QString m_annotateRevisionTextFormat; QString m_annotatePreviousRevisionTextFormat; QString m_copyRevisionTextFormat; - bool m_fileLogAnnotateEnabled; - VcsBaseEditorParameterWidget *m_configurationWidget; - bool m_mouseDragging; + VcsBaseEditorParameterWidget *m_configurationWidget = nullptr; QList<AbstractTextCursorHandler *> m_textCursorHandlers; QPointer<VcsCommand> m_command; - QObject *m_describeReceiver; - const char *m_describeSlot; - Utils::ProgressIndicator *m_progressIndicator; + QObject *m_describeReceiver = nullptr; + const char *m_describeSlot = nullptr; + Utils::ProgressIndicator *m_progressIndicator = nullptr; + bool m_fileLogAnnotateEnabled = false; + bool m_mouseDragging = false; private: - QComboBox *m_entriesComboBox; + QComboBox *m_entriesComboBox = nullptr; }; VcsBaseEditorWidgetPrivate::VcsBaseEditorWidgetPrivate(VcsBaseEditorWidget *editorWidget) : q(editorWidget), - m_parameters(0), - m_cursorLine(-1), m_annotateRevisionTextFormat(VcsBaseEditorWidget::tr("Annotate \"%1\"")), - m_copyRevisionTextFormat(VcsBaseEditorWidget::tr("Copy \"%1\"")), - m_fileLogAnnotateEnabled(false), - m_configurationWidget(0), - m_mouseDragging(false), - m_describeReceiver(0), - m_describeSlot(0), - m_progressIndicator(0), - m_entriesComboBox(0) + m_copyRevisionTextFormat(VcsBaseEditorWidget::tr("Copy \"%1\"")) { m_textCursorHandlers.append(new ChangeTextCursorHandler(editorWidget)); m_textCursorHandlers.append(new UrlTextCursorHandler(editorWidget)); @@ -1199,10 +1190,15 @@ DiffChunk VcsBaseEditorWidget::diffChunk(QTextCursor cursor) const void VcsBaseEditorWidget::reportCommandFinished(bool ok, int exitCode, const QVariant &data) { Q_UNUSED(exitCode); - Q_UNUSED(data); - if (!ok) + hideProgressIndicator(); + if (!ok) { textDocument()->setPlainText(tr("Failed to retrieve data.")); + } else if (data.type() == QVariant::Int) { + const int line = data.toInt(); + if (line >= 0) + gotoLine(line); + } } const VcsBaseEditorParameters *VcsBaseEditor::findType(const VcsBaseEditorParameters *array, @@ -1385,11 +1381,10 @@ void VcsBaseEditorWidget::setCommand(VcsCommand *command) hideProgressIndicator(); } d->m_command = command; - if (d->m_command) { + if (command) { d->m_progressIndicator = new Utils::ProgressIndicator(Utils::ProgressIndicator::Large); d->m_progressIndicator->attachToWidget(this); - connect(d->m_command.data(), &VcsCommand::finished, - this, &VcsBaseEditorWidget::hideProgressIndicator); + connect(command, &VcsCommand::finished, this, &VcsBaseEditorWidget::reportCommandFinished); QTimer::singleShot(100, this, &VcsBaseEditorWidget::showProgressIndicator); } } diff --git a/src/plugins/welcome/welcomeplugin.h b/src/plugins/welcome/welcomeplugin.h index 4d75a43bee..fe05ee8a04 100644 --- a/src/plugins/welcome/welcomeplugin.h +++ b/src/plugins/welcome/welcomeplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WELCOMEPLUGIN_H -#define WELCOMEPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -54,5 +53,3 @@ private: } // namespace Welcome } // namespace Internal - -#endif // WELCOMEPLUGIN_H diff --git a/src/plugins/winrt/winrtconstants.h b/src/plugins/winrt/winrtconstants.h index 15898aee33..c36dc8d70d 100644 --- a/src/plugins/winrt/winrtconstants.h +++ b/src/plugins/winrt/winrtconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTCONSTANTS_H -#define WINRTCONSTANTS_H +#pragma once namespace WinRt { namespace Internal { @@ -45,5 +44,3 @@ const char WINRT_RC_PREFIX[] = "WinRt.WinRtRunConfiguration:"; } // Constants } // Internal } // WinRt - -#endif // WINRTCONSTANTS_H diff --git a/src/plugins/winrt/winrtdebugsupport.cpp b/src/plugins/winrt/winrtdebugsupport.cpp index 338e711cdb..25f2adab41 100644 --- a/src/plugins/winrt/winrtdebugsupport.cpp +++ b/src/plugins/winrt/winrtdebugsupport.cpp @@ -63,14 +63,15 @@ bool WinRtDebugSupport::useQmlDebugging(WinRtRunConfiguration *runConfig) return extraAspect && extraAspect->useQmlDebugger(); } -bool WinRtDebugSupport::getFreePort(quint16 &qmlDebuggerPort, QString *errorMessage) +bool WinRtDebugSupport::getFreePort(Utils::Port &qmlDebuggerPort, QString *errorMessage) { QTcpServer server; - if (!server.listen(QHostAddress::LocalHost, qmlDebuggerPort)) { + if (!server.listen(QHostAddress::LocalHost, + qmlDebuggerPort.isValid() ? qmlDebuggerPort.number() : 0)) { *errorMessage = tr("Not enough free ports for QML debugging."); return false; } - qmlDebuggerPort = server.serverPort(); + qmlDebuggerPort = Utils::Port(server.serverPort()); return true; } @@ -105,7 +106,7 @@ RunControl *WinRtDebugSupport::createDebugRunControl(WinRtRunConfiguration *runC } if (useQmlDebugging(runConfig)) { - quint16 qmlDebugPort = 0; + Utils::Port qmlDebugPort; if (!getFreePort(qmlDebugPort, errorMessage)) return 0; params.qmlServerAddress = QHostAddress(QHostAddress::LocalHost).toString(); diff --git a/src/plugins/winrt/winrtdebugsupport.h b/src/plugins/winrt/winrtdebugsupport.h index df8460ffa6..82705576fa 100644 --- a/src/plugins/winrt/winrtdebugsupport.h +++ b/src/plugins/winrt/winrtdebugsupport.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRT_INTERNAL_WINRTDEBUGSUPPORT_H -#define WINRT_INTERNAL_WINRTDEBUGSUPPORT_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -49,7 +48,7 @@ private: WinRtDebugSupport(ProjectExplorer::RunControl *runControl, WinRtRunnerHelper *runner); static bool useQmlDebugging(WinRtRunConfiguration *runConfig); - static bool getFreePort(quint16 &qmlDebuggerPort, QString *errorMessage); + static bool getFreePort(Utils::Port &qmlDebuggerPort, QString *errorMessage); ProjectExplorer::RunControl *m_debugRunControl; WinRtRunnerHelper *m_runner; @@ -60,5 +59,3 @@ private slots: } // namespace Internal } // namespace WinRt - -#endif // WINRT_INTERNAL_WINRTDEBUGSUPPORT_H diff --git a/src/plugins/winrt/winrtdeployconfiguration.h b/src/plugins/winrt/winrtdeployconfiguration.h index 00a6d67ae6..96ac069dfe 100644 --- a/src/plugins/winrt/winrtdeployconfiguration.h +++ b/src/plugins/winrt/winrtdeployconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTDEPLOYCONFIGURATION_H -#define WINRTDEPLOYCONFIGURATION_H +#pragma once #include <projectexplorer/deployconfiguration.h> #include <projectexplorer/buildstep.h> @@ -72,5 +71,3 @@ private: } // namespace Internal } // namespace WinRt - -#endif // WINRTDEPLOYCONFIGURATION_H diff --git a/src/plugins/winrt/winrtdevice.h b/src/plugins/winrt/winrtdevice.h index 5807223da1..772bc2dfeb 100644 --- a/src/plugins/winrt/winrtdevice.h +++ b/src/plugins/winrt/winrtdevice.h @@ -23,19 +23,10 @@ ** ****************************************************************************/ -#ifndef WINRTDEVICE_H -#define WINRTDEVICE_H - -#include <QList> -#include <QUuid> -#include <QSharedPointer> +#pragma once #include <projectexplorer/devicesupport/idevice.h> -namespace Debugger { - class DebuggerStartParameters; -} // Debugger - namespace WinRt { namespace Internal { @@ -46,15 +37,15 @@ public: typedef QSharedPointer<WinRtDevice> Ptr; typedef QSharedPointer<const WinRtDevice> ConstPtr; - QString displayType() const; - ProjectExplorer::IDeviceWidget *createWidget(); - QList<Core::Id> actionIds() const; - QString displayNameForActionId(Core::Id actionId) const; - void executeAction(Core::Id actionId, QWidget *parent); - ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const; - void fromMap(const QVariantMap &map); - QVariantMap toMap() const; - ProjectExplorer::IDevice::Ptr clone() const; + QString displayType() const override; + ProjectExplorer::IDeviceWidget *createWidget() override; + QList<Core::Id> actionIds() const override; + QString displayNameForActionId(Core::Id actionId) const override; + void executeAction(Core::Id actionId, QWidget *parent) override; + ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override; + void fromMap(const QVariantMap &map) override; + QVariantMap toMap() const override; + ProjectExplorer::IDevice::Ptr clone() const override; static QString displayNameForType(Core::Id type); int deviceId() const { return m_deviceId; } @@ -70,5 +61,3 @@ private: } // Internal } // WinRt - -#endif // WINRTDEVICE_H diff --git a/src/plugins/winrt/winrtdevicefactory.h b/src/plugins/winrt/winrtdevicefactory.h index a10a0c3240..edb938e806 100644 --- a/src/plugins/winrt/winrtdevicefactory.h +++ b/src/plugins/winrt/winrtdevicefactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTDEVICEFACTORY_H -#define WINRTDEVICEFACTORY_H +#pragma once #include <projectexplorer/devicesupport/idevicefactory.h> #include <utils/qtcprocess.h> @@ -63,5 +62,3 @@ private: } // Internal } // WinRt - -#endif // WINRTDEVICEFACTORY_H diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.h b/src/plugins/winrt/winrtpackagedeploymentstep.h index 950d7a1217..f7a2cecfbf 100644 --- a/src/plugins/winrt/winrtpackagedeploymentstep.h +++ b/src/plugins/winrt/winrtpackagedeploymentstep.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTPACKAGEDEPLOYMENTSTEP_H -#define WINRTPACKAGEDEPLOYMENTSTEP_H +#pragma once #include <projectexplorer/abstractprocessstep.h> @@ -66,5 +65,3 @@ private: } // namespace Internal } // namespace WinRt - -#endif // WINRTPACKAGEDEPLOYMENTSTEP_H diff --git a/src/plugins/winrt/winrtpackagedeploymentstepwidget.h b/src/plugins/winrt/winrtpackagedeploymentstepwidget.h index 0473b54c50..14be99b2dc 100644 --- a/src/plugins/winrt/winrtpackagedeploymentstepwidget.h +++ b/src/plugins/winrt/winrtpackagedeploymentstepwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTPACKAGEDEPLOYMENTSTEPWIDGET_H -#define WINRTPACKAGEDEPLOYMENTSTEPWIDGET_H +#pragma once #include "winrtpackagedeploymentstep.h" @@ -56,5 +55,3 @@ private: } // namespace Internal } // namespace WinRt - -#endif // WINRTPACKAGEDEPLOYMENTSTEPWIDGET_H diff --git a/src/plugins/winrt/winrtphoneqtversion.h b/src/plugins/winrt/winrtphoneqtversion.h index ed28e3c225..bbb8bd9764 100644 --- a/src/plugins/winrt/winrtphoneqtversion.h +++ b/src/plugins/winrt/winrtphoneqtversion.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTPHONEQTVERSION_H -#define WINRTPHONEQTVERSION_H +#pragma once #include "winrtqtversion.h" @@ -47,5 +46,3 @@ public: } // Internal } // WinRt - -#endif // WINRTPHONEQTVERSION_H diff --git a/src/plugins/winrt/winrtplugin.h b/src/plugins/winrt/winrtplugin.h index acd4ecd43d..949eb3ba9a 100644 --- a/src/plugins/winrt/winrtplugin.h +++ b/src/plugins/winrt/winrtplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTPLUGIN_H -#define WINRTPLUGIN_H +#pragma once #include <extensionsystem/iplugin.h> @@ -47,5 +46,3 @@ public: } // namespace Internal } // namespace WinRt - -#endif // WINRTPLUGIN_H diff --git a/src/plugins/winrt/winrtqtversion.h b/src/plugins/winrt/winrtqtversion.h index 7fdb3a5399..f3a4fc9d3b 100644 --- a/src/plugins/winrt/winrtqtversion.h +++ b/src/plugins/winrt/winrtqtversion.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTQTVERSION_H -#define WINRTQTVERSION_H +#pragma once #include <qtsupport/baseqtversion.h> @@ -50,5 +49,3 @@ public: } // Internal } // WinRt - -#endif // WINRTQTVERSION_H diff --git a/src/plugins/winrt/winrtqtversionfactory.h b/src/plugins/winrt/winrtqtversionfactory.h index 67280ee29c..bc099372c9 100644 --- a/src/plugins/winrt/winrtqtversionfactory.h +++ b/src/plugins/winrt/winrtqtversionfactory.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTQTVERSIONFACTORY_H -#define WINRTQTVERSIONFACTORY_H +#pragma once #include <qtsupport/qtversionfactory.h> @@ -47,5 +46,3 @@ public: } // Internal } // WinRt - -#endif // WINRTQTVERSIONFACTORY_H diff --git a/src/plugins/winrt/winrtrunconfiguration.h b/src/plugins/winrt/winrtrunconfiguration.h index 593cc79dcc..bfff934ffb 100644 --- a/src/plugins/winrt/winrtrunconfiguration.h +++ b/src/plugins/winrt/winrtrunconfiguration.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTRUNCONFIGURATION_H -#define WINRTRUNCONFIGURATION_H +#pragma once #include <projectexplorer/runconfiguration.h> @@ -61,5 +60,3 @@ private: } // namespace Internal } // namespace WinRt - -#endif // WINRTRUNCONFIGURATION_H diff --git a/src/plugins/winrt/winrtrunconfigurationwidget.h b/src/plugins/winrt/winrtrunconfigurationwidget.h index 7f8b3cbecb..9f68d0bb5b 100644 --- a/src/plugins/winrt/winrtrunconfigurationwidget.h +++ b/src/plugins/winrt/winrtrunconfigurationwidget.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTRUNCONFIGURATIONWIDGET_H -#define WINRTRUNCONFIGURATIONWIDGET_H +#pragma once #include <utils/detailswidget.h> @@ -48,5 +47,3 @@ private: } // namespace Internal } // namespace WinRt - -#endif // WINRTRUNCONFIGURATIONWIDGET_H diff --git a/src/plugins/winrt/winrtruncontrol.h b/src/plugins/winrt/winrtruncontrol.h index d1ff61804f..e7238d7cad 100644 --- a/src/plugins/winrt/winrtruncontrol.h +++ b/src/plugins/winrt/winrtruncontrol.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTRUNCONTROL_H -#define WINRTRUNCONTROL_H +#pragma once #include "winrtdevice.h" @@ -72,5 +71,3 @@ private: } // namespace Internal } // namespace WinRt - -#endif // WINRTRUNCONTROL_H diff --git a/src/plugins/winrt/winrtrunfactories.h b/src/plugins/winrt/winrtrunfactories.h index 09b8986828..59a35ff3a6 100644 --- a/src/plugins/winrt/winrtrunfactories.h +++ b/src/plugins/winrt/winrtrunfactories.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTRUNCONFIGURATIONFACTORY_H -#define WINRTRUNCONFIGURATIONFACTORY_H +#pragma once #include <projectexplorer/runconfiguration.h> #include <projectexplorer/devicesupport/idevicefactory.h> @@ -67,5 +66,3 @@ public: } // namespace Internal } // namespace WinRt - -#endif // WINRTRUNCONFIGURATIONFACTORY_H diff --git a/src/plugins/winrt/winrtrunnerhelper.h b/src/plugins/winrt/winrtrunnerhelper.h index 0ecfd0f76e..0963ff0b1b 100644 --- a/src/plugins/winrt/winrtrunnerhelper.h +++ b/src/plugins/winrt/winrtrunnerhelper.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WINRTRUNNERHELPER_H -#define WINRTRUNNERHELPER_H +#pragma once #include "winrtdevice.h" @@ -92,5 +91,3 @@ private: } // namespace WinRt } // namespace Internal - -#endif // WINRTRUNNERHELPER_H diff --git a/src/shared/cpaster/cgi.h b/src/shared/cpaster/cgi.h index 0422468e6c..688ec50288 100644 --- a/src/shared/cpaster/cgi.h +++ b/src/shared/cpaster/cgi.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CGI_H -#define CGI_H +#pragma once #include <QString> @@ -47,5 +46,3 @@ private: inline short charToHex(const QChar &ch); inline QChar hexToChar(const QString &hx); }; - -#endif // CGI_H diff --git a/src/shared/cpaster/splitter.h b/src/shared/cpaster/splitter.h index a4d14bbbc9..ae03a19514 100644 --- a/src/shared/cpaster/splitter.h +++ b/src/shared/cpaster/splitter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SPLITTER_H -#define SPLITTER_H +#pragma once #include <QByteArray> #include <QList> @@ -42,5 +41,3 @@ struct FileData typedef QList<FileData> FileDataList; FileDataList splitDiffToFiles(const QString &data); - -#endif // SPLITTER_H diff --git a/src/shared/designerintegrationv2/formresizer.h b/src/shared/designerintegrationv2/formresizer.h index 80dbf0e1a0..aad1a57b0f 100644 --- a/src/shared/designerintegrationv2/formresizer.h +++ b/src/shared/designerintegrationv2/formresizer.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORMRESIZER_H -#define FORMRESIZER_H +#pragma once #include "widgethostconstants.h" @@ -90,5 +89,3 @@ private: } } // namespace SharedTools - -#endif // FORMRESIZER_H diff --git a/src/shared/designerintegrationv2/sizehandlerect.h b/src/shared/designerintegrationv2/sizehandlerect.h index 36ebb4c579..df4912abe5 100644 --- a/src/shared/designerintegrationv2/sizehandlerect.h +++ b/src/shared/designerintegrationv2/sizehandlerect.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SIZEHANDLERECT_H -#define SIZEHANDLERECT_H +#pragma once #include "widgethostconstants.h" @@ -71,7 +70,3 @@ private: } } // namespace SharedTools - - -#endif // SIZEHANDLERECT_H - diff --git a/src/shared/designerintegrationv2/widgethost.h b/src/shared/designerintegrationv2/widgethost.h index 00f3ab6b30..ccf8590e91 100644 --- a/src/shared/designerintegrationv2/widgethost.h +++ b/src/shared/designerintegrationv2/widgethost.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WIDGETHOST_H -#define WIDGETHOST_H +#pragma once #include <QScrollArea> @@ -67,5 +66,3 @@ private: }; } // namespace SharedTools - -#endif // WIDGETHOST_H diff --git a/src/shared/designerintegrationv2/widgethostconstants.h b/src/shared/designerintegrationv2/widgethostconstants.h index f05b0c3598..76bbb3950b 100644 --- a/src/shared/designerintegrationv2/widgethostconstants.h +++ b/src/shared/designerintegrationv2/widgethostconstants.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef WIDGETHOST_CONSTANTS_H -#define WIDGETHOST_CONSTANTS_H +#pragma once namespace SharedTools { namespace Internal { @@ -32,6 +31,3 @@ namespace SharedTools { enum SelectionHandleState { SelectionHandleOff, SelectionHandleInactive, SelectionHandleActive }; } } - -#endif // WIDGETHOST_CONSTANTS_H - diff --git a/src/shared/help/bookmarkmanager.h b/src/shared/help/bookmarkmanager.h index 7bb4c71e7f..2526d8bc43 100644 --- a/src/shared/help/bookmarkmanager.h +++ b/src/shared/help/bookmarkmanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BOOKMARKMANAGER_H -#define BOOKMARKMANAGER_H +#pragma once #include "ui_bookmarkdialog.h" @@ -188,5 +187,3 @@ private: BookmarkModel *listModel; QStandardItem *renameItem; }; - -#endif diff --git a/src/shared/help/contentwindow.h b/src/shared/help/contentwindow.h index 345769b258..99ec3cbca5 100644 --- a/src/shared/help/contentwindow.h +++ b/src/shared/help/contentwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CONTENTWINDOW_H -#define CONTENTWINDOW_H +#pragma once #include <QUrl> #include <QModelIndex> @@ -66,5 +65,3 @@ private: int m_expandDepth; bool m_isOpenInNewPageActionVisible; }; - -#endif // CONTENTWINDOW_H diff --git a/src/shared/help/filternamedialog.h b/src/shared/help/filternamedialog.h index a32df1c8f7..23f62e9528 100644 --- a/src/shared/help/filternamedialog.h +++ b/src/shared/help/filternamedialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FILTERNAMEDIALOG_H -#define FILTERNAMEDIALOG_H +#pragma once #include <QDialog> #include "ui_filternamedialog.h" @@ -43,5 +42,3 @@ private slots: private: Ui::FilterNameDialogClass m_ui; }; - -#endif // FILTERNAMEDIALOG_H diff --git a/src/shared/help/helpicons.h b/src/shared/help/helpicons.h index 2ecdc51292..4c6b0aa726 100644 --- a/src/shared/help/helpicons.h +++ b/src/shared/help/helpicons.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HELPICONS_H -#define HELPICONS_H +#pragma once #include <utils/icon.h> @@ -46,5 +45,3 @@ const Utils::Icon MODE_HELP_FLAT_ACTIVE({ } // namespace Icons } // namespace Help - -#endif // HELPICONS_H diff --git a/src/shared/help/indexwindow.h b/src/shared/help/indexwindow.h index 14a0983124..d041ba399f 100644 --- a/src/shared/help/indexwindow.h +++ b/src/shared/help/indexwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef INDEXWINDOW_H -#define INDEXWINDOW_H +#pragma once #include <QAbstractProxyModel> #include <QList> @@ -108,5 +107,3 @@ private: } // Internal } // Help - -#endif // INDEXWINDOW_H diff --git a/src/shared/help/topicchooser.h b/src/shared/help/topicchooser.h index 304551412a..a886b2b929 100644 --- a/src/shared/help/topicchooser.h +++ b/src/shared/help/topicchooser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TOPICCHOOSER_H -#define TOPICCHOOSER_H +#pragma once #include "ui_topicchooser.h" @@ -62,5 +61,3 @@ private: QModelIndex m_activedIndex; QSortFilterProxyModel *m_filterModel; }; - -#endif // TOPICCHOOSER_H diff --git a/src/shared/modeltest/modeltest.h b/src/shared/modeltest/modeltest.h index ecebfeae00..e3f3c8aa34 100644 --- a/src/shared/modeltest/modeltest.h +++ b/src/shared/modeltest/modeltest.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELTEST_H -#define MODELTEST_H +#pragma once #include <QAbstractItemModel> #include <QObject> @@ -74,5 +73,3 @@ private: QList<QPersistentModelIndex> changing; }; - -#endif // MODELTEST_H diff --git a/src/shared/proparser/ioutils.h b/src/shared/proparser/ioutils.h index 3bade494df..f4fd79f32d 100644 --- a/src/shared/proparser/ioutils.h +++ b/src/shared/proparser/ioutils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOUTILS_H -#define IOUTILS_H +#pragma once #include <qstring.h> @@ -64,5 +63,3 @@ public: } // namespace ProFileEvaluatorInternal QT_END_NAMESPACE - -#endif // IOUTILS_H diff --git a/src/shared/proparser/profileevaluator.h b/src/shared/proparser/profileevaluator.h index f49097e670..27b26081b0 100644 --- a/src/shared/proparser/profileevaluator.h +++ b/src/shared/proparser/profileevaluator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROFILEEVALUATOR_H -#define PROFILEEVALUATOR_H +#pragma once #include "qmake_global.h" #include "qmakeglobals.h" @@ -96,5 +95,3 @@ private: }; QT_END_NAMESPACE - -#endif // PROFILEEVALUATOR_H diff --git a/src/shared/proparser/proitems.h b/src/shared/proparser/proitems.h index 4515eafc7b..d6bc4fe1cb 100644 --- a/src/shared/proparser/proitems.h +++ b/src/shared/proparser/proitems.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROITEMS_H -#define PROITEMS_H +#pragma once #include "qmake_global.h" @@ -387,5 +386,3 @@ struct ProFunctionDefs { }; QT_END_NAMESPACE - -#endif // PROITEMS_H diff --git a/src/shared/proparser/prowriter.h b/src/shared/proparser/prowriter.h index cd100ffc98..808884837b 100644 --- a/src/shared/proparser/prowriter.h +++ b/src/shared/proparser/prowriter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PROWRITER_H -#define PROWRITER_H +#pragma once #include "qmake_global.h" #include <QStringList> @@ -70,5 +69,3 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(ProWriter::PutFlags) } // namespace Internal } // namespace QmakeProjectManager - -#endif // PROWRITER_H diff --git a/src/shared/proparser/qmake_global.h b/src/shared/proparser/qmake_global.h index af422118b6..8dd3844309 100644 --- a/src/shared/proparser/qmake_global.h +++ b/src/shared/proparser/qmake_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKE_GLOBAL_H -#define QMAKE_GLOBAL_H +#pragma once #include <qglobal.h> @@ -51,5 +50,3 @@ #ifdef PROEVALUATOR_FULL # define PROEVALUATOR_DEBUG #endif - -#endif diff --git a/src/shared/proparser/qmakeevaluator.h b/src/shared/proparser/qmakeevaluator.h index 9394686283..7bb673cb89 100644 --- a/src/shared/proparser/qmakeevaluator.h +++ b/src/shared/proparser/qmakeevaluator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEEVALUATOR_H -#define QMAKEEVALUATOR_H +#pragma once #if defined(PROEVALUATOR_FULL) && defined(PROEVALUATOR_THREAD_SAFE) # error PROEVALUATOR_FULL is incompatible with PROEVALUATOR_THREAD_SAFE due to cache() implementation @@ -310,5 +309,3 @@ Q_DECLARE_TYPEINFO(QMakeEvaluator::Location, Q_PRIMITIVE_TYPE); Q_DECLARE_OPERATORS_FOR_FLAGS(QMakeEvaluator::LoadFlags) QT_END_NAMESPACE - -#endif // QMAKEEVALUATOR_H diff --git a/src/shared/proparser/qmakeevaluator_p.h b/src/shared/proparser/qmakeevaluator_p.h index 66f6f138df..91c3922106 100644 --- a/src/shared/proparser/qmakeevaluator_p.h +++ b/src/shared/proparser/qmakeevaluator_p.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEEVALUATOR_P_H -#define QMAKEEVALUATOR_P_H +#pragma once #include "proitems.h" @@ -90,5 +89,3 @@ extern QMakeStatics statics; } QT_END_NAMESPACE - -#endif // QMAKEEVALUATOR_P_H diff --git a/src/shared/proparser/qmakeglobals.h b/src/shared/proparser/qmakeglobals.h index bd6fe2ead3..33a5bdb831 100644 --- a/src/shared/proparser/qmakeglobals.h +++ b/src/shared/proparser/qmakeglobals.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEGLOBALS_H -#define QMAKEGLOBALS_H +#pragma once #include "qmake_global.h" #include "proitems.h" @@ -159,5 +158,3 @@ private: }; QT_END_NAMESPACE - -#endif // QMAKEGLOBALS_H diff --git a/src/shared/proparser/qmakeparser.h b/src/shared/proparser/qmakeparser.h index 1da0271625..d44523d024 100644 --- a/src/shared/proparser/qmakeparser.h +++ b/src/shared/proparser/qmakeparser.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEPARSER_H -#define QMAKEPARSER_H +#pragma once #include "qmake_global.h" #include "proitems.h" @@ -226,5 +225,3 @@ Q_DECLARE_TYPEINFO(QMakeParser::Context, Q_PRIMITIVE_TYPE); #endif QT_END_NAMESPACE - -#endif // PROFILEPARSER_H diff --git a/src/shared/proparser/qmakevfs.h b/src/shared/proparser/qmakevfs.h index 18762d836c..8c387fe29d 100644 --- a/src/shared/proparser/qmakevfs.h +++ b/src/shared/proparser/qmakevfs.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QMAKEVFS_H -#define QMAKEVFS_H +#pragma once #include "qmake_global.h" @@ -65,5 +64,3 @@ private: }; QT_END_NAMESPACE - -#endif // QMAKEVFS_H diff --git a/src/shared/qtlockedfile/qtlockedfile.h b/src/shared/qtlockedfile/qtlockedfile.h index 44dbbaafab..52dfef64d0 100644 --- a/src/shared/qtlockedfile/qtlockedfile.h +++ b/src/shared/qtlockedfile/qtlockedfile.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef QTLOCKEDFILE_H -#define QTLOCKEDFILE_H +#pragma once #include <QFile> @@ -69,5 +68,3 @@ private: }; } // namespace SharedTools - -#endif // QTLOCKEDFILE_H diff --git a/src/shared/registryaccess/registryaccess.h b/src/shared/registryaccess/registryaccess.h index 7b65160d60..f8620614c7 100644 --- a/src/shared/registryaccess/registryaccess.h +++ b/src/shared/registryaccess/registryaccess.h @@ -27,8 +27,7 @@ // qtcdebugger is currently registered for post-mortem debugging. // This is only needed on Windows. -#ifndef REGISTRYACCESS_H -#define REGISTRYACCESS_H +#pragma once #include <QString> #include <QLatin1String> @@ -75,5 +74,3 @@ QString debuggerCall(const QString &additionalOption = QString()); bool isRegistered(HKEY handle, const QString &call, QString *errorMessage, QString *oldDebugger = 0); } // namespace RegistryAccess - -#endif // REGISTRYACCESS_H diff --git a/src/src.qbs b/src/src.qbs index ff8007be73..69160e489e 100644 --- a/src/src.qbs +++ b/src/src.qbs @@ -1,4 +1,5 @@ import qbs +import qbs.Environment import qbs.File import qbs.FileInfo @@ -14,7 +15,7 @@ Project { ] property bool qbsSubModuleExists: File.exists(qbsProject.qbsBaseDir + "/qbs.qbs") - property path qbs_install_dir: qbs.getEnv("QBS_INSTALL_DIR") + property path qbs_install_dir: Environment.getEnv("QBS_INSTALL_DIR") property bool useExternalQbs: qbs_install_dir property bool buildQbsProjectManager: useExternalQbs || qbsSubModuleExists Project { diff --git a/src/tools/3rdparty/iossim/coresimulator/coresimulator.h b/src/tools/3rdparty/iossim/coresimulator/coresimulator.h index d38805ace4..6f0e57486e 100644 --- a/src/tools/3rdparty/iossim/coresimulator/coresimulator.h +++ b/src/tools/3rdparty/iossim/coresimulator/coresimulator.h @@ -448,4 +448,3 @@ typedef void (^CDUnknownBlockType)(void); // return type and parameters are unkn - (id)init; @end - diff --git a/src/tools/clangbackend/ipcsource/clangbackendclangipc-source.pri b/src/tools/clangbackend/ipcsource/clangbackendclangipc-source.pri index 344a037207..e9ad8d3f79 100644 --- a/src/tools/clangbackend/ipcsource/clangbackendclangipc-source.pri +++ b/src/tools/clangbackend/ipcsource/clangbackendclangipc-source.pri @@ -27,12 +27,12 @@ HEADERS += $$PWD/clangipcserver.h \ $$PWD/translationunitalreadyexistsexception.h \ $$PWD/commandlinearguments.h \ $$PWD/cursor.h \ - $$PWD/highlightinginformations.h \ - $$PWD/highlightinginformation.h \ - $$PWD/highlightinginformationsiterator.h \ $$PWD/skippedsourceranges.h \ $$PWD/clangtranslationunit.h \ - $$PWD/clangtype.h + $$PWD/clangtype.h \ + $$PWD/highlightingmark.h \ + $$PWD/highlightingmarks.h \ + $$PWD/highlightingmarksiterator.h SOURCES += $$PWD/clangipcserver.cpp \ $$PWD/codecompleter.cpp \ @@ -60,8 +60,8 @@ SOURCES += $$PWD/clangipcserver.cpp \ $$PWD/translationunitalreadyexistsexception.cpp \ $$PWD/commandlinearguments.cpp \ $$PWD/cursor.cpp \ - $$PWD/highlightinginformations.cpp \ - $$PWD/highlightinginformation.cpp \ $$PWD/skippedsourceranges.cpp \ $$PWD/clangtranslationunit.cpp \ - $$PWD/clangtype.cpp + $$PWD/clangtype.cpp \ + $$PWD/highlightingmark.cpp \ + $$PWD/highlightingmarks.cpp diff --git a/src/tools/clangbackend/ipcsource/clangcodecompleteresults.h b/src/tools/clangbackend/ipcsource/clangcodecompleteresults.h index 63e164c402..157fcf1224 100644 --- a/src/tools/clangbackend/ipcsource/clangcodecompleteresults.h +++ b/src/tools/clangbackend/ipcsource/clangcodecompleteresults.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_CLANGCODECOMPLETERESULTS_H -#define CLANGBACKEND_CLANGCODECOMPLETERESULTS_H +#pragma once #include <clang-c/Index.h> @@ -61,5 +60,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_CLANGCODECOMPLETERESULTS_H diff --git a/src/tools/clangbackend/ipcsource/clangfilesystemwatcher.h b/src/tools/clangbackend/ipcsource/clangfilesystemwatcher.h index 4f7a9461a2..4d6be96a21 100644 --- a/src/tools/clangbackend/ipcsource/clangfilesystemwatcher.h +++ b/src/tools/clangbackend/ipcsource/clangfilesystemwatcher.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGFILESYSTEMWATCHER_H -#define CLANGFILESYSTEMWATCHER_H +#pragma once #include <QFileSystemWatcher> #include <QSet> @@ -56,5 +55,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGFILESYSTEMWATCHER_H diff --git a/src/tools/clangbackend/ipcsource/clangipcserver.cpp b/src/tools/clangbackend/ipcsource/clangipcserver.cpp index 301633c658..d5a4ef6edf 100644 --- a/src/tools/clangbackend/ipcsource/clangipcserver.cpp +++ b/src/tools/clangbackend/ipcsource/clangipcserver.cpp @@ -28,7 +28,7 @@ #include "clangfilesystemwatcher.h" #include "codecompleter.h" #include "diagnosticset.h" -#include "highlightinginformations.h" +#include "highlightingmarks.h" #include "projectpartsdonotexistexception.h" #include "skippedsourceranges.h" #include "translationunitdoesnotexistexception.h" @@ -288,7 +288,7 @@ void ClangIpcServer::requestHighlighting(const RequestHighlightingMessage &messa message.fileContainer().projectPartId()); client()->highlightingChanged(HighlightingChangedMessage(translationUnit.fileContainer(), - translationUnit.highlightingInformations().toHighlightingMarksContainers(), + translationUnit.highlightingMarks().toHighlightingMarksContainers(), translationUnit.skippedSourceRanges().toSourceRangeContainers())); } catch (const TranslationUnitDoesNotExistException &exception) { client()->translationUnitDoesNotExist(TranslationUnitDoesNotExistMessage(exception.fileContainer())); diff --git a/src/tools/clangbackend/ipcsource/clangipcserver.h b/src/tools/clangbackend/ipcsource/clangipcserver.h index a75801f828..a8d4a735d0 100644 --- a/src/tools/clangbackend/ipcsource/clangipcserver.h +++ b/src/tools/clangbackend/ipcsource/clangipcserver.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGIPCSERVER_H -#define CLANGIPCSERVER_H +#pragma once #include "ipcserverinterface.h" @@ -74,4 +73,3 @@ private: }; } // namespace ClangBackEnd -#endif // CLANGIPCSERVER_H diff --git a/src/tools/clangbackend/ipcsource/clangstring.h b/src/tools/clangbackend/ipcsource/clangstring.h index 3fb15f5d72..9f49cc7971 100644 --- a/src/tools/clangbackend/ipcsource/clangstring.h +++ b/src/tools/clangbackend/ipcsource/clangstring.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_CLANGSTRING_H -#define CLANGBACKEND_CLANGSTRING_H +#pragma once #include <clang-c/CXString.h> @@ -55,5 +54,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_CLANGSTRING_H diff --git a/src/tools/clangbackend/ipcsource/clangtranslationunit.cpp b/src/tools/clangbackend/ipcsource/clangtranslationunit.cpp index 38315719d1..8682a3e9a3 100644 --- a/src/tools/clangbackend/ipcsource/clangtranslationunit.cpp +++ b/src/tools/clangbackend/ipcsource/clangtranslationunit.cpp @@ -35,7 +35,7 @@ #include "skippedsourceranges.h" #include "sourcelocation.h" #include "sourcerange.h" -#include "highlightinginformations.h" +#include "highlightingmarks.h" #include "translationunitfilenotexitexception.h" #include "translationunitisnullexception.h" #include "translationunitparseerrorexception.h" @@ -80,7 +80,7 @@ public: uint documentRevision = 0; bool needsToBeReparsed = false; bool hasNewDiagnostics = true; - bool hasNewHighlightingInformations = true; + bool hasNewHighlightingMarks = true; bool isUsedByCurrentEditor = false; bool isVisibleInEditor = false; }; @@ -247,9 +247,9 @@ bool TranslationUnit::hasNewDiagnostics() const return d->hasNewDiagnostics; } -bool TranslationUnit::hasNewHighlightingInformations() const +bool TranslationUnit::hasNewHighlightingMarks() const { - return d->hasNewHighlightingInformations; + return d->hasNewHighlightingMarks; } DiagnosticSet TranslationUnit::diagnostics() const @@ -319,14 +319,14 @@ Cursor TranslationUnit::cursor() const return clang_getTranslationUnitCursor(cxTranslationUnit()); } -HighlightingInformations TranslationUnit::highlightingInformations() const +HighlightingMarks TranslationUnit::highlightingMarks() const { - d->hasNewHighlightingInformations = false; + d->hasNewHighlightingMarks = false; - return highlightingInformationsInRange(cursor().sourceRange()); + return highlightingMarksInRange(cursor().sourceRange()); } -HighlightingInformations TranslationUnit::highlightingInformationsInRange(const SourceRange &range) const +HighlightingMarks TranslationUnit::highlightingMarksInRange(const SourceRange &range) const { CXToken *cxTokens = 0; uint cxTokensCount = 0; @@ -334,7 +334,7 @@ HighlightingInformations TranslationUnit::highlightingInformationsInRange(const clang_tokenize(translationUnit, range, &cxTokens, &cxTokensCount); - return HighlightingInformations(translationUnit, cxTokens, cxTokensCount); + return HighlightingMarks(translationUnit, cxTokens, cxTokensCount); } SkippedSourceRanges TranslationUnit::skippedSourceRanges() const @@ -376,7 +376,7 @@ void TranslationUnit::setDirty() { d->needsToBeReparsed = true; d->hasNewDiagnostics = true; - d->hasNewHighlightingInformations = true; + d->hasNewHighlightingMarks = true; } bool TranslationUnit::isMainFileAndExistsOrIsOtherFile(const Utf8String &filePath) const diff --git a/src/tools/clangbackend/ipcsource/clangtranslationunit.h b/src/tools/clangbackend/ipcsource/clangtranslationunit.h index 9a311b62bf..c4b25d53c5 100644 --- a/src/tools/clangbackend/ipcsource/clangtranslationunit.h +++ b/src/tools/clangbackend/ipcsource/clangtranslationunit.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_TRANSLATIONUNIT_H -#define CLANGBACKEND_TRANSLATIONUNIT_H +#pragma once #include <utf8stringvector.h> @@ -48,7 +47,7 @@ class ProjectPart; class DiagnosticContainer; class DiagnosticSet; class FileContainer; -class HighlightingInformations; +class HighlightingMarks; class TranslationUnits; class CommandLineArguments; class Cursor; @@ -112,7 +111,7 @@ public: bool isNeedingReparse() const; bool hasNewDiagnostics() const; - bool hasNewHighlightingInformations() const; + bool hasNewHighlightingMarks() const; DiagnosticSet diagnostics() const; QVector<DiagnosticContainer> mainFileDiagnostics() const; @@ -134,8 +133,8 @@ public: Cursor cursorAt(const Utf8String &filePath, uint line, uint column) const; Cursor cursor() const; - HighlightingInformations highlightingInformations() const; - HighlightingInformations highlightingInformationsInRange(const SourceRange &range) const; + HighlightingMarks highlightingMarks() const; + HighlightingMarks highlightingMarksInRange(const SourceRange &range) const; SkippedSourceRanges skippedSourceRanges() const; @@ -167,5 +166,3 @@ private: bool operator==(const TranslationUnit &first, const TranslationUnit &second); void PrintTo(const TranslationUnit &translationUnit, ::std::ostream *os); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_TRANSLATIONUNIT_H diff --git a/src/tools/clangbackend/ipcsource/clangtype.h b/src/tools/clangbackend/ipcsource/clangtype.h index 348019fad5..e9a19e92db 100644 --- a/src/tools/clangbackend/ipcsource/clangtype.h +++ b/src/tools/clangbackend/ipcsource/clangtype.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_TYPE_H -#define CLANGBACKEND_TYPE_H +#pragma once #include <clang-c/Index.h> @@ -78,5 +77,3 @@ bool operator==(Type first, Type second); void PrintTo(CXTypeKind typeKind, ::std::ostream* os); void PrintTo(const Type &type, ::std::ostream* os); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_TYPE_H diff --git a/src/tools/clangbackend/ipcsource/codecompletefailedexception.h b/src/tools/clangbackend/ipcsource/codecompletefailedexception.h index c722fd4f88..d2ee10b2ed 100644 --- a/src/tools/clangbackend/ipcsource/codecompletefailedexception.h +++ b/src/tools/clangbackend/ipcsource/codecompletefailedexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CODECOMPLETEFAILEDEXCEPTION_H -#define CODECOMPLETEFAILEDEXCEPTION_H +#pragma once class CodeCompleteFailedException @@ -32,5 +31,3 @@ class CodeCompleteFailedException public: CodeCompleteFailedException(); }; - -#endif // CODECOMPLETEFAILEDEXCEPTION_H diff --git a/src/tools/clangbackend/ipcsource/codecompleter.h b/src/tools/clangbackend/ipcsource/codecompleter.h index 260ac4d581..313323a9d9 100644 --- a/src/tools/clangbackend/ipcsource/codecompleter.h +++ b/src/tools/clangbackend/ipcsource/codecompleter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_CODECOMPLETER_H -#define CLANGBACKEND_CODECOMPLETER_H +#pragma once #include "clangtranslationunit.h" @@ -68,5 +67,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_CODECOMPLETER_H diff --git a/src/tools/clangbackend/ipcsource/codecompletionchunkconverter.h b/src/tools/clangbackend/ipcsource/codecompletionchunkconverter.h index a912c4b481..0bfb1a19c1 100644 --- a/src/tools/clangbackend/ipcsource/codecompletionchunkconverter.h +++ b/src/tools/clangbackend/ipcsource/codecompletionchunkconverter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_CODECOMPLETIONCHUNKCONVERTER_H -#define CLANGBACKEND_CODECOMPLETIONCHUNKCONVERTER_H +#pragma once #include <codecompletionchunk.h> @@ -51,5 +50,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_CODECOMPLETIONCHUNKCONVERTER_H diff --git a/src/tools/clangbackend/ipcsource/codecompletionsextractor.h b/src/tools/clangbackend/ipcsource/codecompletionsextractor.h index bc7015dcad..8a4c7c03ab 100644 --- a/src/tools/clangbackend/ipcsource/codecompletionsextractor.h +++ b/src/tools/clangbackend/ipcsource/codecompletionsextractor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_CODECOMPLETIONSEXTRACTOR_H -#define CLANGBACKEND_CODECOMPLETIONSEXTRACTOR_H +#pragma once #include <codecompletion.h> @@ -83,5 +82,3 @@ private: void PrintTo(const CodeCompletionsExtractor &extractor, ::std::ostream* os); #endif } // namespace ClangBackEnd - -#endif // CLANGBACKEND_CODECOMPLETIONSEXTRACTOR_H diff --git a/src/tools/clangbackend/ipcsource/commandlinearguments.h b/src/tools/clangbackend/ipcsource/commandlinearguments.h index 860e4f2f71..8e6f59191d 100644 --- a/src/tools/clangbackend/ipcsource/commandlinearguments.h +++ b/src/tools/clangbackend/ipcsource/commandlinearguments.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_COMMANDLINEARGUMENTS_H -#define CLANGBACKEND_COMMANDLINEARGUMENTS_H +#pragma once #include <utf8stringvector.h> @@ -51,5 +50,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_COMMANDLINEARGUMENTS_H diff --git a/src/tools/clangbackend/ipcsource/cursor.h b/src/tools/clangbackend/ipcsource/cursor.h index 426563255b..6711ab98d5 100644 --- a/src/tools/clangbackend/ipcsource/cursor.h +++ b/src/tools/clangbackend/ipcsource/cursor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_CURSOR_H -#define CLANGBACKEND_CURSOR_H +#pragma once #include "clangtype.h" @@ -119,6 +118,3 @@ bool operator==(const Cursor &first, const Cursor &second); void PrintTo(CXCursorKind cursorKind, ::std::ostream *os); void PrintTo(const Cursor &cursor, ::std::ostream* os); } // namespace ClangBackEnd - - -#endif // CLANGBACKEND_CURSOR_H diff --git a/src/tools/clangbackend/ipcsource/diagnostic.h b/src/tools/clangbackend/ipcsource/diagnostic.h index 76de4a3b81..64d4eff9b7 100644 --- a/src/tools/clangbackend/ipcsource/diagnostic.h +++ b/src/tools/clangbackend/ipcsource/diagnostic.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_DIAGNOSTIC_H -#define CLANGBACKEND_DIAGNOSTIC_H +#pragma once #include <clangbackendipc_global.h> @@ -88,5 +87,3 @@ inline bool operator==(Diagnostic first, Diagnostic second) } } // namespace ClangBackEnd - -#endif // CLANGBACKEND_DIAGNOSTIC_H diff --git a/src/tools/clangbackend/ipcsource/diagnosticset.h b/src/tools/clangbackend/ipcsource/diagnosticset.h index 2a66fa7eb5..e715ad2627 100644 --- a/src/tools/clangbackend/ipcsource/diagnosticset.h +++ b/src/tools/clangbackend/ipcsource/diagnosticset.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_DIAGNOSTICSET_H -#define CLANGBACKEND_DIAGNOSTICSET_H +#pragma once #include "diagnostic.h" #include "diagnosticsetiterator.h" @@ -80,5 +79,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_DIAGNOSTICSET_H diff --git a/src/tools/clangbackend/ipcsource/diagnosticsetiterator.h b/src/tools/clangbackend/ipcsource/diagnosticsetiterator.h index 0442cd0e43..7739dfd365 100644 --- a/src/tools/clangbackend/ipcsource/diagnosticsetiterator.h +++ b/src/tools/clangbackend/ipcsource/diagnosticsetiterator.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DIAGNOSTICSETITERATOR_H -#define DIAGNOSTICSETITERATOR_H +#pragma once #include <iterator> @@ -83,6 +82,3 @@ private: }; } - -#endif // DIAGNOSTICSETITERATOR_H - diff --git a/src/tools/clangbackend/ipcsource/fixit.h b/src/tools/clangbackend/ipcsource/fixit.h index 68e5d05a26..f866bc8c18 100644 --- a/src/tools/clangbackend/ipcsource/fixit.h +++ b/src/tools/clangbackend/ipcsource/fixit.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_FIXIT_H -#define CLANGBACKEND_FIXIT_H +#pragma once #include "sourcerange.h" @@ -56,5 +55,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_FIXIT_H diff --git a/src/tools/clangbackend/ipcsource/highlightinginformation.cpp b/src/tools/clangbackend/ipcsource/highlightingmark.cpp index 9fe288319f..18ceca9157 100644 --- a/src/tools/clangbackend/ipcsource/highlightinginformation.cpp +++ b/src/tools/clangbackend/ipcsource/highlightingmark.cpp @@ -27,7 +27,7 @@ #include "clangstring.h" #include "cursor.h" -#include "highlightinginformation.h" +#include "highlightingmark.h" #include "sourcelocation.h" #include "sourcerange.h" @@ -38,7 +38,7 @@ namespace ClangBackEnd { -HighlightingInformation::HighlightingInformation(const CXCursor &cxCursor, +HighlightingMark::HighlightingMark(const CXCursor &cxCursor, CXToken *cxToken, CXTranslationUnit cxTranslationUnit) { @@ -50,37 +50,58 @@ HighlightingInformation::HighlightingInformation(const CXCursor &cxCursor, line = start.line(); column = start.column(); length = end.offset() - start.offset(); - type = kind(cxToken, originalCursor); + collectKinds(cxToken, originalCursor); } -HighlightingInformation::HighlightingInformation(uint line, uint column, uint length, HighlightingType type) +HighlightingMark::HighlightingMark(uint line, uint column, uint length, HighlightingTypes types) : line(line), column(column), length(length), - type(type) + types(types) { } -bool HighlightingInformation::hasType(HighlightingType type) const +HighlightingMark::HighlightingMark(uint line, uint column, uint length, HighlightingType type) + : line(line), + column(column), + length(length), + types(HighlightingTypes()) { - return this->type == type; + types.mainHighlightingType = type; } -bool HighlightingInformation::hasFunctionArguments() const +bool HighlightingMark::hasInvalidMainType() const { - return originalCursor.argumentCount() > 0; + return types.mainHighlightingType == HighlightingType::Invalid; } -QVector<HighlightingInformation> HighlightingInformation::outputFunctionArguments() const +bool HighlightingMark::hasMainType(HighlightingType type) const { - QVector<HighlightingInformation> outputFunctionArguments; + return types.mainHighlightingType == type; +} + +bool HighlightingMark::hasMixinType(HighlightingType type) const +{ + auto found = std::find(types.mixinHighlightingTypes.begin(), + types.mixinHighlightingTypes.end(), + type); - return outputFunctionArguments; + return found != types.mixinHighlightingTypes.end(); } -HighlightingInformation::operator HighlightingMarkContainer() const +bool HighlightingMark::hasOnlyType(HighlightingType type) const { - return HighlightingMarkContainer(line, column, length, type); + return types.mixinHighlightingTypes.size() == 0 && hasMainType(type); +} + +bool HighlightingMark::hasFunctionArguments() const +{ + return originalCursor.argumentCount() > 0; +} + +HighlightingMark::operator HighlightingMarkContainer() const +{ + return HighlightingMarkContainer(line, column, length, types); } namespace { @@ -90,8 +111,8 @@ bool isFinalFunction(const Cursor &cursor) auto referencedCursor = cursor.referenced(); if (referencedCursor.hasFinalFunctionAttribute()) return true; - - else return false; + else + return false; } bool isFunctionInFinalClass(const Cursor &cursor) @@ -104,20 +125,19 @@ bool isFunctionInFinalClass(const Cursor &cursor) } } -HighlightingType HighlightingInformation::memberReferenceKind(const Cursor &cursor) const +void HighlightingMark::memberReferenceKind(const Cursor &cursor) { if (cursor.isDynamicCall()) { if (isFinalFunction(cursor) || isFunctionInFinalClass(cursor)) - return HighlightingType::Function; + types.mainHighlightingType = HighlightingType::Function; else - return HighlightingType::VirtualFunction; + types.mainHighlightingType = HighlightingType::VirtualFunction; + } else { + identifierKind(cursor.referenced(), Recursion::RecursivePass); } - - return identifierKind(cursor.referenced()); - } -HighlightingType HighlightingInformation::referencedTypeKind(const Cursor &cursor) const +void HighlightingMark::referencedTypeKind(const Cursor &cursor) { const Cursor referencedCursor = cursor.referenced(); @@ -128,22 +148,20 @@ HighlightingType HighlightingInformation::referencedTypeKind(const Cursor &curso case CXCursor_TypedefDecl: case CXCursor_TemplateTypeParameter: case CXCursor_TypeAliasDecl: - case CXCursor_EnumDecl: return HighlightingType::Type; - default: return HighlightingType::Invalid; + case CXCursor_EnumDecl: types.mainHighlightingType = HighlightingType::Type; break; + default: types.mainHighlightingType = HighlightingType::Invalid; break; } - - Q_UNREACHABLE(); } -HighlightingType HighlightingInformation::variableKind(const Cursor &cursor) const +void HighlightingMark::variableKind(const Cursor &cursor) { if (cursor.isLocalVariable()) - return HighlightingType::LocalVariable; + types.mainHighlightingType = HighlightingType::LocalVariable; else - return HighlightingType::GlobalVariable; + types.mainHighlightingType = HighlightingType::GlobalVariable; } -bool HighlightingInformation::isVirtualMethodDeclarationOrDefinition(const Cursor &cursor) const +bool HighlightingMark::isVirtualMethodDeclarationOrDefinition(const Cursor &cursor) const { return cursor.isVirtualMethod() && (originalCursor.isDeclaration() || originalCursor.isDefinition()); @@ -155,34 +173,41 @@ bool isNotFinalFunction(const Cursor &cursor) } } -bool HighlightingInformation::isRealDynamicCall(const Cursor &cursor) const +bool HighlightingMark::isRealDynamicCall(const Cursor &cursor) const { - return originalCursor.isDynamicCall() && isNotFinalFunction(cursor); } -HighlightingType HighlightingInformation::functionKind(const Cursor &cursor) const +void HighlightingMark::addExtraTypeIfFirstPass(HighlightingType type, + Recursion recursion) +{ + if (recursion == Recursion::FirstPass) + types.mixinHighlightingTypes.push_back(type); +} + +void HighlightingMark::functionKind(const Cursor &cursor, Recursion recursion) { if (isRealDynamicCall(cursor) || isVirtualMethodDeclarationOrDefinition(cursor)) - return HighlightingType::VirtualFunction; + types.mainHighlightingType = HighlightingType::VirtualFunction; else - return HighlightingType::Function; + types.mainHighlightingType = HighlightingType::Function; + + addExtraTypeIfFirstPass(HighlightingType::Declaration, recursion); } -HighlightingType HighlightingInformation::identifierKind(const Cursor &cursor) const +void HighlightingMark::identifierKind(const Cursor &cursor, Recursion recursion) { switch (cursor.kind()) { case CXCursor_Destructor: case CXCursor_Constructor: case CXCursor_FunctionDecl: case CXCursor_CallExpr: - case CXCursor_CXXMethod: return functionKind(cursor); + case CXCursor_CXXMethod: functionKind(cursor, recursion); break; case CXCursor_NonTypeTemplateParameter: - case CXCursor_ParmDecl: return HighlightingType::LocalVariable; - case CXCursor_VarDecl: return variableKind(cursor); - case CXCursor_VariableRef: - case CXCursor_DeclRefExpr: return identifierKind(cursor.referenced()); - case CXCursor_MemberRefExpr: return memberReferenceKind(cursor); + case CXCursor_ParmDecl: types.mainHighlightingType = HighlightingType::LocalVariable; break; + case CXCursor_VarDecl: variableKind(cursor); break; + case CXCursor_DeclRefExpr: identifierKind(cursor.referenced(), Recursion::RecursivePass); break; + case CXCursor_MemberRefExpr: memberReferenceKind(cursor); break; case CXCursor_FieldDecl: case CXCursor_MemberRef: case CXCursor_ObjCIvarDecl: @@ -190,8 +215,8 @@ HighlightingType HighlightingInformation::identifierKind(const Cursor &cursor) c case CXCursor_ObjCClassMethodDecl: case CXCursor_ObjCInstanceMethodDecl: case CXCursor_ObjCSynthesizeDecl: - case CXCursor_ObjCDynamicDecl: return HighlightingType::Field; - case CXCursor_TypeRef: return referencedTypeKind(cursor); + case CXCursor_ObjCDynamicDecl: types.mainHighlightingType = HighlightingType::Field; break; + case CXCursor_TypeRef: referencedTypeKind(cursor); break; case CXCursor_ClassDecl: case CXCursor_TemplateTypeParameter: case CXCursor_TemplateTemplateParameter: @@ -215,19 +240,17 @@ HighlightingType HighlightingInformation::identifierKind(const Cursor &cursor) c case CXCursor_ObjCProtocolDecl: case CXCursor_ObjCProtocolRef: case CXCursor_ObjCClassRef: - case CXCursor_ObjCSuperClassRef: return HighlightingType::Type; - case CXCursor_FunctionTemplate: return HighlightingType::Function; - case CXCursor_EnumConstantDecl: return HighlightingType::Enumeration; - case CXCursor_PreprocessingDirective: return HighlightingType::Preprocessor; - case CXCursor_MacroExpansion: return HighlightingType::PreprocessorExpansion; - case CXCursor_MacroDefinition: return HighlightingType::PreprocessorDefinition; - case CXCursor_InclusionDirective: return HighlightingType::StringLiteral; + case CXCursor_ObjCSuperClassRef: types.mainHighlightingType = HighlightingType::Type; break; + case CXCursor_FunctionTemplate: types.mainHighlightingType = HighlightingType::Function; break; + case CXCursor_EnumConstantDecl: types.mainHighlightingType = HighlightingType::Enumeration; break; + case CXCursor_PreprocessingDirective: types.mainHighlightingType = HighlightingType::Preprocessor; break; + case CXCursor_MacroExpansion: types.mainHighlightingType = HighlightingType::PreprocessorExpansion; break; + case CXCursor_MacroDefinition: types.mainHighlightingType = HighlightingType::PreprocessorDefinition; break; + case CXCursor_InclusionDirective: types.mainHighlightingType = HighlightingType::StringLiteral; break; case CXCursor_LabelRef: - case CXCursor_LabelStmt: return HighlightingType::Label; - default: return HighlightingType::Invalid; + case CXCursor_LabelStmt: types.mainHighlightingType = HighlightingType::Label; break; + default: break; } - - Q_UNREACHABLE(); } namespace { @@ -268,25 +291,25 @@ HighlightingType punctationKind(const Cursor &cursor) } } -HighlightingType HighlightingInformation::kind(CXToken *cxToken, const Cursor &cursor) const +void HighlightingMark::collectKinds(CXToken *cxToken, const Cursor &cursor) { auto cxTokenKind = clang_getTokenKind(*cxToken); + types = HighlightingTypes(); + switch (cxTokenKind) { - case CXToken_Keyword: return HighlightingType::Keyword; - case CXToken_Punctuation: return punctationKind(cursor); - case CXToken_Identifier: return identifierKind(cursor); - case CXToken_Comment: return HighlightingType::Comment; - case CXToken_Literal: return literalKind(cursor); + case CXToken_Keyword: types.mainHighlightingType = HighlightingType::Keyword; break; + case CXToken_Punctuation: types.mainHighlightingType = punctationKind(cursor); break; + case CXToken_Identifier: identifierKind(cursor, Recursion::FirstPass); break; + case CXToken_Comment: types.mainHighlightingType = HighlightingType::Comment; break; + case CXToken_Literal: types.mainHighlightingType = literalKind(cursor); break; } - - Q_UNREACHABLE(); } -void PrintTo(const HighlightingInformation &information, ::std::ostream *os) +void PrintTo(const HighlightingMark &information, ::std::ostream *os) { *os << "type: "; - PrintTo(information.type, os); + PrintTo(information.types, os); *os << " line: " << information.line << " column: " << information.column << " length: " << information.length; diff --git a/src/tools/clangbackend/ipcsource/highlightinginformation.h b/src/tools/clangbackend/ipcsource/highlightingmark.h index d943b8b54a..7f2009810b 100644 --- a/src/tools/clangbackend/ipcsource/highlightinginformation.h +++ b/src/tools/clangbackend/ipcsource/highlightingmark.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_HIGHLIGHTINGINFORMATION_H -#define CLANGBACKEND_HIGHLIGHTINGINFORMATION_H +#pragma once #include <clangbackendipc_global.h> #include <highlightingmarkcontainer.h> @@ -35,49 +34,56 @@ namespace ClangBackEnd { -class HighlightingInformation +class HighlightingMark { - friend bool operator==(const HighlightingInformation &first, const HighlightingInformation &second); - friend void PrintTo(const HighlightingInformation& highlightingInformation, ::std::ostream *os); + friend bool operator==(const HighlightingMark &first, const HighlightingMark &second); + friend void PrintTo(const HighlightingMark& highlightingMark, ::std::ostream *os); + + enum class Recursion { + FirstPass, + RecursivePass + }; public: - HighlightingInformation(const CXCursor &cxCursor, CXToken *cxToken, CXTranslationUnit cxTranslationUnit); - HighlightingInformation(uint line, uint column, uint length, HighlightingType type); + HighlightingMark(const CXCursor &cxCursor, CXToken *cxToken, CXTranslationUnit cxTranslationUnit); + HighlightingMark(uint line, uint column, uint length, HighlightingTypes types); + HighlightingMark(uint line, uint column, uint length, HighlightingType type); - bool hasType(HighlightingType type) const; + bool hasInvalidMainType() const; + bool hasMainType(HighlightingType type) const; + bool hasMixinType(HighlightingType type) const; + bool hasOnlyType(HighlightingType type) const; bool hasFunctionArguments() const; - QVector<HighlightingInformation> outputFunctionArguments() const; operator HighlightingMarkContainer() const; private: - HighlightingType identifierKind(const Cursor &cursor) const; - HighlightingType referencedTypeKind(const Cursor &cursor) const; - HighlightingType variableKind(const Cursor &cursor) const; + void identifierKind(const Cursor &cursor, Recursion recursion); + void referencedTypeKind(const Cursor &cursor); + void variableKind(const Cursor &cursor); bool isVirtualMethodDeclarationOrDefinition(const Cursor &cursor) const; - HighlightingType functionKind(const Cursor &cursor) const; - HighlightingType memberReferenceKind(const Cursor &cursor) const; - HighlightingType kind(CXToken *cxToken, const Cursor &cursor) const; + void functionKind(const Cursor &cursor, Recursion recursion); + void memberReferenceKind(const Cursor &cursor); + void collectKinds(CXToken *cxToken, const Cursor &cursor); bool isRealDynamicCall(const Cursor &cursor) const; + void addExtraTypeIfFirstPass(HighlightingType type, Recursion recursion); private: Cursor originalCursor; uint line; uint column; uint length; - HighlightingType type; + HighlightingTypes types; }; -void PrintTo(const HighlightingInformation& highlightingInformation, ::std::ostream *os); +void PrintTo(const HighlightingMark& highlightingMark, ::std::ostream *os); -inline bool operator==(const HighlightingInformation &first, const HighlightingInformation &second) +inline bool operator==(const HighlightingMark &first, const HighlightingMark &second) { return first.line == second.line && first.column == second.column && first.length == second.length - && first.type == second.type; + && first.types == second.types; } } // namespace ClangBackEnd - -#endif // CLANGBACKEND_HIGHLIGHTINGINFORMATION_H diff --git a/src/tools/clangbackend/ipcsource/highlightinginformations.cpp b/src/tools/clangbackend/ipcsource/highlightingmarks.cpp index 6878b3aee2..10cb2b5e82 100644 --- a/src/tools/clangbackend/ipcsource/highlightinginformations.cpp +++ b/src/tools/clangbackend/ipcsource/highlightingmarks.cpp @@ -23,7 +23,7 @@ ** ****************************************************************************/ -#include "highlightinginformations.h" +#include "highlightingmarks.h" #include "highlightingmarkcontainer.h" @@ -31,7 +31,7 @@ namespace ClangBackEnd { -HighlightingInformations::HighlightingInformations(CXTranslationUnit cxTranslationUnit, CXToken *tokens, uint tokensCount) +HighlightingMarks::HighlightingMarks(CXTranslationUnit cxTranslationUnit, CXToken *tokens, uint tokensCount) : cxTranslationUnit(cxTranslationUnit), cxToken(tokens), cxTokenCount(tokensCount) @@ -40,28 +40,31 @@ HighlightingInformations::HighlightingInformations(CXTranslationUnit cxTranslati clang_annotateTokens(cxTranslationUnit, cxToken, cxTokenCount, cxCursor.data()); } -HighlightingInformations::~HighlightingInformations() +HighlightingMarks::~HighlightingMarks() { clang_disposeTokens(cxTranslationUnit, cxToken, cxTokenCount); } -HighlightingInformations::const_iterator HighlightingInformations::begin() const +HighlightingMarks::const_iterator HighlightingMarks::begin() const { return const_iterator(cxCursor.cbegin(), cxToken, cxTranslationUnit); } -HighlightingInformations::const_iterator HighlightingInformations::end() const +HighlightingMarks::const_iterator HighlightingMarks::end() const { return const_iterator(cxCursor.cend(), cxToken + cxTokenCount, cxTranslationUnit); } -QVector<HighlightingMarkContainer> HighlightingInformations::toHighlightingMarksContainers() const +QVector<HighlightingMarkContainer> HighlightingMarks::toHighlightingMarksContainers() const { QVector<HighlightingMarkContainer> containers; containers.reserve(size()); - const auto isValidHighlightMark = [] (const HighlightingInformation &highlightMark) { - return !highlightMark.hasType(HighlightingType::Invalid); + const auto isValidHighlightMark = [] (const HighlightingMark &highlightMark) { + return !highlightMark.hasInvalidMainType() + && !highlightMark.hasMainType(HighlightingType::StringLiteral) + && !highlightMark.hasMainType(HighlightingType::NumberLiteral) + && !highlightMark.hasMainType(HighlightingType::Comment); }; std::copy_if(begin(), end(), std::back_inserter(containers), isValidHighlightMark); @@ -69,24 +72,24 @@ QVector<HighlightingMarkContainer> HighlightingInformations::toHighlightingMarks return containers; } -bool HighlightingInformations::isEmpty() const +bool HighlightingMarks::isEmpty() const { return cxTokenCount == 0; } -bool ClangBackEnd::HighlightingInformations::isNull() const +bool ClangBackEnd::HighlightingMarks::isNull() const { return cxToken == nullptr; } -uint HighlightingInformations::size() const +uint HighlightingMarks::size() const { return cxTokenCount; } -HighlightingInformation HighlightingInformations::operator[](size_t index) const +HighlightingMark HighlightingMarks::operator[](size_t index) const { - return HighlightingInformation(cxCursor[index], cxToken + index, cxTranslationUnit); + return HighlightingMark(cxCursor[index], cxToken + index, cxTranslationUnit); } } // namespace ClangBackEnd diff --git a/src/tools/clangbackend/ipcsource/highlightinginformations.h b/src/tools/clangbackend/ipcsource/highlightingmarks.h index 952a8ab3de..2d77bb86c5 100644 --- a/src/tools/clangbackend/ipcsource/highlightinginformations.h +++ b/src/tools/clangbackend/ipcsource/highlightingmarks.h @@ -23,10 +23,9 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_HIGHLIGHTINGINFORMATIONS_H -#define CLANGBACKEND_HIGHLIGHTINGINFORMATIONS_H +#pragma once -#include "highlightinginformationsiterator.h" +#include "highlightingmarksiterator.h" #include <clang-c/Index.h> @@ -37,22 +36,22 @@ namespace ClangBackEnd { using uint = unsigned int; class HighlightingMarkContainer; -class HighlightingInformations +class HighlightingMarks { public: - using const_iterator = HighlightingInformationsIterator; - using value_type = HighlightingInformation; + using const_iterator = HighlightingMarksIterator; + using value_type = HighlightingMark; public: - HighlightingInformations() = default; - HighlightingInformations(CXTranslationUnit cxTranslationUnit, CXToken *tokens, uint tokensCount); - ~HighlightingInformations(); + HighlightingMarks() = default; + HighlightingMarks(CXTranslationUnit cxTranslationUnit, CXToken *tokens, uint tokensCount); + ~HighlightingMarks(); bool isEmpty() const; bool isNull() const; uint size() const; - HighlightingInformation operator[](size_t index) const; + HighlightingMark operator[](size_t index) const; const_iterator begin() const; const_iterator end() const; @@ -68,5 +67,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_HIGHLIGHTINGINFORMATIONS_H diff --git a/src/tools/clangbackend/ipcsource/highlightinginformationsiterator.h b/src/tools/clangbackend/ipcsource/highlightingmarksiterator.h index 2979f30895..9cbfcabaad 100644 --- a/src/tools/clangbackend/ipcsource/highlightinginformationsiterator.h +++ b/src/tools/clangbackend/ipcsource/highlightingmarksiterator.h @@ -23,10 +23,9 @@ ** ****************************************************************************/ -#ifndef HIGHLIGHTINGINFORMATIONSITERATOR_H -#define HIGHLIGHTINGINFORMATIONSITERATOR_H +#pragma once -#include "highlightinginformation.h" +#include "highlightingmark.h" #include <iterator> #include <vector> @@ -40,10 +39,10 @@ using uint = unsigned int; class DiagnosticSet; class Diagnostic; -class HighlightingInformationsIterator : public std::iterator<std::forward_iterator_tag, HighlightingInformation, uint> +class HighlightingMarksIterator : public std::iterator<std::forward_iterator_tag, HighlightingMark, uint> { public: - HighlightingInformationsIterator(std::vector<CXCursor>::const_iterator cxCursorIterator, + HighlightingMarksIterator(std::vector<CXCursor>::const_iterator cxCursorIterator, CXToken *cxToken, CXTranslationUnit cxTranslationUnit) : cxCursorIterator(cxCursorIterator), @@ -51,7 +50,7 @@ public: cxTranslationUnit(cxTranslationUnit) {} - HighlightingInformationsIterator& operator++() + HighlightingMarksIterator& operator++() { ++cxCursorIterator; ++cxToken; @@ -59,24 +58,24 @@ public: return *this; } - HighlightingInformationsIterator operator++(int) + HighlightingMarksIterator operator++(int) { - return HighlightingInformationsIterator(cxCursorIterator++, cxToken++, cxTranslationUnit); + return HighlightingMarksIterator(cxCursorIterator++, cxToken++, cxTranslationUnit); } - bool operator==(HighlightingInformationsIterator other) const + bool operator==(HighlightingMarksIterator other) const { return cxCursorIterator == other.cxCursorIterator; } - bool operator!=(HighlightingInformationsIterator other) const + bool operator!=(HighlightingMarksIterator other) const { return cxCursorIterator != other.cxCursorIterator; } - HighlightingInformation operator*() + HighlightingMark operator*() { - return HighlightingInformation(*cxCursorIterator, cxToken, cxTranslationUnit); + return HighlightingMark(*cxCursorIterator, cxToken, cxTranslationUnit); } private: @@ -86,5 +85,3 @@ private: }; } // namespace ClangBackEnd - -#endif // HIGHLIGHTINGINFORMATIONSITERATOR_H diff --git a/src/tools/clangbackend/ipcsource/projectpart.h b/src/tools/clangbackend/ipcsource/projectpart.h index d6856f5c99..13cbbae248 100644 --- a/src/tools/clangbackend/ipcsource/projectpart.h +++ b/src/tools/clangbackend/ipcsource/projectpart.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_PROJECT_H -#define CLANGBACKEND_PROJECT_H +#pragma once #include <utf8string.h> @@ -79,5 +78,3 @@ private: bool operator==(const ProjectPart &first, const ProjectPart &second); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_PROJECT_H diff --git a/src/tools/clangbackend/ipcsource/projectpartsdonotexistexception.h b/src/tools/clangbackend/ipcsource/projectpartsdonotexistexception.h index 76de2310ab..2b5b108828 100644 --- a/src/tools/clangbackend/ipcsource/projectpartsdonotexistexception.h +++ b/src/tools/clangbackend/ipcsource/projectpartsdonotexistexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_PROJECTDONOTEXISTSEXCEPTION_H -#define CLANGBACKEND_PROJECTDONOTEXISTSEXCEPTION_H +#pragma once #include <utf8stringvector.h> @@ -53,5 +52,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_PROJECTDONOTEXISTSEXCEPTION_H diff --git a/src/tools/clangbackend/ipcsource/projects.h b/src/tools/clangbackend/ipcsource/projects.h index 29667c89c0..4354aebbeb 100644 --- a/src/tools/clangbackend/ipcsource/projects.h +++ b/src/tools/clangbackend/ipcsource/projects.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_PROJECTS_H -#define CLANGBACKEND_PROJECTS_H +#pragma once #include "projectpart.h" @@ -57,5 +56,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_PROJECTS_H diff --git a/src/tools/clangbackend/ipcsource/skippedsourceranges.h b/src/tools/clangbackend/ipcsource/skippedsourceranges.h index 222c2b9202..ddbf3e62b5 100644 --- a/src/tools/clangbackend/ipcsource/skippedsourceranges.h +++ b/src/tools/clangbackend/ipcsource/skippedsourceranges.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_SKIPPEDSOURCERANGES_H -#define CLANGBACKEND_SKIPPEDSOURCERANGES_H +#pragma once #include "sourcerange.h" @@ -55,5 +54,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_SKIPPEDSOURCERANGES_H diff --git a/src/tools/clangbackend/ipcsource/sourcelocation.h b/src/tools/clangbackend/ipcsource/sourcelocation.h index 0ce40f6c5f..2f278e8566 100644 --- a/src/tools/clangbackend/ipcsource/sourcelocation.h +++ b/src/tools/clangbackend/ipcsource/sourcelocation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_SOURCELOCATION_H -#define CLANGBACKEND_SOURCELOCATION_H +#pragma once #include <clang-c/Index.h> @@ -75,5 +74,3 @@ bool operator==(const SourceLocation &first, const SourceLocation &second); void PrintTo(const SourceLocation &sourceLocation, ::std::ostream* os); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_SOURCELOCATION_H diff --git a/src/tools/clangbackend/ipcsource/sourcerange.h b/src/tools/clangbackend/ipcsource/sourcerange.h index a2f65d178b..df5612004e 100644 --- a/src/tools/clangbackend/ipcsource/sourcerange.h +++ b/src/tools/clangbackend/ipcsource/sourcerange.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_SOURCERANGE_H -#define CLANGBACKEND_SOURCERANGE_H +#pragma once #include "sourcelocation.h" @@ -37,7 +36,6 @@ class SourceRange friend class Diagnostic; friend class FixIt; friend class Cursor; - friend class HighlightingInformation; friend bool operator==(const SourceRange &first, const SourceRange &second); public: @@ -63,5 +61,3 @@ private: bool operator==(const SourceRange &first, const SourceRange &second); void PrintTo(const SourceRange &sourceRange, ::std::ostream* os); } // namespace ClangBackEnd - -#endif // CLANGBACKEND_SOURCERANGE_H diff --git a/src/tools/clangbackend/ipcsource/translationunitalreadyexistsexception.h b/src/tools/clangbackend/ipcsource/translationunitalreadyexistsexception.h index 81055b8810..0db693dc0e 100644 --- a/src/tools/clangbackend/ipcsource/translationunitalreadyexistsexception.h +++ b/src/tools/clangbackend/ipcsource/translationunitalreadyexistsexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_TRANSLATIONUNITALREADYEXISTS_H -#define CLANGBACKEND_TRANSLATIONUNITALREADYEXISTS_H +#pragma once #include <filecontainer.h> @@ -52,5 +51,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_TRANSLATIONUNITALREADYEXISTS_H diff --git a/src/tools/clangbackend/ipcsource/translationunitdoesnotexistexception.h b/src/tools/clangbackend/ipcsource/translationunitdoesnotexistexception.h index 77f87dea93..f4943d9a1c 100644 --- a/src/tools/clangbackend/ipcsource/translationunitdoesnotexistexception.h +++ b/src/tools/clangbackend/ipcsource/translationunitdoesnotexistexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_TRANSLATIONUNITDONOTEXISTS_H -#define CLANGBACKEND_TRANSLATIONUNITDONOTEXISTS_H +#pragma once #include <filecontainer.h> @@ -52,5 +51,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_TRANSLATIONUNITDONOTEXISTS_H diff --git a/src/tools/clangbackend/ipcsource/translationunitfilenotexitexception.h b/src/tools/clangbackend/ipcsource/translationunitfilenotexitexception.h index a351b5b512..9081f3757e 100644 --- a/src/tools/clangbackend/ipcsource/translationunitfilenotexitexception.h +++ b/src/tools/clangbackend/ipcsource/translationunitfilenotexitexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_TRANSLATIONUNITFILENOTEXITS_H -#define CLANGBACKEND_TRANSLATIONUNITFILENOTEXITS_H +#pragma once #include <utf8string.h> @@ -53,5 +52,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_TRANSLATIONUNITFILENOTEXITS_H diff --git a/src/tools/clangbackend/ipcsource/translationunitisnullexception.h b/src/tools/clangbackend/ipcsource/translationunitisnullexception.h index 6e68db62b6..c64c53369e 100644 --- a/src/tools/clangbackend/ipcsource/translationunitisnullexception.h +++ b/src/tools/clangbackend/ipcsource/translationunitisnullexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_TRANSLATIONUNITISNULLEXCEPTION_H -#define CLANGBACKEND_TRANSLATIONUNITISNULLEXCEPTION_H +#pragma once #include <QtGlobal> @@ -45,5 +44,3 @@ public: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_TRANSLATIONUNITISNULLEXCEPTION_H diff --git a/src/tools/clangbackend/ipcsource/translationunitparseerrorexception.h b/src/tools/clangbackend/ipcsource/translationunitparseerrorexception.h index 8175fa7454..13b31e9c7d 100644 --- a/src/tools/clangbackend/ipcsource/translationunitparseerrorexception.h +++ b/src/tools/clangbackend/ipcsource/translationunitparseerrorexception.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_TRANSLATIONUNITPARSEERROREXCEPTION_H -#define CLANGBACKEND_TRANSLATIONUNITPARSEERROREXCEPTION_H +#pragma once #include <utf8string.h> @@ -55,5 +54,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_TRANSLATIONUNITPARSEERROREXCEPTION_H diff --git a/src/tools/clangbackend/ipcsource/translationunits.cpp b/src/tools/clangbackend/ipcsource/translationunits.cpp index 5b118a9652..1f08b448d8 100644 --- a/src/tools/clangbackend/ipcsource/translationunits.cpp +++ b/src/tools/clangbackend/ipcsource/translationunits.cpp @@ -28,7 +28,7 @@ #include <diagnosticschangedmessage.h> #include <diagnosticset.h> #include <highlightingchangedmessage.h> -#include <highlightinginformations.h> +#include <highlightingmarks.h> #include <projectpartsdonotexistexception.h> #include <projects.h> #include <skippedsourceranges.h> @@ -199,7 +199,7 @@ namespace { bool translationUnitHasNewDocumentAnnotations(const TranslationUnit &translationUnit) { - return translationUnit.hasNewDiagnostics() || translationUnit.hasNewHighlightingInformations(); + return translationUnit.hasNewDiagnostics() || translationUnit.hasNewHighlightingMarks(); } } @@ -365,11 +365,11 @@ void TranslationUnits::sendDocumentAnnotations(const TranslationUnit &translatio DiagnosticsChangedMessage diagnosticsMessage(fileContainer, translationUnit.mainFileDiagnostics()); HighlightingChangedMessage highlightingsMessage(fileContainer, - translationUnit.highlightingInformations().toHighlightingMarksContainers(), + translationUnit.highlightingMarks().toHighlightingMarksContainers(), translationUnit.skippedSourceRanges().toSourceRangeContainers()); sendDocumentAnnotationsCallback(std::move(diagnosticsMessage), - std::move(highlightingsMessage)); + std::move(highlightingsMessage)); } } diff --git a/src/tools/clangbackend/ipcsource/translationunits.h b/src/tools/clangbackend/ipcsource/translationunits.h index ef80e05371..d30ca98250 100644 --- a/src/tools/clangbackend/ipcsource/translationunits.h +++ b/src/tools/clangbackend/ipcsource/translationunits.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_TRANSLATIONUNITS_H -#define CLANGBACKEND_TRANSLATIONUNITS_H +#pragma once #include "clangfilesystemwatcher.h" #include "clangtranslationunit.h" @@ -119,5 +118,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_TRANSLATIONUNITS_H diff --git a/src/tools/clangbackend/ipcsource/unsavedfiles.h b/src/tools/clangbackend/ipcsource/unsavedfiles.h index f5617df9b8..270f4aa386 100644 --- a/src/tools/clangbackend/ipcsource/unsavedfiles.h +++ b/src/tools/clangbackend/ipcsource/unsavedfiles.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_UNSAVEDFILES_H -#define CLANGBACKEND_UNSAVEDFILES_H +#pragma once #include <filecontainer.h> @@ -76,5 +75,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_UNSAVEDFILES_H diff --git a/src/tools/cplusplus-shared/utils.h b/src/tools/cplusplus-shared/utils.h index 21dee5d53d..48131cf5c6 100644 --- a/src/tools/cplusplus-shared/utils.h +++ b/src/tools/cplusplus-shared/utils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUSTOOLSUTILS_H -#define CPLUSPLUSTOOLSUTILS_H +#pragma once #include <QString> #include <QStringList> @@ -53,5 +52,3 @@ private: }; } // namespace - -#endif // CPLUSPLUSTOOLSUTILS_H diff --git a/src/tools/cplusplustools.qbs b/src/tools/cplusplustools.qbs index b3e61cf9de..d67d558330 100644 --- a/src/tools/cplusplustools.qbs +++ b/src/tools/cplusplustools.qbs @@ -1,6 +1,9 @@ +import qbs +import qbs.Environment + Project { name: "CPlusPlus Tools" - condition: qbs.getEnv("BUILD_CPLUSPLUS_TOOLS") + condition: Environment.getEnv("BUILD_CPLUSPLUS_TOOLS") references: [ "3rdparty/cplusplus-keywordgen/cplusplus-keywordgen.qbs", "cplusplus-ast2png/cplusplus-ast2png.qbs", diff --git a/src/tools/iostool/iosdevicemanager.h b/src/tools/iostool/iosdevicemanager.h index ddf6b01db1..214415adc4 100644 --- a/src/tools/iostool/iosdevicemanager.h +++ b/src/tools/iostool/iosdevicemanager.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef IOSMANAGER_H -#define IOSMANAGER_H +#pragma once #include <QObject> #include <QString> @@ -105,5 +104,3 @@ public: }; } // namespace Ios - -#endif // IOSMANAGER_H diff --git a/src/tools/qtcreatorcrashhandler/backtracecollector.h b/src/tools/qtcreatorcrashhandler/backtracecollector.h index bf6a42f051..1fdb1eb2df 100644 --- a/src/tools/qtcreatorcrashhandler/backtracecollector.h +++ b/src/tools/qtcreatorcrashhandler/backtracecollector.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef BACKTRACECOLLECTOR_H -#define BACKTRACECOLLECTOR_H +#pragma once #include <QProcess> @@ -56,5 +55,3 @@ private: BacktraceCollectorPrivate *d; }; - -#endif // BACKTRACECOLLECTOR_H diff --git a/src/tools/qtcreatorcrashhandler/crashhandler.h b/src/tools/qtcreatorcrashhandler/crashhandler.h index 8fc3a7ae3b..b46468451f 100644 --- a/src/tools/qtcreatorcrashhandler/crashhandler.h +++ b/src/tools/qtcreatorcrashhandler/crashhandler.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CRASHHANDLER_H -#define CRASHHANDLER_H +#pragma once #include <QObject> @@ -61,5 +60,3 @@ private: CrashHandlerPrivate *d; }; - -#endif // CRASHHANDLER_H diff --git a/src/tools/qtcreatorcrashhandler/crashhandlerdialog.h b/src/tools/qtcreatorcrashhandler/crashhandlerdialog.h index 2307c8a5e9..3bcc2672c5 100644 --- a/src/tools/qtcreatorcrashhandler/crashhandlerdialog.h +++ b/src/tools/qtcreatorcrashhandler/crashhandlerdialog.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CRASHHANDLERDIALOG_H -#define CRASHHANDLERDIALOG_H +#pragma once #include <QDialog> @@ -61,5 +60,3 @@ private: CrashHandler *m_crashHandler; Ui::CrashHandlerDialog *m_ui; }; - -#endif // CRASHHANDLERDIALOG_H diff --git a/src/tools/qtcreatorcrashhandler/crashhandlersetup.h b/src/tools/qtcreatorcrashhandler/crashhandlersetup.h index b37ba599f5..4236bb534d 100644 --- a/src/tools/qtcreatorcrashhandler/crashhandlersetup.h +++ b/src/tools/qtcreatorcrashhandler/crashhandlersetup.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CRASHHANDLERSETUP_H -#define CRASHHANDLERSETUP_H +#pragma once class CrashHandlerSetup { @@ -32,5 +31,3 @@ public: CrashHandlerSetup(); ~CrashHandlerSetup(); }; - -#endif // CRASHHANDLERSETUP_H diff --git a/src/tools/qtcreatorcrashhandler/utils.h b/src/tools/qtcreatorcrashhandler/utils.h index 5defc09b2e..60c2a39f91 100644 --- a/src/tools/qtcreatorcrashhandler/utils.h +++ b/src/tools/qtcreatorcrashhandler/utils.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef UTILS_H -#define UTILS_H +#pragma once #include <QByteArray> #include <QString> @@ -33,5 +32,3 @@ const char APPLICATION_NAME[] = "Qt Creator Crash Handler"; const char URL_BUGTRACKER[] = "https://bugreports.qt.io/"; QByteArray fileContents(const QString &filePath); - -#endif // UTILS_H diff --git a/src/tools/qtcreatorwidgets/customwidgets.h b/src/tools/qtcreatorwidgets/customwidgets.h index d6d2f5d8b8..496e8cbc54 100644 --- a/src/tools/qtcreatorwidgets/customwidgets.h +++ b/src/tools/qtcreatorwidgets/customwidgets.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CUSTOMWIDGETS_H -#define CUSTOMWIDGETS_H +#pragma once #include "customwidget.h" @@ -289,5 +288,3 @@ public: private: QList<QDesignerCustomWidgetInterface*> m_plugins; }; - -#endif // CUSTOMWIDGETS_H diff --git a/src/tools/screenshotcropper/cropimageview.h b/src/tools/screenshotcropper/cropimageview.h index f0da57e8d8..c95bc5bc77 100644 --- a/src/tools/screenshotcropper/cropimageview.h +++ b/src/tools/screenshotcropper/cropimageview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CROPIMAGEVIEW_H -#define CROPIMAGEVIEW_H +#pragma once #include <QWidget> @@ -51,5 +50,3 @@ private: QImage m_image; QRect m_area; }; - -#endif // CROPIMAGEVIEW_H diff --git a/src/tools/screenshotcropper/screenshotcropperwindow.h b/src/tools/screenshotcropper/screenshotcropperwindow.h index 715adac49f..98813a77c3 100644 --- a/src/tools/screenshotcropper/screenshotcropperwindow.h +++ b/src/tools/screenshotcropper/screenshotcropperwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SCREENSHOTCROPPERWINDOW_H -#define SCREENSHOTCROPPERWINDOW_H +#pragma once #include <QMainWindow> #include "screenshotcropper.h" @@ -54,5 +53,3 @@ private: QString m_imagesFolder; Ui::ScreenShotCropperWindow *ui; }; - -#endif // SCREENSHOTCROPPERWINDOW_H diff --git a/src/tools/sdktool/adddebuggeroperation.h b/src/tools/sdktool/adddebuggeroperation.h index b1c6313482..32e8369d64 100644 --- a/src/tools/sdktool/adddebuggeroperation.h +++ b/src/tools/sdktool/adddebuggeroperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDDEBUGGEROPERATION_H -#define ADDDEBUGGEROPERATION_H +#pragma once #include "operation.h" @@ -62,5 +61,3 @@ private: QStringList m_abis; KeyValuePairList m_extra; }; - -#endif // ADDDEBUGGEROPERATION_H diff --git a/src/tools/sdktool/adddeviceoperation.h b/src/tools/sdktool/adddeviceoperation.h index e32dd7feb5..207407aed2 100644 --- a/src/tools/sdktool/adddeviceoperation.h +++ b/src/tools/sdktool/adddeviceoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDDEVICEOPERATION_H -#define ADDDEVICEOPERATION_H +#pragma once #include "operation.h" @@ -95,5 +94,3 @@ private: int m_version; KeyValuePairList m_extra; }; - -#endif // ADDDEVICEOPERATION_H diff --git a/src/tools/sdktool/addkeysoperation.h b/src/tools/sdktool/addkeysoperation.h index 46f7760d16..40483befd1 100644 --- a/src/tools/sdktool/addkeysoperation.h +++ b/src/tools/sdktool/addkeysoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDKEYSOPERATION_H -#define ADDKEYSOPERATION_H +#pragma once #include "operation.h" @@ -50,5 +49,3 @@ private: QList<KeyValuePair> m_data; }; - -#endif // ADDKEYSOPERATION_H diff --git a/src/tools/sdktool/addkitoperation.h b/src/tools/sdktool/addkitoperation.h index 4a90cc6f03..1c14c11e0c 100644 --- a/src/tools/sdktool/addkitoperation.h +++ b/src/tools/sdktool/addkitoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDKITOPERATION_H -#define ADDKITOPERATION_H +#pragma once #include "operation.h" @@ -82,5 +81,3 @@ private: QStringList m_env; KeyValuePairList m_extra; }; - -#endif // ADDKITOPERATION_H diff --git a/src/tools/sdktool/addqtoperation.h b/src/tools/sdktool/addqtoperation.h index f07a1ecaba..2712556767 100644 --- a/src/tools/sdktool/addqtoperation.h +++ b/src/tools/sdktool/addqtoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDQTOPERATION_H -#define ADDQTOPERATION_H +#pragma once #include "operation.h" @@ -61,5 +60,3 @@ private: QString m_qmake; KeyValuePairList m_extra; }; - -#endif // ADDQTOPERATION_H diff --git a/src/tools/sdktool/addtoolchainoperation.h b/src/tools/sdktool/addtoolchainoperation.h index 588a186413..2f642c87f6 100644 --- a/src/tools/sdktool/addtoolchainoperation.h +++ b/src/tools/sdktool/addtoolchainoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ADDTOOLCHAINOPERATION_H -#define ADDTOOLCHAINOPERATION_H +#pragma once #include "operation.h" @@ -63,5 +62,3 @@ private: QString m_supportedAbis; KeyValuePairList m_extra; }; - -#endif // ADDTOOLCHAINOPERATION_H diff --git a/src/tools/sdktool/findkeyoperation.h b/src/tools/sdktool/findkeyoperation.h index be656cf452..f6365c7ebd 100644 --- a/src/tools/sdktool/findkeyoperation.h +++ b/src/tools/sdktool/findkeyoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDKEYOPERATION_H -#define FINDKEYOPERATION_H +#pragma once #include "operation.h" @@ -50,5 +49,3 @@ private: QString m_file; QStringList m_keys; }; - -#endif // FINDKEYOPERATION_H diff --git a/src/tools/sdktool/findvalueoperation.h b/src/tools/sdktool/findvalueoperation.h index ae02a6580f..2d49678b66 100644 --- a/src/tools/sdktool/findvalueoperation.h +++ b/src/tools/sdktool/findvalueoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FINDVALUEOPERATION_H -#define FINDVALUEOPERATION_H +#pragma once #include "operation.h" @@ -50,5 +49,3 @@ private: QString m_file; QVariantList m_values; }; - -#endif // FINDVALUEOPERATION_H diff --git a/src/tools/sdktool/getoperation.h b/src/tools/sdktool/getoperation.h index 4fe475e455..6d9b018ad0 100644 --- a/src/tools/sdktool/getoperation.h +++ b/src/tools/sdktool/getoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef GETOPERATION_H -#define GETOPERATION_H +#pragma once #include "operation.h" @@ -49,5 +48,3 @@ private: QStringList m_keys; QString m_file; }; - -#endif // GETOPERATION_H diff --git a/src/tools/sdktool/operation.h b/src/tools/sdktool/operation.h index 7f51f08978..ad2062cf8f 100644 --- a/src/tools/sdktool/operation.h +++ b/src/tools/sdktool/operation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef OPERATION_H -#define OPERATION_H +#pragma once #include <utils/fileutils.h> @@ -66,5 +65,3 @@ public: static QVariant valueFromString(const QString &v); static QString makeUnique(const QString &name, const QStringList &inUse); }; - -#endif // OPERATION_H diff --git a/src/tools/sdktool/rmdebuggeroperation.h b/src/tools/sdktool/rmdebuggeroperation.h index 6d7d108f95..58c086849b 100644 --- a/src/tools/sdktool/rmdebuggeroperation.h +++ b/src/tools/sdktool/rmdebuggeroperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RMDEBUGGEROPERATION_H -#define RMDEBUGGEROPERATION_H +#pragma once #include "operation.h" @@ -50,5 +49,3 @@ public: private: QString m_id; }; - -#endif // RMDEBUGGEROPERATION_H diff --git a/src/tools/sdktool/rmdeviceoperation.h b/src/tools/sdktool/rmdeviceoperation.h index 7aa76b1214..f5f711b5f5 100644 --- a/src/tools/sdktool/rmdeviceoperation.h +++ b/src/tools/sdktool/rmdeviceoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RMDEVICEOPERATION_H -#define RMDEVICEOPERATION_H +#pragma once #include "operation.h" @@ -50,5 +49,3 @@ public: private: QString m_id; }; - -#endif // RMDEVICEOPERATION_H diff --git a/src/tools/sdktool/rmkeysoperation.h b/src/tools/sdktool/rmkeysoperation.h index dd6eda6a3b..d83c1860d5 100644 --- a/src/tools/sdktool/rmkeysoperation.h +++ b/src/tools/sdktool/rmkeysoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RMKEYSOPERATION_H -#define RMKEYSOPERATION_H +#pragma once #include "operation.h" @@ -49,5 +48,3 @@ private: QStringList m_keys; QString m_file; }; - -#endif // RMKEYSOPERATION_H diff --git a/src/tools/sdktool/rmkitoperation.h b/src/tools/sdktool/rmkitoperation.h index 5d08cffe8a..75fb4cf527 100644 --- a/src/tools/sdktool/rmkitoperation.h +++ b/src/tools/sdktool/rmkitoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RMKITOPERATION_H -#define RMKITOPERATION_H +#pragma once #include "operation.h" @@ -50,5 +49,3 @@ public: private: QString m_id; }; - -#endif // RMKITOPERATION_H diff --git a/src/tools/sdktool/rmqtoperation.h b/src/tools/sdktool/rmqtoperation.h index a4625be1ba..36ff9cee96 100644 --- a/src/tools/sdktool/rmqtoperation.h +++ b/src/tools/sdktool/rmqtoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RMQTOPERATION_H -#define RMQTOPERATION_H +#pragma once #include "operation.h" @@ -50,5 +49,3 @@ public: private: QString m_id; }; - -#endif // RMQTOPERATION_H diff --git a/src/tools/sdktool/rmtoolchainoperation.h b/src/tools/sdktool/rmtoolchainoperation.h index 302d7deaf4..3755320710 100644 --- a/src/tools/sdktool/rmtoolchainoperation.h +++ b/src/tools/sdktool/rmtoolchainoperation.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef RMTOOLCHAINOPERATION_H -#define RMTOOLCHAINOPERATION_H +#pragma once #include "operation.h" @@ -50,5 +49,3 @@ public: private: QString m_id; }; - -#endif // RMTOOLCHAINOPERATION_H diff --git a/src/tools/sdktool/settings.h b/src/tools/sdktool/settings.h index 1da043817d..dbf3481c26 100644 --- a/src/tools/sdktool/settings.h +++ b/src/tools/sdktool/settings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SETTINGS_H -#define SETTINGS_H +#pragma once #include <utils/fileutils.h> @@ -47,5 +46,3 @@ public: private: static Settings *m_instance; }; - -#endif // SETTINGS_H diff --git a/src/tools/valgrindfake/outputgenerator.h b/src/tools/valgrindfake/outputgenerator.h index 1f5fd034e8..f4cba94289 100644 --- a/src/tools/valgrindfake/outputgenerator.h +++ b/src/tools/valgrindfake/outputgenerator.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef LIBVALGRIND_FAKE_OUTPUTGENERATOR_H -#define LIBVALGRIND_FAKE_OUTPUTGENERATOR_H +#pragma once #include <QObject> #include <QTimer> @@ -71,5 +70,3 @@ private: } // namespace Fake } // namespace Valgrind - -#endif // LIBVALGRIND_FAKE_OUTPUTGENERATOR_H diff --git a/tests/auto/cplusplus/cplusplus_global.h b/tests/auto/cplusplus/cplusplus_global.h index 5d911fe132..42a0bef1ad 100644 --- a/tests/auto/cplusplus/cplusplus_global.h +++ b/tests/auto/cplusplus/cplusplus_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CPLUSPLUS_GLOBAL_H -#define CPLUSPLUS_GLOBAL_H +#pragma once // // The following "non-latin1" code points are used in the tests: @@ -38,5 +37,3 @@ #define UC_U4E8C "\xe4\xba\x8c" #define UC_U10302 "\xf0\x90\x8c\x82" #define TEST_UNICODE_IDENTIFIER UC_U00FC UC_U4E8C UC_U10302 - -#endif // CPLUSPLUS_GLOBAL_H diff --git a/tests/auto/debugger/dumpers.pro b/tests/auto/debugger/dumpers.pro index 3a44baea6d..1ecbba6ba5 100644 --- a/tests/auto/debugger/dumpers.pro +++ b/tests/auto/debugger/dumpers.pro @@ -39,7 +39,6 @@ HEADERS += \ } INCLUDEPATH += $$DEBUGGERDIR -DEFINES += QT_NO_CAST_FROM_ASCII # clang 3.5 does not like to optimize long functions. clang: QMAKE_CXXFLAGS_RELEASE = diff --git a/tests/auto/debugger/dumpers.qbs b/tests/auto/debugger/dumpers.qbs index 050a44881f..7138b314c1 100644 --- a/tests/auto/debugger/dumpers.qbs +++ b/tests/auto/debugger/dumpers.qbs @@ -26,7 +26,6 @@ QtcAutotest { cpp.defines: base.concat([ 'CDBEXT_PATH="' + project.buildDirectory + '\\\\lib"', 'DUMPERDIR="' + path + '/../../../share/qtcreator/debugger"', - 'QT_NO_CAST_FROM_ASCII', ]) cpp.includePaths: base.concat([project.debuggerDir]) } diff --git a/tests/auto/extensionsystem/pluginmanager/circularplugins/plugin1/plugin1.h b/tests/auto/extensionsystem/pluginmanager/circularplugins/plugin1/plugin1.h index 82e515b946..556fc0ba6f 100644 --- a/tests/auto/extensionsystem/pluginmanager/circularplugins/plugin1/plugin1.h +++ b/tests/auto/extensionsystem/pluginmanager/circularplugins/plugin1/plugin1.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGIN1_H -#define PLUGIN1_H +#pragma once #include <extensionsystem/iplugin.h> @@ -52,5 +51,3 @@ public: }; } // namespace Plugin1 - -#endif // PLUGIN1_H diff --git a/tests/auto/extensionsystem/pluginmanager/circularplugins/plugin2/plugin2.h b/tests/auto/extensionsystem/pluginmanager/circularplugins/plugin2/plugin2.h index 04c3644900..e5e38e3300 100644 --- a/tests/auto/extensionsystem/pluginmanager/circularplugins/plugin2/plugin2.h +++ b/tests/auto/extensionsystem/pluginmanager/circularplugins/plugin2/plugin2.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGIN2_H -#define PLUGIN2_H +#pragma once #include <extensionsystem/iplugin.h> @@ -52,5 +51,3 @@ public: }; } // Plugin2 - -#endif // PLUGIN2_H diff --git a/tests/auto/extensionsystem/pluginmanager/circularplugins/plugin3/plugin3.h b/tests/auto/extensionsystem/pluginmanager/circularplugins/plugin3/plugin3.h index 36e743d87b..c1ba2d3c93 100644 --- a/tests/auto/extensionsystem/pluginmanager/circularplugins/plugin3/plugin3.h +++ b/tests/auto/extensionsystem/pluginmanager/circularplugins/plugin3/plugin3.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGIN3_H -#define PLUGIN3_H +#pragma once #include <extensionsystem/iplugin.h> @@ -52,5 +51,3 @@ public: }; } // namespace Plugin3 - -#endif // PLUGIN3_H diff --git a/tests/auto/extensionsystem/pluginmanager/correctplugins1/plugin1/plugin1.h b/tests/auto/extensionsystem/pluginmanager/correctplugins1/plugin1/plugin1.h index e911f3d420..6a0d4c7f09 100644 --- a/tests/auto/extensionsystem/pluginmanager/correctplugins1/plugin1/plugin1.h +++ b/tests/auto/extensionsystem/pluginmanager/correctplugins1/plugin1/plugin1.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGIN1_H -#define PLUGIN1_H +#pragma once #include <extensionsystem/iplugin.h> @@ -55,5 +54,3 @@ private: }; } // namespace Plugin1 - -#endif // PLUGIN1_H diff --git a/tests/auto/extensionsystem/pluginmanager/correctplugins1/plugin2/plugin2.h b/tests/auto/extensionsystem/pluginmanager/correctplugins1/plugin2/plugin2.h index 2068170b6a..1a5ff1eb5c 100644 --- a/tests/auto/extensionsystem/pluginmanager/correctplugins1/plugin2/plugin2.h +++ b/tests/auto/extensionsystem/pluginmanager/correctplugins1/plugin2/plugin2.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGIN2_H -#define PLUGIN2_H +#pragma once #include <extensionsystem/iplugin.h> @@ -55,5 +54,3 @@ private: }; } // namespace Plugin2 - -#endif // PLUGIN2_H diff --git a/tests/auto/extensionsystem/pluginmanager/correctplugins1/plugin3/plugin3.h b/tests/auto/extensionsystem/pluginmanager/correctplugins1/plugin3/plugin3.h index 4739ebb997..a8bfb4e7b6 100644 --- a/tests/auto/extensionsystem/pluginmanager/correctplugins1/plugin3/plugin3.h +++ b/tests/auto/extensionsystem/pluginmanager/correctplugins1/plugin3/plugin3.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PLUGIN3_H -#define PLUGIN3_H +#pragma once #include <extensionsystem/iplugin.h> @@ -55,5 +54,3 @@ private: }; } // namespace Plugin3 - -#endif // PLUGIN3_H diff --git a/tests/auto/extensionsystem/pluginspec/testplugin/testplugin.h b/tests/auto/extensionsystem/pluginspec/testplugin/testplugin.h index 9a5913edba..cc88e8a8d0 100644 --- a/tests/auto/extensionsystem/pluginspec/testplugin/testplugin.h +++ b/tests/auto/extensionsystem/pluginspec/testplugin/testplugin.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTPLUGIN_H -#define TESTPLUGIN_H +#pragma once #include "testplugin_global.h" #include <extensionsystem/iplugin.h> @@ -54,5 +53,3 @@ private: }; } // namespace - -#endif // TESTPLUGIN_H diff --git a/tests/auto/extensionsystem/pluginspec/testplugin/testplugin_global.h b/tests/auto/extensionsystem/pluginspec/testplugin/testplugin_global.h index 0bd78078b6..c693b51975 100644 --- a/tests/auto/extensionsystem/pluginspec/testplugin/testplugin_global.h +++ b/tests/auto/extensionsystem/pluginspec/testplugin/testplugin_global.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTPLUGIN_GLOBAL_H -#define TESTPLUGIN_GLOBAL_H +#pragma once #include <qglobal.h> @@ -33,5 +32,3 @@ #else # define MYPLUGIN_EXPORT Q_DECL_IMPORT #endif - -#endif // TESTPLUGIN_GLOBAL_H diff --git a/tests/auto/generichighlighter/highlighterengine/formats.h b/tests/auto/generichighlighter/highlighterengine/formats.h index b84dec4c69..11c3916a8b 100644 --- a/tests/auto/generichighlighter/highlighterengine/formats.h +++ b/tests/auto/generichighlighter/highlighterengine/formats.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef FORMATS_H -#define FORMATS_H +#pragma once #include <QTextCharFormat> @@ -67,5 +66,3 @@ private: QTextCharFormat m_regionMarkerFormat; QTextCharFormat m_othersFormat; }; - -#endif // FORMATS_H diff --git a/tests/auto/generichighlighter/highlighterengine/highlightermock.h b/tests/auto/generichighlighter/highlighterengine/highlightermock.h index 9cc35226a6..09cfcef5bb 100644 --- a/tests/auto/generichighlighter/highlighterengine/highlightermock.h +++ b/tests/auto/generichighlighter/highlighterengine/highlightermock.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HIGHLIGHTERMOCK_H -#define HIGHLIGHTERMOCK_H +#pragma once #include <texteditor/generichighlighter/highlighter.h> @@ -76,5 +75,3 @@ private: bool m_noTestCall; bool m_considerEmptyLines; }; - -#endif // HIGHLIGHTERMOCK_H diff --git a/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h b/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h index e6c6950595..45122612c8 100644 --- a/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h +++ b/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SYNTAXHIGHLIGHTER_H -#define SYNTAXHIGHLIGHTER_H +#pragma once // Replaces the "real" syntaxhighlighter.h file. The scope of this test is restricted to the // highlight definition's context engine. Using a mock derived from QSyntaxHighlighter as a @@ -51,5 +50,3 @@ protected: }; } - -#endif //SYNTAXHIGHLIGHTER_H diff --git a/tests/auto/generichighlighter/highlighterengine/tabsettings.h b/tests/auto/generichighlighter/highlighterengine/tabsettings.h index 69496e6891..968946be54 100644 --- a/tests/auto/generichighlighter/highlighterengine/tabsettings.h +++ b/tests/auto/generichighlighter/highlighterengine/tabsettings.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TABSETTINGS_H -#define TABSETTINGS_H +#pragma once #include <QString> @@ -39,5 +38,3 @@ public: }; } - -#endif // TABSETTINGS_H diff --git a/tests/auto/generichighlighter/highlighterengine/textdocumentlayout.h b/tests/auto/generichighlighter/highlighterengine/textdocumentlayout.h index a9a7c3f599..c53dd72ede 100644 --- a/tests/auto/generichighlighter/highlighterengine/textdocumentlayout.h +++ b/tests/auto/generichighlighter/highlighterengine/textdocumentlayout.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTDOCUMENTLAYOUT_H -#define TEXTDOCUMENTLAYOUT_H +#pragma once #include <QTextBlockUserData> @@ -66,5 +65,3 @@ void setParentheses(const QTextBlock &, const Parentheses &); } } // namespace TextEditor - -#endif // TEXTDOCUMENTLAYOUT_H diff --git a/tests/auto/mapreduce/tst_mapreduce.cpp b/tests/auto/mapreduce/tst_mapreduce.cpp index f20f422202..832715659f 100644 --- a/tests/auto/mapreduce/tst_mapreduce.cpp +++ b/tests/auto/mapreduce/tst_mapreduce.cpp @@ -28,6 +28,10 @@ #include <QtTest> +#if !defined(Q_CC_MSVC) || _MSC_VER >= 1900 // MSVC2015 +#define SUPPORTS_MOVE +#endif + class tst_MapReduce : public QObject { Q_OBJECT @@ -36,6 +40,10 @@ private slots: void mapReduce(); void mapReduceRvalueContainer(); void map(); + void orderedMapReduce(); +#ifdef SUPPORTS_MOVE + void moveOnlyType(); +#endif }; static int returnxx(int x) @@ -50,11 +58,11 @@ static void returnxxThroughFutureInterface(QFutureInterface<int> &fi, int x) void tst_MapReduce::mapReduce() { - const auto dummyInit = [](QFutureInterface<double>& fi) -> double { + const auto initWithFutureInterface = [](QFutureInterface<double> &fi) -> double { fi.reportResult(0.); return 0.; }; - const auto reduceWithFutureInterface = [](QFutureInterface<double>& fi, double &state, int value) { + const auto reduceWithFutureInterface = [](QFutureInterface<double> &fi, double &state, int value) { state += value; fi.reportResult(value); }; @@ -62,45 +70,118 @@ void tst_MapReduce::mapReduce() state += value; return value; }; - const auto cleanupHalfState = [](QFutureInterface<double> &fi, double &state) { + const auto cleanupWithFutureInterface = [](QFutureInterface<double> &fi, double &state) { state /= 2.; fi.reportResult(state); }; - // TODO: cannot use function returnxx without pointer here because of decayCopy of arguments in runAsync { + // map without future interface QList<double> results = Utils::mapReduce(QList<int>({1, 2, 3, 4, 5}), - dummyInit, &returnxx, - reduceWithFutureInterface, cleanupHalfState) + initWithFutureInterface, returnxx, + reduceWithFutureInterface, cleanupWithFutureInterface) .results(); Utils::sort(results); // mapping order is undefined QCOMPARE(results, QList<double>({0., 1., 4., 9., 16., 25., 27.5})); } { + // map with future interface QList<double> results = Utils::mapReduce(QList<int>({1, 2, 3, 4, 5}), - dummyInit, &returnxxThroughFutureInterface, - reduceWithFutureInterface, cleanupHalfState) + initWithFutureInterface, returnxxThroughFutureInterface, + reduceWithFutureInterface, cleanupWithFutureInterface) .results(); Utils::sort(results); // mapping order is undefined QCOMPARE(results, QList<double>({0., 1., 4., 9., 16., 25., 27.5})); } { + // reduce without future interface QList<double> results = Utils::mapReduce(QList<int>({1, 2, 3, 4, 5}), - dummyInit, &returnxx, - reduceWithReturn, cleanupHalfState) + initWithFutureInterface, returnxx, + reduceWithReturn, cleanupWithFutureInterface) + .results(); + Utils::sort(results); // mapping order is undefined + QCOMPARE(results, QList<double>({0., 1., 4., 9., 16., 25., 27.5})); + } + { + // lvalue ref container + QList<int> container({1, 2, 3, 4, 5}); + QList<double> results = Utils::mapReduce(container, + initWithFutureInterface, returnxx, + reduceWithReturn, cleanupWithFutureInterface) .results(); Utils::sort(results); // mapping order is undefined QCOMPARE(results, QList<double>({0., 1., 4., 9., 16., 25., 27.5})); } + { + // std::cref + QList<int> container({1, 2, 3, 4, 5}); + QCOMPARE(Utils::mapReduce(std::cref(container), + initWithFutureInterface, returnxx, + reduceWithReturn, cleanupWithFutureInterface, + Utils::MapReduceOption::Ordered).results(), + QList<double>({0., 1., 4., 9., 16., 25., 27.5})); + } + { + // std::ref + QList<int> container({1, 2, 3, 4, 5}); + QCOMPARE(Utils::mapReduce(std::ref(container), + initWithFutureInterface, returnxx, + reduceWithReturn, cleanupWithFutureInterface, + Utils::MapReduceOption::Ordered).results(), + QList<double>({0., 1., 4., 9., 16., 25., 27.5})); + } + { + // init and cleanup without future interface + QCOMPARE(Utils::mapReduce(QList<int>({1, 2, 3}), + []() { return 0.; }, + [](int v) { return v*2; }, + [](double &state, int v) { return state += v/4.; }, + [](double &) { }, + Utils::MapReduceOption::Ordered).results(), + QList<double>({.5, 1.5, 3.})); + } + { + // simplified map reduce without init and cleanup + QCOMPARE(Utils::mapReduce(QList<QString>({QLatin1String("blubb"), QLatin1String("foo"), QLatin1String("blah")}), + [](const QString &val) { return val.size(); }, + 90., + [](double &state, int val) { + state /= double(val); + }, + Utils::MapReduceOption::Ordered).result(), + 1.5); + } + { + // simplified map reduce + // std::cref + QList<int> container({1, 2, 3}); + QCOMPARE(Utils::mapReduce(std::cref(container), [](int val) { return 2*val; }, 10, + [](int &state, int val) { state += val; }).result(), + 22); + } + { + // simplified map reduce + // std::cref + QList<int> container({1, 2, 3}); + QCOMPARE(Utils::mapReduce(std::ref(container), [](int &val) { return 2*val; }, 10, + [](int &state, int val) { state += val; }).result(), + 22); + } + { + // blocking mapReduce = mappedReduced + QCOMPARE(Utils::mappedReduced(QList<int>({1, 2, 3}), [](int &val) { return 2*val; }, 10, + [](int &state, int val) { state += val; }), + 22); + } } void tst_MapReduce::mapReduceRvalueContainer() { { QFuture<int> future = Utils::mapReduce(QList<int>({1, 2, 3, 4, 5}), - [](QFutureInterface<int>&) { return 0; }, + []() { return 0; }, [](int value) { return value; }, - [](QFutureInterface<int>&, int &state, int value) { state += value; }, + [](QFutureInterface<int> &, int &state, int value) { state += value; }, [](QFutureInterface<int> &fi, int &state) { fi.reportResult(state); }); // here, lifetime of the QList temporary ends QCOMPARE(future.results(), QList<int>({15})); @@ -109,13 +190,8 @@ void tst_MapReduce::mapReduceRvalueContainer() void tst_MapReduce::map() { - { - QList<double> results = Utils::map(QList<int>({2, 5, 1}), - [](int x) { return x*2.5; } - ).results(); - Utils::sort(results); - QCOMPARE(results, QList<double>({2.5, 5., 12.5})); - } + QCOMPARE(Utils::map(QList<int>({2, 5, 1}), [](int x) { return x*2.5; }).results(), + QList<double>({5., 12.5, 2.5})); { // void result QList<int> results; @@ -126,11 +202,111 @@ void tst_MapReduce::map() // map [&mutex, &results](int x) { QMutexLocker l(&mutex); results.append(x); } ).waitForFinished(); - Utils::sort(results); // mapping order is undefined + // Utils::map is "ordered" by default, but that means that result reporting is ordered, + // the map function is still called out-of-order + qSort(results); QCOMPARE(results, QList<int>({1, 2, 5})); } + { + // inplace editing + QList<int> container({2, 5, 1}); + Utils::map(std::ref(container), [](int &x) { x *= 2; }).waitForFinished(); + QCOMPARE(container, QList<int>({4, 10, 2})); + + Utils::map(container.begin(), container.end(), [](int &x) { x *= 2; }, + Utils::MapReduceOption::Unordered, 3).waitForFinished(); + QCOMPARE(container, QList<int>({8, 20, 4})); + } + + // blocking map = mapped + { + const QSet<int> sizes = Utils::mapped<QSet>(QStringList({QLatin1String("foo"), + QLatin1String("bar"), QLatin1String("blah")}), + [](const QString &s) { return s.size(); }); + QList<int> vals = sizes.toList(); + qSort(vals); + QCOMPARE(vals, QList<int>({3, 4})); + } + { + const QStringList list({QLatin1String("foo"), QLatin1String("bar"), QLatin1String("blah")}); + const QSet<int> sizes = Utils::mapped<QSet>(list.cbegin(), list.cend(), + [](const QString &s) { return s.size(); }); + QList<int> vals = sizes.toList(); + qSort(vals); + QCOMPARE(vals, QList<int>({3, 4})); + } +} + +void tst_MapReduce::orderedMapReduce() +{ + QCOMPARE(Utils::mapReduce(QList<int>({1, 2, 3, 4}), + []() { return 0; }, + [](int i) { return i*2; }, + [](int &state, int val) { state += val; return state; }, + [](int &) { }, + Utils::MapReduceOption::Ordered).results(), + QList<int>({2, 6, 12, 20})); +} + +#ifdef SUPPORTS_MOVE + +class MoveOnlyType +{ +public: + MoveOnlyType() noexcept {} // <- with GCC 5 the defaulted one is noexcept(false) + MoveOnlyType(const MoveOnlyType &) = delete; + MoveOnlyType(MoveOnlyType &&) = default; + MoveOnlyType &operator=(const MoveOnlyType &) = delete; + MoveOnlyType &operator=(MoveOnlyType &&) = default; +}; + +class MoveOnlyState : public MoveOnlyType +{ +public: + int count = 0; +}; + +class MoveOnlyInit : public MoveOnlyType +{ +public: + MoveOnlyState operator()(QFutureInterface<int> &) const { return MoveOnlyState(); } +}; + +class MoveOnlyMap : public MoveOnlyType +{ +public: + int operator()(const MoveOnlyType &) const { return 1; } +}; + +class MoveOnlyReduce : public MoveOnlyType +{ +public: + void operator()(QFutureInterface<int> &, MoveOnlyState &state, int) { ++state.count; } +}; + +class MoveOnlyList : public std::vector<MoveOnlyType> +{ +public: + MoveOnlyList() { emplace_back(MoveOnlyType()); emplace_back(MoveOnlyType()); } + MoveOnlyList(const MoveOnlyList &) = delete; + MoveOnlyList(MoveOnlyList &&) = default; + MoveOnlyList &operator=(const MoveOnlyList &) = delete; + MoveOnlyList &operator=(MoveOnlyList &&) = default; +}; + +void tst_MapReduce::moveOnlyType() +{ + QCOMPARE(Utils::mapReduce(MoveOnlyList(), + MoveOnlyInit(), + MoveOnlyMap(), + MoveOnlyReduce(), + [](QFutureInterface<int> &fi, MoveOnlyState &state) { fi.reportResult(state.count); } + ).results(), + QList<int>({2})); } +#endif + QTEST_MAIN(tst_MapReduce) #include "tst_mapreduce.moc" diff --git a/tests/auto/qml/codemodel/codemodel.pro b/tests/auto/qml/codemodel/codemodel.pro index 2e42b5cb7c..61114626c1 100644 --- a/tests/auto/qml/codemodel/codemodel.pro +++ b/tests/auto/qml/codemodel/codemodel.pro @@ -1,4 +1,6 @@ TEMPLATE = subdirs SUBDIRS += check \ - importscheck + importscheck \ + dependencies + diff --git a/tests/auto/qml/codemodel/dependencies/dependencies.pro b/tests/auto/qml/codemodel/dependencies/dependencies.pro new file mode 100644 index 0000000000..b56dfdbe6d --- /dev/null +++ b/tests/auto/qml/codemodel/dependencies/dependencies.pro @@ -0,0 +1,20 @@ +QTC_LIB_DEPENDS += qmljs +QTC_PLUGIN_DEPENDS += qmljstools + +include(../../../qttest.pri) + +DEFINES+=QTCREATORDIR=\\\"$$IDE_SOURCE_TREE\\\" +DEFINES+=TESTSRCDIR=\\\"$$PWD\\\" + +QT += core +QT -= gui + +CONFIG += c++11 + +TARGET = tst_dependencies +CONFIG += console +CONFIG -= app_bundle + +TEMPLATE = app + +SOURCES += tst_dependencies.cpp diff --git a/src/plugins/android/javaautocompleter.cpp b/tests/auto/qml/codemodel/dependencies/samples/001_ApplicationWindow.qml index ca9468f348..6c55b2e8ab 100644 --- a/src/plugins/android/javaautocompleter.cpp +++ b/tests/auto/qml/codemodel/dependencies/samples/001_ApplicationWindow.qml @@ -23,19 +23,13 @@ ** ****************************************************************************/ -#include "javaautocompleter.h" -#include <QTextCursor> +import QtQuick 2.4 +import QtQuick.Controls 1.3 -using namespace Android; -using namespace Android::Internal; - -JavaAutoCompleter::JavaAutoCompleter() -{ +ApplicationWindow { + title: qsTr("Hello World") + width: 640 + height: 480 + visible: true } -bool JavaAutoCompleter::contextAllowsAutoParentheses(const QTextCursor &cursor, const QString &textToInsert) const -{ - Q_UNUSED(cursor) - Q_UNUSED(textToInsert) - return true; -} diff --git a/tests/auto/qml/codemodel/dependencies/samples/002_Window.qml b/tests/auto/qml/codemodel/dependencies/samples/002_Window.qml new file mode 100644 index 0000000000..71dbbd2b7b --- /dev/null +++ b/tests/auto/qml/codemodel/dependencies/samples/002_Window.qml @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** 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. +** +****************************************************************************/ + +import QtQuick 2.4 +import QtQuick.Controls 1.3 + +Window { + title: qsTr("Hello World") + width: 640 + height: 480 + visible: true +} diff --git a/tests/auto/qml/codemodel/dependencies/samples/SampleLib.qml b/tests/auto/qml/codemodel/dependencies/samples/SampleLib.qml new file mode 100644 index 0000000000..2495247708 --- /dev/null +++ b/tests/auto/qml/codemodel/dependencies/samples/SampleLib.qml @@ -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. +** +****************************************************************************/ + +import QtQuick 2.4 +import QtQuick.Controls 1.4 + +TreeView { + id: lib +} + diff --git a/tests/auto/qml/codemodel/dependencies/tst_dependencies.cpp b/tests/auto/qml/codemodel/dependencies/tst_dependencies.cpp new file mode 100644 index 0000000000..ffa9e2f1eb --- /dev/null +++ b/tests/auto/qml/codemodel/dependencies/tst_dependencies.cpp @@ -0,0 +1,153 @@ +/**************************************************************************** +** +** 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 <QString> +#include <QStringList> +#include <QFutureInterface> +#include <QFile> +#include <QTextStream> +#include <QDateTime> +#include <QLibraryInfo> +#include <QtTest> + +#include <QDebug> + +#include <qmljs/qmljsinterpreter.h> +#include <qmljs/qmljsdocument.h> +#include <qmljs/qmljsbind.h> +#include <qmljs/qmljslink.h> +#include <qmljs/qmljscontext.h> +#include <qmljs/qmljsviewercontext.h> +#include <qmljs/qmljscheck.h> +#include <qmljs/qmljsimportdependencies.h> +#include <qmljs/parser/qmljsast_p.h> +#include <qmljs/parser/qmljsengine_p.h> +#include <qmljs/qmljsmodelmanagerinterface.h> +#include <qmljstools/qmljssemanticinfo.h> +#include <extensionsystem/pluginmanager.h> + +using namespace QmlJS; +using namespace QmlJS::AST; +using namespace QmlJS::StaticAnalysis; + +static Document::MutablePtr readDocument(const QString &path) +{ + Document::MutablePtr doc = Document::create(path, Dialect::Qml); + QFile file(doc->fileName()); + file.open(QFile::ReadOnly | QFile::Text); + doc->setSource(file.readAll()); + file.close(); + doc->parse(); + return doc; +} + +class tst_Dependencies : public QObject +{ + Q_OBJECT + +private slots: + void initTestCase(); + void test_data(); + void test(); + +private: + QString m_path; + QStringList m_basePaths; +}; + +void tst_Dependencies::initTestCase() +{ + QLoggingCategory::setFilterRules(QLatin1String("qtc.*.debug=false")); + m_path = QCoreApplication::applicationDirPath() + QLatin1Literal("/samples"); + + m_basePaths.append(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)); + + if (!ModelManagerInterface::instance()) + new ModelManagerInterface; + + if (!ExtensionSystem::PluginManager::instance()) + new ExtensionSystem::PluginManager; +} + +void tst_Dependencies::test_data() +{ + QTest::addColumn<QString>("filename"); + QTest::addColumn<int>("nSemanticMessages"); + QTest::addColumn<int>("nStaticMessages"); + + QTest::newRow("ApplicationWindow") + << QString(m_path + QLatin1String("/001_ApplicationWindow.qml")) + << 0 + << 0; + QTest::newRow("Window") + << QString(m_path + QLatin1String("/002_Window.qml")) + << 0 + << 1; +} + +void tst_Dependencies::test() +{ + QFETCH(QString, filename); + QFETCH(int, nSemanticMessages); + QFETCH(int, nStaticMessages); + + ModelManagerInterface *modelManager = ModelManagerInterface::instance(); + + QFutureInterface<void> result; + PathsAndLanguages lPaths; + QStringList paths(m_basePaths); + paths << m_path; + for (auto p: paths) + lPaths.maybeInsert(Utils::FileName::fromString(p), Dialect::Qml); + ModelManagerInterface::importScan(result, ModelManagerInterface::workingCopy(), lPaths, + ModelManagerInterface::instance(), false); + + + Document::MutablePtr doc = readDocument(filename); + QVERIFY(!doc->source().isEmpty()); + + Snapshot snapshot = modelManager->snapshot(); + + QmlJSTools::SemanticInfo semanticInfo; + semanticInfo.document = doc; + semanticInfo.snapshot = snapshot; + + Link link(semanticInfo.snapshot, modelManager->defaultVContext(doc->language(), doc), modelManager->builtins(doc)); + + semanticInfo.context = link(doc, &semanticInfo.semanticMessages); + + ScopeChain *scopeChain = new ScopeChain(doc, semanticInfo.context); + semanticInfo.setRootScopeChain(QSharedPointer<const ScopeChain>(scopeChain)); + + Check checker(doc, semanticInfo.context); + semanticInfo.staticAnalysisMessages = checker(); + + QCOMPARE(semanticInfo.semanticMessages.length(), nSemanticMessages); + QCOMPARE(semanticInfo.staticAnalysisMessages.length(), nStaticMessages); +} + +QTEST_MAIN(tst_Dependencies) + +#include "tst_dependencies.moc" diff --git a/tests/auto/qml/qmldesigner/bauhaustests/testbauhaus.h b/tests/auto/qml/qmldesigner/bauhaustests/testbauhaus.h index 2292c3efbe..fcb9557efe 100644 --- a/tests/auto/qml/qmldesigner/bauhaustests/testbauhaus.h +++ b/tests/auto/qml/qmldesigner/bauhaustests/testbauhaus.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTBAUHAUS_H -#define TESTBAUHAUS_H +#pragma once #include <QObject> @@ -51,5 +50,3 @@ private: QString m_creatorDir; QString m_qtDir; }; - -#endif // TESTBAUHAUS_H diff --git a/tests/auto/qml/qmldesigner/coretests/testrewriterview.h b/tests/auto/qml/qmldesigner/coretests/testrewriterview.h index 9778b59083..74b5fa384a 100644 --- a/tests/auto/qml/qmldesigner/coretests/testrewriterview.h +++ b/tests/auto/qml/qmldesigner/coretests/testrewriterview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTREWRITERVIEW_H -#define TESTREWRITERVIEW_H +#pragma once #include <rewriterview.h> #include <model/modeltotextmerger.h> @@ -61,5 +60,3 @@ public: }; } // QmlDesigner - -#endif // TESTREWRITERVIEW_H diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp index fdd64360e8..e425a05e11 100644 --- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp @@ -6764,8 +6764,8 @@ void tst_TestCore::testRewriterPropertyChanges() ModelNode rootNode = view->rootModelNode(); QVERIFY(rootNode.isValid()); QCOMPARE(rootNode.type(), QString("QtQuick.Rectangle")); - QVERIFY(rootNode.propertyNames().contains(QLatin1String("data"))); - QVERIFY(rootNode.propertyNames().contains(QLatin1String("states"))); + QVERIFY(rootNode.propertyNames().contains("data")); + QVERIFY(rootNode.propertyNames().contains("states")); QCOMPARE(rootNode.propertyNames().count(), 2); NodeListProperty statesProperty = rootNode.nodeListProperty("states"); diff --git a/tests/auto/qml/qmldesigner/propertyeditortests/testpropertyeditor.h b/tests/auto/qml/qmldesigner/propertyeditortests/testpropertyeditor.h index 4175fc18f1..c405d630cd 100644 --- a/tests/auto/qml/qmldesigner/propertyeditortests/testpropertyeditor.h +++ b/tests/auto/qml/qmldesigner/propertyeditortests/testpropertyeditor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTPROPERTYEDITOR_H -#define TESTPROPERTYEDITOR_H +#pragma once #include <QObject> @@ -49,5 +48,3 @@ private slots: void loadWelcomeScreen(); void loadHelloWorld(); }; - -#endif // TESTPROPERTYEDITOR_H diff --git a/tests/auto/qml/qmldesigner/testview.h b/tests/auto/qml/qmldesigner/testview.h index 41efe550ca..07c9281299 100644 --- a/tests/auto/qml/qmldesigner/testview.h +++ b/tests/auto/qml/qmldesigner/testview.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TESTVIEW_H -#define TESTVIEW_H +#pragma once #include <qmlmodelview.h> #include <QVariant> @@ -84,5 +83,3 @@ private: bool operator==(TestView::MethodCall call1, TestView::MethodCall call2); QDebug operator<<(QDebug debug, TestView::MethodCall call); - -#endif // TESTVIEW_H diff --git a/tests/auto/qtcprocess/qtcprocess.pro b/tests/auto/qtcprocess/qtcprocess.pro index c7d54ae03c..8b7db5493e 100644 --- a/tests/auto/qtcprocess/qtcprocess.pro +++ b/tests/auto/qtcprocess/qtcprocess.pro @@ -4,6 +4,3 @@ include(../qttest.pri) win32:DEFINES += _CRT_SECURE_NO_WARNINGS SOURCES += tst_qtcprocess.cpp - -DEFINES -= QT_USE_FAST_CONCATENATION QT_USE_FAST_OPERATOR_PLUS -DEFINES -= QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII diff --git a/tests/auto/qtcprocess/tst_qtcprocess.cpp b/tests/auto/qtcprocess/tst_qtcprocess.cpp index 6e69789e16..d5fbb42a18 100644 --- a/tests/auto/qtcprocess/tst_qtcprocess.cpp +++ b/tests/auto/qtcprocess/tst_qtcprocess.cpp @@ -585,8 +585,8 @@ void tst_QtcProcess::expandMacros_data() << QString::fromLatin1(vals[i].out) << vals[i].os; sprintf(buf, "padded %s: %s", title, vals[i].in); - QTest::newRow(buf) << (sp + QString::fromLatin1(vals[i].in) + sp) - << (sp + QString::fromLatin1(vals[i].out) + sp) + QTest::newRow(buf) << QString(sp + QString::fromLatin1(vals[i].in) + sp) + << QString(sp + QString::fromLatin1(vals[i].out) + sp) << vals[i].os; } } diff --git a/tests/auto/qttest.pri b/tests/auto/qttest.pri index 20f6e635e4..731d98718d 100644 --- a/tests/auto/qttest.pri +++ b/tests/auto/qttest.pri @@ -6,7 +6,7 @@ QT += testlib CONFIG += qt warn_on console depend_includepath testcase CONFIG -= app_bundle -DEFINES -= QT_NO_CAST_FROM_ASCII +DEFINES -= QT_RESTRICTED_CAST_FROM_ASCII # prefix test binary with tst_ !contains(TARGET, ^tst_.*):TARGET = $$join(TARGET,,"tst_") diff --git a/tests/auto/timeline/shared/runscenegraph.h b/tests/auto/timeline/shared/runscenegraph.h index 1353de785e..c3644104db 100644 --- a/tests/auto/timeline/shared/runscenegraph.h +++ b/tests/auto/timeline/shared/runscenegraph.h @@ -23,11 +23,8 @@ ** ****************************************************************************/ -#ifndef RUNSCENEGRAPH_H -#define RUNSCENEGRAPH_H +#pragma once #include <QSGNode> void runSceneGraph(QSGNode *node); - -#endif //RUNSCENEGRAPH_H diff --git a/tests/auto/valgrind/callgrind/callgrindparsertests.h b/tests/auto/valgrind/callgrind/callgrindparsertests.h index bdcf0e32be..89f86bfaac 100644 --- a/tests/auto/valgrind/callgrind/callgrindparsertests.h +++ b/tests/auto/valgrind/callgrind/callgrindparsertests.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CALLGRINDPARSERTESTS_H -#define CALLGRINDPARSERTESTS_H +#pragma once #include <QObject> #include <QPair> @@ -54,5 +53,3 @@ private Q_SLOTS: void testRecursion(); }; - -#endif // CALLGRINDPARSERTESTS_H diff --git a/tests/auto/valgrind/callgrind/modeltest.h b/tests/auto/valgrind/callgrind/modeltest.h index a215564125..8f5b8c999f 100644 --- a/tests/auto/valgrind/callgrind/modeltest.h +++ b/tests/auto/valgrind/callgrind/modeltest.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MODELTEST_H -#define MODELTEST_H +#pragma once #include <QWidget> @@ -64,5 +63,3 @@ public: QComboBox *m_event; Callgrind::Internal::CallgrindWidgetHandler *m_handler; }; - -#endif // MODELTEST_H diff --git a/tests/auto/valgrind/memcheck/modeldemo.h b/tests/auto/valgrind/memcheck/modeldemo.h index 7e0f44a736..de95a6c743 100644 --- a/tests/auto/valgrind/memcheck/modeldemo.h +++ b/tests/auto/valgrind/memcheck/modeldemo.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef MODELDEMO_H -#define MODELDEMO_H +#pragma once #include <QObject> #include <QDebug> @@ -67,5 +66,3 @@ public Q_SLOTS: private: Valgrind::Memcheck::MemcheckRunner *runner; }; - -#endif // MODELDEMO_H diff --git a/tests/auto/valgrind/memcheck/parsertests.h b/tests/auto/valgrind/memcheck/parsertests.h index bea78cbada..cb65dd8557 100644 --- a/tests/auto/valgrind/memcheck/parsertests.h +++ b/tests/auto/valgrind/memcheck/parsertests.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef PARSERTESTS_H -#define PARSERTESTS_H +#pragma once #include <QObject> #include <QPair> @@ -164,5 +163,3 @@ private: QProcess *m_process; QTcpSocket *m_socket; }; - -#endif // PARSERTESTS_H diff --git a/tests/auto/valgrind/memcheck/testrunner.h b/tests/auto/valgrind/memcheck/testrunner.h index 8312df0186..79eccf675a 100644 --- a/tests/auto/valgrind/memcheck/testrunner.h +++ b/tests/auto/valgrind/memcheck/testrunner.h @@ -24,8 +24,7 @@ ** ****************************************************************************/ -#ifndef TESTRUNNER_H -#define TESTRUNNER_H +#pragma once #include <QObject> #include <QStringList> @@ -86,5 +85,3 @@ private: }; } // namespace Valgrind - -#endif // TESTRUNNER_H diff --git a/tests/cppmodelmanager/testdata/include/header.h b/tests/cppmodelmanager/testdata/include/header.h index 689ec03871..6f70f09bee 100644 --- a/tests/cppmodelmanager/testdata/include/header.h +++ b/tests/cppmodelmanager/testdata/include/header.h @@ -1,4 +1 @@ -#ifndef HEADER_H -#define HEADER_H - -#endif // HEADER_H +#pragma once diff --git a/tests/cppmodelmanager/testdata_guiproject1/mainwindow.h b/tests/cppmodelmanager/testdata_guiproject1/mainwindow.h index 6dae9639b6..7930d5f5f8 100644 --- a/tests/cppmodelmanager/testdata_guiproject1/mainwindow.h +++ b/tests/cppmodelmanager/testdata_guiproject1/mainwindow.h @@ -1,7 +1,6 @@ // Copyright license -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#pragma once #include <QMainWindow> @@ -20,5 +19,3 @@ public: private: Ui::MainWindow *ui; }; - -#endif // MAINWINDOW_H diff --git a/tests/cppmodelmanager/testdata_project1/foo.h b/tests/cppmodelmanager/testdata_project1/foo.h index b427107633..ea1cfa542a 100644 --- a/tests/cppmodelmanager/testdata_project1/foo.h +++ b/tests/cppmodelmanager/testdata_project1/foo.h @@ -1,12 +1,9 @@ // Copyright header -#ifndef FOO_H -#define FOO_H +#pragma once class Foo { public: Foo(); }; - -#endif // FOO_H diff --git a/tests/cppmodelmanager/testdata_project2/bar.h b/tests/cppmodelmanager/testdata_project2/bar.h index abb6e59877..45702c5d0a 100644 --- a/tests/cppmodelmanager/testdata_project2/bar.h +++ b/tests/cppmodelmanager/testdata_project2/bar.h @@ -1,12 +1,9 @@ // Copyright header -#ifndef BAR_H -#define BAR_H +#pragma once class Bar { public: Bar(); }; - -#endif // BAR_H diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.h b/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.h index 4f35262bea..363d990bb0 100644 --- a/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.h +++ b/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.h @@ -1,7 +1,6 @@ // Copyright header -#ifndef FORM_H -#define FORM_H +#pragma once #include "ui_form.h" @@ -23,5 +22,3 @@ public: private: Ui::Form ui; }; - -#endif // FORM_H diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.h b/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.h index 3f5ddba574..0d0b51665d 100644 --- a/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.h +++ b/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.h @@ -1,7 +1,6 @@ // Copyright header -#ifndef FORM_H -#define FORM_H +#pragma once #include <QWidget> @@ -26,5 +25,3 @@ public: private: Ui::Form *ui; }; - -#endif // FORM_H diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.h b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.h index 13fdfa5b23..0017646284 100644 --- a/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.h +++ b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.h @@ -1,7 +1,6 @@ // Copyright header -#ifndef N_FORM_H -#define N_FORM_H +#pragma once #include <QWidget> @@ -24,5 +23,3 @@ public: private: Ui::Form *ui; }; - -#endif // N_FORM_H diff --git a/tests/designer/gotoslot_withoutProject/form.h b/tests/designer/gotoslot_withoutProject/form.h index b027afa78d..f84cc000de 100644 --- a/tests/designer/gotoslot_withoutProject/form.h +++ b/tests/designer/gotoslot_withoutProject/form.h @@ -1,7 +1,6 @@ // Copyright header -#ifndef FORM_H -#define FORM_H +#pragma once #include <QWidget> @@ -20,5 +19,3 @@ public: private: Ui::Form *ui; }; - -#endif // FORM_H diff --git a/tests/genericprojectmanager/testdata_mixedproject1/Glue.h b/tests/genericprojectmanager/testdata_mixedproject1/Glue.h index dd39049add..08570566f9 100644 --- a/tests/genericprojectmanager/testdata_mixedproject1/Glue.h +++ b/tests/genericprojectmanager/testdata_mixedproject1/Glue.h @@ -1,10 +1,7 @@ -#ifndef GLUE_H -#define GLUE_H +#pragma once struct Glue { struct it { static void together(); }; }; - -#endif // GLUE_H diff --git a/tests/genericprojectmanager/testdata_mixedproject1/header.h b/tests/genericprojectmanager/testdata_mixedproject1/header.h index 689ec03871..6f70f09bee 100644 --- a/tests/genericprojectmanager/testdata_mixedproject1/header.h +++ b/tests/genericprojectmanager/testdata_mixedproject1/header.h @@ -1,4 +1 @@ -#ifndef HEADER_H -#define HEADER_H - -#endif // HEADER_H +#pragma once diff --git a/tests/genericprojectmanager/testdata_mixedproject2/header.hpp b/tests/genericprojectmanager/testdata_mixedproject2/header.hpp index ebc2cf627a..f2acb3bef7 100644 --- a/tests/genericprojectmanager/testdata_mixedproject2/header.hpp +++ b/tests/genericprojectmanager/testdata_mixedproject2/header.hpp @@ -1,6 +1,4 @@ -#ifndef HEADER_HPP -#define HEADER_HPP +#pragma once extern "C" void impl(); -#endif // HEADER_HPP diff --git a/tests/manual/cplusplus-tools/detail/header.h b/tests/manual/cplusplus-tools/detail/header.h index 7670772308..bc6d2f36c8 100644 --- a/tests/manual/cplusplus-tools/detail/header.h +++ b/tests/manual/cplusplus-tools/detail/header.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef HEADER_H -#define HEADER_H +#pragma once #include <QtGlobal> @@ -51,5 +50,3 @@ void freefunc3(T) template <class T> void freefunc3(T, int) {} - -#endif //HEADER_H diff --git a/tests/manual/cplusplus-tools/dummy.h b/tests/manual/cplusplus-tools/dummy.h index 87fe29cccf..fef4787180 100644 --- a/tests/manual/cplusplus-tools/dummy.h +++ b/tests/manual/cplusplus-tools/dummy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef DUMMY_H -#define DUMMY_H +#pragma once #include <QString> @@ -71,5 +70,3 @@ class ChildDummy : public Dummy {}; class GrandChildDummy : public Dummy {}; } // namespace test - -#endif // DUMMY_H diff --git a/tests/manual/debugger/gui/mainwindow.h b/tests/manual/debugger/gui/mainwindow.h index b6227c1455..ab47ada3f3 100644 --- a/tests/manual/debugger/gui/mainwindow.h +++ b/tests/manual/debugger/gui/mainwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#pragma once #include <QMainWindow> @@ -79,4 +78,3 @@ private: }; } -#endif // MAINWINDOW_H diff --git a/tests/manual/debugger/qquick1/myplugin/myplugin.h b/tests/manual/debugger/qquick1/myplugin/myplugin.h index bf2d86041f..a902a926a1 100644 --- a/tests/manual/debugger/qquick1/myplugin/myplugin.h +++ b/tests/manual/debugger/qquick1/myplugin/myplugin.h @@ -1,5 +1,4 @@ -#ifndef MYPLUGIN_H -#define MYPLUGIN_H +#pragma once #include <qdeclarative.h> #include <QDeclarativeExtensionPlugin> @@ -11,5 +10,3 @@ class MyPlugin : public QDeclarativeExtensionPlugin public: void registerTypes(const char *uri); }; - -#endif // MYPLUGIN_H diff --git a/tests/manual/debugger/qquick1/myplugin/mytype.h b/tests/manual/debugger/qquick1/myplugin/mytype.h index 8f4116a251..30c90c9ef6 100644 --- a/tests/manual/debugger/qquick1/myplugin/mytype.h +++ b/tests/manual/debugger/qquick1/myplugin/mytype.h @@ -1,5 +1,4 @@ -#ifndef MYTYPE_H -#define MYTYPE_H +#pragma once #include <QObject> #include <QString> @@ -30,6 +29,3 @@ private: Q_DISABLE_COPY(MyType) }; - -#endif // MYTYPE_H - diff --git a/tests/manual/debugger/qquick2/myplugin/myplugin.h b/tests/manual/debugger/qquick2/myplugin/myplugin.h index 053f8bdf15..fd741b8d3c 100644 --- a/tests/manual/debugger/qquick2/myplugin/myplugin.h +++ b/tests/manual/debugger/qquick2/myplugin/myplugin.h @@ -1,5 +1,4 @@ -#ifndef MYPLUGIN_H -#define MYPLUGIN_H +#pragma once #include <QQmlExtensionPlugin> @@ -10,5 +9,3 @@ class MyPlugin : public QQmlExtensionPlugin public: void registerTypes(const char *uri); }; - -#endif // MYPLUGIN_H diff --git a/tests/manual/debugger/qquick2/myplugin/mytype.h b/tests/manual/debugger/qquick2/myplugin/mytype.h index 8f4116a251..30c90c9ef6 100644 --- a/tests/manual/debugger/qquick2/myplugin/mytype.h +++ b/tests/manual/debugger/qquick2/myplugin/mytype.h @@ -1,5 +1,4 @@ -#ifndef MYTYPE_H -#define MYTYPE_H +#pragma once #include <QObject> #include <QString> @@ -30,6 +29,3 @@ private: Q_DISABLE_COPY(MyType) }; - -#endif // MYTYPE_H - diff --git a/tests/manual/dockwidgets/mainwindow.h b/tests/manual/dockwidgets/mainwindow.h index 9e88c54cde..3f5f0bfda5 100644 --- a/tests/manual/dockwidgets/mainwindow.h +++ b/tests/manual/dockwidgets/mainwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#pragma once #include <QMainWindow> @@ -42,5 +41,3 @@ private: QLabel *centralWidget; }; - -#endif // MAINWINDOW_H diff --git a/tests/manual/process/mainwindow.h b/tests/manual/process/mainwindow.h index c01dfdff5b..6dfe387400 100644 --- a/tests/manual/process/mainwindow.h +++ b/tests/manual/process/mainwindow.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#pragma once #include <QMainWindow> @@ -47,5 +46,3 @@ public slots: private: QPlainTextEdit *m_logWindow; }; - -#endif // MAINWINDOW_H diff --git a/tests/manual/ssh/remoteprocess/argumentscollector.h b/tests/manual/ssh/remoteprocess/argumentscollector.h index efac8af84b..5f195cf1f0 100644 --- a/tests/manual/ssh/remoteprocess/argumentscollector.h +++ b/tests/manual/ssh/remoteprocess/argumentscollector.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ARGUMENTSCOLLECTOR_H -#define ARGUMENTSCOLLECTOR_H +#pragma once #include <ssh/sshconnection.h> @@ -50,5 +49,3 @@ private: const QStringList m_arguments; }; - -#endif // ARGUMENTSCOLLECTOR_H diff --git a/tests/manual/ssh/remoteprocess/remoteprocesstest.h b/tests/manual/ssh/remoteprocess/remoteprocesstest.h index 0e626f26a5..44c02169e7 100644 --- a/tests/manual/ssh/remoteprocess/remoteprocesstest.h +++ b/tests/manual/ssh/remoteprocess/remoteprocesstest.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REMOTEPROCESSTEST_H -#define REMOTEPROCESSTEST_H +#pragma once #include <ssh/sshremoteprocessrunner.h> @@ -76,6 +75,3 @@ private: State m_state; bool m_started; }; - - -#endif // REMOTEPROCESSTEST_H diff --git a/tests/manual/ssh/sftp/argumentscollector.h b/tests/manual/ssh/sftp/argumentscollector.h index d3f14be9d8..67b69a7f47 100644 --- a/tests/manual/ssh/sftp/argumentscollector.h +++ b/tests/manual/ssh/sftp/argumentscollector.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ARGUMENTSCOLLECTOR_H -#define ARGUMENTSCOLLECTOR_H +#pragma once #include "parameters.h" @@ -51,5 +50,3 @@ private: const QStringList m_arguments; }; - -#endif // ARGUMENTSCOLLECTOR_H diff --git a/tests/manual/ssh/sftp/parameters.h b/tests/manual/ssh/sftp/parameters.h index 86bc4ba6f6..d947fa9d7d 100644 --- a/tests/manual/ssh/sftp/parameters.h +++ b/tests/manual/ssh/sftp/parameters.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef PARAMETERS_H -#define PARAMETERS_H +#pragma once #include <ssh/sshconnection.h> @@ -33,5 +32,3 @@ struct Parameters { int smallFileCount; int bigFileSize; }; - -#endif // PARAMETERS_H diff --git a/tests/manual/ssh/sftp/sftptest.h b/tests/manual/ssh/sftp/sftptest.h index 87eaac3def..1b984c4154 100644 --- a/tests/manual/ssh/sftp/sftptest.h +++ b/tests/manual/ssh/sftp/sftptest.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SFTPTEST_H -#define SFTPTEST_H +#pragma once #include "parameters.h" @@ -102,6 +101,3 @@ private: QSsh::SftpFileInfo m_dirInfo; QList<QSsh::SftpFileInfo> m_dirContents; }; - - -#endif // SFTPTEST_H diff --git a/tests/manual/ssh/shell/shell.h b/tests/manual/ssh/shell/shell.h index 479635321b..3fae9bf18b 100644 --- a/tests/manual/ssh/shell/shell.h +++ b/tests/manual/ssh/shell/shell.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SHELL_H -#define SHELL_H +#pragma once #include <QObject> #include <QSharedPointer> @@ -65,5 +64,3 @@ private: QSharedPointer<QSsh::SshRemoteProcess> m_shell; QFile * const m_stdin; }; - -#endif // SHELL_H diff --git a/tests/manual/ssh/tunnel/argumentscollector.h b/tests/manual/ssh/tunnel/argumentscollector.h index efac8af84b..5f195cf1f0 100644 --- a/tests/manual/ssh/tunnel/argumentscollector.h +++ b/tests/manual/ssh/tunnel/argumentscollector.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ARGUMENTSCOLLECTOR_H -#define ARGUMENTSCOLLECTOR_H +#pragma once #include <ssh/sshconnection.h> @@ -50,5 +49,3 @@ private: const QStringList m_arguments; }; - -#endif // ARGUMENTSCOLLECTOR_H diff --git a/tests/manual/ssh/tunnel/tunnel.h b/tests/manual/ssh/tunnel/tunnel.h index b2bc7b470c..c01b478c40 100644 --- a/tests/manual/ssh/tunnel/tunnel.h +++ b/tests/manual/ssh/tunnel/tunnel.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TUNNEL_H -#define TUNNEL_H +#pragma once #include <QObject> #include <QSharedPointer> @@ -71,5 +70,3 @@ private: QByteArray m_dataReceivedFromClient; bool m_expectingChannelClose; }; - -#endif // TUNNEL_H diff --git a/tests/system/suite_editors/shared/simplePlainCPP/testfile.h b/tests/system/suite_editors/shared/simplePlainCPP/testfile.h index 0fc49694e4..dbb0bf9d05 100644 --- a/tests/system/suite_editors/shared/simplePlainCPP/testfile.h +++ b/tests/system/suite_editors/shared/simplePlainCPP/testfile.h @@ -8,4 +8,3 @@ public: {\ (X) = 1;\ }\ - diff --git a/tests/unit/echoserver/echoipcserver.h b/tests/unit/echoserver/echoipcserver.h index debc156038..74d1bd5331 100644 --- a/tests/unit/echoserver/echoipcserver.h +++ b/tests/unit/echoserver/echoipcserver.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_ECHOIPCSERVER_H -#define CLANGBACKEND_ECHOIPCSERVER_H +#pragma once #include <ipcserverinterface.h> @@ -52,5 +51,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_ECHOIPCSERVER_H diff --git a/tests/unit/echoserver/echoserver.pro b/tests/unit/echoserver/echoserver.pro index ad2a02ad11..7058753f4f 100644 --- a/tests/unit/echoserver/echoserver.pro +++ b/tests/unit/echoserver/echoserver.pro @@ -15,6 +15,8 @@ osx:QMAKE_CXXFLAGS = -stdlib=libc++ include(../../../src/libs/clangbackendipc/clangbackendipc-lib.pri) include(../../../src/libs/sqlite/sqlite-lib.pri) +INCLUDEPATH += ../../../src/libs + SOURCES += \ echoipcserver.cpp \ echoserverprocessmain.cpp diff --git a/tests/unit/mockup/clangcodemodel/clangcompletionassistinterface.h b/tests/unit/mockup/clangcodemodel/clangcompletionassistinterface.h index 9228e1348a..9596a19e13 100644 --- a/tests/unit/mockup/clangcodemodel/clangcompletionassistinterface.h +++ b/tests/unit/mockup/clangcodemodel/clangcompletionassistinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGCODEMODEL_INTERNAL_CLANGCOMPLETIONASSISTINTERFACE_H -#define CLANGCODEMODEL_INTERNAL_CLANGCOMPLETIONASSISTINTERFACE_H +#pragma once #include <texteditor/codeassist/assistinterface.h> @@ -50,5 +49,3 @@ private: } // namespace Internal } // namespace ClangCodeModel - -#endif // CLANGCODEMODEL_INTERNAL_CLANGCOMPLETIONASSISTINTERFACE_H diff --git a/tests/unit/mockup/texteditor/assistenums.h b/tests/unit/mockup/texteditor/assistenums.h index d1e068c7f3..2a5995526d 100644 --- a/tests/unit/mockup/texteditor/assistenums.h +++ b/tests/unit/mockup/texteditor/assistenums.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ASSISTENUMS_H -#define ASSISTENUMS_H +#pragma once namespace TextEditor { @@ -43,5 +42,3 @@ enum AssistReason }; } // TextEditor - -#endif // ASSISTENUMS_H diff --git a/tests/unit/mockup/texteditor/codeassist/assistinterface.h b/tests/unit/mockup/texteditor/codeassist/assistinterface.h index 9791e71a28..3b3b670471 100644 --- a/tests/unit/mockup/texteditor/codeassist/assistinterface.h +++ b/tests/unit/mockup/texteditor/codeassist/assistinterface.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef ASSISTINTERFACE_H -#define ASSISTINTERFACE_H +#pragma once #include <QTextCursor> @@ -109,6 +108,3 @@ inline QString AssistInterface::fileName() const return fileName_; } } - -#endif // ASSISTINTERFACE_H - diff --git a/tests/unit/mockup/texteditor/quickfix.h b/tests/unit/mockup/texteditor/quickfix.h index b4eb7b1a80..09fd747578 100644 --- a/tests/unit/mockup/texteditor/quickfix.h +++ b/tests/unit/mockup/texteditor/quickfix.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef TEXTEDITORQUICKFIX_H -#define TEXTEDITORQUICKFIX_H +#pragma once #include <QString> @@ -55,6 +54,3 @@ private: }; } - -#endif // TEXTEDITORQUICKFIX_H - diff --git a/tests/unit/mockup/texteditor/refactoringchanges.h b/tests/unit/mockup/texteditor/refactoringchanges.h index 1299fccaf3..9911bab3cd 100644 --- a/tests/unit/mockup/texteditor/refactoringchanges.h +++ b/tests/unit/mockup/texteditor/refactoringchanges.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef REFACTORINGCHANGES_H -#define REFACTORINGCHANGES_H +#pragma once #include <QFile> #include <QSharedPointer> @@ -126,5 +125,3 @@ public: }; } // namespace TextEditor - -#endif // REFACTORINGCHANGES_H diff --git a/tests/unit/mockup/texteditor/semantichighlighter.h b/tests/unit/mockup/texteditor/semantichighlighter.h index b3bbfb2973..ab4f9fa378 100644 --- a/tests/unit/mockup/texteditor/semantichighlighter.h +++ b/tests/unit/mockup/texteditor/semantichighlighter.h @@ -23,8 +23,9 @@ ** ****************************************************************************/ -#ifndef TEXTEDITOR_SEMANTICHIGHLIGHTER_H -#define TEXTEDITOR_SEMANTICHIGHLIGHTER_H +#pragma once + +#include <texteditor/textstyles.h> namespace TextEditor { @@ -33,7 +34,11 @@ public: unsigned line; unsigned column; unsigned length; - int kind; + union { + TextStyles textStyles; + int kind; + }; + bool useTextSyles; bool isValid() const { return line != 0; } @@ -46,7 +51,11 @@ public: {} HighlightingResult(unsigned line, unsigned column, unsigned length, int kind) - : line(line), column(column), length(length), kind(kind) + : line(line), column(column), length(length), kind(kind), useTextSyles(false) + {} + + HighlightingResult(unsigned line, unsigned column, unsigned length, TextStyles textStyles) + : line(line), column(column), length(length), textStyles(textStyles), useTextSyles(true) {} bool operator==(const HighlightingResult& other) const @@ -59,5 +68,3 @@ public: }; } // namespace TextEditor - -#endif // TEXTEDITOR_SEMANTICHIGHLIGHTER_H diff --git a/tests/unit/unittest/chunksreportedmonitor.h b/tests/unit/unittest/chunksreportedmonitor.h index 4f082a8bbc..01058492fc 100644 --- a/tests/unit/unittest/chunksreportedmonitor.h +++ b/tests/unit/unittest/chunksreportedmonitor.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef CLANGBACKEND_CHUNKSREPORTEDMONITOR_H -#define CLANGBACKEND_CHUNKSREPORTEDMONITOR_H +#pragma once #include <QObject> #include <QFuture> @@ -54,5 +53,3 @@ private: }; } // namespace ClangBackEnd - -#endif // CLANGBACKEND_CHUNKSREPORTEDMONITOR_H diff --git a/tests/unit/unittest/clangipcservertest.cpp b/tests/unit/unittest/clangipcservertest.cpp index df8d615c3a..28206c35ea 100644 --- a/tests/unit/unittest/clangipcservertest.cpp +++ b/tests/unit/unittest/clangipcservertest.cpp @@ -81,6 +81,7 @@ using ClangBackEnd::UpdateVisibleTranslationUnitsMessage; using ClangBackEnd::RequestHighlightingMessage; using ClangBackEnd::HighlightingChangedMessage; using ClangBackEnd::HighlightingMarkContainer; +using ClangBackEnd::HighlightingTypes; MATCHER_P5(HasDirtyTranslationUnit, filePath, @@ -174,8 +175,10 @@ TEST_F(ClangIpcServer, GetCodeCompletion) TEST_F(ClangIpcServer, RequestHighlighting) { RequestHighlightingMessage requestHighlightingMessage({variableTestFilePath, projectPartId}); - - HighlightingMarkContainer highlightingMarkContainer(1, 6, 8, ClangBackEnd::HighlightingType::Function); + HighlightingTypes types; + types.mainHighlightingType = ClangBackEnd::HighlightingType::Function; + types.mixinHighlightingTypes.push_back(ClangBackEnd::HighlightingType::Declaration); + HighlightingMarkContainer highlightingMarkContainer(1, 6, 8, types); EXPECT_CALL(mockIpcClient, highlightingChanged(Property(&HighlightingChangedMessage::highlightingMarks, Contains(highlightingMarkContainer)))) .Times(1); diff --git a/tests/unit/unittest/data/complete_forwarding_header_1.h b/tests/unit/unittest/data/complete_forwarding_header_1.h index 4905abf3e8..ebd822c41b 100644 --- a/tests/unit/unittest/data/complete_forwarding_header_1.h +++ b/tests/unit/unittest/data/complete_forwarding_header_1.h @@ -1,6 +1,3 @@ -#ifndef COMPLETE_FORWARDING_HEADER_1_H -#define COMPLETE_FORWARDING_HEADER_1_H +#pragma once #include <complete_target_header.h> - -#endif // COMPLETE_FORWARDING_HEADER_1_H diff --git a/tests/unit/unittest/data/complete_forwarding_header_2.h b/tests/unit/unittest/data/complete_forwarding_header_2.h index dd0c3bc291..ebd822c41b 100644 --- a/tests/unit/unittest/data/complete_forwarding_header_2.h +++ b/tests/unit/unittest/data/complete_forwarding_header_2.h @@ -1,7 +1,3 @@ -#ifndef COMPLETE_FORWARDING_HEADER_2_H -#define COMPLETE_FORWARDING_HEADER_2_H +#pragma once #include <complete_target_header.h> - -#endif // COMPLETE_FORWARDING_HEADER_2_H - diff --git a/tests/unit/unittest/data/complete_target_header.h b/tests/unit/unittest/data/complete_target_header.h index 7d0ba1c845..67bc13701d 100644 --- a/tests/unit/unittest/data/complete_target_header.h +++ b/tests/unit/unittest/data/complete_target_header.h @@ -1,7 +1,3 @@ -#ifndef COMPLETE_TARGET_HEADER_H -#define COMPLETE_TARGET_HEADER_H +#pragma once void FunctionInIncludedHeader(); - -#endif // COMPLETE_TARGET_HEADER_H - diff --git a/tests/unit/unittest/data/complete_target_header_changed.h b/tests/unit/unittest/data/complete_target_header_changed.h index d631afd91b..be7ac4e532 100644 --- a/tests/unit/unittest/data/complete_target_header_changed.h +++ b/tests/unit/unittest/data/complete_target_header_changed.h @@ -1,8 +1,4 @@ -#ifndef COMPLETE_TARGET_HEADER_CHANGED_H -#define COMPLETE_TARGET_HEADER_CHANGED_H +#pragma once void FunctionInIncludedHeader(); void FunctionInIncludedHeaderChanged(); - -#endif // COMPLETE_TARGET_HEADER_CHANGED_H - diff --git a/tests/unit/unittest/data/complete_target_header_unsaved.h b/tests/unit/unittest/data/complete_target_header_unsaved.h index 904a861870..7007f9b5fe 100644 --- a/tests/unit/unittest/data/complete_target_header_unsaved.h +++ b/tests/unit/unittest/data/complete_target_header_unsaved.h @@ -1,8 +1,4 @@ -#ifndef COMPLETE_TARGET_HEADER_UNSAVED_H -#define COMPLETE_TARGET_HEADER_UNSAVED_H +#pragma once void FunctionInIncludedHeader(); void FunctionInIncludedHeaderUnsaved(); - -#endif // COMPLETE_TARGET_HEADER_UNSAVED_H - diff --git a/tests/unit/unittest/data/highlightinginformations.cpp b/tests/unit/unittest/data/highlightingmarks.cpp index e6121d1c9c..0fb2ea3beb 100644 --- a/tests/unit/unittest/data/highlightinginformations.cpp +++ b/tests/unit/unittest/data/highlightingmarks.cpp @@ -236,7 +236,7 @@ void f11() MacroDefinition(2, 4); } -#include "highlightinginformations.h" +#include "highlightingmarks.h" void f12() { GOTO_LABEL: @@ -286,7 +286,7 @@ void f12() OutputParameter(One, 2); } -#include <highlightinginformations.h> +#include <highlightingmarks.h> #define FOREACH(variable, container) \ variable; \ diff --git a/tests/unit/unittest/data/highlightinginformations.h b/tests/unit/unittest/data/highlightingmarks.h index e69de29bb2..e69de29bb2 100644 --- a/tests/unit/unittest/data/highlightinginformations.h +++ b/tests/unit/unittest/data/highlightingmarks.h diff --git a/tests/unit/unittest/data/translationunits.h b/tests/unit/unittest/data/translationunits.h index 151a9f28e1..67bc13701d 100644 --- a/tests/unit/unittest/data/translationunits.h +++ b/tests/unit/unittest/data/translationunits.h @@ -1,7 +1,3 @@ -#ifndef TRANSLATIONUNITS_H -#define TRANSLATIONUNITS_H +#pragma once void FunctionInIncludedHeader(); - -#endif // TRANSLATIONUNITS_H - diff --git a/tests/unit/unittest/gtest-qt-printing.h b/tests/unit/unittest/gtest-qt-printing.h index 8f0d7d14f9..0e5de633ad 100644 --- a/tests/unit/unittest/gtest-qt-printing.h +++ b/tests/unit/unittest/gtest-qt-printing.h @@ -30,8 +30,7 @@ #include <iostream> -#ifndef GTESTQTPRINTING_H -#define GTESTQTPRINTING_H +#pragma once QT_BEGIN_NAMESPACE class QVariant; @@ -59,5 +58,3 @@ QT_END_NAMESPACE //} //} -#endif // GTESTQTPRINTING_H - diff --git a/tests/unit/unittest/highlightinginformationstest.cpp b/tests/unit/unittest/highlightinginformationstest.cpp deleted file mode 100644 index 379319ec1d..0000000000 --- a/tests/unit/unittest/highlightinginformationstest.cpp +++ /dev/null @@ -1,1018 +0,0 @@ -/**************************************************************************** -** -** 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 <cursor.h> -#include <clangbackendipc_global.h> -#include <clangstring.h> -#include <projectpart.h> -#include <projects.h> -#include <sourcelocation.h> -#include <sourcerange.h> -#include <highlightinginformation.h> -#include <highlightinginformations.h> -#include <clangtranslationunit.h> -#include <translationunits.h> -#include <unsavedfiles.h> - -#include <gmock/gmock.h> -#include <gmock/gmock-matchers.h> -#include <gtest/gtest.h> -#include "gtest-qt-printing.h" - -using ClangBackEnd::Cursor; -using ClangBackEnd::HighlightingInformation; -using ClangBackEnd::HighlightingInformations; -using ClangBackEnd::HighlightingType; -using ClangBackEnd::TranslationUnit; -using ClangBackEnd::UnsavedFiles; -using ClangBackEnd::ProjectPart; -using ClangBackEnd::TranslationUnits; -using ClangBackEnd::ClangString; -using ClangBackEnd::SourceRange; - -using testing::PrintToString; -using testing::IsNull; -using testing::NotNull; -using testing::Gt; -using testing::Contains; -using testing::EndsWith; -using testing::AllOf; -using testing::Not; -using testing::IsEmpty; -using testing::SizeIs; - -namespace { - -MATCHER_P4(IsHighlightingInformation, line, column, length, type, - std::string(negation ? "isn't " : "is ") - + PrintToString(HighlightingInformation(line, column, length, type)) - ) -{ - const HighlightingInformation expected(line, column, length, type); - - return arg == expected; -} - -MATCHER_P(HasType, type, - std::string(negation ? "isn't " : "is ") - + PrintToString(type) - ) -{ - return arg.hasType(type); -} - -struct Data { - ClangBackEnd::ProjectParts projects; - ClangBackEnd::UnsavedFiles unsavedFiles; - ClangBackEnd::TranslationUnits translationUnits{projects, unsavedFiles}; - TranslationUnit translationUnit{Utf8StringLiteral(TESTDATA_DIR"/highlightinginformations.cpp"), - ProjectPart(Utf8StringLiteral("projectPartId"), {Utf8StringLiteral("-std=c++14")}), - {}, - translationUnits}; -}; - -class HighlightingInformations : public ::testing::Test -{ -public: - static void SetUpTestCase(); - static void TearDownTestCase(); - - SourceRange sourceRange(uint line, uint columnEnd) const; - -protected: - static Data *d; - const TranslationUnit &translationUnit = d->translationUnit; -}; - -TEST_F(HighlightingInformations, CreateNullInformations) -{ - ::HighlightingInformations infos; - - ASSERT_TRUE(infos.isNull()); -} - -TEST_F(HighlightingInformations, NullInformationsAreEmpty) -{ - ::HighlightingInformations infos; - - ASSERT_TRUE(infos.isEmpty()); -} - -TEST_F(HighlightingInformations, IsNotNull) -{ - const auto aRange = translationUnit.sourceRange(3, 1, 5, 1); - - const auto infos = translationUnit.highlightingInformationsInRange(aRange); - - ASSERT_FALSE(infos.isNull()); -} - -TEST_F(HighlightingInformations, IteratorBeginEnd) -{ - const auto aRange = translationUnit.sourceRange(3, 1, 5, 1); - const auto infos = translationUnit.highlightingInformationsInRange(aRange); - - const auto endIterator = std::next(infos.begin(), infos.size()); - - ASSERT_THAT(infos.end(), endIterator); -} - -TEST_F(HighlightingInformations, ForFullTranslationUnitRange) -{ - const auto infos = translationUnit.highlightingInformations(); - - ASSERT_THAT(infos, AllOf(Contains(IsHighlightingInformation(1u, 1u, 4u, HighlightingType::Keyword)), - Contains(IsHighlightingInformation(277u, 5u, 15u, HighlightingType::Function)))); -} - -TEST_F(HighlightingInformations, Size) -{ - const auto range = translationUnit.sourceRange(5, 5, 5, 10); - - const auto infos = translationUnit.highlightingInformationsInRange(range); - - ASSERT_THAT(infos.size(), 1); -} - -TEST_F(HighlightingInformations, DISABLED_Keyword) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(5, 12)); - - ASSERT_THAT(infos[0], IsHighlightingInformation(5u, 5u, 6u, HighlightingType::Keyword)); -} - -TEST_F(HighlightingInformations, StringLiteral) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(1, 29)); - - ASSERT_THAT(infos[4], IsHighlightingInformation(1u, 24u, 10u, HighlightingType::StringLiteral)); -} - -TEST_F(HighlightingInformations, Utf8StringLiteral) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(2, 33)); - - ASSERT_THAT(infos[4], IsHighlightingInformation(2u, 24u, 12u, HighlightingType::StringLiteral)); -} - -TEST_F(HighlightingInformations, RawStringLiteral) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(3, 34)); - - ASSERT_THAT(infos[4], IsHighlightingInformation(3u, 24u, 13u, HighlightingType::StringLiteral)); -} - -TEST_F(HighlightingInformations, CharacterLiteral) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(4, 28)); - - ASSERT_THAT(infos[3], IsHighlightingInformation(4u, 24u, 3u, HighlightingType::StringLiteral)); -} - -TEST_F(HighlightingInformations, IntegerLiteral) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(23, 26)); - - ASSERT_THAT(infos[3], IsHighlightingInformation(23u, 24u, 1u, HighlightingType::NumberLiteral)); -} - -TEST_F(HighlightingInformations, FloatLiteral) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(24, 29)); - - ASSERT_THAT(infos[3], IsHighlightingInformation(24u, 24u, 4u, HighlightingType::NumberLiteral)); -} - -TEST_F(HighlightingInformations, FunctionDefinition) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(45, 20)); - - ASSERT_THAT(infos[1], IsHighlightingInformation(45u, 5u, 8u, HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, MemberFunctionDefinition) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(52, 29)); - - ASSERT_THAT(infos[1], IsHighlightingInformation(52u, 10u, 14u, HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, FunctionDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(55, 32)); - - ASSERT_THAT(infos[1], IsHighlightingInformation(55u, 5u, 19u, HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, MemberFunctionDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(59, 27)); - - ASSERT_THAT(infos[1], IsHighlightingInformation(59u, 10u, 14u, HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, MemberFunctionReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(104, 35)); - - ASSERT_THAT(infos[0], IsHighlightingInformation(104u, 9u, 23u, HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, FunctionCall) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(64, 16)); - - ASSERT_THAT(infos[0], IsHighlightingInformation(64u, 5u, 8u, HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, TypeConversionFunction) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(68, 20)); - - ASSERT_THAT(infos[1], IsHighlightingInformation(68u, 14u, 3u, HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, InbuiltTypeConversionFunction) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(69, 20)); - - ASSERT_THAT(infos[1], IsHighlightingInformation(69u, 14u, 3u, HighlightingType::Keyword)); -} - -TEST_F(HighlightingInformations, TypeReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(74, 13)); - - ASSERT_THAT(infos[0], IsHighlightingInformation(74u, 5u, 3u, HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, LocalVariable) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(79, 13)); - - ASSERT_THAT(infos[1], IsHighlightingInformation(79u, 9u, 3u, HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, LocalVariableDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(79, 13)); - - ASSERT_THAT(infos[1], IsHighlightingInformation(79u, 9u, 3u, HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, LocalVariableReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(81, 26)); - - ASSERT_THAT(infos[0], IsHighlightingInformation(81u, 5u, 3u, HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, LocalVariableFunctionArgumentDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(84, 45)); - - ASSERT_THAT(infos[5], IsHighlightingInformation(84u, 41u, 3u, HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, LocalVariableFunctionArgumentReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(86, 26)); - - ASSERT_THAT(infos[0], IsHighlightingInformation(86u, 5u, 3u, HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, ClassVariableDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(90, 21)); - - ASSERT_THAT(infos[1], IsHighlightingInformation(90u, 9u, 11u, HighlightingType::Field)); -} - -TEST_F(HighlightingInformations, ClassVariableReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(94, 23)); - - ASSERT_THAT(infos[0], IsHighlightingInformation(94u, 9u, 11u, HighlightingType::Field)); -} - -TEST_F(HighlightingInformations, StaticMethodDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(110, 25)); - - ASSERT_THAT(infos[1], IsHighlightingInformation(110u, 10u, 12u, HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, StaticMethodReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(114, 30)); - - ASSERT_THAT(infos[2], IsHighlightingInformation(114u, 15u, 12u, HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, Enumeration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(118, 17)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, Enumerator) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(120, 15)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Enumeration)); -} - -TEST_F(HighlightingInformations, EnumerationReferenceDeclarationType) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(125, 28)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, EnumerationReferenceDeclarationVariable) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(125, 28)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, EnumerationReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(127, 30)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, EnumeratorReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(127, 30)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::Enumeration)); -} - -TEST_F(HighlightingInformations, ClassForwardDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(130, 12)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, ConstructorDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(134, 13)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, DestructorDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(135, 15)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, ClassForwardDeclarationReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(138, 23)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, ClassTypeReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(140, 32)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, ConstructorReferenceVariable) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(140, 32)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, UnionDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(145, 12)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, UnionDeclarationReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(150, 33)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, GlobalVariable) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(150, 33)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::GlobalVariable)); -} - -TEST_F(HighlightingInformations, StructDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(50, 11)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, NameSpace) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(160, 22)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, NameSpaceAlias) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(164, 38)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, UsingStructInNameSpace) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(165, 36)); - - ASSERT_THAT(infos[3], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, NameSpaceReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(166, 35)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, StructInNameSpaceReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(166, 35)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, VirtualFunction) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(170, 35)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::VirtualFunction)); -} - -TEST_F(HighlightingInformations, DISABLED_NonVirtualFunctionCall) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(177, 46)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, DISABLED_NonVirtualFunctionCallPointer) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(180, 54)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, VirtualFunctionCallPointer) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(192, 51)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::VirtualFunction)); -} - -TEST_F(HighlightingInformations, FinalVirtualFunctionCallPointer) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(202, 61)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, NonFinalVirtualFunctionCallPointer) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(207, 61)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::VirtualFunction)); -} - -TEST_F(HighlightingInformations, PlusOperator) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(224, 49)); - - ASSERT_THAT(infos[6], HasType(HighlightingType::Operator)); -} - -TEST_F(HighlightingInformations, PlusAssignOperator) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(226, 24)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Operator)); -} - -TEST_F(HighlightingInformations, Comment) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(229, 14)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Comment)); -} - -TEST_F(HighlightingInformations, PreprocessingDirective) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(231, 37)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Preprocessor)); -} - -TEST_F(HighlightingInformations, PreprocessorMacroDefinition) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(231, 37)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::PreprocessorDefinition)); -} - -TEST_F(HighlightingInformations, PreprocessorFunctionMacroDefinition) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(232, 47)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::PreprocessorDefinition)); -} - -TEST_F(HighlightingInformations, PreprocessorMacroExpansion) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(236, 27)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::PreprocessorExpansion)); -} - -TEST_F(HighlightingInformations, PreprocessorMacroExpansionArgument) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(236, 27)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::NumberLiteral)); -} - -TEST_F(HighlightingInformations, PreprocessorInclusionDirective) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(239, 18)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::StringLiteral)); -} - -TEST_F(HighlightingInformations, GotoLabelStatement) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(242, 12)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Label)); -} - -TEST_F(HighlightingInformations, GotoLabelStatementReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(244, 21)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Label)); -} - -TEST_F(HighlightingInformations, TemplateReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(254, 25)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, TemplateTypeParameter) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(265, 135)); - - ASSERT_THAT(infos[3], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, TemplateDefaultParameter) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(265, 135)); - - ASSERT_THAT(infos[5], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, NonTypeTemplateParameter) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(265, 135)); - - ASSERT_THAT(infos[8], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, NonTypeTemplateParameterDefaultArgument) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(265, 135)); - - ASSERT_THAT(infos[10], HasType(HighlightingType::NumberLiteral)); -} - -TEST_F(HighlightingInformations, TemplateTemplateParameter) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(265, 135)); - - ASSERT_THAT(infos[17], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, TemplateTemplateParameterDefaultArgument) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(265, 135)); - - ASSERT_THAT(infos[19], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, TemplateFunctionDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(266, 63)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, TemplateTypeParameterReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(268, 58)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, TemplateTypeParameterDeclarationReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(268, 58)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, NonTypeTemplateParameterReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(269, 71)); - - ASSERT_THAT(infos[3], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, NonTypeTemplateParameterReferenceReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(269, 71)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, TemplateTemplateParameterReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(270, 89)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, TemplateTemplateContainerParameterReference) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(270, 89)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, TemplateTemplateParameterReferenceVariable) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(270, 89)); - - ASSERT_THAT(infos[4], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, ClassFinalVirtualFunctionCallPointer) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(212, 61)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, ClassFinalVirtualFunctionCall) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(277, 23)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, HasFunctionArguments) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(286, 29)); - - ASSERT_TRUE(infos[1].hasFunctionArguments()); -} - -TEST_F(HighlightingInformations, NoOutputFunctionArguments) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(285, 13)); - - auto outputFunctionArguments = infos[1].outputFunctionArguments(); - - ASSERT_THAT(outputFunctionArguments, IsEmpty()); -} - -TEST_F(HighlightingInformations, DISABLED_OneOutputFunctionArguments) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(285, 13)); - - auto outputFunctionArguments = infos[1].outputFunctionArguments(); - - ASSERT_THAT(outputFunctionArguments, SizeIs(1)); -} - -TEST_F(HighlightingInformations, PreprocessorInclusionDirectiveWithAngleBrackets ) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(289, 38)); - - ASSERT_THAT(infos[3], HasType(HighlightingType::StringLiteral)); -} - -TEST_F(HighlightingInformations, ArgumentInMacroExpansionIsKeyword) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(302, 36)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::Keyword)); -} - -TEST_F(HighlightingInformations, DISABLED_FirstArgumentInMacroExpansionIsLocalVariable) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(302, 36)); - - ASSERT_THAT(infos[3], HasType(HighlightingType::Invalid)); -} - -TEST_F(HighlightingInformations, DISABLED_SecondArgumentInMacroExpansionIsLocalVariable) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(302, 36)); - - ASSERT_THAT(infos[5], HasType(HighlightingType::Invalid)); -} - -TEST_F(HighlightingInformations, DISABLED_SecondArgumentInMacroExpansionIsField) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(310, 40)); - - ASSERT_THAT(infos[5], HasType(HighlightingType::Invalid)); -} - - -TEST_F(HighlightingInformations, DISABLED_EnumerationType) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(316, 30)); - - ASSERT_THAT(infos[3], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, TypeInStaticCast) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(328, 64)); - - ASSERT_THAT(infos[4], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, StaticCastIsKeyword) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(328, 64)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Keyword)); -} - -TEST_F(HighlightingInformations, StaticCastPunctationIsInvalid) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(328, 64)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Invalid)); - ASSERT_THAT(infos[3], HasType(HighlightingType::Invalid)); - ASSERT_THAT(infos[5], HasType(HighlightingType::Invalid)); -} - -TEST_F(HighlightingInformations, TypeInReinterpretCast) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(329, 69)); - - ASSERT_THAT(infos[4], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, IntegerAliasDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(333, 41)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, IntegerAlias) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(341, 31)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, SecondIntegerAlias) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(342, 43)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, IntegerTypedef) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(343, 35)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, FunctionAlias) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(344, 16)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, FriendTypeDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(350, 28)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::Invalid)); -} - -TEST_F(HighlightingInformations, FriendArgumentTypeDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(351, 65)); - - ASSERT_THAT(infos[6], HasType(HighlightingType::Invalid)); -} - -TEST_F(HighlightingInformations, FriendArgumentDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(351, 65)); - - ASSERT_THAT(infos[8], HasType(HighlightingType::Invalid)); -} - -TEST_F(HighlightingInformations, FieldInitialization) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(358, 18)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Field)); -} - -TEST_F(HighlightingInformations, TemplateFunctionCall) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(372, 29)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Function)); -} - -TEST_F(HighlightingInformations, TemplatedType) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(377, 21)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, TemplatedTypeDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(384, 49)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, NoOperator) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(389, 24)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::Invalid)); -} - -TEST_F(HighlightingInformations, ScopeOperator) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(400, 33)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::Invalid)); -} - -TEST_F(HighlightingInformations, TemplateClassNamespace) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(413, 78)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, TemplateClass) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(413, 78)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, TemplateClassParameter) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(413, 78)); - - ASSERT_THAT(infos[4], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, TemplateClassDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(413, 78)); - - ASSERT_THAT(infos[6], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, TypeDefDeclaration) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(418, 36)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, TypeDefDeclarationUsage) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(419, 48)); - - ASSERT_THAT(infos[0], HasType(HighlightingType::Type)); -} - -TEST_F(HighlightingInformations, DISABLED_EnumerationTypeDef) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(424, 41)); - - ASSERT_THAT(infos[3], HasType(HighlightingType::Type)); -} - -// QTCREATORBUG-15473 -TEST_F(HighlightingInformations, DISABLED_ArgumentToUserDefinedIndexOperator) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(434, 19)); - - ASSERT_THAT(infos[2], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, LambdaCapture) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(442, 47)); - - ASSERT_THAT(infos[4], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, LambdaCapturedVarUsage) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(443, 41)); - - ASSERT_THAT(infos[1], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, LambdaArgumentUsage) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(443, 41)); - - ASSERT_THAT(infos[3], HasType(HighlightingType::LocalVariable)); -} - -TEST_F(HighlightingInformations, LambdaFieldUsage) -{ - const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(443, 41)); - - ASSERT_THAT(infos[5], HasType(HighlightingType::Field)); -} - -Data *HighlightingInformations::d; - -void HighlightingInformations::SetUpTestCase() -{ - d = new Data; -} - -void HighlightingInformations::TearDownTestCase() -{ - delete d; - d = nullptr; -} - -ClangBackEnd::SourceRange HighlightingInformations::sourceRange(uint line, uint columnEnd) const -{ - return translationUnit.sourceRange(line, 1, line, columnEnd); -} - -} diff --git a/tests/unit/unittest/highlightingmarksreportertest.cpp b/tests/unit/unittest/highlightingmarksreportertest.cpp index 831344b649..11d1cbf5ed 100644 --- a/tests/unit/unittest/highlightingmarksreportertest.cpp +++ b/tests/unit/unittest/highlightingmarksreportertest.cpp @@ -38,7 +38,7 @@ #include "gtest-qt-printing.h" using ClangBackEnd::Cursor; -using ClangBackEnd::HighlightingInformations; +using ClangBackEnd::HighlightingMarks; using ClangBackEnd::HighlightingMarkContainer; using ClangBackEnd::HighlightingType; using ClangBackEnd::TranslationUnit; @@ -54,7 +54,7 @@ struct Data { ProjectParts projects; UnsavedFiles unsavedFiles; TranslationUnits translationUnits{projects, unsavedFiles}; - TranslationUnit translationUnit{Utf8StringLiteral(TESTDATA_DIR"/highlightinginformations.cpp"), + TranslationUnit translationUnit{Utf8StringLiteral(TESTDATA_DIR"/highlightingmarks.cpp"), ProjectPart(Utf8StringLiteral("projectPartId"), {Utf8StringLiteral("-std=c++14")}), {}, diff --git a/tests/unit/unittest/highlightingmarkstest.cpp b/tests/unit/unittest/highlightingmarkstest.cpp new file mode 100644 index 0000000000..ebb388d3bb --- /dev/null +++ b/tests/unit/unittest/highlightingmarkstest.cpp @@ -0,0 +1,983 @@ +/**************************************************************************** +** +** 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 <cursor.h> +#include <clangbackendipc_global.h> +#include <clangstring.h> +#include <projectpart.h> +#include <projects.h> +#include <sourcelocation.h> +#include <sourcerange.h> +#include <highlightingmark.h> +#include <highlightingmarks.h> +#include <clangtranslationunit.h> +#include <translationunits.h> +#include <unsavedfiles.h> + +#include <gmock/gmock.h> +#include <gmock/gmock-matchers.h> +#include <gtest/gtest.h> +#include "gtest-qt-printing.h" + +using ClangBackEnd::Cursor; +using ClangBackEnd::HighlightingTypes; +using ClangBackEnd::HighlightingMark; +using ClangBackEnd::HighlightingMarks; +using ClangBackEnd::HighlightingType; +using ClangBackEnd::TranslationUnit; +using ClangBackEnd::UnsavedFiles; +using ClangBackEnd::ProjectPart; +using ClangBackEnd::TranslationUnits; +using ClangBackEnd::ClangString; +using ClangBackEnd::SourceRange; + +using testing::PrintToString; +using testing::IsNull; +using testing::NotNull; +using testing::Gt; +using testing::Contains; +using testing::EndsWith; +using testing::AllOf; +using testing::Not; +using testing::IsEmpty; +using testing::SizeIs; + +namespace { + +MATCHER_P4(IsHighlightingMark, line, column, length, type, + std::string(negation ? "isn't " : "is ") + + PrintToString(HighlightingMark(line, column, length, type)) + ) +{ + const HighlightingMark expected(line, column, length, type); + + return arg == expected; +} + +MATCHER_P(HasOnlyType, type, + std::string(negation ? "isn't " : "is ") + + PrintToString(type) + ) +{ + return arg.hasOnlyType(type); +} + +MATCHER_P2(HasTwoTypes, firstType, secondType, + std::string(negation ? "isn't " : "is ") + + PrintToString(firstType) + + " and " + + PrintToString(secondType) + ) +{ + return arg.hasMainType(firstType) && arg.hasMixinType(secondType); +} + +struct Data { + ClangBackEnd::ProjectParts projects; + ClangBackEnd::UnsavedFiles unsavedFiles; + ClangBackEnd::TranslationUnits translationUnits{projects, unsavedFiles}; + TranslationUnit translationUnit{Utf8StringLiteral(TESTDATA_DIR"/highlightingmarks.cpp"), + ProjectPart(Utf8StringLiteral("projectPartId"), {Utf8StringLiteral("-std=c++14")}), + {}, + translationUnits}; +}; + +class HighlightingMarks : public ::testing::Test +{ +public: + static void SetUpTestCase(); + static void TearDownTestCase(); + + SourceRange sourceRange(uint line, uint columnEnd) const; + +protected: + static Data *d; + const TranslationUnit &translationUnit = d->translationUnit; +}; + +TEST_F(HighlightingMarks, CreateNullInformations) +{ + ::HighlightingMarks infos; + + ASSERT_TRUE(infos.isNull()); +} + +TEST_F(HighlightingMarks, NullInformationsAreEmpty) +{ + ::HighlightingMarks infos; + + ASSERT_TRUE(infos.isEmpty()); +} + +TEST_F(HighlightingMarks, IsNotNull) +{ + const auto aRange = translationUnit.sourceRange(3, 1, 5, 1); + + const auto infos = translationUnit.highlightingMarksInRange(aRange); + + ASSERT_FALSE(infos.isNull()); +} + +TEST_F(HighlightingMarks, IteratorBeginEnd) +{ + const auto aRange = translationUnit.sourceRange(3, 1, 5, 1); + const auto infos = translationUnit.highlightingMarksInRange(aRange); + + const auto endIterator = std::next(infos.begin(), infos.size()); + + ASSERT_THAT(infos.end(), endIterator); +} + +TEST_F(HighlightingMarks, ForFullTranslationUnitRange) +{ + const auto infos = translationUnit.highlightingMarks(); + + ASSERT_THAT(infos, AllOf(Contains(IsHighlightingMark(1u, 1u, 4u, HighlightingType::Keyword)), + Contains(IsHighlightingMark(277u, 5u, 15u, HighlightingType::Function)))); +} + +TEST_F(HighlightingMarks, Size) +{ + const auto range = translationUnit.sourceRange(5, 5, 5, 10); + + const auto infos = translationUnit.highlightingMarksInRange(range); + + ASSERT_THAT(infos.size(), 1); +} + +TEST_F(HighlightingMarks, DISABLED_Keyword) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(5, 12)); + + ASSERT_THAT(infos[0], IsHighlightingMark(5u, 5u, 6u, HighlightingType::Keyword)); +} + +TEST_F(HighlightingMarks, StringLiteral) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(1, 29)); + + ASSERT_THAT(infos[4], IsHighlightingMark(1u, 24u, 10u, HighlightingType::StringLiteral)); +} + +TEST_F(HighlightingMarks, Utf8StringLiteral) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(2, 33)); + + ASSERT_THAT(infos[4], IsHighlightingMark(2u, 24u, 12u, HighlightingType::StringLiteral)); +} + +TEST_F(HighlightingMarks, RawStringLiteral) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(3, 34)); + + ASSERT_THAT(infos[4], IsHighlightingMark(3u, 24u, 13u, HighlightingType::StringLiteral)); +} + +TEST_F(HighlightingMarks, CharacterLiteral) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(4, 28)); + + ASSERT_THAT(infos[3], IsHighlightingMark(4u, 24u, 3u, HighlightingType::StringLiteral)); +} + +TEST_F(HighlightingMarks, IntegerLiteral) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(23, 26)); + + ASSERT_THAT(infos[3], IsHighlightingMark(23u, 24u, 1u, HighlightingType::NumberLiteral)); +} + +TEST_F(HighlightingMarks, FloatLiteral) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(24, 29)); + + ASSERT_THAT(infos[3], IsHighlightingMark(24u, 24u, 4u, HighlightingType::NumberLiteral)); +} + +TEST_F(HighlightingMarks, FunctionDefinition) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(45, 20)); + + ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Function, HighlightingType::Declaration)); +} + +TEST_F(HighlightingMarks, MemberFunctionDefinition) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(52, 29)); + + ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Function, HighlightingType::Declaration)); +} + +TEST_F(HighlightingMarks, FunctionDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(55, 32)); + + ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Function, HighlightingType::Declaration)); +} + +TEST_F(HighlightingMarks, MemberFunctionDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(59, 27)); + + ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Function, HighlightingType::Declaration)); +} + +TEST_F(HighlightingMarks, MemberFunctionReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(104, 35)); + + ASSERT_THAT(infos[0], IsHighlightingMark(104u, 9u, 23u, HighlightingType::Function)); +} + +TEST_F(HighlightingMarks, FunctionCall) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(64, 16)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Function)); +} + +TEST_F(HighlightingMarks, TypeConversionFunction) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(68, 20)); + + ASSERT_THAT(infos[1], IsHighlightingMark(68u, 14u, 3u, HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, InbuiltTypeConversionFunction) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(69, 20)); + + ASSERT_THAT(infos[1], IsHighlightingMark(69u, 14u, 3u, HighlightingType::Keyword)); +} + +TEST_F(HighlightingMarks, TypeReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(74, 13)); + + ASSERT_THAT(infos[0], IsHighlightingMark(74u, 5u, 3u, HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, LocalVariable) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(79, 13)); + + ASSERT_THAT(infos[1], IsHighlightingMark(79u, 9u, 3u, HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, LocalVariableDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(79, 13)); + + ASSERT_THAT(infos[1], IsHighlightingMark(79u, 9u, 3u, HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, LocalVariableReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(81, 26)); + + ASSERT_THAT(infos[0], IsHighlightingMark(81u, 5u, 3u, HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, LocalVariableFunctionArgumentDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(84, 45)); + + ASSERT_THAT(infos[5], IsHighlightingMark(84u, 41u, 3u, HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, LocalVariableFunctionArgumentReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(86, 26)); + + ASSERT_THAT(infos[0], IsHighlightingMark(86u, 5u, 3u, HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, ClassVariableDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(90, 21)); + + ASSERT_THAT(infos[1], IsHighlightingMark(90u, 9u, 11u, HighlightingType::Field)); +} + +TEST_F(HighlightingMarks, ClassVariableReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(94, 23)); + + ASSERT_THAT(infos[0], IsHighlightingMark(94u, 9u, 11u, HighlightingType::Field)); +} + +TEST_F(HighlightingMarks, StaticMethodDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(110, 25)); + + ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Function, HighlightingType::Declaration)); +} + +TEST_F(HighlightingMarks, StaticMethodReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(114, 30)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); +} + +TEST_F(HighlightingMarks, Enumeration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(118, 17)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, Enumerator) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(120, 15)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Enumeration)); +} + +TEST_F(HighlightingMarks, EnumerationReferenceDeclarationType) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(125, 28)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, EnumerationReferenceDeclarationVariable) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(125, 28)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, EnumerationReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(127, 30)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, EnumeratorReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(127, 30)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Enumeration)); +} + +TEST_F(HighlightingMarks, ClassForwardDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(130, 12)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, ConstructorDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(134, 13)); + + ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Function, HighlightingType::Declaration)); +} + +TEST_F(HighlightingMarks, DestructorDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(135, 15)); + + ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Function, HighlightingType::Declaration)); +} + +TEST_F(HighlightingMarks, ClassForwardDeclarationReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(138, 23)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, ClassTypeReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(140, 32)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, ConstructorReferenceVariable) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(140, 32)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, UnionDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(145, 12)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, UnionDeclarationReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(150, 33)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, GlobalVariable) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(150, 33)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::GlobalVariable)); +} + +TEST_F(HighlightingMarks, StructDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(50, 11)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, NameSpace) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(160, 22)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, NameSpaceAlias) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(164, 38)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, UsingStructInNameSpace) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(165, 36)); + + ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, NameSpaceReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(166, 35)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, StructInNameSpaceReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(166, 35)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, VirtualFunctionDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(170, 35)); + + ASSERT_THAT(infos[2], HasTwoTypes(HighlightingType::VirtualFunction, HighlightingType::Declaration)); +} + +TEST_F(HighlightingMarks, DISABLED_NonVirtualFunctionCall) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(177, 46)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); +} + +TEST_F(HighlightingMarks, DISABLED_NonVirtualFunctionCallPointer) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(180, 54)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); +} + +TEST_F(HighlightingMarks, VirtualFunctionCallPointer) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(192, 51)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::VirtualFunction)); +} + +TEST_F(HighlightingMarks, FinalVirtualFunctionCallPointer) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(202, 61)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); +} + +TEST_F(HighlightingMarks, NonFinalVirtualFunctionCallPointer) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(207, 61)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::VirtualFunction)); +} + +TEST_F(HighlightingMarks, PlusOperator) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(224, 49)); + + ASSERT_THAT(infos[6], HasOnlyType(HighlightingType::Operator)); +} + +TEST_F(HighlightingMarks, PlusAssignOperator) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(226, 24)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Operator)); +} + +TEST_F(HighlightingMarks, Comment) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(229, 14)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Comment)); +} + +TEST_F(HighlightingMarks, PreprocessingDirective) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(231, 37)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Preprocessor)); +} + +TEST_F(HighlightingMarks, PreprocessorMacroDefinition) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(231, 37)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::PreprocessorDefinition)); +} + +TEST_F(HighlightingMarks, PreprocessorFunctionMacroDefinition) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(232, 47)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::PreprocessorDefinition)); +} + +TEST_F(HighlightingMarks, PreprocessorMacroExpansion) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(236, 27)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::PreprocessorExpansion)); +} + +TEST_F(HighlightingMarks, PreprocessorMacroExpansionArgument) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(236, 27)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::NumberLiteral)); +} + +TEST_F(HighlightingMarks, PreprocessorInclusionDirective) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(239, 18)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::StringLiteral)); +} + +TEST_F(HighlightingMarks, GotoLabelStatement) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(242, 12)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Label)); +} + +TEST_F(HighlightingMarks, GotoLabelStatementReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(244, 21)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Label)); +} + +TEST_F(HighlightingMarks, TemplateReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(254, 25)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Function)); +} + +TEST_F(HighlightingMarks, TemplateTypeParameter) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(265, 135)); + + ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, TemplateDefaultParameter) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(265, 135)); + + ASSERT_THAT(infos[5], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, NonTypeTemplateParameter) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(265, 135)); + + ASSERT_THAT(infos[8], HasOnlyType(HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, NonTypeTemplateParameterDefaultArgument) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(265, 135)); + + ASSERT_THAT(infos[10], HasOnlyType(HighlightingType::NumberLiteral)); +} + +TEST_F(HighlightingMarks, TemplateTemplateParameter) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(265, 135)); + + ASSERT_THAT(infos[17], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, TemplateTemplateParameterDefaultArgument) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(265, 135)); + + ASSERT_THAT(infos[19], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, TemplateFunctionDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(266, 63)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Function)); +} + +TEST_F(HighlightingMarks, TemplateTypeParameterReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(268, 58)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, TemplateTypeParameterDeclarationReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(268, 58)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, NonTypeTemplateParameterReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(269, 71)); + + ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, NonTypeTemplateParameterReferenceReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(269, 71)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, TemplateTemplateParameterReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(270, 89)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, TemplateTemplateContainerParameterReference) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(270, 89)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, TemplateTemplateParameterReferenceVariable) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(270, 89)); + + ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, ClassFinalVirtualFunctionCallPointer) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(212, 61)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); +} + +TEST_F(HighlightingMarks, ClassFinalVirtualFunctionCall) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(277, 23)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Function)); +} + +TEST_F(HighlightingMarks, HasFunctionArguments) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(286, 29)); + + ASSERT_TRUE(infos[1].hasFunctionArguments()); +} + +TEST_F(HighlightingMarks, PreprocessorInclusionDirectiveWithAngleBrackets ) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(289, 38)); + + ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::StringLiteral)); +} + +TEST_F(HighlightingMarks, ArgumentInMacroExpansionIsKeyword) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(302, 36)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Keyword)); +} + +TEST_F(HighlightingMarks, DISABLED_FirstArgumentInMacroExpansionIsLocalVariable) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(302, 36)); + + ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Invalid)); +} + +TEST_F(HighlightingMarks, DISABLED_SecondArgumentInMacroExpansionIsLocalVariable) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(302, 36)); + + ASSERT_THAT(infos[5], HasOnlyType(HighlightingType::Invalid)); +} + +TEST_F(HighlightingMarks, DISABLED_SecondArgumentInMacroExpansionIsField) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(310, 40)); + + ASSERT_THAT(infos[5], HasOnlyType(HighlightingType::Invalid)); +} + + +TEST_F(HighlightingMarks, DISABLED_EnumerationType) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(316, 30)); + + ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, TypeInStaticCast) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(328, 64)); + + ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, StaticCastIsKeyword) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(328, 64)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Keyword)); +} + +TEST_F(HighlightingMarks, StaticCastPunctationIsInvalid) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(328, 64)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Invalid)); + ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Invalid)); + ASSERT_THAT(infos[5], HasOnlyType(HighlightingType::Invalid)); +} + +TEST_F(HighlightingMarks, TypeInReinterpretCast) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(329, 69)); + + ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, IntegerAliasDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(333, 41)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, IntegerAlias) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(341, 31)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, SecondIntegerAlias) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(342, 43)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, IntegerTypedef) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(343, 35)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, FunctionAlias) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(344, 16)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, FriendTypeDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(350, 28)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Invalid)); +} + +TEST_F(HighlightingMarks, FriendArgumentTypeDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(351, 65)); + + ASSERT_THAT(infos[6], HasOnlyType(HighlightingType::Invalid)); +} + +TEST_F(HighlightingMarks, FriendArgumentDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(351, 65)); + + ASSERT_THAT(infos[8], HasOnlyType(HighlightingType::Invalid)); +} + +TEST_F(HighlightingMarks, FieldInitialization) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(358, 18)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Field)); +} + +TEST_F(HighlightingMarks, TemplateFunctionCall) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(372, 29)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Function)); +} + +TEST_F(HighlightingMarks, TemplatedType) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(377, 21)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, TemplatedTypeDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(384, 49)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, NoOperator) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(389, 24)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Invalid)); +} + +TEST_F(HighlightingMarks, ScopeOperator) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(400, 33)); + + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Invalid)); +} + +TEST_F(HighlightingMarks, TemplateClassNamespace) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(413, 78)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, TemplateClass) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(413, 78)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, TemplateClassParameter) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(413, 78)); + + ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, TemplateClassDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(413, 78)); + + ASSERT_THAT(infos[6], HasOnlyType(HighlightingType::LocalVariable)); +} + +TEST_F(HighlightingMarks, TypeDefDeclaration) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(418, 36)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, TypeDefDeclarationUsage) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(419, 48)); + + ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Type)); +} + +TEST_F(HighlightingMarks, DISABLED_EnumerationTypeDef) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(424, 41)); + + ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Type)); +} + +// QTCREATORBUG-15473 +TEST_F(HighlightingMarks, DISABLED_ArgumentToUserDefinedIndexOperator) +{ + const auto infos = translationUnit.highlightingMarksInRange(sourceRange(434, 19)); + + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::LocalVariable)); +} + +Data *HighlightingMarks::d; + +void HighlightingMarks::SetUpTestCase() +{ + d = new Data; +} + +void HighlightingMarks::TearDownTestCase() +{ + delete d; + d = nullptr; +} + +ClangBackEnd::SourceRange HighlightingMarks::sourceRange(uint line, uint columnEnd) const +{ + return translationUnit.sourceRange(line, 1, line, columnEnd); +} + +} diff --git a/tests/unit/unittest/mockipclient.h b/tests/unit/unittest/mockipclient.h index e57c177ee3..447de2c9bd 100644 --- a/tests/unit/unittest/mockipclient.h +++ b/tests/unit/unittest/mockipclient.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MOCKIPCLIENT_H -#define MOCKIPCLIENT_H +#pragma once #include <ipcclientinterface.h> @@ -50,6 +49,3 @@ public: MOCK_METHOD1(highlightingChanged, void(const ClangBackEnd::HighlightingChangedMessage &message)); }; - -#endif // MOCKIPCLIENT_H - diff --git a/tests/unit/unittest/mockipcserver.h b/tests/unit/unittest/mockipcserver.h index 1589a10157..9f024d4076 100644 --- a/tests/unit/unittest/mockipcserver.h +++ b/tests/unit/unittest/mockipcserver.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MOCKIPCSERVER_H -#define MOCKIPCSERVER_H +#pragma once #include <ipcserverinterface.h> @@ -60,6 +59,3 @@ public: MOCK_METHOD1(updateVisibleTranslationUnits, void(const ClangBackEnd::UpdateVisibleTranslationUnitsMessage &message)); }; - -#endif // MOCKIPCSERVER_H - diff --git a/tests/unit/unittest/mocksenddocumentannotationscallback.h b/tests/unit/unittest/mocksenddocumentannotationscallback.h index 124ff1e8e1..1ab5206ec6 100644 --- a/tests/unit/unittest/mocksenddocumentannotationscallback.h +++ b/tests/unit/unittest/mocksenddocumentannotationscallback.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef MOCKSENDDOCUMENTANNOTATIONSCALLBACK_H -#define MOCKSENDDOCUMENTANNOTATIONSCALLBACK_H +#pragma once #include <gmock/gmock.h> #include <gmock/gmock-matchers.h> @@ -45,5 +44,3 @@ public: MOCK_METHOD0(sendDocumentAnnotations, void()); }; - -#endif // MOCKSENDDOCUMENTANNOTATIONSCALLBACK_H diff --git a/tests/unit/unittest/smallstringtest.cpp b/tests/unit/unittest/smallstringtest.cpp index b0d465e162..cbdcf1cdac 100644 --- a/tests/unit/unittest/smallstringtest.cpp +++ b/tests/unit/unittest/smallstringtest.cpp @@ -87,6 +87,14 @@ TEST(SmallString, ShortSmallStringIsReference) ASSERT_TRUE(longText.isReadOnlyReference()); } +TEST(SmallString, SmallStringContructorIsNotReference) +{ + const char *shortCSmallString = "short string"; + auto shortText = SmallString(shortCSmallString); + + ASSERT_TRUE(shortText.isShortString()); +} + TEST(SmallString, ShortSmallStringIsNotReference) { const char *shortCSmallString = "short string"; @@ -95,6 +103,14 @@ TEST(SmallString, ShortSmallStringIsNotReference) ASSERT_FALSE(shortText.isReadOnlyReference()); } +TEST(SmallString, LongSmallStringConstrutorIsAllocated) +{ + const char *longCSmallString = "very very very very very long text"; + auto longText = SmallString(longCSmallString); + + ASSERT_TRUE(longText.hasAllocatedMemory()); +} + TEST(SmallString, MaximumShortSmallString) { SmallString maximumShortText("very very very very short text", 30); diff --git a/tests/unit/unittest/spydummy.h b/tests/unit/unittest/spydummy.h index 175956772c..0a9f2f5a8b 100644 --- a/tests/unit/unittest/spydummy.h +++ b/tests/unit/unittest/spydummy.h @@ -23,8 +23,7 @@ ** ****************************************************************************/ -#ifndef SPYDUMMY_H -#define SPYDUMMY_H +#pragma once #include <QObject> @@ -40,5 +39,3 @@ signals: void databaseIsOpened(); void databaseIsClosed(); }; - -#endif // SPYDUMMY_H diff --git a/tests/unit/unittest/translationunitstest.cpp b/tests/unit/unittest/translationunitstest.cpp index 25c64080cd..84946f4f48 100644 --- a/tests/unit/unittest/translationunitstest.cpp +++ b/tests/unit/unittest/translationunitstest.cpp @@ -26,7 +26,7 @@ #include <diagnosticset.h> #include <filecontainer.h> #include <highlightingchangedmessage.h> -#include <highlightinginformations.h> +#include <highlightingmarks.h> #include <projectpartcontainer.h> #include <projectpart.h> #include <projectpartsdonotexistexception.h> @@ -217,30 +217,30 @@ TEST_F(TranslationUnits, RemoveFileAndCheckForDiagnostics) ASSERT_TRUE(translationUnits.translationUnit(filePath, projectPartId).hasNewDiagnostics()); } -TEST_F(TranslationUnits, UpdateUnsavedFileAndCheckForHighlightingInformations) +TEST_F(TranslationUnits, UpdateUnsavedFileAndCheckForHighlightingMarks) { ClangBackEnd::FileContainer fileContainer(filePath, projectPartId, Utf8StringVector(), 74u); ClangBackEnd::FileContainer headerContainer(headerPath, projectPartId, Utf8StringVector(), 74u); ClangBackEnd::FileContainer headerContainerWithUnsavedContent(headerPath, projectPartId, Utf8String(), true, 75u); translationUnits.create({fileContainer, headerContainer}); - translationUnits.translationUnit(filePath, projectPartId).highlightingInformations(); + translationUnits.translationUnit(filePath, projectPartId).highlightingMarks(); translationUnits.update({headerContainerWithUnsavedContent}); - ASSERT_TRUE(translationUnits.translationUnit(filePath, projectPartId).hasNewHighlightingInformations()); + ASSERT_TRUE(translationUnits.translationUnit(filePath, projectPartId).hasNewHighlightingMarks()); } -TEST_F(TranslationUnits, RemoveFileAndCheckForHighlightingInformations) +TEST_F(TranslationUnits, RemoveFileAndCheckForHighlightingMarks) { ClangBackEnd::FileContainer fileContainer(filePath, projectPartId, Utf8StringVector(), 74u); ClangBackEnd::FileContainer headerContainer(headerPath, projectPartId, Utf8StringVector(), 74u); ClangBackEnd::FileContainer headerContainerWithUnsavedContent(headerPath, projectPartId, Utf8String(), true, 75u); translationUnits.create({fileContainer, headerContainer}); - translationUnits.translationUnit(filePath, projectPartId).highlightingInformations(); + translationUnits.translationUnit(filePath, projectPartId).highlightingMarks(); translationUnits.remove({headerContainerWithUnsavedContent}); - ASSERT_TRUE(translationUnits.translationUnit(filePath, projectPartId).hasNewHighlightingInformations()); + ASSERT_TRUE(translationUnits.translationUnit(filePath, projectPartId).hasNewHighlightingMarks()); } TEST_F(TranslationUnits, DontGetNewerFileContainerIfRevisionIsTheSame) @@ -402,7 +402,7 @@ TEST_F(TranslationUnits, DoNotSendDocumentAnnotationsAfterGettingDocumentAnnotat auto translationUnit = translationUnits.translationUnit(fileContainer); translationUnit.setIsVisibleInEditor(true); translationUnit.diagnostics(); // Reset - translationUnit.highlightingInformations(); // Reset + translationUnit.highlightingMarks(); // Reset EXPECT_CALL(mockSendDocumentAnnotationsCallback, sendDocumentAnnotations()).Times(0); @@ -435,7 +435,7 @@ TEST_F(TranslationUnits, DoNotSendDocumentAnnotationsForCurrentEditorAfterGettin auto translationUnit = translationUnits.translationUnit(fileContainer); translationUnit.setIsUsedByCurrentEditor(true); translationUnit.diagnostics(); // Reset - translationUnit.highlightingInformations(); // Reset + translationUnit.highlightingMarks(); // Reset EXPECT_CALL(mockSendDocumentAnnotationsCallback, sendDocumentAnnotations()).Times(0); @@ -472,7 +472,7 @@ TEST_F(TranslationUnits, SendDocumentAnnotationsOnlyOnceForVisibleEditor) auto headerTranslationUnit = translationUnits.translationUnit(headerContainer); headerTranslationUnit.setIsVisibleInEditor(true); headerTranslationUnit.diagnostics(); // Reset - headerTranslationUnit.highlightingInformations(); // Reset + headerTranslationUnit.highlightingMarks(); // Reset EXPECT_CALL(mockSendDocumentAnnotationsCallback, sendDocumentAnnotations()).Times(1); @@ -485,7 +485,7 @@ TEST_F(TranslationUnits, SendDocumentAnnotationsAfterProjectPartChange) auto fileTranslationUnit = translationUnits.translationUnit(fileContainer); fileTranslationUnit.setIsVisibleInEditor(true); fileTranslationUnit.diagnostics(); // Reset - fileTranslationUnit.highlightingInformations(); // Reset + fileTranslationUnit.highlightingMarks(); // Reset projects.createOrUpdate({ProjectPartContainer(projectPartId, {Utf8StringLiteral("-DNEW")})}); translationUnits.setTranslationUnitsDirtyIfProjectPartChanged(); diff --git a/tests/unit/unittest/translationunittest.cpp b/tests/unit/unittest/translationunittest.cpp index f4931235d1..a3fd9ea2d6 100644 --- a/tests/unit/unittest/translationunittest.cpp +++ b/tests/unit/unittest/translationunittest.cpp @@ -25,7 +25,7 @@ #include <commandlinearguments.h> #include <diagnosticset.h> -#include <highlightinginformations.h> +#include <highlightingmarks.h> #include <filecontainer.h> #include <projectpart.h> #include <projectpartcontainer.h> @@ -289,49 +289,49 @@ TEST_F(TranslationUnit, HasNoNewDiagnosticsAfterGettingDiagnostics) ASSERT_FALSE(translationUnit.hasNewDiagnostics()); } -TEST_F(TranslationUnit, HasNewHighlightingInformationsAfterCreation) +TEST_F(TranslationUnit, HasNewHighlightingMarksAfterCreation) { translationUnit.cxTranslationUnit(); - ASSERT_TRUE(translationUnit.hasNewHighlightingInformations()); + ASSERT_TRUE(translationUnit.hasNewHighlightingMarks()); } -TEST_F(TranslationUnit, HasNewHighlightingInformationsForMainFile) +TEST_F(TranslationUnit, HasNewHighlightingMarksForMainFile) { translationUnit.cxTranslationUnit(); translationUnit.setDirtyIfDependencyIsMet(translationUnitFilePath); - ASSERT_TRUE(translationUnit.hasNewHighlightingInformations()); + ASSERT_TRUE(translationUnit.hasNewHighlightingMarks()); } -TEST_F(TranslationUnit, HasNoNewHighlightingInformationsForIndependendFile) +TEST_F(TranslationUnit, HasNoNewHighlightingMarksForIndependendFile) { translationUnit.cxTranslationUnit(); - translationUnit.highlightingInformations(); + translationUnit.highlightingMarks(); translationUnit.setDirtyIfDependencyIsMet(Utf8StringLiteral(TESTDATA_DIR"/otherfiles.h")); - ASSERT_FALSE(translationUnit.hasNewHighlightingInformations()); + ASSERT_FALSE(translationUnit.hasNewHighlightingMarks()); } -TEST_F(TranslationUnit, HasNewHighlightingInformationsForDependendFile) +TEST_F(TranslationUnit, HasNewHighlightingMarksForDependendFile) { translationUnit.cxTranslationUnit(); translationUnit.setDirtyIfDependencyIsMet(Utf8StringLiteral(TESTDATA_DIR"/translationunits.h")); - ASSERT_TRUE(translationUnit.hasNewHighlightingInformations()); + ASSERT_TRUE(translationUnit.hasNewHighlightingMarks()); } -TEST_F(TranslationUnit, HasNoNewHighlightingInformationsAfterGettingHighlightingInformations) +TEST_F(TranslationUnit, HasNoNewHighlightingMarksAfterGettingHighlightingMarks) { translationUnit.cxTranslationUnit(); translationUnit.setDirtyIfDependencyIsMet(translationUnitFilePath); - translationUnit.highlightingInformations(); + translationUnit.highlightingMarks(); - ASSERT_FALSE(translationUnit.hasNewHighlightingInformations()); + ASSERT_FALSE(translationUnit.hasNewHighlightingMarks()); } TEST_F(TranslationUnit, SetDirtyIfProjectPartIsOutdated) diff --git a/tests/unit/unittest/unittest.pro b/tests/unit/unittest/unittest.pro index 922354975f..30d075079b 100644 --- a/tests/unit/unittest/unittest.pro +++ b/tests/unit/unittest/unittest.pro @@ -61,13 +61,13 @@ SOURCES += \ utf8test.cpp \ senddocumenttrackertest.cpp \ cursortest.cpp \ - highlightinginformationstest.cpp \ skippedsourcerangestest.cpp \ highlightingmarksreportertest.cpp \ chunksreportedmonitor.cpp \ unsavedfiletest.cpp \ clangisdiagnosticrelatedtolocationtest.cpp \ smallstringtest.cpp \ + highlightingmarkstest.cpp \ sizedarraytest.cpp exists($$GOOGLEBENCHMARK_DIR) { |