GUI: add possibility to call script from link in result paragraph html

This commit is contained in:
Jean-Francois Dockes
2014-08-24 18:11:00 +02:00
parent 43e0f4eab4
commit 26c7e1c690
4 changed files with 65 additions and 0 deletions
+16
View File
@@ -151,6 +151,22 @@ bool DesktopDb::allApps(vector<AppDef> *apps)
return true;
}
bool DesktopDb::appByName(const string& nm, AppDef& app)
{
for (AppMap::const_iterator it = m_appMap.begin();
it != m_appMap.end(); it++) {
for (vector<AppDef>::const_iterator it1 = it->second.begin();
it1 != it->second.end(); it1++) {
if (!nm.compare(it1->name)) {
app.name = it1->name;
app.command = it1->command;
return true;
}
}
}
return false;
}
const string& DesktopDb::getReason()
{
return m_reason;
+7
View File
@@ -33,6 +33,8 @@ public:
AppDef(const std::string& nm, const std::string& cmd)
: name(nm), command(cmd)
{}
AppDef() {}
std::string name;
std::string command;
};
@@ -64,6 +66,11 @@ public:
*/
bool allApps(vector<AppDef> *apps);
/**
* Get app with given name
*/
bool appByName(const string& nm, AppDef& app);
typedef map<string, vector<DesktopDb::AppDef> > AppMap;
private: