Some changes to "portable mode" detection.
This commit is contained in:
parent
412902cc36
commit
43574ca6a6
@ -35,6 +35,7 @@
|
|||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QReadWriteLock>
|
#include <QReadWriteLock>
|
||||||
|
#include <QRegExp>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// GLOBAL VARS
|
// GLOBAL VARS
|
||||||
@ -165,10 +166,9 @@ bool lamexp_version_portable(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QString baseName = QFileInfo(QApplication::applicationFilePath()).completeBaseName();
|
const QRegExp regex_portable("[_\\-]p", Qt::CaseInsensitive);
|
||||||
const int idx1 = baseName.indexOf("lamexp", 0, Qt::CaseInsensitive);
|
const QString baseName = QFileInfo(QApplication::applicationFilePath()).baseName();
|
||||||
const int idx2 = baseName.lastIndexOf("portable", -1, Qt::CaseInsensitive);
|
g_lamexp_portable = qBound(0, baseName.indexOf(regex_portable), 1);
|
||||||
g_lamexp_portable = ((idx1 >= 0) && (idx2 >= 0) && (idx1 < idx2)) ? (1) : (0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user