Bug 191178 - Copying and Pasting across parley instances does not work
Summary: Copying and Pasting across parley instances does not work
Status: CONFIRMED
Alias: None
Product: parley
Classification: Applications
Component: editor (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: parley bug tracker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-30 23:18 UTC by Casey Link
Modified: 2021-03-09 23:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Casey Link 2009-04-30 23:18:01 UTC
Version:           SVN (using KDE 4.2.2)
OS:                Linux
Installed from:    Compiled From Sources

1. Open a Collection for Editing in an instance Parley
2. Open a new instance of Parley and create a new blank collection.
3. Select & Copy some rows in the first instance of Parley
4. Switch to the second instance and paste into a new, blank lesson

Result: the content all ends up in the first column
Expected Behavior: the content should be parsed into the appropriate columns.


ex.

1st Parley shows:

Lang1 | Lang2
-------------
foo   | bar


after copy paste
2nd Parley shows:
Lang1       | Lang2
--------------------
foo - bar   | 


Note: Copying and pasting within the same parley instance works fine.
Comment 1 Casey Link 2009-05-01 08:57:19 UTC
I've discovered the source of this bug.

It's because parley doesn't correctly implement the QMimeData api for copy/pasting between apps.

src/vocabulary/vocabularyview.cpp the slot slotEditPaste() does:
const VocabularyMimeData *vocMimeData = qobject_cast<const VocabularyMimeData *>(mimeData);

then proceeds to pull data from the VocabMimeData object, which explains why copy/pasting works in the same instance of parley.
Comment 2 Casey Link 2009-05-01 09:15:37 UTC
After some further poking around, it seems nigh impossible to easily fix this bug in Parley alone.

The "correct" solution would be to have the VocabularyMimeData::retrieveData() method return a serialized list of it's KEduVocExpressions when a certain mimetype (possibly "text/kdevocexpression") is requested of it.

I propose adding a method to libkdeedu/keduvocdocument/keduvocexpression.h that serializes the contents of the expression. Something like 
QString expressionToClipboard() const;
and of course, the opposite 
KEduVocExpression expressionFromClipboard(const QString &data);

However, it looks like KEduVocExpression is a pretty complex type containing 
a QMap<int, KEduVocTranslation> as well as a KEduVocLesson* 

I assume some information could be tossed when copy/pasting? surely the grade information isn't needed?
Comment 3 Inge Wallin 2014-02-19 19:47:16 UTC
Moved to the editor component.

This is something we would have to look into.  One solution would be to convert to csv for copy/paste, perhaps.
Comment 4 Justin Zobel 2021-03-09 23:43:33 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.