Bug 302740 - Duplicate rotation/flip entries in image menu, shortcuts not working
Summary: Duplicate rotation/flip entries in image menu, shortcuts not working
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Usability-Keyboard (show other bugs)
Version: 3.0.0
Platform: Gentoo Packages Linux
: NOR minor
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-29 11:19 UTC by Wonko
Modified: 2017-08-02 17:41 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 3.0.0
Sentry Crash Report:


Attachments
Image Menu (52.14 KB, image/jpeg)
2012-06-29 11:35 UTC, Wonko
Details
Image menu (38.85 KB, image/jpeg)
2012-06-29 12:26 UTC, Wonko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wonko 2012-06-29 11:19:14 UTC
The entries for rotation, mirroring and automatic rotation/mirroring appear two times in the image menu. I guess this is also why the keyboard shortcuts Ctrl-Shift-Left/Right do not work.

Reproducible: Always

Steps to Reproduce:
1. Select an image
2. Press Ctrl-Shift-Right
Actual Results:  
A dialog states that the shortcut is ambiguous.

Expected Results:  
This should just work, and there should be no duplicate entries.

Workaround: Assign a new shortcut  to 'Left' and 'Right'. This also makes the original shortcuts work.

BTW, this also happens with a fresh setup.
Comment 1 caulier.gilles 2012-06-29 11:22:58 UTC
2 time in image menu ? Impossible... Can you take a screen-shot please ?

Gilles Caulier
Comment 2 Wonko 2012-06-29 11:35:18 UTC
Created attachment 72213 [details]
Image Menu

Here's a screenshot of the Image menu.
Comment 3 caulier.gilles 2012-06-29 11:41:31 UTC
Where entries for rotation, mirroring and automatic rotation/mirroring appear two times in the image menu ???

Please switch application in English and take another shot.

Note : here actions appear only one time in menu and keyboard shortcuts work fine...

Gilles Caulier
Comment 4 Wonko 2012-06-29 12:26:44 UTC
Created attachment 72215 [details]
Image menu

Okay, it's English now.

If you think it's a Gentoo-specific issue, I can file the bug on bugs.gentoo.org instead,
Comment 5 caulier.gilles 2012-06-29 12:42:08 UTC
In your screenshot, where menu is duplicated about image rotate/flip actions ?

Gilles Caulier
Comment 6 Wonko 2012-06-29 12:46:43 UTC
Um, it's the highlighted 'Rotate' entry in the middle, repeated 7 lines below. Same for 'Flip' and 'Auto Rorate/Flip Using Exif Information'. Rotate and Flip both have non-working keyboard shortcuts.
Comment 7 caulier.gilles 2012-06-29 12:54:09 UTC
ok, sorry, the preview of screenshot give bu gizilla been uncomplete on my screen.

Well, it's a Gentoo problem. menu is duplicated because JPEGLossLess kipi-plugin is loaded in digiKam. digiKam 2.6.0 do not load it because i provide an core solution instead.

digiKam check name of plugin and if it JPEGLossLess, it drop it from loader.

I don't know why it load plugin on your computer...

Solution for you : got to digiKam Setup/kipi and disable JPEGLossLess tool.

Gilles Caulier
Comment 9 Wonko 2012-06-29 13:20:54 UTC
Okay, thanks! I disabled the plugin, and all is fine now.

I reported this on Gentoo's bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=424071
Comment 10 Andreas K. Huettel 2012-07-09 22:07:22 UTC
I dont see how this can be a Gentoo bug, because we dont touch any of the relevant code.
(Actually we dont apply any patches at all to 2.6.0, digikam or kipi-plugins.)

That said, I can reproduce the effect just fine, and with KDebugdialog I get the confirmation that it indeed loads JPEGLossless:

digikam(5763)/KIPI (loading) KIPIJPEGLossLessPlugin::Plugin_JPEGLossless::Plugin_JPEGLossless: Plugin_JPEGLossless plugin loaded
digikam(5763)/KIPI (loading) KIPI::PluginLoader::Info::plugin: Loaded plugin  "JPEGLossless"
Comment 11 Andreas K. Huettel 2012-07-09 22:07:58 UTC
PS. Please reopen. It's not always that easy. :)
Comment 12 Wonko 2012-07-09 22:18:01 UTC
Whatever :)
Comment 13 caulier.gilles 2012-07-10 04:28:12 UTC
Please try with last 2.7.0...
Comment 14 caulier.gilles 2012-07-10 07:52:48 UTC
Just to be sure, change application language to English and restart it. Go to Help Menu to change i18n

Gilles Caulier
Comment 15 Wonko 2012-07-10 13:37:47 UTC
So I installed 2.7.0. The lossless JPEG plugin is still available. But when I enable it again, there are not two entries for rotation/flipping any more.

But I still get a message about ambiguous keystrokes when I use Ctrl-Shift-Left/Right.

The 'configure shortcuts' dialog has two entries for rotation, named 'Left' and 'Rotated Left' (and of course the same for right). I thought one came from the lossless JPEG plugin, but even when disabled, both are there. When I set both to their defaults (Ctrl-Shift-Left for 'Left', and nothing for 'Rotated Left'), I still get the message that Ctrl-Shift-Left is ambiguous, but I do not know why, there is no other Ctrl-Shift-Left shortcut defined. So I set 'Left' to Ctrl-Left, and the shortcut works now. And I set 'Rotated Left' to Ctrl-Alt-Left, so I can trigger both actions via keyboard, whatever the difference may be, I see none. And even now, when I press the default, but unassigned Ctrl-Shift-Left sequence, I get the ambiguity dialog.
Comment 16 Andreas K. Huettel 2012-07-10 15:08:53 UTC
I can confirm the problem with digikam-2.7.0, kipi-plugins-2.7.0 (and libkipi-4.8.95 from KDE 4.9rc1).

I can also confirm that manually disabling the JPEGLossless plugin in the Digikam configuration dialog "fixes" things. No clue why the plugin is loaded though.
Comment 17 caulier.gilles 2012-07-10 15:10:45 UTC
For me with this libkipi version and digiKam 2.8.0, it's not reproducible...

Gilles Caulier
Comment 18 Andreas K. Huettel 2012-07-10 15:18:47 UTC
> For me with this libkipi version and digiKam 2.8.0, it's not reproducible...
> 
OK... please give me a few days, I'll try to get to the bottom of this.
Comment 19 Wonko 2012-07-10 18:17:06 UTC
I just noticed that I had still kipi-plugins2.6.0 installed, and upgraded to 2.7.0. Now the Ctrl-Shift-Left shortcut is working, when the lossless JPEG plugin is enabled, and does nothing when it is deactivated. I no longer get the ambuguity dialog, unless I restore the shortcuts to their default values (Ctrl-Shift-Left for the 'Left' action, nothing for 'Rotated Left').

Summary: Either the lossless JPEG plugin needs to be deactivated, or the shortcut for 'Left' needs to be changed from Ctrl-Shift-Left to make this shortcut work.

Why is the Plugin still around, when this feature is available directly in Digikam? Does it work different, or does it have additional features?
Comment 20 Andi Clemens 2012-10-13 16:35:58 UTC
Git commit a97ed4b9aaf4d27194507a140afb5f0522ec5c1a by Andi Clemens.
Committed on 13/10/2012 at 18:34.
Pushed by aclemens into branch 'master'.

No need to duplicate actions here, they have already been added to the global action collection.

M  +1    -1    digikam/items/digikamimageview.cpp
M  +0    -36   digikam/utils/contextmenuhelper.cpp
M  +0    -7    digikam/utils/contextmenuhelper.h
M  +1    -1    digikam/views/imagepreviewview.cpp

http://commits.kde.org/digikam/a97ed4b9aaf4d27194507a140afb5f0522ec5c1a
Comment 21 Andreas K. Huettel 2013-01-02 21:25:34 UTC
This is NOT fixed in 3.0.0-rc yet.

And, it is actually a libkipi bug: in libkipi the plugin name from the ignore list is compared against the LOCALIZED plugin name (which here in a german installation is "Verlustfreies JPEG"; of course this won't be found in the ignore list).

Analysis done: I patched libkipi-4.9.95 pluginloader.cpp to add a debug output also if a plugin is NOT found in the ignore list: 
    315         if (d->ignoredPlugins.contains(name))
    316         {
    317             kDebug(51001) << "Plugin " << name << " is in the ignore list from host application";
    318             continue;
    319         } else {
    320             kDebug(51001) << "Plugin " << name << " is NOT in the ignore list from host application";
    321         }

The resulting messages are:
[...]
digikam(19796)/KIPI (loading) KIPI::PluginLoader::init: Plugin  "Piwigo-Export"  is NOT in the ignore list from host application
digikam(19796)/KIPI (loading) KIPI::PluginLoader::init: Plugin  "SmugMug-Import/Export"  is NOT in the ignore list from host application
digikam(19796)/KIPI (loading) KIPI::PluginLoader::init: Plugin  "Verlustfreies JPEG"  is NOT in the ignore list from host application
digikam(19796)/KIPI (loading) KIPI::PluginLoader::init: Plugin  "KioExportImport"  is NOT in the ignore list from host application
digikam(19796)/KIPI (loading) KIPI::PluginLoader::init: Plugin  "Bildbetrachter"  is NOT in the ignore list from host application
digikam(19796)/KIPI (loading) KIPI::PluginLoader::init: Plugin  "Shwup-Export"  is NOT in the ignore list from host application
Comment 22 Andreas K. Huettel 2013-01-02 21:36:36 UTC
Reading the docs, libkipi should probably use KService::untranslatedGenericName instead of KService::name ...
Comment 23 Andreas K. Huettel 2013-01-02 22:10:58 UTC
(In reply to comment #22)
> Reading the docs, libkipi should probably use
> KService::untranslatedGenericName instead of KService::name ...

... except that KService::untranslatedGenericName returns empty string for all kipi plugins. :(
Comment 24 Andreas K. Huettel 2013-01-02 22:23:51 UTC
OK here's how to fix this (2 steps required):

1) in each kipi-plugin service .desktop file, add a line as for example
UntranslatedGenericName=JPEGLossless
(with the respective untranslated name of the plugin)

2) apply the following patch to libkipi (debug output not required of course):

diff -ruN libkipi-4.9.95.orig/libkipi/pluginloader.cpp libkipi-4.9.95/libkipi/pluginloader.cpp
--- libkipi-4.9.95.orig/libkipi/pluginloader.cpp        2012-12-17 16:03:59.000000000 +0100
+++ libkipi-4.9.95/libkipi/pluginloader.cpp     2013-01-02 23:08:12.000000000 +0100
@@ -302,6 +302,7 @@
     {
         KService::Ptr service   = *iter;
         QString name            = service->name();
+        QString uname           = service->untranslatedGenericName();
         QString library         = service->library();
         QStringList reqFeatures = service->property(QString::fromLatin1("X-KIPI-ReqFeatures")).toStringList();
         int binVersion          = service->property(QString::fromLatin1("X-KIPI-BinaryVersion")).toInt();
@@ -312,10 +313,12 @@
             continue;
         }
 
-        if (d->ignoredPlugins.contains(name))
+        if (d->ignoredPlugins.contains(uname))
         {
-            kDebug(51001) << "Plugin " << name << " is in the ignore list from host application";
+            kDebug(51001) << "Plugin " << name << "(generic name " << uname << ") is in the ignore list from host application";
             continue;
+        } else {
+            kDebug(51001) << "Plugin " << name << "(generic name " << uname << ") is NOT in the ignore list from host application";
         }
 
         if (binVersion != kipi_binary_version)
Comment 25 caulier.gilles 2013-01-02 22:54:45 UTC
Victor,

Do you see the investigations from Andreas in this file ?

Gilles Caulier
Comment 26 Andreas K. Huettel 2013-01-27 16:04:47 UTC
Ping?
Comment 27 Victor Dodon 2013-01-27 16:17:02 UTC
I will investigate the problem and apply the patch to libkipi and to all
kipi-plugins.

Andreas, thank you very much for your input and for the patch.

Victor.




On Sun, Jan 27, 2013 at 6:04 PM, Andreas K. Huettel <dilfridge@gentoo.org>wrote:

> https://bugs.kde.org/show_bug.cgi?id=302740
>
> --- Comment #26 from Andreas K. Huettel <dilfridge@gentoo.org> ---
> Ping?
>
> --
> You are receiving this mail because:
> You are the assignee for the bug.
> _______________________________________________
> Digikam-devel mailing list
> Digikam-devel@kde.org
> https://mail.kde.org/mailman/listinfo/digikam-devel
>
Comment 28 caulier.gilles 2013-01-28 09:05:37 UTC
Git commit 0e25e3ee73cf4048b6d97ccc496bad5b1a1fd577 by Victor Dodon.
Committed on 28/01/2013 at 09:57.
Pushed by dodon into branch 'master'.

Check the untranslatedGenericName service property when loading plugins

BUGS: 302740
CCMAIL: dilfridge@gentoo.org
CCMAIL: caulier.gilles@gmail.com

M  +6    -5    libkipi/pluginloader.cpp
M  +1    -0    tests/kxmlhelloworld/plugin/kipiplugin_kxmlhelloworld.desktop.cmake

http://commits.kde.org/libkipi/0e25e3ee73cf4048b6d97ccc496bad5b1a1fd577