1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

OP-1230 fix paths for Windows as suggested by Filnet

This commit is contained in:
Alessio Morale 2014-03-09 15:07:11 +01:00
parent 15b1fe88cb
commit b98fce7980

View File

@ -524,25 +524,19 @@ QString DeviceWidget::getDevFirmwarePath()
{ {
QDir fwDirectory; QDir fwDirectory;
QString fwDirectoryStr; QString fwDirectoryStr;
fwDirectoryStr = QCoreApplication::applicationDirPath();
fwDirectory = QDir(fwDirectoryStr);
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
fwDirectoryStr = QCoreApplication::applicationDirPath();
fwDirectory = QDir(fwDirectoryStr);
fwDirectory.cdUp();
fwDirectory.cd("firmware");
fwDirectoryStr = fwDirectory.absolutePath();
#elif defined Q_OS_LINUX
fwDirectoryStr = QCoreApplication::applicationDirPath();
fwDirectory = QDir(fwDirectoryStr);
fwDirectory.cd("../.."); fwDirectory.cd("../..");
fwDirectoryStr = fwDirectory.absolutePath(); fwDirectoryStr = fwDirectory.absolutePath();
fwDirectoryStr = fwDirectoryStr + "/fw_" + myDevice->lblBrdName->text().toLower() + "/fw_" + myDevice->lblBrdName->text().toLower() + ".opfw"; #elif defined Q_OS_LINUX
fwDirectory.cd("../..");
fwDirectoryStr = fwDirectory.absolutePath();
#elif defined Q_OS_MAC #elif defined Q_OS_MAC
fwDirectoryStr = QCoreApplication::applicationDirPath();
fwDirectory = QDir(fwDirectoryStr);
fwDirectory.cd("../../../../../.."); fwDirectory.cd("../../../../../..");
fwDirectoryStr = fwDirectory.absolutePath(); fwDirectoryStr = fwDirectory.absolutePath();
fwDirectoryStr = fwDirectoryStr + "/fw_" + myDevice->lblBrdName->text().toLower() + "/fw_" + myDevice->lblBrdName->text().toLower() + ".opfw";
#endif #endif
fwDirectoryStr = fwDirectoryStr + "/fw_" + myDevice->lblBrdName->text().toLower() + "/fw_" + myDevice->lblBrdName->text().toLower() + ".opfw";
return fwDirectoryStr; return fwDirectoryStr;
} }