mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
Save relative paths in fastresume files
Conditionally change absolute paths to relative in the fastresume data files. The condition is specified by user via a command line parameter and paths are relative to the profile dir. On Windows the convertion to relative path is performed if the path and the profile are on the same drive only.
This commit is contained in:
parent
0710a59bf5
commit
a8d95dd8bd
9 changed files with 127 additions and 21 deletions
|
@ -42,6 +42,7 @@ class Application;
|
|||
namespace Private
|
||||
{
|
||||
class Profile;
|
||||
class PathConverter;
|
||||
}
|
||||
|
||||
using SettingsPtr = std::unique_ptr<QSettings>;
|
||||
|
@ -64,17 +65,22 @@ public:
|
|||
/// or the value, supplied via parameters
|
||||
QString configurationName() const;
|
||||
|
||||
QString toPortablePath(const QString &absolutePath) const;
|
||||
QString fromPortablePath(const QString &portablePath) const;
|
||||
|
||||
static const Profile &instance();
|
||||
|
||||
private:
|
||||
Profile(Private::Profile *impl);
|
||||
Profile(Private::Profile *impl, Private::PathConverter *pathConverter);
|
||||
~Profile();
|
||||
|
||||
friend class ::Application;
|
||||
static void initialize(const QString &rootProfilePath, const QString &configurationName);
|
||||
static void initialize(const QString &rootProfilePath, const QString &configurationName,
|
||||
bool convertPathsToProfileRelative);
|
||||
void ensureDirectoryExists(SpecialFolder folder);
|
||||
|
||||
QScopedPointer<Private::Profile> m_impl;
|
||||
QScopedPointer<Private::Profile> m_profileImpl;
|
||||
QScopedPointer<Private::PathConverter> m_pathConverterImpl;
|
||||
static Profile *m_instance;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue