equal
deleted
inserted
replaced
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 |