summaryrefslogtreecommitdiff
path: root/noncore/net/opieftp/opieftp.cpp
authorllornkcor <llornkcor>2004-07-07 21:00:39 (UTC)
committer llornkcor <llornkcor>2004-07-07 21:00:39 (UTC)
commit30d8a50aba298e26a3d3cc1d5b6a0c69c1d2783d (patch) (side-by-side diff)
tree686ad6e5b4873c5c3046442e106c99cb6f9a0907 /noncore/net/opieftp/opieftp.cpp
parente6a4d3d3e45f1a39aafb3ecfe298611621590d22 (diff)
downloadopie-30d8a50aba298e26a3d3cc1d5b6a0c69c1d2783d.zip
opie-30d8a50aba298e26a3d3cc1d5b6a0c69c1d2783d.tar.gz
opie-30d8a50aba298e26a3d3cc1d5b6a0c69c1d2783d.tar.bz2
bug fix 1267
Diffstat (limited to 'noncore/net/opieftp/opieftp.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index aa4314a..817943b 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -39,13 +39,12 @@ using namespace Opie::Core;
#include <qlayout.h>
#include <qmessagebox.h>
#include <qmenubar.h>
#include <qlineedit.h>
#include <qlistbox.h>
#include <qvbox.h>
-
/* STD */
#include <unistd.h>
#include <stdlib.h>
QProgressBar *ProgressBar;
static netbuf *conn=NULL;
@@ -299,42 +298,36 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl)
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
tabLayout_3->addItem( spacer, 5, 0 );
TabWidget->insertTab( tab_3, tr( "Config" ) );
-#if 0
connect(TabWidget,SIGNAL(currentChanged(QWidget*)),
this,SLOT(tabChanged(QWidget*)));
-#endif
currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
currentDir.setPath( QDir::currentDirPath());
// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
currentPathCombo = new QComboBox( FALSE, view, "currentPathCombo" );
layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 4);
currentPathCombo ->setFixedWidth(220);
currentPathCombo->setEditable(TRUE);
currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
-#if 0
connect( currentPathCombo, SIGNAL( activated(const QString&) ),
this, SLOT( currentPathComboActivated(const QString&) ) );
connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()),
this,SLOT(currentPathComboChanged()));
-#endif
ProgressBar = new QProgressBar( view, "ProgressBar" );
layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4);
ProgressBar->setMaximumHeight(10);
filterStr="*";
b=FALSE;
-#if 0
populateLocalView();
-#endif
readConfig();
// ServerComboBox->setCurrentItem(currentServerConfig);
TabWidget->setCurrentPage(2);
odebug << "Constructor done" << oendl;
@@ -664,28 +657,30 @@ void OpieFtp::populateLocalView()
const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
QFileInfoListIterator it(*list);
QFileInfo *fi;
while ( (fi=it.current()) ) {
if (fi->isSymLink() ){
QString symLink=fi->readLink();
- odebug << "Symlink detected "+symLink << oendl;
+// odebug << "Symlink detected "+symLink << oendl;
QFileInfo sym( symLink);
fileS.sprintf( "%10i", sym.size() );
fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() );
fileDate = sym.lastModified().toString();
} else {
- odebug << "Not a dir: "+currentDir.canonicalPath()+fileL << oendl;
+// odebug << "Not a dir: "+currentDir.canonicalPath()+fileL << oendl;
fileS.sprintf( "%10i", fi->size() );
fileL.sprintf( "%s",fi->fileName().data() );
fileDate= fi->lastModified().toString();
if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) {
fileL+="/";
isDir=TRUE;
- odebug << fileL << oendl;
+// odebug << fileL << oendl;
}
}
+
+
if(fileL !="./" && fi->exists()) {
item = new QListViewItem( Local_View,fileL, fileDate, fileS );
QPixmap pm;
if(isDir || fileL.find("/",0,TRUE) != -1) {
if( !QDir( fi->filePath() ).isReadable())
@@ -715,13 +710,13 @@ void OpieFtp::populateLocalView()
}
isDir=FALSE;
++it;
}
Local_View->setSorting( 3,FALSE);
currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() );
- fillCombo( (const QString &)currentDir);
+ // fillCombo( (const QString &)currentDir);
}
bool OpieFtp::populateRemoteView( )
{
// odebug << "populate remoteview" << oendl;
QString sfile=QDir::homeDirPath();
@@ -1142,21 +1137,26 @@ void OpieFtp::currentPathComboActivated(const QString & currentPath) {
// update();
}
}
void OpieFtp::fillCombo(const QString &currentPath) {
-
+ qDebug("Fill Combo "+currentPath);
currentPathCombo->lineEdit()->setText(currentPath);
+
if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
+ qDebug("Clearing local");
currentPathCombo->clear();
localDirPathStringList.prepend(currentPath );
currentPathCombo->insertStringList( localDirPathStringList,-1);
}
+
currentPathCombo->lineEdit()->setText(currentPath);
+
if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
+ qDebug("Clearing remote");
currentPathCombo->clear();
remoteDirPathStringList.prepend(currentPath );
currentPathCombo->insertStringList( remoteDirPathStringList,-1);
}
}
@@ -1284,12 +1284,13 @@ void OpieFtp::clearCombos() {
}
void OpieFtp::fillCombos()
{
clearCombos();
+ qDebug("did we get here yet?");
Config cfg("opieftp");
cfg.setGroup("Server");
QString username, remoteServerStr, remotePathStr, password, port, temp;
int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);