Add option to auto copy URL after upload (#553)

This commit is contained in:
teryanik
2019-10-01 20:58:29 +03:00
committed by Dharkael
parent f648e88cca
commit 62dbabc341
5 changed files with 35 additions and 1 deletions

View File

@@ -77,7 +77,13 @@ void ImgurUploader::handleReply(QNetworkReply *reply) {
m_imageURL.setUrl(data[QStringLiteral("link")].toString());
m_deleteImageURL.setUrl(QStringLiteral("https://imgur.com/delete/%1").arg(
data[QStringLiteral("deletehash")].toString()));
onUploadOk();
if (ConfigHandler().copyAndCloseAfterUploadEnabled()) {
QApplication::clipboard()->setText(m_imageURL.toString());
SystemNotification().sendMessage(QObject::tr("URL copied to clipboard."));
close();
} else {
onUploadOk();
}
} else {
m_infoLabel->setText(reply->errorString());
}