mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
parent
7a41192597
commit
0297f0f34b
3 changed files with 9 additions and 2 deletions
|
@ -42,6 +42,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "base/global.h"
|
#include "base/global.h"
|
||||||
|
#include "base/utils/fs.h"
|
||||||
#include "base/utils/misc.h"
|
#include "base/utils/misc.h"
|
||||||
#include "base/utils/string.h"
|
#include "base/utils/string.h"
|
||||||
|
|
||||||
|
@ -336,7 +337,7 @@ QBtCommandLineParameters::QBtCommandLineParameters(const QProcessEnvironment &en
|
||||||
, webUIPort(WEBUI_PORT_OPTION.value(env, -1))
|
, webUIPort(WEBUI_PORT_OPTION.value(env, -1))
|
||||||
, torrentingPort(TORRENTING_PORT_OPTION.value(env, -1))
|
, torrentingPort(TORRENTING_PORT_OPTION.value(env, -1))
|
||||||
, skipDialog(SKIP_DIALOG_OPTION.value(env))
|
, skipDialog(SKIP_DIALOG_OPTION.value(env))
|
||||||
, profileDir(PROFILE_OPTION.value(env))
|
, profileDir(Utils::Fs::toAbsolutePath(Path(PROFILE_OPTION.value(env))))
|
||||||
, configurationName(CONFIGURATION_OPTION.value(env))
|
, configurationName(CONFIGURATION_OPTION.value(env))
|
||||||
{
|
{
|
||||||
addTorrentParams.savePath = Path(SAVE_PATH_OPTION.value(env));
|
addTorrentParams.savePath = Path(SAVE_PATH_OPTION.value(env));
|
||||||
|
@ -402,7 +403,7 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
|
||||||
#endif
|
#endif
|
||||||
else if (arg == PROFILE_OPTION)
|
else if (arg == PROFILE_OPTION)
|
||||||
{
|
{
|
||||||
result.profileDir = Path(PROFILE_OPTION.value(arg));
|
result.profileDir = Utils::Fs::toAbsolutePath(Path(PROFILE_OPTION.value(arg)));
|
||||||
}
|
}
|
||||||
else if (arg == RELATIVE_FASTRESUME)
|
else if (arg == RELATIVE_FASTRESUME)
|
||||||
{
|
{
|
||||||
|
|
|
@ -345,6 +345,11 @@ bool Utils::Fs::isDir(const Path &path)
|
||||||
return QFileInfo(path.data()).isDir();
|
return QFileInfo(path.data()).isDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Path Utils::Fs::toAbsolutePath(const Path &path)
|
||||||
|
{
|
||||||
|
return Path(QFileInfo(path.data()).absoluteFilePath());
|
||||||
|
}
|
||||||
|
|
||||||
Path Utils::Fs::toCanonicalPath(const Path &path)
|
Path Utils::Fs::toCanonicalPath(const Path &path)
|
||||||
{
|
{
|
||||||
return Path(QFileInfo(path.data()).canonicalFilePath());
|
return Path(QFileInfo(path.data()).canonicalFilePath());
|
||||||
|
|
|
@ -55,6 +55,7 @@ namespace Utils::Fs
|
||||||
|
|
||||||
QString toValidFileName(const QString &name, const QString &pad = u" "_s);
|
QString toValidFileName(const QString &name, const QString &pad = u" "_s);
|
||||||
Path toValidPath(const QString &name, const QString &pad = u" "_s);
|
Path toValidPath(const QString &name, const QString &pad = u" "_s);
|
||||||
|
Path toAbsolutePath(const Path &path);
|
||||||
Path toCanonicalPath(const Path &path);
|
Path toCanonicalPath(const Path &path);
|
||||||
|
|
||||||
bool copyFile(const Path &from, const Path &to);
|
bool copyFile(const Path &from, const Path &to);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue