author | zecke <zecke> | 2002-06-29 10:19:59 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-29 10:19:59 (UTC) |
commit | d8508c23608ad28e0b37f26807ee35055fcabe38 (patch) (unidiff) | |
tree | 916888a027aa6312d5521c9018ff16d0432a004f /libopie | |
parent | 0252b90a4b2e7be6186518eaa12ea03ef26ae08c (diff) | |
download | opie-d8508c23608ad28e0b37f26807ee35055fcabe38.zip opie-d8508c23608ad28e0b37f26807ee35055fcabe38.tar.gz opie-d8508c23608ad28e0b37f26807ee35055fcabe38.tar.bz2 |
Fix bugs #94 and #96
-rw-r--r-- | libopie/ofileselector.cc | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc index 824acf2..3c3a6c4 100644 --- a/libopie/ofileselector.cc +++ b/libopie/ofileselector.cc | |||
@@ -330,9 +330,13 @@ QString OFileSelector::selectedName() const | |||
330 | name = lnk->file(); | 330 | name = lnk->file(); |
331 | delete lnk; | 331 | delete lnk; |
332 | }else if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ){ | 332 | }else if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ){ |
333 | QListViewItem *item = m_View->currentItem(); | 333 | if ( m_shLne ) { |
334 | if( item != 0 ) | 334 | name = m_currentDir + "/" +m_edit->text(); |
335 | name = m_currentDir + "/" + item->text( 1 ); | 335 | }else{ |
336 | QListViewItem *item = m_View->currentItem(); | ||
337 | if( item != 0 ) | ||
338 | name = m_currentDir + "/" + item->text( 1 ); | ||
339 | } | ||
336 | }else { // installed view | 340 | }else { // installed view |
337 | ; | 341 | ; |
338 | } | 342 | } |
@@ -521,10 +525,21 @@ void OFileSelector::slotMimeCheck(const QString &mime) | |||
521 | } | 525 | } |
522 | 526 | ||
523 | } | 527 | } |
528 | /* | ||
529 | * Ok if a non dir gets inserted into this combobox | ||
530 | * we need to change it | ||
531 | * QFileInfo and dirPath will give us the right Dir | ||
532 | */ | ||
524 | void OFileSelector::slotLocationActivated(const QString &file) | 533 | void OFileSelector::slotLocationActivated(const QString &file) |
525 | { | 534 | { |
526 | cd(file.left(file.find("<-",0,TRUE))); | 535 | qWarning("slotLocationActivated"); |
527 | reparse(); | 536 | QString name = file.left( file.find("<-", 0, TRUE ) ); |
537 | QFileInfo info( name ); | ||
538 | if ( info.isFile() ) | ||
539 | cd(info.dirPath( TRUE ) ); //absolute | ||
540 | else | ||
541 | cd(name ); | ||
542 | reparse(); | ||
528 | } | 543 | } |
529 | void OFileSelector::slotInsertLocationPath(const QString ¤tPath, int count) | 544 | void OFileSelector::slotInsertLocationPath(const QString ¤tPath, int count) |
530 | { | 545 | { |
@@ -544,10 +559,20 @@ void OFileSelector::slotInsertLocationPath(const QString ¤tPath, int count | |||
544 | m_location->insertStringList( pathList,-1); | 559 | m_location->insertStringList( pathList,-1); |
545 | } | 560 | } |
546 | } | 561 | } |
562 | /* | ||
563 | * Do not crash anymore | ||
564 | * don't try to change dir to a file | ||
565 | */ | ||
547 | void OFileSelector::locationComboChanged() | 566 | void OFileSelector::locationComboChanged() |
548 | { | 567 | { |
549 | cd( m_location->lineEdit()->text()); | 568 | QFileInfo info( m_location->lineEdit()->text() ); |
550 | reparse(); | 569 | qWarning("info %s %s", info.dirPath(true).latin1(), m_location->lineEdit()->text().latin1() ); |
570 | if (info.isFile() ) | ||
571 | cd(info.dirPath(TRUE) ); //absolute path | ||
572 | else | ||
573 | cd( m_location->lineEdit()->text() ); | ||
574 | |||
575 | reparse(); | ||
551 | } | 576 | } |
552 | void OFileSelector::init() | 577 | void OFileSelector::init() |
553 | { | 578 | { |