Port mediawiki runner to Plasma5/Qt5
ClosedPublic

Authored by kossebau on Jan 29 2018, 6:15 PM.

Details

Summary

Straight initial port of existing logic, with separate plugin metadata files
for different services. Perhaps could be changed to have just one normal
plugin, but with a config UI where the user can edit a list of
mediawiki-running servers and individual trigger words per server.
Left for another step/developer for now.

Test Plan

A bug in Milou (kde #389611) prevents normal testing for now.
One can increase that reset timeout to some big value, e.g.
m_resetTimer.setInterval(3000);
in the Milou::SourcesModel constructor to work around the bug.
Then enable the mediawiki plugins you want to test, e.g. the
Wikipedia one, and enter in KRunner "wiki kde plasma"

Diff Detail

Repository
R114 Plasma Addons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Jan 29 2018, 6:15 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 29 2018, 6:15 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Jan 29 2018, 6:15 PM
kossebau updated this revision to Diff 26208.Jan 30 2018, 12:04 PM

rebase to latest master

Lgtm

runners/mediawiki/mediawiki.cpp
60–61

Make sure to enable QNetworkAccessManager auto-redirect or else Ben will get mad at you

135

Categorized logging, perhaps?

runners/mediawiki/mediawiki.h
74–75

Asterisk goes to variable name, QObject *parent (pedantic)

runners/mediawiki/plasma-runner-wikipedia.desktop
118

Is there a chance we can make this user-configurable or perhaps have it use the current language automatically? (Just asking, it's fine if you just did a straight port)

kossebau marked 2 inline comments as done.Feb 6 2018, 4:48 PM

Thanks for first round of review :)

runners/mediawiki/mediawiki.cpp
135

Yes, though I plan to do this later in one concentrated go for all of kdeplasma-addons, so things will be consistent and complete.

runners/mediawiki/mediawiki.h
74–75

Ah, too much kdevelop code done (where asterisk goes to type) :)

runners/mediawiki/plasma-runner-wikipedia.desktop
118

No idea yet, but i had seen the related bug report https://bugs.kde.org/show_bug.cgi?id=256019 and agree that it will be good to have.

I hope that can be covered in the planned follow-up work to improve the configuration UI to allow the user adding more mediawiki servers without having to create and install new desktop files like now.
No brain cycles yet spent on that.

kossebau updated this revision to Diff 26661.Feb 6 2018, 4:48 PM
kossebau marked an inline comment as done.

update to kai's feedback

kossebau updated this revision to Diff 26662.Feb 6 2018, 5:28 PM

keep also ampersand with varname, not type, in method signature

mart accepted this revision.Mar 23 2018, 2:58 PM
This revision is now accepted and ready to land.Mar 23 2018, 2:58 PM
This revision was automatically updated to reflect the committed changes.