summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp51
-rw-r--r--noncore/net/opieftp/opieftp.h0
2 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()
if(conn)
FtpQuit(conn);
- QFile f("./._temp");
- if(f.exists())
- f. remove();
+ QString sfile=QDir::homeDirPath();
+ if(sfile.right(1) != "/")
+ sfile+="/._temp";
+ else
+ sfile+="._temp";
+ QFile file( sfile);
+ if(file.exists())
+ file.remove();
}
@@ -296,5 +301,5 @@ void OpieFtp::localUpload()
}
TabWidget->setCurrentPage(1);
- populateRemoteView();
+ remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
QCopEnvelope ( "QPE/System", "notBusy()" );
}
@@ -398,6 +403,12 @@ void OpieFtp::disConnector()
bool OpieFtp::remoteDirList(const QString &dir)
{
+ QString tmp = QDir::homeDirPath();
+ if(tmp.right(1) != "/")
+ tmp+="/._temp";
+ else
+ tmp+="._temp";
+// qDebug("Listing remote dir "+tmp);
QCopEnvelope ( "QPE/System", "busy()" );
- if (!FtpDir( "./._temp", dir.latin1(), conn) ) {
+ if (!FtpDir( tmp.latin1(), dir.latin1(), conn) ) {
QString msg;
msg.sprintf("Unable to list the directory\n"+dir+"\n%s",FtpLastResponse(conn) );
@@ -466,11 +477,17 @@ void OpieFtp::populateLocalView()
bool OpieFtp::populateRemoteView()
{
+// qDebug("populate remoteview");
+ QString sfile=QDir::homeDirPath();
+ if(sfile.right(1) != "/")
+ sfile+="/._temp";
+ else
+ sfile+="._temp";
+ QFile file( sfile);
Remote_View->clear();
- QFile tmp("./._temp");
QString s, File_Name;
QString fileL, fileS, fileDate;
new QListViewItem( Remote_View, "../");
- if (tmp.open(IO_ReadOnly)) {
- QTextStream t( &tmp ); // use a text stream
+ if ( file.open(IO_ReadOnly)) {
+ QTextStream t( &file ); // use a text stream
while ( !t.eof()) {
s = t.readLine();
@@ -486,7 +503,10 @@ bool OpieFtp::populateRemoteView()
new QListViewItem( Remote_View, fileL, fileS, fileDate);
}
- tmp.close();
+ file.close();
+ if( file.exists())
+ file. remove();
} else
- qDebug("temp file not opened successfullly");
+ qDebug("temp file not opened successfullly "+sfile);
+
return true;
}
@@ -523,5 +543,4 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
currentRemoteDir = oldRemoteCurrentDir;
strItem="";
- populateRemoteView();
qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir);
}
@@ -533,5 +552,4 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir);
- populateRemoteView();
} else {
currentRemoteDir = currentRemoteDir+strItem;
@@ -541,8 +559,8 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
}
}
+ remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
if(currentRemoteDir.right(1) !="/")
currentRemoteDir +="/";
currentPathEdit->setText( currentRemoteDir );
- remoteDirList( (const QString &)currentRemoteDir);
QCopEnvelope ( "QPE/System", "notBusy()" );
}
@@ -725,6 +743,6 @@ void OpieFtp::remoteMakDir()
}
QCopEnvelope ( "QPE/System", "notBusy()" );
+ remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
}
- populateRemoteView();
}
@@ -745,4 +763,6 @@ void OpieFtp::remoteDelete()
QMessageBox::message("Note",msg);
}
+ remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
+
}
break;
@@ -759,4 +779,5 @@ void OpieFtp::remoteDelete()
QMessageBox::message("Note",msg);
}
+ remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
}
break;
@@ -784,6 +805,6 @@ void OpieFtp::remoteRename()
}
QCopEnvelope ( "QPE/System", "notBusy()" );
+ remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
}
- populateRemoteView();
}
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