Put temp files in .qBittorrent directory. Closes #4462.

This commit is contained in:
Chocobo1
2016-11-29 17:55:58 +08:00
committed by sledgehammer999
parent c38b250667
commit bc9cae199b
5 changed files with 12 additions and 2 deletions

View File

@@ -142,7 +142,7 @@ void DownloadHandler::init()
bool DownloadHandler::saveToFile(const QByteArray &replyData, QString &filePath)
{
QTemporaryFile *tmpfile = new QTemporaryFile;
QTemporaryFile *tmpfile = new QTemporaryFile(Utils::Fs::tempPath() + "XXXXXX");
if (!tmpfile->open()) {
delete tmpfile;
return false;

View File

@@ -491,3 +491,10 @@ QString Utils::Fs::cacheLocation()
locationDir.mkpath(locationDir.absolutePath());
return location;
}
QString Utils::Fs::tempPath()
{
static const QString path = QDir::tempPath() + "/.qBittorrent/";
QDir().mkdir(path);
return path;
}

View File

@@ -67,6 +67,7 @@ namespace Utils
/* End of Qt4 code */
QString cacheLocation();
QString tempPath();
}
}