summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-24 17:03:37 (UTC)
committer llornkcor <llornkcor>2002-03-24 17:03:37 (UTC)
commit6ce8bbff9eb16e0d731755010bda63e7fb43f70b (patch) (unidiff)
tree0f3cf5476398743f86fa6d884d86751a7251df3e
parent368d5032f4ff4566dea1e99aa2bb782300e0bfd5 (diff)
downloadopie-6ce8bbff9eb16e0d731755010bda63e7fb43f70b.zip
opie-6ce8bbff9eb16e0d731755010bda63e7fb43f70b.tar.gz
opie-6ce8bbff9eb16e0d731755010bda63e7fb43f70b.tar.bz2
config last server on startup
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp46
1 files changed, 17 insertions, 29 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index e2a6cad..e97a9bf 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -153,2 +153,4 @@ OpieFtp::OpieFtp( )
153 Remote_View->setColumnAlignment(2,QListView::AlignRight); 153 Remote_View->setColumnAlignment(2,QListView::AlignRight);
154 Remote_View->addColumn( tr("Dir"),-1);
155 Remote_View->setColumnAlignment(4,QListView::AlignRight);
154 Remote_View->setAllColumnsShowFocus(TRUE); 156 Remote_View->setAllColumnsShowFocus(TRUE);
@@ -245,4 +247,3 @@ OpieFtp::OpieFtp( )
245 247
246 serverComboSelected(0); 248// fillCombos();
247 fillCombos();
248 249
@@ -262,2 +263,4 @@ OpieFtp::OpieFtp( )
262 populateLocalView(); 263 populateLocalView();
264 readConfig();
265 ServerComboBox->setCurrentItem(currentServerConfig);
263 TabWidget->setCurrentPage(2); 266 TabWidget->setCurrentPage(2);
@@ -583,6 +586,6 @@ bool OpieFtp::populateRemoteView( )
583 if(fileL.find("total",0,TRUE) == -1) { 586 if(fileL.find("total",0,TRUE) == -1) {
584 QListViewItem * item = new QListViewItem( Remote_View, fileL, fileS, fileDate);
585 if(s.left(1) == "d" || fileL.find("/",0,TRUE) != -1) { 587 if(s.left(1) == "d" || fileL.find("/",0,TRUE) != -1) {
588 QListViewItem * item = new QListViewItem( Remote_View, fileL, fileS, fileDate,"d");
586 item->setPixmap( 0, Resource::loadPixmap( "folder" )); 589 item->setPixmap( 0, Resource::loadPixmap( "folder" ));
587 if(itemDir) 590// if(itemDir)
588 item->moveItem(itemDir); 591 item->moveItem(itemDir);
@@ -590,4 +593,6 @@ bool OpieFtp::populateRemoteView( )
590 } else { 593 } else {
594 QListViewItem * item = new QListViewItem( Remote_View, fileL, fileS, fileDate,"f");
591 item->setPixmap( 0, Resource::loadPixmap( "fileopen" )); 595 item->setPixmap( 0, Resource::loadPixmap( "fileopen" ));
592 if(itemFile) 596// if(itemFile)
597 item->moveItem(itemDir);
593 item->moveItem(itemFile); 598 item->moveItem(itemFile);
@@ -605,3 +610,2 @@ bool OpieFtp::populateRemoteView( )
605 Remote_View->setSorting( 4,TRUE); 610 Remote_View->setSorting( 4,TRUE);
606
607 return true; 611 return true;
@@ -974,27 +978,7 @@ void OpieFtp::readConfig()
974{ 978{
975 979 fillCombos();
976 Config cfg("opieftp"); 980 Config cfg("opieftp");
977 cfg.setGroup("Server"); 981 cfg.setGroup("Server");
978 QString username, remoteServer, remotePathStr, password, port, temp; 982 currentServerConfig = cfg.readNumEntry("currentServer", -1);
979 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); 983 serverComboSelected( currentServerConfig);
980 for (int i = 0; i <= numberOfEntries; i++) {
981 temp.setNum(i+1);
982 cfg.setGroup("Server");
983 remoteServer = cfg.readEntry( temp,"");
984 ServerComboBox->insertItem( remoteServer );
985 cfg.setGroup(temp);
986
987 remotePathStr = cfg.readEntry(remoteServer,"");
988 int divider = remoteServer.length() - remoteServer.find(":",0,TRUE);
989 port = remoteServer.right( divider+1);
990 bool ok;
991 PortSpinBox->setValue( port.toInt(&ok,10));
992
993 remoteServer = remoteServer.left(divider - 1);
994 remotePath->setText( remotePathStr);
995 username = cfg.readEntry(temp);
996 UsernameComboBox->insertItem(username);
997 password = cfg.readEntryCrypt(username,"");
998 PasswordEdit->setText(password);
999 }
1000} 984}
@@ -1090,2 +1074,6 @@ void OpieFtp::serverComboSelected(int index)
1090 PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org")); 1074 PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org"));
1075
1076 cfg.setGroup("Server");
1077 temp.sprintf("%d",currentServerConfig);
1078 cfg.writeEntry("currentServer", temp);
1091 update(); 1079 update();