forked from qt-creator/qt-creator
		
	Wizards: Enforce use of #pragma once in the Creator Plugin template
This should match Creator style, no matter what the users uses for own projects. Change-Id: I32e052b24ed6d029cd3c7a466bdf8191d1657e4e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
		@@ -1,9 +1,4 @@
 | 
			
		||||
@if '%{Cpp:PragmaOnce}'
 | 
			
		||||
#pragma once
 | 
			
		||||
@else
 | 
			
		||||
#ifndef %{GUARD}
 | 
			
		||||
#define %{GUARD}
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
#include "%{GlobalHdrFileName}"
 | 
			
		||||
 | 
			
		||||
@@ -29,7 +24,3 @@ private:
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace %{PluginName}::Internal
 | 
			
		||||
 | 
			
		||||
@if ! '%{Cpp:PragmaOnce}'
 | 
			
		||||
#endif // %{GUARD}
 | 
			
		||||
@endif
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,5 @@
 | 
			
		||||
%{Cpp:LicenseTemplate}\
 | 
			
		||||
@if '%{Cpp:PragmaOnce}'
 | 
			
		||||
#pragma once
 | 
			
		||||
@else
 | 
			
		||||
#ifndef %{GLOBAL_GUARD}
 | 
			
		||||
#define %{GLOBAL_GUARD}
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
#include <qglobal.h>
 | 
			
		||||
 | 
			
		||||
@@ -13,7 +8,3 @@
 | 
			
		||||
#else
 | 
			
		||||
#  define %{LibraryExport} Q_DECL_IMPORT
 | 
			
		||||
#endif
 | 
			
		||||
@if ! '%{Cpp:PragmaOnce}'
 | 
			
		||||
 | 
			
		||||
#endif // %{GLOBAL_GUARD}
 | 
			
		||||
@endif
 | 
			
		||||
 
 | 
			
		||||
@@ -1,20 +1,9 @@
 | 
			
		||||
%{Cpp:LicenseTemplate}\
 | 
			
		||||
@if '%{Cpp:PragmaOnce}'
 | 
			
		||||
#pragma once
 | 
			
		||||
@else
 | 
			
		||||
#ifndef %{CONSTANTS_GUARD}
 | 
			
		||||
#define %{CONSTANTS_GUARD}
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
namespace %{PluginName} {
 | 
			
		||||
namespace Constants {
 | 
			
		||||
namespace %{PluginName}::Constants {
 | 
			
		||||
 | 
			
		||||
const char ACTION_ID[] = "%{PluginName}.Action";
 | 
			
		||||
const char MENU_ID[] = "%{PluginName}.Menu";
 | 
			
		||||
 | 
			
		||||
} // namespace Constants
 | 
			
		||||
} // namespace %{PluginName}
 | 
			
		||||
 | 
			
		||||
@if ! '%{Cpp:PragmaOnce}'
 | 
			
		||||
#endif // %{CONSTANTS_GUARD}
 | 
			
		||||
@endif
 | 
			
		||||
} // namespace %{PluginName}::Constants
 | 
			
		||||
 
 | 
			
		||||
@@ -23,10 +23,7 @@
 | 
			
		||||
        { "key": "GlobalHdrFileName", "value": "%{JS: Util.fileName(value('PluginNameLower') + '_global', Util.preferredSuffix('text/x-c++hdr'))}" },
 | 
			
		||||
        { "key": "ConstantsHdrFileName", "value": "%{JS: Util.fileName(value('PluginNameLower') + 'constants', Util.preferredSuffix('text/x-c++hdr'))}" },
 | 
			
		||||
        { "key": "CN", "value": "%{JS: Cpp.className(value('PluginName') + 'Plugin')}" },
 | 
			
		||||
        { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('CN'), Util.suffix(value('HdrFileName')))}" },
 | 
			
		||||
        { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" },
 | 
			
		||||
        { "key": "GLOBAL_GUARD", "value": "%{JS: Cpp.headerGuard(value('GlobalHdrFileName'))}" },
 | 
			
		||||
        { "key": "CONSTANTS_GUARD", "value": "%{JS: Cpp.headerGuard(value('ConstantsHdrFileName'))}" }
 | 
			
		||||
        { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" }
 | 
			
		||||
    ],
 | 
			
		||||
 | 
			
		||||
    "pages":
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user