author | llornkcor <llornkcor> | 2003-06-17 01:07:27 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-06-17 01:07:27 (UTC) |
commit | f48df16919769a1abb73eab9d229659a792a6b8a (patch) (side-by-side diff) | |
tree | f1368b9f2d7c9656805d13d4f2c92bebf5f6b625 | |
parent | fc79272790448b77eeb7e656d80ce1b799c5cd38 (diff) | |
download | opie-f48df16919769a1abb73eab9d229659a792a6b8a.zip opie-f48df16919769a1abb73eab9d229659a792a6b8a.tar.gz opie-f48df16919769a1abb73eab9d229659a792a6b8a.tar.bz2 |
fix crash on menu - no item selected
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 668a03d..269449e 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp @@ -763,6 +763,7 @@ bool OpieFtp::populateRemoteView( ) void OpieFtp::remoteListClicked(QListViewItem *selectedItem) { if( selectedItem) { + // if(selectedItem!= NULL) { // QCopEnvelope ( "QPE/System", "busy()" ); QString oldRemoteCurrentDir = currentRemoteDir; QString strItem=selectedItem->text(0); @@ -908,10 +909,12 @@ void OpieFtp::showRemoteMenu(QListViewItem * item) { QPopupMenu * m;// = new QPopupMenu( Local_View ); m = new QPopupMenu(this); - if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) != -1) + if(item != NULL ) { + if( item->text(0).find("/",0,TRUE) != -1) m->insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() )); else m->insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); + } m->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); m->insertItem( tr("Rescan"), this, SLOT( populateLocalView() )); m->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); @@ -928,10 +931,12 @@ void OpieFtp::showLocalMenu(QListViewItem * item) m = new QPopupMenu( this); m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); m->insertSeparator(); - if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1) + if(item != NULL ) { + if( item->text(0).find("/",0,TRUE) !=-1) m->insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); else m->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); + } m->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); m->insertItem( tr("Rescan"), this, SLOT( populateRemoteView() )); m->insertItem( tr( "Rename" ), this, SLOT( localRename() )); |