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

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

Merged
merged 3 commits into from Dec 22, 2017

Conversation

Projects
None yet
2 participants
@mgrojo
Copy link
Contributor

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

Always copy data to clipboard and to internal buffer. Embedded image …
…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 Dec 7, 2017

mgrojo added some commits Dec 7, 2017

Merge branch 'master' into copy_clipboard_and_internal
# Conflicts:
#	src/ExtendedTableWidget.cpp
Merge branch 'master' into copy_clipboard_and_internal
# Conflicts:
#	src/ExtendedTableWidget.cpp
@MKleusberg
Copy link
Member

MKleusberg left a comment

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"?

This comment has been minimized.

@MKleusberg

MKleusberg Dec 22, 2017

Member

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 😉

This comment has been minimized.

@mgrojo

mgrojo Dec 22, 2017

Author Contributor

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

This comment has been minimized.

@MKleusberg

MKleusberg Dec 22, 2017

Member

Cool, just changed it 😄

@MKleusberg MKleusberg merged commit c753e56 into master Dec 22, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@justinclift justinclift deleted the copy_clipboard_and_internal branch Dec 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment