Today I updated KDE from 4.9 to 4.10 and kate is not showing the "highlight selection" plugin (hlselection) anymore. The plugin is not visible in the extension manager anymore and also does not highlight seletected words anymore. Reproducible: Always Steps to Reproduce: 1. update to KDE 4.10 (on Ubuntu 12.04 using ppa:kubuntu-ppa/backports) 2. in Kate open menu Settings > Configure Kate 3. look at Editor Component > Extensions Actual Results: I see no entry for Highlight Selection... Expected Results: I saw this entry befor and had working highlighting in the editor. Ubuntu 12.04 gnome-fallback session ppa:kubuntu-ppa/backports
This feature can be seen here in action, just so we are clear what I'm talking about: http://kate-editor.org/2010/11/14/highlight-selected-text/ The only bug entry I found regarding this plugin has been fixed for a long time and is likely not related, even if the symptoms are the same: https://bugs.kde.org/show_bug.cgi?id=275548
Figured out how to get it working again...still a bug though. On the console kate only showed 4 other plugins: kate(9195)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found 0 offers for "ktexteditorexporter" kate(9195)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found 0 offers for "ktexteditorinsertfile" kate(9195)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found 1 offers for "ktexteditorautobrace" kate(9195)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found 0 offers for "kdeviconinserter" But the hlselection plugin's files actually exsist on my system: $ locate hlselection /usr/lib/kde4/ktexteditor_hlselection.so /usr/share/kde4/services/ktexteditor_hlselection.desktop Comparing the desktop files of the working plugins to the non-working one revealed only one significant difference: $ grep X-KDE-Version /usr/share/kde4/services/ktexteditor_hlselection.desktop /usr/share/kde4/services/ktexteditor_insertfile.desktop /usr/share/kde4/services/ktexteditor_hlselection.desktop:X-KDE-Version=4.3 /usr/share/kde4/services/ktexteditor_insertfile.desktop:X-KDE-Version=4.0 When I changed the X-KDE-Version to 4.0 in hlselection's desktop file, it showed up in kate again is is now working. Setting the value to 4.1, 4.2 or 4.10 hides the plugin, setting it to 4.0 shows it again (kate needs two restarts to pick up the change though). So this actually seems to be some bug in the version comparison...
Confirmed in 4.10 + master compiled from sources
Created attachment 76999 [details] proposed patch In KatePartPluginManager::setupPluginList(), it uses "([X-KDE-Version] >= 4.0) and ([X-KDE-Version] <= 4.10" constraint when querying the plugins. It's doing float comparison, so 4.3 > 4.10. I don't see a way to check the version using the constraint, but it can be done in C++ instead.
@Dorian and Loïc: Good catch. Imo the patch looks good, but I haven't tested it yet, since I'm still on KDE 4.9. @Kate devs: can you look into this?
Tested on gentoo. Compillation OK, works as expected. Thanks a lot.
Can approve too. Tested on kubuntu 12.10. Works fine.
I didn't tested the patch but I really hope to have this functionality back to Kate.
Tested manual fix on Arch Linux: works.
Tested on Gentoo and confirmed fixed with the patch. :)
Git commit f934575613d7efc60b9b6be6203c777d42ab7ffc by Dominik Haumann. Committed on 10/02/2013 at 22:18. Pushed by dhaumann into branch 'KDE/4.10'. fix plugin loading in KDE SC 4.10.0 Thanks to Dorian and Loïc for finding the root of this issue. FIXED-IN: 4.10.1 M +14 -6 part/utils/katepartpluginmanager.cpp http://commits.kde.org/kate/f934575613d7efc60b9b6be6203c777d42ab7ffc
Git commit 3adf3cc5473c533f382ae8a481e452289a56bab3 by Dominik Haumann. Committed on 10/02/2013 at 22:18. Pushed by dhaumann into branch 'master'. fix plugin loading in KDE SC 4.10.0 Thanks to Dorian and Loïc for finding the root of this issue. FIXED-IN: 4.10.1 M +14 -6 part/utils/katepartpluginmanager.cpp http://commits.kde.org/kate/3adf3cc5473c533f382ae8a481e452289a56bab3
Did anyone look at fixing this properly in kdelibs yet?
*** Bug 314957 has been marked as a duplicate of this bug. ***
@Will: no, and I'm not even sure it's a real kdelibs issue. @David: see commit diff above: KService::List traderList = KServiceTypeTrader::self()->query("KTextEditor/Plugin", "([X-KDE-Version] >= 4.0) and ([X-KDE-Version] <= " + QString("%1.%2").arg(KDE::versionMajor()).arg(KDE::versionMinor()) + ')'); Here, "4.3 <= 4.10" did not hold, if I understand correctly.
*** Bug 315120 has been marked as a duplicate of this bug. ***
4.3 is not smaller than 4.10, ask any mathematician :-) The examples in the KMimeTypeTrader documentation show integer numbers, for "the version of the interface used by the plugins". If the interface didn't change between 4.9 and 4.10, there is no real reason to reject the 4.9 plugins, is there? Or if there is, just use an integer that increases everytime, or even simply 100 * versionMajor + versionMinor.
*** Bug 315795 has been marked as a duplicate of this bug. ***