broulik accepted this revision. broulik added a comment. This revision is now accepted and ready to land.
Looks good to me. > wayland Wayland would still use upower but instead of having XRandRBrightness only use sysfs, this needs some more thought on how we could split that in the future, I guess. INLINE COMMENTS > kdedpowerdevil.cpp:83 > + const QStringList paths = QCoreApplication::libraryPaths(); > + QFileInfoList finfos; > + for (const QString& path : paths) { fileInfos also call reserve() as you later iterate something and add an already known number of items > kdedpowerdevil.cpp:84 > + QFileInfoList finfos; > + for (const QString& path : paths) { > + QDir dir(path + QLatin1String("/kf5/powerdevil/"), const QString &paths > kdedpowerdevil.cpp:94 > + Q_FOREACH (const QFileInfo &f, finfos) { > + if (f.baseName().toLower() == > QStringLiteral("powerdevilupowerbackend")) { > + backendFileInfo = f; compare with QLatin1String > kdedpowerdevil.cpp:100 > > - if (!interface) { > - // Ouch > + QPluginLoader* loader = new QPluginLoader(backendFileInfo.filePath(), > m_core); > + QObject *instance = loader->instance(); QPluginLoader * > kdedpowerdevil.cpp:107 > } else { > - // Let's go! > + auto interface = > qobject_cast<PowerDevil::BackendInterface*>(instance); > qCDebug(POWERDEVIL) << "Backend loaded, loading core"; Check for interface being null (cast failed) maybe? REPOSITORY rPOWERDEVIL Powerdevil BRANCH bshah/proper-backends REVISION DETAIL https://phabricator.kde.org/D2369 EMAIL PREFERENCES https://phabricator.kde.org/settings/panel/emailpreferences/ To: bshah, broulik, #plasma Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas