Changeset View
Changeset View
Standalone View
Standalone View
src/kxmlguiclient.cpp
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 95 | if (d->m_parent) { | |||
---|---|---|---|---|---|
96 | d->m_parent->removeChildClient(this); | 96 | d->m_parent->removeChildClient(this); | ||
97 | } | 97 | } | ||
98 | 98 | | |||
99 | if (d->m_factory) { | 99 | if (d->m_factory) { | ||
100 | qCWarning(DEBUG_KXMLGUI) << this << "deleted without having been removed from the factory first. This will leak standalone popupmenus and could lead to crashes."; | 100 | qCWarning(DEBUG_KXMLGUI) << this << "deleted without having been removed from the factory first. This will leak standalone popupmenus and could lead to crashes."; | ||
101 | d->m_factory->forgetClient(this); | 101 | d->m_factory->forgetClient(this); | ||
102 | } | 102 | } | ||
103 | 103 | | |||
104 | Q_FOREACH (KXMLGUIClient *client, d->m_children) { | 104 | for (KXMLGUIClient *client : qAsConst(d->m_children)) { | ||
105 | if (d->m_factory) { | 105 | if (d->m_factory) { | ||
106 | d->m_factory->forgetClient(client); | 106 | d->m_factory->forgetClient(client); | ||
107 | } | 107 | } | ||
108 | assert(client->d->m_parent == this); | 108 | assert(client->d->m_parent == this); | ||
109 | client->d->m_parent = nullptr; | 109 | client->d->m_parent = nullptr; | ||
110 | } | 110 | } | ||
111 | 111 | | |||
112 | delete d->m_actionCollection; | 112 | delete d->m_actionCollection; | ||
113 | delete d; | 113 | delete d; | ||
114 | } | 114 | } | ||
115 | 115 | | |||
116 | QAction *KXMLGUIClient::action(const char *name) const | 116 | QAction *KXMLGUIClient::action(const char *name) const | ||
117 | { | 117 | { | ||
118 | QAction *act = actionCollection()->action(QLatin1String(name)); | 118 | QAction *act = actionCollection()->action(QLatin1String(name)); | ||
119 | if (!act) { | 119 | if (!act) { | ||
120 | Q_FOREACH (KXMLGUIClient *client, d->m_children) { | 120 | for (KXMLGUIClient *client : qAsConst(d->m_children)) { | ||
121 | act = client->actionCollection()->action(QLatin1String(name)); | 121 | act = client->actionCollection()->action(QLatin1String(name)); | ||
122 | if (act) { | 122 | if (act) { | ||
123 | break; | 123 | break; | ||
124 | } | 124 | } | ||
125 | } | 125 | } | ||
126 | } | 126 | } | ||
127 | return act; | 127 | return act; | ||
128 | } | 128 | } | ||
▲ Show 20 Lines • Show All 652 Lines • ▼ Show 20 Line(s) | 775 | for (QStringList::const_iterator it = stateChange.actionsToDisable.constBegin(); | |||
781 | } | 781 | } | ||
782 | } | 782 | } | ||
783 | 783 | | |||
784 | } | 784 | } | ||
785 | 785 | | |||
786 | void KXMLGUIClient::beginXMLPlug(QWidget *w) | 786 | void KXMLGUIClient::beginXMLPlug(QWidget *w) | ||
787 | { | 787 | { | ||
788 | actionCollection()->addAssociatedWidget(w); | 788 | actionCollection()->addAssociatedWidget(w); | ||
789 | foreach (KXMLGUIClient *client, d->m_children) { | 789 | for (KXMLGUIClient *client : qAsConst(d->m_children)) { | ||
790 | client->beginXMLPlug(w); | 790 | client->beginXMLPlug(w); | ||
791 | } | 791 | } | ||
792 | } | 792 | } | ||
793 | 793 | | |||
794 | void KXMLGUIClient::endXMLPlug() | 794 | void KXMLGUIClient::endXMLPlug() | ||
795 | { | 795 | { | ||
796 | } | 796 | } | ||
797 | 797 | | |||
798 | void KXMLGUIClient::prepareXMLUnplug(QWidget *w) | 798 | void KXMLGUIClient::prepareXMLUnplug(QWidget *w) | ||
799 | { | 799 | { | ||
800 | actionCollection()->removeAssociatedWidget(w); | 800 | actionCollection()->removeAssociatedWidget(w); | ||
801 | foreach (KXMLGUIClient *client, d->m_children) { | 801 | for (KXMLGUIClient *client : qAsConst(d->m_children)) { | ||
802 | client->prepareXMLUnplug(w); | 802 | client->prepareXMLUnplug(w); | ||
803 | } | 803 | } | ||
804 | } | 804 | } | ||
805 | 805 | | |||
806 | void KXMLGUIClient::virtual_hook(int, void *) | 806 | void KXMLGUIClient::virtual_hook(int, void *) | ||
807 | { | 807 | { | ||
808 | /*BASE::virtual_hook( id, data );*/ | 808 | /*BASE::virtual_hook( id, data );*/ | ||
809 | } | 809 | } |