Commit 5a75d760 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Use qputenv() instead of setenv()

Fixes build on Windows where setenv() is not available.
parent 1e328a07
......@@ -32,8 +32,6 @@
#include <QCommandLineOption>
#include <QDBusMetaType>
#include <stdlib.h>
int main(int argc, char **argv)
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
......@@ -73,8 +71,8 @@ int main(int argc, char **argv)
if (parser.isSet(QStringLiteral("remote"))) {
const QString akonadiAddr = QStringLiteral("tcp:host=%1,port=31415").arg(parser.value(QStringLiteral("remote")));
const QString dbusAddr = QStringLiteral("tcp:host=%1,port=31416").arg(parser.value(QStringLiteral("remote")));
setenv("AKONADI_SERVER_ADDRESS", akonadiAddr.toLatin1(), 1);
setenv("DBUS_SESSION_BUS_ADDRESS", dbusAddr.toLatin1(), 1);
qputenv("AKONADI_SERVER_ADDRESS", akonadiAddr.toLatin1());
qputenv("DBUS_SESSION_BUS_ADDRESS", dbusAddr.toLatin1());
}
InstanceSelector instanceSelector(parser.isSet(QStringLiteral("remote")) ? parser.value(QStringLiteral("remote")) : QString());
......
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