Skip to content

Commit

Permalink
Put temporary files in qbt own temp folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobo1 committed Aug 2, 2018
1 parent e1727c9 commit 9612a75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/base/bittorrent/session.cpp
Expand Up @@ -2300,7 +2300,7 @@ bool Session::loadMetadata(const MagnetUri &magnetUri)
p.max_connections = maxConnectionsPerTorrent();
p.max_uploads = maxUploadsPerTorrent();

QString savePath = QString("%1/%2").arg(QDir::tempPath(), hash);
QString savePath = QString("%1/%2").arg(Utils::Fs::tempPath(), hash);
p.save_path = Utils::Fs::toNativePath(savePath).toStdString();

// Forced start
Expand Down
3 changes: 2 additions & 1 deletion src/gui/guiiconprovider.cpp
Expand Up @@ -37,6 +37,7 @@
#endif

#include "base/preferences.h"
#include "base/utils/fs.h"

GuiIconProvider::GuiIconProvider(QObject *parent)
: IconProvider(parent)
Expand Down Expand Up @@ -124,7 +125,7 @@ QString GuiIconProvider::getIconPath(const QString &iconId) const
{
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
if (m_useSystemTheme) {
QString path = QDir::temp().absoluteFilePath(iconId + ".png");
QString path = Utils::Fs::tempPath() + iconId + ".png";
if (!QFile::exists(path)) {
const QIcon icon = QIcon::fromTheme(iconId);
if (!icon.isNull())
Expand Down

3 comments on commit 9612a75

@Lash78
Copy link

@Lash78 Lash78 commented on 9612a75 Aug 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chocobo1
Hi. I think this causes an I/O error with magnet links. After the "Downloading metadata" state, it changed to "Errored"

Example from the log file (watch the double backslash):
An I/O error occurred, 'Castle.Rock.S01E01.iNTERNAL.1080p.WEB.h264-BAMBOOZLE[rarbg]' paused. Castle.Rock.S01E01.iNTERNAL.1080p.WEB.h264-BAMBOOZLE[rarbg] stat (C:\Users\LasH\AppData\Local\Temp\.qBittorrent\\2ce1e03161c0f152643eabc93edaae8212492706\Castle.Rock.S01E01.iNTERNAL.1080p.WEB.h264-BAMBOOZLE[rarbg]\RARBG.txt) error: The filename, directory name, or volume label syntax is incorrect

@Chocobo1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lash78
Thanks! I submitted PR #9303, please try it out.

@Lash78
Copy link

@Lash78 Lash78 commented on 9612a75 Aug 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works now.

Please sign in to comment.