Bug 323644 - Ctrl-C copies artist and track name when other text is highlighted
Summary: Ctrl-C copies artist and track name when other text is highlighted
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Context View (show other bugs)
Version: 2.8-git
Platform: unspecified Linux
: NOR normal
Target Milestone: 2.9
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-17 17:20 UTC by Todd
Modified: 2014-05-21 10:40 UTC (History)
0 users

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 Todd 2013-08-17 17:20:54 UTC
When you select text with either with the mouse or Ctrl-A, then hit Ctrl-C to copy, it doesn't copy the text, it copies the artist and track names.  I have tested this with the lyrics view, the wikipedia view, and the guitar tabs view, but it may be a problem with other views as well.

Steps to reproduce (using the lyrics view as an example):
1. Play a song with lyrics
2. Click on the text of the lyrics
3. Hit Ctrl-a to highlight all the lyrics
4. Hit Ctrl-c to copy the lyrics
5. Open a text edit
6. Paste the text from the clipboard

Actual Result:
The text "[artist] -  [title]"  is pasted

Expected Result:
The selected lyrics are pasted

Additional notes:
Ideally, I would personally expect that just single-clicking on a context view, then copying, would copy the text from that context view without having to manually highlight everything.
Comment 1 Myriam Schweingruber 2013-08-18 00:17:03 UTC
Confirmed, that is really odd and clearly a bug.
Comment 2 Mark Kretschmann 2013-08-18 07:19:53 UTC
No it's not a bug, it's a feature. Also see:

https://bugs.kde.org/show_bug.cgi?id=228872
Comment 3 Myriam Schweingruber 2013-08-18 10:11:25 UTC
Sorry, but that is nonsense: How on earth can I copy the lyrics, then? Selecting the Lyrics text and copying to the clipboard should allow the user to copy that text somewhere else. That other feature might be desirable for copying a track information form the playlist or the Collection browser, but makes absolutely no sense whatsoever in the lyrics applet. 
So hardcoding Artist+Title to the Ctrl+C action is just outright stupid.
Comment 4 Todd 2013-08-18 12:35:15 UTC
I would have to agree that it is a bug.  Certainly if you have only selected the track, or not clicked anything at all, using Ctrl-c should follow the current behavior.

However, if someone has gone to the trouble of highlighting some specific text then hit Ctrl-c, I think it would be reasonable to conclude that they want to copy the text they have highlighted.  Why else would they have highlighted it? 

I would argue that if someone has gone to the trouble to click on the lyrics pane then hit Ctrl-c, they probably want to copy the lyrics, but that is more debatable.
Comment 5 Mark Kretschmann 2013-08-18 12:42:50 UTC
You can configure this shortcut, by the way.
Comment 6 Todd 2013-08-18 13:00:59 UTC
Then you can no longer copy the track information.  There is no reason copying the track information and copying selected text need to be mutually exclusive, nor can I see any benefit to users from making them mutually exclusive.
Comment 7 Mark Kretschmann 2013-08-18 13:02:05 UTC
I don't see how that could be done, having both at the same time...
Comment 8 Todd 2013-08-18 13:09:26 UTC
Why not have the selected text copied if there is a selection, otherwise copy the track info?

Or, alternatively, have the selected text copied if there is a selection.  If there is no selection and a widget with text has focus (lyrics, wikipedia, tabs, etc), copy the text from that widget.  Otherwise copy the track info.
Comment 9 Mark Kretschmann 2013-08-18 13:36:59 UTC
But how would you even detect that there is a selection?
Comment 10 Mark Kretschmann 2013-08-18 14:35:45 UTC
Git commit c6d9f246383def39aecdd0f62c1354d0b164cec6 by Mark Kretschmann.
Committed on 18/08/2013 at 14:32.
Pushed by markey into branch 'master'.

Ctrl-C works again when there is text selected in Amarok.

Amarok now checks if the clipboard content is owned by Amarok itself.
In this case Ctrl-C will work just like expected, copying the selection
to the clipboard. If it's not owned by Amarok, the currently playing
artist and album is copied to the clipboard.

BACKPORT
Related: bug 228872

M  +2    -0    ChangeLog
M  +3    -2    src/MainWindow.cpp

http://commits.kde.org/amarok/c6d9f246383def39aecdd0f62c1354d0b164cec6
Comment 11 Todd 2013-08-18 17:46:25 UTC
Great, thanks!
Comment 12 Mark Kretschmann 2013-08-18 19:02:55 UTC
I'm very sorry, I spoke too soon. My fix doesn't work. 

I'm still looking for the correct fix obviously.
Comment 13 Todd 2013-08-19 14:45:15 UTC
Can you check which widget (Qt widget, not plasmoid) has focus?  If certain widgets have focus, Ctrl-C does one thing, otherwise it does something else.
Comment 14 Myriam Schweingruber 2013-08-19 15:08:48 UTC
Well, if you can select a text with Ctrl+A then that widget certainly has focus, else that action would not be possible.
Comment 15 Mark Kretschmann 2013-08-22 14:54:07 UTC
Git commit a1a90d09bca60d752542fb6412930fe1c2caf17b by Mark Kretschmann.
Committed on 22/08/2013 at 10:14.
Pushed by markey into branch 'master'.

Revert "Ctrl-C works again when there is text selected in Amarok."

This reverts commit c6d9f246383def39aecdd0f62c1354d0b164cec6.
The patch was not working, sorry.
Related: bug 228872

M  +0    -2    ChangeLog
M  +2    -3    src/MainWindow.cpp

http://commits.kde.org/amarok/a1a90d09bca60d752542fb6412930fe1c2caf17b
Comment 16 vedant agarwala 2014-05-21 10:24:48 UTC
Git commit 3500478880b19ba984b4f356d63cffe43cfb648f by Vedant Agarwala, on behalf of Mark Kretschmann.
Committed on 18/08/2013 at 14:32.
Pushed by vedanta into branch 'tagguessing'.

Ctrl-C works again when there is text selected in Amarok.

Amarok now checks if the clipboard content is owned by Amarok itself.
In this case Ctrl-C will work just like expected, copying the selection
to the clipboard. If it's not owned by Amarok, the currently playing
artist and album is copied to the clipboard.

BACKPORT
Related: bug 228872

M  +2    -0    ChangeLog
M  +3    -2    src/MainWindow.cpp

http://commits.kde.org/amarok/3500478880b19ba984b4f356d63cffe43cfb648f
Comment 17 vedant agarwala 2014-05-21 10:40:34 UTC
Git commit 3d4fc6bd692b3fdedae1bbcaac9fb0690baae2c0 by Vedant Agarwala, on behalf of Mark Kretschmann.
Committed on 22/08/2013 at 10:14.
Pushed by vedanta into branch 'tagguessing'.

Revert "Ctrl-C works again when there is text selected in Amarok."

This reverts commit c6d9f246383def39aecdd0f62c1354d0b164cec6.
The patch was not working, sorry.
Related: bug 228872

M  +0    -2    ChangeLog
M  +2    -3    src/MainWindow.cpp

http://commits.kde.org/amarok/3d4fc6bd692b3fdedae1bbcaac9fb0690baae2c0