Commit 2101f36a authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Drop unused functions

parent 950aee09
Pipeline #160888 passed with stages
in 2 minutes and 26 seconds
......@@ -120,47 +120,6 @@ void KontactInterface::getProcessesIdForName(const QString &processName, QList<i
CloseHandle(h);
}
bool KontactInterface::otherProcessesExist(const QString &processName)
{
QList<int> pids;
getProcessesIdForName(processName, pids);
int myPid = QCoreApplication::applicationPid();
for (int pid : std::as_const(pids)) {
if (myPid != pid) {
// qCDebug(KONTACTINTERFACE_LOG) << "Process ID is " << pid;
return true;
}
}
return false;
}
bool KontactInterface::killProcesses(const QString &processName)
{
QList<int> pids;
getProcessesIdForName(processName, pids);
if (pids.empty()) {
return true;
}
qCWarning(KONTACTINTERFACE_LOG) << "Killing process \"" << processName << " (pid=" << pids[0] << ")..";
int overallResult = 0;
qDebug() << "NEED TO PORT KILL PROCESS ON WINDOWS";
#if 0
for (int pid : std::as_const(pids)) {
int result;
result = kill(pid, SIGTERM);
if (result == 0) {
continue;
}
result = kill(pid, SIGKILL);
if (result != 0) {
overallResult = result;
}
}
#endif
return overallResult == 0;
}
struct EnumWindowsStruct {
EnumWindowsStruct()
: windowId(0)
......
......@@ -32,20 +32,6 @@ namespace KontactInterface
*/
KONTACTINTERFACE_EXPORT void getProcessesIdForName(const QString &processName, QList<int> &pids);
/**
* @return true if one or more processes (other than the current process) exist
* for name @a processName; false otherwise.
*/
KONTACTINTERFACE_EXPORT bool otherProcessesExist(const QString &processName);
/**
* Terminates or kills all processes with name @a processName.
* First, SIGTERM is sent to a process, then if that fails, we try with SIGKILL.
* @return true on successful termination of all processes or false if at least
* one process failed to terminate.
*/
KONTACTINTERFACE_EXPORT bool killProcesses(const QString &processName);
/**
* Activates window for first found process with executable @a executableName
* (without path and .exe extension)
......
Supports Markdown
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