/*************************************************************************** libMiniCash Copyright © 2013-2022 christoph holzheuer c.holzheuer@sourceworx.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. ***************************************************************************/ #include #include SWDriveSelector::SWDriveSelector( QWidget* parent ) : QComboBox( parent ) { } SWDriveSelector::~SWDriveSelector() { } bool SWDriveSelector::event( QEvent* event ) { if( event->type() == QEvent::MouseButtonPress ) { clear(); for( auto& storage : QStorageInfo::mountedVolumes() ) { if( storage.isValid() && storage.isReady() ) addItem( storage.rootPath() ); } } return QComboBox::event( event ); }