Commit 7ee10da0 authored by Ivan Čukić's avatar Ivan Čukić 👁

Remove the trailing slashes from the mount point

parent bdf111ba
......@@ -30,6 +30,10 @@ static QString normalizePath(const QString& path)
auto result = fileInfo.canonicalFilePath();
if (result.isEmpty()) {
result = path;
}
if (result.endsWith('/')) {
result.chop(1);
}
......
......@@ -235,13 +235,17 @@ public:
vaultData.status = VaultInfo::Error;
// Reading the mount data from the config
const KConfigGroup vaultConfig(config, device.data());
KConfigGroup vaultConfig(config, device.data());
vaultData.name = vaultConfig.readEntry(CFG_NAME, name);
vaultData.mountPoint = MountPoint(vaultConfig.readEntry(CFG_MOUNT_POINT, mountPoint.data()));
vaultData.backendName = vaultConfig.readEntry(CFG_BACKEND, backendName);
vaultData.activities = vaultConfig.readEntry(CFG_ACTIVITIES, activities);
vaultData.isOfflineOnly = vaultConfig.readEntry(CFG_OFFLINEONLY, isOfflineOnly);
const QString configuredMountPoint = vaultConfig.readEntry(CFG_MOUNT_POINT, mountPoint.data());
vaultData.mountPoint = MountPoint(configuredMountPoint);
const QString actualMountPoint = vaultData.mountPoint.data();
vaultConfig.writeEntry(CFG_MOUNT_POINT, actualMountPoint);
const QDir mountPointDir(vaultData.mountPoint);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment