Diffstat (limited to 'libopie2/opieui/fileselector/ofileselector.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.cpp | 24 |
1 files changed, 22 insertions, 2 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 @@ -531,4 +531,12 @@ 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() { @@ -818,5 +826,5 @@ QWidget* OFileViewFileSystem::widget( QWidget* parent ) void OFileViewFileSystem::activate( const QString& str) { - m_all = ( str.find( "All" ) != -1 ); + m_all = m_view->allItem( str ); } @@ -868,4 +876,6 @@ OFileSelector::OFileSelector( QWidget* parent, int mode, int sel, m_selector = sel; + m_allList = new QStringList(); + initUI(); m_lneEdit->setText( fileName ); @@ -1024,8 +1034,10 @@ void OFileSelector::initViews() m_views.insert( QObject::tr("Directories"), in ); m_views.insert( QObject::tr("All Directories"), in ); + m_allList->append( QObject::tr("All Directories") ); } else { m_views.insert( QObject::tr("Documents"), new ODocumentFileView(this) ); m_views.insert( QObject::tr("Files"), in ); m_views.insert( QObject::tr("All Files"), in ); + m_allList->append( QObject::tr("All Files") ); } } @@ -1147,4 +1159,12 @@ 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 { @@ -1176,5 +1196,4 @@ void OFileSelector::slotViewChange( const QString& view ) return; - interface->activate( view ); if (m_current) m_stack->removeWidget( m_current->widget( m_stack ) ); @@ -1185,4 +1204,5 @@ void OFileSelector::slotViewChange( const QString& view ) m_stack->raiseWidget( id ); + interface->activate( view ); interface->reread(); m_current = interface; |