|
|
@ -37,39 +37,37 @@ |
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Utility functions related to file system. |
|
|
|
* Utility functions related to file system. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
class fsutils |
|
|
|
namespace fsutils |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_DECLARE_TR_FUNCTIONS(fsutils) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
QString toNativePath(const QString& path); |
|
|
|
static QString toNativePath(const QString& path); |
|
|
|
QString fromNativePath(const QString& path); |
|
|
|
static QString fromNativePath(const QString& path); |
|
|
|
QString fileExtension(const QString& filename); |
|
|
|
static QString fileExtension(const QString& filename); |
|
|
|
QString fileName(const QString& file_path); |
|
|
|
static QString fileName(const QString& file_path); |
|
|
|
qint64 computePathSize(const QString& path); |
|
|
|
static qint64 computePathSize(const QString& path); |
|
|
|
bool sameFiles(const QString& path1, const QString& path2); |
|
|
|
static bool sameFiles(const QString& path1, const QString& path2); |
|
|
|
QString updateLabelInSavePath(const QString &defaultSavePath, const QString &save_path, const QString& old_label, const QString& new_label); |
|
|
|
static QString updateLabelInSavePath(const QString &defaultSavePath, const QString &save_path, const QString& old_label, const QString& new_label); |
|
|
|
QString toValidFileSystemName(QString filename); |
|
|
|
static QString toValidFileSystemName(QString filename); |
|
|
|
bool isValidFileSystemName(const QString& filename); |
|
|
|
static bool isValidFileSystemName(const QString& filename); |
|
|
|
long long freeDiskSpaceOnPath(QString path); |
|
|
|
static long long freeDiskSpaceOnPath(QString path); |
|
|
|
QString branchPath(const QString& file_path, QString* removed = 0); |
|
|
|
static QString branchPath(const QString& file_path, QString* removed = 0); |
|
|
|
bool sameFileNames(const QString& first, const QString& second); |
|
|
|
static bool sameFileNames(const QString& first, const QString& second); |
|
|
|
QString expandPath(const QString& path); |
|
|
|
static QString expandPath(const QString& path); |
|
|
|
QString expandPathAbs(const QString& path); |
|
|
|
static QString expandPathAbs(const QString& path); |
|
|
|
bool isValidTorrentFile(const QString& path); |
|
|
|
static bool isValidTorrentFile(const QString& path); |
|
|
|
bool smartRemoveEmptyFolderTree(const QString& dir_path); |
|
|
|
static bool smartRemoveEmptyFolderTree(const QString& dir_path); |
|
|
|
bool forceRemove(const QString& file_path); |
|
|
|
static bool forceRemove(const QString& file_path); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Ported from Qt4 to drop dependency on QtGui */ |
|
|
|
/* Ported from Qt4 to drop dependency on QtGui */ |
|
|
|
static QString QDesktopServicesDataLocation(); |
|
|
|
QString QDesktopServicesDataLocation(); |
|
|
|
static QString QDesktopServicesCacheLocation(); |
|
|
|
QString QDesktopServicesCacheLocation(); |
|
|
|
static QString QDesktopServicesDownloadLocation(); |
|
|
|
QString QDesktopServicesDownloadLocation(); |
|
|
|
/* End of Qt4 code */ |
|
|
|
/* End of Qt4 code */ |
|
|
|
static QString searchEngineLocation(); |
|
|
|
QString searchEngineLocation(); |
|
|
|
static QString BTBackupLocation(); |
|
|
|
QString BTBackupLocation(); |
|
|
|
static QString cacheLocation(); |
|
|
|
QString cacheLocation(); |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif // FS_UTILS_H
|
|
|
|
#endif // FS_UTILS_H
|
|
|
|
|
|
|
|
|
|
|
|