generic: misc cleanups

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2016-04-16 13:56:36 +00:00
parent d5dc1bd28c
commit e53de3cbb8
13 changed files with 34 additions and 34 deletions

View file

@ -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()

View file

@ -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

View file

@ -39,7 +39,6 @@
#include <kdebug.h>
#include "kguiitem.h"
#include "kicon.h"
//---------------------------------------------------------------------

View file

@ -27,7 +27,6 @@
#define KACTION_H
#include <kdeui_export.h>
#include <kguiitem.h>
#include <kshortcut.h>
#include <QtGui/QWidgetAction>

View file

@ -22,6 +22,7 @@
#include "kglobalaccel.h"
#include "kgesturemap.h"
#include <kcomponentdata.h>
#include <kicon.h>
class KAction;

View file

@ -22,6 +22,7 @@
#include <kdeui_export.h>
#include <kaction.h>
#include <kguiitem.h>
class KDualActionPrivate;

View file

@ -41,6 +41,7 @@
#include <kicon.h>
#include <klocale.h>
#include <kdebug.h>
#include <kglobal.h>
#include "kcombobox.h"
#include "kmenu.h"

View file

@ -29,6 +29,8 @@
#include <kdebug.h>
#include <kstringhandler.h>
#include <klocale.h>
#include <kicon.h>
#include <kglobal.h>
#include <QtGui/qtreewidget.h>

View file

@ -24,6 +24,7 @@
#include "kdeui_export.h"
#include "kaction.h"
#include "kglobal.h"
#include "kglobalshortcutinfo.h"
class QWidget;

View file

@ -35,6 +35,7 @@
#include <kiconloader.h>
#include <kdebug.h>
#include <kcomponentdata.h>
#include <kicon.h>
#include <QtXml/qdom.h>
#include <QtGui/QMenuBar>

View file

@ -39,6 +39,7 @@
#include <kio/accessmanager.h>
#include <kstringhandler.h>
#include <kdebug.h>
#include <kicon.h>
#include <QLabel>
#include <QNetworkRequest>

View file

@ -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;

View file

@ -25,11 +25,9 @@
#include <QtCore/QDateTime>
#include <QtCore/QTimer>
#include <QtCore/QEventLoop>
#include <QtNetwork/QHostInfo>
#include <QtNetwork/QHostAddress>
#include <QtNetwork/QNetworkInterface>
#include <QtScript/QScriptValue>
#include <QtScript/QScriptEngine>
#include <QtScript/QScriptProgram>
@ -39,8 +37,6 @@
#include <klocalizedstring.h>
#include <kio/hostinfo_p.h>
#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();