Diffstat (limited to 'noncore/net/opieftp/opieftp.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 51 |
1 files changed, 36 insertions, 15 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 042ed59..6a3a64d 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -247,7 +247,12 @@ void OpieFtp::cleanUp() | |||
247 | if(conn) | 247 | if(conn) |
248 | FtpQuit(conn); | 248 | FtpQuit(conn); |
249 | QFile f("./._temp"); | 249 | QString sfile=QDir::homeDirPath(); |
250 | if(f.exists()) | 250 | if(sfile.right(1) != "/") |
251 | f. remove(); | 251 | sfile+="/._temp"; |
252 | else | ||
253 | sfile+="._temp"; | ||
254 | QFile file( sfile); | ||
255 | if(file.exists()) | ||
256 | file.remove(); | ||
252 | } | 257 | } |
253 | 258 | ||
@@ -296,5 +301,5 @@ void OpieFtp::localUpload() | |||
296 | } | 301 | } |
297 | TabWidget->setCurrentPage(1); | 302 | TabWidget->setCurrentPage(1); |
298 | populateRemoteView(); | 303 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate |
299 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 304 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
300 | } | 305 | } |
@@ -398,6 +403,12 @@ void OpieFtp::disConnector() | |||
398 | bool OpieFtp::remoteDirList(const QString &dir) | 403 | bool OpieFtp::remoteDirList(const QString &dir) |
399 | { | 404 | { |
405 | QString tmp = QDir::homeDirPath(); | ||
406 | if(tmp.right(1) != "/") | ||
407 | tmp+="/._temp"; | ||
408 | else | ||
409 | tmp+="._temp"; | ||
410 | // qDebug("Listing remote dir "+tmp); | ||
400 | QCopEnvelope ( "QPE/System", "busy()" ); | 411 | QCopEnvelope ( "QPE/System", "busy()" ); |
401 | if (!FtpDir( "./._temp", dir.latin1(), conn) ) { | 412 | if (!FtpDir( tmp.latin1(), dir.latin1(), conn) ) { |
402 | QString msg; | 413 | QString msg; |
403 | msg.sprintf("Unable to list the directory\n"+dir+"\n%s",FtpLastResponse(conn) ); | 414 | msg.sprintf("Unable to list the directory\n"+dir+"\n%s",FtpLastResponse(conn) ); |
@@ -466,11 +477,17 @@ void OpieFtp::populateLocalView() | |||
466 | bool OpieFtp::populateRemoteView() | 477 | bool OpieFtp::populateRemoteView() |
467 | { | 478 | { |
479 | // qDebug("populate remoteview"); | ||
480 | QString sfile=QDir::homeDirPath(); | ||
481 | if(sfile.right(1) != "/") | ||
482 | sfile+="/._temp"; | ||
483 | else | ||
484 | sfile+="._temp"; | ||
485 | QFile file( sfile); | ||
468 | Remote_View->clear(); | 486 | Remote_View->clear(); |
469 | QFile tmp("./._temp"); | ||
470 | QString s, File_Name; | 487 | QString s, File_Name; |
471 | QString fileL, fileS, fileDate; | 488 | QString fileL, fileS, fileDate; |
472 | new QListViewItem( Remote_View, "../"); | 489 | new QListViewItem( Remote_View, "../"); |
473 | if (tmp.open(IO_ReadOnly)) { | 490 | if ( file.open(IO_ReadOnly)) { |
474 | QTextStream t( &tmp ); // use a text stream | 491 | QTextStream t( &file ); // use a text stream |
475 | while ( !t.eof()) { | 492 | while ( !t.eof()) { |
476 | s = t.readLine(); | 493 | s = t.readLine(); |
@@ -486,7 +503,10 @@ bool OpieFtp::populateRemoteView() | |||
486 | new QListViewItem( Remote_View, fileL, fileS, fileDate); | 503 | new QListViewItem( Remote_View, fileL, fileS, fileDate); |
487 | } | 504 | } |
488 | tmp.close(); | 505 | file.close(); |
506 | if( file.exists()) | ||
507 | file. remove(); | ||
489 | } else | 508 | } else |
490 | qDebug("temp file not opened successfullly"); | 509 | qDebug("temp file not opened successfullly "+sfile); |
510 | |||
491 | return true; | 511 | return true; |
492 | } | 512 | } |
@@ -523,5 +543,4 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | |||
523 | currentRemoteDir = oldRemoteCurrentDir; | 543 | currentRemoteDir = oldRemoteCurrentDir; |
524 | strItem=""; | 544 | strItem=""; |
525 | populateRemoteView(); | ||
526 | qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); | 545 | qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); |
527 | } | 546 | } |
@@ -533,5 +552,4 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | |||
533 | qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); | 552 | qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); |
534 | 553 | ||
535 | populateRemoteView(); | ||
536 | } else { | 554 | } else { |
537 | currentRemoteDir = currentRemoteDir+strItem; | 555 | currentRemoteDir = currentRemoteDir+strItem; |
@@ -541,8 +559,8 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | |||
541 | } | 559 | } |
542 | } | 560 | } |
561 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | ||
543 | if(currentRemoteDir.right(1) !="/") | 562 | if(currentRemoteDir.right(1) !="/") |
544 | currentRemoteDir +="/"; | 563 | currentRemoteDir +="/"; |
545 | currentPathEdit->setText( currentRemoteDir ); | 564 | currentPathEdit->setText( currentRemoteDir ); |
546 | remoteDirList( (const QString &)currentRemoteDir); | ||
547 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 565 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
548 | } | 566 | } |
@@ -725,6 +743,6 @@ void OpieFtp::remoteMakDir() | |||
725 | } | 743 | } |
726 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 744 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
745 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | ||
727 | } | 746 | } |
728 | populateRemoteView(); | ||
729 | } | 747 | } |
730 | 748 | ||
@@ -745,4 +763,6 @@ void OpieFtp::remoteDelete() | |||
745 | QMessageBox::message("Note",msg); | 763 | QMessageBox::message("Note",msg); |
746 | } | 764 | } |
765 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | ||
766 | |||
747 | } | 767 | } |
748 | break; | 768 | break; |
@@ -759,4 +779,5 @@ void OpieFtp::remoteDelete() | |||
759 | QMessageBox::message("Note",msg); | 779 | QMessageBox::message("Note",msg); |
760 | } | 780 | } |
781 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | ||
761 | } | 782 | } |
762 | break; | 783 | break; |
@@ -784,6 +805,6 @@ void OpieFtp::remoteRename() | |||
784 | } | 805 | } |
785 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 806 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
807 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | ||
786 | } | 808 | } |
787 | populateRemoteView(); | ||
788 | } | 809 | } |
789 | 810 | ||