Commit 8530a21f authored by Luca Giambonini's avatar Luca Giambonini

port akabei core to Qt5:

- fromAscii -> fromLatin1
- toAscii -> toLatin1
- qInstallMsgHandler -> qInstallMessageHandler
- QWeakPointer -> QPointer
- <funcitonname>.moc -> mov_<functionname>.cpp
parent f17f3f8f
......@@ -8,25 +8,23 @@ if (CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS_DEBUG "-ggdb")
endif(CMAKE_COMPILER_IS_GNUCC)
# https://cmake.org/cmake/help/v3.0/policy/CMP0003.html
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
#set(CMAKE_CXX_FLAGS "-fPIC")
set(MAJOR_AKABEI_VERSION 0 CACHE INT "Akabei’s major version number" FORCE)
set(MINOR_AKABEI_VERSION 0 CACHE INT "Akabei’s minor version number" FORCE)
set(PATCH_AKABEI_VERSION 1 CACHE INT "Akabei’s patch version number" FORCE)
set(FIX_AKABEI_VERSION 0 CACHE INT "Akabei’s fix version number" FORCE)
set(AKABEI_VERSION_STRING "${MAJOR_AKABEI_VERSION}.${MINOR_AKABEI_VERSION}.${PATCH_AKABEI_VERSION}.${FIX_AKABEI_VERSION}")
# requires minimal Qt 4.4
set(QT_MIN_VERSION "4.4.0")
find_package(Qt4 REQUIRED)
find_package(Qt5 5.2.0 REQUIRED CONFIG COMPONENTS Test Network Xml Concurrent DBus Widgets Gui)
find_package(LibArchive REQUIRED)
find_package(Sqlite REQUIRED)
find_package(PolkitQt-1 REQUIRED)
INCLUDE(${QT_USE_FILE})
find_package(PolkitQt5-1 REQUIRED)
add_definitions(${QT_DEFINITIONS} -W -Wall)
add_definitions(-Werror)
......
......@@ -88,26 +88,19 @@ operations/akabeiplainhookoperation.h
operations/akabeioperationutils.h
)
qt4_automoc(${AKABEI_CORE_SRCS})
qt4_automoc(${AKABEI_OPERATION_SRCS})
# There are some files which are not detected by automoc, add them
qt4_wrap_cpp(AKABEI_MISSING_MOCS
akabeibackend_p.h
akabeihelpers_p.h
operations/akabeiplainscriptletoperation_p.h
)
add_library(akabeicore SHARED ${AKABEI_CORE_SRCS} ${AKABEI_OPERATION_SRCS} ${AKABEI_MISSING_MOCS})
set_target_properties(akabeicore PROPERTIES AUTOMOC TRUE)
set_target_properties(akabeicore PROPERTIES VERSION ${MAJOR_AKABEI_VERSION}.${MINOR_AKABEI_VERSION}.${PATCH_AKABEI_VERSION}
SOVERSION ${MAJOR_AKABEI_VERSION})
target_link_libraries(akabeicore
${QT_QTCORE_LIBRARY}
${LIBARCHIVE_LIBRARY}
${SQLITE_LIBRARIES}
${QT_QTDBUS_LIBRARY}
${POLKITQT-1_LIBRARIES})
target_link_libraries(akabeicore Qt5::Core
Qt5::DBus
Qt5::Concurrent
${LIBARCHIVE_LIBRARY}
${SQLITE_LIBRARIES}
${POLKITQT-1_LIBRARIES})
install(TARGETS akabeicore DESTINATION ${LIB_INSTALL_DIR})
install(FILES ${AKABEI_CORE_HDRS} DESTINATION ${INCLUDES_INSTALL_DIR})
......
......@@ -219,7 +219,7 @@ SQLiteConnection::Row SQLiteConnection::Private::getRowFromStatement(sqlite3_stm
switch (sqlite3_column_type(statement, i)) {
case SQLITE_TEXT:
ptr = sqlite3_column_text(statement, i);
record.setValue(QString::fromAscii(reinterpret_cast<const char *>(ptr)));
record.setValue(QString::fromLatin1(reinterpret_cast<const char *>(ptr)));
break;
case SQLITE_INTEGER:
......
......@@ -532,7 +532,7 @@ Backend::Backend(QObject* parent)
qRegisterMetaType< Akabei::Backend::Status >();
qDBusRegisterMetaType< QList< QVariantMap > >();
qInstallMsgHandler(akabeiDebug);
qInstallMessageHandler(akabeiDebug);
// We need at least 2 threads in QThreadPool to make everything work correctly.
if (QThreadPool::globalInstance()->maxThreadCount() < 2) {
......@@ -1003,4 +1003,4 @@ Hook* Backend::loadHookFromFile(const QString& path, QList<Package*> pkgs)
}
#include "akabeibackend.moc"
#include "moc_akabeibackend.cpp"
......@@ -15,34 +15,26 @@ QDebug akabeiDebug()
return qDebug();
}
void akabeiDebug(QtMsgType type, const char *msg)
{
void akabeiDebug(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
Q_UNUSED(context);
QTextStream out( stdout );
QTextStream err( stderr );
if (Akabei::Config::instance()->debug()) { /* only prints if the "--debug" option is set */
switch (type) {
case QtDebugMsg: {
case QtDebugMsg:
out << "Akabei - Debug: " << msg << endl;
break;
}
case QtWarningMsg: {
case QtWarningMsg:
err << "Akabei - Warning: " << msg << endl;
break;
}
case QtCriticalMsg: {
case QtCriticalMsg:
err << "Akabei - Critical: " << msg << endl;
break;
}
case QtFatalMsg: {
case QtFatalMsg:
err << "Akabei - Fatal: " << msg << endl;
break;
}
default:
break;
}
......
......@@ -11,12 +11,13 @@
#define AKABEIDEBUG_H
#include <QDebug>
#include <QMessageLogContext>
#include <akabeicore_global.h>
/**
* Akabei Qt message handler (for qDebug(), qWarning(), ...)
*/
void akabeiDebug(QtMsgType, const char *);
void akabeiDebug(QtMsgType, const QMessageLogContext &, const QString &);
/*
* This is a workaround to avoid changing all the akabeiDebug() calls back into qDebug() calls
......
......@@ -158,7 +158,7 @@ int compare_versions(QString const& a, QString const& b)
if (!conversion1 || !conversion2) {
for (int i = 0; i != i1->length(); ++i) {
if (i2->length() > i && i1->at(i) != i2->at(i))
return i1->at(i).toAscii() > i2->at(i).toAscii() ? 1 : -1;
return i1->at(i).toLatin1() > i2->at(i).toLatin1() ? 1 : -1;
p1 = i1->mid(i + 1).toInt(&conversion1);
p2 = i2->mid(i + 1).toInt(&conversion2);
......@@ -918,9 +918,9 @@ int QueryPerformer::insertDelta(AbstractSQLiteConnection& dbConnection, Akabei::
try {
dbConnection.bind(":Package", packageId);
dbConnection.bind(":Filename", delta->filename());
dbConnection.bind(":VersionFrom", QString::fromAscii(delta->versionFrom()));
dbConnection.bind(":VersionTo", QString::fromAscii(delta->versionTo()));
dbConnection.bind(":MD5SUM", QString::fromAscii(delta->md5sum()));
dbConnection.bind(":VersionFrom", QString::fromLatin1(delta->versionFrom()));
dbConnection.bind(":VersionTo", QString::fromLatin1(delta->versionTo()));
dbConnection.bind(":MD5SUM", QString::fromLatin1(delta->md5sum()));
dbConnection.query(QString("INSERT INTO deltas (`package`, `filename`, `versionfrom`, `versionto`, `md5sum`) "
"VALUES (:Package, :Filename, :VersionFrom, :VersionTo, :MD5SUM);"));
} catch (SQLiteException& ex) {
......@@ -1264,5 +1264,4 @@ int QueryPerformer::removeScriptlet(AbstractSQLiteConnection &dbConnection, int
}
}
#include "akabeihelpers.moc"
#include "moc_akabeihelpers.cpp"
......@@ -36,7 +36,7 @@ enum Permission {
WritePermission = 0x02,
ReadWritePermission = 0x03
};
Q_DECLARE_FLAGS(Permissions, Permission);
Q_DECLARE_FLAGS(Permissions, Permission)
QByteArray md5sum(const QByteArray &data);
QByteArray md5sumOfFile(const QString &path);
QByteArray processMd5(unsigned char output[]);
......
......@@ -194,7 +194,7 @@ AkabeiLogLine& AkabeiLogLine::operator<<(bool b)
AkabeiLogLine& AkabeiLogLine::operator<<(char ch)
{
d->data.append( QChar::fromAscii(ch) );
d->data.append( QChar(ch).toLatin1() );
return *this;
}
......
......@@ -331,4 +331,4 @@ void Operation::setEta(int eta)
}
#include "akabeioperation.moc"
#include "moc_akabeioperation.cpp"
......@@ -13,11 +13,11 @@
#include <akabeioperation.h>
#include <QWeakPointer>
#include <QHash>
#include <QMetaObject>
#include <QUuid>
#include <QStringList>
#include <QPointer>
class QEventLoop;
namespace Akabei {
......@@ -59,8 +59,8 @@ public:
Operation::List preOps;
Operation::List postOps;
QWeakPointer<QEventLoop> validateLoop;
QWeakPointer<QEventLoop> runLoop;
QPointer<QEventLoop> validateLoop;
QPointer<QEventLoop> runLoop;
OperationRunner *runner;
......
......@@ -293,4 +293,4 @@ void OperationRunner::cancel()
}
#include "akabeioperationrunner.moc"
#include "moc_akabeioperationrunner.cpp"
......@@ -14,7 +14,7 @@
#include <akabeioperationrunner.h>
#include <QHash>
#include <QWeakPointer>
#include <QPointer>
#include <QMetaType>
#include <QTime>
#include <QMutex>
......@@ -40,8 +40,8 @@ public:
Operation::Phase phase;
QWeakPointer<ValidatorRunnable> valThread;
QWeakPointer<RunnerRunnable> runThread;
QPointer<ValidatorRunnable> valThread;
QPointer<RunnerRunnable> runThread;
Error::List errors;
......
......@@ -20,7 +20,7 @@
#include <QTimer>
#include <QCoreApplication>
static QWeakPointer<QFutureWatcher< void > > s_runFutureWatcher;
static QPointer<QFutureWatcher< void > > s_runFutureWatcher;
static Akabei::ProcessingOptions s_options;
namespace Akabei
......@@ -250,4 +250,4 @@ RunnerWorker * RunnerRunnable::worker()
}
#include "akabeirunnerrunnable_p.moc"
#include "moc_akabeirunnerrunnable_p.cpp"
......@@ -13,7 +13,7 @@
#include <QThread>
#include <QHash>
#include <QWeakPointer>
#include <QPointer>
#include <akabeierror.h>
#include <akabeioperation.h>
......
......@@ -33,7 +33,7 @@
manageErrors(errors); \
return; }
static QWeakPointer<QFutureWatcher< void > > s_validateFutureWatcher;
static QPointer<QFutureWatcher< void > > s_validateFutureWatcher;
static Akabei::ProcessingOptions s_options;//FIXME: I think we can put all processingoptions into operations only!
namespace Akabei {
......@@ -475,4 +475,4 @@ void ValidatorRunnable::run()
}
#include <akabeivalidatorrunnable_p.moc>
#include <moc_akabeivalidatorrunnable_p.cpp>
......@@ -7,8 +7,11 @@ set(DATABASE_BENCHMARK_SRCS
databasebenchmark.cpp
)
qt4_wrap_cpp(DATABASE_BENCHMARK_MOC_SRCS
qt5_wrap_cpp(DATABASE_BENCHMARK_MOC_SRCS
databasebenchmark.h)
add_executable(databasebenchmark ${DATABASE_BENCHMARK_SRCS} ${DATABASE_BENCHMARK_MOC_SRCS})
target_link_libraries(databasebenchmark akabeicore ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
target_link_libraries(databasebenchmark akabeicore
Qt5::Core
Qt5::Test
Qt5::Gui)
......@@ -30,7 +30,7 @@ ArchiveEntry::ArchiveEntry(archive_entry *e)
throw ArchiveException("archive_entry_new() failed");
}
fileName = QString::fromAscii(archive_entry_pathname(entry));
fileName = QString::fromLatin1(archive_entry_pathname(entry));
fileSize = archive_entry_size(entry);
fileMode = archive_entry_mode(entry);
}
......@@ -107,7 +107,7 @@ ArchiveHandler::ArchiveHandler(const QString &path)
*/
archive_entry *e;
while (archive_read_next_header(archive, &e) == ARCHIVE_OK) {
entries[QString::fromAscii(archive_entry_pathname(e))] = new ArchiveEntry( e );
entries[QString::fromLatin1(archive_entry_pathname(e))] = new ArchiveEntry( e );
archive_read_data_skip(archive);
}
......@@ -590,7 +590,7 @@ bool ReinstallUpgradeFunctor::operator()(const ArchiveEntry& currentEntry)
if (backupFiles.contains(path) && !backupFiles[path].isEmpty()) {
//Get two of the 3 possible md5sums
QByteArray originalMD5Sum = backupFiles[path].toAscii();
QByteArray originalMD5Sum = backupFiles[path].toLatin1();
QByteArray onDiskMd5Sum = Akabei::Helpers::md5sumOfFile(path);
//First extract the new file then check the md5sum
......
......@@ -279,6 +279,3 @@ Akabei::Error::List PolKitArchiveHandler::errors()
errs << d->handler->errors();
return errs;
}
#include "polkitarchivehandler.moc"
......@@ -117,6 +117,6 @@ private:
Private *d;
};
Q_DECLARE_METATYPE(QList<QByteArray>);
Q_DECLARE_METATYPE(QList<QByteArray>)
#endif
......@@ -144,4 +144,4 @@ void PlainHookOperation::validate()
}
}
#include "akabeiplainhookoperation.moc"
#include "moc_akabeiplainhookoperation.cpp"
......@@ -38,9 +38,9 @@ class AKABEICORESHARED_EXPORT PlainHookOperation : public Operation
friend class ChrootedProcess;
Q_PRIVATE_SLOT(d, void slotErrors(Akabei::Error::List));
Q_PRIVATE_SLOT(d, void slotFinished(bool));
Q_PRIVATE_SLOT(d, void slotMessage(QString));
Q_PRIVATE_SLOT(d, void slotErrors(Akabei::Error::List))
Q_PRIVATE_SLOT(d, void slotFinished(bool))
Q_PRIVATE_SLOT(d, void slotMessage(QString))
};
}
......
......@@ -158,4 +158,4 @@ void PlainScriptletOperation::slotMessage(const QString& mes)
}
#include "akabeiplainscriptletoperation.moc"
#include "moc_akabeiplainscriptletoperation.cpp"
......@@ -193,4 +193,4 @@ void PolkitInstallOperation::validate()
}
#include "akabeipolkitinstalloperation.moc"
#include "moc_akabeipolkitinstalloperation.cpp"
......@@ -237,6 +237,6 @@ void PolkitReInstallOperation::validate()
// Ok, validated!
setValidationFinished(true);
}
};
}
#include "akabeipolkitreinstalloperation.moc"
\ No newline at end of file
#include "moc_akabeipolkitreinstalloperation.cpp"
......@@ -213,4 +213,4 @@ void PolkitRemoveOperation::validate()
}
#include "akabeipolkitremoveoperation.moc"
#include "moc_akabeipolkitremoveoperation.cpp"
......@@ -272,4 +272,4 @@ void PolkitUpgradeOperation::validate()
}
#include "akabeipolkitupgradeoperation.moc"
#include "moc_akabeipolkitupgradeoperation.cpp"
......@@ -6,11 +6,13 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "^[Dd]ebug[Ff]ull$")
akabeitest.cpp
)
qt4_wrap_cpp(akabei_test_MOC_SRCS akabeitest.h)
qt5_wrap_cpp(akabei_test_MOC_SRCS akabeitest.h)
add_executable(akabei_test ${akabei_test_SRCS} ${akabei_test_MOC_SRCS})
target_link_libraries(akabei_test ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} akabeicore)
target_link_libraries(akabei_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei akabei_test)
......@@ -19,11 +21,13 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "^[Dd]ebug[Ff]ull$")
akabeihooktest.cpp
)
qt4_wrap_cpp(akabei_hook_test_MOC_SRCS akabeihooktest.h)
qt5_wrap_cpp(akabei_hook_test_MOC_SRCS akabeihooktest.h)
add_executable(akabei_hook_test ${akabei_hook_test_SRCS} ${akabei_hook_test_MOC_SRCS})
target_link_libraries(akabei_hook_test ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} akabeicore)
target_link_libraries(akabei_hook_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_hook_test akabei_hook_test)
......@@ -32,11 +36,13 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "^[Dd]ebug[Ff]ull$")
akabeigrouptest.cpp
)
qt4_wrap_cpp(akabei_group_test_MOC_SRCS akabeigrouptest.h)
qt5_wrap_cpp(akabei_group_test_MOC_SRCS akabeigrouptest.h)
add_executable(akabei_group_test ${akabei_group_test_SRCS} ${akabei_group_test_MOC_SRCS})
target_link_libraries(akabei_group_test ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} akabeicore)
target_link_libraries(akabei_group_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_group_test akabei_group_test)
......@@ -45,11 +51,13 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "^[Dd]ebug[Ff]ull$")
akabeierrortest.cpp
)
qt4_wrap_cpp(akabei_error_test_MOC_SRCS akabeierrortest.h)
qt5_wrap_cpp(akabei_error_test_MOC_SRCS akabeierrortest.h)
add_executable(akabei_error_test ${akabei_error_test_SRCS} ${akabei_error_test_MOC_SRCS})
target_link_libraries(akabei_error_test ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} akabeicore)
target_link_libraries(akabei_error_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_error_test akabei_error_test)
......@@ -58,11 +66,13 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "^[Dd]ebug[Ff]ull$")
akabeimd5sumtest.cpp
)
qt4_wrap_cpp(akabei_md5sum_test_MOC_SRCS akabeimd5sumtest.h)
qt5_wrap_cpp(akabei_md5sum_test_MOC_SRCS akabeimd5sumtest.h)
add_executable(akabei_md5sum_test ${akabei_md5sum_test_SRCS} ${akabei_md5sum_test_MOC_SRCS})
target_link_libraries(akabei_md5sum_test ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} akabeicore)
target_link_libraries(akabei_md5sum_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_md5sum_test akabei_md5sum_test)
......@@ -71,11 +81,13 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "^[Dd]ebug[Ff]ull$")
akabeisqlitetest.cpp
)
qt4_wrap_cpp(akabei_sqlite_test_MOC_SRCS akabeisqlitetest.h)
qt5_wrap_cpp(akabei_sqlite_test_MOC_SRCS akabeisqlitetest.h)
add_executable(akabei_sqlite_test ${akabei_sqlite_test_SRCS} ${akabei_sqlite_test_MOC_SRCS})
target_link_libraries(akabei_sqlite_test ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} akabeicore)
target_link_libraries(akabei_sqlite_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_sqlite_test akabei_sqlite_test)
......@@ -84,18 +96,26 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "^[Dd]ebug[Ff]ull$")
akabeiarchivehandlertest.cpp
)
qt4_wrap_cpp(akabei_archive_handler_test_MOC_SRCS akabeiarchivehandlertest.h)
qt5_wrap_cpp(akabei_archive_handler_test_MOC_SRCS akabeiarchivehandlertest.h)
add_executable(akabei_archive_handler_test ${akabei_archive_handler_test_SRCS} ${akabei_archive_handler_test_MOC_SRCS})
target_link_libraries(akabei_archive_handler_test ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} akabeicore)
target_link_libraries(akabei_archive_handler_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_archive_handler_test akabei_archive_handler_test)
#Version test
set(akabei_version_test_SRCS akabeiversiontest.cpp)
qt4_wrap_cpp(akabei_version_test_MOC_SRCS akabeiversiontest.h)
add_executable(akabei_version_test ${akabei_version_test_SRCS} ${akabei_version_test_MOC_SRCS})
target_link_libraries(akabei_version_test ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} akabeicore)
target_link_libraries(akabei_version_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_version_test akabei_version_test)
#PolKitArchiveHandler test
......@@ -103,11 +123,14 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "^[Dd]ebug[Ff]ull$")
akabeipolkitarchivehandlertest.cpp
)
qt4_wrap_cpp(akabei_polkit_archive_handler_test_MOC_SRCS akabeipolkitarchivehandlertest.h)
qt5_wrap_cpp(akabei_polkit_archive_handler_test_MOC_SRCS akabeipolkitarchivehandlertest.h)
add_executable(akabei_polkit_archive_handler_test ${akabei_polkit_archive_handler_test_SRCS} ${akabei_polkit_archive_handler_test_MOC_SRCS})
target_link_libraries(akabei_polkit_archive_handler_test ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} akabeicore)
target_link_libraries(akabei_polkit_archive_handler_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_polkit_archive_handler_test akabei_polkit_archive_handler_test)
#PolKitSQLiteConnection test
......@@ -115,11 +138,14 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "^[Dd]ebug[Ff]ull$")
akabeipolkitarchivehandlertest.cpp
)
qt4_wrap_cpp(akabei_polkit_sqliteconnection_test_MOC_SRCS akabeipolkitarchivehandlertest.h)
qt5_wrap_cpp(akabei_polkit_sqliteconnection_test_MOC_SRCS akabeipolkitarchivehandlertest.h)
add_executable(akabei_polkit_sqliteconnection_test ${akabei_polkit_sqliteconnection_test_SRCS} ${akabei_polkit_sqliteconnection_test_MOC_SRCS})
target_link_libraries(akabei_polkit_sqliteconnection_test ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} akabeicore)
target_link_libraries(akabei_polkit_sqliteconnection_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_polkit_sqliteconnection_test akabei_polkit_sqliteconnection_test)
#Permissions test
......@@ -127,11 +153,14 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "^[Dd]ebug[Ff]ull$")
akabeipermissionstest.cpp
)
qt4_wrap_cpp(akabei_permissions_test_MOC_SRCS akabeipermissionstest.h)
qt5_wrap_cpp(akabei_permissions_test_MOC_SRCS akabeipermissionstest.h)
add_executable(akabei_permissions_test ${akabei_permissions_test_SRCS} ${akabei_permissions_test_MOC_SRCS})
target_link_libraries(akabei_permissions_test ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} akabeicore)
target_link_libraries(akabei_permissions_test akabeicore
Qt5::Gui
Qt5::Test)
add_test(akabei_permissions_test akabei_permissions_test)
......
......@@ -30,4 +30,3 @@ void AkabeiTest::simpleTest()
QTEST_MAIN(AkabeiTest)
//#include "akabeitest.moc"
\ No newline at end of file
......@@ -5,10 +5,10 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
set(akabei_create_db_SRCS databaseworker.cpp main.cpp createdb.cpp inputvalidator.cpp)
qt4_automoc(${akabei_create_db_SRCS})
add_executable(akabei-create-db ${akabei_create_db_SRCS})
target_link_libraries(akabei-create-db akabeicore)
set_target_properties(akabei-create-db PROPERTIES AUTOMOC TRUE)
install(TARGETS akabei-create-db DESTINATION ${BIN_INSTALL_DIR})
......@@ -422,4 +422,3 @@ void CreateDb::remove()
QCoreApplication::instance()->exit(0);
}
#include "createdb.moc"
......@@ -595,4 +595,3 @@ bool DatabaseWorker::remove(QList< Akabei::Delta* > deltas)
return !failed;
}
#include "databaseworker.moc"
......@@ -24,7 +24,7 @@ set(polkit_akabeicore_helper_SRCS installhelper.cpp
main.cpp
)
QT4_WRAP_CPP(polkit_akabeicore_helper_MOC_SRCS
qt5_wrap_cpp(polkit_akabeicore_helper_MOC_SRCS
akabeicorehelper.h
archivehandlerhelper.h
filesystemhelper.h
......@@ -39,8 +39,8 @@ add_executable(akabeicore-polkit-helper
)
target_link_libraries(akabeicore-polkit-helper
${QT_QTCORE_LIBRARY}
${QT_QTDBUS_LIBRARY}
Qt5::Core
Qt5::DBus
${POLKITQT-1_LIBRARIES}
akabeicore
)
......
......@@ -129,7 +129,7 @@ public:
if (m_backupFiles.contains(path) && !m_backupFiles[path].isEmpty()) {
//Get two of the 3 possible md5sums
QByteArray originalMD5Sum = m_backupFiles[path].toAscii();
QByteArray originalMD5Sum = m_backupFiles[path].toLatin1();
QByteArray onDiskMd5Sum = Akabei::Helpers::md5sumOfFileWithoutPolkit(path);
//First extract the new file then check the md5sum
......
......@@ -6,12 +6,14 @@ IF(NOT PO2TS_EXECUTABLE)
ENDIF(NOT PO2TS_EXECUTABLE)
FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
NAMES lrelease
NAMES lrelease lrelease-qt5
PATHS ${QT_BINARY_DIR}
/usr/local/bin
/usr/bin/
NO_DEFAULT_PATH
)
IF(NOT QT_LRELEASE_EXECUTABLE)
MESSAGE(FATAL_ERROR "Qt4 lrelease not found. Make sure that it has been built and installed by the Qt4 package.")
MESSAGE(FATAL_ERROR "Qt5 lrelease not found. Make sure that it has been built and installed by the Qt5 package.")
ENDIF(NOT QT_LRELEASE_EXECUTABLE)
......
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