diff --git a/plasmoid/contents/ui/MsmView.qml b/plasmoid/contents/ui/MsmView.qml --- a/plasmoid/contents/ui/MsmView.qml +++ b/plasmoid/contents/ui/MsmView.qml @@ -46,7 +46,7 @@ } function getSkillInfoLocal() { - var customFold = '/opt/mycroft/skills/' + var customFold = launchinstaller.skillsPath() || '/opt/mycroft/skills/' var skillPath = customFold + model.name if(PlasmaLa.FileReader.file_exists_local(skillPath)){ installLabl.text = "Installed" diff --git a/plugin/msmapp.h b/plugin/msmapp.h --- a/plugin/msmapp.h +++ b/plugin/msmapp.h @@ -29,6 +29,8 @@ explicit MsmApp(QObject *parent = 0); Q_INVOKABLE QString msmapp(const QString &program); + Q_INVOKABLE QString skillsPath(); + private: QProcess *m_process; }; diff --git a/plugin/msmapp.cpp b/plugin/msmapp.cpp --- a/plugin/msmapp.cpp +++ b/plugin/msmapp.cpp @@ -19,8 +19,9 @@ #include "msmapp.h" #include +#include -MsmApp::MsmApp(QObject *parent) : +MsmApp::MsmApp(QObject *parent) : QObject(parent), m_process(new QProcess(this)) { @@ -34,4 +35,11 @@ QString output = QString::fromLocal8Bit(bytes); return output; } - + +QString MsmApp::skillsPath() +{ + QString path = QDir::homePath()+"/.mycroft/skills"; + QDir dir(path); + if (dir.exists()) return path; + return QStringLiteral("/opt/mycroft/skills"); +}