#include <QTimer>
#include <QThread>
#include <QMetaObject>
#include <QCoreApplication>
#include <QRegularExpression>
#include <QStandardPaths>
#include <QDir>
#include <type_traits>
#include <cstring>
浏览源代码.
@chinese
该文件定义和实现了一些小的工具函数.
◆ escapeToObjectPath()
QString DUtil::escapeToObjectPath |
( |
const QString & |
str | ) |
|
|
inline |
将字符串转义成符合DBus ObjectPath规则字符串
- 参数
-
- 返回
- 转义后字符串
- 注意
- 不要传入完整的dbus路径, 否则'/'也会被转义
◆ getAbsolutePathFromAppId()
QStringList DUtil::getAbsolutePathFromAppId |
( |
const QString & |
appId | ) |
|
|
inline |
从appId中获取符合条件的Desktop文件路径
- 参数
-
- 返回
- desktop文件的路径
- 注意
- 可能有多个desktop文件的appId相同, 所以返回所有符合条件的列表
◆ getAppIdFromAbsolutePath()
QString DUtil::getAppIdFromAbsolutePath |
( |
const QString & |
path | ) |
|
|
inline |
从desktop文件的绝对路径中提取出AppId
- 参数
-
- 返回
- 代表AppId的字符串
- 注意
- AppId可能为空, 代表无法获取AppId
◆ unescapeFromObjectPath()
QString DUtil::unescapeFromObjectPath |
( |
const QString & |
str | ) |
|
|
inline |
将DBus ObjectPath的部分路径转义成原来的字符串
- 参数
-
- 返回
- 转义后字符串