view ui/processhelp.h @ 1371:23df332b2a4c

(issue179) Read install signature timestamp from config This also changes the way the sigDt is propgated to the MainWindow. It no longer uses the settings but hands it over as a parameter directly.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 24 Nov 2014 15:48:49 +0100
parents 2a1aa9df8f11
children
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.
 *
 * Parts of this code (especially windows) are based on kpimutils processes.cpp
 * available under LGPL 2.1 or later.
 */
#ifndef PROCESSHELP_H
#define PROCESSHELP_H

#include <QList>
#include <QString>
#include <QDateTime>

/**
 * @file processhelp.h
 * @brief Static helper functions for process handling
 */
/** @brief Static helper functions for process handling */
class ProcessHelp {

public:
/**
* @brief look up process id's for a processName
*
* Looks up processes run by the current user.
*
* @param[in] processName the name of the process to look for
* @returns a list of pids that match this process. May be empty
*/
static const QList<int> getProcessesIdForName(const QString &processName);

/**
* @brief check if another process with the same name exists
*
* Under GNU/Linux this only works for processes that have a
* processName.pid file in QStandardPaths::DataLocation.
*
* @param[in] processName name of the process to look for.
*
* @returns true if one or more processes (other than the current process) exist
*/
static bool otherProcessesExist(const QString &processName);

/**
* @brief Activates the window for first found process
* @param [in] executableName executableName (without path and .exe extension)
*/
static void activateWindowForProcess(const QString &executableName);

/**
* @brief Clean up internaly used infrastructure like pid/lock files.
*/
static void cleanUp(void);

#ifndef WIN32
/**
* @brief Read the signature timestamp from settings.
*
* @returns The signature timestamp as qdatetime or an invalid dt on error.
*/
static QDateTime getSigDtFromInstSettings();
#endif
};

#endif // PROCESSHELP_H

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