summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp23
1 files changed, 14 insertions, 9 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
@@ -761,9 +761,10 @@ bool OpieFtp::populateRemoteView( )
}
void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
{
- if( selectedItem) {
+ if( selectedItem) {
+ // if(selectedItem!= NULL) {
// QCopEnvelope ( "QPE/System", "busy()" );
QString oldRemoteCurrentDir = currentRemoteDir;
QString strItem=selectedItem->text(0);
strItem=strItem.simplifyWhiteSpace();
@@ -907,12 +908,14 @@ void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &,
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)
- m->insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() ));
- else
- m->insertItem( tr( "Download" ), this, SLOT( remoteDownload() ));
+ 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() ));
m->insertSeparator();
@@ -927,12 +930,14 @@ void OpieFtp::showLocalMenu(QListViewItem * item)
QPopupMenu *m;
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)
- m->insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() ));
- else
- m->insertItem( tr( "Upload" ), this, SLOT( localUpload() ));
+ 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() ));
m->insertSeparator();