thank you for ALL !!!
I present final solution
header
#ifndef MAPP_H
#define MAPP_H
#include<QCoreApplication>
#include<QProcess>
#include<QFile>
class mApp : public QCoreApplication
{
Q_OBJECT
QProcess* fproc;
const QString progName{"/usr/bin/firefox"};
const QStringList wwwSite{{"localhost"},{"-P marek"},{"-no-remote"}};
const QStringList killffox{{"firefox"}};
public:
mApp(int argc, char *argv[]);
~mApp();
signals:
public slots:
void ffoxClose(int a);
};
#endif // MAPP_H
souce
#include "mapp.h"
#include<QFileInfo>
mApp::mApp(int argc, char *argv[]):QCoreApplication(argc, argv)
{
fproc=new QProcess(this);
QFileInfo lock("/home/tygrysy/.mozilla/firefox/marek/lock"); //file exist when firefox is run
if (lock.isSymLink()){
fproc->start("killall",killffox);
fproc->waitForFinished();
}
fproc->start(progName,wwwSite);
connect(fproc,SIGNAL(finished(int)),this, SLOT(ffoxClose(int)));
}
mApp::~mApp()
{
fproc->close();
fproc->destroyed();
}
void mApp::ffoxClose(int a) //gdy aplikacja się skończy to odpalam ponownie
{
QFileInfo lock("/home/tygrysy/.mozilla/firefox/marek/lock"); // file exist when firefox run :P
if (!lock.isSymLink()){
fproc->start(progName,wwwSite);
}
}