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 @@ -132,31 +132,31 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags ) QString ramble = config.readEntry( QString::number(i), "" ); config.setGroup( "Titles" ); QString tempTitle = config.readEntry( ramble, ""); config.setGroup( tempTitle); int index = config.readNumEntry( "LineNumber", -1 ); if( index != -1) { odebug << tempTitle << oendl; if(!tempTitle.isEmpty()) bookmarksMenu->insertItem( tempTitle); } } - // QString gutenIndex= local_library + "GUTINDEX.ALL"; - QString gutenIndex = QPEApplication::qpeDir()+ "etc/gutenbrowser/GUTINDEX.ALL"; + QString gutenIndex = local_library + "/GUTINDEX.ALL"; qDebug("gutenindex "+gutenIndex ); + if( QFile( gutenIndex).exists() ) { indexLib.setName( gutenIndex); } else { - QString localLibIndexFile = QPEApplication::qpeDir()+ "etc/gutenbrowser/PGWHOLE.TXT"; + QString localLibIndexFile = local_library + "/PGWHOLE.TXT"; // QString localLibIndexFile= local_library + "PGWHOLE.TXT"; newindexLib.setName( localLibIndexFile); } qDebug("attempting new library"); LibraryDlg = new LibraryDialog( this, "Library Index" /*, TRUE */); loadCheck = false; chdir(local_library); if(!showMainList) { Lview->setFocus(); // if(firstTime) // Bookmark(); for (int i=1;i< qApp->argc();i++) { @@ -188,46 +188,46 @@ void Gutenbrowser::InfoBarClick() { QClipboard *cb = QApplication::clipboard(); text = cb->text(); } else { // text=title; text=this->caption(); } searchGoogle(text); } /* download http with wget or preferred browser */ void Gutenbrowser::goGetit( const QString &url, bool showMsg) { - // int eexit=0; QString cmd; - // config.read(); qApp->processEvents(); - QString filename = QPEApplication::qpeDir(); - if(filename.right(1)!="/") - filename+="/etc/gutenbrowser/"; - else - filename+="etc/gutenbrowser/"; - odebug << "filename "+filename << oendl; - // QString filename = QDir::homeDirPath()+"/Applications/gutenbrowser/"; - filename += url.right( url.length() - url.findRev("/",-1,TRUE) -1); + QString filename = local_library + "/GUTINDEX.ALL"; +// QString filename = old_index; - Config config("Gutenbrowser"); - config.setGroup( "Browser" ); - QString brow = config.readEntry("Preferred", "Opera"); - odebug << "Preferred browser is "+brow << oendl; +// filename += url.right( url.length() - url.findRev("/",-1,TRUE) -1); + + Config cfg("Gutenbrowser"); + cfg.setGroup("FTPsite"); + ftp_host=cfg.readEntry("SiteName", "sailor.gutenberg.org"); + ftp_base_dir= cfg.readEntry("base", "/pub/gutenberg"); + +// Config config("Gutenbrowser"); +// config.setGroup( "Browser" ); +// QString brow = config.readEntry("Preferred", "Opera"); +// //odebug << "Preferred browser is "+brow << oendl; if(!showMsg) { //if we just get the gutenindex.all +// QString cmd="wget -O " + gutenindex1 + " http://sailor.gutenberg.org/GUTINDEX.ALL 2>&1"; cmd="wget -O " + filename +" " + url+" 2>&1" ; chdir(local_library); - odebug << "Issuing the system command: " << cmd << "" << oendl; +// //odebug << "Issuing the system command: " << cmd << "" << oendl; Output *outDlg; outDlg = new Output( 0, tr("Downloading Gutenberg Index...."),TRUE); outDlg->showMaximized(); outDlg->show(); qApp->processEvents(); FILE *fp; char line[130]; outDlg->OutputEdit->append( tr("Running wget") ); outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); @@ -265,25 +265,25 @@ void Gutenbrowser::goGetit( const QString &url, bool showMsg) { cmd = "mozilla "+url+" &"; } if( brow == "Netscape") { cmd = "netscape "+url+" &"; } if(brow == "wget") { // cmd="wget -q "+url+" &"; QString tempHtml=local_library+"webster.html"; cmd="wget -O "+tempHtml+" -q "+url; } chdir(local_library); - odebug << "Issuing the sys command: " << cmd << "" << oendl; +// //odebug << "Issuing the sys command: " << cmd << "" << oendl; system(cmd); } } void Gutenbrowser::toggleButtonIcons( bool useEm) { QString pixDir; if(useEm) useEm=TRUE; pixDir=QPEApplication::qpeDir()+"pics/gutenbrowser"; odebug << "Docdir is "+QPEApplication::documentDir() << oendl; if( useIcons && QDir( pixDir).exists() ) { |