removed other instances of QSharedPointer (damn Qt)

CCBUG: 290965
This commit is contained in:
Hugo Pereira Da Costa 2012-01-09 09:49:44 +01:00
parent 0f8e0545f5
commit 49d44ee2a5

View file

@ -113,16 +113,24 @@ namespace Oxygen
{ {
// map dialog // map dialog
//QSharedPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) );
QPointer<ExceptionDialog> dialog = new ExceptionDialog( this ); QPointer<ExceptionDialog> dialog = new ExceptionDialog( this );
dialog->setException( _defaultConfiguration ); dialog->setException( _defaultConfiguration );
// run dialog and check existence // run dialog and check existence
if( dialog->exec() == QDialog::Rejected ) return; if( dialog->exec() == QDialog::Rejected )
{
delete dialog;
return;
}
// check dialog
if( !dialog ) return; if( !dialog ) return;
// retrieve exception and check // retrieve exception and check
Exception exception( dialog->exception() ); Exception exception( dialog->exception() );
delete dialog;
// check exceptions
if( !checkException( exception ) ) return; if( !checkException( exception ) ) return;
// create new item // create new item
@ -136,8 +144,6 @@ namespace Oxygen
ui.exceptionListView->selectionModel()->setCurrentIndex( index, QItemSelectionModel::Current|QItemSelectionModel::Rows ); ui.exceptionListView->selectionModel()->setCurrentIndex( index, QItemSelectionModel::Current|QItemSelectionModel::Rows );
} }
delete dialog;
resizeColumns(); resizeColumns();
emit changed(); emit changed();
return; return;
@ -155,12 +161,22 @@ namespace Oxygen
Exception& exception( model().get( current ) ); Exception& exception( model().get( current ) );
// create dialog // create dialog
QSharedPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) ); QPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) );
dialog->setException( exception ); dialog->setException( exception );
// map dialog // map dialog
if( dialog->exec() == QDialog::Rejected ) return; if( dialog->exec() == QDialog::Rejected )
{
delete dialog;
return;
}
// check dialog
if( !dialog ) return;
// retrieve exception
Exception newException = dialog->exception(); Exception newException = dialog->exception();
delete dialog;
// check if exception was changed // check if exception was changed
if( exception == newException ) return; if( exception == newException ) return;
@ -170,6 +186,7 @@ namespace Oxygen
// asign new exception // asign new exception
*&exception = newException; *&exception = newException;
resizeColumns(); resizeColumns();
emit changed(); emit changed();
return; return;
@ -316,11 +333,16 @@ namespace Oxygen
{ {
KMessageBox::error( this, i18n("Regular Expression syntax is incorrect") ); KMessageBox::error( this, i18n("Regular Expression syntax is incorrect") );
QSharedPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) ); QPointer<ExceptionDialog> dialog( new ExceptionDialog( this ) );
dialog->setException( exception ); dialog->setException( exception );
if( dialog->exec() == QDialog::Rejected ) return false; if( dialog->exec() == QDialog::Rejected )
exception = dialog->exception(); {
delete dialog;
return false;
}
exception = dialog->exception();
delete dialog;
} }
return true; return true;