Commit 3f3c0e54 authored by AlmAck's avatar AlmAck
parents 5aa78d68 396b833b
project(akabei)
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.0.0)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
# KF5 global definitions, use them to be compatible with KF5 applications
add_definitions(#-DQT_NO_CAST_TO_ASCII
#-DQT_NO_CAST_FROM_ASCII
-DQT_NO_URL_CAST_FROM_STRING
-DQT_NO_CAST_FROM_BYTEARRAY
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
-DQT_USE_FAST_OPERATOR_PLUS
-DQT_USE_QSTRINGBUILDER
)
set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/akabei" CACHE "Akabei data's install dir" STRING)
set(SCRIPTS_INSTALL_DIR "${DATA_INSTALL_DIR}/python" CACHE "Akabei scripts' install dir" STRING)
set(LOCALE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/locale" CACHE "Akabei locales' install dir" STRING)
find_package(Qt5 5.2.0 REQUIRED CONFIG COMPONENTS Core Network)
find_package(AkabeiCore REQUIRED)
find_package(AkabeiClient REQUIRED)
find_package(MSGFMT REQUIRED)
find_package(Qt4 REQUIRED)
# This header adds a macro to make the licenses accessible to akabei independently of the install prefix
configure_file(
......@@ -18,11 +29,13 @@ configure_file(
IMMEDIATE @ONLY
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
add_definitions(-Wall -Werror -std=c++11)
add_definitions(${QT_DEFINITIONS} -W -Wall)
add_definitions(-Werror)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
include_directories(BEFORE SYSTEM
${QT_INCLUDES}
${Qt5Core_LIBRARIES}
${Qt5Network_LIBRARIES}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}
${AKABEICLIENT_INCLUDE_DIR}
......@@ -52,22 +65,16 @@ add_subdirectory(translations)
add_subdirectory(docs)
add_subdirectory(licenses)
# qt4_automoc() doesn't recognize our operation files, so I use this safer version instead
QT4_WRAP_CPP(MISSING_MOCS
apm.h
queryoperation.h
queueoperation.h
removeoperation.h
upgradeoperation.h
syncoperation.h
performoperation.h)
add_executable(akabei ${apm_SRCS} ${MISSING_MOCS})
target_link_libraries(akabei ${QT_QTCORE_LIBRARY} ${AKABEICORE_LIBRARIES} ${AKABEICLIENT_LIBRARIES})
set_target_properties(akabei PROPERTIES AUTOMOC TRUE)
target_link_libraries(akabei ${Qt5Core_LIBRARIES} ${Qt5Network_LIBRARIES} ${AKABEICORE_LIBRARIES} ${AKABEICLIENT_LIBRARIES})
install(TARGETS akabei
RUNTIME DESTINATION bin)
add_executable(pakabei ${apm_SRCS} ${MISSING_MOCS})
target_link_libraries(pakabei ${QT_QTCORE_LIBRARY} ${AKABEICORE_LIBRARIES} ${AKABEICLIENT_LIBRARIES})
set_target_properties(pakabei PROPERTIES AUTOMOC TRUE)
target_link_libraries(pakabei ${Qt5Core_LIBRARIES} ${Qt5Network_LIBRARIES} ${AKABEICORE_LIBRARIES} ${AKABEICLIENT_LIBRARIES})
install(TARGETS pakabei
RUNTIME DESTINATION bin)
......@@ -58,7 +58,7 @@ OperationManager::OperationManager(APM::OperationType type, QList<APM::Operation
QLocale systemLocale = QLocale::system();
AkabeiClient::Backend::instance()->setLocale( systemLocale.name() );
AkabeiClient::Backend::instance()->initialize(root, cache, dbs, config);
AkabeiClient::Backend::instance()->initialize(root, cache, dbs, QUrl(config));
}
OperationManager::~OperationManager()
......
......@@ -27,7 +27,7 @@ public:
/* This is just the static version of the quit() slot below, to be passed as a signal handler to sigaction(3) */
static void staticQuit(int);
private slots:
private Q_SLOTS:
void statusChanged(Akabei::Backend::Status);
void start();
void showErrors();
......
......@@ -30,7 +30,7 @@ bool CommandLine::isSet(const QString& command)
* repeated twice
*/
if (command.size() == 2) {
actualCom = QString::fromAscii("-") + command[0];
actualCom = QString::fromLatin1("-") + command[0];
m_requested.push_front(actualCom);
if (m_commands.count(actualCom) == 2) {
......
......@@ -24,14 +24,14 @@ public:
void start(QHash<APM::OptionName, QStringList> options, QStringList args);
signals:
Q_SIGNALS:
void performFinished();
private:
QStringList removePkgs, installPkgs;
QHash<APM::OptionName, QStringList> m_options;
private slots:
private Q_SLOTS:
void secondStep();
};
......
......@@ -15,6 +15,7 @@
#include <QString>
#include <QMap>
#include <QTime>
#include <QObject>
class ProgressBar
{
......@@ -25,7 +26,7 @@ public:
Progress = 0x04,
Eta = 0x08
};
Q_DECLARE_FLAGS(Columns, Column);
Q_DECLARE_FLAGS(Columns, Column)
ProgressBar();
virtual ~ProgressBar();
......
......@@ -53,11 +53,11 @@ private:
void showUpgradeable();
void printFiles(Akabei::Package::List packages);
private slots:
private Q_SLOTS:
void showNotRequired(QUuid, QList<Akabei::Package*>);
void listGroups(QUuid, QList<Akabei::Group*>);
signals:
Q_SIGNALS:
void queryFinished();
};
......
......@@ -34,14 +34,14 @@ public:
void start(AkabeiClient::PackageAction action, Akabei::Package::List packages);
private slots:
private Q_SLOTS:
void validationFinished(bool valid);
void showProgress();
void transactionMessage(const QString &message);
void transactionFinished(bool success);
void transactionCreated(AkabeiClient::Transaction*);
signals:
Q_SIGNALS:
void finished();
private:
......
......@@ -26,7 +26,7 @@ public:
void start();
public slots:
public Q_SLOTS:
void remove(Akabei::Package::List packages);
void removeUnneeded(QUuid, QList<Akabei::Package*>);
void nextOperation();
......@@ -38,7 +38,7 @@ private:
QUuid id;
signals:
Q_SIGNALS:
void removeFinished();
};
......
......@@ -27,7 +27,7 @@ public:
void start();
private slots:
private Q_SLOTS:
void searchResult(QUuid,QList<Akabei::Package*>);
void listRepo(const QString &repo);
void showInformation(QUuid,QList<Akabei::Package*> packages);
......@@ -39,7 +39,7 @@ private slots:
void nextOperation();
public slots:
public Q_SLOTS:
void updateNextDatabase();
void updateError();
......@@ -60,7 +60,7 @@ private:
ProgressBar m_bar;
bool forceDbUpdate;
signals:
Q_SIGNALS:
void syncFinished();
};
......
......@@ -10,10 +10,10 @@ if(NOT AKABEICORE_FOUND)
endif(NOT AKABEICORE_FOUND)
set(akabei_clean_cache_SRCS main.cpp)
include_directories(${QT_INCLUDES}
include_directories(${Qt5Core_LIBRARIES}
${AKABEICORE_INCLUDE_DIR})
add_executable(akabei-clean-cache ${akabei_clean_cache_SRCS})
target_link_libraries(akabei-clean-cache ${AKABEICORE_LIBRARIES} ${QT_QTCORE_LIBRARY})
target_link_libraries(akabei-clean-cache ${AKABEICORE_LIBRARIES} ${Qt5Core_LIBRARIES})
install(TARGETS akabei-clean-cache
RUNTIME DESTINATION bin)
......@@ -123,9 +123,9 @@ int main(int argc, char **argv)
}
if (arg == "--cachedir" || arg == "-c") {
cachedir = (i < argc - 1) ? QString::fromAscii(argv[i + 1]) : QString();
cachedir = (i < argc - 1) ? QString::fromLatin1(argv[i + 1]) : QString();
} else if (arg == "--databasedir" || arg == "-d") {
databasedir = (i < argc - 1) ? QString::fromAscii(argv[i + 1]) : QString();
databasedir = (i < argc - 1) ? QString::fromLatin1(argv[i + 1]) : QString();
} else if (arg == "-k" || arg == "--keep-package") {
/*
......@@ -133,7 +133,7 @@ int main(int argc, char **argv)
* Also, args can be in a single string, but separated by commas.
*/
for (int j = i + 1; j < argc && argv[j][0] != '-'; j++) {
keepPackages << QString::fromAscii(argv[j]).split(",");
keepPackages << QString::fromLatin1(argv[j]).split(",");
}
} else if (arg == "-o" || arg == "--clean-old") {
......
......@@ -11,10 +11,10 @@ endif(CMAKE_COMPILER_IS_GNUCC)
set(akabei_key_SRCS main.cpp)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${QT_INCLUDES}
${Qt5Core_LIBRARIES}
${GPGME_INCLUDES})
add_executable(akabei-key ${akabei_key_SRCS})
target_link_libraries(akabei-key ${QT_QTCORE_LIBRARY} ${GPGME_VANILLA_LIBRARIES})
target_link_libraries(akabei-key ${Qt5Core_LIBRARIES} ${GPGME_VANILLA_LIBRARIES})
install(TARGETS akabei-key
RUNTIME DESTINATION bin)
......@@ -288,7 +288,7 @@ void getFromServer(gpgme_ctx_t ctx, QString id)
out << "- " << key->subkeys->keyid << " " << key->uids->name << " " << key->uids->email << endl;
if (QString::fromAscii(key->subkeys->keyid) == id) {
if (QString::fromLatin1(key->subkeys->keyid) == id) {
found = true;
break;
}
......
......@@ -24,7 +24,7 @@ public:
void start(QList<APM::OperationName> operations, QHash<APM::OptionName, QStringList> options, QStringList args);
signals:
Q_SIGNALS:
void upgradeFinished();
};
......
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