From 1ba81f6e894ba9b5e5d920624fa2766446eb5d68 Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Wed, 18 Aug 2021 20:11:18 -0400 Subject: [PATCH] System info: if no network connection, set IP as 'Not available' --- functions.h | 3 +++ reader.cpp | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/functions.h b/functions.h index 59f4e46..1bf5fc5 100644 --- a/functions.h +++ b/functions.h @@ -383,6 +383,9 @@ namespace { getIpProc->waitForFinished(); QString ipAddress = getIpProc->readAllStandardOutput(); + if(ipAddress == "") { + ipAddress = "Not available"; + } return ipAddress; } void getSystemInfo() { diff --git a/reader.cpp b/reader.cpp index 92f4870..6e12669 100644 --- a/reader.cpp +++ b/reader.cpp @@ -173,11 +173,13 @@ reader::reader(QWidget *parent) : string_writeconfig("/tmp/inkboxBookPath", book_file_str); // Calling InkBox daemon (ibxd) via FIFO interface to run bookconfig_mount - string_writeconfig("/opt/ibxd", "bookconfig_mount\n"); - // Callback handler to wait until bookconfig_mount has finished execution - while(true) { - if(QFile::exists("/inkbox/bookConfigSetUp")) { - break; + if(checkconfig(".config/16-global_reading_settings") == true) { + string_writeconfig("/opt/ibxd", "bookconfig_mount\n"); + // Callback handler to wait until bookconfig_mount has finished execution + while(true) { + if(QFile::exists("/inkbox/bookConfigSetUp")) { + break; + } } }