Split MousepadPlugin into X11 and Wayland plugin
AbandonedPublic

Authored by nicolasfella on Feb 23 2018, 7:47 PM.

Details

Reviewers
graesslin
albertvaka
Group Reviewers
KDE Connect
Summary

The MousepadPlugin contains disjoint codepaths to support X11 and Wayland. Split it into two plugins instead of #ifdef'ing for better maintainability.

Currently both plugins are loaded (when compiled). Is there a way to decide whether to load them on runtime? On Android I just would return false in onCreate, but there seems no aquivalent on the desktop.

Test Plan

Tested on X and Wayland.
X works fine, Wayland plugin on Wayland too.
X plugin on Wayland crashes, needs to be disabled on runtime.

Diff Detail

Repository
R224 KDE Connect
Branch
mousepad
Lint
No Linters Available
Unit
No Unit Test Coverage
nicolasfella requested review of this revision.Feb 23 2018, 7:47 PM
nicolasfella created this revision.
apol added a subscriber: apol.Feb 23 2018, 11:43 PM

Would it make sense to have a small input method abstraction class within the plugin?

Would also solve the duplicated plugin issue.

plugins/mousepad_wayland/mousepadplugin_wayland.cpp
34

I'd say it's barely better maintainability when stuff is duplicated.

albertvaka requested changes to this revision.Mar 15 2018, 7:46 PM
albertvaka added a subscriber: albertvaka.

I don't like having two plugins doing the same. I really like removing the ifdefs, though, and having code for each platform on a different file. Can we do this inside a same plugin?

We could have a mousepadplugin that instantiates one specific implementation class within it, depending on the platform (wayland/X11/windows/macosx/whatever), instead of N different plugins.

This revision now requires changes to proceed.Mar 15 2018, 7:46 PM
nicolasfella abandoned this revision.Mar 25 2018, 5:14 PM

Superseeded by D11692