fix(libsearch):解决编译问题

This commit is contained in:
iaom 2023-11-27 11:20:16 +08:00
parent 4d73bc7c4c
commit aee23999ac
4 changed files with 76 additions and 75 deletions

View File

@ -22,16 +22,15 @@
#include <QDBusArgument>
#include "application-property.h"
namespace UkuiSearch {
QDBusArgument &operator << (QDBusArgument &argument, const ApplicationProperty::Property &property) {
using namespace UkuiSearch;
QDBusArgument &operator << (QDBusArgument &argument, const UkuiSearch::ApplicationProperty::Property &property) {
argument.beginStructure();
argument << static_cast<int>(property);
argument.endStructure();
return argument;
}
const QDBusArgument &operator >> (const QDBusArgument &argument, ApplicationProperty::Property &property) {
const QDBusArgument &operator >> (const QDBusArgument &argument, UkuiSearch::ApplicationProperty::Property &property) {
int value;
argument.beginStructure();
argument >> value;
@ -94,7 +93,4 @@ namespace UkuiSearch {
argument.endMap();
return argument;
}
}
#endif // APPINFODBUSARGUMENT_H

View File

@ -25,10 +25,11 @@ static AppInfoTable *global_intance = nullptr;
AppInfoTablePrivate::AppInfoTablePrivate(AppInfoTable *parent) : QObject(parent), q(parent), m_database(new QSqlDatabase())
{
//dbus接收数据库信号
qRegisterMetaType<ApplicationPropertyMap>("ApplicationPropertyMap");
qRegisterMetaType<UkuiSearch::ApplicationProperty::Property>("ApplicationProperty::Property");
qRegisterMetaType<UkuiSearch::ApplicationInfoMap>("ApplicationInfoMap");
qRegisterMetaType<UkuiSearch::ApplicationPropertyMap>("ApplicationPropertyMap");
qDBusRegisterMetaType<UkuiSearch::ApplicationProperty::Property>();
qDBusRegisterMetaType<ApplicationPropertyMap>();
qRegisterMetaType<ApplicationInfoMap>("ApplicationInfoMap");
qDBusRegisterMetaType<ApplicationInfoMap>();
m_signalTransInterface = new QDBusInterface("com.ukui.search.appdb.service",

View File

@ -24,6 +24,7 @@
#include <QMap>
#include <QVector>
#include <QVariant>
#include <QDBusArgument>
namespace UkuiSearch {
namespace ApplicationProperty {
@ -61,5 +62,7 @@ typedef QMap<ApplicationProperty::Property, QVariant> ApplicationPropertyMap;
typedef QMap<QString, ApplicationPropertyMap> ApplicationInfoMap; // desktopFile->ApplicationPropertyMap
}
Q_DECLARE_METATYPE(UkuiSearch::ApplicationProperty::Property)
Q_DECLARE_METATYPE(UkuiSearch::ApplicationPropertyMap)
Q_DECLARE_METATYPE(UkuiSearch::ApplicationInfoMap)
Q_DECLARE_METATYPE(UkuiSearch::ApplicationProperties)
#endif // APPLICATIONPROPERTY_H

View File

@ -35,6 +35,7 @@ namespace UkuiSearch {
class FileContentSearchTask : public SearchTaskPluginIface
{
Q_OBJECT
public:
explicit FileContentSearchTask(QObject *parent = nullptr);