Changeset View
Changeset View
Standalone View
Standalone View
src/kshortcutsdialog.cpp
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | 84 | if (m_keyChooser->isModified() && KMessageBox::questionYesNo(q, | |||
---|---|---|---|---|---|
86 | m_keyChooser->save(); | 86 | m_keyChooser->save(); | ||
87 | } else { | 87 | } else { | ||
88 | m_keyChooser->undoChanges(); | 88 | m_keyChooser->undoChanges(); | ||
89 | } | 89 | } | ||
90 | 90 | | |||
91 | QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); | 91 | QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); | ||
92 | m_keyChooser->clearCollections(); | 92 | m_keyChooser->clearCollections(); | ||
93 | 93 | | |||
94 | foreach (KActionCollection *collection, m_collections) { | 94 | for (KActionCollection *collection : qAsConst(m_collections)) { | ||
95 | // passing an empty stream forces the clients to reread the XML | 95 | // passing an empty stream forces the clients to reread the XML | ||
96 | KXMLGUIClient *client = const_cast<KXMLGUIClient *>(collection->parentGUIClient()); | 96 | KXMLGUIClient *client = const_cast<KXMLGUIClient *>(collection->parentGUIClient()); | ||
97 | if (client) { | 97 | if (client) { | ||
98 | client->setXMLGUIBuildDocument(QDomDocument()); | 98 | client->setXMLGUIBuildDocument(QDomDocument()); | ||
99 | } | 99 | } | ||
100 | } | 100 | } | ||
101 | 101 | | |||
102 | //get xmlguifactory | 102 | //get xmlguifactory | ||
103 | if (!m_collections.isEmpty()) { | 103 | if (!m_collections.isEmpty()) { | ||
104 | const KXMLGUIClient *client = m_collections.first()->parentGUIClient(); | 104 | const KXMLGUIClient *client = m_collections.first()->parentGUIClient(); | ||
105 | if (client) { | 105 | if (client) { | ||
106 | KXMLGUIFactory *factory = client->factory(); | 106 | KXMLGUIFactory *factory = client->factory(); | ||
107 | if (factory) { | 107 | if (factory) { | ||
108 | factory->changeShortcutScheme(scheme); | 108 | factory->changeShortcutScheme(scheme); | ||
109 | } | 109 | } | ||
110 | } | 110 | } | ||
111 | } | 111 | } | ||
112 | 112 | | |||
113 | foreach (KActionCollection *collection, m_collections) { | 113 | for (KActionCollection *collection : qAsConst(m_collections)) { | ||
114 | m_keyChooser->addCollection(collection); | 114 | m_keyChooser->addCollection(collection); | ||
115 | } | 115 | } | ||
116 | 116 | | |||
117 | QApplication::restoreOverrideCursor(); | 117 | QApplication::restoreOverrideCursor(); | ||
118 | } | 118 | } | ||
119 | 119 | | |||
120 | void undoChanges() | 120 | void undoChanges() | ||
121 | { | 121 | { | ||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |