When sharing a virtual file, we should actually use the original file name
not the virtual file name
Issue: #6461
}
// Set filename
- QFileInfo lPath(_localPath);
- QString fileName = lPath.fileName();
+ QString fileName = QFileInfo(_sharePath).fileName();
_ui->label_name->setText(tr("%1").arg(fileName));
QFont f(_ui->label_name->font());
f.setPointSize(qRound(f.pointSize() * 1.4));
data.folderRelativePath = data.localPath.mid(data.folder->cleanPath().length() + 1);
data.accountRelativePath = QDir(data.folder->remotePath()).filePath(data.folderRelativePath);
-
+ QString virtualFileExt = QStringLiteral(APPLICATION_DOTVIRTUALFILE_SUFFIX);
+ if (data.accountRelativePath.endsWith(virtualFileExt)) {
+ data.accountRelativePath.chop(virtualFileExt.size());
+ }
return data;
}
FileData parentFolder() const;
Folder *folder;
+ // Absolute path of the file locally. (May be a virtual file)
QString localPath;
+ // Relative path of the file locally, as in the DB. (May be a virtual file)
QString folderRelativePath;
+ // Path of the file on the server (In case of virtual file, it points to the actual file)
QString accountRelativePath;
};