first re-commit.
This commit is contained in:
44
libMiniCash/swdriveselector.cpp
Normal file
44
libMiniCash/swdriveselector.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/***************************************************************************
|
||||
|
||||
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 <swdriveselector.h>
|
||||
#include <QStorageInfo>
|
||||
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user