mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 12:38:48 +03:00
Add a default filename for clipboard pastes again
This commit is contained in:
parent
447a3d4cb9
commit
922c63ef27
1 changed files with 6 additions and 1 deletions
|
@ -1050,7 +1050,12 @@ InputBar::startUploadFromMimeData(const QMimeData &source, const QString &format
|
|||
return;
|
||||
}
|
||||
|
||||
startUpload(std::move(file), {}, format);
|
||||
QMimeDatabase db;
|
||||
auto mime = db.mimeTypeForName(format);
|
||||
auto suffix = mime.preferredSuffix();
|
||||
QString filename = QStringLiteral("clipboard");
|
||||
|
||||
startUpload(std::move(file), suffix.isEmpty() ? filename : (filename + "." + suffix), format);
|
||||
}
|
||||
void
|
||||
InputBar::startUpload(std::unique_ptr<QIODevice> dev, const QString &orgPath, const QString &format)
|
||||
|
|
Loading…
Reference in a new issue