Skip to content

Commit

Permalink
Remove QtDBus includes
Browse files Browse the repository at this point in the history
Per the discussion of QTBUG-88831, we determined that module-wide
imports are unfortunate, especially for compile times. Following this,
all QtDBus includes have been replaced with the headers for the classes
actually used in each file. Additionally, some cleanup of header file
order and format has been performed in the changed files.

Pick-to: 6.0
Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Volker Hilsheimer <[email protected]>
Reviewed-by: Edward Welbourne <[email protected]>
  • Loading branch information
David Skoland committed Jan 12, 2021
1 parent 6a3f8cb commit 9e09677
Show file tree
Hide file tree
Showing 51 changed files with 339 additions and 235 deletions.
17 changes: 9 additions & 8 deletions examples/dbus/complexpingpong/complexping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,18 @@
**
****************************************************************************/

#include <stdio.h>

#include <QtCore/QCoreApplication>
#include <QtCore/QFile>
#include <QtCore/QDebug>
#include <QtCore/QProcess>
#include <QtDBus/QtDBus>

#include "ping-common.h"
#include "complexping.h"

#include <QCoreApplication>
#include <QDBusReply>
#include <QDBusServiceWatcher>
#include <QFile>
#include <QDebug>
#include <QProcess>

#include <stdio.h>

void Ping::start(const QString &name)
{
if (name != SERVICE_NAME)
Expand Down
15 changes: 8 additions & 7 deletions examples/dbus/complexpingpong/complexpong.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,17 @@
**
****************************************************************************/

#include <stdio.h>
#include <stdlib.h>

#include <QtCore/QCoreApplication>
#include <QtCore/QTimer>
#include <QtDBus/QtDBus>

#include "ping-common.h"
#include "complexpong.h"

#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusError>
#include <QTimer>

#include <stdio.h>
#include <stdlib.h>

// the property
QString Pong::value() const
{
Expand Down
11 changes: 7 additions & 4 deletions examples/dbus/listnames/listnames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@
**
****************************************************************************/

#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtCore/QStringList>
#include <QtDBus/QtDBus>
#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QDBusInterface>
#include <QDBusReply>
#include <QDebug>
#include <QStringList>

void method1()
{
Expand Down
10 changes: 6 additions & 4 deletions examples/dbus/pingpong/ping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@
**
****************************************************************************/

#include <stdio.h>
#include "ping-common.h"

#include <QtCore/QCoreApplication>
#include <QtDBus/QtDBus>
#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusInterface>
#include <QDBusReply>

#include "ping-common.h"
#include <stdio.h>

int main(int argc, char **argv)
{
Expand Down
15 changes: 8 additions & 7 deletions examples/dbus/pingpong/pong.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,17 @@
**
****************************************************************************/

#include <stdio.h>
#include <stdlib.h>

#include <QtCore/QCoreApplication>
#include <QtCore/QTimer>
#include <QtDBus/QtDBus>

#include "ping-common.h"
#include "pong.h"

#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusError>
#include <QTimer>

#include <stdio.h>
#include <stdlib.h>

QString Pong::ping(const QString &arg)
{
QMetaObject::invokeMethod(QCoreApplication::instance(), "quit");
Expand Down
2 changes: 1 addition & 1 deletion examples/dbus/remotecontrolledcar/controller/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
****************************************************************************/

#include <QtWidgets>
#include <QtDBus>


#include "controller.h"

Expand Down
2 changes: 1 addition & 1 deletion src/dbus/doc/snippets/qdbusextratypes/qdbusextratypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
****************************************************************************/

#include <QtCore>
#include <QtDBus>


static QVariant callMyDBusFunction() { return QVariant(); }

Expand Down
20 changes: 11 additions & 9 deletions src/gui/platform/unix/dbusmenu/qdbusmenuadaptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,17 @@
However it is maintained manually.
*/

#include "qdbusmenuadaptor_p.h"
#include "qdbusplatformmenu_p.h"
#include <QtCore/QMetaObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QMetaObject>
#include <QByteArray>
#include <QList>
#include <QMap>
#include <QString>
#include <QStringList>
#include <QVariant>
#include <QLocale>

#include <private/qdbusmenuadaptor_p.h>
#include <private/qdbusplatformmenu_p.h>

QT_BEGIN_NAMESPACE

Expand Down
7 changes: 4 additions & 3 deletions src/gui/platform/unix/dbusmenu/qdbusmenuadaptor_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@
// We mean it.
//

#include <QtCore/QObject>
#include <QtDBus/QtDBus>
#include "qdbusmenutypes_p.h"
#include <QObject>
#include <QDBusAbstractAdaptor>

#include <private/qdbusmenutypes_p.h>

QT_BEGIN_NAMESPACE

Expand Down
21 changes: 11 additions & 10 deletions src/gui/platform/unix/dbusmenu/qdbusmenuconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,19 @@

#include <QtGui/qtgui-config.h>

#include <QDBusMessage>
#include <QDBusInterface>
#include <QDBusServiceWatcher>
#include <QDBusConnectionInterface>
#include <QDebug>
#include <QCoreApplication>

#ifndef QT_NO_SYSTEMTRAYICON
#include "../dbustray/qdbustrayicon_p.h"
#include <private/qdbustrayicon_p.h>
#endif
#include "qdbusmenuconnection_p.h"
#include "qdbusmenuadaptor_p.h"
#include "qdbusplatformmenu_p.h"

#include <QtDBus/QDBusMessage>
#include <QtDBus/QDBusServiceWatcher>
#include <QtDBus/QDBusConnectionInterface>
#include <qdebug.h>
#include <qcoreapplication.h>
#include <private/qdbusmenuconnection_p.h>
#include <private/qdbusmenuadaptor_p.h>
#include <private/qdbusplatformmenu_p.h>

QT_BEGIN_NAMESPACE

Expand Down
31 changes: 18 additions & 13 deletions src/gui/platform/unix/dbustray/qdbustrayicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,28 @@

#ifndef QT_NO_SYSTEMTRAYICON

#include <private/qdbusmenuconnection_p.h>
#include "qstatusnotifieritemadaptor_p.h"
#include <private/qdbusmenuadaptor_p.h>
#include <private/qdbusplatformmenu_p.h>
#include "qxdgnotificationproxy_p.h"
#include <QString>
#include <QDebug>
#include <QRect>
#include <QLoggingCategory>
#include <QStandardPaths>
#include <QDir>
#include <QMetaObject>
#include <QMetaEnum>
#include <QDBusConnectionInterface>
#include <QDBusArgument>
#include <QDBusMetaType>
#include <QDBusServiceWatcher>

#include <qpa/qplatformmenu.h>
#include <qstring.h>
#include <qdebug.h>
#include <qrect.h>
#include <qloggingcategory.h>
#include <qstandardpaths.h>
#include <qdir.h>
#include <qmetaobject.h>
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformservices.h>
#include <qdbusconnectioninterface.h>

#include <private/qdbusmenuconnection_p.h>
#include <private/qstatusnotifieritemadaptor_p.h>
#include <private/qdbusmenuadaptor_p.h>
#include <private/qdbusplatformmenu_p.h>
#include <private/qxdgnotificationproxy_p.h>
#include <private/qlockfile_p.h>
#include <private/qguiapplication_p.h>

Expand Down
8 changes: 4 additions & 4 deletions src/gui/platform/unix/dbustray/qstatusnotifieritemadaptor_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@
// We mean it.
//

#include <QtGui/private/qtguiglobal_p.h>
#include <private/qtguiglobal_p.h>

QT_REQUIRE_CONFIG(systemtrayicon);

#include <QtCore/QObject>
#include <QtDBus/QtDBus>
#include <QObject>
#include <QDBusAbstractAdaptor>

#include "qdbustraytypes_p.h"
#include <private/qdbustraytypes_p.h>

QT_BEGIN_NAMESPACE
class QDBusTrayIcon;
Expand Down
20 changes: 11 additions & 9 deletions src/gui/platform/unix/dbustray/qxdgnotificationproxy_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,17 @@
// We mean it.
//

#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QLoggingCategory>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
#include <QObject>
#include <QByteArray>
#include <QList>
#include <QLoggingCategory>
#include <QMap>
#include <QString>
#include <QStringList>
#include <QVariant>
#include <QDBusAbstractInterface>
#include <QDBusPendingReply>
#include <QDBusReply>

QT_BEGIN_NAMESPACE

Expand Down
38 changes: 20 additions & 18 deletions src/gui/platform/unix/qgenericunixthemes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,34 @@

#include "qgenericunixthemes_p.h"

#include "qpa/qplatformtheme_p.h"
#include "qpa/qplatformfontdatabase.h" // lcQpaFonts

#include <QtGui/QPalette>
#include <QtGui/QFont>
#include <QtGui/QGuiApplication>
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include <QtCore/QFile>
#include <QtCore/QDebug>
#include <QtCore/QHash>
#include <QPalette>
#include <QFont>
#include <QGuiApplication>
#include <QDir>
#include <QFileInfo>
#include <QFile>
#include <QDebug>
#include <QHash>
#include <QLoggingCategory>
#include <QVariant>
#include <QStandardPaths>
#include <QStringList>
#if QT_CONFIG(mimetype)
#include <QtCore/QMimeDatabase>
#include <QMimeDatabase>
#endif
#include <QtCore/QLoggingCategory>
#if QT_CONFIG(settings)
#include <QtCore/QSettings>
#include <QSettings>
#endif
#include <QtCore/QVariant>
#include <QtCore/QStandardPaths>
#include <QtCore/QStringList>
#include <private/qguiapplication_p.h>

#include <qpa/qplatformfontdatabase.h> // lcQpaFonts
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformservices.h>
#include <qpa/qplatformdialoghelper.h>
#include <qpa/qplatformtheme_p.h>

#include <private/qguiapplication_p.h>
#ifndef QT_NO_DBUS
#include <QDBusConnectionInterface>
#include <private/qdbusplatformmenu_p.h>
#include <private/qdbusmenubar_p.h>
#endif
Expand Down
18 changes: 10 additions & 8 deletions src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
#ifndef QIBUSINPUTCONTEXTPROXY_H_1394889529
#define QIBUSINPUTCONTEXTPROXY_H_1394889529

#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
#include <QObject>
#include <QByteArray>
#include <QList>
#include <QMap>
#include <QString>
#include <QStringList>
#include <QVariant>
#include <QDBusAbstractInterface>
#include <QDBusPendingReply>


/*
* Proxy class for interface org.freedesktop.IBus.InputContext
Expand Down
Loading

0 comments on commit 9e09677

Please sign in to comment.