From e53de3cbb84ab0a3586cd77252cb90c5ac7ddbde Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 16 Apr 2016 13:56:36 +0000 Subject: [PATCH] generic: misc cleanups Signed-off-by: Ivailo Monev --- cmake/modules/FindKDE4Internal.cmake | 6 ++-- kcddb/CMakeLists.txt | 6 ++-- kdeui/actions/kaction.cpp | 1 - kdeui/actions/kaction.h | 1 - kdeui/actions/kaction_p.h | 1 + kdeui/actions/kdualaction.h | 1 + kdeui/actions/kselectaction.cpp | 1 + kdeui/dialogs/kshortcutseditoritem.cpp | 2 ++ kdeui/shortcuts/kglobalaccel.h | 1 + kdeui/xmlgui/kxmlguibuilder.cpp | 1 + kdewebkit/kwebkitpart/src/webview.cpp | 1 + kio/misc/kpac/proxyscout.cpp | 2 +- kio/misc/kpac/script.cpp | 44 ++++++++++++-------------- 13 files changed, 34 insertions(+), 34 deletions(-) diff --git a/cmake/modules/FindKDE4Internal.cmake b/cmake/modules/FindKDE4Internal.cmake index f55b2afc..2fedb682 100644 --- a/cmake/modules/FindKDE4Internal.cmake +++ b/cmake/modules/FindKDE4Internal.cmake @@ -236,6 +236,7 @@ cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) cmake_policy(SET CMP0000 OLD) # CMP0003: add the link paths to the link command as with cmake 2.4 cmake_policy(SET CMP0003 OLD) +# TODO: get rid of this and adjust to new behaviour # CMP0005: keep escaping behaviour for definitions added via add_definitions() cmake_policy(SET CMP0005 OLD) @@ -253,10 +254,7 @@ set(CMAKE_MODULE_PATH ${kde_cmake_module_dir} ${CMAKE_MODULE_PATH} ) # if the minimum Qt requirement is changed, change all occurrence in the # following lines -if(NOT QT_MIN_VERSION ) - set(QT_MIN_VERSION "4.8.2") -endif() -if(${QT_MIN_VERSION} VERSION_LESS "4.8.2") +if(NOT QT_MIN_VERSION OR QT_MIN_VERSION VERSION_LESS "4.8.2") set(QT_MIN_VERSION "4.8.2") endif() diff --git a/kcddb/CMakeLists.txt b/kcddb/CMakeLists.txt index ad344e93..ea312b65 100644 --- a/kcddb/CMakeLists.txt +++ b/kcddb/CMakeLists.txt @@ -27,10 +27,10 @@ if(MUSICBRAINZ5_FOUND) ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}") -else(MUSICBRAINZ5_FOUND) +else() set(HAVE_MUSICBRAINZ5 0) set(libmusicbrainz_SRCS) -endif(MUSICBRAINZ5_FOUND) +endif() configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config-musicbrainz.h.cmake @@ -40,5 +40,5 @@ configure_file( if(ENABLE_TESTING) add_subdirectory(test) endif() -add_subdirectory(kcmcddb ) +add_subdirectory(kcmcddb) add_subdirectory(libkcddb) diff --git a/kdeui/actions/kaction.cpp b/kdeui/actions/kaction.cpp index 29e23bcc..91c88393 100644 --- a/kdeui/actions/kaction.cpp +++ b/kdeui/actions/kaction.cpp @@ -39,7 +39,6 @@ #include -#include "kguiitem.h" #include "kicon.h" //--------------------------------------------------------------------- diff --git a/kdeui/actions/kaction.h b/kdeui/actions/kaction.h index fe3283e7..d4c4907e 100644 --- a/kdeui/actions/kaction.h +++ b/kdeui/actions/kaction.h @@ -27,7 +27,6 @@ #define KACTION_H #include -#include #include #include diff --git a/kdeui/actions/kaction_p.h b/kdeui/actions/kaction_p.h index 26f2b77e..a47f811d 100644 --- a/kdeui/actions/kaction_p.h +++ b/kdeui/actions/kaction_p.h @@ -22,6 +22,7 @@ #include "kglobalaccel.h" #include "kgesturemap.h" #include +#include class KAction; diff --git a/kdeui/actions/kdualaction.h b/kdeui/actions/kdualaction.h index ec09919d..1ce54d68 100644 --- a/kdeui/actions/kdualaction.h +++ b/kdeui/actions/kdualaction.h @@ -22,6 +22,7 @@ #include #include +#include class KDualActionPrivate; diff --git a/kdeui/actions/kselectaction.cpp b/kdeui/actions/kselectaction.cpp index b3117276..56e6f795 100644 --- a/kdeui/actions/kselectaction.cpp +++ b/kdeui/actions/kselectaction.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include "kcombobox.h" #include "kmenu.h" diff --git a/kdeui/dialogs/kshortcutseditoritem.cpp b/kdeui/dialogs/kshortcutseditoritem.cpp index 247f5ca7..35042edb 100644 --- a/kdeui/dialogs/kshortcutseditoritem.cpp +++ b/kdeui/dialogs/kshortcutseditoritem.cpp @@ -29,6 +29,8 @@ #include #include #include +#include +#include #include diff --git a/kdeui/shortcuts/kglobalaccel.h b/kdeui/shortcuts/kglobalaccel.h index 1d382437..f5e0fb8c 100644 --- a/kdeui/shortcuts/kglobalaccel.h +++ b/kdeui/shortcuts/kglobalaccel.h @@ -24,6 +24,7 @@ #include "kdeui_export.h" #include "kaction.h" +#include "kglobal.h" #include "kglobalshortcutinfo.h" class QWidget; diff --git a/kdeui/xmlgui/kxmlguibuilder.cpp b/kdeui/xmlgui/kxmlguibuilder.cpp index 68a62be3..d0a0bab7 100644 --- a/kdeui/xmlgui/kxmlguibuilder.cpp +++ b/kdeui/xmlgui/kxmlguibuilder.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include diff --git a/kdewebkit/kwebkitpart/src/webview.cpp b/kdewebkit/kwebkitpart/src/webview.cpp index 53835f60..b519b1f8 100644 --- a/kdewebkit/kwebkitpart/src/webview.cpp +++ b/kdewebkit/kwebkitpart/src/webview.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include diff --git a/kio/misc/kpac/proxyscout.cpp b/kio/misc/kpac/proxyscout.cpp index 91fd8a78..ca03a312 100644 --- a/kio/misc/kpac/proxyscout.cpp +++ b/kio/misc/kpac/proxyscout.cpp @@ -129,7 +129,7 @@ namespace KPAC KUrl url(checkUrl); if (m_suspendTime) { - if ( std::time( 0 ) - m_suspendTime < 300 ) { + if ( (std::time( 0 ) - m_suspendTime) < 300 ) { return QLatin1String("DIRECT"); } m_suspendTime = 0; diff --git a/kio/misc/kpac/script.cpp b/kio/misc/kpac/script.cpp index a5953013..1a11a0b3 100644 --- a/kio/misc/kpac/script.cpp +++ b/kio/misc/kpac/script.cpp @@ -25,11 +25,9 @@ #include #include #include - #include #include #include - #include #include #include @@ -39,8 +37,6 @@ #include #include -#define QL1S(x) QLatin1String(x) - namespace { static int findString (const QString& s, const char* const* values) @@ -701,26 +697,26 @@ namespace void registerFunctions(QScriptEngine* engine) { QScriptValue value = engine->globalObject(); - value.setProperty(QL1S("isPlainHostName"), engine->newFunction(IsPlainHostName)); - value.setProperty(QL1S("dnsDomainIs"), engine->newFunction(DNSDomainIs)); - value.setProperty(QL1S("localHostOrDomainIs"), engine->newFunction(LocalHostOrDomainIs)); - value.setProperty(QL1S("isResolvable"), engine->newFunction(IsResolvable)); - value.setProperty(QL1S("isInNet"), engine->newFunction(IsInNet)); - value.setProperty(QL1S("dnsResolve"), engine->newFunction(DNSResolve)); - value.setProperty(QL1S("myIpAddress"), engine->newFunction(MyIpAddress)); - value.setProperty(QL1S("dnsDomainLevels"), engine->newFunction(DNSDomainLevels)); - value.setProperty(QL1S("shExpMatch"), engine->newFunction(ShExpMatch)); - value.setProperty(QL1S("weekdayRange"), engine->newFunction(WeekdayRange)); - value.setProperty(QL1S("dateRange"), engine->newFunction(DateRange)); - value.setProperty(QL1S("timeRange"), engine->newFunction(TimeRange)); + value.setProperty(QLatin1String("isPlainHostName"), engine->newFunction(IsPlainHostName)); + value.setProperty(QLatin1String("dnsDomainIs"), engine->newFunction(DNSDomainIs)); + value.setProperty(QLatin1String("localHostOrDomainIs"), engine->newFunction(LocalHostOrDomainIs)); + value.setProperty(QLatin1String("isResolvable"), engine->newFunction(IsResolvable)); + value.setProperty(QLatin1String("isInNet"), engine->newFunction(IsInNet)); + value.setProperty(QLatin1String("dnsResolve"), engine->newFunction(DNSResolve)); + value.setProperty(QLatin1String("myIpAddress"), engine->newFunction(MyIpAddress)); + value.setProperty(QLatin1String("dnsDomainLevels"), engine->newFunction(DNSDomainLevels)); + value.setProperty(QLatin1String("shExpMatch"), engine->newFunction(ShExpMatch)); + value.setProperty(QLatin1String("weekdayRange"), engine->newFunction(WeekdayRange)); + value.setProperty(QLatin1String("dateRange"), engine->newFunction(DateRange)); + value.setProperty(QLatin1String("timeRange"), engine->newFunction(TimeRange)); // Microsoft's IPv6 PAC Extensions... - value.setProperty(QL1S("isResolvableEx"), engine->newFunction(IsResolvableEx)); - value.setProperty(QL1S("isInNetEx"), engine->newFunction(IsInNetEx)); - value.setProperty(QL1S("dnsResolveEx"), engine->newFunction(DNSResolveEx)); - value.setProperty(QL1S("myIpAddressEx"), engine->newFunction(MyIpAddressEx)); - value.setProperty(QL1S("sortIpAddressList"), engine->newFunction(SortIpAddressList)); - value.setProperty(QL1S("getClientVersion"), engine->newFunction(GetClientVersion)); + value.setProperty(QLatin1String("isResolvableEx"), engine->newFunction(IsResolvableEx)); + value.setProperty(QLatin1String("isInNetEx"), engine->newFunction(IsInNetEx)); + value.setProperty(QLatin1String("dnsResolveEx"), engine->newFunction(DNSResolveEx)); + value.setProperty(QLatin1String("myIpAddressEx"), engine->newFunction(MyIpAddressEx)); + value.setProperty(QLatin1String("sortIpAddressList"), engine->newFunction(SortIpAddressList)); + value.setProperty(QLatin1String("getClientVersion"), engine->newFunction(GetClientVersion)); } } @@ -744,10 +740,10 @@ namespace KPAC QString Script::evaluate(const KUrl& url) { - QScriptValue func = m_engine->globalObject().property(QL1S("FindProxyForURL")); + QScriptValue func = m_engine->globalObject().property(QLatin1String("FindProxyForURL")); if (!func.isValid()) { - func = m_engine->globalObject().property(QL1S("FindProxyForURLEx")); + func = m_engine->globalObject().property(QLatin1String("FindProxyForURLEx")); if (!func.isValid()) { throw Error(i18n("Could not find 'FindProxyForURL' or 'FindProxyForURLEx'")); return QString();