From 17a8a1734b55c27c0e8cafd863e3d455792d7a20 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Sun, 18 Oct 2015 00:05:42 +0300 Subject: [PATCH] * create cppcheck and clangformat targets * apply code style (#67) * send values by reference * fix warnings on plugin destruction by disconnecting dataengines first * fix invalid hddtemp group definition --- CONTRIBUTING.md | 14 +- {utils => sources}/.clang-format | 4 +- sources/.idea/codeStyleSettings.xml | 41 ++ sources/.idea/sources.iml | 2 + sources/.idea/workspace.xml | 675 +++++++++++++++--- sources/.kdev4/awesomewidgets.kdev4 | 2 +- sources/CMakeLists.txt | 19 +- sources/awdebug.cpp | 9 +- sources/awdebug.h | 6 +- .../package/contents/ui/dataengine.qml | 6 +- sources/awesome-widget/plugin/CMakeLists.txt | 16 +- sources/awesome-widget/plugin/awactions.cpp | 89 ++- sources/awesome-widget/plugin/awactions.h | 9 +- .../awesome-widget/plugin/awconfighelper.cpp | 128 ++-- .../awesome-widget/plugin/awconfighelper.h | 20 +- .../plugin/awdataaggregator.cpp | 100 ++- .../awesome-widget/plugin/awdataaggregator.h | 19 +- .../plugin/awdataengineaggregator.cpp | 40 +- .../plugin/awdataengineaggregator.h | 4 +- sources/awesome-widget/plugin/awkeys.cpp | 343 +++++---- sources/awesome-widget/plugin/awkeys.h | 8 +- .../plugin/awkeysaggregator.cpp | 60 +- .../awesome-widget/plugin/awkeysaggregator.h | 11 +- sources/awesomewidgets/CMakeLists.txt | 14 +- sources/awesomewidgets/abstractextitem.cpp | 32 +- sources/awesomewidgets/abstractextitem.h | 3 +- .../abstractextitemaggregator.cpp | 21 +- sources/awesomewidgets/extitemaggregator.h | 54 +- sources/awesomewidgets/extquotes.cpp | 89 ++- sources/awesomewidgets/extquotes.h | 14 +- sources/awesomewidgets/extscript.cpp | 90 ++- sources/awesomewidgets/extscript.h | 15 +- sources/awesomewidgets/extupgrade.cpp | 40 +- sources/awesomewidgets/extupgrade.h | 8 +- sources/awesomewidgets/extweather.cpp | 74 +- sources/awesomewidgets/extweather.h | 16 +- sources/awesomewidgets/graphicalitem.cpp | 75 +- sources/awesomewidgets/graphicalitem.h | 20 +- sources/checkgit.cmake | 14 +- sources/clang-format.cmake | 18 + sources/cppcheck.cmake | 23 + sources/desktop-panel/plugin/CMakeLists.txt | 14 +- sources/desktop-panel/plugin/dpadds.cpp | 179 +++-- sources/desktop-panel/plugin/dpadds.h | 7 +- sources/extsysmon/CMakeLists.txt | 16 +- sources/extsysmon/extsysmon.cpp | 75 +- sources/extsysmon/extsysmon.h | 3 +- sources/extsysmon/extsysmonaggregator.cpp | 80 ++- sources/extsysmon/extsysmonaggregator.h | 4 +- .../sources/abstractextsysmonsource.h | 5 +- sources/extsysmon/sources/batterysource.cpp | 40 +- sources/extsysmon/sources/customsource.cpp | 6 +- sources/extsysmon/sources/customsource.h | 2 +- sources/extsysmon/sources/desktopsource.cpp | 2 +- sources/extsysmon/sources/desktopsource.h | 2 +- sources/extsysmon/sources/gpuloadsource.cpp | 34 +- sources/extsysmon/sources/gpuloadsource.h | 2 +- sources/extsysmon/sources/gputempsource.cpp | 33 +- sources/extsysmon/sources/gputempsource.h | 2 +- sources/extsysmon/sources/hddtempsource.cpp | 24 +- sources/extsysmon/sources/hddtempsource.h | 2 +- sources/extsysmon/sources/loadsource.cpp | 4 +- sources/extsysmon/sources/loadsource.h | 2 +- sources/extsysmon/sources/networksource.cpp | 13 +- sources/extsysmon/sources/networksource.h | 2 +- sources/extsysmon/sources/playersource.cpp | 155 ++-- sources/extsysmon/sources/playersource.h | 7 +- sources/extsysmon/sources/processessource.cpp | 19 +- sources/extsysmon/sources/quotessource.cpp | 53 +- sources/extsysmon/sources/quotessource.h | 2 +- sources/extsysmon/sources/updatesource.h | 2 +- sources/extsysmon/sources/upgradesource.cpp | 9 +- sources/extsysmon/sources/upgradesource.h | 2 +- sources/extsysmon/sources/weathersource.cpp | 40 +- sources/extsysmon/sources/weathersource.h | 2 +- sources/libraries.cmake | 12 +- sources/packages-recipe.cmake | 12 +- sources/translations/CMakeLists.txt | 24 +- utils/cpp-check.sh | 9 - utils/qt-code-style.sh | 10 - 80 files changed, 2134 insertions(+), 1022 deletions(-) rename {utils => sources}/.clang-format (96%) create mode 100644 sources/.idea/codeStyleSettings.xml create mode 100644 sources/clang-format.cmake create mode 100644 sources/cppcheck.cmake delete mode 100755 utils/cpp-check.sh delete mode 100755 utils/qt-code-style.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a7808a..dd54838 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -126,6 +126,12 @@ HIG The recommended HIG is [KDE one](https://techbase.kde.org/Projects/Usability/HIG). +Licensing +--------- + +All files should be licensed under GPLv3, the owner of the license should be the +project (i.e. **awesome-widgets**). See **Tools** section for more details. + Logging ------- @@ -212,7 +218,7 @@ Tools // declare with default value bool m_prop = false; ``` -* Use `cppcheck` to avoid common errors in the code. Refer to `utils` for more - details. -* Use `clang-format` to apply valid code format. Refer to `utils` for more - details. +* Use `cppcheck` to avoid common errors in the code. To start application just + run `make cppcheck`. +* Use `clang-format` to apply valid code format. To start application just run + `make clangformat`. diff --git a/utils/.clang-format b/sources/.clang-format similarity index 96% rename from utils/.clang-format rename to sources/.clang-format index 9baa1fd..b4b4e86 100644 --- a/utils/.clang-format +++ b/sources/.clang-format @@ -9,7 +9,7 @@ AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: All +AllowShortFunctionsOnASingleLine: Inline AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None @@ -37,7 +37,7 @@ IndentWrappedFunctionNames: false KeepEmptyLinesAtTheStartOfBlocks: true MacroBlockBegin: '' MacroBlockEnd: '' -MaxEmptyLinesToKeep: 1 +MaxEmptyLinesToKeep: 2 NamespaceIndentation: None ObjCBlockIndentWidth: 2 ObjCSpaceAfterProperty: false diff --git a/sources/.idea/codeStyleSettings.xml b/sources/.idea/codeStyleSettings.xml new file mode 100644 index 0000000..e46bb42 --- /dev/null +++ b/sources/.idea/codeStyleSettings.xml @@ -0,0 +1,41 @@ + + + + + + \ No newline at end of file diff --git a/sources/.idea/sources.iml b/sources/.idea/sources.iml index fa1fc54..5fc47ca 100644 --- a/sources/.idea/sources.iml +++ b/sources/.idea/sources.iml @@ -66,6 +66,8 @@ + + diff --git a/sources/.idea/workspace.xml b/sources/.idea/workspace.xml index 319fa3b..92726ab 100644 --- a/sources/.idea/workspace.xml +++ b/sources/.idea/workspace.xml @@ -6,8 +6,10 @@ + + @@ -21,38 +23,88 @@ + + + + + + + + + + + + + - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + - - + + + - + @@ -74,40 +126,68 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -116,10 +196,37 @@ @@ -191,6 +298,24 @@ + + + + + + + + true + + + @@ -387,7 +554,15 @@ - + + + + + + + + + @@ -399,6 +574,8 @@ + + @@ -415,27 +592,46 @@ - + - + - - - + + + - - + + - - + + + + + + + + + + + + + + + + + + + + +