Bug 259539

Summary: Klipper shortcuts for previous/next history item can not be assigned to default in klipper menu
Product: [Applications] klipper Reporter: Andreas Gölzer <K_2005>
Component: generalAssignee: Esben Mose Hansen <kde>
Severity: normal CC: adaptee, christophe, ermonnezza, fuckel, kde
Priority: NOR    
Version: 0.9.6   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 4.8.0

Description Andreas Gölzer 2010-12-11 19:15:46 UTC
Version:           0.9.6 (using KDE 4.5.4) 
OS:                Linux

using klipper v0.9.7 in kde 4.5.4, if I try to change the shortcut for previous/next history item by going to right click on klipper icon -> "Configure klipper...", then trying to set the shortcut for next history item to the default ctr-alt-down, one gets the surprising error message:

"The shortcut 'Ctrl+Alt+Down' conflicts with the following key combination:
Shortcut 'Ctrl+Alt+Down' in Application Klipper for action Next History Item"

This might have something to do with the global kde shortcuts, system settings, shortcuts and gestures, global keyboard shortcuts, klipper

Reproducible: Always

Steps to Reproduce:
Try to change the shortcut for previous/next history item:
right click on klipper icon -> "Configure klipper...", then set the shortcut for next history item to the default ctr-alt-down

Actual Results:  
"The shortcut 'Ctrl+Alt+Down' conflicts with the following key combination:
Shortcut 'Ctrl+Alt+Down' in Application Klipper for action Next History Item"

Expected Results:  
shortcut is set to default value

Sometimes the key combination did not work for me, that's why I tried setting it to its default value in the first place.
Comment 1 Vaso 2011-04-27 12:18:40 UTC
Klipper 0.9.7, KDE 4.6.2

I have related problem -- it's impossible to assign keyboard shortcuts for any actions except "Enable Clipboard Actions Manually" & "Invoke Action on Current Clipboard":

1. Fresh user account --> Configure Klipper / Shortcuts ==> only two above actions have assigned shortcuts, all the others are switched to "Custom" = "None".
2. I switch e.g. "Edit Contents" to "Default" = "Ctrl+Alt+E", or assign another shortcut e.g. "Custom" = "Ctrl+Alt+G".
3. Anyway after session restart I get "Edit Contents": "Custom" = "None".
4. BTW if I try after about steps to assign the "disappeared" key sequence to another action I got message:
"The shortcut "Ctrl+Alt+E" (or "Ctrl+Alt+G") conflicts with the following key combination: Shortcut "Ctrl+Alt+E" (or "Ctrl+Alt+G") in Application Klipper for action "Edit Contents".

Reproduce on Kubuntu and AltLinux.
Comment 2 Jekyll Wu 2011-11-06 19:21:43 UTC
I failed to reproduce this with klipper 0.9.7 in KDE 4.7.3. Is this still a problem for the reporter in recent version of KDE?
Comment 3 Andreas Gölzer 2011-11-07 23:22:33 UTC
Yes, this problem persists for me in klipper 0.9.7, kde 4.7.3 (ubuntu).

I deleted config/klipperrc and share/apps/klipper, to make sure it is not a simple case of old broken config files.  It might still be a problem with other kde config files.
Comment 4 ermonnezza 2011-12-07 14:14:31 UTC
I have the same problem in 0.9.7, KDE 4.7.2, and the issue survived after upgrade from 4.6.5 and 4.6.2 earlier on. The exact same thing happens to me with knotes (global shortcuts New Note=Alt+Shift+N and New Note from Clipboard=Alt+Shift+C). I think the issue is related with upgrading from an earlier version, as it's not present when logging in as a freshly created different user. Any help in linking it to a specific settings file is welcome.
Comment 5 Jekyll Wu 2011-12-25 01:00:56 UTC
(In reply to comment #2)
OK, I can reproduce the problem now (and knows why I failed last time). 

(In reply to comment #4)
Yes, Knotes has similar problem(I just tried) and I believe they share the same cause(I just browsed its code). And the problem is not related with upgrading. Comment #1 contains nice steps for reproducing it using fresh account. Step 3 is the key: exit the application and run it again. That is why I failed last time.

I actually have found where the problem is:

    // klipper.cpp:196
    m_editAction->setGlobalShortcut(KShortcut(Qt::ALT+Qt::CTRL+Qt::Key_E), KAction::DefaultShortcut);

That 'KAction::DefaultShortcut' argument causes the global shortcut to be always 'None' after application restarts. 

However, I'm not sure about that judgement. I'll try to get some confirmation before fixing it. Anyway, it should be quite easy to fix :)
Comment 6 Jekyll Wu 2011-12-25 18:08:06 UTC
Git commit 8c3ce22cb63fc12c888ccd2d974f2c1a1e0a2167 by Jekyll Wu.
Committed on 25/12/2011 at 12:55.
Pushed by jekyllwu into branch 'KDE/4.8'.

Make the global shortcuts of Klipper work as expected

The old code just does not work. The influenced global shortcuts always
reset to 'None' after klipper restart, and users can't even set it to
its default value.
Related: bug 259539

M  +4    -4    klipper/klipper.cpp

Comment 7 Christophe Marin 2012-01-01 14:56:48 UTC
> -    m_showOnMousePos->setGlobalShortcut(KShortcut(Qt::CTRL+Qt::SHIFT+Qt::Ke
> y_V), KAction::DefaultShortcut);
> +    m_showOnMousePos->setGlobalShortcut(KShortcut(Qt::CTRL+Qt::SHIFT+Qt::K
> ey_V));

This commit has an unexpected side effect: pasting in konsole doesn't work anymore (the klipper context menu appears instead)
Comment 8 Kai Uwe Broulik 2012-01-15 20:09:32 UTC
Confirmed. Ctrl+Shift+V should not be used as a global shortcut as it breaks Konsole’s paste feature.
Comment 9 Jekyll Wu 2012-01-16 03:12:52 UTC
Well, no need to report or worry about the Ctrl+Shift+V conflict with konsole. It won't appear in the final KDE SC 4.8. See bug 290716. 

Sorry for the mess in RC2. Apparently, I always use Shift+Insert for pasting in konsole ...