summaryrefslogtreecommitdiff
path: root/noncore
authorerik <erik>2007-01-26 20:22:50 (UTC)
committer erik <erik>2007-01-26 20:22:50 (UTC)
commit53d630c9c4813142ee13e6843c30476a5db26e78 (patch) (unidiff)
tree50a77a94cfeaccbb3d993bced8b7d0f498f74c7c /noncore
parent152a8fe978851aea8dac6ae5cb11f73540746b83 (diff)
downloadopie-53d630c9c4813142ee13e6843c30476a5db26e78.zip
opie-53d630c9c4813142ee13e6843c30476a5db26e78.tar.gz
opie-53d630c9c4813142ee13e6843c30476a5db26e78.tar.bz2
Each file in this commit exhibit an example of what prevent calls
'reverse inull'. All that means is that a pointer gets dereferenced. Then a pointer gets checked for validity before being dereferenced again. This almost always points to shenanigans. For example, the konsole.cpp file has this konsoleInit() call which passes in a const char** shell variable. Since it is a double pointer the programmer who wrote the code made the mistake of mixing the checking of the pointer and the pointer that points to the pointer. This commit attempts to correct that. Of course there are other instances of the same thing. But they all boil down to a small mistake which might have produced strange side effects.
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/notesapplet/notes.cpp2
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index 13f297e..61a47d7 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -226,25 +226,25 @@ void NotesControl::slotBoxSelected(const QString &itemString) {
226 226
227 227
228void NotesControl::showMenu() { 228void NotesControl::showMenu() {
229 QPopupMenu *m = new QPopupMenu(0); 229 QPopupMenu *m = new QPopupMenu(0);
230 m->insertItem( tr( "Beam Out" ), this, SLOT( slotBeamButton() )); 230 m->insertItem( tr( "Beam Out" ), this, SLOT( slotBeamButton() ));
231 m->insertItem( tr( "Search For..." ), this, SLOT( slotSearch() )); 231 m->insertItem( tr( "Search For..." ), this, SLOT( slotSearch() ));
232 m->insertItem( tr( "Toggle Maximized" ), this, SLOT( slotShowMax() )); 232 m->insertItem( tr( "Toggle Maximized" ), this, SLOT( slotShowMax() ));
233 m->insertSeparator(); 233 m->insertSeparator();
234 m->insertItem( tr( "Delete" ), this, SLOT( slotDeleteButton() )); 234 m->insertItem( tr( "Delete" ), this, SLOT( slotDeleteButton() ));
235 m->setFocus(); 235 m->setFocus();
236 m->exec( QCursor::pos() ); 236 m->exec( QCursor::pos() );
237 237
238 if(m) delete m; 238 delete m;
239} 239}
240 240
241void NotesControl::focusOutEvent ( QFocusEvent * e) { 241void NotesControl::focusOutEvent ( QFocusEvent * e) {
242 if( e->reason() == QFocusEvent::Popup) 242 if( e->reason() == QFocusEvent::Popup)
243 save(); 243 save();
244 else { 244 else {
245 if(!loaded) { 245 if(!loaded) {
246 populateBox(); 246 populateBox();
247 load(); 247 load();
248 } 248 }
249 } 249 }
250 QWidget::focusOutEvent(e); 250 QWidget::focusOutEvent(e);
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 828f5a1..cf19ba8 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -487,25 +487,25 @@ void AdvancedFm::showFileMenu() {
487 m->setCheckable(TRUE); 487 m->setCheckable(TRUE);
488 if (!b) 488 if (!b)
489 m->setItemChecked(m->idAt(0),TRUE); 489 m->setItemChecked(m->idAt(0),TRUE);
490 else 490 else
491 m->setItemChecked(m->idAt(0),FALSE); 491 m->setItemChecked(m->idAt(0),FALSE);
492 492
493 if(Ir::supported()) 493 if(Ir::supported())
494 m->insertItem(tr("Beam File"),this,SLOT(doBeam())); 494 m->insertItem(tr("Beam File"),this,SLOT(doBeam()));
495 m->setFocus(); 495 m->setFocus();
496 496
497 m->exec(QPoint(QCursor::pos().x(),QCursor::pos().y())); 497 m->exec(QPoint(QCursor::pos().x(),QCursor::pos().y()));
498 498
499 if(m) delete m; 499 delete m;
500} 500}
501 501
502 502
503QString AdvancedFm::checkDiskSpace(const QString &path) { 503QString AdvancedFm::checkDiskSpace(const QString &path) {
504 struct statfs fss; 504 struct statfs fss;
505 if ( !statfs( path.latin1(), &fss ) ) { 505 if ( !statfs( path.latin1(), &fss ) ) {
506 int blkSize = fss.f_bsize; 506 int blkSize = fss.f_bsize;
507// int totalBlks = fs.f_blocks; 507// int totalBlks = fs.f_blocks;
508 int availBlks = fss.f_bavail; 508 int availBlks = fss.f_bavail;
509 509
510 long mult = blkSize / 1024; 510 long mult = blkSize / 1024;
511 long div = 1024 / blkSize; 511 long div = 1024 / blkSize;