mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 01:35:21 +03:00
Companion will still find old TARANIS.BIN files
This commit is contained in:
parent
5aaa560cb4
commit
9135409e67
1 changed files with 25 additions and 5 deletions
|
@ -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; ;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue