2022-03-01 17:39:53 +08:00
|
|
|
#ifndef APPINFOTABLEPRIVATE_H
|
|
|
|
#define APPINFOTABLEPRIVATE_H
|
2022-06-28 11:20:36 +08:00
|
|
|
|
|
|
|
#include "app-info-table.h"
|
2022-03-01 17:39:53 +08:00
|
|
|
#include <QObject>
|
2022-06-28 11:20:36 +08:00
|
|
|
#include <QDBusInterface>
|
2022-06-13 13:38:47 +08:00
|
|
|
#include <QSqlDatabase>
|
|
|
|
|
2022-03-01 17:39:53 +08:00
|
|
|
namespace UkuiSearch {
|
2022-06-28 11:20:36 +08:00
|
|
|
|
2022-03-01 17:39:53 +08:00
|
|
|
class AppInfoTablePrivate : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2023-03-07 17:33:08 +08:00
|
|
|
friend class AppInfoTable;
|
2022-03-01 17:39:53 +08:00
|
|
|
public:
|
|
|
|
explicit AppInfoTablePrivate(AppInfoTable *parent = nullptr);
|
|
|
|
AppInfoTablePrivate(AppInfoTablePrivate &) = delete;
|
|
|
|
AppInfoTablePrivate &operator =(const AppInfoTablePrivate &) = delete;
|
|
|
|
|
2022-07-12 11:26:03 +08:00
|
|
|
//设置应用的置顶和收藏
|
2023-03-31 17:24:06 +08:00
|
|
|
void setAppFavoritesState(const QString &desktopfp);
|
|
|
|
void setAppFavoritesState(const QString &desktopfp, uint num);
|
|
|
|
void setAppTopState(const QString &desktopfp);
|
|
|
|
void setAppTopState(const QString &desktopfp, uint num);
|
2022-06-28 11:20:36 +08:00
|
|
|
|
|
|
|
//搜索接口
|
2022-06-13 13:38:47 +08:00
|
|
|
bool searchInstallApp(QString &keyWord, QStringList &installAppInfoRes);
|
|
|
|
bool searchInstallApp(QStringList &keyWord, QStringList &installAppInfoRes);
|
|
|
|
|
|
|
|
|
2022-06-28 14:00:57 +08:00
|
|
|
//数据库错误信息
|
2022-06-13 13:38:47 +08:00
|
|
|
QString lastError(void) const;
|
|
|
|
|
2023-02-17 15:55:10 +08:00
|
|
|
//通过pid查找desktop文件
|
|
|
|
bool tranPidToDesktopFp(int pid, QString &desktopfp);
|
|
|
|
|
2022-06-28 14:00:57 +08:00
|
|
|
//下面的接口都不外放,暂时没啥用
|
2023-03-14 16:06:37 +08:00
|
|
|
bool setAppLaunchTimes(const QString &desktopfp, size_t num);
|
|
|
|
bool updateAppLaunchTimes(const QString &desktopfp);
|
|
|
|
bool setAppLockState(const QString &desktopfp, size_t num);
|
2022-06-28 14:00:57 +08:00
|
|
|
|
2022-03-01 17:39:53 +08:00
|
|
|
private:
|
2022-06-13 13:38:47 +08:00
|
|
|
~AppInfoTablePrivate();
|
2022-06-23 10:12:02 +08:00
|
|
|
bool initDateBaseConnection();
|
|
|
|
bool openDataBase();
|
2022-06-13 13:38:47 +08:00
|
|
|
void closeDataBase();
|
|
|
|
|
2022-07-12 11:26:03 +08:00
|
|
|
QDBusInterface *m_signalTransInterface = nullptr;
|
|
|
|
QDBusInterface *m_appDBInterface = nullptr;
|
2022-06-28 11:20:36 +08:00
|
|
|
|
2022-06-13 13:38:47 +08:00
|
|
|
AppInfoTable *q = nullptr;
|
2022-10-19 17:11:05 +08:00
|
|
|
QSqlDatabase *m_database = nullptr;
|
2022-06-13 13:38:47 +08:00
|
|
|
QString m_ConnectionName;
|
2022-03-01 17:39:53 +08:00
|
|
|
|
2022-06-28 11:20:36 +08:00
|
|
|
public Q_SLOTS:
|
2023-03-14 14:01:28 +08:00
|
|
|
void sendAppDBItemsUpdate(ApplicationInfoMap results);
|
|
|
|
void sendAppDBItemsUpdateAll(QStringList desktopFilePaths);
|
|
|
|
void sendAppDBItemsAdd(QStringList desktopFilePaths);
|
|
|
|
void sendAppDBItemsDelete(QStringList desktopFilePaths);
|
2022-06-28 11:20:36 +08:00
|
|
|
|
2022-03-01 17:39:53 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif // APPINFOTABLEPRIVATE_H
|