summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/ftplib/ftplib.c (renamed from noncore/net/opieftp/ftplib.c)60
-rw-r--r--noncore/net/ftplib/ftplib.control9
-rw-r--r--noncore/net/ftplib/ftplib.h (renamed from noncore/net/opieftp/ftplib.h)0
-rw-r--r--noncore/net/ftplib/ftplib.pro6
-rw-r--r--noncore/net/opieftp/opieftp.control2
-rw-r--r--noncore/net/opieftp/opieftp.cpp6
-rw-r--r--noncore/net/opieftp/opieftp.h2
-rw-r--r--noncore/net/opieftp/opieftp.pro4
8 files changed, 81 insertions, 8 deletions
diff --git a/noncore/net/opieftp/ftplib.c b/noncore/net/ftplib/ftplib.c
index 5116170..421f855 100644
--- a/noncore/net/opieftp/ftplib.c
+++ b/noncore/net/ftplib/ftplib.c
@@ -1,85 +1,97 @@
1/***************************************************************************/ 1/***************************************************************************/
2/* ftplib.c - callable ftp access routines */ 2/* ftplib.c - callable ftp access routines */
3/* Copyright (C) 1996-2000 Thomas Pfau, pfau@cnj.digex.net */ 3/* Copyright (C) 1996-2000 Thomas Pfau, pfau@cnj.digex.net */
4/* 73 Catherine Street, South Bound Brook, NJ, 08880 */ 4/* 73 Catherine Street, South Bound Brook, NJ, 08880 */
5/* */ 5/* */
6/* This library is free software; you can redistribute it and/or */ 6/* This library is free software; you can redistribute it and/or */
7/* modify it under the terms of the GNU Library General Public */ 7/* modify it under the terms of the GNU Library General Public */
8/* License as published by the Free Software Foundation; either */ 8/* License as published by the Free Software Foundation; either */
9/* version 2 of the License, or (at your option) any later version. */ 9/* version 2 of the License, or (at your option) any later version. */
10/* */ 10/* */
11/* This library is distributed in the hope that it will be useful, */ 11/* This library is distributed in the hope that it will be useful, */
12/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 12/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
13/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ 13/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
14/* Library General Public License for more details. */ 14/* Library General Public License for more details. */
15/* */ 15/* */
16/* You should have received a copy of the GNU Library General Public */ 16/* You should have received a copy of the GNU Library General Public */
17/* License along with this progam; if not, write to the */ 17/* License along with this progam; if not, write to the */
18/* Free Software Foundation, Inc., 59 Temple Place - Suite 330, */ 18/* Free Software Foundation, Inc., 59 Temple Place - Suite 330, */
19/* Boston, MA 02111-1307, USA. */ 19/* Boston, MA 02111-1307, USA. */
20/* */ 20/* */
21/***************************************************************************/ 21/***************************************************************************/
22 22// changes made by Lorn Potter <llornkcor@handhelds.org>
23//
23#if defined(__unix__) || defined(__VMS) 24#if defined(__unix__) || defined(__VMS)
24#include <unistd.h> 25#include <unistd.h>
25#endif 26#endif
26#if defined(_WIN32) 27#if defined(_WIN32)
27#include <windows.h> 28#include <windows.h>
28#endif 29#endif
30
29#include <stdio.h> 31#include <stdio.h>
30#include <stdlib.h> 32#include <stdlib.h>
31#include <string.h> 33#include <string.h>
32#include <errno.h> 34#include <errno.h>
33#include <ctype.h> 35#include <ctype.h>
36
34#if defined(__unix__) 37#if defined(__unix__)
38
39#include <sys/types.h>
40#include <unistd.h>
41#include <fcntl.h>
35#include <sys/time.h> 42#include <sys/time.h>
36#include <sys/types.h> 43#include <sys/types.h>
37#include <sys/socket.h> 44#include <sys/socket.h>
38#include <netinet/in.h> 45#include <netinet/in.h>
39#include <netdb.h> 46#include <netdb.h>
40#include <arpa/inet.h> 47#include <arpa/inet.h>
48
41#elif defined(VMS) 49#elif defined(VMS)
50
42#include <types.h> 51#include <types.h>
43#include <socket.h> 52#include <socket.h>
44#include <in.h> 53#include <in.h>
45#include <netdb.h> 54#include <netdb.h>
46#include <inet.h> 55#include <inet.h>
56
47#elif defined(_WIN32) 57#elif defined(_WIN32)
58
48#include <winsock.h> 59#include <winsock.h>
60
49#endif 61#endif
50 62
51#define BUILDING_LIBRARY 63#define BUILDING_LIBRARY
52#include "ftplib.h" 64#include "ftplib.h"
53 65
54#if defined(_WIN32) 66#if defined(_WIN32)
55#define SETSOCKOPT_OPTVAL_TYPE (const char *) 67#define SETSOCKOPT_OPTVAL_TYPE (const char *)
56#else 68#else
57#define SETSOCKOPT_OPTVAL_TYPE (void *) 69#define SETSOCKOPT_OPTVAL_TYPE (void *)
58#endif 70#endif
59 71
60#define FTPLIB_BUFSIZ 8192 72#define FTPLIB_BUFSIZ 8192
61#define ACCEPT_TIMEOUT 15 73#define ACCEPT_TIMEOUT 10
62 74
63#define FTPLIB_CONTROL 0 75#define FTPLIB_CONTROL 0
64#define FTPLIB_READ 1 76#define FTPLIB_READ 1
65#define FTPLIB_WRITE 2 77#define FTPLIB_WRITE 2
66 78
67#if !defined FTPLIB_DEFMODE 79#if !defined FTPLIB_DEFMODE
68#define FTPLIB_DEFMODE FTPLIB_PASSIVE 80#define FTPLIB_DEFMODE FTPLIB_PASSIVE
69#endif 81#endif
70 82
71struct NetBuf { 83struct NetBuf {
72 char *cput,*cget; 84 char *cput,*cget;
73 int handle; 85 int handle;
74 int cavail,cleft; 86 int cavail,cleft;
75 char *buf; 87 char *buf;
76 int dir; 88 int dir;
77 netbuf *ctrl; 89 netbuf *ctrl;
78 netbuf *data; 90 netbuf *data;
79 int cmode; 91 int cmode;
80 struct timeval idletime; 92 struct timeval idletime;
81 FtpCallback idlecb; 93 FtpCallback idlecb;
82 void *idlearg; 94 void *idlearg;
83 int xfered; 95 int xfered;
84 int cbbytes; 96 int cbbytes;
85 int xfered1; 97 int xfered1;
@@ -361,114 +373,153 @@ GLOBALDEF void FtpInit(void)
361 int err; 373 int err;
362 wVersionRequested = MAKEWORD(1,1); 374 wVersionRequested = MAKEWORD(1,1);
363 if ((err = WSAStartup(wVersionRequested,&wsadata)) != 0) 375 if ((err = WSAStartup(wVersionRequested,&wsadata)) != 0)
364 fprintf(stderr,"Network failed to start: %d\n",err); 376 fprintf(stderr,"Network failed to start: %d\n",err);
365#endif 377#endif
366} 378}
367 379
368/* 380/*
369 * FtpLastResponse - return a pointer to the last response received 381 * FtpLastResponse - return a pointer to the last response received
370 */ 382 */
371GLOBALDEF char *FtpLastResponse(netbuf *nControl) 383GLOBALDEF char *FtpLastResponse(netbuf *nControl)
372{ 384{
373 if ((nControl) && (nControl->dir == FTPLIB_CONTROL)) 385 if ((nControl) && (nControl->dir == FTPLIB_CONTROL))
374 return nControl->response; 386 return nControl->response;
375 return NULL; 387 return NULL;
376} 388}
377 389
378/* 390/*
379 * FtpConnect - connect to remote server 391 * FtpConnect - connect to remote server
380 * 392 *
381 * return 1 if connected, 0 if not 393 * return 1 if connected, 0 if not
382 */ 394 */
383GLOBALDEF int FtpConnect(const char *host, netbuf **nControl) 395GLOBALDEF int FtpConnect(const char *host, netbuf **nControl)
384{ 396{
385 int sControl; 397 int sControl, stat, flags, oldflags;
386 struct sockaddr_in sin; 398 struct sockaddr_in sin;
387 struct hostent *phe; 399 struct hostent *phe;
388 struct servent *pse; 400 struct servent *pse;
389 int on=1; 401 int on=1;
390 netbuf *ctrl; 402 netbuf *ctrl;
391 char *lhost; 403 char *lhost;
392 char *pnum; 404 char *pnum;
405 struct timeval tv;
406 fd_set wr;
393 407
394 memset(&sin,0,sizeof(sin)); 408 memset(&sin,0,sizeof(sin));
395 sin.sin_family = AF_INET; 409 sin.sin_family = AF_INET;
396 lhost = strdup(host); 410 lhost = strdup(host);
397 pnum = strchr(lhost,':'); 411 pnum = strchr(lhost,':');
398 if (pnum == NULL) 412 if (pnum == NULL)
399 { 413 {
400#if defined(VMS) 414#if defined(VMS)
401 sin.sin_port = htons(21); 415 sin.sin_port = htons(21);
402#else 416#else
403 if ((pse = getservbyname("ftp","tcp")) == NULL) 417 if ((pse = getservbyname("ftp","tcp")) == NULL)
404 { 418 {
405 perror("getservbyname"); 419 perror("getservbyname");
406 return 0; 420 return 0;
407 } 421 }
408 sin.sin_port = pse->s_port; 422 sin.sin_port = pse->s_port;
409#endif 423#endif
410 } 424 }
411 else 425 else
412 { 426 {
413 *pnum++ = '\0'; 427 *pnum++ = '\0';
414 if (isdigit(*pnum)) 428 if (isdigit(*pnum))
415 sin.sin_port = htons(atoi(pnum)); 429 sin.sin_port = htons(atoi(pnum));
416 else 430 else
417 { 431 {
418 pse = getservbyname(pnum,"tcp"); 432 pse = getservbyname(pnum,"tcp");
419 sin.sin_port = pse->s_port; 433 sin.sin_port = pse->s_port;
420 } 434 }
421 } 435 }
422 if ((sin.sin_addr.s_addr = inet_addr(lhost)) == -1) 436 if ((sin.sin_addr.s_addr = inet_addr(lhost)) == -1)
423 { 437 {
424 if ((phe = gethostbyname(lhost)) == NULL) 438 if ((phe = gethostbyname(lhost)) == NULL)
425 { 439 {
426 perror("gethostbyname"); 440 perror("gethostbyname");
427 return 0; 441 return 0;
428 } 442 }
443
429 memcpy((char *)&sin.sin_addr, phe->h_addr, phe->h_length); 444 memcpy((char *)&sin.sin_addr, phe->h_addr, phe->h_length);
445
430 } 446 }
431 free(lhost); 447 free(lhost);
448
432 sControl = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); 449 sControl = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
433 if (sControl == -1) 450 if (sControl == -1)
434 { 451 {
435 perror("socket"); 452 perror("socket");
436 return 0; 453 return 0;
437 } 454 }
455
438 if (setsockopt(sControl,SOL_SOCKET,SO_REUSEADDR, 456 if (setsockopt(sControl,SOL_SOCKET,SO_REUSEADDR,
439 SETSOCKOPT_OPTVAL_TYPE &on, sizeof(on)) == -1) 457 SETSOCKOPT_OPTVAL_TYPE &on, sizeof(on)) == -1)
440 { 458 {
441 perror("setsockopt"); 459 perror("setsockopt");
442 net_close(sControl); 460 net_close(sControl);
443 return 0; 461 return 0;
444 } 462 }
445 if (connect(sControl, (struct sockaddr *)&sin, sizeof(sin)) == -1) 463
464 //set nonblocking for connection timeout
465 flags = fcntl( sControl, F_GETFL,0);
466 oldflags=flags;
467 fcntl( sControl, F_SETFL, O_NONBLOCK|flags);
468
469 stat=connect( sControl, (struct sockaddr *)&sin, sizeof(sin));
470 if (stat < 0)
471 {
472 if (errno != EWOULDBLOCK && errno != EINPROGRESS)
446 { 473 {
447 perror("connect"); 474 perror("connect");
448 net_close(sControl); 475 net_close(sControl);
449 return 0; 476 return 0;
450 } 477 }
478 }
479
480 FD_ZERO(&wr);
481 FD_SET( sControl, &wr);
482
483 tv.tv_sec = ACCEPT_TIMEOUT;
484 tv.tv_usec = 0;
485
486 stat = select(sControl+1, 0, &wr, 0, &tv);
487
488 if (stat < 1)
489 {
490 // time out has expired,
491 // or an error has ocurred
492 perror("timeout");
493 net_close(sControl);
494 return 0;
495 }
496
497 printf("connected\n");
498
499 //set original flags
500 fcntl( sControl, F_SETFL, oldflags);
501
451 ctrl = calloc(1,sizeof(netbuf)); 502 ctrl = calloc(1,sizeof(netbuf));
452 if (ctrl == NULL) 503 if (ctrl == NULL)
453 { 504 {
454 perror("calloc"); 505 perror("calloc");
455 net_close(sControl); 506 net_close(sControl);
456 return 0; 507 return 0;
457 } 508 }
458 ctrl->buf = malloc(FTPLIB_BUFSIZ); 509 ctrl->buf = malloc(FTPLIB_BUFSIZ);
459 if (ctrl->buf == NULL) 510 if (ctrl->buf == NULL)
460 { 511 {
461 perror("calloc"); 512 perror("calloc");
462 net_close(sControl); 513 net_close(sControl);
463 free(ctrl); 514 free(ctrl);
464 return 0; 515 return 0;
465 } 516 }
466 ctrl->handle = sControl; 517 ctrl->handle = sControl;
467 ctrl->dir = FTPLIB_CONTROL; 518 ctrl->dir = FTPLIB_CONTROL;
468 ctrl->ctrl = NULL; 519 ctrl->ctrl = NULL;
469 ctrl->cmode = FTPLIB_DEFMODE; 520 ctrl->cmode = FTPLIB_DEFMODE;
470 ctrl->idlecb = NULL; 521 ctrl->idlecb = NULL;
471 ctrl->idletime.tv_sec = ctrl->idletime.tv_usec = 0; 522 ctrl->idletime.tv_sec = ctrl->idletime.tv_usec = 0;
472 ctrl->idlearg = NULL; 523 ctrl->idlearg = NULL;
473 ctrl->xfered = 0; 524 ctrl->xfered = 0;
474 ctrl->xfered1 = 0; 525 ctrl->xfered1 = 0;
@@ -716,48 +767,49 @@ static int FtpOpenPort(netbuf *nControl, netbuf **nData, int mode, int dir)
716 *nData = ctrl; 767 *nData = ctrl;
717 return 1; 768 return 1;
718} 769}
719 770
720/* 771/*
721 * FtpAcceptConnection - accept connection from server 772 * FtpAcceptConnection - accept connection from server
722 * 773 *
723 * return 1 if successful, 0 otherwise 774 * return 1 if successful, 0 otherwise
724 */ 775 */
725static int FtpAcceptConnection(netbuf *nData, netbuf *nControl) 776static int FtpAcceptConnection(netbuf *nData, netbuf *nControl)
726{ 777{
727 int sData; 778 int sData;
728 struct sockaddr addr; 779 struct sockaddr addr;
729 unsigned int l; 780 unsigned int l;
730 int i; 781 int i;
731 struct timeval tv; 782 struct timeval tv;
732 fd_set mask; 783 fd_set mask;
733 int rv; 784 int rv;
734 785
735 FD_ZERO(&mask); 786 FD_ZERO(&mask);
736 FD_SET(nControl->handle, &mask); 787 FD_SET(nControl->handle, &mask);
737 FD_SET(nData->handle, &mask); 788 FD_SET(nData->handle, &mask);
738 tv.tv_usec = 0; 789 tv.tv_usec = 0;
739 tv.tv_sec = ACCEPT_TIMEOUT; 790 tv.tv_sec = ACCEPT_TIMEOUT;
791 printf("<<<<<<<<<<<<<<<<%d\n",ACCEPT_TIMEOUT);
740 i = nControl->handle; 792 i = nControl->handle;
741 if (i < nData->handle) 793 if (i < nData->handle)
742 i = nData->handle; 794 i = nData->handle;
743 i = select(i+1, &mask, NULL, NULL, &tv); 795 i = select(i+1, &mask, NULL, NULL, &tv);
744 if (i == -1) 796 if (i == -1)
745 { 797 {
746 strncpy(nControl->response, strerror(errno), 798 strncpy(nControl->response, strerror(errno),
747 sizeof(nControl->response)); 799 sizeof(nControl->response));
748 net_close(nData->handle); 800 net_close(nData->handle);
749 nData->handle = 0; 801 nData->handle = 0;
750 rv = 0; 802 rv = 0;
751 } 803 }
752 else if (i == 0) 804 else if (i == 0)
753 { 805 {
754 strcpy(nControl->response, "timed out waiting for connection"); 806 strcpy(nControl->response, "timed out waiting for connection");
755 net_close(nData->handle); 807 net_close(nData->handle);
756 nData->handle = 0; 808 nData->handle = 0;
757 rv = 0; 809 rv = 0;
758 } 810 }
759 else 811 else
760 { 812 {
761 if (FD_ISSET(nData->handle, &mask)) 813 if (FD_ISSET(nData->handle, &mask))
762 { 814 {
763 l = sizeof(addr); 815 l = sizeof(addr);
diff --git a/noncore/net/ftplib/ftplib.control b/noncore/net/ftplib/ftplib.control
new file mode 100644
index 0000000..67765ad
--- a/dev/null
+++ b/noncore/net/ftplib/ftplib.control
@@ -0,0 +1,9 @@
1Files: $QTDIR/lib/libftplib.*
2Priority: optional
3Section: Communications
4Maintainer: L.J. Potter <ljp@llornkcor.com>
5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-base ($QPE_VERSION)
8Description: Libftp
9 The ftp library for the Opie environment.
diff --git a/noncore/net/opieftp/ftplib.h b/noncore/net/ftplib/ftplib.h
index 75a90ae..75a90ae 100644
--- a/noncore/net/opieftp/ftplib.h
+++ b/noncore/net/ftplib/ftplib.h
diff --git a/noncore/net/ftplib/ftplib.pro b/noncore/net/ftplib/ftplib.pro
new file mode 100644
index 0000000..9ee3605
--- a/dev/null
+++ b/noncore/net/ftplib/ftplib.pro
@@ -0,0 +1,6 @@
1TEMPLATE = lib
2CONFIG = qt warn_on release
3HEADERS = ftplib.h
4SOURCES = ftplib.c
5DESTDIR = $(QTDIR)/lib$(PROJMAK)
6INTERFACES =
diff --git a/noncore/net/opieftp/opieftp.control b/noncore/net/opieftp/opieftp.control
index 18ec80f..42590bd 100644
--- a/noncore/net/opieftp/opieftp.control
+++ b/noncore/net/opieftp/opieftp.control
@@ -1,9 +1,9 @@
1Files: bin/opieftp pics/opieftp apps/Applications/opieftp.desktop 1Files: bin/opieftp pics/opieftp apps/Applications/opieftp.desktop
2Priority: optional 2Priority: optional
3Section: Communications 3Section: Communications
4Maintainer: L.J. Potter <ljp@llornkcor.com> 4Maintainer: L.J. Potter <ljp@llornkcor.com>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-base ($QPE_VERSION) 7Depends: opie-base ($QPE_VERSION), ftplib
8Description: OpieFtp 8Description: OpieFtp
9 The ftp client for the Opie environment. 9 The ftp client for the Opie environment.
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index 292cc9d..7c83223 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -1,41 +1,41 @@
1/*************************************************************************** 1/***************************************************************************
2 opieftp.cpp 2 opieftp.cpp
3 ------------------- 3 -------------------
4** Created: Sat Mar 9 23:33:09 2002 4** Created: Sat Mar 9 23:33:09 2002
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12//#define DEVELOPERS_VERSION 12//#define DEVELOPERS_VERSION
13 13
14#include "opieftp.h" 14#include "opieftp.h"
15 15
16extern "C" { 16extern "C" {
17#include "ftplib.h" 17#include "../ftplib/ftplib.h"
18} 18}
19 19
20#include "inputDialog.h" 20#include "inputDialog.h"
21 21
22#include <qpe/qpemenubar.h> 22#include <qpe/qpemenubar.h>
23#include <qpe/qpetoolbar.h> 23#include <qpe/qpetoolbar.h>
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25#include <qpe/resource.h> 25#include <qpe/resource.h>
26#include <qpe/qcopenvelope_qws.h> 26#include <qpe/qcopenvelope_qws.h>
27#include <qpe/config.h> 27#include <qpe/config.h>
28#include <qpe/mimetype.h> 28#include <qpe/mimetype.h>
29#include <qpe/qpemessagebox.h> 29#include <qpe/qpemessagebox.h>
30 30
31#include <qstringlist.h> 31#include <qstringlist.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qpushbutton.h> 33#include <qpushbutton.h>
34#include <qtoolbutton.h> 34#include <qtoolbutton.h>
35#include <qdatetime.h> 35#include <qdatetime.h>
36#include <qdir.h> 36#include <qdir.h>
37#include <qfile.h> 37#include <qfile.h>
38#include <qstring.h> 38#include <qstring.h>
39#include <qcombobox.h> 39#include <qcombobox.h>
40#include <qpopupmenu.h> 40#include <qpopupmenu.h>
41#include <qlistview.h> 41#include <qlistview.h>
@@ -1489,24 +1489,28 @@ void OpieFtp::NewServer() {
1489 cfg.setGroup( QString::number(i)); 1489 cfg.setGroup( QString::number(i));
1490 if(cfg.readEntry("ServerName").find(newServerName,0,TRUE) != -1) { 1490 if(cfg.readEntry("ServerName").find(newServerName,0,TRUE) != -1) {
1491 QMessageBox::message(tr("OpieFtp"),tr("Sorry name already taken")); 1491 QMessageBox::message(tr("OpieFtp"),tr("Sorry name already taken"));
1492 return; 1492 return;
1493 } 1493 }
1494 } 1494 }
1495 currentServerConfig =-1; 1495 currentServerConfig =-1;
1496 writeConfig(); 1496 writeConfig();
1497 serverListView->insertItem( newServerName ); 1497 serverListView->insertItem( newServerName );
1498 serverListView->setCurrentItem( serverListView->count()); 1498 serverListView->setCurrentItem( serverListView->count());
1499 } 1499 }
1500} 1500}
1501 1501
1502void OpieFtp::serverListClicked( const QString &item) { 1502void OpieFtp::serverListClicked( const QString &item) {
1503 if(item.isEmpty()) return; 1503 if(item.isEmpty()) return;
1504 Config cfg("opieftp"); 1504 Config cfg("opieftp");
1505 qDebug("highltined "+item); 1505 qDebug("highltined "+item);
1506 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); 1506 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
1507 for (int i = 1; i <= numberOfEntries; i++) { 1507 for (int i = 1; i <= numberOfEntries; i++) {
1508 cfg.setGroup(QString::number(i)); 1508 cfg.setGroup(QString::number(i));
1509 if(cfg.readEntry( "ServerName").find(item) != -1 && !fuckeduphack) 1509 if(cfg.readEntry( "ServerName").find(item) != -1 && !fuckeduphack)
1510 serverComboSelected(i-1); 1510 serverComboSelected(i-1);
1511 } 1511 }
1512} 1512}
1513
1514void OpieFtp::timerOut() {
1515
1516}
diff --git a/noncore/net/opieftp/opieftp.h b/noncore/net/opieftp/opieftp.h
index 2aa691a..109b5f8 100644
--- a/noncore/net/opieftp/opieftp.h
+++ b/noncore/net/opieftp/opieftp.h
@@ -18,76 +18,78 @@
18#include <qdir.h> 18#include <qdir.h>
19#include <qstring.h> 19#include <qstring.h>
20#include <qpoint.h> 20#include <qpoint.h>
21 21
22class QVBoxLayout; 22class QVBoxLayout;
23class QHBoxLayout; 23class QHBoxLayout;
24class QGridLayout; 24class QGridLayout;
25class QComboBox; 25class QComboBox;
26class QListView; 26class QListView;
27class QListViewItem; 27class QListViewItem;
28class QLabel; 28class QLabel;
29class QProgressBar; 29class QProgressBar;
30class QSpinBox; 30class QSpinBox;
31class QTabWidget; 31class QTabWidget;
32class QWidget; 32class QWidget;
33class QPEToolBar; 33class QPEToolBar;
34class QPEMenuBar; 34class QPEMenuBar;
35class QPopupMenu; 35class QPopupMenu;
36class QFile; 36class QFile;
37class QLineEdit; 37class QLineEdit;
38class QPushButton; 38class QPushButton;
39class QToolButton; 39class QToolButton;
40class QStringList; 40class QStringList;
41class QListBox; 41class QListBox;
42class QTimer;
42 43
43class OpieFtp : public QMainWindow 44class OpieFtp : public QMainWindow
44{ 45{
45 Q_OBJECT 46 Q_OBJECT
46 47
47public: 48public:
48 OpieFtp( ); 49 OpieFtp( );
49 ~OpieFtp(); 50 ~OpieFtp();
50 51
51 QTabWidget *TabWidget; 52 QTabWidget *TabWidget;
52 QWidget *tab, *tab_2, *tab_3; 53 QWidget *tab, *tab_2, *tab_3;
53 QListView *Local_View, *Remote_View; 54 QListView *Local_View, *Remote_View;
54 QListBox *serverListView; 55 QListBox *serverListView;
55 56
56 QComboBox *UsernameComboBox, *ServerComboBox, *currentPathCombo; 57 QComboBox *UsernameComboBox, *ServerComboBox, *currentPathCombo;
57 QLineEdit *PasswordEdit, *remotePath; 58 QLineEdit *PasswordEdit, *remotePath;
58 QLabel *TextLabel2, *TextLabel1, *TextLabel3, *TextLabel4;; 59 QLabel *TextLabel2, *TextLabel1, *TextLabel3, *TextLabel4;;
59 QSpinBox* PortSpinBox; 60 QSpinBox* PortSpinBox;
60 QPopupMenu *connectionMenu, *localMenu, *remoteMenu, *tabMenu, *aboutMenu; 61 QPopupMenu *connectionMenu, *localMenu, *remoteMenu, *tabMenu, *aboutMenu;
61 QDir currentDir; 62 QDir currentDir;
62 QString currentRemoteDir; 63 QString currentRemoteDir;
63 QString filterStr; 64 QString filterStr;
64 QListViewItem * item; 65 QListViewItem * item;
65 QPushButton *connectServerBtn, *newServerButton;// 66 QPushButton *connectServerBtn, *newServerButton;//
66 QToolButton *cdUpButton, *homeButton, *docButton; 67 QToolButton *cdUpButton, *homeButton, *docButton;
67 bool b; 68 bool b;
68 int currentServerConfig; 69 int currentServerConfig;
69protected slots: 70protected slots:
71 void timerOut();
70 void upDir(); 72 void upDir();
71 void homeButtonPushed(); 73 void homeButtonPushed();
72 void docButtonPushed(); 74 void docButtonPushed();
73 void doAbout(); 75 void doAbout();
74 76
75 void serverComboEdited(const QString & ); 77 void serverComboEdited(const QString & );
76 void UsernameComboBoxEdited(const QString & ); 78 void UsernameComboBoxEdited(const QString & );
77 void PasswordEditEdited(const QString & ); 79 void PasswordEditEdited(const QString & );
78 80
79 void showLocalMenu( QListViewItem *); 81 void showLocalMenu( QListViewItem *);
80 void showRemoteMenu( QListViewItem *); 82 void showRemoteMenu( QListViewItem *);
81 void doLocalCd(); 83 void doLocalCd();
82 void doRemoteCd(); 84 void doRemoteCd();
83 void localUpload(); 85 void localUpload();
84 void remoteDownload(); 86 void remoteDownload();
85 void newConnection(); 87 void newConnection();
86 void connector(); 88 void connector();
87 void disConnector(); 89 void disConnector();
88 void populateLocalView(); 90 void populateLocalView();
89 bool populateRemoteView(); 91 bool populateRemoteView();
90 void showHidden(); 92 void showHidden();
91 void writeConfig(); 93 void writeConfig();
92 void readConfig(); 94 void readConfig();
93 void localListClicked(QListViewItem *); 95 void localListClicked(QListViewItem *);
diff --git a/noncore/net/opieftp/opieftp.pro b/noncore/net/opieftp/opieftp.pro
index 6d88530..ae72ff3 100644
--- a/noncore/net/opieftp/opieftp.pro
+++ b/noncore/net/opieftp/opieftp.pro
@@ -1,24 +1,24 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3HEADERS = opieftp.h inputDialog.h ftplib.h 3HEADERS = opieftp.h inputDialog.h ftplib.h
4SOURCES = opieftp.cpp inputDialog.cpp ftplib.c main.cpp 4SOURCES = opieftp.cpp inputDialog.cpp main.cpp
5TARGET = opieftp 5TARGET = opieftp
6DESTDIR = $(OPIEDIR)/bin 6DESTDIR = $(OPIEDIR)/bin
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include 8DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe -lftplib
10 10
11TRANSLATIONS = ../../../i18n/de/opieftp.ts \ 11TRANSLATIONS = ../../../i18n/de/opieftp.ts \
12 ../../../i18n/en/opieftp.ts \ 12 ../../../i18n/en/opieftp.ts \
13 ../../../i18n/es/opieftp.ts \ 13 ../../../i18n/es/opieftp.ts \
14 ../../../i18n/fr/opieftp.ts \ 14 ../../../i18n/fr/opieftp.ts \
15 ../../../i18n/hu/opieftp.ts \ 15 ../../../i18n/hu/opieftp.ts \
16 ../../../i18n/ja/opieftp.ts \ 16 ../../../i18n/ja/opieftp.ts \
17 ../../../i18n/ko/opieftp.ts \ 17 ../../../i18n/ko/opieftp.ts \
18 ../../../i18n/no/opieftp.ts \ 18 ../../../i18n/no/opieftp.ts \
19 ../../../i18n/pl/opieftp.ts \ 19 ../../../i18n/pl/opieftp.ts \
20 ../../../i18n/pt/opieftp.ts \ 20 ../../../i18n/pt/opieftp.ts \
21 ../../../i18n/pt_BR/opieftp.ts \ 21 ../../../i18n/pt_BR/opieftp.ts \
22 ../../../i18n/sl/opieftp.ts \ 22 ../../../i18n/sl/opieftp.ts \
23 ../../../i18n/zh_CN/opieftp.ts \ 23 ../../../i18n/zh_CN/opieftp.ts \
24 ../../../i18n/zh_TW/opieftp.ts 24 ../../../i18n/zh_TW/opieftp.ts