Commit da971450 authored by Laurent Montel's avatar Laurent Montel 😁

Remove getPid

parent ee9f9125
......@@ -37,8 +37,8 @@
#include <QFileInfo>
#include <QDir>
#include <unistd.h>
#include <QStandardPaths>
#include <QCoreApplication>
using namespace KontactInterface;
......@@ -174,7 +174,7 @@ QString Plugin::registerClient()
if (d->serviceName.isEmpty()) {
d->serviceName = QLatin1String("org.kde.") + QLatin1String(objectName().toLatin1());
#ifdef Q_OS_WIN
const QString pid = QString::number(getpid());
const QString pid = QString::number(QCoreApplication::applicationPid());
d->serviceName.append(QLatin1String(".unique-") + pid);
#endif
QDBusConnection::sessionBus().registerService(d->serviceName);
......
......@@ -43,6 +43,7 @@ using namespace KontactInterface;
#include <QtCore/QList>
#include <QtCore/QtDebug>
#include <QCoreApplication>
#include "kontactinterface_debug.h"
// Copy from kdelibs/kinit/kinit_win.cpp
......@@ -139,7 +140,7 @@ bool KPIMUtils::otherProcessesExist(const QString &processName)
{
QList<int> pids;
getProcessesIdForName(processName, pids);
int myPid = getpid();
int myPid = QCoreApplication::applicationPid();
foreach (int pid, pids) {
if (myPid != pid) {
// qCDebug(KONTACTINTERFACE_LOG) << "Process ID is " << pid;
......@@ -198,7 +199,7 @@ void KPIMUtils::activateWindowForProcess(const QString &executableName)
{
QList<int> pids;
KPIMUtils::getProcessesIdForName(executableName, pids);
int myPid = getpid();
int myPid = QCoreApplication::applicationPid();
int foundPid = 0;
foreach (int pid, pids) {
if (myPid != pid) {
......
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