summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-04-08 23:13:24 (UTC)
committer llornkcor <llornkcor>2004-04-08 23:13:24 (UTC)
commit8ea8d193ff14250d4dbc0fc3d4699e5888ba35fe (patch) (side-by-side diff)
treefced2b714b39a5f2747e36a9784f6fc131e77c55
parent502281033b395bb5f089a2bbaa86f9ba423dec84 (diff)
downloadopie-8ea8d193ff14250d4dbc0fc3d4699e5888ba35fe.zip
opie-8ea8d193ff14250d4dbc0fc3d4699e5888ba35fe.tar.gz
opie-8ea8d193ff14250d4dbc0fc3d4699e5888ba35fe.tar.bz2
fix segfault in d'tor
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/LibraryDialog.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
index 157a3da..5b22b00 100644
--- a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
+++ b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
@@ -41,103 +41,103 @@ LibraryDialog::LibraryDialog( QWidget* parent, const char* name , bool modal, W
// this->setMaximumWidth(240);
index = "GUTINDEX.ALL";
local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/";
local_index = local_library + index;
QString iniFile ;
iniFile = QPEApplication::qpeDir()+"/etc/gutenbrowser/gutenbrowserrc";
new_index =QPEApplication::qpeDir()+"/etc/gutenbrowser/PGWHOLE.TXT";
old_index = QPEApplication::qpeDir()+"/etc/gutenbrowser/GUTINDEX.ALL";
// old_index = QPEApplication::qpeDir()+"etc/gutenbrowser/GUTINDEX.ALL";
// iniFile = local_library+"gutenbrowserrc";
// new_index = local_library + "PGWHOLE.TXT";
// old_index = local_library + "GUTINDEX.ALL";
Config config("Gutenbrowser");
config.setGroup( "HttpServer" );
proxy_http = config.readEntry("Preferred", "http://sailor.gutenbook.org");
config.setGroup( "FTPsite" );
ftp_host=config.readEntry("SiteName", "sailor.gutenberg.org");
qDebug("Library Dialog: ftp_host is "+ftp_host);
// ftp_host=ftp_host.right(ftp_host.length()-(ftp_host.find(") ",0,TRUE)+1) );
// ftp_host=ftp_host.stripWhiteSpace();
ftp_base_dir= config.readEntry("base", "/pub/gutenberg");
i_binary = 0;
config.setGroup("SortAuth");
if( config.readEntry("authSort", "FALSE") == "TRUE")
authBox->setChecked(TRUE);
config.setGroup("General");
downDir =config.readEntry( "DownloadDirectory",local_library);
qDebug("downDir is "+downDir);
newindexLib.setName( old_index);
indexLib.setName( old_index);
new QPEDialogListener(this);
}
LibraryDialog::~LibraryDialog()
{
- delete QList_Item2;
- delete QList_Item1;
- delete QList_Item3;
- delete QList_Item4;
- delete QList_Item5;
+// delete QList_Item2;
+// delete QList_Item1;
+// delete QList_Item3;
+// delete QList_Item4;
+// delete QList_Item5;
- saveConfig();
+ // saveConfig();
}
/*This groks using PGWHOLE.TXT */
void LibraryDialog::Newlibrary()
{
#ifndef Q_WS_QWS //sorry embedded gutenbrowser cant use zip files
//qDebug("Opening new library index %s",newindexLib);
if ( newindexLib.open( IO_ReadOnly) ) {
setCaption( tr( "Library Index - using master pg index." ) );// file opened successfully
QTextStream indexStream( &newindexLib );
QString indexLine;
while ( !indexStream.atEnd() ) { // until end of file..
indexLine = indexStream.readLine();
if ( ( indexLine.mid(4,4)).toInt() && !( indexLine.left(3)).toInt()) {
year = indexLine.mid(4,4);
year = year.stripWhiteSpace();
file = indexLine.mid( indexLine.find( "[", 0, TRUE )+1, 12 );
file = file.stripWhiteSpace();
number = indexLine.mid( indexLine.find( "]", 0, TRUE ) +1, indexLine.find( " ", 0, TRUE )+1 );
if( year.toInt() < 1984)
number = number.left( number.length() -1 );
number = number.stripWhiteSpace();
title = indexLine.mid( indexLine.find(" ", 26, TRUE), indexLine.length() );
title = title.stripWhiteSpace();
getAuthor(); // groks author
author = author.stripWhiteSpace();
if (authBox->isChecked()) { // this reverses the first name and last name of the author
// qDebug("Sorting last name first");
QString lastName, firstName="";
int finder=author.findRev( ' ', -1, TRUE);
lastName=author.right( author.length()-finder);
firstName=author.left(finder);
lastName=lastName.stripWhiteSpace();
firstName=firstName.stripWhiteSpace();
if( lastName.find( firstName, 0, true) == -1) // this avoids dup names
author=lastName+", "+firstName;
}
if( !number.isEmpty() && (title.find( "reserved",0, FALSE) == -1) && (file.find( "]",0, TRUE) == -1) ) {
// fill string list or something to be able to resort the whole library
if( author.isEmpty() )
QList_Item5 = new QListViewItem( ListView5, /* number,*/ title, author, year, file );
else {
if( (author.left(1) >= QString("A") && author.left(1) <= QString("F")) ||