mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 16:37:21 -06:00
Replace wrappers in base/utils/fs.h with Profile::SpecialFolders::location()
This commit is contained in:
@@ -50,8 +50,6 @@
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
#include "base/profile.h"
|
||||
|
||||
/**
|
||||
* Converts a path to a string suitable for display.
|
||||
* This function makes sure the directory separator used is consistent
|
||||
@@ -317,30 +315,6 @@ QString Utils::Fs::expandPathAbs(const QString& path)
|
||||
return ret;
|
||||
}
|
||||
|
||||
QString Utils::Fs::QDesktopServicesDataLocation()
|
||||
{
|
||||
return Profile::instance().location(SpecialFolder::Data);
|
||||
}
|
||||
|
||||
QString Utils::Fs::QDesktopServicesCacheLocation()
|
||||
{
|
||||
return Profile::instance().location(SpecialFolder::Cache);
|
||||
}
|
||||
|
||||
QString Utils::Fs::QDesktopServicesDownloadLocation()
|
||||
{
|
||||
return Profile::instance().location(SpecialFolder::Downloads);
|
||||
}
|
||||
|
||||
QString Utils::Fs::cacheLocation()
|
||||
{
|
||||
QString location = expandPathAbs(QDesktopServicesCacheLocation());
|
||||
QDir locationDir(location);
|
||||
if (!locationDir.exists())
|
||||
locationDir.mkpath(locationDir.absolutePath());
|
||||
return location;
|
||||
}
|
||||
|
||||
QString Utils::Fs::tempPath()
|
||||
{
|
||||
static const QString path = QDir::tempPath() + "/.qBittorrent/";
|
||||
|
||||
@@ -60,13 +60,6 @@ namespace Utils
|
||||
bool forceRemove(const QString& file_path);
|
||||
void removeDirRecursive(const QString& dirName);
|
||||
|
||||
/* Ported from Qt4 to drop dependency on QtGui */
|
||||
QString QDesktopServicesDataLocation();
|
||||
QString QDesktopServicesCacheLocation();
|
||||
QString QDesktopServicesDownloadLocation();
|
||||
/* End of Qt4 code */
|
||||
|
||||
QString cacheLocation();
|
||||
QString tempPath();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user