mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-31 20:58:07 -06:00
Merge pull request #5987 from Chocobo1/temp_dir
Put temp files in .qBittorrent directory
This commit is contained in:
@@ -35,7 +35,6 @@
|
||||
#include <QUrlQuery>
|
||||
#endif
|
||||
#include <QDir>
|
||||
#include <QTemporaryFile>
|
||||
#include <QDebug>
|
||||
#include "requestparser.h"
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace Utils
|
||||
/* End of Qt4 code */
|
||||
|
||||
QString cacheLocation();
|
||||
QString tempPath();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user