equal
deleted
inserted
replaced
49 { |
49 { |
50 Q_OBJECT |
50 Q_OBJECT |
51 public: |
51 public: |
52 enum Option |
52 enum Option |
53 { |
53 { |
54 FillWithVolume = 0x00000001, // add volume behind disname |
54 FillWithVolume = 0x00000001, // add volume behind disname |
55 FillWithDefaultVolume = 0x00000002, // add default diskname while enable FillWithVolume and volume is empty |
55 FillWithDefaultVolume = 0x00000002, // add default diskname while enable FillWithVolume and volume is empty |
56 HideUnAvailableDrive = 0x00000004 // for example: drive F when no MMC card inserted. |
56 HideUnAvailableDrive = 0x00000004, // for example: drive F when no MMC card inserted. |
|
57 FillWithTotalSize = 0x00000008, // show the drive's total size. |
|
58 FillWithFreeSize = 0x00000010 //show the drive's free size. |
57 }; |
59 }; |
58 Q_DECLARE_FLAGS(Options, Option) |
60 Q_DECLARE_FLAGS(Options, Option) |
59 |
61 |
60 explicit FmDriveModel( QObject *parent = 0, Options options = 0, |
62 explicit FmDriveModel( QObject *parent = 0, Options options = 0, |
61 FmDriveListProvider *driveListProvider = 0 ); |
63 FmDriveListProvider *driveListProvider = 0 ); |
66 int columnCount( const QModelIndex &parent = QModelIndex() ) const; |
68 int columnCount( const QModelIndex &parent = QModelIndex() ) const; |
67 QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const; |
69 QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const; |
68 QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; |
70 QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; |
69 bool indexValid( const QModelIndex &index ) const; |
71 bool indexValid( const QModelIndex &index ) const; |
70 QString driveName( const QModelIndex &index ) const; |
72 QString driveName( const QModelIndex &index ) const; |
71 QString displayString( const QModelIndex &index ) const; |
73 QVariant displayString( const QModelIndex &index ) const; |
72 |
74 |
73 private: |
75 private: |
74 QStringList mFindResult; |
76 QStringList mFindResult; |
75 FmFileIconProvider *mIconProvider; |
77 FmFileIconProvider *mIconProvider; |
76 QStringList mDriveList; |
78 QStringList mDriveList; |