mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-12 16:15:43 -04:00
Show save image option only when it is needed
This commit is contained in:
parent
bbebd6a5d7
commit
bc4691ceb4
4 changed files with 21 additions and 4 deletions
|
@ -41,3 +41,11 @@ void ImageUtil::extractImage(QWidget *window, QTextCursor cursor)
|
|||
QMessageBox::warning(window, QApplication::translate("ImageUtil", "Save image"), QApplication::translate("ImageUtil", "Not an image"));
|
||||
}
|
||||
}
|
||||
|
||||
bool ImageUtil::checkImage(QTextCursor cursor)
|
||||
{
|
||||
cursor.movePosition(QTextCursor::Left, QTextCursor::MoveAnchor, 1);
|
||||
cursor.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor, 2);
|
||||
QString imagestr = cursor.selection().toHtml();
|
||||
return imagestr.indexOf("base64,") != -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue