filemanager/src/inc/fmdrivemodel.cpp
changeset 16 ada7962b4308
parent 14 1957042d8c7e
child 24 1d0c87b42e2e
child 25 b7bfdea70ca2
child 37 15bc28c9dd51
equal deleted inserted replaced
14:1957042d8c7e 16:ada7962b4308
    14 * Description: 
    14 * Description: 
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include "fmdrivemodel.h"
    18 #include "fmdrivemodel.h"
       
    19 #include "fmfileiconprovider.h"
    19 #include "fmutils.h"
    20 #include "fmutils.h"
    20 
    21 
    21 #include <QDir>
    22 #include <QDir>
    22 #include <QFileInfo>
    23 #include <QFileInfo>
    23 
    24 
    24 FmDriveModel::FmDriveModel( QObject *parent, Options options ) :
    25 FmDriveModel::FmDriveModel( QObject *parent, Options options ) :
    25     QAbstractListModel( parent ), mOptions( options )
    26     QAbstractListModel( parent ), mOptions( options )
    26 {
    27 {
    27     mIconProvider = new QFileIconProvider();
    28     mIconProvider = new FmFileIconProvider();
    28     refresh();
    29     refresh();
    29 }
    30 }
    30 
    31 
    31 FmDriveModel::~FmDriveModel(void)
    32 FmDriveModel::~FmDriveModel()
    32 {
    33 {
    33     delete mIconProvider;
    34     delete mIconProvider;
    34 }
    35 }
    35 
    36 
    36 void FmDriveModel::refresh()
    37 void FmDriveModel::refresh()
    37 {
    38 {
    38     QFileInfoList infoList = QDir::drives();
    39     QFileInfoList infoList = QDir::drives();
    39 
    40 
    40     mDriveList.clear();
    41     mDriveList.clear();
    41     if( mOptions & HideUnAvailableDrive ) {
    42     if( mOptions & HideUnAvailableDrive ) {
       
    43         FmLogger::log( QString( "FmDriveModel::refresh HideUnAvailableDrive_true" ) );
    42         FmUtils::getDriveList( mDriveList, true );
    44         FmUtils::getDriveList( mDriveList, true );
    43     } else {
    45     } else {
       
    46         FmLogger::log( QString( "FmDriveModel::refresh HideUnAvailableDrive_false" ) );
    44         FmUtils::getDriveList( mDriveList, false );
    47         FmUtils::getDriveList( mDriveList, false );
    45     }
    48     }
    46     emit layoutChanged();
    49     emit layoutChanged();
    47 }
    50 }
    48 
    51