Summary: | [PATCH] "highlight selection" plugin is missing from kate since update to kde 4.10 | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Dorian Scholz <dorianscholz> |
Component: | part | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | adaptee, asturm, david.martin.it, faure, finex, julee.vv, kde_bugs, kensington, kirill.bogdanenko, kungfoobar, lueck, mkyral, tonurics, wstephenson |
Priority: | VHI | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kate/3adf3cc5473c533f382ae8a481e452289a56bab3 | Version Fixed In: | 4.10.1 |
Attachments: | proposed patch |
Description
Dorian Scholz
2013-02-06 16:18:41 UTC
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. *** |