[uim-commit] r2533 - trunk/qt
kzk at freedesktop.org
kzk at freedesktop.org
Sun Dec 11 18:01:10 PST 2005
Author: kzk
Date: 2005-12-11 18:01:06 -0800 (Sun, 11 Dec 2005)
New Revision: 2533
Modified:
trunk/qt/pref-qt.cpp
Log:
* qt/pref-qt.cpp
- (UimPrefDialog::checkDotUimFile): delete pointer for avoiding
memory leak.
- (QConfirmDialog::setupWidgets): fix invalid layouting which
causes SEGV in destructor
Modified: trunk/qt/pref-qt.cpp
===================================================================
--- trunk/qt/pref-qt.cpp 2005-12-12 01:09:01 UTC (rev 2532)
+++ trunk/qt/pref-qt.cpp 2005-12-12 02:01:06 UTC (rev 2533)
@@ -107,13 +107,13 @@
"This file will override all conflicted settings set by\n"
"this tool (stored in ~/.uim.d/customs/*.scm).\n"
"Please check the file if you find your settings aren't applied.");
+
QConfirmDialog *d = new QConfirmDialog( msg,
"/uim/qt/warnDotUim",
this );
d->setCaption( _("~/.uim exists!") );
d->exec();
- // To avoid crashes... --ekato 2005.02.25
- //delete d;
+ delete d;
}
}
@@ -335,30 +335,25 @@
void QConfirmDialog::setupWidgets( const QString&msg )
{
- QVBoxLayout *vbox = new QVBoxLayout( this );
- vbox->setSpacing( 6 );
- vbox->setMargin( 6 );
-
+ QVBoxLayout *vLayout = new QVBoxLayout( this );
+ vLayout->setSpacing( 6 );
+ vLayout->setMargin( 6 );
QLabel *msgLabel = new QLabel( msg, this );
KSeparator *sep = new KSeparator( this );
+ vLayout->addWidget( msgLabel );
+ vLayout->addWidget( sep );
- QHBoxLayout *buttonHBox = new QHBoxLayout(vbox, 4);
-
+ QHBoxLayout *buttonHLayout = new QHBoxLayout( vLayout );
QCheckBox *checkBox = new QCheckBox( _("Show this dialog on startup"), this );
QSettings settings;
bool isWarnDotUim = settings.readBoolEntry( m_confname, true );
checkBox->setChecked( isWarnDotUim );
-
QPushButton *ok = new QPushButton( _("OK"), this );
ok->setDefault(true);
- buttonHBox->addWidget( checkBox );
- buttonHBox->addStretch();
- buttonHBox->addWidget( ok );
+ buttonHLayout->addWidget( checkBox );
+ buttonHLayout->addStretch();
+ buttonHLayout->addWidget( ok );
- vbox->addWidget( msgLabel );
- vbox->addWidget( sep );
- vbox->addLayout( buttonHBox );
-
QObject::connect( ok, SIGNAL(clicked()),
this, SLOT(accept()) );
QObject::connect( checkBox, SIGNAL(toggled(bool)),
More information about the uim-commit
mailing list