feature: paste image in chat #51
No reviewers
Labels
No Label
Bug
Documentation
Easy
Feature
Localization
Packaging
Refactoring
Test
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blue/squawk#51
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "shunf4/squawk:feat/paste_img"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add feature: paste image in chat (context menu/Ctrl-V).
This PR is based on #50. The changes for this PR is at the lastest commit.
@ -84,2 +90,3 @@
m_ui->messageEditor->installEventFilter(&ker);
QAction* pasteImageAction = new QAction(tr("Paste Image"), this);
Do you mind if we better move it to initialization block? Cuz, since you declare here that variable again as QAction* it might be even considered like another variable rather than that one declared as a property...
How about this change?
52551c1ce0
That's good, thank you!
@ -221,0 +253,4 @@
if (image.isNull()) {
return;
}
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + QStringLiteral("/squawk_img_attach_XXXXXX.png"), QApplication::instance());
Interestring solution...
I actually was thinking of it, but was more into may be saving it into downloads folder, for the next time. Like this way at somepoint the image is not going to be accesible, so, we're going to be forced to download it to see it.
Dunno, i really have mixed feelings about my way, what do you think?
I agree with you. Placing the pasted image into downloads folder is better.
Or putting it to temp folder, then moving it to downloads folder if it is sent successfully?
Yeah, that would do! But if you will move the image on successfull send you're going to need to update the path to the image in databases after the image is moved, I hope I've done that handler...
Done in
39f2f3d975
.The file is copied (rather than moved) because it might still be used by
QImageReader
in message preview widget.