mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
add command line option -m to allow multiple instances (temporarilly)
This commit is contained in:
parent
babcaac97f
commit
28d62d2400
13
src/main.cpp
13
src/main.cpp
@ -120,8 +120,19 @@ void VLogger(QtMsgType type, const QMessageLogContext &context, const QString &m
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
bool allowMultiInstances = false;
|
||||||
|
for (int i = 1; i < argc; ++i) {
|
||||||
|
if (!qstrcmp(argv[i], "-m")) {
|
||||||
|
allowMultiInstances = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VSingleInstanceGuard guard;
|
VSingleInstanceGuard guard;
|
||||||
bool canRun = guard.tryRun();
|
bool canRun = true;
|
||||||
|
if (!allowMultiInstances) {
|
||||||
|
canRun = guard.tryRun();
|
||||||
|
}
|
||||||
|
|
||||||
QTextCodec *codec = QTextCodec::codecForName("UTF8");
|
QTextCodec *codec = QTextCodec::codecForName("UTF8");
|
||||||
if (codec) {
|
if (codec) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user