refactoring to add nav mesh
This commit is contained in:
22
Settings.h
22
Settings.h
@@ -6,6 +6,7 @@
|
||||
#include <Indoor/sensors/radio/VAPGrouper.h>
|
||||
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
|
||||
namespace Settings {
|
||||
|
||||
@@ -80,11 +81,22 @@ namespace Settings {
|
||||
// qDebug(folder.c_str());
|
||||
// return folder;
|
||||
//return "/storage/sdcard1/YASMIN/";
|
||||
const std::string f1 = "/storage/sdcard1/YASMIN/";
|
||||
const std::string f2 = "/sdcard/YASMIN/";
|
||||
if (QFile(f1.c_str()).exists()) {return f1;}
|
||||
if (QFile(f2.c_str()).exists()) {return f2;}
|
||||
throw Exception("data folder missing. one of those:\n" + f1 + "\n" + f2);
|
||||
//const std::string f1 = "/storage/sdcard1/YASMIN/";
|
||||
//const std::string f2 = "/sdcard/YASMIN/";
|
||||
//if (QFile(f1.c_str()).exists()) {return f1;}
|
||||
//if (QFile(f2.c_str()).exists()) {return f2;}
|
||||
std::string tried;
|
||||
QDir dStorage("/storage");
|
||||
QStringList lst = dStorage.entryList();
|
||||
lst.append("/sdcard/YASMIN/");
|
||||
|
||||
// try each potential folder
|
||||
for (const QString subfolder : lst) {
|
||||
QString path = dStorage.path() + "/" + subfolder + "/YASMIN/";
|
||||
if (QFile(path).exists()) {return path.toStdString();}
|
||||
tried += path.toStdString() + "\n";
|
||||
}
|
||||
throw Exception("data folder missing. tried:\n" + tried);
|
||||
#else
|
||||
//return "/home/toni/Documents/programme/localization/YASMIN/YASMIN_DATA/";
|
||||
return "/apps/android/workspace/YASMIN_DATA/";
|
||||
|
||||
Reference in New Issue
Block a user