-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 46 |
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( ) Remote_View->setColumnAlignment(2,QListView::AlignRight); + Remote_View->addColumn( tr("Dir"),-1); + Remote_View->setColumnAlignment(4,QListView::AlignRight); Remote_View->setAllColumnsShowFocus(TRUE); @@ -245,4 +247,3 @@ OpieFtp::OpieFtp( ) - serverComboSelected(0); - fillCombos(); +// fillCombos(); @@ -262,2 +263,4 @@ OpieFtp::OpieFtp( ) populateLocalView(); + readConfig(); + ServerComboBox->setCurrentItem(currentServerConfig); TabWidget->setCurrentPage(2); @@ -583,6 +586,6 @@ bool OpieFtp::populateRemoteView( ) if(fileL.find("total",0,TRUE) == -1) { - QListViewItem * item = new QListViewItem( Remote_View, fileL, fileS, fileDate); if(s.left(1) == "d" || fileL.find("/",0,TRUE) != -1) { + QListViewItem * item = new QListViewItem( Remote_View, fileL, fileS, fileDate,"d"); item->setPixmap( 0, Resource::loadPixmap( "folder" )); - if(itemDir) +// if(itemDir) item->moveItem(itemDir); @@ -590,4 +593,6 @@ bool OpieFtp::populateRemoteView( ) } else { + QListViewItem * item = new QListViewItem( Remote_View, fileL, fileS, fileDate,"f"); item->setPixmap( 0, Resource::loadPixmap( "fileopen" )); - if(itemFile) +// if(itemFile) + item->moveItem(itemDir); item->moveItem(itemFile); @@ -605,3 +610,2 @@ bool OpieFtp::populateRemoteView( ) Remote_View->setSorting( 4,TRUE); - return true; @@ -974,27 +978,7 @@ void OpieFtp::readConfig() { - + fillCombos(); Config cfg("opieftp"); cfg.setGroup("Server"); - QString username, remoteServer, remotePathStr, password, port, temp; - int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); - for (int i = 0; i <= numberOfEntries; i++) { - temp.setNum(i+1); - cfg.setGroup("Server"); - remoteServer = cfg.readEntry( temp,""); - ServerComboBox->insertItem( remoteServer ); - cfg.setGroup(temp); - - remotePathStr = cfg.readEntry(remoteServer,""); - int divider = remoteServer.length() - remoteServer.find(":",0,TRUE); - port = remoteServer.right( divider+1); - bool ok; - PortSpinBox->setValue( port.toInt(&ok,10)); - - remoteServer = remoteServer.left(divider - 1); - remotePath->setText( remotePathStr); - username = cfg.readEntry(temp); - UsernameComboBox->insertItem(username); - password = cfg.readEntryCrypt(username,""); - PasswordEdit->setText(password); - } + currentServerConfig = cfg.readNumEntry("currentServer", -1); + serverComboSelected( currentServerConfig); } @@ -1090,2 +1074,6 @@ void OpieFtp::serverComboSelected(int index) PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org")); + + cfg.setGroup("Server"); + temp.sprintf("%d",currentServerConfig); + cfg.writeEntry("currentServer", temp); update(); |