git pull Revert "use QWeakPointer (and explicit deletion, if needed)

instead of QSharedPointer"

This reverts commit 73da3a77f2041ac3de44842a162243c036fd32f9.
CCBUG: 277925
icc-effect-5.14.5
Hugo Pereira Da Costa 2011-07-25 17:04:28 +02:00
parent 6d96696898
commit cfdfe9251c
1 changed files with 13 additions and 16 deletions

View File

@ -27,7 +27,7 @@
#include "oxygenexceptionlistwidget.moc" #include "oxygenexceptionlistwidget.moc"
#include "oxygenexceptiondialog.h" #include "oxygenexceptiondialog.h"
#include <QtCore/QWeakPointer> #include <QtCore/QSharedPointer>
#include <KLocale> #include <KLocale>
#include <KMessageBox> #include <KMessageBox>
@ -113,14 +113,13 @@ namespace Oxygen
{ {
// map dialog // map dialog
QWeakPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) ); QSharedPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) );
dialog.data()->setException( _defaultConfiguration ); dialog->setException( _defaultConfiguration );
if( dialog.data()->exec() == QDialog::Rejected || !dialog ) return; if( dialog->exec() == QDialog::Rejected ) return;
// retrieve exception and check // retrieve exception and check
Exception exception( dialog.data()->exception() ); Exception exception( dialog->exception() );
if( !checkException( exception ) ) return; if( !checkException( exception ) ) return;
delete dialog.data();
// create new item // create new item
model().add( exception ); model().add( exception );
@ -150,13 +149,12 @@ namespace Oxygen
Exception& exception( model().get( current ) ); Exception& exception( model().get( current ) );
// create dialog // create dialog
QWeakPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) ); QSharedPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) );
dialog.data()->setException( exception ); dialog->setException( exception );
// map dialog // map dialog
if( dialog.data()->exec() == QDialog::Rejected || !dialog ) return; if( dialog->exec() == QDialog::Rejected ) return;
Exception newException = dialog.data()->exception(); Exception newException = dialog->exception();
delete dialog.data();
// check if exception was changed // check if exception was changed
if( exception == newException ) return; if( exception == newException ) return;
@ -312,11 +310,10 @@ namespace Oxygen
{ {
KMessageBox::error( this, i18n("Regular Expression syntax is incorrect") ); KMessageBox::error( this, i18n("Regular Expression syntax is incorrect") );
QWeakPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) ); QSharedPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) );
dialog.data()->setException( exception ); dialog->setException( exception );
if( dialog.data()->exec() == QDialog::Rejected || !dialog ) return false; if( dialog->exec() == QDialog::Rejected ) return false;
exception = dialog.data()->exception(); exception = dialog->exception();
delete dialog.data();
} }