Skip to content

Always copy to clipboard and to internal buffer. Embedded image support. #1257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 22, 2017

Conversation

mgrojo
Copy link
Member

@mgrojo mgrojo commented Dec 7, 2017

At the time of pasting, use the generator and date meta tags in the HTML
version for knowing whether our data in the system clipboard has been
overwritten. If not, the internal buffer has better data, so we use it.

Since the binary data is not excluded in the system clipboard, images
are also included embedded in the HTML table. Other binary data are encoded
as base64 strings.

See issue #1244

…support

At the time of pasting, use the generator and date meta tags in the HTML
version for knowing whether our data in the system clipboard has been
overwritten. If not, the internal buffer has better data, so we use it.

Since the binary data is not excluded in the system clipboard, images
are also included embedded in the HTML table. Other binary data are encoded
as base64 strings.
@mgrojo mgrojo requested a review from MKleusberg December 7, 2017 13:34
# Conflicts:
#	src/ExtendedTableWidget.cpp
# Conflicts:
#	src/ExtendedTableWidget.cpp
Copy link
Member

@MKleusberg MKleusberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 😄 I couldn't find any problems with this 👍

I've added just one note regarding your TODO comment but will just merge this as-is and probably change the Base64 thing later if you don't object 😉

} else {
QByteArray text;
if (m->isBinary(index))
text = data.toByteArray().toBase64(); // TODO: Or should be just "BLOB"?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably leave them empty like we did before. So no "Image" and no "BLOB" but no data either if that makes sense. The reason is that probably no one will parse the Base64 when pasting anyway. And because it's impossible to tell if the contents of a cell was actual binary data, "BLOB", or some Base64 string I think it's best to just not copy anything. It's probably the clearest way to tell the user that this isn't going to work as expected 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! That isn't really very useful and my TODO note was already indicating my hesitation. No objection at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, just changed it 😄

@MKleusberg MKleusberg merged commit c753e56 into master Dec 22, 2017
@justinclift justinclift deleted the copy_clipboard_and_internal branch December 23, 2017 23:10
@mgrojo mgrojo restored the copy_clipboard_and_internal branch October 14, 2023 21:27
@mgrojo mgrojo deleted the copy_clipboard_and_internal branch October 14, 2023 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants