forked from openkylin/ukui-search
add dir watch of desktop
This commit is contained in:
parent
883de524e3
commit
723a79c221
|
@ -25,6 +25,13 @@ AppMatch::AppMatch(QObject *parent) : QObject(parent)
|
|||
{
|
||||
|
||||
this->getDesktopFilePath();
|
||||
|
||||
m_watchAppDir=new QFileSystemWatcher(this);
|
||||
m_watchAppDir->addPath("/usr/share/applications/");
|
||||
connect(m_watchAppDir,&QFileSystemWatcher::directoryChanged,[this](){
|
||||
this->getDesktopFilePath();
|
||||
});
|
||||
|
||||
qDBusRegisterMetaType<QMap<QString,QString>>();
|
||||
qDBusRegisterMetaType<QList<QMap<QString,QString>>>();
|
||||
m_interFace=new QDBusInterface ("com.kylin.softwarecenter.getsearchresults", "/com/kylin/softwarecenter/getsearchresults",
|
||||
|
@ -41,6 +48,10 @@ AppMatch::~AppMatch(){
|
|||
delete m_interFace;
|
||||
m_interFace=NULL;
|
||||
}
|
||||
if(m_watchAppDir){
|
||||
delete m_watchAppDir;
|
||||
m_watchAppDir=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
QStringList AppMatch::startMatchApp(QString input){
|
||||
|
|
|
@ -55,6 +55,7 @@ private:
|
|||
QStringList m_returnResult;
|
||||
|
||||
QDBusInterface *m_interFace=nullptr;
|
||||
QFileSystemWatcher *m_watchAppDir=nullptr;
|
||||
QMap<QString,QList<QString>> m_softWareCenterMap;
|
||||
QMap<QString,QList<QString>> m_installAppMap;
|
||||
QMap<QString,QList<QString>> m_filterInstallAppMap;
|
||||
|
|
Loading…
Reference in New Issue