Merge pull request #49 from GlitchMasta47/dev

Fix for #28, take 3
This commit is contained in:
ArsenArsen 2017-12-10 18:07:42 +01:00 committed by GitHub
commit 70bba2cbbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>
@ -81,6 +83,11 @@ int main(int argc, char *argv[]) {
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);