Warning, file /plasma/khotkeys/kcm_hotkeys/action_group_widget.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 SPDX-FileCopyrightText: 2008 Michael Jansen <kde@michael-jansen.biz> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "action_group_widget.h" 0008 0009 #include "conditions/conditions_widget.h" 0010 0011 #include "action_data/action_data_group.h" 0012 0013 ActionGroupWidget::ActionGroupWidget(QWidget *parent) 0014 : HotkeysWidgetBase(parent) 0015 , _conditions(new ConditionsWidget) 0016 { 0017 extend(_conditions, i18n("Conditions")); 0018 connect(_conditions, SIGNAL(changed(bool)), SLOT(slotChanged())); 0019 } 0020 0021 ActionGroupWidget::~ActionGroupWidget() 0022 { 0023 _conditions = nullptr; 0024 } 0025 0026 void ActionGroupWidget::setActionData(KHotKeys::ActionDataGroup *group) 0027 { 0028 _data = group; 0029 0030 // BUG: conditions copies twice from the original. Once in 0031 // setConditionsList and once because of the copyFromObject call below. 0032 Q_ASSERT(_conditions); 0033 _conditions->setConditionsList(group->conditions()); 0034 0035 Base::copyFromObject(); 0036 } 0037 0038 void ActionGroupWidget::doCopyFromObject() 0039 { 0040 Q_ASSERT(data()); 0041 Base::doCopyFromObject(); 0042 0043 Q_ASSERT(_conditions); 0044 _conditions->copyFromObject(); 0045 } 0046 0047 void ActionGroupWidget::doCopyToObject() 0048 { 0049 Q_ASSERT(data()); 0050 Base::doCopyToObject(); 0051 0052 Q_ASSERT(_conditions); 0053 _conditions->copyToObject(); 0054 } 0055 0056 bool ActionGroupWidget::isChanged() const 0057 { 0058 return _conditions->hasChanges() || Base::isChanged(); 0059 } 0060 0061 #include "moc_action_group_widget.cpp"