From 98a30cc8b97ed2f16cc15742327ae8ea732fc9a6 Mon Sep 17 00:00:00 2001 From: craig Date: Wed, 25 Jan 2012 21:10:44 +0000 Subject: #10082: Backport new Query dialog code and adjust usage to new duplicate check method, and move to declared vars git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17234 11d20701-8431-0410-a711-e3c959e3b870 --- scribus/shadebutton.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'scribus/shadebutton.cpp') diff --git a/scribus/shadebutton.cpp b/scribus/shadebutton.cpp index dd84efa..7d12172 100644 --- a/scribus/shadebutton.cpp +++ b/scribus/shadebutton.cpp @@ -46,21 +46,17 @@ void ShadeButton::setShade(QAction *act) if (c == 0) { - Query* dia = new Query(this, "New", 1, 0, tr("&Shade:"), tr("Shade")); - if (dia->exec()) - { - c = dia->getEditText().toInt(&ok); + Query dia(this, "New", 1, 0, tr("&Shade:"), tr("Shade")); + if (dia.exec()) + { + c = dia.getEditText().toInt(&ok); if (ok) b = qMax(qMin(c, 100),0); else b = 100; - delete dia; } else - { - delete dia; return; - } } setText(QString::number(b)+" %"); emit clicked(); -- cgit