forked from Silverfish/proton-bridge
Other: Bridge must now be in the same folder as bridge-gui.
This commit is contained in:
@ -32,8 +32,6 @@ QString const exeSuffix;
|
||||
#endif
|
||||
|
||||
QString const exeName = "bridge" + exeSuffix; ///< The bridge executable file name.
|
||||
QString const devDir = "cmd/Desktop-Bridge"; ///< The folder typically containg the bridge executable in a developer's environment.
|
||||
int const maxExeUpwardSeekingDepth = 5; ///< The maximum number of parent folder that will searched when trying to locate the bridge executable.
|
||||
|
||||
|
||||
}
|
||||
@ -45,23 +43,8 @@ int const maxExeUpwardSeekingDepth = 5; ///< The maximum number of parent folder
|
||||
//****************************************************************************************************************************************************
|
||||
QString BridgeMonitor::locateBridgeExe()
|
||||
{
|
||||
QString const currentDir = QDir::current().absolutePath();
|
||||
QString const exeDir = QCoreApplication::applicationDirPath();
|
||||
QStringList dirs = {currentDir, exeDir};
|
||||
for (int i = 0; i <= maxExeUpwardSeekingDepth; ++i)
|
||||
{
|
||||
dirs.append(currentDir + QString("../").repeated(i) + devDir);
|
||||
dirs.append(exeDir + QString("../").repeated(i) + devDir);
|
||||
}
|
||||
|
||||
for (QString const &dir: dirs)
|
||||
{
|
||||
QFileInfo const fileInfo(QDir(dir).absoluteFilePath(exeName));
|
||||
if (fileInfo.exists() && fileInfo.isFile() && fileInfo.isExecutable())
|
||||
return fileInfo.absoluteFilePath();
|
||||
}
|
||||
|
||||
return QString();
|
||||
QFileInfo const fileInfo(QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(exeName));
|
||||
return (fileInfo.exists() && fileInfo.isFile() && fileInfo.isExecutable()) ? fileInfo.absoluteFilePath() : QString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user