KDEUI
Go to the documentation of this file.
19 #include "kshortcutschemeshelper_p.h"
22 #include <QTextStream>
23 #include <QDomDocument>
32 bool KShortcutSchemesHelper::exportActionCollection(
KActionCollection *collection,
43 schemeFileName = shortcutSchemeFileName(client, schemeName);
45 QFile schemeFile(schemeFileName);
46 if (!schemeFile.open(QFile::WriteOnly | QFile::Truncate))
48 kDebug() <<
"COULD NOT WRITE" << schemeFileName;
53 QDomElement docElem = doc.createElement(
"kpartgui");
54 docElem.setAttribute(
"version",
"1");
56 doc.appendChild(docElem);
57 QDomElement elem = doc.createElement(
"ActionProperties");
58 docElem.appendChild(elem);
66 QString actionName = kaction->objectName();
68 if (!shortcut.isEmpty())
70 QDomElement act_elem = doc.createElement(
"Action");
71 act_elem.setAttribute(
"name", actionName );
72 act_elem.setAttribute(
"shortcut", shortcut );
73 elem.appendChild(act_elem);
77 QTextStream out(&schemeFile);
78 out << doc.toString(2);
82 QString KShortcutSchemesHelper::currentShortcutSchemeName()
84 return KGlobal::config()->group(
"Shortcut Schemes" ).readEntry(
"Current Scheme",
"Default");
94 QString KShortcutSchemesHelper::applicationShortcutSchemeFileName(
const QString &schemeName)
96 return KGlobal::dirs()->locateLocal(
"appdata",
97 KGlobal::mainComponent().componentName() + schemeName +
"shortcuts.rc");
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jun 1 2013 20:19:52 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.