Diffstat (limited to 'noncore/apps/opie-gutenbrowser/openetext.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-gutenbrowser/openetext.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/noncore/apps/opie-gutenbrowser/openetext.cpp b/noncore/apps/opie-gutenbrowser/openetext.cpp index 40f35d6..bd44ce6 100644 --- a/noncore/apps/opie-gutenbrowser/openetext.cpp +++ b/noncore/apps/opie-gutenbrowser/openetext.cpp @@ -15,17 +15,18 @@ #include "gutenbrowser.h" #include "openetext.h" #include "editTitle.h" -#include <qfileinfo.h> +/* OPIE */ +#include <opie2/ofiledialog.h> #include <qpe/applnk.h> +#include <qpe/config.h> #include <qpe/qpeapplication.h> +using namespace Opie::Ui; #include <stdlib.h> #include <qtextstream.h> -#include <qpe/config.h> - -#include <opie/ofiledialog.h> +#include <qfileinfo.h> #if defined(_WS_WIN_) #include <windows.h> #else @@ -148,15 +149,15 @@ OpenFileButton->setDown(TRUE); // // sMsg = "Error opening library filelist "+fileName; // } if( filer.right(4) == ".txt" - || filer.right(4) == ".TXT" - || filer.right(4) == ".etx" - || filer.right(4) == ".ETX" - || filer.right(4) == ".etx" - || filer.right(4) == ".ETX" - || filer.right(4) == ".zip" - || filer.right(4) == ".ZIP" ) { + || filer.right(4) == ".TXT" + || filer.right(4) == ".etx" + || filer.right(4) == ".ETX" + || filer.right(4) == ".etx" + || filer.right(4) == ".ETX" + || filer.right(4) == ".zip" + || filer.right(4) == ".ZIP" ) { QFileInfo zipFile( filer); QString s_fileName = zipFile.fileName(); QString cmd; @@ -177,12 +178,12 @@ OpenFileButton->setDown(TRUE); fileName = s_fileName; // qDebug("Filename is now "+fileName); } } else - fileName = str; - + fileName = str; + FindTitle(fileName); - + QFileInfo fi( fileName); name_file = fi.fileName(); name_file = name_file.left(name_file.length() - 4); @@ -223,9 +224,9 @@ bool OpenEtext::FindTitle( QString filename) bool findCheck = FALSE; // int Titlenumber=0; if ( indexLib.open( IO_ReadOnly) ) { - qDebug("file opened successfully"); + qDebug("file opened successfully"); QTextStream indexStream( &indexLib ); QString target = "Project Gutenberg Etext of"; QString target2 = "Project Gutenberg Etext"; QString target3 = "Project Gutenberg's Etext of"; @@ -263,10 +264,10 @@ bool OpenEtext::FindTitle( QString filename) title = title.stripWhiteSpace (); // qDebug("Found the title 4 and it is %s", title.latin1()); } } //endof file - indexLib.close(); - + indexLib.close(); + if( !findCheck || title.length() < 2) { qDebug("Trying hard to find title from GUTINDEX.ALL"); title = titleFromLibrary( filename); findCheck = TRUE; |