forked from openkylin/ukui-search
Change the pos if the override of QDbusArgument's operator>> in order to avoid others who use the app-info-table include dbus.
This commit is contained in:
parent
aea548ad74
commit
12d6d64c3b
|
@ -2,8 +2,6 @@
|
|||
#define APPDBCOMMON_H
|
||||
|
||||
#include <QDir>
|
||||
#include <QMetaType>
|
||||
#include <QDBusArgument>
|
||||
|
||||
namespace UkuiSearch {
|
||||
|
||||
|
@ -12,6 +10,7 @@ namespace UkuiSearch {
|
|||
|
||||
struct AppInfoResult
|
||||
{
|
||||
public:
|
||||
QString desktopPath;
|
||||
QString iconName;
|
||||
QString appLocalName;
|
||||
|
@ -23,27 +22,7 @@ struct AppInfoResult
|
|||
int lock;
|
||||
|
||||
AppInfoResult() : top(0), favorite(0), launchTimes(0), lock(0) {}
|
||||
friend QDBusArgument &operator << (QDBusArgument &argument, const AppInfoResult &infoResult)
|
||||
{
|
||||
argument.beginStructure();
|
||||
argument << infoResult.desktopPath << infoResult.iconName << infoResult.appLocalName << infoResult.firstLetter
|
||||
<< infoResult.category << infoResult.top << infoResult.favorite << infoResult.launchTimes << infoResult.lock;
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
friend const QDBusArgument &operator >> (const QDBusArgument &argument, AppInfoResult &infoResult)
|
||||
{
|
||||
argument.beginStructure();
|
||||
argument >> infoResult.desktopPath >> infoResult.iconName >> infoResult.appLocalName >> infoResult.firstLetter
|
||||
>> infoResult.category >> infoResult.top >> infoResult.favorite >> infoResult.launchTimes >> infoResult.lock;
|
||||
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(UkuiSearch::AppInfoResult)
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
#ifndef APPINFODBUSARGUMENT_H
|
||||
#define APPINFODBUSARGUMENT_H
|
||||
|
||||
#include <QDBusArgument>
|
||||
#include "app-db-common.h"
|
||||
|
||||
namespace UkuiSearch {
|
||||
|
||||
QDBusArgument &operator << (QDBusArgument &argument, const AppInfoResult &infoResult)
|
||||
{
|
||||
argument.beginStructure();
|
||||
argument << infoResult.desktopPath << infoResult.iconName << infoResult.appLocalName << infoResult.firstLetter
|
||||
<< infoResult.category << infoResult.top << infoResult.favorite << infoResult.launchTimes << infoResult.lock;
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
const QDBusArgument &operator >> (const QDBusArgument &argument, AppInfoResult &infoResult)
|
||||
{
|
||||
argument.beginStructure();
|
||||
argument >> infoResult.desktopPath >> infoResult.iconName >> infoResult.appLocalName >> infoResult.firstLetter
|
||||
>> infoResult.category >> infoResult.top >> infoResult.favorite >> infoResult.launchTimes >> infoResult.lock;
|
||||
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // APPINFODBUSARGUMENT_H
|
|
@ -51,6 +51,7 @@ SOURCES += \
|
|||
|
||||
HEADERS += \
|
||||
app-db-common.h \
|
||||
app-info-dbus-argument.h \
|
||||
common.h \
|
||||
file-utils.h \
|
||||
global-settings.h \
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "ukui-search-app-data-service.h"
|
||||
#include "app-db-manager.h"
|
||||
#include "signal-transformer.h"
|
||||
#include "app-info-dbus-argument.h"
|
||||
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusMetaType>
|
||||
|
|
Loading…
Reference in New Issue