Replace wrappers in base/utils/fs.h with Profile::SpecialFolders::location()

This commit is contained in:
Eugene Shalygin 2016-05-11 13:25:29 +02:00
parent 44b6cb28f6
commit 0bf7fa15c1
9 changed files with 20 additions and 43 deletions

View file

@ -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/";