From kde-commits Tue Jun 11 13:16:27 2013 From: Anne-Marie Mahfouf Date: Tue, 11 Jun 2013 13:16:27 +0000 To: kde-commits Subject: [kdelibs/frameworks] /: Move KButtonGroup to KDE4Support Message-Id: <20130611131627.2D44FA6067 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=137095659809752 Git commit 60dfe18a3d93ce12e8bb8258efa9a93d704ba6ea by Anne-Marie Mahfouf. Committed on 11/06/2013 at 15:12. Pushed by annma into branch 'frameworks'. Move KButtonGroup to KDE4Support Move class, fix export in header, mark as deprecated Move test to autotests, fix some trailing whitespaces Review: 110478 M +0 -2 kdeui/CMakeLists.txt M +0 -1 kdeui/tests/CMakeLists.txt M +0 -6 kdewidgets/kde.widgets M +6 -0 kdewidgets/kdedeprecated.widgets M +1 -0 staging/kde4support/autotests/CMakeLists.txt R +1 -1 staging/kde4support/autotests/kbuttongrouptest.cpp [from: kd= eui/tests/kbuttongrouptest.cpp - 099% similarity] R +0 -0 staging/kde4support/autotests/kbuttongrouptest.h [from: kdeu= i/tests/kbuttongrouptest.h - 100% similarity] M +2 -0 staging/kde4support/src/CMakeLists.txt R +3 -3 staging/kde4support/src/kdeui/kbuttongroup.cpp [from: kdeui/= widgets/kbuttongroup.cpp - 099% similarity] R +4 -2 staging/kde4support/src/kdeui/kbuttongroup.h [from: kdeui/wi= dgets/kbuttongroup.h - 095% similarity] http://commits.kde.org/kdelibs/60dfe18a3d93ce12e8bb8258efa9a93d704ba6ea diff --git a/kdeui/CMakeLists.txt b/kdeui/CMakeLists.txt index 562c7ca..6b4a365 100644 --- a/kdeui/CMakeLists.txt +++ b/kdeui/CMakeLists.txt @@ -138,7 +138,6 @@ set(kdeui_LIB_SRCS util/kpassivepopup.cpp util/kpassivepopupmessagehandler.cpp util/kundoactions.cpp - widgets/kbuttongroup.cpp widgets/kcharselect.cpp widgets/kcharselectdata.cpp widgets/kcmodule.cpp @@ -401,7 +400,6 @@ install( FILES widgets/kcmodule.h widgets/kcombobox.h widgets/kcompletionbox.h - widgets/kbuttongroup.h widgets/kcharselect.h widgets/kdatetable.h widgets/khelpmenu.h diff --git a/kdeui/tests/CMakeLists.txt b/kdeui/tests/CMakeLists.txt index 4ca816e..beb1cba 100644 --- a/kdeui/tests/CMakeLists.txt +++ b/kdeui/tests/CMakeLists.txt @@ -18,7 +18,6 @@ ENDMACRO(KDEUI_EXECUTABLE_TESTS) KDEUI_UNIT_TESTS( kactioncollectiontest kactioncategorytest - kbuttongrouptest kfindtest kmainwindow_unittest klineedit_unittest diff --git a/kdewidgets/kde.widgets b/kdewidgets/kde.widgets index 261ac1f..b138d4e 100644 --- a/kdewidgets/kde.widgets +++ b/kdewidgets/kde.widgets @@ -14,12 +14,6 @@ ToolTip=3DAn extended version of QToolButton which can d= isplay an animated icon. Group=3DDisplay (KDE) ConstructorArgs=3D(parent) = -[KButtonGroup] -IncludeFile=3Dkbuttongroup.h -ToolTip=3DGroup of radio buttons with index selection. -IsContainer=3Dtrue -Group=3DContainer (KDE) - [KCapacityBar] IncludeFile=3Dkcapacitybar.h ToolTip=3DCapacity Bar (KDE) diff --git a/kdewidgets/kdedeprecated.widgets b/kdewidgets/kdedeprecated.wi= dgets index 92185a7..47dfaec 100644 --- a/kdewidgets/kdedeprecated.widgets +++ b/kdewidgets/kdedeprecated.widgets @@ -9,6 +9,12 @@ ToolTip=3DDraws a button which shows an arrow pointing int= o a certain direction. Group=3DButtons (KDE) ConstructorArgs=3D(parent,Qt::UpArrow) = +[KButtonGroup] +IncludeFile=3Dkbuttongroup.h +ToolTip=3DGroup of radio buttons with index selection. +IsContainer=3Dtrue +Group=3DContainer (KDE) + [KEditListBox] ToolTip=3DFullfeatured edit box with buttons (KDE) Group=3DViews (KDE) diff --git a/staging/kde4support/autotests/CMakeLists.txt b/staging/kde4sup= port/autotests/CMakeLists.txt index 8cef72f..ada9d00 100644 --- a/staging/kde4support/autotests/CMakeLists.txt +++ b/staging/kde4support/autotests/CMakeLists.txt @@ -24,6 +24,7 @@ kde4support_unit_tests( globalcleanuptest kaccelgentest kdebugtest + kbuttongrouptest kdialog_unittest kfadewidgeteffecttest kconfigafterkglobaltest1 diff --git a/kdeui/tests/kbuttongrouptest.cpp b/staging/kde4support/autotes= ts/kbuttongrouptest.cpp similarity index 99% rename from kdeui/tests/kbuttongrouptest.cpp rename to staging/kde4support/autotests/kbuttongrouptest.cpp index 93dd05e..a93ebe6 100644 --- a/kdeui/tests/kbuttongrouptest.cpp +++ b/staging/kde4support/autotests/kbuttongrouptest.cpp @@ -53,7 +53,7 @@ void KButtonGroupTest::initTestCase() = void KButtonGroupTest::directSelectionTestCase() { - // test where setSelected is called before the = + // test where setSelected is called before the // ensurePolished() is called. KButtonGroup* kbuttongroup2 =3D new KButtonGroup(); kbuttongroup2->setSelected( 3 ); diff --git a/kdeui/tests/kbuttongrouptest.h b/staging/kde4support/autotests= /kbuttongrouptest.h similarity index 100% rename from kdeui/tests/kbuttongrouptest.h rename to staging/kde4support/autotests/kbuttongrouptest.h diff --git a/staging/kde4support/src/CMakeLists.txt b/staging/kde4support/s= rc/CMakeLists.txt index f89e845..ca1fe7f 100644 --- a/staging/kde4support/src/CMakeLists.txt +++ b/staging/kde4support/src/CMakeLists.txt @@ -39,6 +39,7 @@ set(libkde4support_SRCS kdeui/k3icon.cpp kdeui/kaction.cpp kdeui/kapplication.cpp + kdeui/kbuttongroup.cpp kdeui/kcolorchoosermode.cpp kdeui/kcolordialog.cpp kdeui/kcolorhelpers.cpp @@ -150,6 +151,7 @@ install(FILES kdeui/kaccelgen.h kdeui/kaction.h kdeui/kapplication.h + kdeui/kbuttongroup.h kdeui/kcolorchoosermode.h kdeui/kcolordialog.h kdeui/kcolorvalueselector.h diff --git a/kdeui/widgets/kbuttongroup.cpp b/staging/kde4support/src/kdeui= /kbuttongroup.cpp similarity index 99% rename from kdeui/widgets/kbuttongroup.cpp rename to staging/kde4support/src/kdeui/kbuttongroup.cpp index c4d918d..139d60d 100644 --- a/kdeui/widgets/kbuttongroup.cpp +++ b/staging/kde4support/src/kdeui/kbuttongroup.cpp @@ -69,7 +69,7 @@ void KButtonGroup::setSelected( int id ) ensurePolished(); return; } - = + QHash::Iterator it =3D d->btnMap.begin(); QHash::Iterator itEnd =3D d->btnMap.end(); QAbstractButton* button =3D 0; @@ -84,7 +84,7 @@ void KButtonGroup::setSelected( int id ) return; } } - // button not found, it might still show up though, eg. because of prema= ture polishing above = + // button not found, it might still show up though, eg. because of prema= ture polishing above d->wantToBeId =3D id; } = @@ -110,7 +110,7 @@ void KButtonGroup::childEvent( QChildEvent* event ) d->releasedMapper.setMapping( button, d->nextId ); = d->btnMap[ button ] =3D d->nextId; - = + if ( d->nextId =3D=3D d->wantToBeId ) { d->currentId =3D d->wantToBeId; diff --git a/kdeui/widgets/kbuttongroup.h b/staging/kde4support/src/kdeui/k= buttongroup.h similarity index 95% rename from kdeui/widgets/kbuttongroup.h rename to staging/kde4support/src/kdeui/kbuttongroup.h index 5bc89dd..06f2aa2 100644 --- a/kdeui/widgets/kbuttongroup.h +++ b/staging/kde4support/src/kdeui/kbuttongroup.h @@ -22,12 +22,14 @@ #ifndef KBUTTONGROUP_H #define KBUTTONGROUP_H = -#include +#include #include = class QAbstractButton; = /** + * @deprecated since 5.0, use QGroupBox and QButtonGroup instead + * * @short Group box with index of the selected button * KButtonGroup is a simple group box that can keep track of the current s= elected * button of the ones added to it. @@ -38,7 +40,7 @@ class QAbstractButton; * * @author Pino Toscano */ -class KDEUI_EXPORT KButtonGroup +class KDE4SUPPORT_EXPORT KButtonGroup : public QGroupBox { Q_OBJECT