author | kergoth <kergoth> | 2003-01-26 22:45:27 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-01-26 22:45:27 (UTC) |
commit | 954ff2a858b34a8249314340f799f0a74426d59c (patch) (side-by-side diff) | |
tree | f0b738dceaec14bba0347151db4f372d25cdf8e8 | |
parent | 4ce67fbdfb5e82bbde3a8963d3e956567438689d (diff) | |
download | opie-954ff2a858b34a8249314340f799f0a74426d59c.zip opie-954ff2a858b34a8249314340f799f0a74426d59c.tar.gz opie-954ff2a858b34a8249314340f799f0a74426d59c.tar.bz2 |
Added two missing dir.exists() checks, without which a segfault occurs if m_currentDir doesnt exist.
-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 @@ -1202,6 +1202,7 @@ void OFileSelector::reparse() // 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(); @@ -1225,6 +1226,7 @@ void OFileSelector::reparse() 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 @@ -1237,6 +1239,7 @@ void OFileSelector::reparse() QDir dir( m_currentDir ); + if( dir.exists() ){ int sort; if ( m_case ) sort = (QDir::IgnoreCase | QDir::Name | QDir::DirsFirst | QDir::Reversed); @@ -1290,6 +1293,7 @@ void OFileSelector::reparse() //qWarning( "%s", fi->fileName().latin1() ); ++it; } // of while loop + } // if ( dir.exists() ) m_View->sort(); if( m_shTool ){ m_location->insertItem( m_currentDir ); |