Diffstat (limited to 'noncore/apps/opie-gutenbrowser/gutenbrowser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-gutenbrowser/gutenbrowser.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp index c7cdd83..413ab51 100644 --- a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp +++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp | |||
@@ -138,19 +138,19 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags ) | |||
138 | if( index != -1) { | 138 | if( index != -1) { |
139 | odebug << tempTitle << oendl; | 139 | odebug << tempTitle << oendl; |
140 | if(!tempTitle.isEmpty()) bookmarksMenu->insertItem( tempTitle); | 140 | if(!tempTitle.isEmpty()) bookmarksMenu->insertItem( tempTitle); |
141 | } | 141 | } |
142 | } | 142 | } |
143 | 143 | ||
144 | // QString gutenIndex= local_library + "GUTINDEX.ALL"; | 144 | QString gutenIndex = local_library + "/GUTINDEX.ALL"; |
145 | QString gutenIndex = QPEApplication::qpeDir()+ "etc/gutenbrowser/GUTINDEX.ALL"; | ||
146 | qDebug("gutenindex "+gutenIndex ); | 145 | qDebug("gutenindex "+gutenIndex ); |
146 | |||
147 | if( QFile( gutenIndex).exists() ) { | 147 | if( QFile( gutenIndex).exists() ) { |
148 | indexLib.setName( gutenIndex); | 148 | indexLib.setName( gutenIndex); |
149 | } else { | 149 | } else { |
150 | QString localLibIndexFile = QPEApplication::qpeDir()+ "etc/gutenbrowser/PGWHOLE.TXT"; | 150 | QString localLibIndexFile = local_library + "/PGWHOLE.TXT"; |
151 | // QString localLibIndexFile= local_library + "PGWHOLE.TXT"; | 151 | // QString localLibIndexFile= local_library + "PGWHOLE.TXT"; |
152 | newindexLib.setName( localLibIndexFile); | 152 | newindexLib.setName( localLibIndexFile); |
153 | } | 153 | } |
154 | qDebug("attempting new library"); | 154 | qDebug("attempting new library"); |
155 | LibraryDlg = new LibraryDialog( this, "Library Index" /*, TRUE */); | 155 | LibraryDlg = new LibraryDialog( this, "Library Index" /*, TRUE */); |
156 | loadCheck = false; | 156 | loadCheck = false; |
@@ -194,34 +194,34 @@ void Gutenbrowser::InfoBarClick() { | |||
194 | searchGoogle(text); | 194 | searchGoogle(text); |
195 | } | 195 | } |
196 | 196 | ||
197 | /* | 197 | /* |
198 | download http with wget or preferred browser */ | 198 | download http with wget or preferred browser */ |
199 | void Gutenbrowser::goGetit( const QString &url, bool showMsg) { | 199 | void Gutenbrowser::goGetit( const QString &url, bool showMsg) { |
200 | // int eexit=0; | ||
201 | QString cmd; | 200 | QString cmd; |
202 | // config.read(); | ||
203 | qApp->processEvents(); | 201 | qApp->processEvents(); |
204 | QString filename = QPEApplication::qpeDir(); | ||
205 | if(filename.right(1)!="/") | ||
206 | filename+="/etc/gutenbrowser/"; | ||
207 | else | ||
208 | filename+="etc/gutenbrowser/"; | ||
209 | odebug << "filename "+filename << oendl; | ||
210 | // QString filename = QDir::homeDirPath()+"/Applications/gutenbrowser/"; | ||
211 | 202 | ||
212 | filename += url.right( url.length() - url.findRev("/",-1,TRUE) -1); | 203 | QString filename = local_library + "/GUTINDEX.ALL"; |
204 | // QString filename = old_index; | ||
213 | 205 | ||
214 | Config config("Gutenbrowser"); | 206 | // filename += url.right( url.length() - url.findRev("/",-1,TRUE) -1); |
215 | config.setGroup( "Browser" ); | 207 | |
216 | QString brow = config.readEntry("Preferred", "Opera"); | 208 | Config cfg("Gutenbrowser"); |
217 | odebug << "Preferred browser is "+brow << oendl; | 209 | cfg.setGroup("FTPsite"); |
210 | ftp_host=cfg.readEntry("SiteName", "sailor.gutenberg.org"); | ||
211 | ftp_base_dir= cfg.readEntry("base", "/pub/gutenberg"); | ||
212 | |||
213 | // Config config("Gutenbrowser"); | ||
214 | // config.setGroup( "Browser" ); | ||
215 | // QString brow = config.readEntry("Preferred", "Opera"); | ||
216 | // //odebug << "Preferred browser is "+brow << oendl; | ||
218 | if(!showMsg) { //if we just get the gutenindex.all | 217 | if(!showMsg) { //if we just get the gutenindex.all |
218 | // QString cmd="wget -O " + gutenindex1 + " http://sailor.gutenberg.org/GUTINDEX.ALL 2>&1"; | ||
219 | cmd="wget -O " + filename +" " + url+" 2>&1" ; | 219 | cmd="wget -O " + filename +" " + url+" 2>&1" ; |
220 | chdir(local_library); | 220 | chdir(local_library); |
221 | odebug << "Issuing the system command: " << cmd << "" << oendl; | 221 | // //odebug << "Issuing the system command: " << cmd << "" << oendl; |
222 | 222 | ||
223 | Output *outDlg; | 223 | Output *outDlg; |
224 | 224 | ||
225 | outDlg = new Output( 0, tr("Downloading Gutenberg Index...."),TRUE); | 225 | outDlg = new Output( 0, tr("Downloading Gutenberg Index...."),TRUE); |
226 | 226 | ||
227 | outDlg->showMaximized(); | 227 | outDlg->showMaximized(); |
@@ -271,13 +271,13 @@ void Gutenbrowser::goGetit( const QString &url, bool showMsg) { | |||
271 | // cmd="wget -q "+url+" &"; | 271 | // cmd="wget -q "+url+" &"; |
272 | QString tempHtml=local_library+"webster.html"; | 272 | QString tempHtml=local_library+"webster.html"; |
273 | cmd="wget -O "+tempHtml+" -q "+url; | 273 | cmd="wget -O "+tempHtml+" -q "+url; |
274 | } | 274 | } |
275 | 275 | ||
276 | chdir(local_library); | 276 | chdir(local_library); |
277 | odebug << "Issuing the sys command: " << cmd << "" << oendl; | 277 | // //odebug << "Issuing the sys command: " << cmd << "" << oendl; |
278 | system(cmd); | 278 | system(cmd); |
279 | } | 279 | } |
280 | } | 280 | } |
281 | 281 | ||
282 | void Gutenbrowser::toggleButtonIcons( bool useEm) { | 282 | void Gutenbrowser::toggleButtonIcons( bool useEm) { |
283 | QString pixDir; | 283 | QString pixDir; |