author | llornkcor <llornkcor> | 2002-03-17 01:20:09 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-17 01:20:09 (UTC) |
commit | 2fe80a98551e89b45798369f1bf91f0368382ba6 (patch) (unidiff) | |
tree | a09d8dd51306563faf3496a05cbaca987665b365 /noncore | |
parent | 6fa31a92ee5ae6b4e9df2713b0ed7b8fb39fff49 (diff) | |
download | opie-2fe80a98551e89b45798369f1bf91f0368382ba6.zip opie-2fe80a98551e89b45798369f1bf91f0368382ba6.tar.gz opie-2fe80a98551e89b45798369f1bf91f0368382ba6.tar.bz2 |
fixed problem with remote directory not being listed after an upload, and fixed
problem with temp file poop with strewn throughout the local filesystem.
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 79 | ||||
-rw-r--r-- | noncore/net/opieftp/opieftp.h | 6 |
2 files changed, 53 insertions, 32 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 | |||
@@ -76,3 +76,3 @@ OpieFtp::OpieFtp( ) | |||
76 | remoteMenu = new QPopupMenu( this ); | 76 | remoteMenu = new QPopupMenu( this ); |
77 | tabMenu = new QPopupMenu( this ); | 77 | tabMenu = new QPopupMenu( this ); |
78 | 78 | ||
@@ -85,3 +85,3 @@ OpieFtp::OpieFtp( ) | |||
85 | 85 | ||
86 | connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); | 86 | connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); |
87 | connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); | 87 | connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); |
@@ -107,3 +107,3 @@ OpieFtp::OpieFtp( ) | |||
107 | 107 | ||
108 | TabWidget = new QTabWidget( this, "TabWidget" ); | 108 | TabWidget = new QTabWidget( this, "TabWidget" ); |
109 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 3 ); | 109 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 3 ); |
@@ -150,3 +150,3 @@ OpieFtp::OpieFtp( ) | |||
150 | 150 | ||
151 | connect( Remote_View, SIGNAL( doubleClicked( QListViewItem*)), | 151 | connect( Remote_View, SIGNAL( doubleClicked( QListViewItem*)), |
152 | this,SLOT( remoteListClicked(QListViewItem *)) ); | 152 | this,SLOT( remoteListClicked(QListViewItem *)) ); |
@@ -157,3 +157,3 @@ OpieFtp::OpieFtp( ) | |||
157 | 157 | ||
158 | TabWidget->insertTab( tab_2, tr( "Remote" ) ); | 158 | TabWidget->insertTab( tab_2, tr( "Remote" ) ); |
159 | 159 | ||
@@ -207,5 +207,5 @@ OpieFtp::OpieFtp( ) | |||
207 | TextLabel4->setText( tr( "Port" ) ); | 207 | TextLabel4->setText( tr( "Port" ) ); |
208 | tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 ); | 208 | tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 ); |
209 | 209 | ||
210 | PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" ); | 210 | PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" ); |
211 | PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows ); | 211 | PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows ); |
@@ -214,3 +214,3 @@ OpieFtp::OpieFtp( ) | |||
214 | // PortSpinBox->setValue( 21); | 214 | // PortSpinBox->setValue( 21); |
215 | tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1); | 215 | tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1); |
216 | 216 | ||
@@ -219,3 +219,3 @@ OpieFtp::OpieFtp( ) | |||
219 | 219 | ||
220 | TabWidget->insertTab( tab_3, tr( "Config" ) ); | 220 | TabWidget->insertTab( tab_3, tr( "Config" ) ); |
221 | 221 | ||
@@ -230,3 +230,3 @@ OpieFtp::OpieFtp( ) | |||
230 | 230 | ||
231 | currentPathEdit->setText( currentDir.canonicalPath()); | 231 | currentPathEdit->setText( currentDir.canonicalPath()); |
232 | connect( currentPathEdit,SIGNAL(returnPressed()),this,SLOT(currentPathEditChanged())); | 232 | connect( currentPathEdit,SIGNAL(returnPressed()),this,SLOT(currentPathEditChanged())); |
@@ -248,5 +248,10 @@ void OpieFtp::cleanUp() | |||
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 | } |
@@ -258,6 +263,6 @@ void OpieFtp::tabChanged(QWidget *w) | |||
258 | } | 263 | } |
259 | if (TabWidget->currentPageIndex() == 1) { | 264 | if (TabWidget->currentPageIndex() == 1) { |
260 | currentPathEdit->setText( currentRemoteDir ); | 265 | currentPathEdit->setText( currentRemoteDir ); |
261 | } | 266 | } |
262 | if (TabWidget->currentPageIndex() == 2) { | 267 | if (TabWidget->currentPageIndex() == 2) { |
263 | } | 268 | } |
@@ -297,3 +302,3 @@ void OpieFtp::localUpload() | |||
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()" ); |
@@ -399,4 +404,10 @@ 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; |
@@ -408,3 +419,3 @@ bool OpieFtp::remoteDirList(const QString &dir) | |||
408 | } | 419 | } |
409 | populateRemoteView(); | 420 | populateRemoteView() ; |
410 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 421 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
@@ -465,6 +476,12 @@ void OpieFtp::populateLocalView() | |||
465 | 476 | ||
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; |
@@ -472,4 +489,4 @@ bool OpieFtp::populateRemoteView() | |||
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()) { |
@@ -487,5 +504,8 @@ bool OpieFtp::populateRemoteView() | |||
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; |
@@ -524,3 +544,2 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | |||
524 | strItem=""; | 544 | strItem=""; |
525 | populateRemoteView(); | ||
526 | qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); | 545 | qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); |
@@ -534,3 +553,2 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | |||
534 | 553 | ||
535 | populateRemoteView(); | ||
536 | } else { | 554 | } else { |
@@ -542,2 +560,3 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | |||
542 | } | 560 | } |
561 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | ||
543 | if(currentRemoteDir.right(1) !="/") | 562 | if(currentRemoteDir.right(1) !="/") |
@@ -545,3 +564,2 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | |||
545 | currentPathEdit->setText( currentRemoteDir ); | 564 | currentPathEdit->setText( currentRemoteDir ); |
546 | remoteDirList( (const QString &)currentRemoteDir); | ||
547 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 565 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
@@ -726,4 +744,4 @@ void OpieFtp::remoteMakDir() | |||
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 | } |
@@ -746,2 +764,4 @@ void OpieFtp::remoteDelete() | |||
746 | } | 764 | } |
765 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | ||
766 | |||
747 | } | 767 | } |
@@ -760,2 +780,3 @@ void OpieFtp::remoteDelete() | |||
760 | } | 780 | } |
781 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | ||
761 | } | 782 | } |
@@ -785,4 +806,4 @@ void OpieFtp::remoteRename() | |||
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 | } |
diff --git a/noncore/net/opieftp/opieftp.h b/noncore/net/opieftp/opieftp.h index e3ff334..1e5fffa 100644 --- a/noncore/net/opieftp/opieftp.h +++ b/noncore/net/opieftp/opieftp.h | |||
@@ -91,5 +91,5 @@ protected slots: | |||
91 | void currentPathEditChanged(); | 91 | void currentPathEditChanged(); |
92 | void switchToLocalTab(); | 92 | void switchToLocalTab(); |
93 | void switchToRemoteTab(); | 93 | void switchToRemoteTab(); |
94 | void switchToConfigTab(); | 94 | void switchToConfigTab(); |
95 | protected: | 95 | protected: |