Commit 1b7db97f authored by Volker Krause's avatar Volker Krause

Enable the use of QStringBuilder

parent 1fc9c45f
......@@ -42,6 +42,11 @@ else()
find_package(Qt5 REQUIRED COMPONENTS Positioning)
endif()
add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_USE_QSTRINGBUILDER)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_subdirectory(src)
add_subdirectory(autotests)
......
......@@ -97,7 +97,7 @@ int main(int argc, char **argv)
QCommandLineParser parser;
parser.addHelpOption();
parser.addVersionOption();
parser.addPositionalArgument("pass", QStringLiteral("PkPass file to import."));
parser.addPositionalArgument(QStringLiteral("pass"), QStringLiteral("PkPass file to import."));
parser.process(app);
PkPassManager passMgr;
......
......@@ -41,7 +41,7 @@ PkPassManager::~PkPassManager() = default;
QVector<QString> PkPassManager::passes() const
{
const auto basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/passes");
const QString basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/passes");
QDir::root().mkpath(basePath);
QVector<QString> passIds;
......@@ -94,7 +94,7 @@ void PkPassManager::doImportPass(const QUrl& url, PkPassManager::ImportMode mode
if (!url.isLocalFile())
return; // TODO
const auto basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/passes");
const QString basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/passes");
QDir::root().mkpath(basePath);
std::unique_ptr<KPkPass::Pass> newPass(KPkPass::Pass::fromFile(url.toLocalFile()));
......@@ -146,7 +146,7 @@ void PkPassManager::doImportPass(const QUrl& url, PkPassManager::ImportMode mode
void PkPassManager::removePass(const QString& passId)
{
const auto basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/passes/");
const QString basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/passes/");
QFile::remove(basePath + QLatin1Char('/') + passId + QLatin1String(".pkpass"));
emit passRemoved(passId);
delete m_passes.take(passId);
......
......@@ -56,7 +56,7 @@ void ReservationManager::setPkPassManager(PkPassManager* mgr)
QVector<QString> ReservationManager::reservations() const
{
const auto basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/reservations");
const QString basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/reservations");
QDir::root().mkpath(basePath);
QVector<QString> resIds;
......@@ -129,7 +129,7 @@ void ReservationManager::importReservations(const QVector<QVariant> &resData)
postproc.setContextDate(QDateTime(QDate::currentDate(), QTime(0, 0)));
postproc.process(resData);
const auto basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/reservations/");
const QString basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/reservations/");
QDir::root().mkpath(basePath);
for (auto res : postproc.result()) {
......@@ -171,7 +171,7 @@ void ReservationManager::importReservations(const QVector<QVariant> &resData)
void ReservationManager::addReservation(const QVariant &res)
{
QString resId = QUuid::createUuid().toString();
const auto basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/reservations/");
const QString basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/reservations/");
QDir::root().mkpath(basePath);
const QString path = basePath + resId + QLatin1String(".jsonld");
QFile f(path);
......@@ -187,7 +187,7 @@ void ReservationManager::addReservation(const QVariant &res)
void ReservationManager::removeReservation(const QString& id)
{
const auto basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/reservations/");
const QString basePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/reservations/");
QFile::remove(basePath + QLatin1Char('/') + id + QLatin1String(".jsonld"));
emit reservationRemoved(id);
m_reservations.remove(id);
......
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