Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit cc1931e9 authored by Yuri Chornoivan's avatar Yuri Chornoivan

Fix minor EBN issues

parent 25fbd496
......@@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <config.h>
#include "config.h" // krazy:exclude=includes
#include <QLabel>
#include <QVBoxLayout>
......
......@@ -1248,12 +1248,12 @@ void KolfGame::putterTimeout()
if (al > 45)
{
deg = putter->curDeg() - 45 + rand() % 90;
strength -= rand() % (int)strength;
strength -= qrand() % (int)strength;
}
else if (!finishStroking)
{
deg = putter->curDeg() - 45 + rand() % 90;
strength -= rand() % (int)strength;
strength -= qrand() % (int)strength;
}
else
deg = putter->curDeg() + (int)(strokeCircle->value() / 3);
......
......@@ -111,15 +111,15 @@ QString KComboBoxDialog::getItem( const QString &_text, const QString &_caption,
return prevAnswer;
}
KComboBoxDialog dlg( _text, _items, _value, !dontAskAgainName.isNull(), parent );
QPointer<KComboBoxDialog> dlg = new KComboBoxDialog( _text, _items, _value, !dontAskAgainName.isNull(), parent );
if ( !_caption.isNull() )
dlg.setWindowTitle( _caption );
dlg->setWindowTitle( _caption );
dlg.exec();
dlg->exec();
const QString text = dlg.text();
const QString text = dlg->text();
if (dlg.dontAskAgainChecked())
if (dlg->dontAskAgainChecked())
{
if ( !dontAskAgainName.isEmpty() && !text.isEmpty() )
{
......@@ -128,6 +128,7 @@ QString KComboBoxDialog::getItem( const QString &_text, const QString &_caption,
configGroup->writeEntry( dontAskAgainName, text );
}
}
delete dlg;
return text;
}
......@@ -135,11 +136,11 @@ QString KComboBoxDialog::getItem( const QString &_text, const QString &_caption,
QString KComboBoxDialog::getText(const QString &_caption, const QString &_text, const QString &_value, bool *ok, QWidget *parent, const QString &configName, KSharedConfigPtr config)
{
KConfigGroup *configGroup = 0;
KComboBoxDialog dlg(_text, QStringList(), _value, false, parent);
QPointer<KComboBoxDialog> dlg = new KComboBoxDialog(_text, QStringList(), _value, false, parent);
if ( !_caption.isNull() )
dlg.setWindowTitle( _caption );
dlg->setWindowTitle( _caption );
KHistoryComboBox * const box = dlg.comboBox();
KHistoryComboBox * const box = dlg->comboBox();
box->setEditable(true);
const QString historyItem = QString("%1History").arg(configName);
......@@ -152,17 +153,19 @@ QString KComboBoxDialog::getText(const QString &_caption, const QString &_text,
box->completionObject()->setItems(configGroup->readEntry(completionItem,QStringList()));
}
bool result = dlg.exec();
bool result = dlg->exec();
if(ok) *ok = result;
if(!configName.isNull() && result)
{
box->addToHistory(dlg.text());
box->completionObject()->addItem(dlg.text());
box->addToHistory(dlg->text());
box->completionObject()->addItem(dlg->text());
configGroup = new KConfigGroup(config->group("KComboBoxDialog"));
configGroup->writeEntry(historyItem, box->historyItems());
configGroup->writeEntry(completionItem, box->completionObject()->items());
}
return dlg.text();
QString text = dlg->text();
delete dlg;
return text;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment