1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-27 02:05:16 +03:00

Companion will still find old TARANIS.BIN files

This commit is contained in:
Andre Bernet 2014-04-09 21:17:56 +02:00
parent 5aaa560cb4
commit 9135409e67

View file

@ -954,6 +954,7 @@ QString MainWindow::FindTaranisPath()
{
int pathcount=0;
QString path;
QString temppath;
QStringList drives;
QString eepromfile;
QString fsname;
@ -968,12 +969,21 @@ QString MainWindow::FindTaranisPath()
if(ret) {
QString vName=QString::fromUtf16 ( (const ushort *) szVolumeName) ;
if (vName.contains("TARANIS")) {
eepromfile=drive.absolutePath();
temppath=drive.absolutePath();
eepromfile=temppath;
eepromfile.append("/EEPROM.BIN");
if (QFile::exists(eepromfile)) {
pathcount++;
path=eepromfile;
}
else {
eepromfile=temppath;
eepromfile.append("/TARANIS.BIN");
if (QFile::exists(eepromfile)) {
pathcount++;
path=eepromfile;
}
}
}
}
}
@ -983,12 +993,10 @@ QString MainWindow::FindTaranisPath()
while (entry != NULL) {
if (!drives.contains(entry->me_devname)) {
drives.append(entry->me_devname);
eepromfile=entry->me_mountdir;
temppath=entry->me_mountdir;
eepromfile=temppath;
eepromfile.append("/EEPROM.BIN");
#if !defined __APPLE__ && !defined WIN32
QString fstype=entry->me_type;
qDebug() << fstype;
if (QFile::exists(eepromfile) && fstype.contains("fat") ) {
#else
if (QFile::exists(eepromfile)) {
@ -996,6 +1004,18 @@ QString MainWindow::FindTaranisPath()
pathcount++;
path=eepromfile;
}
else {
eepromfile=temppath;
eepromfile.append("/TARANIS.BIN");
#if !defined __APPLE__ && !defined WIN32
if (QFile::exists(eepromfile) && fstype.contains("fat") ) {
#else
if (QFile::exists(eepromfile)) {
#endif
pathcount++;
path=eepromfile;
}
}
}
entry = entry->me_next; ;
}