mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Replace wrappers in base/utils/fs.h with Profile::SpecialFolders::location()
This commit is contained in:
parent
44b6cb28f6
commit
0bf7fa15c1
9 changed files with 20 additions and 43 deletions
|
@ -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/";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue