Commit d90f945c authored by Luca Giambonini's avatar Luca Giambonini

due the fact that KF5 uses the flag "QT_NO_CAST_FROM_ASCII" we can't cast...

due the fact that KF5 uses the flag "QT_NO_CAST_FROM_ASCII" we can't cast directly a string, but instead we must use QLatin1String
even the flag "QT_NO_URL_CAST_FROM_STRING" is set, we can't cast a QString to QUrl directly, but instead use the setUrl function
Modified only the _global.h header, is the one used by external applications (like discover)
https://techbase.kde.org/Policies/Library_Code_Policy
parent 767e027e
......@@ -13,7 +13,15 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
#set(CMAKE_CXX_FLAGS "-fPIC")
# 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(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)
......
......@@ -13,6 +13,7 @@
#include <qglobal.h>
#include <QUrl>
#include <QString>
#if defined(AKABEICORE_LIBRARY)
# define AKABEICORESHARED_EXPORT Q_DECL_EXPORT
......@@ -125,12 +126,12 @@ namespace Hooks {
}
const QUrl DEFAULT_DATABASE_DIR("/var/lib/akabei");
const QUrl DEFAULT_CACHE_DIR("/var/cache/akabei/pkg");
const QUrl DEFAULT_DATABASE_DIR(QLatin1String("/var/lib/akabei"));
const QUrl DEFAULT_CACHE_DIR(QLatin1String("/var/cache/akabei/pkg"));
const QString errorPrefix = ":: ";
const QString packageExtension = ".tar.xz";
const QString signatureExtension = ".sig";
const QString errorPrefix = QLatin1String(":: ");
const QString packageExtension = QLatin1String(".tar.xz");
const QString signatureExtension = QLatin1String(".sig");
enum ProcessingOption
{
......
......@@ -72,7 +72,7 @@ bool PolKitArchiveHandler::write(const QString& filename, const QHash<QString, Q
{
QUrl file(filename);
if (file.isRelative()) {
file = QDir::current().absoluteFilePath(file.toString());
file.setUrl(QDir::current().absoluteFilePath(file.toString()));
}
if (Akabei::Helpers::permissionsOfPath(QFileInfo(file.toString()).absolutePath()) & Akabei::Helpers::WritePermission) {
......
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