Commit ef3196f9 authored by Alex Richardson's avatar Alex Richardson

Compile using c++11

parent 4d83b71a
......@@ -25,6 +25,10 @@ find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs
KTextWidgets XmlGui KDBusAddons KCrash KArchive ItemModels KJobWidgets Solid KWallet KJS
)
if( UNIX )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
endif()
# needed for set_package_properties macro
find_package(LibAttica REQUIRED NO_MODULE ) #somehow this is not searched for
find_package(KDELibs4 REQUIRED NO_MODULE) #needed for KDE4Support
......
......@@ -20,7 +20,6 @@
#include <QtTest/QTest>
#include <QtGlobal>
#include <KGlobal>
#include <KLocale>
#include <limits>
#include <bytearraymodel.h>
......@@ -500,52 +499,52 @@ void PrimitiveDataInformationTest::testGetAndSetValue()
QCOMPARE(clone->value(), expected);
}
template<typename s, typename u>
template<typename signedType, typename unsignedType>
void PrimitiveDataInformationTest::addRowsGetAndSetSigned(PrimitiveDataTypeEnum type, const char* name)
{
QString msg = QString::fromUtf8(name);
QTest::newRow(msg.arg(QStringLiteral("-325")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(-325) << AllPrimitiveTypes(s(-325));
<< basic[type] << AllPrimitiveTypes(-325) << AllPrimitiveTypes(signedType(-325));
QTest::newRow(msg.arg(QStringLiteral("0")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(0) << AllPrimitiveTypes(s(0));
<< basic[type] << AllPrimitiveTypes(0) << AllPrimitiveTypes(signedType(0));
QTest::newRow(msg.arg(QStringLiteral("-1")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(-1) << AllPrimitiveTypes(s(-1));
<< basic[type] << AllPrimitiveTypes(-1) << AllPrimitiveTypes(signedType(-1));
QTest::newRow(msg.arg(QStringLiteral("357891")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(357891) << AllPrimitiveTypes(s(357891));
<< basic[type] << AllPrimitiveTypes(357891) << AllPrimitiveTypes(signedType(357891));
QTest::newRow(msg.arg(QStringLiteral("max")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(std::numeric_limits<s>::max())
<< AllPrimitiveTypes(s(std::numeric_limits<s>::max()));
<< basic[type] << AllPrimitiveTypes(std::numeric_limits<signedType>::max())
<< AllPrimitiveTypes(signedType(std::numeric_limits<signedType>::max()));
QTest::newRow(msg.arg(QStringLiteral("min")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(std::numeric_limits<s>::min())
<< AllPrimitiveTypes(s(std::numeric_limits<s>::min()));
<< basic[type] << AllPrimitiveTypes(std::numeric_limits<signedType>::min())
<< AllPrimitiveTypes(signedType(std::numeric_limits<signedType>::min()));
QTest::newRow(msg.arg(QStringLiteral("u_max")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(std::numeric_limits<u>::max())
<< AllPrimitiveTypes(s(std::numeric_limits<u>::max()));
<< basic[type] << AllPrimitiveTypes(std::numeric_limits<unsignedType>::max())
<< AllPrimitiveTypes(signedType(std::numeric_limits<unsignedType>::max()));
QTest::newRow(msg.arg(QStringLiteral("u_min")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(std::numeric_limits<u>::min())
<< AllPrimitiveTypes(s(std::numeric_limits<u>::min()));
<< basic[type] << AllPrimitiveTypes(std::numeric_limits<unsignedType>::min())
<< AllPrimitiveTypes(signedType(std::numeric_limits<unsignedType>::min()));
}
template<typename s>
template<typename signedType>
void PrimitiveDataInformationTest::addRowsGetAndSetUnsigned(PrimitiveDataTypeEnum type, const char* name)
{
QString msg = QString::fromUtf8(name);
QTest::newRow(msg.arg(QStringLiteral("-325")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(-325) << AllPrimitiveTypes(s(-325));
<< basic[type] << AllPrimitiveTypes(-325) << AllPrimitiveTypes(signedType(-325));
QTest::newRow(msg.arg(QStringLiteral("0")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(0) << AllPrimitiveTypes(s(0));
<< basic[type] << AllPrimitiveTypes(0) << AllPrimitiveTypes(signedType(0));
QTest::newRow(msg.arg(QStringLiteral("-1")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(-1) << AllPrimitiveTypes(s(-1));
<< basic[type] << AllPrimitiveTypes(-1) << AllPrimitiveTypes(signedType(-1));
QTest::newRow(msg.arg(QStringLiteral("357891")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(357891) << AllPrimitiveTypes(s(357891));
<< basic[type] << AllPrimitiveTypes(357891) << AllPrimitiveTypes(signedType(357891));
QTest::newRow(msg.arg(QStringLiteral("max")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(std::numeric_limits<s>::max())
<< AllPrimitiveTypes(s(std::numeric_limits<s>::max()));
<< basic[type] << AllPrimitiveTypes(std::numeric_limits<signedType>::max())
<< AllPrimitiveTypes(signedType(std::numeric_limits<signedType>::max()));
QTest::newRow(msg.arg(QStringLiteral("min")).toUtf8().constData())
<< basic[type] << AllPrimitiveTypes(std::numeric_limits<s>::min())
<< AllPrimitiveTypes(s(std::numeric_limits<s>::min()));
<< basic[type] << AllPrimitiveTypes(std::numeric_limits<signedType>::min())
<< AllPrimitiveTypes(signedType(std::numeric_limits<signedType>::min()));
}
void PrimitiveDataInformationTest::testGetAndSetValue_data()
......
......@@ -25,7 +25,7 @@
#include <KDebug>
#include <cstdio>
SafeReferenceHolder SafeReferenceHolder::instance = SafeReferenceHolder();
SafeReferenceHolder SafeReferenceHolder::instance;
void SafeReferenceHolder::invalidateAll(DataInformation* data)
{
......
......@@ -60,8 +60,6 @@ void ByteArrayRawFileSynchronizer::setDocument( ByteArrayDocument* document )
SLOT(onModelModified(bool)) );
}
void ByteArrayRawFileSynchronizer::startOffering( AbstractDocument* document ) { Q_UNUSED(document) }
AbstractLoadJob *ByteArrayRawFileSynchronizer::startLoad( const QUrl &url )
{
return new ByteArrayRawFileLoadJob( this, url );
......
......@@ -45,7 +45,7 @@ class OKTETAKASTENCORE_EXPORT ByteArrayRawFileSynchronizer : public AbstractMode
ByteArrayRawFileSynchronizer();
public: // AbstractModelSynchronizer API
virtual void startOffering( AbstractDocument* document ) Q_DECL_OVERRIDE;
virtual void startOffering( AbstractDocument* document ) Q_DECL_EQ_DELETE;
virtual AbstractLoadJob *startLoad( const QUrl &url ) Q_DECL_OVERRIDE;
virtual AbstractSyncToRemoteJob *startSyncToRemote() Q_DECL_OVERRIDE;
virtual AbstractSyncFromRemoteJob *startSyncFromRemote() Q_DECL_OVERRIDE;
......
Markdown is supported
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