diff --git a/autotests/coronatest.cpp b/autotests/coronatest.cpp index 4d05871e7..ff7bc3c1e 100644 --- a/autotests/coronatest.cpp +++ b/autotests/coronatest.cpp @@ -7,12 +7,14 @@ #include "coronatest.h" #include #include + #include #include #include #include #include #include + Plasma::Applet *SimpleLoader::internalLoadApplet(const QString &name, uint appletId, const QVariantList &args) { Q_UNUSED(args) diff --git a/src/declarativeimports/core/datamodel.h b/src/declarativeimports/core/datamodel.h index f9d0f7371..d797d3327 100644 --- a/src/declarativeimports/core/datamodel.h +++ b/src/declarativeimports/core/datamodel.h @@ -161,13 +161,16 @@ class DataModel : public QAbstractItemModel Q_PROPERTY(QObject *dataSource READ dataSource WRITE setDataSource) /** - * It's a regular expression. Only data with keys that match this filter expression will be inserted in the model + * It's a regular expression. Only data with keys that match this filter + * expression will be inserted in the model */ Q_PROPERTY(QString keyRoleFilter READ keyRoleFilter WRITE setKeyRoleFilter) /** - * it's a regular expression. If the DataSource is connected to more than one source, only inserts data from sources matching this filter expression in the - * model. If we want to have a source watch all sources beginning with say "name:", the required regexp would be sourceFilter: "name:.*" + * It's a regular expression. If the DataSource is connected to more than one source, + * only inserts data from sources matching this filter expression in the model. If we + * want to have a source watch all sources beginning with say "name:", the required + * regexp would be sourceFilter: "name:.*" */ Q_PROPERTY(QString sourceFilter READ sourceFilter WRITE setSourceFilter) diff --git a/src/declarativeimports/core/framesvgitem.cpp b/src/declarativeimports/core/framesvgitem.cpp index 22f1df6ab..2592b4691 100644 --- a/src/declarativeimports/core/framesvgitem.cpp +++ b/src/declarativeimports/core/framesvgitem.cpp @@ -523,13 +523,16 @@ void FrameSvgItem::doUpdate() } QString prefix = m_frameSvg->actualPrefix(); - bool hasOverlay = !prefix.startsWith(QLatin1String("mask-")) && m_frameSvg->hasElement(prefix % QLatin1String("overlay")); + bool hasOverlay = (!prefix.startsWith(QLatin1String("mask-")) // + && m_frameSvg->hasElement(prefix % QLatin1String("overlay"))); bool hasComposeOverBorder = m_frameSvg->hasElement(prefix % QLatin1String("hint-compose-over-border")) && m_frameSvg->hasElement(QLatin1String("mask-") % prefix % QLatin1String("center")); m_fastPath = !hasOverlay && !hasComposeOverBorder; - // software rendering (at time of writing Qt5.10) doesn't seem to like our tiling/stretching in the 9-tiles. - // also when using QPainter it's arguably faster to create and cache pixmaps of the whole frame, which is what the slow path does + // Software rendering (at time of writing Qt5.10) doesn't seem to like our + // tiling/stretching in the 9-tiles. + // Also when using QPainter it's arguably faster to create and cache pixmaps + // of the whole frame, which is what the slow path does if (QQuickWindow::sceneGraphBackend() == QLatin1String("software")) { m_fastPath = false; } @@ -548,7 +551,9 @@ Plasma::FrameSvg *FrameSvgItem::frameSvg() const QSGNode *FrameSvgItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) { - if (!window() || !m_frameSvg || (!m_frameSvg->hasElementPrefix(m_frameSvg->actualPrefix()) && !m_frameSvg->hasElementPrefix(m_frameSvg->prefix()))) { + if (!window() || !m_frameSvg // + || (!m_frameSvg->hasElementPrefix(m_frameSvg->actualPrefix()) // + && !m_frameSvg->hasElementPrefix(m_frameSvg->prefix()))) { delete oldNode; return nullptr; } @@ -565,10 +570,10 @@ QSGNode *FrameSvgItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaint QString prefix = m_frameSvg->actualPrefix(); oldNode = new FrameNode(prefix, m_frameSvg); - bool tileCenter = - (m_frameSvg->hasElement(QStringLiteral("hint-tile-center")) || m_frameSvg->hasElement(prefix % QLatin1String("hint-tile-center"))); - bool stretchBorders = - (m_frameSvg->hasElement(QStringLiteral("hint-stretch-borders")) || m_frameSvg->hasElement(prefix % QLatin1String("hint-stretch-borders"))); + bool tileCenter = (m_frameSvg->hasElement(QStringLiteral("hint-tile-center")) // + || m_frameSvg->hasElement(prefix % QLatin1String("hint-tile-center"))); + bool stretchBorders = (m_frameSvg->hasElement(QStringLiteral("hint-stretch-borders")) // + || m_frameSvg->hasElement(prefix % QLatin1String("hint-stretch-borders"))); FrameItemNode::FitMode borderFitMode = stretchBorders ? FrameItemNode::Stretch : FrameItemNode::Tile; FrameItemNode::FitMode centerFitMode = tileCenter ? FrameItemNode::Tile : FrameItemNode::Stretch; diff --git a/src/declarativeimports/core/iconitem.cpp b/src/declarativeimports/core/iconitem.cpp index 13693991b..0db750acd 100644 --- a/src/declarativeimports/core/iconitem.cpp +++ b/src/declarativeimports/core/iconitem.cpp @@ -355,7 +355,9 @@ void IconItem::setSource(const QVariant &source) } if (!localFile.isEmpty()) { - if (sourceString.endsWith(QLatin1String(".svg")) || sourceString.endsWith(QLatin1String(".svgz")) || sourceString.endsWith(QLatin1String(".ico"))) { + if (sourceString.endsWith(QLatin1String(".svg")) // + || sourceString.endsWith(QLatin1String(".svgz")) // + || sourceString.endsWith(QLatin1String(".ico"))) { QIcon icon = QIcon(localFile); m_iconItemSource.reset(new QIconSource(icon, this)); } else { diff --git a/src/declarativeimports/core/tooltip.h b/src/declarativeimports/core/tooltip.h index 711bf94ee..e77a5f6c7 100644 --- a/src/declarativeimports/core/tooltip.h +++ b/src/declarativeimports/core/tooltip.h @@ -106,9 +106,10 @@ class ToolTip : public QQuickItem Q_PROPERTY(bool active MEMBER m_active WRITE setActive NOTIFY activeChanged) /** - * if interactive is false (default), the tooltip will automatically hide - * itself as soon as the mouse leaves the tooltiparea, if is true, if the mouse leaves tooltiparea and goes over the tooltip itself, the tooltip won't hide, - * so it will be possible to interact with tooltip contents + * If interactive is false (default), the tooltip will automatically hide + * itself as soon as the mouse leaves the tooltiparea, if is true, if the + * mouse leaves tooltiparea and goes over the tooltip itself, the tooltip + * won't hide, so it will be possible to interact with tooltip contents. */ Q_PROPERTY(bool interactive MEMBER m_interactive WRITE setInteractive NOTIFY interactiveChanged) diff --git a/src/declarativeimports/core/windowthumbnail.cpp b/src/declarativeimports/core/windowthumbnail.cpp index d6c66ac34..33f0fc8b1 100644 --- a/src/declarativeimports/core/windowthumbnail.cpp +++ b/src/declarativeimports/core/windowthumbnail.cpp @@ -455,8 +455,9 @@ void WindowThumbnail::resolveEGLFunctions() } auto *context = window()->openglContext(); QList extensions = QByteArray(eglQueryString(display, EGL_EXTENSIONS)).split(' '); - if (extensions.contains(QByteArrayLiteral("EGL_KHR_image")) - || (extensions.contains(QByteArrayLiteral("EGL_KHR_image_base")) && extensions.contains(QByteArrayLiteral("EGL_KHR_image_pixmap")))) { + if (extensions.contains(QByteArrayLiteral("EGL_KHR_image")) // + || (extensions.contains(QByteArrayLiteral("EGL_KHR_image_base")) // + && extensions.contains(QByteArrayLiteral("EGL_KHR_image_pixmap")))) { if (context->hasExtension(QByteArrayLiteral("GL_OES_EGL_image"))) { qDebug() << "Have EGL texture from pixmap"; m_eglCreateImageKHR = context->getProcAddress(QByteArrayLiteral("eglCreateImageKHR")); @@ -793,7 +794,16 @@ bool WindowThumbnail::loadGLXTexture() glGenTextures(1, &m_texture); - const int attrs[] = {GLX_TEXTURE_FORMAT_EXT, info->textureFormat, GLX_MIPMAP_TEXTURE_EXT, false, GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_2D_EXT, XCB_NONE}; + /* clang-format off */ + const int attrs[] = { + GLX_TEXTURE_FORMAT_EXT, + info->textureFormat, + GLX_MIPMAP_TEXTURE_EXT, + false, + GLX_TEXTURE_TARGET_EXT, + GLX_TEXTURE_2D_EXT, + XCB_NONE}; + /* clang-format on */ m_glxPixmap = glXCreatePixmap(QX11Info::display(), info->fbConfig, m_pixmap, attrs); diff --git a/src/declarativeimports/plasmacomponents/qmenu.h b/src/declarativeimports/plasmacomponents/qmenu.h index 05810cb09..34acd52de 100644 --- a/src/declarativeimports/plasmacomponents/qmenu.h +++ b/src/declarativeimports/plasmacomponents/qmenu.h @@ -61,13 +61,15 @@ class QMenuProxy : public QObject Q_CLASSINFO("DefaultProperty", "content") /** - * This is a hint to the window manager that this window is a dialog or pop-up on behalf of the given window. + * This is a hint to the window manager that this window is a dialog or pop-up on + * behalf of the given window. */ Q_PROPERTY(QWindow *transientParent READ transientParent WRITE setTransientParent NOTIFY transientParentChanged) /** - * the visualParent is used to position the menu. it can be an item on the scene, like a button (that will open the menu on clicked) or another menuitem (in - * this case this will be a submenu) + * The visualParent is used to position the menu. it can be an item on the + * scene, like a button (that will open the menu on clicked) or another menuitem + * (in this case this will be a submenu). */ Q_PROPERTY(QObject *visualParent READ visualParent WRITE setVisualParent NOTIFY visualParentChanged()) Q_PROPERTY(DialogStatus::Status status READ status NOTIFY statusChanged) diff --git a/src/declarativeimports/platformcomponents/utils/d_ptr.h b/src/declarativeimports/platformcomponents/utils/d_ptr.h index e2008adce..6ec1cfdd0 100644 --- a/src/declarativeimports/platformcomponents/utils/d_ptr.h +++ b/src/declarativeimports/platformcomponents/utils/d_ptr.h @@ -28,10 +28,12 @@ public: T *operator->() const; }; -#define D_PTR \ - class Private; \ - friend class Private; \ +/* clang-format off */ +#define D_PTR \ + class Private; \ + friend class Private; \ const ::utils::d_ptr d +/* clang-format on */ } // namespace utils diff --git a/src/plasma/applet.cpp b/src/plasma/applet.cpp index a930d93d4..c31271b99 100644 --- a/src/plasma/applet.cpp +++ b/src/plasma/applet.cpp @@ -12,10 +12,8 @@ #include "config-plasma.h" -#include -#include - #include +#include #include #include #include @@ -30,7 +28,6 @@ #include #include #include -#include #include "containment.h" #include "corona.h" @@ -44,6 +41,9 @@ #include "private/containment_p.h" #include "private/package_p.h" +#include +#include + namespace Plasma { static KPluginMetaData appletMetadataForDirectory(const QString &path) diff --git a/src/plasma/applet.h b/src/plasma/applet.h index 64d1415de..8153401b4 100644 --- a/src/plasma/applet.h +++ b/src/plasma/applet.h @@ -787,12 +787,14 @@ private: /** * Register an applet when it is contained in a loadable module */ -#define K_EXPORT_PLASMA_APPLET(libname, classname) \ - K_PLUGIN_FACTORY(factory, registerPlugin();) \ +/* clang-format off */ +#define K_EXPORT_PLASMA_APPLET(libname, classname) \ + K_PLUGIN_FACTORY(factory, registerPlugin();) \ K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) -#define K_EXPORT_PLASMA_APPLET_WITH_JSON(libname, classname, jsonFile) \ - K_PLUGIN_FACTORY_WITH_JSON(factory, jsonFile, registerPlugin();) \ +#define K_EXPORT_PLASMA_APPLET_WITH_JSON(libname, classname, jsonFile) \ + K_PLUGIN_FACTORY_WITH_JSON(factory, jsonFile, registerPlugin();) \ K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) +/* clang-format on */ #endif // multiple inclusion guard diff --git a/src/plasma/containmentactions.cpp b/src/plasma/containmentactions.cpp index 35154d2d5..aef104046 100644 --- a/src/plasma/containmentactions.cpp +++ b/src/plasma/containmentactions.cpp @@ -11,12 +11,12 @@ #include "private/containmentactions_p.h" #include +#include #include #include #include #include -#include #include "version.h" diff --git a/src/plasma/containmentactions.h b/src/plasma/containmentactions.h index 693e658fe..bef97048b 100644 --- a/src/plasma/containmentactions.h +++ b/src/plasma/containmentactions.h @@ -153,9 +153,10 @@ private: /** * Register a containmentactions when it is contained in a loadable module */ - -#define K_EXPORT_PLASMA_CONTAINMENTACTIONS_WITH_JSON(libname, classname, jsonFile) \ - K_PLUGIN_FACTORY_WITH_JSON(factory, jsonFile, registerPlugin();) \ +/* clang-format off */ +#define K_EXPORT_PLASMA_CONTAINMENTACTIONS_WITH_JSON(libname, classname, jsonFile) \ + K_PLUGIN_FACTORY_WITH_JSON(factory, jsonFile, registerPlugin();) \ K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) +/* clang-format on */ #endif // PLASMA_CONTAINMENTACTIONS_H diff --git a/src/plasma/corona.cpp b/src/plasma/corona.cpp index 0c3f5afe7..e343f8d53 100644 --- a/src/plasma/corona.cpp +++ b/src/plasma/corona.cpp @@ -10,17 +10,17 @@ #include "corona.h" #include "private/corona_p.h" +#include #include #include #include #include #include -#include - #include #include -#include + +#include #include "containment.h" #include "debug_p.h" @@ -180,8 +180,9 @@ QList Corona::importLayout(const KConfigGroup &conf) Containment *Corona::containmentForScreen(int screen) const { for (Containment *containment : qAsConst(d->containments)) { - if (containment->screen() == screen - && (containment->containmentType() == Plasma::Types::DesktopContainment || containment->containmentType() == Plasma::Types::CustomContainment)) { + if (containment->screen() == screen // + && (containment->containmentType() == Plasma::Types::DesktopContainment // + || containment->containmentType() == Plasma::Types::CustomContainment)) { return containment; } } @@ -199,8 +200,11 @@ Containment *Corona::containmentForScreen(int screen, const QString &activity, c Containment *containment = nullptr; for (Containment *cont : qAsConst(d->containments)) { - if (cont->lastScreen() == screen && (cont->activity().isEmpty() || cont->activity() == activity) - && (cont->containmentType() == Plasma::Types::DesktopContainment || cont->containmentType() == Plasma::Types::CustomContainment)) { + /* clang-format off */ + if (cont->lastScreen() == screen + && (cont->activity().isEmpty() || cont->activity() == activity) + && (cont->containmentType() == Plasma::Types::DesktopContainment + || cont->containmentType() == Plasma::Types::CustomContainment)) { /* clang-format on */ containment = cont; } } @@ -231,8 +235,9 @@ QList Corona::containmentsForActivity(const QString &activity) } std::copy_if(d->containments.begin(), d->containments.end(), std::back_inserter(conts), [activity](Containment *cont) { - return cont->activity() == activity - && (cont->containmentType() == Plasma::Types::DesktopContainment || cont->containmentType() == Plasma::Types::CustomContainment); + return cont->activity() == activity // + && (cont->containmentType() == Plasma::Types::DesktopContainment // + || cont->containmentType() == Plasma::Types::CustomContainment); }); return conts; @@ -247,8 +252,9 @@ QList Corona::containmentsForScreen(int screen) } std::copy_if(d->containments.begin(), d->containments.end(), std::back_inserter(conts), [screen](Containment *cont) { - return cont->lastScreen() == screen - && (cont->containmentType() == Plasma::Types::DesktopContainment || cont->containmentType() == Plasma::Types::CustomContainment); + return cont->lastScreen() == screen // + && (cont->containmentType() == Plasma::Types::DesktopContainment // + || cont->containmentType() == Plasma::Types::CustomContainment); }); return conts; @@ -410,7 +416,12 @@ bool Corona::isEditMode() const QList Corona::freeEdges(int screen) const { QList freeEdges; - freeEdges << Plasma::Types::TopEdge << Plasma::Types::BottomEdge << Plasma::Types::LeftEdge << Plasma::Types::RightEdge; + /* clang-format off */ + freeEdges << Plasma::Types::TopEdge + << Plasma::Types::BottomEdge + << Plasma::Types::LeftEdge + << Plasma::Types::RightEdge; + /* clang-format on */ const auto containments = this->containments(); for (Containment *containment : containments) { diff --git a/src/plasma/dataengine.cpp b/src/plasma/dataengine.cpp index c3093f7ac..7cb06e436 100644 --- a/src/plasma/dataengine.cpp +++ b/src/plasma/dataengine.cpp @@ -401,8 +401,7 @@ DataEnginePrivate::DataEnginePrivate(DataEngine *e, const KPluginMetaData &md, c : q(e) , dataEngineDescription(md) , refCount(-1) - , // first ref - checkSourcesTimerId(0) + , checkSourcesTimerId(0) // first ref , updateTimerId(0) , minPollingInterval(-1) , valid(false) diff --git a/src/plasma/dataengine.h b/src/plasma/dataengine.h index 7d5bd024f..abb9aaad3 100644 --- a/src/plasma/dataengine.h +++ b/src/plasma/dataengine.h @@ -453,12 +453,14 @@ private: /** * Register a data engine when it is contained in a loadable module */ -#define K_EXPORT_PLASMA_DATAENGINE(libname, classname) \ - K_PLUGIN_FACTORY(factory, registerPlugin();) \ +/* clang-format off */ +#define K_EXPORT_PLASMA_DATAENGINE(libname, classname) \ + K_PLUGIN_FACTORY(factory, registerPlugin();) \ K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) -#define K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(libname, classname, jsonFile) \ - K_PLUGIN_FACTORY_WITH_JSON(factory, jsonFile, registerPlugin();) \ +#define K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(libname, classname, jsonFile) \ + K_PLUGIN_FACTORY_WITH_JSON(factory, jsonFile, registerPlugin();) \ K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) +/* clang-format on */ #endif // multiple inclusion guard diff --git a/src/plasma/framesvg.cpp b/src/plasma/framesvg.cpp index 8389f9d19..36be92a1b 100644 --- a/src/plasma/framesvg.cpp +++ b/src/plasma/framesvg.cpp @@ -437,8 +437,9 @@ QPixmap FrameSvgPrivate::alphaMask() return maskFrame->cachedBackground; } - const bool shouldUpdate = - maskFrame->enabledBorders != frame->enabledBorders || maskFrame->frameSize != frameSize(frame.data()) || maskFrame->imagePath != frame->imagePath; + const bool shouldUpdate = (maskFrame->enabledBorders != frame->enabledBorders // + || maskFrame->frameSize != frameSize(frame.data()) // + || maskFrame->imagePath != frame->imagePath); if (shouldUpdate) { maskFrame = lookupOrCreateMaskFrame(frame, maskPrefix, maskRequestedPrefix); if (!maskFrame->cachedBackground.isNull()) { diff --git a/src/plasma/packagestructure.h b/src/plasma/packagestructure.h index 168f8023f..ad64c8a37 100644 --- a/src/plasma/packagestructure.h +++ b/src/plasma/packagestructure.h @@ -89,13 +89,16 @@ private: /** * Register a Package class when it is contained in a loadable module */ -#define K_EXPORT_PLASMA_PACKAGE(libname, classname) \ - K_PLUGIN_FACTORY(factory, registerPlugin();) \ + +/* clang-format off */ +#define K_EXPORT_PLASMA_PACKAGE(libname, classname) \ + K_PLUGIN_FACTORY(factory, registerPlugin();) \ K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) -#define K_EXPORT_PLASMA_PACKAGE_WITH_JSON(classname, jsonFile) \ - K_PLUGIN_FACTORY_WITH_JSON(factory, jsonFile, registerPlugin();) \ +#define K_EXPORT_PLASMA_PACKAGE_WITH_JSON(classname, jsonFile) \ + K_PLUGIN_FACTORY_WITH_JSON(factory, jsonFile, registerPlugin();) \ K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) +/* clang-format on */ #endif // PLASMA_ENABLE_DEPRECATED_SINCE(5, 6) diff --git a/src/plasma/pluginloader.cpp b/src/plasma/pluginloader.cpp index 9ee5b8a9e..577e0c2dc 100644 --- a/src/plasma/pluginloader.cpp +++ b/src/plasma/pluginloader.cpp @@ -89,17 +89,30 @@ QSet PluginLoaderPrivate::knownCategories() // this is to trick the translation tools into making the correct // strings for translation QSet categories = s_customCategories; - categories << QStringLiteral(I18N_NOOP("Accessibility")).toLower() << QStringLiteral(I18N_NOOP("Application Launchers")).toLower() - << QStringLiteral(I18N_NOOP("Astronomy")).toLower() << QStringLiteral(I18N_NOOP("Date and Time")).toLower() - << QStringLiteral(I18N_NOOP("Development Tools")).toLower() << QStringLiteral(I18N_NOOP("Education")).toLower() - << QStringLiteral(I18N_NOOP("Environment and Weather")).toLower() << QStringLiteral(I18N_NOOP("Examples")).toLower() - << QStringLiteral(I18N_NOOP("File System")).toLower() << QStringLiteral(I18N_NOOP("Fun and Games")).toLower() - << QStringLiteral(I18N_NOOP("Graphics")).toLower() << QStringLiteral(I18N_NOOP("Language")).toLower() - << QStringLiteral(I18N_NOOP("Mapping")).toLower() << QStringLiteral(I18N_NOOP("Miscellaneous")).toLower() - << QStringLiteral(I18N_NOOP("Multimedia")).toLower() << QStringLiteral(I18N_NOOP("Online Services")).toLower() - << QStringLiteral(I18N_NOOP("Productivity")).toLower() << QStringLiteral(I18N_NOOP("System Information")).toLower() - << QStringLiteral(I18N_NOOP("Utilities")).toLower() << QStringLiteral(I18N_NOOP("Windows and Tasks")).toLower() - << QStringLiteral(I18N_NOOP("Clipboard")).toLower() << QStringLiteral(I18N_NOOP("Tasks")).toLower(); + /* clang-format off */ + categories << QStringLiteral(I18N_NOOP("Accessibility")).toLower() + << QStringLiteral(I18N_NOOP("Application Launchers")).toLower() + << QStringLiteral(I18N_NOOP("Astronomy")).toLower() + << QStringLiteral(I18N_NOOP("Date and Time")).toLower() + << QStringLiteral(I18N_NOOP("Development Tools")).toLower() + << QStringLiteral(I18N_NOOP("Education")).toLower() + << QStringLiteral(I18N_NOOP("Environment and Weather")).toLower() + << QStringLiteral(I18N_NOOP("Examples")).toLower() + << QStringLiteral(I18N_NOOP("File System")).toLower() + << QStringLiteral(I18N_NOOP("Fun and Games")).toLower() + << QStringLiteral(I18N_NOOP("Graphics")).toLower() + << QStringLiteral(I18N_NOOP("Language")).toLower() + << QStringLiteral(I18N_NOOP("Mapping")).toLower() + << QStringLiteral(I18N_NOOP("Miscellaneous")).toLower() + << QStringLiteral(I18N_NOOP("Multimedia")).toLower() + << QStringLiteral(I18N_NOOP("Online Services")).toLower() + << QStringLiteral(I18N_NOOP("Productivity")).toLower() + << QStringLiteral(I18N_NOOP("System Information")).toLower() + << QStringLiteral(I18N_NOOP("Utilities")).toLower() + << QStringLiteral(I18N_NOOP("Windows and Tasks")).toLower() + << QStringLiteral(I18N_NOOP("Clipboard")).toLower() + << QStringLiteral(I18N_NOOP("Tasks")).toLower(); + /* clang-format on */ return categories; } @@ -273,7 +286,8 @@ KPluginInfo::List PluginLoader::listEngineInfoByCategory(const QString &category return md.value(QStringLiteral("X-KDE-PluginInfo-Category")) == category; }; auto filterParentApp = [&category, &parentApp](const KPluginMetaData &md) -> bool { - return md.value(QStringLiteral("X-KDE-ParentApp")) == parentApp && md.value(QStringLiteral("X-KDE-PluginInfo-Category")) == category; + return md.value(QStringLiteral("X-KDE-ParentApp")) == parentApp // + && md.value(QStringLiteral("X-KDE-PluginInfo-Category")) == category; }; QVector plugins; if (parentApp.isEmpty()) { @@ -564,7 +578,8 @@ QList PluginLoader::listAppletMetaDataForUrl(const QUrl &url) auto filter = [&parentApp](const KPluginMetaData &md) -> bool { const QString pa = md.value(QStringLiteral("X-KDE-ParentApp")); - return (parentApp.isEmpty() || pa == parentApp) && !KPluginMetaData::readStringList(md.rawData(), QStringLiteral("X-Plasma-DropUrlPatterns")).isEmpty(); + return (parentApp.isEmpty() || pa == parentApp) // + && !KPluginMetaData::readStringList(md.rawData(), QStringLiteral("X-Plasma-DropUrlPatterns")).isEmpty(); }; const QList allApplets = KPackage::PackageLoader::self()->findPackages(QStringLiteral("Plasma/Applet"), QString(), filter); @@ -597,7 +612,8 @@ QStringList PluginLoader::listAppletCategories(const QString &parentApp, bool vi const QStringList excluded = group.readEntry("ExcludeCategories", QStringList()); auto filter = [&parentApp, &excluded, visibleOnly](const KPluginMetaData &md) -> bool { const QString pa = md.value(QStringLiteral("X-KDE-ParentApp")); - return (parentApp.isEmpty() || pa == parentApp) && (excluded.isEmpty() || excluded.contains(md.value(QStringLiteral("X-KDE-PluginInfo-Category")))) + return (parentApp.isEmpty() || pa == parentApp) // + && (excluded.isEmpty() || excluded.contains(md.value(QStringLiteral("X-KDE-PluginInfo-Category")))) // && (!visibleOnly || !md.isHidden()); }; const QList allApplets = KPackage::PackageLoader::self()->findPackages(QStringLiteral("Plasma/Applet"), QString(), filter); diff --git a/src/plasma/private/applet_p.cpp b/src/plasma/private/applet_p.cpp index 6a2721f00..3ec11ed00 100644 --- a/src/plasma/private/applet_p.cpp +++ b/src/plasma/private/applet_p.cpp @@ -265,7 +265,8 @@ void AppletPrivate::askDestroy() deleteNotification->setTitle(i18n("Widget Removed")); deleteNotification->setText(i18n("The widget \"%1\" has been removed.", q->title().toHtmlEscaped())); } else if (asContainment - && (asContainment->containmentType() == Types::PanelContainment || asContainment->containmentType() == Types::CustomPanelContainment)) { + && (asContainment->containmentType() == Types::PanelContainment // + || asContainment->containmentType() == Types::CustomPanelContainment)) { deleteNotification->setTitle(i18n("Panel Removed")); deleteNotification->setText(i18n("A panel has been removed.")); // This will never happen with our current shell, but could with a custom one diff --git a/src/plasma/private/containment_p.cpp b/src/plasma/private/containment_p.cpp index 2009aab25..564cb43a0 100644 --- a/src/plasma/private/containment_p.cpp +++ b/src/plasma/private/containment_p.cpp @@ -30,8 +30,7 @@ ContainmentPrivate::ContainmentPrivate(Containment *c) , formFactor(Types::Planar) , location(Types::Floating) , lastScreen(-1) - , // never had a screen - type(Plasma::Types::NoContainmentType) + , type(Plasma::Types::NoContainmentType) // never had a screen , uiReady(false) , appletsUiReady(false) { diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp index f924a76b1..d4c36a015 100644 --- a/src/plasma/private/theme_p.cpp +++ b/src/plasma/private/theme_p.cpp @@ -198,7 +198,8 @@ bool ThemePrivate::useCache() const auto files = cacheDir.entryInfoList(); for (const QFileInfo &file : files) { - if (currentCacheFileName.isEmpty() || !file.absoluteFilePath().endsWith(currentCacheFileName)) { + if (currentCacheFileName.isEmpty() // + || !file.absoluteFilePath().endsWith(currentCacheFileName)) { QFile::remove(file.absoluteFilePath()); } } @@ -384,8 +385,9 @@ const QString ThemePrivate::processStyleSheet(const QString &css, Plasma::Svg::S if (css.isEmpty()) { stylesheet = cachedDefaultStyleSheet; if (stylesheet.isEmpty()) { + /* clang-format off */ stylesheet = QStringLiteral( - "\n\ + "\n\ body {\n\ color: %textcolor;\n\ generalfont-size: %fontsize;\n\ @@ -396,6 +398,7 @@ const QString ThemePrivate::processStyleSheet(const QString &css, Plasma::Svg::S a:visited { color: %visitedlink; }\n\ a:hover { color: %hoveredlink; text-decoration: none; }\n\ "); + /* clang-format on */ stylesheet = cachedDefaultStyleSheet = processStyleSheet(stylesheet, status); } diff --git a/src/plasmaquick/appletquickitem.cpp b/src/plasmaquick/appletquickitem.cpp index 35f6ea7fa..017b2b991 100644 --- a/src/plasmaquick/appletquickitem.cpp +++ b/src/plasmaquick/appletquickitem.cpp @@ -109,9 +109,15 @@ void AppletQuickItemPrivate::connectLayoutAttached(QObject *item) const auto lstChildren = item->children(); for (QObject *child : lstChildren) { // find for the needed property of Layout: minimum/maximum/preferred sizes and fillWidth/fillHeight - if (child->property("minimumWidth").isValid() && child->property("minimumHeight").isValid() && child->property("preferredWidth").isValid() - && child->property("preferredHeight").isValid() && child->property("maximumWidth").isValid() && child->property("maximumHeight").isValid() - && child->property("fillWidth").isValid() && child->property("fillHeight").isValid()) { + /* clang-format off */ + if (child->property("minimumWidth").isValid() + && child->property("minimumHeight").isValid() + && child->property("preferredWidth").isValid() + && child->property("preferredHeight").isValid() + && child->property("maximumWidth").isValid() + && child->property("maximumHeight").isValid() + && child->property("fillWidth").isValid() + && child->property("fillHeight").isValid()) { /* clang-format on */ layout = child; break; } @@ -148,9 +154,15 @@ void AppletQuickItemPrivate::connectLayoutAttached(QObject *item) const auto children = q->children(); for (QObject *child : children) { // find for the needed property of Layout: minimum/maximum/preferred sizes and fillWidth/fillHeight - if (child->property("minimumWidth").isValid() && child->property("minimumHeight").isValid() && child->property("preferredWidth").isValid() - && child->property("preferredHeight").isValid() && child->property("maximumWidth").isValid() && child->property("maximumHeight").isValid() - && child->property("fillWidth").isValid() && child->property("fillHeight").isValid()) { + /* clang-format off */ + if (child->property("minimumWidth").isValid() + && child->property("minimumHeight").isValid() + && child->property("preferredWidth").isValid() + && child->property("preferredHeight").isValid() + && child->property("maximumWidth").isValid() + && child->property("maximumHeight").isValid() + && child->property("fillWidth").isValid() + && child->property("fillHeight").isValid()) { /* clang-format on */ ownLayout = child; break; } diff --git a/src/plasmaquick/packageurlinterceptor.cpp b/src/plasmaquick/packageurlinterceptor.cpp index 155fb8af7..6f3cade75 100644 --- a/src/plasmaquick/packageurlinterceptor.cpp +++ b/src/plasmaquick/packageurlinterceptor.cpp @@ -106,7 +106,8 @@ QUrl PackageUrlInterceptor::intercept(const QUrl &path, QQmlAbstractUrlIntercept const QUrl url = QUrl(plainPath); const QString newPath = url.path(); // search it in a resource or as a file on disk - if (!(plainPath.contains(QLatin1String("qrc")) && QFile::exists(QLatin1Char(':') + newPath)) && !QFile::exists(newPath)) { + if (!(plainPath.contains(QLatin1String("qrc")) && QFile::exists(QLatin1Char(':') + newPath)) // + && !QFile::exists(newPath)) { return d->selector->select(path); } qWarning() << "Warning: all files used by qml by the plasmoid should be in ui/. The file in the path" << plainPath << "was expected at" << path; diff --git a/src/plasmaquick/packageurlinterceptor.h b/src/plasmaquick/packageurlinterceptor.h index 8ef02453d..51865983c 100644 --- a/src/plasmaquick/packageurlinterceptor.h +++ b/src/plasmaquick/packageurlinterceptor.h @@ -60,8 +60,13 @@ public: // failed by type, let's try by extension const QString &extension = fileName.mid(fileName.lastIndexOf(QLatin1Char('.')) + 1).toLower(); - if (extension == QLatin1String("svg") || extension == QStringLiteral("svgz") || extension == QLatin1String("png") || extension == QStringLiteral("gif") - || extension == QLatin1String("jpg") || extension == QStringLiteral("jpeg")) { + /* clang-format off */ + if (extension == QLatin1String("svg") + || extension == QStringLiteral("svgz") + || extension == QLatin1String("png") + || extension == QStringLiteral("gif") + || extension == QLatin1String("jpg") + || extension == QStringLiteral("jpeg")) { /* clang-format on */ return QByteArray("images"); // FIXME: are those necessary? are they *always* caught by type? } else if (extension == QLatin1String("js")) { diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp b/src/scriptengines/qml/plasmoid/appletinterface.cpp index 348b6dea0..d859959b8 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp @@ -105,8 +105,14 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, const QVariant // if both compactRepresentationItem and fullRepresentationItem exist, // the applet is in a popup if (expanded) { - if (compactRepresentationItem() && fullRepresentationItem() && fullRepresentationItem()->window() && compactRepresentationItem()->window() - && fullRepresentationItem()->window() != compactRepresentationItem()->window() && fullRepresentationItem()->parentItem()) { + /* clang-format off */ + if (compactRepresentationItem() + && fullRepresentationItem() + && fullRepresentationItem()->window() + && compactRepresentationItem()->window() + && fullRepresentationItem()->window() != compactRepresentationItem()->window() + && fullRepresentationItem()->parentItem()) { + /* clang-format on */ fullRepresentationItem()->parentItem()->installEventFilter(this); } else if (fullRepresentationItem() && fullRepresentationItem()->parentItem()) { fullRepresentationItem()->parentItem()->removeEventFilter(this); diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index ba5b7afdd..d9d564218 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -1083,7 +1083,8 @@ void ContainmentInterface::addAppletActions(QMenu *desktopMenu, Plasma::Applet * void ContainmentInterface::addContainmentActions(QMenu *desktopMenu, QEvent *event) { - if (m_containment->corona()->immutability() != Plasma::Types::Mutable && !KAuthorized::authorizeAction(QStringLiteral("plasma/containment_actions"))) { + if (m_containment->corona()->immutability() != Plasma::Types::Mutable // + && !KAuthorized::authorizeAction(QStringLiteral("plasma/containment_actions"))) { // qDebug() << "immutability"; return; } @@ -1111,8 +1112,10 @@ void ContainmentInterface::addContainmentActions(QMenu *desktopMenu, QEvent *eve if (actions.isEmpty()) { // it probably didn't bother implementing the function. give the user a chance to set // a better plugin. note that if the user sets no-plugin this won't happen... - if ((m_containment->containmentType() != Plasma::Types::PanelContainment && m_containment->containmentType() != Plasma::Types::CustomPanelContainment) - && m_containment->actions()->action(QStringLiteral("configure"))) { + /* clang-format off */ + if ((m_containment->containmentType() != Plasma::Types::PanelContainment + && m_containment->containmentType() != Plasma::Types::CustomPanelContainment) + && m_containment->actions()->action(QStringLiteral("configure"))) { /* clang-format on */ desktopMenu->addAction(m_containment->actions()->action(QStringLiteral("configure"))); } } else { diff --git a/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp b/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp index 222aa1a1b..134ebe69c 100644 --- a/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp +++ b/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp @@ -150,7 +150,9 @@ void WallpaperInterface::syncWallpaperPackage() void WallpaperInterface::loadFinished() { - if (m_qmlObject->mainComponent() && m_qmlObject->rootObject() && !m_qmlObject->mainComponent()->isError()) { + if (m_qmlObject->mainComponent() // + && m_qmlObject->rootObject() // + && !m_qmlObject->mainComponent()->isError()) { m_qmlObject->rootObject()->setProperty("z", -1000); m_qmlObject->rootObject()->setProperty("parent", QVariant::fromValue(this));