jenkinsmain
Last change
on this file since bc7a483 was
6b6f1ba,
checked in by Vadim Troshchinskiy Shmelev <vtroshchinskiy@…>, 16 months ago
|
Fix build, missing file in cmake
|
-
Property mode set to
100644
|
File size:
649 bytes
|
Rev | Line | |
---|
[6b6f1ba] | 1 | #include <QObject> |
---|
| 2 | #include <QString> |
---|
| 3 | #include <QMap> |
---|
| 4 | |
---|
| 5 | |
---|
| 6 | class DesktopParser { |
---|
| 7 | public: |
---|
| 8 | |
---|
| 9 | static DesktopParser &getInstance() { |
---|
| 10 | static DesktopParser instance; |
---|
| 11 | return instance; |
---|
| 12 | } |
---|
| 13 | |
---|
| 14 | void loadSchemes(); |
---|
| 15 | |
---|
| 16 | QString getScheme(const QString &scheme) { |
---|
| 17 | QString s = scheme.toLower().trimmed(); |
---|
| 18 | |
---|
| 19 | if (_schemes.contains(s)) { |
---|
| 20 | return _schemes[s]; |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | return ""; |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | QMap<QString, QString>& getSchemes() { return _schemes; } |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | private: |
---|
| 33 | DesktopParser(); |
---|
| 34 | |
---|
| 35 | QStringList _applicationPaths{"/usr/share/applications"}; |
---|
| 36 | QMap<QString, QString> _schemes{}; |
---|
| 37 | |
---|
| 38 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.