diff --git a/common/src/System.cpp b/common/src/System.cpp index dc0adfe..8531e8e 100644 --- a/common/src/System.cpp +++ b/common/src/System.cpp @@ -251,8 +251,7 @@ bool System::test_dir(const QString& dir) -bool System::checkForUSBStick() -{ +std::optional System::checkForUSBStick(QString const &dirPathUnderMountPath) { #if defined (ARCH_DesktopLinux) // DEBUG / TEST: if (QFileInfo(getUSBMountPath()).isDir()) @@ -261,11 +260,9 @@ bool System::checkForUSBStick() return false; #endif - if (getUSBMountPath().isEmpty()) { - return false; - } - - return true; + QString const &mountPath = getUSBMountPath(dirPathUnderMountPath); + // qCritical() << "MOUNT-PATH" << mountPath; + return mountPath.isEmpty() ? std::nullopt : std::optional(mountPath); }