Fix for #28, take 3
Fixes an issue where multiple processes would be opened on Windows machines
This commit is contained in:
parent
a1e2158e69
commit
688e9d404e
@ -3,6 +3,8 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QLockFile>
|
||||||
|
#include <QDir>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <formatter.hpp>
|
#include <formatter.hpp>
|
||||||
@ -80,6 +82,11 @@ int main(int argc, char *argv[]) {
|
|||||||
a.setApplicationName("KShare");
|
a.setApplicationName("KShare");
|
||||||
a.setOrganizationName("ArsenArsen");
|
a.setOrganizationName("ArsenArsen");
|
||||||
a.setApplicationVersion("4.1");
|
a.setApplicationVersion("4.1");
|
||||||
|
|
||||||
|
QLockFile lockFile(QDir::temp().absoluteFilePath("com.arsenarsen.kshare.lock"));
|
||||||
|
if(!lockFile.tryLock(100)){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
QString locale = QLocale::system().name();
|
QString locale = QLocale::system().name();
|
||||||
if (locale != "en_US") loadTranslation(locale);
|
if (locale != "en_US") loadTranslation(locale);
|
||||||
|
Loading…
Reference in New Issue
Block a user