diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ endif() find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Widgets DBus X11Extras) -find_package(KF5 REQUIRED COMPONENTS Activities Auth IdleTime Config DBusAddons Solid I18n GlobalAccel KIO NotifyConfig Screen KDELibs4Support Wayland) +find_package(KF5 REQUIRED COMPONENTS Activities Auth IdleTime Config DBusAddons Solid I18n GlobalAccel KIO NotifyConfig Screen Notifications Crash DocTools Wayland) find_package(LibKWorkspace CONFIG REQUIRED) find_package(KF5BluezQt) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -79,6 +79,7 @@ KF5::WidgetsAddons KF5::Notifications KF5::XmlGui + KF5::Crash PW::KWorkspace ) @@ -106,8 +107,8 @@ powerdevilpolicyagent.h PowerDevil::PolicyAgent powermanagementpolicyagentadaptor PowerManagementPolicyAgentAdaptor) -qt5_add_dbus_adaptor(powerdevil_SRCS ${KDE4_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.PowerManagement.xml powerdevilfdoconnector.h PowerDevil::FdoConnector powermanagementfdoadaptor PowerManagementFdoAdaptor) -qt5_add_dbus_adaptor(powerdevil_SRCS ${KDE4_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.PowerManagement.Inhibit.xml powerdevilfdoconnector.h PowerDevil::FdoConnector powermanagementinhibitadaptor PowerManagementInhibitAdaptor) +qt5_add_dbus_adaptor(powerdevil_SRCS ${SOLID_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.PowerManagement.xml powerdevilfdoconnector.h PowerDevil::FdoConnector powermanagementfdoadaptor PowerManagementFdoAdaptor) +qt5_add_dbus_adaptor(powerdevil_SRCS ${SOLID_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.PowerManagement.Inhibit.xml powerdevilfdoconnector.h PowerDevil::FdoConnector powermanagementinhibitadaptor PowerManagementInhibitAdaptor) # Backends diff --git a/daemon/actions/bundled/CMakeLists.txt b/daemon/actions/bundled/CMakeLists.txt --- a/daemon/actions/bundled/CMakeLists.txt +++ b/daemon/actions/bundled/CMakeLists.txt @@ -18,7 +18,7 @@ add_powerdevil_bundled_action(keyboardbrightnesscontrol) add_powerdevil_bundled_action(dimdisplay) add_powerdevil_bundled_action(runscript KF5::KIOCore KF5::KIOWidgets) -add_powerdevil_bundled_action(suspendsession KF5::KIOCore KF5::KIOWidgets KF5::Solid KF5::KDELibs4Support) +add_powerdevil_bundled_action(suspendsession KF5::KIOCore KF5::KIOWidgets KF5::Solid) if(HAVE_WIRELESS_SUPPORT) add_powerdevil_bundled_action(wirelesspowersaving KF5::NetworkManagerQt KF5::BluezQt) endif() @@ -37,7 +37,6 @@ KF5::ConfigGui KF5::Solid KF5::XmlGui - KF5::KDELibs4Support ) install(TARGETS powerdevilhandlebuttoneventsaction_config DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES powerdevilhandlebuttoneventsaction.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/daemon/actions/bundled/handlebuttoneventsconfig.cpp b/daemon/actions/bundled/handlebuttoneventsconfig.cpp --- a/daemon/actions/bundled/handlebuttoneventsconfig.cpp +++ b/daemon/actions/bundled/handlebuttoneventsconfig.cpp @@ -24,7 +24,6 @@ #include "upower_interface.h" #include -#include #include #include @@ -94,16 +93,8 @@ QList boxes; boxes << m_lidCloseCombo << m_powerButtonCombo; - QSet< Solid::PowerManagement::SleepState > methods = Solid::PowerManagement::supportedSleepStates(); - Q_FOREACH (QComboBox *box, boxes) { box->addItem(QIcon::fromTheme("dialog-cancel"), i18n("Do nothing"), (uint)SuspendSession::None); - if (methods.contains(Solid::PowerManagement::SuspendState)) { - box->addItem(QIcon::fromTheme("system-suspend"), i18n("Suspend"), (uint)SuspendSession::ToRamMode); - } - if (methods.contains(Solid::PowerManagement::HibernateState)) { - box->addItem(QIcon::fromTheme("system-suspend-hibernate"), i18n("Hibernate"), (uint)SuspendSession::ToDiskMode); - } box->addItem(QIcon::fromTheme("system-shutdown"), i18n("Shut down"), (uint)SuspendSession::ShutdownMode); box->addItem(QIcon::fromTheme("system-lock-screen"), i18n("Lock screen"), (uint)SuspendSession::LockScreenMode); if (box != m_lidCloseCombo) { diff --git a/daemon/actions/bundled/suspendsessionconfig.cpp b/daemon/actions/bundled/suspendsessionconfig.cpp --- a/daemon/actions/bundled/suspendsessionconfig.cpp +++ b/daemon/actions/bundled/suspendsessionconfig.cpp @@ -23,8 +23,6 @@ #include #include -#include - #include #include #include @@ -78,14 +76,6 @@ m_idleTime->setValue(0); m_idleTime->setSuffix(i18n(" min")); - QSet< Solid::PowerManagement::SleepState > methods = Solid::PowerManagement::supportedSleepStates(); - - if (methods.contains(Solid::PowerManagement::SuspendState)) { - m_comboBox->addItem(QIcon::fromTheme("system-suspend"), i18n("Suspend"), (uint)SuspendSession::ToRamMode); - } - if (methods.contains(Solid::PowerManagement::HibernateState)) { - m_comboBox->addItem(QIcon::fromTheme("system-suspend-hibernate"), i18n("Hibernate"), (uint)SuspendSession::ToDiskMode); - } m_comboBox->addItem(QIcon::fromTheme("system-shutdown"), i18n("Shut down"), (uint)SuspendSession::ShutdownMode); m_comboBox->addItem(QIcon::fromTheme("system-lock-screen"), i18n("Lock screen"), (uint)SuspendSession::LockScreenMode); diff --git a/kcmodule/activities/CMakeLists.txt b/kcmodule/activities/CMakeLists.txt --- a/kcmodule/activities/CMakeLists.txt +++ b/kcmodule/activities/CMakeLists.txt @@ -17,7 +17,6 @@ target_link_libraries(kcm_powerdevilactivitiesconfig KF5::Solid KF5::Activities - KF5::KDELibs4Support powerdevilconfigcommonprivate ) diff --git a/kcmodule/activities/activitypage.h b/kcmodule/activities/activitypage.h --- a/kcmodule/activities/activitypage.h +++ b/kcmodule/activities/activitypage.h @@ -25,6 +25,8 @@ #include +#include + class QTabWidget; class KMessageWidget; @@ -57,8 +59,8 @@ KActivities::Consumer *m_activityConsumer; QList< ActivityWidget* > m_activityWidgets; - QWeakPointer< ErrorOverlay > m_errorOverlay; - QWeakPointer< KMessageWidget > m_messageWidget; + QPointer< ErrorOverlay > m_errorOverlay; + QPointer< KMessageWidget > m_messageWidget; KActivities::Consumer::ServiceStatus m_previousServiceStatus; }; diff --git a/kcmodule/activities/activitywidget.cpp b/kcmodule/activities/activitywidget.cpp --- a/kcmodule/activities/activitywidget.cpp +++ b/kcmodule/activities/activitywidget.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -91,16 +90,6 @@ using namespace PowerDevil::BundledActions; - QSet< Solid::PowerManagement::SleepState > methods = Solid::PowerManagement::supportedSleepStates(); - - if (methods.contains(Solid::PowerManagement::SuspendState)) { - m_ui->alwaysActionBox->addItem(QIcon::fromTheme("system-suspend"), - i18n("Suspend"), (uint)SuspendSession::ToRamMode); - } - if (methods.contains(Solid::PowerManagement::HibernateState)) { - m_ui->alwaysActionBox->addItem(QIcon::fromTheme("system-suspend-hibernate"), - i18n("Hibernate"), (uint)SuspendSession::ToDiskMode); - } m_ui->alwaysActionBox->addItem(QIcon::fromTheme("system-shutdown"), i18n("Shut down"), (uint)SuspendSession::ShutdownMode); m_ui->actLikeComboBox->clear(); diff --git a/kcmodule/global/CMakeLists.txt b/kcmodule/global/CMakeLists.txt --- a/kcmodule/global/CMakeLists.txt +++ b/kcmodule/global/CMakeLists.txt @@ -16,7 +16,6 @@ KF5::KIOWidgets KF5::Solid KF5::NotifyConfig - KF5::KDELibs4Support powerdevilconfigcommonprivate ) diff --git a/kcmodule/global/GeneralPage.h b/kcmodule/global/GeneralPage.h --- a/kcmodule/global/GeneralPage.h +++ b/kcmodule/global/GeneralPage.h @@ -44,7 +44,7 @@ void onServiceUnregistered(const QString &service); private: - QWeakPointer< ErrorOverlay > m_errorOverlay; + QPointer< ErrorOverlay > m_errorOverlay; }; #endif /* GENERALPAGE_H */ diff --git a/kcmodule/global/GeneralPage.cpp b/kcmodule/global/GeneralPage.cpp --- a/kcmodule/global/GeneralPage.cpp +++ b/kcmodule/global/GeneralPage.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -101,15 +100,6 @@ } } - QSet< Solid::PowerManagement::SleepState > methods = Solid::PowerManagement::supportedSleepStates(); - - BatteryCriticalCombo->addItem(QIcon::fromTheme("dialog-cancel"), i18n("Do nothing"), PowerDevil::BundledActions::SuspendSession::None); - if (methods.contains(Solid::PowerManagement::SuspendState)) { - BatteryCriticalCombo->addItem(QIcon::fromTheme("system-suspend"), i18n("Suspend"), PowerDevil::BundledActions::SuspendSession::ToRamMode); - } - if (methods.contains(Solid::PowerManagement::HibernateState)) { - BatteryCriticalCombo->addItem(QIcon::fromTheme("system-suspend-hibernate"), i18n("Hibernate"), PowerDevil::BundledActions::SuspendSession::ToDiskMode); - } BatteryCriticalCombo->addItem(QIcon::fromTheme("system-shutdown"), i18n("Shut down"), PowerDevil::BundledActions::SuspendSession::ShutdownMode); notificationsButton->setIcon(QIcon::fromTheme("preferences-desktop-notification")); diff --git a/kcmodule/profiles/CMakeLists.txt b/kcmodule/profiles/CMakeLists.txt --- a/kcmodule/profiles/CMakeLists.txt +++ b/kcmodule/profiles/CMakeLists.txt @@ -18,7 +18,6 @@ KF5::Solid KF5::ConfigGui KF5::ConfigWidgets - KF5::KDELibs4Support powerdevilui powerdevilconfigcommonprivate ) diff --git a/kcmodule/profiles/EditPage.h b/kcmodule/profiles/EditPage.h --- a/kcmodule/profiles/EditPage.h +++ b/kcmodule/profiles/EditPage.h @@ -25,6 +25,8 @@ #include "ui_profileEditPage.h" +#include + class ActionEditWidget; namespace PowerDevil { class ActionConfig; @@ -63,7 +65,7 @@ private: KSharedConfig::Ptr m_profilesConfig; QHash< QString, bool > m_profileEdited; - QWeakPointer< ErrorOverlay > m_errorOverlay; + QPointer< ErrorOverlay > m_errorOverlay; QHash< QString, ActionEditWidget* > m_editWidgets; }; diff --git a/kcmodule/profiles/EditPage.cpp b/kcmodule/profiles/EditPage.cpp --- a/kcmodule/profiles/EditPage.cpp +++ b/kcmodule/profiles/EditPage.cpp @@ -50,7 +50,6 @@ #include #include -#include K_PLUGIN_FACTORY(PowerDevilProfilesKCMFactory, registerPlugin(); @@ -78,12 +77,6 @@ m_profilesConfig = KSharedConfig::openConfig("powermanagementprofilesrc", KConfig::SimpleConfig | KConfig::CascadeConfig); if (m_profilesConfig->groupList().isEmpty()) { - // Use the generator - QSet methods = Solid::PowerManagement::supportedSleepStates(); - PowerDevil::ProfileGenerator::generateProfiles( - methods.contains(Solid::PowerManagement::SuspendState), - methods.contains(Solid::PowerManagement::HibernateState) - ); m_profilesConfig->reparseConfiguration(); } @@ -195,11 +188,6 @@ "Are you sure you want to continue?"), i18n("Restore Default Profiles")); if (ret == KMessageBox::Continue) { qCDebug(POWERDEVIL) << "Restoring defaults."; - QSet methods = Solid::PowerManagement::supportedSleepStates(); - PowerDevil::ProfileGenerator::generateProfiles( - methods.contains(Solid::PowerManagement::SuspendState), - methods.contains(Solid::PowerManagement::HibernateState) - ); load();