Commit 74ef3b27 authored by Alex Richardson's avatar Alex Richardson

adapt to latest kdelibs changes

parent 4313b957
......@@ -20,9 +20,10 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) #allow deprecated functions fo
find_package(kdeqt5staging REQUIRED NO_MODULE)
# Load CMake, Compiler and InstallDirs settings from KF5 and the following are already somewhat "done" tier1/tier2 libs from kdelibs:
find_package(KF5 MODULE REQUIRED COMPONENTS CMake Compiler InstallDirs
KWidgetsAddons KCoreAddons KConfig KI18n KGuiAddons KService ItemViews KConfigWidgets
KWindowSystem KNotifications KAuth KCodecs KWidgets KIconThemes Sonnet KCompletion
KWidgetsAddons KCoreAddons KConfig KI18n KGuiAddons KDBusAddons KService ItemViews KAuth KConfigWidgets
KWindowSystem KNotifications KCodecs KWidgets KIconThemes Sonnet KCompletion
KTextWidgets XmlGui KDBusAddons KCrash KArchive ItemModels KJobWidgets Solid KWallet KJS
KIO KUnitConversion KDE4Attic
)
if( UNIX )
......@@ -33,16 +34,19 @@ endif()
find_package(LibAttica REQUIRED NO_MODULE ) #somehow this is not searched for
find_package(KDELibs4 REQUIRED NO_MODULE) #needed for KDE4Support
find_package(KDE4Support REQUIRED NO_MODULE)
find_package(KDE4Attic REQUIRED NO_MODULE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON) #this is needed since it is apparently not set by Qt5Config.cmake
SET( CMAKE_INCLUDE_CURRENT_DIR ON )
set( CMAKE_INCLUDE_CURRENT_DIR ON )
set( CMAKE_AUTOMOC TRUE )
include_directories( ${KDE4_INCLUDES} )
macro_optional_find_package( QCA2 )
macro_log_feature( QCA2_FOUND "QCA2" "Qt Cryptographic Architecture" "http://delta.affinix.com/qca" FALSE "2.0.0" "Needed for most of the algorithms of the checksum tool." )
include(FeatureSummary)
find_package(QCA2)
set_package_properties(QCA2 PROPERTIES DESCRIPTION "Qt Cryptographic Architecture"
URL "http://delta.affinix.com/qca" TYPE OPTIONAL
PURPOSE "Needed for most of the algorithms of the checksum tool")
# control build scope
# TODO: examples and templates not internal need headers and libs as installed
......@@ -120,4 +124,4 @@ if (QT_QTDECLARATIVE_FOUND AND OKTETA_MOBILE_UI)
macro_optional_add_subdirectory(mobile)
endif (QT_QTDECLARATIVE_FOUND AND OKTETA_MOBILE_UI)
macro_display_feature_log()
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -120,7 +120,7 @@ set_target_properties(oktetacore_objs PROPERTIES POSITION_INDEPENDENT_CODE ON)
set( oktetacore_LIB_OBJS $<TARGET_OBJECTS:oktetacore_objs>)
kde4_add_library( ${oktetacore_LIB} SHARED ${oktetacore_LIB_OBJS} )
target_link_libraries( ${oktetacore_LIB} LINK_PUBLIC ${KDE4_KDECORE_LIBS} )
target_link_libraries( ${oktetacore_LIB} LINK_PUBLIC ${KDE4_KDECORE_LIBS} ${KDE4Attic_LIBRARIES} )
set_target_properties( ${oktetacore_LIB} PROPERTIES
OUTPUT_NAME ${oktetacore_LIB_NAME}
......
......@@ -14,7 +14,6 @@ set( oktetacoretestutil_LIB_SRCS
kde4_add_library( oktetacoretestutil STATIC ${oktetacoretestutil_LIB_SRCS} )
########### arraychangemetricstest ###############
set( arraychangemetricstest_SRCS
......@@ -154,7 +153,7 @@ set( charcodectest_SRCS
kde4_add_unit_test( charcodectest TESTNAME libokteta-core-charcodectest ${charcodectest_SRCS})
target_link_libraries( charcodectest
testoktetacore ${KDE4_KDECORE_LIBS} Qt5::Test
testoktetacore ${KDE4_KDECORE_LIBS} Qt5::Test ${KDE4Attic_LIBRARIES}
)
......@@ -166,7 +165,7 @@ set( textcharcodectest_SRCS
kde4_add_unit_test( textcharcodectest TESTNAME libokteta-core-textcharcodectest ${textcharcodectest_SRCS} )
target_link_libraries( textcharcodectest
testoktetacore ${KDE4_KDECORE_LIBS} Qt5::Test
testoktetacore ${KDE4_KDECORE_LIBS} Qt5::Test ${KDE4Attic_LIBRARIES}
)
......@@ -179,7 +178,7 @@ set( textcharcodeccharcodeciftest_SRCS
kde4_add_unit_test( textcharcodeccharcodeciftest TESTNAME libokteta-core-textcharcodeccharcodeciftest ${textcharcodeccharcodeciftest_SRCS} )
target_link_libraries( textcharcodeccharcodeciftest
testoktetacore ${KDE4_KDECORE_LIBS} Qt5::Test
testoktetacore ${KDE4_KDECORE_LIBS} Qt5::Test ${KDE4Attic_LIBRARIES}
)
......
......@@ -57,6 +57,7 @@ target_link_libraries( bytearrayrawfilesynchronizertest
oktetacoretestutil
testoktetacore
${KDE4_KIO_LIBS}
${KDE4Attic_LIBRARIES}
Qt5::Test
)
......
......@@ -26,8 +26,8 @@
#include <valuecodec.h>
// KDE
#include <KLocalizedString>
#include <KDebug>
// Qt
#include <QDebug>
#include <QtCore/QString>
#include <QtCore/QRegExp>
#include <QtScript/QScriptEngine>
......@@ -118,12 +118,11 @@ Address AddressValidator::toAddress( const QString& string, AddressType* address
QScriptEngine evaluator;
QScriptValue value = evaluator.evaluate( expression );
address = value.toInt32();
kDebug() << "expression " << expression << " evaluated to: " << address;
qDebug() << "expression " << expression << " evaluated to: " << address;
if( evaluator.hasUncaughtException() )
{
kWarning() << "evaluation error: "
<< evaluator.uncaughtExceptionBacktrace();
qWarning() << "evaluation error: " << evaluator.uncaughtExceptionBacktrace();
if( addressType )
*addressType = InvalidAddressType;
}
......
......@@ -35,8 +35,8 @@
#include <QtCore/QFileInfo>
#include <QtCore/QDir>
#include <QtCore/QUuid>
#include <QDebug>
#include <KDebug>
namespace Kasten2
{
......@@ -149,7 +149,7 @@ ByteArrayViewProfileManager::ByteArrayViewProfileManager()
const QString viewProfileFolderPath = dataFolderPath + viewProfileDirSubPath;
// watch folder for changes
mViewProfileFileWatcher->addDir( viewProfileFolderPath, KDirWatch::WatchDirOnly );
kDebug() << "adding Dir" << viewProfileFolderPath;
qDebug() << "adding Dir" << viewProfileFolderPath;
// read current files
onViewProfilesFolderChanged( viewProfileFolderPath );
......@@ -264,7 +264,7 @@ void ByteArrayViewProfileManager::saveViewProfiles( QList<ByteArrayViewProfile>&
if( needsId )
viewProfile.setId( QUuid::createUuid().toString() );
kDebug() << "going to save"<<viewProfile.viewProfileTitle()<<viewProfile.id()<<oldViewProfileId;
qDebug() << "going to save"<<viewProfile.viewProfileTitle()<<viewProfile.id()<<oldViewProfileId;
saveViewProfile( viewProfile );
}
}
......@@ -332,7 +332,7 @@ ByteArrayViewProfileManager::lockViewProfile( const Kasten::ByteArrayViewProfile
ByteArrayViewProfile
ByteArrayViewProfileManager::loadViewProfile( const QString& absoluteFilePath ) const
{
kDebug() << "Loading" << QFileInfo(absoluteFilePath).baseName() << absoluteFilePath;
qDebug() << "Loading" << QFileInfo(absoluteFilePath).baseName() << absoluteFilePath;
ByteArrayViewProfile result;
KConfig configFile( absoluteFilePath, KConfig::SimpleConfig );
......@@ -342,7 +342,7 @@ kDebug() << "Loading" << QFileInfo(absoluteFilePath).baseName() << absoluteFileP
const QString formatVersion = formatConfigGroup.readEntry( "Version" );
if( ! formatVersion.startsWith(QStringLiteral( "1." )) )
{
kDebug() << "ViewProfile file has an unsupported version:" << formatVersion;
qDebug() << "ViewProfile file has an unsupported version:" << formatVersion;
return result;
}
......@@ -379,7 +379,7 @@ kDebug() << "ViewProfile file has an unsupported version:" << formatVersion;
void
ByteArrayViewProfileManager::saveViewProfile( const ByteArrayViewProfile& viewProfile ) const
{
kDebug() << "------------------ Saving"<<viewProfile.id();
qDebug() << "------------------ Saving"<<viewProfile.id();
{
const QString fileName = viewProfileFilePath( viewProfile.id() );
KConfig configFile( fileName, KConfig::SimpleConfig );
......@@ -412,14 +412,14 @@ kDebug() << "------------------ Saving"<<viewProfile.id();
charsConfigGroup.writeEntry( "SubstituteChar", QString(viewProfile.substituteChar()) );
charsConfigGroup.writeEntry( "UndefinedChar", QString(viewProfile.undefinedChar()) );
}
kDebug() << "------------------ Saved"<<viewProfile.id();
qDebug() << "------------------ Saved"<<viewProfile.id();
}
void
ByteArrayViewProfileManager::removeViewProfile( const ByteArrayViewProfile::Id& viewProfileId )
{
const QString filePath = filePathOfViewProfile( viewProfileId );
kDebug() << "------------------ Removing"<<viewProfileId<<filePath;
qDebug() << "------------------ Removing"<<viewProfileId<<filePath;
if( ! filePath.isEmpty() )
QFile::remove( filePath );
}
......@@ -453,7 +453,7 @@ ByteArrayViewProfileManager::filePathOfViewProfile( const ByteArrayViewProfile::
void
ByteArrayViewProfileManager::onViewProfilesFolderChanged( const QString& viewProfileFolderPath )
{
kDebug() << "looking into folder"<< viewProfileFolderPath;
qDebug() << "looking into folder"<< viewProfileFolderPath;
ByteArrayViewProfileFileInfoLookup& viewProfileFileInfoLookup =
mViewProfileFileInfoLookupPerFolder[viewProfileFolderPath];
......@@ -465,8 +465,8 @@ kDebug() << "looking into folder"<< viewProfileFolderPath;
QList<ByteArrayViewProfile::Id> newUnlockedViewProfileIds = lockedViewProfileIds(viewProfileFileInfoLookup);
QList<ByteArrayViewProfile::Id> newLockedViewProfileIds;
kDebug() << "old profiles:" << removedViewProfileIds;
kDebug() << "locked profiles:" << newUnlockedViewProfileIds;
qDebug() << "old profiles:" << removedViewProfileIds;
qDebug() << "locked profiles:" << newUnlockedViewProfileIds;
// iterate all files in folder
const QFileInfoList viewProfileFileInfoList =
QDir( viewProfileFolderPath ).entryInfoList( viewProfileFileNameFilter, QDir::Files );
......@@ -489,7 +489,7 @@ kDebug() << "locked profiles:" << newUnlockedViewProfileIds;
// all other files assumed to be viewProfile files
const ByteArrayViewProfile::Id viewProfileId = viewProfileFileInfo.baseName();
kDebug() <<"going to load"<<viewProfileId;
qDebug() <<"going to load"<<viewProfileId;
// load file
const ByteArrayViewProfile viewProfile = loadViewProfile( viewProfileFileInfo.absoluteFilePath() );
// loading failed? Treat as not existing
......@@ -566,22 +566,22 @@ kDebug() <<"going to load"<<viewProfileId;
// update lock info
updateLockStatus( viewProfileFileInfoLookup, newLockedViewProfileIds, newUnlockedViewProfileIds );
kDebug() << "new profiles:" << viewProfileFileInfoLookup.keys();
qDebug() << "new profiles:" << viewProfileFileInfoLookup.keys();
// signal changes
if( ! changedViewProfiles.isEmpty() )
emit viewProfilesChanged( changedViewProfiles );
kDebug() << "changed profiles" << viewProfileIds(changedViewProfiles);
qDebug() << "changed profiles" << viewProfileIds(changedViewProfiles);
if( ! removedViewProfileIds.isEmpty() )
emit viewProfilesRemoved( removedViewProfileIds );
kDebug() << "removed profiles" << removedViewProfileIds;
qDebug() << "removed profiles" << removedViewProfileIds;
if( ! newUnlockedViewProfileIds.isEmpty() )
emit viewProfilesUnlocked( newUnlockedViewProfileIds );
kDebug() << "unlocked profiles" << newUnlockedViewProfileIds;
qDebug() << "unlocked profiles" << newUnlockedViewProfileIds;
if( ! newLockedViewProfileIds.isEmpty() )
emit viewProfilesLocked( newLockedViewProfileIds );
kDebug() << "locked profiles" << newLockedViewProfileIds;
qDebug() << "locked profiles" << newLockedViewProfileIds;
if( isDefaultViewProfileChanged )
emit defaultViewProfileChanged( mDefaultViewProfileId );
}
......@@ -595,7 +595,7 @@ void ByteArrayViewProfileManager::onDefaultViewProfileChanged( const QString& pa
const QString viewProfileId = QString::fromUtf8( fileContent );
defaultViewProfileFile.close();
kDebug() << "Default viewprofile read:" << viewProfileId;
qDebug() << "Default viewprofile read:" << viewProfileId;
// no id set?
if( viewProfileId.isEmpty() )
......
......@@ -26,7 +26,7 @@
#include <KDirWatch>
#include <Solid/Networking>
#include <KDebug>
#include <QDebug>
namespace Kasten2
{
......@@ -94,34 +94,34 @@ void AbstractModelFileSystemSynchronizerPrivate::stopNetworkWatching()
void AbstractModelFileSystemSynchronizerPrivate::onFileDirty( const QString& fileName )
{
Q_UNUSED( fileName )
kDebug()<<fileName;
qDebug() << fileName;
setRemoteState( RemoteHasChanges );
}
void AbstractModelFileSystemSynchronizerPrivate::onFileCreated( const QString& fileName )
{
Q_UNUSED( fileName )
kDebug()<<fileName;
//TODO: could happen after a delete, what to do?
qDebug() << fileName;
//TODO: could happen after a delete, what to do?
setRemoteState( RemoteHasChanges );
}
void AbstractModelFileSystemSynchronizerPrivate::onFileDeleted( const QString& fileName )
{
Q_UNUSED( fileName )
kDebug()<<fileName;
qDebug() << fileName;
setRemoteState( RemoteDeleted );
}
void AbstractModelFileSystemSynchronizerPrivate::onNetworkConnect()
{
kDebug();
qDebug();
setRemoteState( RemoteUnknown );
}
void AbstractModelFileSystemSynchronizerPrivate::onNetworkDisconnect()
{
kDebug();
qDebug();
setRemoteState( RemoteUnreachable );
}
......
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