-rw-r--r-- | libopie/ofileselector.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc index 6a6a300..7481360 100644 --- a/libopie/ofileselector.cc +++ b/libopie/ofileselector.cc @@ -1197,16 +1197,17 @@ void OFileSelector::reparse() m_mimetypes.clear(); // ok we can change mimetype so we need to be able to give a selection if( m_shChooser ) { currentMimeType = m_mimeCheck->currentText(); m_mimeCheck->clear(); // let's find possible mimetypes QDir dir( m_currentDir ); + if( dir.exists() ){ dir.setFilter( QDir::Files | QDir::Readable ); dir.setSorting( QDir::Size ); const QFileInfoList *list = dir.entryInfoList(); QFileInfoListIterator it( *list ); QFileInfo *fi; while( (fi=it.current() ) ) { if( fi->extension() == QString::fromLatin1("desktop") ){ ++it; @@ -1220,28 +1221,30 @@ void OFileSelector::reparse() ++it; } // add them to the chooser updateMimeCheck(); m_mimeCheck->setCurrentItem( indexByString( m_mimeCheck, currentMimeType ) ); currentMimeType = m_mimeCheck->currentText(); } + } }else { // no autoMime // let the mimetype be set from out side the m_mimeCheck FEATURE if( m_shChooser ){ currentMimeType = m_mimeCheck->currentText(); // updateMimeCheck(); } } // now we got our mimetypes we can add the files QDir dir( m_currentDir ); + if( dir.exists() ){ int sort; if ( m_case ) sort = (QDir::IgnoreCase | QDir::Name | QDir::DirsFirst | QDir::Reversed); else sort = (QDir::Name | QDir::DirsFirst | QDir::Reversed); dir.setSorting( sort ); int filter; @@ -1285,15 +1288,16 @@ void OFileSelector::reparse() }else if( fi->isDir() ){ addDir( currentMimeType, fi ); }else if( fi->isFile() ){ addFile( currentMimeType, fi ); } //qWarning( "%s", fi->fileName().latin1() ); ++it; } // of while loop + } // if ( dir.exists() ) m_View->sort(); if( m_shTool ){ m_location->insertItem( m_currentDir ); } // reenable painting and updates } |