-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 | |||
@@ -1199,12 +1199,13 @@ void OFileSelector::reparse() | |||
1199 | if( m_shChooser ) { | 1199 | if( m_shChooser ) { |
1200 | currentMimeType = m_mimeCheck->currentText(); | 1200 | currentMimeType = m_mimeCheck->currentText(); |
1201 | m_mimeCheck->clear(); | 1201 | m_mimeCheck->clear(); |
1202 | 1202 | ||
1203 | // let's find possible mimetypes | 1203 | // let's find possible mimetypes |
1204 | QDir dir( m_currentDir ); | 1204 | QDir dir( m_currentDir ); |
1205 | if( dir.exists() ){ | ||
1205 | dir.setFilter( QDir::Files | QDir::Readable ); | 1206 | dir.setFilter( QDir::Files | QDir::Readable ); |
1206 | dir.setSorting( QDir::Size ); | 1207 | dir.setSorting( QDir::Size ); |
1207 | const QFileInfoList *list = dir.entryInfoList(); | 1208 | const QFileInfoList *list = dir.entryInfoList(); |
1208 | QFileInfoListIterator it( *list ); | 1209 | QFileInfoListIterator it( *list ); |
1209 | QFileInfo *fi; | 1210 | QFileInfo *fi; |
1210 | while( (fi=it.current() ) ) { | 1211 | while( (fi=it.current() ) ) { |
@@ -1222,24 +1223,26 @@ void OFileSelector::reparse() | |||
1222 | } | 1223 | } |
1223 | // add them to the chooser | 1224 | // add them to the chooser |
1224 | updateMimeCheck(); | 1225 | updateMimeCheck(); |
1225 | m_mimeCheck->setCurrentItem( indexByString( m_mimeCheck, currentMimeType ) ); | 1226 | m_mimeCheck->setCurrentItem( indexByString( m_mimeCheck, currentMimeType ) ); |
1226 | currentMimeType = m_mimeCheck->currentText(); | 1227 | currentMimeType = m_mimeCheck->currentText(); |
1227 | } | 1228 | } |
1229 | } | ||
1228 | }else { // no autoMime | 1230 | }else { // no autoMime |
1229 | // let the mimetype be set from out side the m_mimeCheck FEATURE | 1231 | // let the mimetype be set from out side the m_mimeCheck FEATURE |
1230 | 1232 | ||
1231 | if( m_shChooser ){ | 1233 | if( m_shChooser ){ |
1232 | currentMimeType = m_mimeCheck->currentText(); | 1234 | currentMimeType = m_mimeCheck->currentText(); |
1233 | // updateMimeCheck(); | 1235 | // updateMimeCheck(); |
1234 | } | 1236 | } |
1235 | } | 1237 | } |
1236 | // now we got our mimetypes we can add the files | 1238 | // now we got our mimetypes we can add the files |
1237 | 1239 | ||
1238 | QDir dir( m_currentDir ); | 1240 | QDir dir( m_currentDir ); |
1239 | 1241 | ||
1242 | if( dir.exists() ){ | ||
1240 | int sort; | 1243 | int sort; |
1241 | if ( m_case ) | 1244 | if ( m_case ) |
1242 | sort = (QDir::IgnoreCase | QDir::Name | QDir::DirsFirst | QDir::Reversed); | 1245 | sort = (QDir::IgnoreCase | QDir::Name | QDir::DirsFirst | QDir::Reversed); |
1243 | else | 1246 | else |
1244 | sort = (QDir::Name | QDir::DirsFirst | QDir::Reversed); | 1247 | sort = (QDir::Name | QDir::DirsFirst | QDir::Reversed); |
1245 | dir.setSorting( sort ); | 1248 | dir.setSorting( sort ); |
@@ -1287,12 +1290,13 @@ void OFileSelector::reparse() | |||
1287 | }else if( fi->isFile() ){ | 1290 | }else if( fi->isFile() ){ |
1288 | addFile( currentMimeType, fi ); | 1291 | addFile( currentMimeType, fi ); |
1289 | } | 1292 | } |
1290 | //qWarning( "%s", fi->fileName().latin1() ); | 1293 | //qWarning( "%s", fi->fileName().latin1() ); |
1291 | ++it; | 1294 | ++it; |
1292 | } // of while loop | 1295 | } // of while loop |
1296 | } // if ( dir.exists() ) | ||
1293 | m_View->sort(); | 1297 | m_View->sort(); |
1294 | if( m_shTool ){ | 1298 | if( m_shTool ){ |
1295 | m_location->insertItem( m_currentDir ); | 1299 | m_location->insertItem( m_currentDir ); |
1296 | 1300 | ||
1297 | } | 1301 | } |
1298 | // reenable painting and updates | 1302 | // reenable painting and updates |