Revision: 6359
Author: nogu.dev
Date: Sun May  2 07:29:42 2010
Log: * qt4/pref/customwidgets.cpp
  - (KeyEditForm::slotAddClicked, KeyEditForm::slotEditClicked):
    Fix crashy code. See also: http://www.kdedevelopers.org/node/3919
http://code.google.com/p/uim/source/detail?r=6359

Modified:
 /trunk/qt4/pref/customwidgets.cpp

=======================================
--- /trunk/qt4/pref/customwidgets.cpp   Sun Apr  4 20:35:54 2010
+++ /trunk/qt4/pref/customwidgets.cpp   Sun May  2 07:29:42 2010
@@ -37,6 +37,7 @@

 #include "qtgettext.h"

+#include <QtCore/QPointer>
 #include <QtGui/QFileDialog>
 #include <QtGui/QLabel>
 #include <QtGui/QTreeWidget>
@@ -828,7 +829,7 @@

 void KeyEditForm::slotAddClicked()
 {
-    KeyGrabDialog *d = new KeyGrabDialog( this );
+    QPointer<KeyGrabDialog> d = new KeyGrabDialog( this );
     if( d->exec() == KeyGrabDialog::Accepted )
     {
         QString keystr = d->getKeyStr();
@@ -855,7 +856,7 @@
     QList<QTreeWidgetItem *> selectedItems = m_listView->selectedItems();
     if( selectedItems.isEmpty() )
         return;
-    KeyGrabDialog *d = new KeyGrabDialog( this );
+    QPointer<KeyGrabDialog> d = new KeyGrabDialog( this );
     if( d->exec() == KeyGrabDialog::Accepted )
     {
         QString keystr = d->getKeyStr();

Reply via email to