summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <[email protected]>2018-01-27 00:49:14 +0100
committerDaniel Vrátil <[email protected]>2018-01-27 00:49:14 +0100
commit5a75d760cba469a55a6ec6ad40426aba06e3944e (patch)
tree4082c11b44de327e3144704b6a293f5e07af69c3
parent1e328a076698759f63df23424957976f03afb199 (diff)
Use qputenv() instead of setenv()
Fixes build on Windows where setenv() is not available.
-rw-r--r--src/main.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index e188056..d88e6b1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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());