example 'meshtastic': add proper local data paths on desktop

This commit is contained in:
pls.153 2023-08-05 08:36:42 +02:00
parent 4fc8ee3ca8
commit bc2e23b4bd
9 changed files with 44 additions and 15 deletions

View file

@ -146,6 +146,17 @@ QVariant QT::sqlQuery(const QVariant& vQuery, const QVariant& vValues) {
// etc
QVariant QT::dataPath() {
// for desktop
static QString path;
if (path.isEmpty()) {
path = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
path.truncate(path.lastIndexOf(QChar('/')));
path.append("/cl-meshtastic/data/");
}
return path;
}
QVariant QT::localIp() {
// Returns the local IP string. Private networks may use:
// 10.*.*.*