Commit c22b558f authored by Ömer Fadıl Usta's avatar Ömer Fadıl Usta 😊
Browse files

[Imgur Share] Added support to fetch DeleteUrl for Share

In case of User share a photo, it is his/her/its right to have
image's deleteUrl so he/she/it can able to delete uploaded Image

BUG: 441566
parent 5ab33f15
......@@ -529,13 +529,23 @@ struct MainWindow::Private {
mSharedMessage->setMessageType(KMessageWidget::MessageType::Error);
mSharedMessage->animatedShow();
} else {
const QString url = output[QStringLiteral("url")].toString();
if (!url.isEmpty()) {
mSharedMessage->setText(i18n("The shared image link (<a href=\"%1\">%1</a>) has been copied to the clipboard.", url));
const QString imageUrl = output[QStringLiteral("url")].toString();
const QString deleteUrl = output[QStringLiteral("deleteUrl")].toString();
if (!imageUrl.isEmpty()) {
if (!deleteUrl.isEmpty()) {
mSharedMessage->setText(
i18n("The shared image link (<a href=\"%1\">%1</a>) has been copied to the clipboard.And Delete Link is (<a href=\"%2\">%2</a>) in "
"case if you want to delete",
imageUrl,
deleteUrl));
} else {
// TODO : This part will be removed Whenever KF min became 5.86
// deleteUrl part support added since 5.86 into purpose
mSharedMessage->setText(i18n("The shared image link (<a href=\"%1\">%1</a>) has been copied to the clipboard", imageUrl));
}
mSharedMessage->setMessageType(KMessageWidget::MessageType::Positive);
mSharedMessage->animatedShow();
QApplication::clipboard()->setText(url);
QApplication::clipboard()->setText(imageUrl);
} else {
mSharedMessage->setVisible(false);
}
......
  • In the future, can you please submit a merge request instead of committing directly? There are multiple issues here which would have been caught in review. :)

  • mentioned in commit a9dc7758

    Toggle commit list
Supports Markdown
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