Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add ControlCenter DBus adaptor #213

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions calendar-client/config/dbus/ControlCenterAdaptor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// SPDX-FileCopyrightText: 2024 - 2025 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#include "ControlCenterAdaptor.h"
#include <QtCore/QMetaObject>

Check warning on line 6 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QMetaObject> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 6 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QMetaObject> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtCore/QByteArray>

Check warning on line 7 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QByteArray> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 7 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QByteArray> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtCore/QList>

Check warning on line 8 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QList> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 8 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QList> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtCore/QMap>

Check warning on line 9 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QMap> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 9 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QMap> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtCore/QString>

Check warning on line 10 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QString> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 10 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QString> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtCore/QStringList>

Check warning on line 11 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QStringList> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 11 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QStringList> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtCore/QVariant>

Check warning on line 12 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QVariant> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 12 in calendar-client/config/dbus/ControlCenterAdaptor.cpp

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QVariant> not found. Please note: Cppcheck does not need standard library headers to get proper results.

/*
* Implementation of adaptor class ControlCenterAdaptor
*/

ControlCenterAdaptor::ControlCenterAdaptor(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
// constructor
setAutoRelaySignals(true);
}

ControlCenterAdaptor::~ControlCenterAdaptor()
{
// destructor
}

void ControlCenterAdaptor::ShowPage(const QString &url)
{
// handle method call org.deepin.dde.ControlCenter1.ShowPage
QMetaObject::invokeMethod(parent(), "ShowPage", Q_ARG(QString, url));
}

43 changes: 43 additions & 0 deletions calendar-client/config/dbus/ControlCenterAdaptor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// SPDX-FileCopyrightText: 2024 - 2025 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef CONTROLCENTERADAPTOR_H
#define CONTROLCENTERADAPTOR_H

#include <QtCore/QObject>

Check warning on line 8 in calendar-client/config/dbus/ControlCenterAdaptor.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtCore/QObject> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 8 in calendar-client/config/dbus/ControlCenterAdaptor.h

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtCore/QObject> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtDBus/QtDBus>

Check warning on line 9 in calendar-client/config/dbus/ControlCenterAdaptor.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtDBus/QtDBus> not found. Please note: Cppcheck does not need standard library headers to get proper results.

Check warning on line 9 in calendar-client/config/dbus/ControlCenterAdaptor.h

View workflow job for this annotation

GitHub Actions / static-check / static-check

Include file: <QtDBus/QtDBus> not found. Please note: Cppcheck does not need standard library headers to get proper results.
QT_BEGIN_NAMESPACE
class QByteArray;
template<class T> class QList;
template<class Key, class Value> class QMap;
class QString;
class QStringList;
class QVariant;
QT_END_NAMESPACE

/*
* Adaptor class for interface org.deepin.dde.ControlCenter1
*/
class ControlCenterAdaptor: public QDBusAbstractAdaptor
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.ControlCenter1")
Q_CLASSINFO("D-Bus Introspection", ""
" <interface name=\"org.deepin.dde.ControlCenter1\">\n"
" <method name=\"ShowPage\">\n"
" <arg direction=\"in\" type=\"s\" name=\"url\"/>\n"
" </method>\n"
" </interface>\n"
"")
public:
ControlCenterAdaptor(QObject *parent);
virtual ~ControlCenterAdaptor();

public: // PROPERTIES
public Q_SLOTS: // METHODS

Check warning on line 38 in calendar-client/config/dbus/ControlCenterAdaptor.h

View workflow job for this annotation

GitHub Actions / cppcheck

There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it.

Check warning on line 38 in calendar-client/config/dbus/ControlCenterAdaptor.h

View workflow job for this annotation

GitHub Actions / static-check / static-check

There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it.
void ShowPage(const QString &url);
Q_SIGNALS: // SIGNALS
};

#endif
Loading