summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser
Unidiff
Diffstat (limited to 'noncore/apps/opie-gutenbrowser') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/openetext.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/noncore/apps/opie-gutenbrowser/openetext.cpp b/noncore/apps/opie-gutenbrowser/openetext.cpp
index a5d855d..75edacd 100644
--- a/noncore/apps/opie-gutenbrowser/openetext.cpp
+++ b/noncore/apps/opie-gutenbrowser/openetext.cpp
@@ -347,59 +347,57 @@ bool OpenEtext::checkConf()
347 Config config("Gutenbrowser"); 347 Config config("Gutenbrowser");
348 config.setGroup( "Files" ); 348 config.setGroup( "Files" );
349 QString s_numofFiles = config.readEntry("NumberOfFiles", "0" ); 349 QString s_numofFiles = config.readEntry("NumberOfFiles", "0" );
350 int i_numofFiles = s_numofFiles.toInt(); 350 int i_numofFiles = s_numofFiles.toInt();
351 351
352 for (int i = 1; i <= i_numofFiles; i++) { 352 for (int i = 1; i <= i_numofFiles; i++) {
353 QString temp; 353 QString temp;
354 temp.setNum(i); 354 temp.setNum(i);
355 config.setGroup( "Files"); 355 config.setGroup( "Files");
356 QString ramble = config.readEntry(temp, "" ); 356 QString ramble = config.readEntry(temp, "" );
357 357
358 if(ramble == file ) { 358 if(ramble == file ) {
359 return true; 359 return true;
360 } 360 }
361 } 361 }
362 return false; 362 return false;
363} 363}
364 364
365void OpenEtext::remove() 365void OpenEtext::remove()
366{ 366{
367 title_text = QListBox_1->text( QListBox_1->currentItem() ); 367 title_text = QListBox_1->text( QListBox_1->currentItem() );
368 title_text=title_text.stripWhiteSpace(); 368 title_text=title_text.stripWhiteSpace();
369 QString msg ="<p>Do you really want to REMOVE\n" + title_text + 369 QString msg ="<p>Do you really want to REMOVE\n" + title_text +
370 "?\nThis will not delete the file.</P>"; 370 "?\nThis will not delete the file.</P>";
371 switch( QMessageBox::information( this, tr("Remove Etext"), 371 unsigned short clickVal =
372 QMessageBox::information( this, tr("Remove Etext"),
372 tr(msg), 373 tr(msg),
373 tr("&Yes"), tr("&Cancel"), 0 ) ) 374 tr("&Yes"), tr("&Cancel"), 0 );
374 { 375 if ( clickVal == 0 ) {
375 case 0: // Yes clicked, 376 // The yes button was clicked
376 removeSelection(); 377 removeSelection();
377 QListBox_1->clear(); 378 QListBox_1->clear();
378 getTitles(); 379 getTitles();
379 break;
380 case 1:
381 default:
382 } 380 }
383} 381}
384 382
385/*! 383/*!
386 * This removes selected title entry 384 * This removes selected title entry
387 */ 385 */
388void OpenEtext::removeSelection() 386void OpenEtext::removeSelection()
389{ 387{
390 Config config("Gutenbrowser"); 388 Config config("Gutenbrowser");
391 config.setGroup( "Files" ); 389 config.setGroup( "Files" );
392 s_numofFiles = config.readEntry("NumberOfFiles", "0"); 390 s_numofFiles = config.readEntry("NumberOfFiles", "0");
393 int rem=0; 391 int rem=0;
394 int i_numofFiles = s_numofFiles.toInt(); 392 int i_numofFiles = s_numofFiles.toInt();
395 QString fileNum2; 393 QString fileNum2;
396 QString fileNum; 394 QString fileNum;
397 395
398 for (int i = 1; i <= i_numofFiles; i++) { 396 for (int i = 1; i <= i_numofFiles; i++) {
399 fileNum.setNum(i); 397 fileNum.setNum(i);
400 config.setGroup( "Files" ); 398 config.setGroup( "Files" );
401 399
402 QString s_filename = config.readEntry(fileNum, "" ); 400 QString s_filename = config.readEntry(fileNum, "" );
403 config.setGroup( "Titles" ); 401 config.setGroup( "Titles" );
404 402
405 QString file_title = config.readEntry( s_filename, ""); 403 QString file_title = config.readEntry( s_filename, "");