Commit 3968c13e authored by Laurent Montel's avatar Laurent Montel 😁

Use QCoreApplication::applicationPid() (the portable way for getPid)

parent f9490e10
......@@ -35,6 +35,7 @@
#include <klocalizedstring.h>
#include <kcharsets.h>
#include <qdebug.h>
#include <QCoreApplication>
#include <QtCore/QVector>
#include <QtCore/QString>
......@@ -43,11 +44,6 @@
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#ifdef WIN32
#include <process.h>
#else
#include <unistd.h>
#endif
using namespace KMime;
......@@ -164,12 +160,7 @@ QByteArray uniqueString()
p[10] = '\0';
now = time(nullptr);
ran = 1 + (int)(1000.0 * rand() / (RAND_MAX + 1.0));
timeval = (now / ran)
#ifdef WIN32
+ _getpid();
#else
+ getpid();
#endif
timeval = (now / ran) + QCoreApplication::applicationPid();
for (int i = 0; i < 10; i++) {
pos = (int)(61.0 * rand() / (RAND_MAX + 1.0));
......
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