From edaae61c36de21dda224b3e40d9abc1d5e8c057a Mon Sep 17 00:00:00 2001 From: Filip Fila Date: Tue, 2 Jul 2019 10:02:03 +0200 Subject: [PATCH] Make includes more orderly 1. header files 2. Qt 3. KDE - alphabetically organized - no spacing after copyright info - one line of spacing after last include NOTE: xcursor.cpp differs because it won't compile with a standardized ordering of includes. --- sddmauthhelper.cpp | 14 +++++++------- sddmthemeinstaller.cpp | 11 +++++------ src/advanceconfig.cpp | 15 +++++++-------- src/configwidgets/selectimagebutton.cpp | 6 ++---- src/cursortheme/cursortheme.cpp | 11 ++++------- src/cursortheme/cursortheme.h | 3 +-- src/cursortheme/dummytheme.cpp | 3 +-- src/cursortheme/sortproxymodel.cpp | 5 ++--- src/cursortheme/sortproxymodel.h | 4 ++-- src/cursortheme/thememodel.cpp | 15 ++++++--------- src/cursortheme/thememodel.h | 1 - src/cursortheme/xcursortheme.cpp | 13 ++++++------- src/cursortheme/xcursortheme.h | 5 ++--- src/sddmkcm.cpp | 19 +++++++------------ src/sessionmodel.cpp | 6 ++---- src/sessionmodel.h | 2 -- src/themeconfig.cpp | 15 +++++++-------- src/thememetadata.cpp | 2 +- src/thememetadata.h | 2 +- src/themesdelegate.cpp | 7 +++---- src/themesmodel.cpp | 9 +++------ src/usersmodel.cpp | 3 +-- 22 files changed, 70 insertions(+), 101 deletions(-) diff --git a/sddmauthhelper.cpp b/sddmauthhelper.cpp index 3a18ae2b..576cb301 100644 --- a/sddmauthhelper.cpp +++ b/sddmauthhelper.cpp @@ -17,20 +17,20 @@ */ #include "sddmauthhelper.h" +#include +#include #include #include -#include -#include -#include -#include #include +#include +#include -#include -#include -#include #include #include #include +#include +#include +#include static QSharedPointer openConfig(const QString &filePath) { diff --git a/sddmthemeinstaller.cpp b/sddmthemeinstaller.cpp index 3bf99c23..3bd4b140 100644 --- a/sddmthemeinstaller.cpp +++ b/sddmthemeinstaller.cpp @@ -17,21 +17,20 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ - #include +#include +#include #include -#include #include +#include #include -#include -#include -#include #include #include +#include +#include #include #include -#include int main(int argc, char **argv) { diff --git a/src/advanceconfig.cpp b/src/advanceconfig.cpp index 34debee6..42b512b5 100644 --- a/src/advanceconfig.cpp +++ b/src/advanceconfig.cpp @@ -16,20 +16,19 @@ */ #include "advanceconfig.h" #include "ui_advanceconfig.h" +#include "config.h" +#include "cursortheme/thememodel.h" +#include "cursortheme/sortproxymodel.h" +#include "cursortheme/cursortheme.h" +#include "sessionmodel.h" +#include "usersmodel.h" +#include #include -#include #include #include -#include "usersmodel.h" -#include "sessionmodel.h" -#include "config.h" -#include "cursortheme/thememodel.h" -#include "cursortheme/sortproxymodel.h" -#include "cursortheme/cursortheme.h" - const int MIN_UID = 1000; const int MAX_UID = 60000; diff --git a/src/configwidgets/selectimagebutton.cpp b/src/configwidgets/selectimagebutton.cpp index ff8f562e..ac6ccd76 100644 --- a/src/configwidgets/selectimagebutton.cpp +++ b/src/configwidgets/selectimagebutton.cpp @@ -18,15 +18,13 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - #include "selectimagebutton.h" -#include - -#include #include #include #include +#include +#include #include #include diff --git a/src/cursortheme/cursortheme.cpp b/src/cursortheme/cursortheme.cpp index 8ff9c318..f6fcea94 100644 --- a/src/cursortheme/cursortheme.cpp +++ b/src/cursortheme/cursortheme.cpp @@ -16,24 +16,21 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ +#include "cursortheme.h" +// #include #include -#include #include -#include #include +#include +#include #include -#include "cursortheme.h" - -// #include - #ifdef HAVE_XFIXES # include # include #endif - CursorTheme::CursorTheme(const QString &title, const QString &description) { setTitle(title); diff --git a/src/cursortheme/cursortheme.h b/src/cursortheme/cursortheme.h index fc1fbc64..adff06d5 100644 --- a/src/cursortheme/cursortheme.h +++ b/src/cursortheme/cursortheme.h @@ -16,12 +16,11 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ - #ifndef CURSORTHEME_H #define CURSORTHEME_H -#include #include +#include /** * This is the abstract base class for all cursor themes stored in a diff --git a/src/cursortheme/dummytheme.cpp b/src/cursortheme/dummytheme.cpp index da80e502..01626da7 100644 --- a/src/cursortheme/dummytheme.cpp +++ b/src/cursortheme/dummytheme.cpp @@ -14,11 +14,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - #include "dummytheme.h" -#include #include +#include #include diff --git a/src/cursortheme/sortproxymodel.cpp b/src/cursortheme/sortproxymodel.cpp index b9d63092..52e163f9 100644 --- a/src/cursortheme/sortproxymodel.cpp +++ b/src/cursortheme/sortproxymodel.cpp @@ -16,11 +16,10 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ - -#include -#include "sortproxymodel.h" #include "cursortheme.h" +#include "sortproxymodel.h" +#include int SortProxyModel::compare(const QModelIndex &left, const QModelIndex &right, int role) const { diff --git a/src/cursortheme/sortproxymodel.h b/src/cursortheme/sortproxymodel.h index f420c776..c1fa7814 100644 --- a/src/cursortheme/sortproxymodel.h +++ b/src/cursortheme/sortproxymodel.h @@ -16,13 +16,13 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ - #ifndef SORTPROXYMODEL_H #define SORTPROXYMODEL_H -#include #include "thememodel.h" +#include + /** * SortProxyModel is a sorting proxy model intended to be used in combination * with the ItemDelegate class. diff --git a/src/cursortheme/thememodel.cpp b/src/cursortheme/thememodel.cpp index ce8b9820..becc1bc5 100644 --- a/src/cursortheme/thememodel.cpp +++ b/src/cursortheme/thememodel.cpp @@ -15,17 +15,16 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ +#include "thememodel.h" +#include "xcursortheme.h" - -#include -#include -#include -#include #include +#include #include -#include "thememodel.h" -#include "xcursortheme.h" +#include +#include +#include #include #include @@ -36,8 +35,6 @@ # define XCURSOR_LIB_MINOR XCURSOR_MINOR #endif - - CursorThemeModel::CursorThemeModel(QObject *parent) : QAbstractTableModel(parent) { diff --git a/src/cursortheme/thememodel.h b/src/cursortheme/thememodel.h index 007064a3..7654bf8a 100644 --- a/src/cursortheme/thememodel.h +++ b/src/cursortheme/thememodel.h @@ -16,7 +16,6 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ - #ifndef THEMEMODEL_H #define THEMEMODEL_H diff --git a/src/cursortheme/xcursortheme.cpp b/src/cursortheme/xcursortheme.cpp index 2b3e25c0..195c5766 100644 --- a/src/cursortheme/xcursortheme.cpp +++ b/src/cursortheme/xcursortheme.cpp @@ -16,22 +16,21 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ +#include +#include +#include +#include +#include -#include #include #include +#include -#include -#include -#include -#include -#include #include #include #include "xcursortheme.h" - // Static variable holding alternative names for some cursors QHash XCursorTheme::alternatives; diff --git a/src/cursortheme/xcursortheme.h b/src/cursortheme/xcursortheme.h index 8c7d760c..63f70000 100644 --- a/src/cursortheme/xcursortheme.h +++ b/src/cursortheme/xcursortheme.h @@ -16,14 +16,13 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ - #ifndef XCURSORTHEME_H #define XCURSORTHEME_H -#include - #include "cursortheme.h" +#include + class QDir; struct _XcursorImage; diff --git a/src/sddmkcm.cpp b/src/sddmkcm.cpp index 87f43636..0dc41eaf 100644 --- a/src/sddmkcm.cpp +++ b/src/sddmkcm.cpp @@ -14,30 +14,25 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "advanceconfig.h" +#include "config.h" #include "sddmkcm.h" +#include "themeconfig.h" #include +#include #include #include #include -#include - -#include - #include - +#include +#include #include -#include - -#include "config.h" -#include "themeconfig.h" -#include "advanceconfig.h" - +#include #include #include -#include K_PLUGIN_FACTORY(SddmKcmFactory, registerPlugin();) diff --git a/src/sessionmodel.cpp b/src/sessionmodel.cpp index 0bbe2173..efa7ef6d 100644 --- a/src/sessionmodel.cpp +++ b/src/sessionmodel.cpp @@ -16,20 +16,18 @@ * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ***************************************************************************/ - #include "config.h" #include "sessionmodel.h" +#include + #include #include #include #include -#include - #include - class Session { public: QString file; diff --git a/src/sessionmodel.h b/src/sessionmodel.h index e307d37b..9256a769 100644 --- a/src/sessionmodel.h +++ b/src/sessionmodel.h @@ -16,12 +16,10 @@ * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ***************************************************************************/ - #ifndef SDDM_SESSIONMODEL_H #define SDDM_SESSIONMODEL_H #include - #include class SessionModelPrivate; diff --git a/src/themeconfig.cpp b/src/themeconfig.cpp index d50cc016..83772ab2 100644 --- a/src/themeconfig.cpp +++ b/src/themeconfig.cpp @@ -14,28 +14,27 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "config.h" #include "themeconfig.h" #include "ui_themeconfig.h" #include "themesmodel.h" #include "themesdelegate.h" +#include #include +#include +#include #include #include #include -#include #include -#include -#include -#include -#include -#include #include #include #include - -#include "config.h" +#include +#include +#include ThemeConfig::ThemeConfig(const KSharedConfigPtr &config, QWidget *parent) : QWidget(parent), diff --git a/src/thememetadata.cpp b/src/thememetadata.cpp index 666e7705..909eae30 100644 --- a/src/thememetadata.cpp +++ b/src/thememetadata.cpp @@ -20,8 +20,8 @@ #include #include -#include #include +#include class ThemeMetadataPrivate : public QSharedData { diff --git a/src/thememetadata.h b/src/thememetadata.h index 51cb28a6..bba3fd72 100644 --- a/src/thememetadata.h +++ b/src/thememetadata.h @@ -18,8 +18,8 @@ #ifndef THEMEMETADATA_H #define THEMEMETADATA_H -#include #include +#include class ThemeMetadataPrivate; diff --git a/src/themesdelegate.cpp b/src/themesdelegate.cpp index 73530900..46f0973f 100644 --- a/src/themesdelegate.cpp +++ b/src/themesdelegate.cpp @@ -17,18 +17,17 @@ along with this program. If not, see . */ #include "themesdelegate.h" +#include "themesmodel.h" #include +#include +#include #include #include #include -#include -#include #include -#include "themesmodel.h" - static const int BLUR_PAD = 6; ThemesDelegate::ThemesDelegate(QObject *parent) diff --git a/src/themesmodel.cpp b/src/themesmodel.cpp index 2c6cef42..968d3285 100644 --- a/src/themesmodel.cpp +++ b/src/themesmodel.cpp @@ -14,21 +14,18 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - - +#include "config.h" +#include "thememetadata.h" #include "themesmodel.h" #include +#include #include #include #include #include #include -#include - -#include "config.h" -#include "thememetadata.h" ThemesModel::ThemesModel(QObject *parent) : QAbstractListModel(parent) diff --git a/src/usersmodel.cpp b/src/usersmodel.cpp index e2d6855b..0e32ca34 100644 --- a/src/usersmodel.cpp +++ b/src/usersmodel.cpp @@ -14,11 +14,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - #include "usersmodel.h" -#include #include +#include UsersModel::UsersModel(QObject *parent) : QAbstractListModel(parent)