mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-26 06:15:48 +03:00
Share dialog: use the original name and not the virtual file name
When sharing a virtual file, we should actually use the original file name not the virtual file name Issue: #6461
This commit is contained in:
parent
a6c19572a2
commit
ced5dfb8ee
3 changed files with 8 additions and 3 deletions
|
@ -87,8 +87,7 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState,
|
|||
}
|
||||
|
||||
// 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));
|
||||
|
|
|
@ -864,7 +864,10 @@ SocketApi::FileData SocketApi::FileData::get(const QString &localFile)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -82,8 +82,11 @@ private:
|
|||
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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue