#ifndef TEST_APPLICATION_INFO_H
#define TEST_APPLICATION_INFO_H

#include <QObject>
#include <QHash>
#include <QStringList>

namespace UkuiSearch {

class ApplicationInfo : public QObject
{
    Q_OBJECT
public:
    explicit ApplicationInfo(QObject *parent = nullptr)
        : QObject(parent)
    {
    }

    void desktopFilePathFromName(const QString &name, QString &path)
    {
        path = s_desktopFiles.value(name);
    }

    static void setDesktopFilePath(const QString &name, const QString &path)
    {
        s_desktopFiles.insert(name, path);
    }

    static void clearDesktopFilePaths()
    {
        s_desktopFiles.clear();
    }

Q_SIGNALS:
    void appDBItems2BDelete(const QStringList &desktopFiles);
    void appDBItems2BAdd(const QStringList &desktopFiles);

private:
    inline static QHash<QString, QString> s_desktopFiles;
};

} // namespace UkuiSearch

#endif // TEST_APPLICATION_INFO_H
