summaryrefslogtreecommitdiff
authorerik <erik>2007-01-31 22:06:07 (UTC)
committer erik <erik>2007-01-31 22:06:07 (UTC)
commit9395cf2a65184e493714c699bb23b02ea31feef5 (patch) (unidiff)
treeea07c026298820559c13ad32e612d51048cee0a9
parent958e042c5a4d4e38fd1baae50b78a2febfd306ab (diff)
downloadopie-9395cf2a65184e493714c699bb23b02ea31feef5.zip
opie-9395cf2a65184e493714c699bb23b02ea31feef5.tar.gz
opie-9395cf2a65184e493714c699bb23b02ea31feef5.tar.bz2
I expanded my audit to include any app I could get to compile in i386.
In that expansion a whole new crop of unchecked returns has sprung up. This commit fixes those weeds or should I say potential bugs.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/LibraryDialog.cpp12
-rw-r--r--noncore/apps/opie-gutenbrowser/openetext.cpp124
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp4
-rw-r--r--noncore/multimedia/opieplayer2/om3u.cpp17
-rw-r--r--noncore/multimedia/opieplayer2/threadutil.cpp11
-rw-r--r--noncore/net/opiestumbler/opiestumbler.cpp3
-rw-r--r--noncore/settings/networksettings/mainwindow/mainwindowimp.cpp9
-rw-r--r--noncore/settings/networksettings/ppp/modem.cpp6
8 files changed, 93 insertions, 93 deletions
diff --git a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
index 6c246e97..7f21ab3 100644
--- a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
+++ b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
@@ -17,13 +17,13 @@
17#include "output.h" 17#include "output.h"
18 18
19/* OPIE */ 19/* OPIE */
20#include <qpe/applnk.h> 20#include <qpe/applnk.h>
21#include <qpe/qpeapplication.h> 21#include <qpe/qpeapplication.h>
22#include <qpe/qpedialog.h> 22#include <qpe/qpedialog.h>
23//#include <opie2///odebug.h> 23#include <opie2/odebug.h>
24 24
25/* QT */ 25/* QT */
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27#include <qmultilineedit.h> 27#include <qmultilineedit.h>
28//#include <qlayout.h> 28//#include <qlayout.h>
29 29
@@ -469,14 +469,18 @@ bool LibraryDialog::getEtext(const QStringList &networkList)
469 469
470 if(NetworkDlg->successDownload) { 470 if(NetworkDlg->successDownload) {
471 //odebug << "Filename is "+File_Name << oendl; 471 //odebug << "Filename is "+File_Name << oendl;
472 if(File_Name.right(4) == ".txt") { 472 if(File_Name.right(4) == ".txt") {
473 QString s_fileName = File_Name; 473 QString s_fileName = File_Name;
474 s_fileName.replace( s_fileName.length() - 3, 3, "gtn"); 474 s_fileName.replace( s_fileName.length() - 3, 3, "gtn");
475 // s_fileName.replace( s_fileName.length()-3,3,"etx"); 475 if (rename( File_Name.latin1(), s_fileName.latin1()) == 1) {
476 rename( File_Name.latin1(), s_fileName.latin1()); 476 owarn << "Failed to rename " << File_Name.latin1() << " to "
477 << s_fileName.latin1() << oendl;
478 return false;
479 }
480
477 File_Name = s_fileName; 481 File_Name = s_fileName;
478 482
479 //odebug << "Filename is now "+File_Name << oendl; 483 //odebug << "Filename is now "+File_Name << oendl;
480 484
481 } 485 }
482 if(File_Name.length() > 5 ) { 486 if(File_Name.length() > 5 ) {
@@ -496,13 +500,12 @@ bool LibraryDialog::getEtext(const QStringList &networkList)
496 lnk.setFile(File_Name); //sets File property 500 lnk.setFile(File_Name); //sets File property
497 lnk.setType("guten/plain");// hey is this a REGISTERED mime type?!?!? ;D 501 lnk.setType("guten/plain");// hey is this a REGISTERED mime type?!?!? ;D
498 lnk.setExec(File_Name); 502 lnk.setExec(File_Name);
499 lnk.setIcon("gutenbrowser/Gutenbrowser"); 503 lnk.setIcon("gutenbrowser/Gutenbrowser");
500 if(!lnk.writeLink()) { 504 if(!lnk.writeLink()) {
501 //odebug << "Writing doclink did not work" << oendl; 505 //odebug << "Writing doclink did not work" << oendl;
502 } else {
503 } 506 }
504 } else 507 } else
505 QMessageBox::message("Note","<p>There was an error with the file</p>"); 508 QMessageBox::message("Note","<p>There was an error with the file</p>");
506 } 509 }
507 } 510 }
508 511
@@ -698,13 +701,12 @@ void LibraryDialog::onButtonSearch()
698 701
699 QString resultString; 702 QString resultString;
700 703
701 int i_berger = 0; 704 int i_berger = 0;
702 if( searchDlg->exec() != 0 ) { 705 if( searchDlg->exec() != 0 ) {
703 QString searcherStr = searchDlg->get_text(); 706 QString searcherStr = searchDlg->get_text();
704 int fluff = 0;
705 707
706 bool cS; 708 bool cS;
707 if( searchDlg->caseSensitiveCheckBox->isChecked()) 709 if( searchDlg->caseSensitiveCheckBox->isChecked())
708 cS = true; //case sensitive 710 cS = true; //case sensitive
709 else 711 else
710 cS = false; 712 cS = false;
diff --git a/noncore/apps/opie-gutenbrowser/openetext.cpp b/noncore/apps/opie-gutenbrowser/openetext.cpp
index 0267416..a5d855d 100644
--- a/noncore/apps/opie-gutenbrowser/openetext.cpp
+++ b/noncore/apps/opie-gutenbrowser/openetext.cpp
@@ -54,24 +54,28 @@ OpenEtext::~OpenEtext()
54void OpenEtext::getTitles() 54void OpenEtext::getTitles()
55{ 55{
56 QListBox_1->clear(); 56 QListBox_1->clear();
57 Config config("Gutenbrowser"); 57 Config config("Gutenbrowser");
58 config.setGroup( "Files" ); 58 config.setGroup( "Files" );
59 s_numofFiles = config.readEntry("NumberOfFiles", "0"); 59 s_numofFiles = config.readEntry("NumberOfFiles", "0");
60 QLabel_1->setText( tr( 60 QLabel_1->setText( tr( s_numofFiles+" etexts in your library." ) );
61 s_numofFiles+" etexts in your library."));
62 int i_numofFiles = s_numofFiles.toInt(); 61 int i_numofFiles = s_numofFiles.toInt();
63 for (int i = 1; i <= i_numofFiles+1; i++) { 62 for (int i = 1; i <= i_numofFiles+1; i++) {
64 QString temp; 63 QString temp;
65 temp.setNum(i); 64 temp.setNum(i);
66 config.setGroup( "Files" ); 65 config.setGroup( "Files" );
67 QString ramble = config.readEntry(temp, "" ); 66 QString ramble = config.readEntry(temp, "" );
68 config.setGroup( "Titles" ); 67 config.setGroup( "Titles" );
69 title = config.readEntry(ramble, ""); 68 title = config.readEntry(ramble, "");
70 if( !title.isEmpty()) { 69 if( !title.isEmpty()) {
71 QListBox_1->insertItem ( QPixmap( QPEApplication::qpeDir()+"pics/gutenbrowser/gutenbrowser_sm.png"), title, -1); 70 QListBox_1->insertItem ( QPixmap(
71 QPEApplication::qpeDir() +
72 "pics/gutenbrowser/gutenbrowser_sm.png"
73 ),
74 title,
75 -1);
72 } 76 }
73 } 77 }
74} 78}
75 79
76/* 80/*
77 opens selected title */ 81 opens selected title */
@@ -97,33 +101,26 @@ void OpenEtext::select_title(int index )
97 Config config("Gutenbrowser"); 101 Config config("Gutenbrowser");
98 config.setGroup( "Files" ); 102 config.setGroup( "Files" );
99 file = config.readEntry(temp, ""); 103 file = config.readEntry(temp, "");
100 OpenEtext::accept(); 104 OpenEtext::accept();
101} 105}
102 106
103/* 107/*!
104 This function imports already existing etexts into the local library list*/ 108 * This function imports already existing etexts into the local library list
109 */
105void OpenEtext::open() 110void OpenEtext::open()
106{ 111{
107OpenFileButton->setDown(TRUE); 112OpenFileButton->setDown(TRUE);
108 title = ""; 113 title = "";
109 QString currDir=""; 114 QString currDir="";
110 QString filer; 115 QString filer;
111 QString name_file; 116 QString name_file;
112 QString local ; 117 QString local ;
113 local = (QDir::homeDirPath () +"Applications/gutenbrowser"); 118 local = (QDir::homeDirPath () +"Applications/gutenbrowser");
114 QDir library( local); 119 QDir library( local);
115 120
116// fileBrowser *browseForFiles;
117// browseForFiles=new fileBrowser(this,"Browse for File", TRUE, 0, "guten/plain;text/plain");
118// // browseForFiles=new fileBrowser(this,"fileBrowser",TRUE,0, "*");
119// browseForFiles->setFileView( 0);
120// browseForFiles->showMaximized();
121// browseForFiles->exec();
122// QString selFile= browseForFiles->selectedFileName;
123// fileList=browseForFiles->fileList;
124 Config cfg("Gutenbrowser"); 121 Config cfg("Gutenbrowser");
125 cfg. setGroup ( "View" ); 122 cfg. setGroup ( "View" );
126 QString dir = cfg.readEntry("LastOpenDirectory", QPEApplication::documentDir()); 123 QString dir = cfg.readEntry("LastOpenDirectory", QPEApplication::documentDir());
127 QMap<QString, QStringList> map; 124 QMap<QString, QStringList> map;
128 map.insert(tr("All"), QStringList() ); 125 map.insert(tr("All"), QStringList() );
129 QStringList text; 126 QStringList text;
@@ -136,51 +133,39 @@ OpenFileButton->setDown(TRUE);
136 133
137 if( !str.isEmpty() && QFile(str).exists() && !QFileInfo(str).isDir() ) { 134 if( !str.isEmpty() && QFile(str).exists() && !QFileInfo(str).isDir() ) {
138 filer = str; 135 filer = str;
139 136
140 odebug << "Open file: "+str << oendl; 137 odebug << "Open file: "+str << oendl;
141 138
142 // QStringList::ConstIterator f; 139 if( filer.right(4) == ".txt" ||
143// QString fileTemp; 140 filer.right(4) == ".TXT" ||
144// for ( f = fileList.begin(); f != fileList.end(); f++ ) { 141 filer.right(4) == ".etx" ||
145// fileTemp = *f; 142 filer.right(4) == ".ETX" ||
146// fileTemp.right( fileTemp.length()-5); 143 filer.right(4) == ".etx" ||
147// fileName = fileTemp; 144 filer.right(4) == ".ETX" ||
148// if( !fileName.isEmpty() ){ 145 filer.right(4) == ".zip" ||
149// filer = fileName; 146 filer.right(4) == ".ZIP" )
150// } else { //filename is empty 147 {
151// // QString sMsg;
152// // sMsg = "Error opening library filelist "+fileName;
153// }
154
155 if( filer.right(4) == ".txt"
156 || filer.right(4) == ".TXT"
157 || filer.right(4) == ".etx"
158 || filer.right(4) == ".ETX"
159 || filer.right(4) == ".etx"
160 || filer.right(4) == ".ETX"
161 || filer.right(4) == ".zip"
162 || filer.right(4) == ".ZIP" ) {
163 QFileInfo zipFile( filer); 148 QFileInfo zipFile( filer);
164 QString s_fileName = zipFile.fileName(); 149 QString s_fileName = zipFile.fileName();
165 QString cmd; 150 QString cmd;
166 151
167 if( s_fileName.right(4) == ".zip") { // unzip that sucker.... 152 if( s_fileName.right(4) == ".zip") { // unzip the file
168 s_fileName = s_fileName.left( s_fileName.length() - 4); 153 s_fileName = s_fileName.left( s_fileName.length() - 4);
169 if( chdir((const char*)local_library.latin1())!=0) 154 if( chdir((const char*)local_library.latin1())!=0)
170 odebug << "chdir failed." << oendl; // QString cmd = "gunzip -d " + filer + " -d " + local_library; 155 odebug << "chdir failed." << oendl;
171 cmd = "gunzip -S .zip " + filer; 156 cmd = "gunzip -S .zip " + filer;
172 fileName = local_library + s_fileName + ".txt"; 157 fileName = local_library + s_fileName + ".txt";
173 system( cmd); 158 system( cmd);
174 } 159 } else { // else rename .txt to .etx
175// this renames the .txt to .etx!!
176 else /*if( s_fileName.right(4) == ".txt" || if( s_fileName.right(4) == ".TXT"))*/ {
177// odebug << "Filename is "+fileName << oendl; 160// odebug << "Filename is "+fileName << oendl;
178 s_fileName = fileName; 161 s_fileName = fileName;
179 s_fileName.replace( s_fileName.length()-3,3,"gtn");// s_fileName.replace( s_fileName.length()-3,3,"etx"); 162 s_fileName.replace( s_fileName.length()-3,3,"gtn");
180 rename(fileName.latin1(),s_fileName.latin1()); 163 if (rename(fileName.latin1(),s_fileName.latin1()) == -1)
164 owarn << "Rename of " << fileName.latin1() << " to "
165 << s_fileName.latin1() << " failed" << oendl;
181 fileName = s_fileName; 166 fileName = s_fileName;
182// odebug << "Filename is now "+fileName << oendl; 167// odebug << "Filename is now "+fileName << oendl;
183 } 168 }
184 } else 169 } else
185 fileName = str; 170 fileName = str;
186 171
@@ -198,13 +183,16 @@ OpenFileButton->setDown(TRUE);
198 lnk.setComment(title); 183 lnk.setComment(title);
199 184
200 QListBox_1->clear(); 185 QListBox_1->clear();
201 getTitles(); 186 getTitles();
202 odebug << "Filename is "+fileName << oendl; 187 odebug << "Filename is "+fileName << oendl;
203 lnk.setFile(fileName); //sets File property 188 lnk.setFile(fileName); //sets File property
204 lnk.setType("guten/plain");// hey is this a REGISTERED mime type?!?!? ;D 189 // @bug This is probably not a registered MIME type. Perhaps we should
190 // set a valid MIME type here instead. Or maybe register .etx as a
191 // Gutenberge etext?
192 lnk.setType("guten/plain");
205 lnk.setExec(fileName); 193 lnk.setExec(fileName);
206 lnk.setIcon("gutenbrowser/Gutenbrowser"); 194 lnk.setIcon("gutenbrowser/Gutenbrowser");
207 if(!lnk.writeLink()) 195 if(!lnk.writeLink())
208 odebug << "Writing doclink did not work" << oendl; 196 odebug << "Writing doclink did not work" << oendl;
209 197
210 } // end of for each file name.... 198 } // end of for each file name....
@@ -222,13 +210,12 @@ bool OpenEtext::FindTitle( QString filename)
222 210
223 QFileInfo fi(filename); 211 QFileInfo fi(filename);
224 name = fi.fileName(); 212 name = fi.fileName();
225 odebug << "filename to open is " + name << oendl; 213 odebug << "filename to open is " + name << oendl;
226 QFile indexLib( filename); 214 QFile indexLib( filename);
227 bool findCheck = FALSE; 215 bool findCheck = FALSE;
228 // int Titlenumber=0;
229 216
230 if ( indexLib.open( IO_ReadOnly) ) { 217 if ( indexLib.open( IO_ReadOnly) ) {
231 odebug << "file opened successfully" << oendl; 218 odebug << "file opened successfully" << oendl;
232 QTextStream indexStream( &indexLib ); 219 QTextStream indexStream( &indexLib );
233 QString target = "Project Gutenberg Etext of"; 220 QString target = "Project Gutenberg Etext of";
234 QString target2 = "Project Gutenberg Etext"; 221 QString target2 = "Project Gutenberg Etext";
@@ -274,13 +261,12 @@ bool OpenEtext::FindTitle( QString filename)
274 odebug << "Trying hard to find title from GUTINDEX.ALL" << oendl; 261 odebug << "Trying hard to find title from GUTINDEX.ALL" << oendl;
275 title = titleFromLibrary( filename); 262 title = titleFromLibrary( filename);
276 findCheck = TRUE; 263 findCheck = TRUE;
277 } 264 }
278 265
279 if ( checkConf() == false && findCheck == TRUE) { 266 if ( checkConf() == false && findCheck == TRUE) {
280
281 config.setGroup( "Files"); 267 config.setGroup( "Files");
282 config.writeEntry("NumberOfFiles",i_numofFiles + 1 ); 268 config.writeEntry("NumberOfFiles",i_numofFiles + 1 );
283 QString interger; 269 QString interger;
284 interger.setNum( i_numofFiles +1); 270 interger.setNum( i_numofFiles +1);
285 config.writeEntry(interger, filename); 271 config.writeEntry(interger, filename);
286 config.setGroup( "Titles" ); 272 config.setGroup( "Titles" );
@@ -312,16 +298,16 @@ bool OpenEtext::FindTitle( QString filename)
312QString OpenEtext::titleFromLibrary( QString fileName) 298QString OpenEtext::titleFromLibrary( QString fileName)
313{ 299{
314 QFile indexLib( local_index); 300 QFile indexLib( local_index);
315 QString target; 301 QString target;
316 int find1 = fileName.findRev("/",-1,TRUE) + 1; 302 int find1 = fileName.findRev("/",-1,TRUE) + 1;
317 int find2 = fileName.findRev(".gtn",-1,TRUE) - find1; 303 int find2 = fileName.findRev(".gtn",-1,TRUE) - find1;
318 if(find2==-1-find1) 304 if(find2== (-1-find1))
319 int find2 = fileName.findRev(".etx",-1,TRUE) - find1; 305 find2 = fileName.findRev(".etx",-1,TRUE) - find1;
320 else if(find2==-1-find1) 306 else if(find2==(-1-find1))
321 int find2 = fileName.findRev(".txt",-1,TRUE) - find1; 307 find2 = fileName.findRev(".txt",-1,TRUE) - find1;
322 308
323 target = fileName.mid( find1, find2 ); 309 target = fileName.mid( find1, find2 );
324 QString checker = target.right(1); 310 QString checker = target.right(1);
325 bool ok; 311 bool ok;
326 checker.toInt( &ok,10); 312 checker.toInt( &ok,10);
327 if( ok) { 313 if( ok) {
@@ -341,13 +327,12 @@ QString OpenEtext::titleFromLibrary( QString fileName)
341 while ( !indexStream.atEnd() ) { // until end of file.. 327 while ( !indexStream.atEnd() ) { // until end of file..
342 indexLine = indexStream.readLine(); 328 indexLine = indexStream.readLine();
343 329
344 if( indexLine.find( target,0,FALSE) > 0 ) { 330 if( indexLine.find( target,0,FALSE) > 0 ) {
345 findCheck = TRUE; 331 findCheck = TRUE;
346 title = indexLine.mid( 9, 50); 332 title = indexLine.mid( 9, 50);
347// title = indexLine.mid( 26, indexLine.length() );
348 title = title.stripWhiteSpace (); 333 title = title.stripWhiteSpace ();
349// odebug << "Finally Found the title and it is\n " << title << "" << oendl; 334// odebug << "Finally Found the title and it is\n " << title << "" << oendl;
350// QListBox_1->insertItem ( title); 335// QListBox_1->insertItem ( title);
351 } 336 }
352 } //end while loop 337 } //end while loop
353 } 338 }
@@ -378,28 +363,31 @@ bool OpenEtext::checkConf()
378} 363}
379 364
380void OpenEtext::remove() 365void OpenEtext::remove()
381{ 366{
382 title_text = QListBox_1->text( QListBox_1->currentItem() ); 367 title_text = QListBox_1->text( QListBox_1->currentItem() );
383 title_text=title_text.stripWhiteSpace(); 368 title_text=title_text.stripWhiteSpace();
384 QString msg ="<p>Do you really want to REMOVE\n" +title_text +"?\nThis will not delete the file.</P>"; 369 QString msg ="<p>Do you really want to REMOVE\n" + title_text +
385 switch( QMessageBox::information( this, (tr("Remove Etext")), 370 "?\nThis will not delete the file.</P>";
386 (tr(msg)), 371 switch( QMessageBox::information( this, tr("Remove Etext"),
387 (tr("&Yes")), (tr("&Cancel")), 0 )){ 372 tr(msg),
373 tr("&Yes"), tr("&Cancel"), 0 ) )
374 {
388 case 0: // Yes clicked, 375 case 0: // Yes clicked,
389 removeSelection(); 376 removeSelection();
390 QListBox_1->clear(); 377 QListBox_1->clear();
391 getTitles(); 378 getTitles();
392 break; 379 break;
393 case 1: // Cancel 380 case 1:
394 break; 381 default:
395 }; 382 }
396} 383}
397 384
398/* 385/*!
399 this removes selected title entry*/ 386 * This removes selected title entry
387 */
400void OpenEtext::removeSelection() 388void OpenEtext::removeSelection()
401{ 389{
402 Config config("Gutenbrowser"); 390 Config config("Gutenbrowser");
403 config.setGroup( "Files" ); 391 config.setGroup( "Files" );
404 s_numofFiles = config.readEntry("NumberOfFiles", "0"); 392 s_numofFiles = config.readEntry("NumberOfFiles", "0");
405 int rem=0; 393 int rem=0;
@@ -433,17 +421,17 @@ void OpenEtext::removeSelection()
433 if (!s_filename2.isEmpty()) { 421 if (!s_filename2.isEmpty()) {
434 config.writeEntry(fileNum, s_filename2 ); 422 config.writeEntry(fileNum, s_filename2 );
435 } 423 }
436 } 424 }
437 config.writeEntry("NumberOfFiles", i_numofFiles - 1 ); 425 config.writeEntry("NumberOfFiles", i_numofFiles - 1 );
438 config.removeEntry(fileNum2); 426 config.removeEntry(fileNum2);
439// remFile();
440} 427}
441 428
442/* 429/*!
443 removes file title name from list and config file*/ 430 * Removes file title name from list and config file
431 */
444void OpenEtext::remFile() 432void OpenEtext::remFile()
445{ 433{
446 Config config("Gutenbrowser"); 434 Config config("Gutenbrowser");
447 config.setGroup( "Files" ); 435 config.setGroup( "Files" );
448 QString remFile; 436 QString remFile;
449 s_numofFiles = config.readEntry("NumberOfFiles", "0"); 437 s_numofFiles = config.readEntry("NumberOfFiles", "0");
@@ -458,26 +446,26 @@ void OpenEtext::remFile()
458 446
459 for(int fg = i_numofFiles - i; fg < i_numofFiles ; fg++ ) { //this rewrites Files number entry 447 for(int fg = i_numofFiles - i; fg < i_numofFiles ; fg++ ) { //this rewrites Files number entry
460 QString fileNum2; 448 QString fileNum2;
461 fileNum2.setNum( fg + 1); 449 fileNum2.setNum( fg + 1);
462 QString s_filename2 = config.readEntry(fileNum2, "" ); 450 QString s_filename2 = config.readEntry(fileNum2, "" );
463 451
464 if (!s_filename2.isEmpty()) { 452 if (!s_filename2.isEmpty())
465 config.writeEntry(fileNum, s_filename2 ); 453 config.writeEntry(fileNum, s_filename2 );
466 } 454 }
467 } 455 }
468 } 456 }
469 }
470 config.writeEntry("NumberOfFiles", i_numofFiles - 1 ); 457 config.writeEntry("NumberOfFiles", i_numofFiles - 1 );
471 config.removeEntry(s_numofFiles); 458 config.removeEntry(s_numofFiles);
472 459
473 QListBox_1->triggerUpdate(true); 460 QListBox_1->triggerUpdate(true);
474} 461}
475 462
476/* 463/*!
477sorts the list*/ 464 * Sorts the list
465 */
478void OpenEtext::scan() { 466void OpenEtext::scan() {
479 467
480 QListBox_1->sort(TRUE); 468 QListBox_1->sort(TRUE);
481 QListBox_1->triggerUpdate(true); 469 QListBox_1->triggerUpdate(true);
482} 470}
483 471
@@ -507,13 +495,17 @@ void OpenEtext::editTitle() {
507 Edit_Title *titleEdit; 495 Edit_Title *titleEdit;
508 titleEdit = new Edit_Title(this,file_title ,TRUE); 496 titleEdit = new Edit_Title(this,file_title ,TRUE);
509 if(titleEdit->exec() !=0) { 497 if(titleEdit->exec() !=0) {
510//odebug << titleEdit->newTitle << oendl; 498//odebug << titleEdit->newTitle << oendl;
511 config.writeEntry( s_filename, titleEdit->newTitle); 499 config.writeEntry( s_filename, titleEdit->newTitle);
512 QListBox_1->removeItem(currentItem); 500 QListBox_1->removeItem(currentItem);
513 QListBox_1->insertItem ( QPixmap( QPEApplication::qpeDir()+"pics/gutenbrowser/gutenbrowser_sm.png"), titleEdit->newTitle, currentItem); 501 QListBox_1->insertItem (
502 QPixmap( QPEApplication::qpeDir()+
503 "pics/gutenbrowser/gutenbrowser_sm.png"),
504 titleEdit->newTitle, currentItem
505 );
514 } 506 }
515 } 507 }
516 } 508 }
517 509
518// getTitles(); 510// getTitles();
519 QListBox_1->triggerUpdate(true); 511 QListBox_1->triggerUpdate(true);
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 84d28ce..5f281b7 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -74,13 +74,13 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
74 QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; 74 QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf";
75 // get the configuration 75 // get the configuration
76 76
77 // not really OO, should be an extra class, later 77 // not really OO, should be an extra class, later
78 if ( !QFile::exists(configPath) ) { 78 if ( !QFile::exists(configPath) ) {
79 QFile f(configPath); 79 QFile f(configPath);
80 f.open(IO_WriteOnly); 80 if (f.open(IO_WriteOnly)) {
81 QTextStream ts( &f ); 81 QTextStream ts( &f );
82 ts << "misc.memcpy_method:glibc\n"; 82 ts << "misc.memcpy_method:glibc\n";
83 ts << "# uncomment if you experience double speed audio \n #audio.oss_sync_method:softsync\n"; 83 ts << "# uncomment if you experience double speed audio \n #audio.oss_sync_method:softsync\n";
84 ts << "codec.ffmpeg_pp_quality:3\n"; 84 ts << "codec.ffmpeg_pp_quality:3\n";
85 ts << "audio.num_buffers:50\n"; 85 ts << "audio.num_buffers:50\n";
86 ts << "audio.size_buffers:4096\n"; 86 ts << "audio.size_buffers:4096\n";
@@ -88,12 +88,14 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
88 ts << "video.size_buffers:4096\n"; 88 ts << "video.size_buffers:4096\n";
89 ts << "audio.out_num_audio_buf:16\n"; 89 ts << "audio.out_num_audio_buf:16\n";
90 ts << "audio.out_size_audio_buf:8096\n"; 90 ts << "audio.out_size_audio_buf:8096\n";
91 ts << "audio.out_size_zero_buf:1024\n"; 91 ts << "audio.out_size_zero_buf:1024\n";
92 ts << "audio.passthrough_offset:0\n"; 92 ts << "audio.passthrough_offset:0\n";
93 f.close(); 93 f.close();
94 } else
95 owarn << "Failed to open " f.name() << oendl;
94 } 96 }
95 97
96 if ( initMode == InitializeImmediately ) { 98 if ( initMode == InitializeImmediately ) {
97 initialize(); 99 initialize();
98 m_initialized = true; 100 m_initialized = true;
99 } 101 }
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp
index 790fa09..f2a01d3 100644
--- a/noncore/multimedia/opieplayer2/om3u.cpp
+++ b/noncore/multimedia/opieplayer2/om3u.cpp
@@ -35,16 +35,19 @@
35#include <opie2/odebug.h> 35#include <opie2/odebug.h>
36using namespace Opie::Core; 36using namespace Opie::Core;
37 37
38//extern PlayListWidget *playList; 38//extern PlayListWidget *playList;
39 39
40Om3u::Om3u( const QString &filePath, int mode) 40Om3u::Om3u( const QString &filePath, int mode)
41 : QStringList (){ 41 : QStringList ()
42{
42odebug << "<<<<<<<new m3u "+filePath << oendl; 43odebug << "<<<<<<<new m3u "+filePath << oendl;
43 f.setName(filePath); 44 f.setName(filePath);
44 f.open(mode); 45 if (!f.open(mode)) {
46 owarn << "Unable to open file " << f.name() << oendl;
47 }
45} 48}
46 49
47Om3u::~Om3u(){} 50Om3u::~Om3u(){}
48 51
49void Om3u::readM3u() { 52void Om3u::readM3u() {
50// odebug << "<<<<<<reading m3u "+f.name() << oendl; 53// odebug << "<<<<<<reading m3u "+f.name() << oendl;
@@ -80,33 +83,24 @@ void Om3u::readPls() { //it's a pls file
80 s = t.readLine(); 83 s = t.readLine();
81 if( s.left(4) == "File" ) { 84 if( s.left(4) == "File" ) {
82 s = s.right( s.length() - s.find("=",0,true)-1 ); 85 s = s.right( s.length() - s.find("=",0,true)-1 );
83 s = s.stripWhiteSpace(); 86 s = s.stripWhiteSpace();
84 s.replace( QRegExp( "%20" )," "); 87 s.replace( QRegExp( "%20" )," ");
85// odebug << "adding " + s + " to playlist" << oendl; 88// odebug << "adding " + s + " to playlist" << oendl;
86 // numberofentries=2
87 // File1=http
88 // Title
89 // Length
90 // Version
91 // File2=http
92 s = s.replace( QRegExp( "\\" ), "/" ); 89 s = s.replace( QRegExp( "\\" ), "/" );
93 QFileInfo f( s ); 90 QFileInfo f( s );
94 QString name = f.baseName(); 91 QString name = f.baseName();
95 if( name.left( 4 ) == "http" ) { 92 if( name.left( 4 ) == "http" ) {
96 name = s.right( s.length() - 7); 93 name = s.right( s.length() - 7);
97 } else { 94 } else {
98 name = s; 95 name = s;
99 } 96 }
100 name = name.right( name.length() - name.findRev( "\\", -1, TRUE) - 1 ); 97 name = name.right( name.length() - name.findRev( "\\", -1, TRUE) - 1 );
101 if( s.at( s.length() - 4) == '.') // if this is probably a file 98 if( s.at( s.length() - 4) == '.') // if this is probably a file
102 append(s); 99 append(s);
103 else { //if its a url 100 else { //if its a url
104// if( name.right( 1 ).find( '/' ) == -1) {
105// s += "/";
106// }
107 append(s); 101 append(s);
108 } 102 }
109 } 103 }
110 } 104 }
111} 105}
112 106
@@ -117,13 +111,12 @@ void Om3u::write() { //writes list to m3u file
117 if(count()>0) { 111 if(count()>0) {
118 for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { 112 for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) {
119// odebug << *it << oendl; 113// odebug << *it << oendl;
120 t << *it << "\n"; 114 t << *it << "\n";
121 } 115 }
122 } 116 }
123// f.close();
124} 117}
125 118
126void Om3u::add(const QString &filePath) { //adds to m3u file 119void Om3u::add(const QString &filePath) { //adds to m3u file
127 append(filePath); 120 append(filePath);
128} 121}
129 122
diff --git a/noncore/multimedia/opieplayer2/threadutil.cpp b/noncore/multimedia/opieplayer2/threadutil.cpp
index b5cac61..5fc8a0b 100644
--- a/noncore/multimedia/opieplayer2/threadutil.cpp
+++ b/noncore/multimedia/opieplayer2/threadutil.cpp
@@ -230,18 +230,23 @@ bool Thread::isRunning() const
230 230
231void Thread::exit() 231void Thread::exit()
232{ 232{
233 pthread_exit( 0 ); 233 pthread_exit( 0 );
234} 234}
235 235
236OnewayNotifier::OnewayNotifier() 236OnewayNotifier::OnewayNotifier() :
237 m_readFd(-1),
238 m_writeFd(-1)
237{ 239{
238 int fds[ 2 ]; 240 int fds[ 2 ] = { -1, -1 };
239 pipe( fds ); 241 if (pipe( fds ) == 0) {
240 m_readFd = fds[ 0 ]; 242 m_readFd = fds[ 0 ];
241 m_writeFd = fds[ 1 ]; 243 m_writeFd = fds[ 1 ];
244 } else {
245 owarn << "Call to pipe() failed" << oendl;
246 }
242 247
243 m_notifier = new QSocketNotifier( m_readFd, QSocketNotifier::Read ); 248 m_notifier = new QSocketNotifier( m_readFd, QSocketNotifier::Read );
244 connect( m_notifier, SIGNAL( activated(int) ), 249 connect( m_notifier, SIGNAL( activated(int) ),
245 this, SLOT( wakeUp() ) ); 250 this, SLOT( wakeUp() ) );
246} 251}
247 252
diff --git a/noncore/net/opiestumbler/opiestumbler.cpp b/noncore/net/opiestumbler/opiestumbler.cpp
index 9b0d099..ab0b8d8 100644
--- a/noncore/net/opiestumbler/opiestumbler.cpp
+++ b/noncore/net/opiestumbler/opiestumbler.cpp
@@ -339,13 +339,14 @@ void OpieStumbler::slotAssociated()
339 delete m_proc; 339 delete m_proc;
340 } 340 }
341 341
342 m_proc = new Opie::Core::OProcess(this); 342 m_proc = new Opie::Core::OProcess(this);
343 343
344 *m_proc << "udhcpc" << "-f" << "-n" << "-i" << m_interface; 344 *m_proc << "udhcpc" << "-f" << "-n" << "-i" << m_interface;
345 m_proc->start(Opie::Core::OProcess::DontCare); 345 if (!m_proc->start(Opie::Core::OProcess::DontCare))
346 owarn << "Execution of udhcpc returned false. Are paths correct?" << oendl;
346 QTimer::singleShot(5000, this, SLOT(slotCheckDHCP())); 347 QTimer::singleShot(5000, this, SLOT(slotCheckDHCP()));
347} 348}
348 349
349void OpieStumbler::slotCheckDHCP() 350void OpieStumbler::slotCheckDHCP()
350{ 351{
351 if(!m_proc->isRunning()) { 352 if(!m_proc->isRunning()) {
diff --git a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp
index 650e634..e81f603 100644
--- a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp
@@ -193,13 +193,14 @@ void MainWindowImp::getAllInterfaces()
193 if ( !QString( pifr->ifr_name ).startsWith( "wifi" ) ) ifaces += pifr->ifr_name; 193 if ( !QString( pifr->ifr_name ).startsWith( "wifi" ) ) ifaces += pifr->ifr_name;
194 else odebug << "ignoring hostap control interface " << pifr->ifr_name << oendl; 194 else odebug << "ignoring hostap control interface " << pifr->ifr_name << oendl;
195 } 195 }
196 } 196 }
197 else 197 else
198 { 198 {
199 procFile.open(IO_ReadOnly); 199 if (!procFile.open(IO_ReadOnly))
200 owarn << "Failed to open proc file " << procFile.name() << oendl;
200 QString line; 201 QString line;
201 QTextStream procTs(&procFile); 202 QTextStream procTs(&procFile);
202 int loc = -1; 203 int loc = -1;
203 204
204 procTs.readLine(); // eat a line 205 procTs.readLine(); // eat a line
205 procTs.readLine(); // eat a line 206 procTs.readLine(); // eat a line
@@ -729,13 +730,14 @@ void MainWindowImp::setHostname()
729 } 730 }
730 731
731 OProcess h; 732 OProcess h;
732 _procTemp=""; 733 _procTemp="";
733 h << "hostname" << m_Nameinput->text(); 734 h << "hostname" << m_Nameinput->text();
734 connect(&h,SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),this,SLOT(slotHostname(Opie::Core::OProcess*,char*,int))); 735 connect(&h,SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),this,SLOT(slotHostname(Opie::Core::OProcess*,char*,int)));
735 h.start(OProcess::Block,OProcess::Stderr); 736 if (!h.start(OProcess::Block,OProcess::Stderr))
737 owarn << "Failed execution of 'hostname'. Are the paths correct?" << oendl;
736 odebug << "Got " << _procTemp << " - " << h.exitStatus() << oendl; 738 odebug << "Got " << _procTemp << " - " << h.exitStatus() << oendl;
737 if (h.exitStatus()!=0) { 739 if (h.exitStatus()!=0) {
738 QMessageBox::critical(0, tr("Sorry"), QString(tr("Could not set name.\n%1")).arg(_procTemp.stripWhiteSpace())); 740 QMessageBox::critical(0, tr("Sorry"), QString(tr("Could not set name.\n%1")).arg(_procTemp.stripWhiteSpace()));
739 return; 741 return;
740 } 742 }
741 _procTemp=""; 743 _procTemp="";
@@ -765,13 +767,14 @@ void MainWindowImp::initHostname()
765{ 767{
766 OProcess h; 768 OProcess h;
767 _procTemp=""; 769 _procTemp="";
768 770
769 h << "hostname"; 771 h << "hostname";
770 connect(&h,SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),this,SLOT(slotHostname(Opie::Core::OProcess*,char*,int))); 772 connect(&h,SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),this,SLOT(slotHostname(Opie::Core::OProcess*,char*,int)));
771 h.start(OProcess::Block,OProcess::AllOutput); 773 if (!h.start(OProcess::Block,OProcess::AllOutput))
774 owarn << "Could not execute 'hostname'. Are the paths correct?" oendl;
772 odebug << "Got " << _procTemp <<oendl; 775 odebug << "Got " << _procTemp <<oendl;
773 m_Nameinput->setText(_procTemp.stripWhiteSpace()); 776 m_Nameinput->setText(_procTemp.stripWhiteSpace());
774 _procTemp=""; 777 _procTemp="";
775} 778}
776 779
777void MainWindowImp::slotHostname(Opie::Core::OProcess */*proc*/, char *buffer, int buflen) 780void MainWindowImp::slotHostname(Opie::Core::OProcess */*proc*/, char *buffer, int buflen)
diff --git a/noncore/settings/networksettings/ppp/modem.cpp b/noncore/settings/networksettings/ppp/modem.cpp
index 7b2e2a3..17ada9b 100644
--- a/noncore/settings/networksettings/ppp/modem.cpp
+++ b/noncore/settings/networksettings/ppp/modem.cpp
@@ -765,14 +765,16 @@ bool Modem::createAuthFile(Auth method, const char *username, const char *passwo
765 if(!(oldName = authFile(method, Old))) 765 if(!(oldName = authFile(method, Old)))
766 return false; 766 return false;
767 767
768 // delete old file if any 768 // delete old file if any
769 unlink(oldName); 769 unlink(oldName);
770 770
771 rename(authfile, oldName); 771 if (rename(authfile, oldName) == -1)
772 rename(newName, authfile); 772 return false;
773 if (rename(newName, authfile) == -1)
774 return false;
773 775
774 return true; 776 return true;
775} 777}
776 778
777 779
778bool Modem::removeAuthFile(Auth method) { 780bool Modem::removeAuthFile(Auth method) {