Commit ea9181cc authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Port away from KDELibs4Support

- macro_bool_to_01 comes from KDELibs4Support, the CMake vars it was setting
  aren't used
- QKeySequence operator int() has been obsoleted for ages; looking at the Qt
  code it returned QKeySequence[0], which is simple to do that manually
- use KGlobalSettings enum values directly, IIUC the plan is to use
  KConfigWatcher for all the KGlobalSettings stuff
- kimagecache.h is actually in KGuiAddons not KDELibs4Support, so we can use
  that (and have to link against KCoreAddons for KSharedDataCache...)

Remains kcms/dateandtime for ktimezone* classes used for the timezones
widget; d_ed said the plan is to port it to QML.
parent 0b6588c4
......@@ -40,6 +40,7 @@ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Auth
Crash
Plasma
PlasmaQuick
DocTools
......@@ -47,12 +48,14 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
KCMUtils
NewStuff
NewStuffQuick
KDELibs4Support
KIO
Notifications
NotifyConfig
Attica
Runner
GlobalAccel
CoreAddons # KSharedDataCache required by KImageCache
GuiAddons # KImageCache
Declarative
DBusAddons
Activities
......@@ -61,6 +64,8 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Wallet
WidgetsAddons
Codecs
Sonnet
KDELibs4Support # kcms/dateandtime
)
find_package(AccountsQt5 ${ACCOUNTSQT_DEP_VERSION} CONFIG)
......
......@@ -21,28 +21,12 @@ check_include_files("sys/types.h;sys/statfs.h" HAVE_SYS_STATFS_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(malloc.h HAVE_MALLOC_H)
check_function_exists(statfs HAVE_STATFS)
macro_bool_to_01(OPENGL_FOUND HAVE_OPENGL) # kwin
macro_bool_to_01(X11_XShm_FOUND HAVE_XSHM) # kwin, ksplash
macro_bool_to_01(X11_XTest_FOUND HAVE_XTEST) # khotkeys, kxkb, kdm
macro_bool_to_01(X11_Xcomposite_FOUND HAVE_XCOMPOSITE) # kicker, kwin
macro_bool_to_01(X11_Xcursor_FOUND HAVE_XCURSOR) # many uses
macro_bool_to_01(X11_Xdamage_FOUND HAVE_XDAMAGE) # kwin
macro_bool_to_01(X11_Xfixes_FOUND HAVE_XFIXES) # klipper, kicker, kwin
macro_bool_to_01(X11_Xinerama_FOUND HAVE_XINERAMA)
macro_bool_to_01(X11_Xrandr_FOUND HAVE_XRANDR) # kwin
macro_bool_to_01(X11_Xrender_FOUND HAVE_XRENDER) # kcontrol/style, kicker
macro_bool_to_01(X11_xf86misc_FOUND HAVE_XF86MISC) # kdesktop and kcontrol/lock
macro_bool_to_01(X11_dpms_FOUND HAVE_DPMS) # kdesktop
macro_bool_to_01(X11_XSync_FOUND HAVE_XSYNC) # kwin
set(HAVE_XCURSOR {X11_Xcursor_FOUND}) # many uses
set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
check_function_exists(getpeereid HAVE_GETPEEREID) # kdesu
check_function_exists(setpriority HAVE_SETPRIORITY) # kscreenlocker
check_function_exists(setpriority HAVE_SETPRIORITY) # kscreenlocker
set(CMAKE_REQUIRED_INCLUDES ${X11_Xrandr_INCLUDE_PATH}/Xrandr.h)
set(CMAKE_REQUIRED_LIBRARIES ${X11_Xrandr_LIB})
check_function_exists(XRRGetScreenSizeRange XRANDR_1_2_FOUND)
macro_bool_to_01(XRANDR_1_2_FOUND HAS_RANDR_1_2)
check_function_exists(XRRGetScreenResourcesCurrent XRANDR_1_3_FOUND)
macro_bool_to_01(XRANDR_1_3_FOUND HAS_RANDR_1_3)
......@@ -4,17 +4,16 @@ set(trashplugin_SRCS
trashplugin.cpp
)
add_library(trashplugin SHARED ${trashplugin_SRCS})
target_link_libraries(trashplugin
Qt::Core
Qt::Qml
KF5::KIOCore
KF5::KIOWidgets
KF5::CoreAddons # KSharedDataCache required by KImageCache in GuiAddons
KF5::GuiAddons
Qt::DBus
)
install(TARGETS trashplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/trash)
install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/trash)
......@@ -21,10 +21,10 @@
#define DIRMODEL_H
#include <KDirModel>
#include <KImageCache>
#include <KSharedDataCache>
#include <QSize>
#include <QVariant>
#include <kimagecache.h>
class QTimer;
......
/* Define if you have the XRandR extension */
#cmakedefine HAVE_XRANDR 1
/* Define if you have the XDamage extension */
#cmakedefine HAVE_XDAMAGE 1
/* Define if you have the XKB extension */
#cmakedefine HAVE_XKB 1
/* Define if you have the Xinerama extension */
#cmakedefine HAVE_XINERAMA 1
/* Define if you have the XSHM (MIT SHM) extension */
#cmakedefine HAVE_XSHM 1
/* Define if you have the XComposite extension */
#cmakedefine HAVE_XCOMPOSITE 1
/* Define to 1 if you have Xcursor */
#cmakedefine HAVE_XCURSOR 1
/* Define if you have the xf86misc extension */
#cmakedefine HAVE_XF86MISC 1
/* Define if you have the XFixes extension */
#cmakedefine HAVE_XFIXES 1
/* Define if you have the XTest extension */
#cmakedefine HAVE_XTEST 1
/* Define if your system has XRender support */
#cmakedefine HAVE_XRENDER 1
/* Define if you have OpenGL */
#cmakedefine HAVE_OPENGL 1
/* Define if you have the XSync extension */
#cmakedefine HAVE_XSYNC 1
/* Define if you have XRandR 1.3 */
#cmakedefine HAS_RANDR_1_3 1
/* Define if you have XorgLibinput */
#cmakedefine01 HAVE_XORGLIBINPUT
......
/* Define if you have DPMS support */
#cmakedefine HAVE_DPMS 1
/* Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h> */
#cmakedefine HAVE_DPMSCAPABLE_PROTO 1
/* Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h> */
#cmakedefine HAVE_DPMSINFO_PROTO 1
/* Define if you have gethostname */
#cmakedefine HAVE_GETHOSTNAME 1
......
......@@ -30,7 +30,6 @@
// KDE
#include <KActivities/Controller>
#include <KImageCache>
// Local
#include "sortedactivitiesmodel.h"
......
......@@ -33,7 +33,6 @@
#include <QWidget>
#include <KDatePicker>
#include <KNumInput>
class Kclock;
class QTimeEdit;
......
......@@ -179,8 +179,13 @@ void GlobalAccelModel::save()
for (auto &action : it->actions) {
if (action.initialShortcuts != action.activeShortcuts) {
const QStringList actionId = buildActionId(it->id, it->displayName, action.id, action.displayName);
// operator int of QKeySequence
QList<int> keys(action.activeShortcuts.cbegin(), action.activeShortcuts.cend());
// TODO: pass action.activeShortcuts to m_globalAccelInterface->setForeignShortcut() as a QSet<QKeySequence>
// or QList<QKeySequence>?
QList<int> keys;
keys.reserve(action.activeShortcuts.size());
for (const QKeySequence &key : qAsConst(action.activeShortcuts)) {
keys.append(key[0]);
}
qCDebug(KCMKEYS) << "Saving" << actionId << action.activeShortcuts << keys;
auto reply = m_globalAccelInterface->setForeignShortcut(actionId, keys);
reply.waitForFinished();
......
......@@ -26,7 +26,6 @@ target_link_libraries(kcm_landingpage
KF5::KCMUtils
KF5::ConfigWidgets
KF5::Declarative
KF5::KDELibs4Support # kglobalsettings
PW::KWorkspace
KF5::ActivitiesStats
......
......@@ -24,7 +24,6 @@
#include <KAboutData>
#include <KColorScheme>
#include <KLocalizedString>
#include <KGlobalSettings>
#include <KPackage/PackageLoader>
#include <KService>
#include <KCModuleInfo>
......@@ -227,8 +226,8 @@ void KCMLandingPage::save()
QDBusMessage message = QDBusMessage::createSignal("/KGlobalSettings", "org.kde.KGlobalSettings", "notifyChange");
QList<QVariant> args;
args.append(KGlobalSettings::SettingsChanged);
args.append(KGlobalSettings::SETTINGS_MOUSE);
args.append(3 /*KGlobalSettings::SettingsChanged*/);
args.append(0 /*KGlobalSettings::SETTINGS_MOUSE*/);
message.setArguments(args);
QDBusConnection::sessionBus().send(message);
......
......@@ -26,7 +26,6 @@ target_link_libraries(kcm_workspace
KF5::KCMUtils
KF5::ConfigWidgets
KF5::Declarative
KF5::KDELibs4Support # kglobalsettings
Qt::DBus
)
......
......@@ -20,7 +20,6 @@
#include "workspaceoptions.h"
#include <KAboutData>
#include <KGlobalSettings>
#include <KLocalizedString>
#include <KPluginFactory>
......@@ -68,8 +67,8 @@ void KCMWorkspaceOptions::save()
QDBusMessage message = QDBusMessage::createSignal("/KGlobalSettings", "org.kde.KGlobalSettings", "notifyChange");
QList<QVariant> args;
args.append(KGlobalSettings::SettingsChanged);
args.append(KGlobalSettings::SETTINGS_MOUSE);
args.append(3 /*KGlobalSettings::SettingsChanged*/);
args.append(0 /*GlobalSettings::SettingsCategory::SETTINGS_MOUSE*/);
message.setArguments(args);
QDBusConnection::sessionBus().send(message);
}
......
......@@ -19,6 +19,7 @@
#include "knetattach.h"
#include <QUrlQuery>
#include <QVariant>
#include <KCharsets>
......@@ -236,7 +237,7 @@ bool KNetAttach::validateCurrentPage()
desktopFile.writeEntry("Name", name);
desktopFile.writeEntry("Type", "Link");
desktopFile.writeEntry("URL", url.toDisplayString());
desktopFile.writeEntry("Charset", url.queryItemValue("charset"));
desktopFile.writeEntry("Charset", QUrlQuery(url).queryItemValue(QStringLiteral("charset")));
desktopFile.sync();
org::kde::KDirNotify::emitFilesAdded(QUrl(QStringLiteral("remote:/")));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment