view ui/processhelp_linux.cpp @ 1316:ff9cd05e861e

(issue166) Fix certificiate removal The index that should be removed came from the filter proxy model and did not map to the real index. This was broken.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 13 Oct 2014 17:23:35 +0200
parents 2a1aa9df8f11
children 23df332b2a4c
line wrap: on
line source
/* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
 * Software engineering by Intevation GmbH
 *
 * This file is Free Software under the GNU GPL (v>=2)
 * and comes with ABSOLUTELY NO WARRANTY!
 * See LICENSE.txt for details.
 */
#ifndef WIN32

#include "processhelp.h"
#include "linuxlockfile.h"

#include <fcntl.h>
#include <semaphore.h>

#include <QDebug>
#include <QDir>
#include <QStandardPaths>

int lockFileFD = -1;

const QList<int> ProcessHelp::getProcessesIdForName(const QString &processName) {
    // TODO (issue39)
    Q_UNUSED(processName);
    return QList<int>();
}

bool ProcessHelp::otherProcessesExist(const QString &processName) {
    QDir dataDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
    dataDir.mkpath(".");
    QString lockFilePath = dataDir.filePath(processName + ".pid");
    lockFileFD = open_lockfile(lockFilePath.toLocal8Bit().data());
    if (lockFileFD == -1)
        // Creating the lock file failed, so we assume another
        // instance is runnning.
        return true;
    return false;
}

void ProcessHelp::activateWindowForProcess(const QString &executableName) {
    // TODO (issue136)
    Q_UNUSED(executableName);
    return;
}

void ProcessHelp::cleanUp() {
    close_lockfile(lockFileFD);
}

#endif /* Not WIN32 */

http://wald.intevation.org/projects/trustbridge/