From 5124e1cca672e7ab803f8f8106a28f8ada25dbfb Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Tue, 14 May 2024 12:43:46 +0200 Subject: [PATCH] Use return value of type std::optional for checkForUSBStick() and getUSBMountPath(). Add getJsonFilesOnUsbStick(). --- common/include/System.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/common/include/System.h b/common/include/System.h index 918aff6..4c59a04 100644 --- a/common/include/System.h +++ b/common/include/System.h @@ -3,6 +3,10 @@ #include +#include + +#include +#include class System : public QObject { @@ -13,16 +17,17 @@ private: static QString errorMsg; - public: + static const QStringList allowedJsonFiles; static bool checkForSDCard(); static bool umountSDCard(); - static bool checkForUSBStick(); - static QString getUSBMountPath(); - static QString getUSBDeviceName(); + static std::optional checkForUSBStick(QString const &dirPathUnderMountPath = "."); + static QString getUSBMountPath(QString const &dirPathUnderMountPath = "."); + + //static QString getUSBDeviceName(); static bool umountUSBStick(); static bool test_mount(const QString& dev, const QString &mountpoint); @@ -48,7 +53,7 @@ public: static QString getPTU4SerialNumber(); static QString getPTU4MACAddress(); - + static QStringList getJsonFilesOnUsbStick(QString const &mountPath); };