summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-12 02:40:58 (UTC)
committer llornkcor <llornkcor>2002-03-12 02:40:58 (UTC)
commitc10fa05d94418620a08f25fc8d1436a2787f1446 (patch) (side-by-side diff)
tree8cd2509ff5579cd577e557a3f9696951be8c8f33
parent2b32b2dee7955b6be3fd58de9a84304405f74a40 (diff)
downloadopie-c10fa05d94418620a08f25fc8d1436a2787f1446.zip
opie-c10fa05d94418620a08f25fc8d1436a2787f1446.tar.gz
opie-c10fa05d94418620a08f25fc8d1436a2787f1446.tar.bz2
added kludge for handling symlinks on remote server
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index 151be84..e1dd582 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -424,49 +424,58 @@ bool OpieFtp::populateRemoteView()
tmp.close();
}
return true;
}
void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
{
QCopEnvelope ( "QPE/System", "busy()" );
QString strItem=selectedItem->text(0);
strItem=strItem.simplifyWhiteSpace();
if(strItem == "../") {
if( FtpCDUp( conn) == 0) {
QString msg;
msg.sprintf("Unable to change directories \n%s",FtpLastResponse(conn));
QMessageBox::message("Note",msg);
}
char path[256];
if( FtpPwd( path,sizeof(path),conn) == 0) {
QString msg;
msg.sprintf("Unable to get working dir\n%s",FtpLastResponse(conn));
QMessageBox::message("Note",msg);
}
currentRemoteDir=path;
} else {
- if(strItem.find("/",0,TRUE) != -1) {
+ if(strItem.find("->",0,TRUE) != -1) { //symlink on some servers
+ strItem=strItem.right( strItem.length() - strItem.find("->",0,TRUE)-3 );
+ strItem = strItem.stripWhiteSpace();
+ currentRemoteDir = strItem;
+ if( remoteChDir( (const QString &)strItem) ==0) {
+ QString msg;
+ msg.sprintf("Unable to change directories \n%s",FtpLastResponse(conn));
+ QMessageBox::message("Note",msg);
+ }
+ } else if(strItem.find("/",0,TRUE) != -1) {
if( remoteChDir( (const QString &)currentRemoteDir+strItem) ==0) {
QString msg;
msg.sprintf("Unable to change directories \n%s",FtpLastResponse(conn));
QMessageBox::message("Note",msg);
}
currentRemoteDir = currentRemoteDir+strItem;
} else {
qDebug("download "+strItem);
}
}
if(currentRemoteDir.right(1) !="/")
currentRemoteDir +="/";
currentPathEdit->setText( currentRemoteDir );
remoteDirList( (const QString &)currentRemoteDir);
QCopEnvelope ( "QPE/System", "notBusy()" );
}
void OpieFtp::localListClicked(QListViewItem *selectedItem)
{
QString strItem=selectedItem->text(0);
QString strSize=selectedItem->text(1);
strSize=strSize.stripWhiteSpace();
if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink
// is symlink