Skip to content

Commit

Permalink
Some changes to "portable mode" detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
lordmulder committed Jun 11, 2017
1 parent 412902c commit 43574ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Global_Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <QDate>
#include <QFileInfo>
#include <QReadWriteLock>
#include <QRegExp>

///////////////////////////////////////////////////////////////////////////////
// GLOBAL VARS
Expand Down Expand Up @@ -165,10 +166,9 @@ bool lamexp_version_portable(void)
}
else
{
const QString baseName = QFileInfo(QApplication::applicationFilePath()).completeBaseName();
const int idx1 = baseName.indexOf("lamexp", 0, Qt::CaseInsensitive);
const int idx2 = baseName.lastIndexOf("portable", -1, Qt::CaseInsensitive);
g_lamexp_portable = ((idx1 >= 0) && (idx2 >= 0) && (idx1 < idx2)) ? (1) : (0);
const QRegExp regex_portable("[_\\-]p", Qt::CaseInsensitive);
const QString baseName = QFileInfo(QApplication::applicationFilePath()).baseName();
g_lamexp_portable = qBound(0, baseName.indexOf(regex_portable), 1);
}
}

Expand Down

0 comments on commit 43574ca

Please sign in to comment.