|
a/src/utils/appformime.h |
|
b/src/utils/appformime.h |
|
... |
|
... |
35 |
{}
|
35 |
{}
|
36 |
std::string name;
|
36 |
std::string name;
|
37 |
std::string command;
|
37 |
std::string command;
|
38 |
};
|
38 |
};
|
39 |
|
39 |
|
|
|
40 |
/** Build/Get the db for the standard fdo directory */
|
40 |
static DesktopDb* getDb();
|
41 |
static DesktopDb* getDb();
|
41 |
static const string& getReason();
|
42 |
|
|
|
43 |
/** Constructor for a db based on a non-standard location */
|
|
|
44 |
DesktopDb(const string& dir);
|
|
|
45 |
|
42 |
~DesktopDb();
|
46 |
~DesktopDb();
|
|
|
47 |
|
|
|
48 |
/** In case of error: what happened ? */
|
|
|
49 |
const string& getReason();
|
43 |
|
50 |
|
44 |
/**
|
51 |
/**
|
45 |
* Get a list of applications able to process a given MIME type.
|
52 |
* Get a list of applications able to process a given MIME type.
|
46 |
* @param mime MIME type we want the apps for
|
53 |
* @param mime MIME type we want the apps for
|
47 |
* @param[output] apps appropriate applications
|
54 |
* @param[output] apps appropriate applications
|
|
... |
|
... |
50 |
* problem was detected.
|
57 |
* problem was detected.
|
51 |
*/
|
58 |
*/
|
52 |
bool appForMime(const std::string& mime, vector<AppDef> *apps,
|
59 |
bool appForMime(const std::string& mime, vector<AppDef> *apps,
|
53 |
std::string *reason = 0);
|
60 |
std::string *reason = 0);
|
54 |
|
61 |
|
|
|
62 |
/**
|
|
|
63 |
* Get all applications defs:
|
|
|
64 |
* @param[output] apps applications
|
|
|
65 |
* @return true
|
|
|
66 |
*/
|
|
|
67 |
bool allApps(vector<AppDef> *apps);
|
|
|
68 |
|
|
|
69 |
typedef map<string, vector<DesktopDb::AppDef> > AppMap;
|
|
|
70 |
|
55 |
private:
|
71 |
private:
|
|
|
72 |
/** This is used by getDb() and builds a db for the standard location */
|
56 |
DesktopDb();
|
73 |
DesktopDb();
|
|
|
74 |
void build(const string& dir);
|
57 |
DesktopDb(const DesktopDb &);
|
75 |
DesktopDb(const DesktopDb &);
|
58 |
DesktopDb& operator=(const DesktopDb &);
|
76 |
DesktopDb& operator=(const DesktopDb &);
|
|
|
77 |
|
|
|
78 |
AppMap m_appMap;
|
|
|
79 |
std::string m_reason;
|
|
|
80 |
bool m_ok;
|
59 |
};
|
81 |
};
|
60 |
|
82 |
|
61 |
|
83 |
|
62 |
#endif /* _APPFORMIME_H_INCLUDED_ */
|
84 |
#endif /* _APPFORMIME_H_INCLUDED_ */
|