Changeset View
Changeset View
Standalone View
Standalone View
krusader/krservices.h
Show All 35 Lines | |||||
36 | */ | 36 | */ | ||
37 | class KrServices | 37 | class KrServices | ||
38 | { | 38 | { | ||
39 | public: | 39 | public: | ||
40 | static bool cmdExist(const QString& cmdName); | 40 | static bool cmdExist(const QString& cmdName); | ||
41 | static QString chooseFullPathName(QStringList names, const QString& confName); | 41 | static QString chooseFullPathName(QStringList names, const QString& confName); | ||
42 | static QString fullPathName(const QString& name, QString confName = QString()); | 42 | static QString fullPathName(const QString& name, QString confName = QString()); | ||
43 | static bool isExecutable(const QString &path); | 43 | static bool isExecutable(const QString &path); | ||
44 | static QString registeredProtocol(const QString& mimetype); | | |||
45 | static bool isoSupported(const QString& mimetype); | 44 | static bool isoSupported(const QString& mimetype); | ||
46 | static QString urlToLocalPath(const QUrl &url); | 45 | static QString urlToLocalPath(const QUrl &url); | ||
47 | static void clearProtocolCache(); | | |||
48 | static bool fileToStringList(QTextStream *stream, QStringList& target, bool keepEmptyLines = false); | 46 | static bool fileToStringList(QTextStream *stream, QStringList& target, bool keepEmptyLines = false); | ||
49 | static bool fileToStringList(QFile *file, QStringList& target, bool keepEmptyLines = false); | 47 | static bool fileToStringList(QFile *file, QStringList& target, bool keepEmptyLines = false); | ||
50 | static QString quote(const QString& name); | 48 | static QString quote(const QString& name); | ||
51 | static QStringList quote(const QStringList& names); | 49 | static QStringList quote(const QStringList& names); | ||
52 | static QList<QUrl> toUrlList(const QStringList &list); | 50 | static QList<QUrl> toUrlList(const QStringList &list); | ||
53 | static QStringList toStringList(const QList<QUrl> &list); | 51 | static QStringList toStringList(const QList<QUrl> &list); | ||
54 | static QStringList supportedTools(); // find supported tools | 52 | static QStringList supportedTools(); // find supported tools | ||
55 | static QString escapeFileUrl(QString urlString); | 53 | static QString escapeFileUrl(QString urlString); | ||
56 | static QUrl escapeFileUrl(const QUrl &url); | 54 | static QUrl escapeFileUrl(const QUrl &url); | ||
57 | /** | 55 | /** | ||
58 | * Sets the global logging message handler for qDebug(), qWarning()... messages to a custom one | 56 | * Sets the global logging message handler for qDebug(), qWarning()... messages to a custom one | ||
59 | * with the ability to filter debug messages. | 57 | * with the ability to filter debug messages. | ||
60 | */ | 58 | */ | ||
61 | static void setGlobalKrMessageHandler(bool withDebugMessages); | 59 | static void setGlobalKrMessageHandler(bool withDebugMessages); | ||
62 | static QString GLOBAL_MESSAGE_PATTERN; | 60 | static QString GLOBAL_MESSAGE_PATTERN; | ||
63 | 61 | | |||
64 | protected: | 62 | protected: | ||
65 | static QString escape(QString name); | 63 | static QString escape(QString name); | ||
66 | 64 | | |||
67 | private: | 65 | private: | ||
68 | KrServices() {} | 66 | KrServices() {} | ||
69 | ~KrServices() {} | 67 | ~KrServices() {} | ||
70 | static QSet<QString> generateKrarcArchiveMimetypes(); | | |||
71 | static QMap<QString, QString>* slaveMap; | | |||
72 | static QSet<QString> krarcArchiveMimetypes; | | |||
73 | static QSet<QString> isoArchiveMimetypes; | | |||
74 | static void krMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg); | 68 | static void krMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg); | ||
75 | }; | 69 | }; | ||
76 | 70 | | |||
77 | // TODO: make KrServices a namespace and move it there | 71 | // TODO: make KrServices a namespace and move it there | ||
78 | 72 | | |||
79 | #endif | 73 | #endif |