Skip to content

Commit

Permalink
Merge pull request #12 from dingjingmaster/master
Browse files Browse the repository at this point in the history
CHANGE
  • Loading branch information
tong2357 authored Mar 13, 2020
2 parents 57d89cd + c95c4fd commit 37e5985
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion common/QGSettings/qgsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void QGSettingsPrivate::settingChanged(GSettings *, const gchar *key, gpointer u
* Qt::AutoConnection 则如果obj与调用者位于同一个线程中,则会同步调用该成员; 否则它将异步调用该成员
*
*/
QMetaObject::invokeMethod(self, "changed", Qt::DirectConnection, Q_ARG(QString, key));
QMetaObject::invokeMethod(self, "changed", Qt::AutoConnection, Q_ARG(QString, key));
}


Expand Down
1 change: 0 additions & 1 deletion common/clib-syslog.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#ifndef CLIB_SYSLOG_H
#define CLIB_SYSLOG_H
#include "global.h"
#include <stdio.h>
#include <stdarg.h>
#include <syslog.h>
Expand Down
13 changes: 12 additions & 1 deletion common/common.pri
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
INCLUDEPATH += $$PWD/
QT += core gui dbus
CONFIG += c++11 no_keywords link_pkgconfig
CONFIG -= app_bundle

include($$PWD/../common/common.pri)

INCLUDEPATH += -I $$PWD/

PKGCONFIG += \
glib-2.0\
gio-2.0


SOURCES += \
$$PWD/clib-syslog.c\
Expand Down
4 changes: 2 additions & 2 deletions daemon/daemon.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TEMPLATE = app
TARGET = ukui-settings-daemon

QT += core gui dbus
CONFIG += c++11 link_pkgconfig
CONFIG += no_keywords link_pkgconfig c++11
CONFIG -= app_bundle

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
Expand Down Expand Up @@ -33,5 +33,5 @@ HEADERS += \
$$PWD/plugin-info.h\
$$PWD/plugin-manager.h\
$$PWD/manager-interface.h \
global.h
$$PWD/global.h

4 changes: 1 addition & 3 deletions daemon/manager-interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PluginManagerDBus: public QDBusAbstractInterface

~PluginManagerDBus();

public slots:
public Q_SLOTS:
inline QDBusPendingReply<bool> managerAwake()
{
QList<QVariant> argumentList;
Expand Down Expand Up @@ -61,8 +61,6 @@ public slots:
QList<QVariant> argumentList;
return asyncCallWithArgumentList(QStringLiteral("onPluginDeactivated"), argumentList);
}

signals: // SIGNALS
};

#endif
4 changes: 2 additions & 2 deletions daemon/plugin-info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ bool PluginInfo::activatePlugin()

if (res) {
mPlugin->activate();
emit activated(mName);
Q_EMIT activated(mName);
} else {
CT_SYSLOG(LOG_ERR, "Error activating plugin '%s'", this->mName.toUtf8().data());
}
Expand Down Expand Up @@ -266,7 +266,7 @@ bool PluginInfo::loadPluginModule()
void PluginInfo::deactivatePlugin()
{
mPlugin->deactivate();
emit deactivated(mName);
Q_EMIT deactivated(mName);
}

//void PluginInfo::pluginEnabledCB(GSettings *settings, gchar *key, PluginInfo*)
Expand Down
2 changes: 1 addition & 1 deletion daemon/plugin-info.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PluginInfo : public QObject

bool operator== (PluginInfo&);

signals:
Q_SIGNALS:
void activated(QString&);
void deactivated(QString&);

Expand Down
5 changes: 2 additions & 3 deletions daemon/plugin-manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <QDBusConnectionInterface>
#include <QApplication>

QList<PluginInfo*>* PluginManager::mPlugin = NULL;
PluginManager* PluginManager::mPluginManager = NULL;

static bool is_schema (QString& schema);
Expand Down Expand Up @@ -79,14 +78,14 @@ bool PluginManager::managerAwake()
void PluginManager::onPluginActivated(QString &name)
{
CT_SYSLOG(LOG_DEBUG, "emitting plugin-activated '%s'", name.toUtf8().data());
emit pluginActivated(name);
Q_EMIT pluginActivated(name);
}

// FIXME://
void PluginManager::onPluginDeactivated(QString &name)
{
CT_SYSLOG(LOG_DEBUG, "emitting plugin-deactivated '%s'", name.toUtf8().data());
emit pluginDeactivated(name);
Q_EMIT pluginDeactivated(name);
}

void PluginManager::loadAll()
Expand Down
6 changes: 3 additions & 3 deletions daemon/plugin-manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class PluginManager : QObject
void loadFile (QString& fileName);
void unloadAll ();

signals:
Q_SIGNALS:
void pluginActivated (QString& name);
void pluginDeactivated (QString& name);

public slots:
public Q_SLOTS:
bool managerStart ();
void managerStop ();
bool managerAwake ();
Expand All @@ -45,7 +45,7 @@ public slots:
void onPluginDeactivated (QString& name);

private:
static QList<PluginInfo*>* mPlugin;
QList<PluginInfo*>* mPlugin;
static PluginManager* mPluginManager;
};

Expand Down

0 comments on commit 37e5985

Please sign in to comment.