author | simon <simon> | 2002-11-08 15:16:56 (UTC) |
---|---|---|
committer | simon <simon> | 2002-11-08 15:16:56 (UTC) |
commit | c2d39953b626147400114dbde85d87bdf5081576 (patch) (unidiff) | |
tree | 137fdab93cbf9786d35a8060d0c1aebdfa552570 | |
parent | 0850f627522ed8765ffd37dfa47dc3c40fd543be (diff) | |
download | opie-c2d39953b626147400114dbde85d87bdf5081576.zip opie-c2d39953b626147400114dbde85d87bdf5081576.tar.gz opie-c2d39953b626147400114dbde85d87bdf5081576.tar.bz2 |
- for ( i; i <= numberOfEntries; i++) {
+ for ( ; i <= numberOfEntries; i++) {
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 3d97ecb..292cc9d 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -1319,129 +1319,129 @@ void OpieFtp::serverComboSelected(int index) | |||
1319 | temp.setNum(index+1); | 1319 | temp.setNum(index+1); |
1320 | remoteServerStr = cfg.readEntry( temp,""); | 1320 | remoteServerStr = cfg.readEntry( temp,""); |
1321 | 1321 | ||
1322 | qDebug("Group" +temp); | 1322 | qDebug("Group" +temp); |
1323 | cfg.setGroup(temp); | 1323 | cfg.setGroup(temp); |
1324 | // qDebug(temp); | 1324 | // qDebug(temp); |
1325 | int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); | 1325 | int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); |
1326 | port = remoteServerStr.right( divider - 1); | 1326 | port = remoteServerStr.right( divider - 1); |
1327 | bool ok; | 1327 | bool ok; |
1328 | int portInt = port.toInt(&ok,10); | 1328 | int portInt = port.toInt(&ok,10); |
1329 | if( portInt == 0) portInt = 21; | 1329 | if( portInt == 0) portInt = 21; |
1330 | 1330 | ||
1331 | ServerComboBox->lineEdit()->setText(remoteServerStr.left( remoteServerStr.find(":",0,TRUE))); | 1331 | ServerComboBox->lineEdit()->setText(remoteServerStr.left( remoteServerStr.find(":",0,TRUE))); |
1332 | 1332 | ||
1333 | PortSpinBox->setValue( portInt); | 1333 | PortSpinBox->setValue( portInt); |
1334 | 1334 | ||
1335 | remotePath->setText(cfg.readEntry("RemotePath", "/")); | 1335 | remotePath->setText(cfg.readEntry("RemotePath", "/")); |
1336 | 1336 | ||
1337 | username = cfg.readEntry("Username", "anonymous"); | 1337 | username = cfg.readEntry("Username", "anonymous"); |
1338 | UsernameComboBox->lineEdit()->setText(username); | 1338 | UsernameComboBox->lineEdit()->setText(username); |
1339 | qDebug(username); | 1339 | qDebug(username); |
1340 | // qDebug("Password is "+cfg.readEntryCrypt(username, "me@opieftp.org")); | 1340 | // qDebug("Password is "+cfg.readEntryCrypt(username, "me@opieftp.org")); |
1341 | PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org")); | 1341 | PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org")); |
1342 | // UsernameComboBox | 1342 | // UsernameComboBox |
1343 | // PasswordEdit | 1343 | // PasswordEdit |
1344 | 1344 | ||
1345 | cfg.setGroup("Server"); | 1345 | cfg.setGroup("Server"); |
1346 | temp.sprintf("%d",currentServerConfig); | 1346 | temp.sprintf("%d",currentServerConfig); |
1347 | cfg.writeEntry("currentServer", temp); | 1347 | cfg.writeEntry("currentServer", temp); |
1348 | 1348 | ||
1349 | fuckeduphack = TRUE; | 1349 | fuckeduphack = TRUE; |
1350 | serverListView->setCurrentItem( index); | 1350 | serverListView->setCurrentItem( index); |
1351 | fuckeduphack=FALSE; | 1351 | fuckeduphack=FALSE; |
1352 | qDebug("server list set selected %d",index); | 1352 | qDebug("server list set selected %d",index); |
1353 | update(); | 1353 | update(); |
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | void OpieFtp::deleteServer() | 1356 | void OpieFtp::deleteServer() |
1357 | { | 1357 | { |
1358 | QString username, remoteServerStr, remotePathStr, password, port, temp, servername; | 1358 | QString username, remoteServerStr, remotePathStr, password, port, temp, servername; |
1359 | remoteServerStr = ServerComboBox->currentText( ); | 1359 | remoteServerStr = ServerComboBox->currentText( ); |
1360 | username = UsernameComboBox->currentText(); | 1360 | username = UsernameComboBox->currentText(); |
1361 | servername=serverListView->currentText(); | 1361 | servername=serverListView->currentText(); |
1362 | 1362 | ||
1363 | Config cfg("opieftp"); | 1363 | Config cfg("opieftp"); |
1364 | cfg.setGroup("Server"); | 1364 | cfg.setGroup("Server"); |
1365 | QString tempname; | 1365 | QString tempname; |
1366 | int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); | 1366 | int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); |
1367 | 1367 | ||
1368 | for (int i = 1; i <= numberOfEntries; i++) { | 1368 | for (int i = 1; i <= numberOfEntries; i++) { |
1369 | temp.setNum(i); | 1369 | temp.setNum(i); |
1370 | // cfg.setGroup("Server"); | 1370 | // cfg.setGroup("Server"); |
1371 | cfg.setGroup(QString::number(i)); | 1371 | cfg.setGroup(QString::number(i)); |
1372 | tempname=cfg.readEntry( "ServerName",""); | 1372 | tempname=cfg.readEntry( "ServerName",""); |
1373 | 1373 | ||
1374 | if( tempname.find( servername,0,TRUE) != -1 ) { | 1374 | if( tempname.find( servername,0,TRUE) != -1 ) { |
1375 | // servername.find( cfg.readEntry("ServerName")) != -1 && | 1375 | // servername.find( cfg.readEntry("ServerName")) != -1 && |
1376 | // remoteServerStr.find( cfg.readEntry("RemotePath")) != -1 && | 1376 | // remoteServerStr.find( cfg.readEntry("RemotePath")) != -1 && |
1377 | // username.find( cfg.readEntry("Username")) != -1) { | 1377 | // username.find( cfg.readEntry("Username")) != -1) { |
1378 | 1378 | ||
1379 | serverListView->removeItem(i); | 1379 | serverListView->removeItem(i); |
1380 | 1380 | ||
1381 | qDebug("OK DELETE "+tempname); | 1381 | qDebug("OK DELETE "+tempname); |
1382 | cfg.removeEntry(QString::number(i)); | 1382 | cfg.removeEntry(QString::number(i)); |
1383 | for ( i; i <= numberOfEntries; i++) { | 1383 | for ( ; i <= numberOfEntries; i++) { |
1384 | cfg.setGroup("Server"); | 1384 | cfg.setGroup("Server"); |
1385 | cfg.writeEntry("Server", QString::number(numberOfEntries + 1 )); | 1385 | cfg.writeEntry("Server", QString::number(numberOfEntries + 1 )); |
1386 | 1386 | ||
1387 | cfg.setGroup(QString::number(i+1)); //get next server config | 1387 | cfg.setGroup(QString::number(i+1)); //get next server config |
1388 | servername=cfg.readEntry("ServerName"); | 1388 | servername=cfg.readEntry("ServerName"); |
1389 | remoteServerStr=cfg.readEntry("RemotePath"); | 1389 | remoteServerStr=cfg.readEntry("RemotePath"); |
1390 | username=cfg.readEntry("Username"); | 1390 | username=cfg.readEntry("Username"); |
1391 | password=cfg.readEntryCrypt( username); | 1391 | password=cfg.readEntryCrypt( username); |
1392 | 1392 | ||
1393 | cfg.setGroup(QString::number(i)); | 1393 | cfg.setGroup(QString::number(i)); |
1394 | 1394 | ||
1395 | cfg.writeEntry("RemotePath", remoteServerStr); | 1395 | cfg.writeEntry("RemotePath", remoteServerStr); |
1396 | cfg.writeEntry("ServerName", servername); | 1396 | cfg.writeEntry("ServerName", servername); |
1397 | cfg.writeEntry("Username", username); | 1397 | cfg.writeEntry("Username", username); |
1398 | cfg.writeEntryCrypt( username, password); | 1398 | cfg.writeEntryCrypt( username, password); |
1399 | 1399 | ||
1400 | } | 1400 | } |
1401 | cfg.setGroup("Server"); | 1401 | cfg.setGroup("Server"); |
1402 | cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries - 1 )); | 1402 | cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries - 1 )); |
1403 | } | 1403 | } |
1404 | } | 1404 | } |
1405 | cfg.setGroup(QString::number(numberOfEntries)); | 1405 | cfg.setGroup(QString::number(numberOfEntries)); |
1406 | cfg.removeEntry("Server"); | 1406 | cfg.removeEntry("Server"); |
1407 | cfg.removeEntry("RemotePath"); | 1407 | cfg.removeEntry("RemotePath"); |
1408 | cfg.removeEntry("ServerName"); | 1408 | cfg.removeEntry("ServerName"); |
1409 | username=cfg.readEntry("Username"); | 1409 | username=cfg.readEntry("Username"); |
1410 | cfg.removeEntry("Username"); | 1410 | cfg.removeEntry("Username"); |
1411 | cfg.removeEntry(username); | 1411 | cfg.removeEntry(username); |
1412 | 1412 | ||
1413 | currentServerConfig=currentServerConfig-1; | 1413 | currentServerConfig=currentServerConfig-1; |
1414 | 1414 | ||
1415 | fillCombos(); | 1415 | fillCombos(); |
1416 | update(); | 1416 | update(); |
1417 | } | 1417 | } |
1418 | 1418 | ||
1419 | void OpieFtp::upDir() | 1419 | void OpieFtp::upDir() |
1420 | { | 1420 | { |
1421 | if (TabWidget->currentPageIndex() == 0) { | 1421 | if (TabWidget->currentPageIndex() == 0) { |
1422 | QString current = currentDir.canonicalPath(); | 1422 | QString current = currentDir.canonicalPath(); |
1423 | QDir dir(current); | 1423 | QDir dir(current); |
1424 | dir.cdUp(); | 1424 | dir.cdUp(); |
1425 | current = dir.canonicalPath(); | 1425 | current = dir.canonicalPath(); |
1426 | chdir( current.latin1() ); | 1426 | chdir( current.latin1() ); |
1427 | currentDir.cd( current, TRUE); | 1427 | currentDir.cd( current, TRUE); |
1428 | populateLocalView(); | 1428 | populateLocalView(); |
1429 | update(); | 1429 | update(); |
1430 | } else { | 1430 | } else { |
1431 | if( FtpCDUp( conn) == 0) { | 1431 | if( FtpCDUp( conn) == 0) { |
1432 | QString msg; | 1432 | QString msg; |
1433 | msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn)); | 1433 | msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn)); |
1434 | msg.replace(QRegExp(":"),"\n"); | 1434 | msg.replace(QRegExp(":"),"\n"); |
1435 | QMessageBox::message(tr("Note"),msg); | 1435 | QMessageBox::message(tr("Note"),msg); |
1436 | // qDebug(msg); | 1436 | // qDebug(msg); |
1437 | } | 1437 | } |
1438 | char path[256]; | 1438 | char path[256]; |
1439 | if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string | 1439 | if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string |
1440 | QString msg; | 1440 | QString msg; |
1441 | msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn)); | 1441 | msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn)); |
1442 | msg.replace(QRegExp(":"),"\n"); | 1442 | msg.replace(QRegExp(":"),"\n"); |
1443 | QMessageBox::message(tr("Note"),msg); | 1443 | QMessageBox::message(tr("Note"),msg); |
1444 | // qDebug(msg); | 1444 | // qDebug(msg); |
1445 | } | 1445 | } |
1446 | currentRemoteDir=path; | 1446 | currentRemoteDir=path; |
1447 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | 1447 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate |