-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.cpp | 26 | ||||
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.h | 3 | ||||
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector_p.h | 1 |
3 files changed, 27 insertions, 3 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index 346eeae..e8d502f 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp @@ -532,2 +532,10 @@ bool OFileViewFileListView::eventFilter (QObject *, QEvent *e) +/** + * @return true if the item show all files or directories + */ +bool OFileViewFileListView::allItem( const QString& item )const +{ + return m_sel->allItem( item ); +} + void OFileViewFileListView::connectSlots() @@ -817,5 +825,5 @@ QWidget* OFileViewFileSystem::widget( QWidget* parent ) -void OFileViewFileSystem::activate( const QString& str) +void OFileViewFileSystem::activate( const QString& str ) { - m_all = ( str.find( "All" ) != -1 ); + m_all = m_view->allItem( str ); } @@ -869,2 +877,4 @@ OFileSelector::OFileSelector( QWidget* parent, int mode, int sel, + m_allList = new QStringList(); + initUI(); @@ -1025,2 +1035,3 @@ void OFileSelector::initViews() m_views.insert( QObject::tr("All Directories"), in ); + m_allList->append( QObject::tr("All Directories") ); } else { @@ -1029,2 +1040,3 @@ void OFileSelector::initViews() m_views.insert( QObject::tr("All Files"), in ); + m_allList->append( QObject::tr("All Files") ); } @@ -1148,2 +1160,10 @@ int OFileSelector::selector()const +/** + * @return true if the item show all files or directories + */ +bool OFileSelector::allItem( const QString& item )const +{ + return ( m_allList->findIndex( item ) != -1 ); +} + QStringList OFileSelector::currentMimeType()const @@ -1177,3 +1197,2 @@ void OFileSelector::slotViewChange( const QString& view ) - interface->activate( view ); if (m_current) @@ -1186,2 +1205,3 @@ void OFileSelector::slotViewChange( const QString& view ) + interface->activate( view ); interface->reread(); diff --git a/libopie2/opieui/fileselector/ofileselector.h b/libopie2/opieui/fileselector/ofileselector.h index b1cd405..d96712a 100644 --- a/libopie2/opieui/fileselector/ofileselector.h +++ b/libopie2/opieui/fileselector/ofileselector.h @@ -123,2 +123,3 @@ public: int selector()const; + bool allItem( const QString& )const; @@ -214,2 +215,4 @@ private: + QStringList* m_allList; + struct Data; // used for future versions diff --git a/libopie2/opieui/fileselector/ofileselector_p.h b/libopie2/opieui/fileselector/ofileselector_p.h index a3ef8e2..252a7f5 100644 --- a/libopie2/opieui/fileselector/ofileselector_p.h +++ b/libopie2/opieui/fileselector/ofileselector_p.h @@ -154,2 +154,3 @@ public: QString currentDir()const; + bool allItem( const QString& )const; protected: |