summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser/ftpsitedlg.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-gutenbrowser/ftpsitedlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/ftpsitedlg.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/noncore/apps/opie-gutenbrowser/ftpsitedlg.cpp b/noncore/apps/opie-gutenbrowser/ftpsitedlg.cpp
index ad770b5..a9c7346 100644
--- a/noncore/apps/opie-gutenbrowser/ftpsitedlg.cpp
+++ b/noncore/apps/opie-gutenbrowser/ftpsitedlg.cpp
@@ -12,4 +12,5 @@
12 * (at your option) any later version. * 12 * (at your option) any later version. *
13 ***************************************************************************/ 13 ***************************************************************************/
14
14#include "optionsDialog.h" 15#include "optionsDialog.h"
15#include "gutenbrowser.h" 16#include "gutenbrowser.h"
@@ -17,13 +18,17 @@
17#include "output.h" 18#include "output.h"
18 19
20/* OPIE */
21#include <opie2/odebug.h>
22#include <qpe/config.h>
23
24/* QT */
19#include <qprogressbar.h> 25#include <qprogressbar.h>
20#include <stdlib.h>
21#include <qurloperator.h> 26#include <qurloperator.h>
22#include <qpe/config.h>
23#include <qlistbox.h> 27#include <qlistbox.h>
24 28
29/* STD */
30#include <stdlib.h>
25#include <unistd.h> 31#include <unistd.h>
26#include <stdio.h> 32#include <stdio.h>
27#include <stdlib.h>
28 33
29// :)~ 34// :)~
@@ -39,5 +44,5 @@ void optionsDialog::ftpSiteDlg( )
39 dir.mkdir(ListFile,true); 44 dir.mkdir(ListFile,true);
40 ListFile+="/ftpList"; 45 ListFile+="/ftpList";
41 qDebug("opening "+ListFile); 46 odebug << "opening "+ListFile << oendl;
42 if ( QFile(ListFile).exists() ) { 47 if ( QFile(ListFile).exists() ) {
43 openSiteList(); 48 openSiteList();
@@ -77,5 +82,5 @@ void optionsDialog::getSite()
77// if( NetworkDlg->exec() != 0 ) 82// if( NetworkDlg->exec() != 0 )
78// { // use new, improved, *INSTANT* network-dialog-file-getterer 83// { // use new, improved, *INSTANT* network-dialog-file-getterer
79// qDebug("gitcha!"); 84// odebug << "gitcha!" << oendl;
80// } 85// }
81// delete NetworkDlg; 86// delete NetworkDlg;
@@ -85,5 +90,5 @@ void optionsDialog::getSite()
85 90
86 QString cmd="wget -T 15 -O " +outputFile + " " + networkUrl + " 2>&1" ; 91 QString cmd="wget -T 15 -O " +outputFile + " " + networkUrl + " 2>&1" ;
87 qDebug("Issuing the command "+cmd); 92 odebug << "Issuing the command "+cmd << oendl;
88 Output *outDlg; 93 Output *outDlg;
89 outDlg = new Output( 0, tr("Downloading ftp sites...."),TRUE); 94 outDlg = new Output( 0, tr("Downloading ftp sites...."),TRUE);
@@ -100,9 +105,9 @@ void optionsDialog::getSite()
100 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 105 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
101 } 106 }
102 pclose(fp); 107 pclose(fp);
103 outDlg->close(); 108 outDlg->close();
104 if(outDlg) 109 if(outDlg)
105 delete outDlg; 110 delete outDlg;
106 111
107// outputFile=ListFile; 112// outputFile=ListFile;
108 ftp_QListBox_1->clear(); 113 ftp_QListBox_1->clear();
@@ -114,5 +119,5 @@ bool optionsDialog::parseFtpList( QString outputFile)
114// parse ftplist html and extract just the machine names/directories 119// parse ftplist html and extract just the machine names/directories
115// TODO: add locations!! 120// TODO: add locations!!
116 qDebug("parse ftplist "+outputFile); 121 odebug << "parse ftplist "+outputFile << oendl;
117 QString ftpList, s_location; 122 QString ftpList, s_location;
118 QFile f( outputFile ); 123 QFile f( outputFile );
@@ -153,9 +158,9 @@ bool optionsDialog::parseFtpList( QString outputFile)
153 s = t.readLine(); 158 s = t.readLine();
154 if(( start=s.find("<BR>(", 0, TRUE) ) != -1) { 159 if(( start=s.find("<BR>(", 0, TRUE) ) != -1) {
155// qDebug("%s",s.latin1()); 160// odebug << "" << s << "" << oendl;
156 end = s.find( ")", 0, TRUE)+1; 161 end = s.find( ")", 0, TRUE)+1;
157 s_location= s.mid( start+4, (end - start) ); 162 s_location= s.mid( start+4, (end - start) );
158 163
159// qDebug("%s", s_location.latin1()); 164// odebug << "" << s_location << "" << oendl;
160// ftpList += ftpSite + "\n"; 165// ftpList += ftpSite + "\n";
161// ftp_QListBox_1->sort( TRUE ); 166// ftp_QListBox_1->sort( TRUE );
@@ -174,5 +179,5 @@ bool optionsDialog::parseFtpList( QString outputFile)
174 } // end while loop 179 } // end while loop
175 QFile f2( ListFile); 180 QFile f2( ListFile);
176 if(!f2.open( IO_ReadWrite | IO_Truncate)) 181 if(!f2.open( IO_ReadWrite | IO_Truncate))
177 QMessageBox::message( (tr("Note")), (tr("File not opened sucessfully.\n"+ListFile )) ); 182 QMessageBox::message( (tr("Note")), (tr("File not opened sucessfully.\n"+ListFile )) );
178 f2.writeBlock( ftpList, ftpList.length() ); 183 f2.writeBlock( ftpList, ftpList.length() );
@@ -191,5 +196,5 @@ bool optionsDialog::parseFtpList( QString outputFile)
191void optionsDialog::openSiteList() { 196void optionsDialog::openSiteList() {
192 197
193 qDebug(" just opens the ftp site list"); 198 odebug << " just opens the ftp site list" << oendl;
194// ListFile = ( QDir::homeDirPath ()) +"/.gutenbrowser/ftpList"; 199// ListFile = ( QDir::homeDirPath ()) +"/.gutenbrowser/ftpList";
195 QFile f( ListFile); 200 QFile f( ListFile);
@@ -231,5 +236,5 @@ void optionsDialog::select_site( const char *index )
231// if(s_site.find("(",0,TRUE)) 236// if(s_site.find("(",0,TRUE))
232 s_site2=s_site.right( s_site.length()-(s_site.find(" ",0,TRUE)+4) ); 237 s_site2=s_site.right( s_site.length()-(s_site.find(" ",0,TRUE)+4) );
233qDebug("Selected ftp site is "+ s_site2); 238odebug << "Selected ftp site is "+ s_site2 << oendl;
234 int i_ftp = s_site2.find("/", 0, FALSE); 239 int i_ftp = s_site2.find("/", 0, FALSE);
235 ftp_host = s_site2.left(i_ftp ); 240 ftp_host = s_site2.left(i_ftp );