Commit 20fd9f62 authored by Michael Abrahams's avatar Michael Abrahams

Fix some compiler warnings for unused f'n args

parent 440621b2
......@@ -431,7 +431,7 @@ void KisPart::configureShortcuts()
d->loadActions();
auto actionRegistry = KisActionRegistry::instance();
actionRegistry->configureShortcuts(d->actionCollection);
actionRegistry->configureShortcuts();
}
void KisPart::updateShortcuts()
......
......@@ -217,7 +217,7 @@ QAction * KisActionRegistry::makeQAction(const QString &name, QObject *parent)
};
void KisActionRegistry::configureShortcuts(KActionCollection *ac)
void KisActionRegistry::configureShortcuts()
{
KisShortcutsDialog dlg;
......@@ -307,8 +307,7 @@ bool KisActionRegistry::propertizeAction(const QString &name, QAction * a)
// TODO: check for colliding shortcuts, either with some code like this, or
// by relying on the code existing inside kactioncollection
// TODO: check for colliding shortcuts, either here, or in loading code
//
// QMap<QKeySequence, QAction*> existingShortcuts;
// Q_FOREACH (QAction* action, actionCollection->actions()) {
......@@ -407,8 +406,8 @@ void KisActionRegistry::Private::loadActionFiles()
// <text> field
QDomElement categoryTextNode = actions.firstChild().toElement();
QString categoryName = quietlyTranslate(categoryTextNode.text());
KActionCategory *category = actionCollection->getCategory(categoryName);
dbgAction << "Using category" << categoryName;
// KActionCategory *category = actionCollection->getCategory(categoryName);
// dbgAction << "Using category" << categoryName;
// <action></action> tags
QDomElement actionXml = categoryTextNode.nextSiblingElement();
......
......@@ -101,7 +101,7 @@ public:
QStringList allActions();
/**
* Save settings. Not implemented yet.
* Save settings. Currently implemented in KisShortcutsEditor
*/
// void writeSettings(KActionCollection *ac);
......@@ -109,7 +109,7 @@ public:
/**
* Display the shortcut configuration dialog.
*/
void configureShortcuts(KActionCollection *ac);
void configureShortcuts();
/**
......
......@@ -35,43 +35,6 @@
#include "KoResourcePaths.h"
#include "kis_action_registry.h"
bool KShortcutSchemesHelper::exportActionCollection(KActionCollection *collection,
const QString &schemeName, const QString &dir)
{
QString schemeFileName = shortcutSchemeFileName(schemeName);
QFile schemeFile(schemeFileName);
if (!schemeFile.open(QFile::WriteOnly | QFile::Truncate)) {
return false;
}
QDomDocument doc;
QDomElement docElem = doc.createElement(QStringLiteral("kpartgui"));
docElem.setAttribute(QStringLiteral("version"), QLatin1String("1"));
docElem.setAttribute(QStringLiteral("name"), QCoreApplication::applicationName());
doc.appendChild(docElem);
QDomElement elem = doc.createElement(QStringLiteral("ActionProperties"));
docElem.appendChild(elem);
// now, iterate through our actions
Q_FOREACH (QAction *action, collection->actions()) {
if (!action) {
continue;
}
QString actionName = action->objectName();
QString shortcut = QKeySequence::listToString(action->shortcuts());
if (!shortcut.isEmpty()) {
QDomElement act_elem = doc.createElement(QStringLiteral("Action"));
act_elem.setAttribute(QStringLiteral("name"), actionName);
act_elem.setAttribute(QStringLiteral("shortcut"), shortcut);
elem.appendChild(act_elem);
}
}
QTextStream out(&schemeFile);
out << doc.toString(2);
return true;
}
QString KShortcutSchemesHelper::currentShortcutSchemeName()
{
......
......@@ -30,19 +30,6 @@ class KShortcutSchemesHelper
{
public:
/**
* Saves actions from the collection to shortcut scheme file.
* If the url is given, saves to that directory, otherwise saves to user appdata directory.
*
* This doesn't save anything if there's no parent xmlgui client for action collection.
*
* The name of the resulting file is: shortcuts/<scheme name>.rc .
*
* @return true if the action collection was exported
*/
static bool exportActionCollection(KActionCollection *collection, const QString &schemeName,
const QString &dir = QString());
/**
* @return the current shortcut scheme name for the application.
*/
......
......@@ -687,8 +687,11 @@ void KXMLGUIFactoryPrivate::applyShortcutScheme(KXMLGUIClient *client,
const QList<QAction *> &actions
/*, const QDomDocument &scheme */)
{
// Deprecated - use KisShortcutsEditor and KisActionRegistry instead
Q_UNUSED(client);
Q_UNUSED(actions);
#if 0
Q_UNUSED(client)
KConfigGroup cg = KSharedConfig::openConfig()->group("Shortcut Schemes");
QString schemeName = cg.readEntry("Current Scheme", "Default");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment