From f98feb16981350480bdb292cf157f70005d5be12 Mon Sep 17 00:00:00 2001 From: Henri Chain Date: Fri, 28 Feb 2020 09:53:54 +0100 Subject: fix min/max entries with dpointer Summary: D27497 was causing cases with dpointer + min/max to fail Specifically, this okular build: https://build.kde.org/job/Applications/job/okular/job/kf5-qt5 SUSEQt5.12/175/console Test Plan: Added min/max to dpointer autotest Reviewers: meven, ervin Subscribers: kde-frameworks-devel, aacid Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27717 --- autotests/kconfig_compiler/test_dpointer.cpp.ref | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'autotests/kconfig_compiler/test_dpointer.cpp.ref') diff --git a/autotests/kconfig_compiler/test_dpointer.cpp.ref b/autotests/kconfig_compiler/test_dpointer.cpp.ref index 5693fb62..14af30b7 100644 --- a/autotests/kconfig_compiler/test_dpointer.cpp.ref +++ b/autotests/kconfig_compiler/test_dpointer.cpp.ref @@ -78,6 +78,8 @@ TestDPointer::TestDPointer( ) d->autoSaveItem->setWhatsThis( QCoreApplication::translate("TestDPointer", "WhatsThis text for AutoSave option") ); addItem( d->autoSaveItem, QStringLiteral( "AutoSave" ) ); d->autoSaveIntervalItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Auto Save Interval" ), d->autoSaveInterval, 10 ); + d->autoSaveIntervalItem->setMinValue(0); + d->autoSaveIntervalItem->setMaxValue(123); d->autoSaveIntervalItem->setLabel( QCoreApplication::translate("TestDPointer", "Auto Save Interval") ); addItem( d->autoSaveIntervalItem, QStringLiteral( "AutoSaveInterval" ) ); d->confirmItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Confirm Deletes" ), d->confirm, true ); @@ -179,6 +181,18 @@ KConfigSkeleton::ItemBool *TestDPointer::autoSaveItem() void TestDPointer::setAutoSaveInterval( int v ) { + if (v < 0) + { + qDebug() << "setAutoSaveInterval: value " << v << " is less than the minimum value of 0"; + v = 0; + } + + if (v > 123) + { + qDebug() << "setAutoSaveInterval: value " << v << " is greater than the maximum value of 123"; + v = 123; + } + if (!self()->TestDPointer::isAutoSaveIntervalImmutable()) self()->d->autoSaveInterval = v; } -- cgit v1.2.1