Krita Source Code Documentation
Loading...
Searching...
No Matches
KisKShortcutSchemesHelper Class Reference

#include <kshortcutschemeshelper_p.h>

Static Public Member Functions

static bool saveShortcutScheme ()
 
static QHash< QString, QString > schemeFileLocations ()
 
static QString shortcutSchemeFileName (const QString &schemeName)
 

Detailed Description

Definition at line 16 of file kshortcutschemeshelper_p.h.

Member Function Documentation

◆ saveShortcutScheme()

static bool KisKShortcutSchemesHelper::saveShortcutScheme ( )
static

◆ schemeFileLocations()

QHash< QString, QString > KisKShortcutSchemesHelper::schemeFileLocations ( )
static
Returns
a list of files to save the shortcut scheme to. Does not include "Default"
See also
shortcutSchemeFileName, exportActionCollection

Definition at line 32 of file kshortcutschemeshelper.cpp.

33{
34 QStringList schemes;
35 schemes << QString("Default"); // Forbid "Default.shortcuts"
36 QHash<QString, QString> schemeFileLocations;
37 const QStringList shortcutFiles = KoResourcePaths::findAllAssets("kis_shortcuts", "*.shortcuts");
38 Q_FOREACH (const QString &file, shortcutFiles) {
39 QFileInfo fileInfo(file);
40 QString schemeName = fileInfo.completeBaseName();
41 if (!schemes.contains(schemeName)) {
42 schemes << schemeName;
43 schemeFileLocations.insert(schemeName, fileInfo.canonicalFilePath());
44 }
45 }
47}
static QHash< QString, QString > schemeFileLocations()
static QStringList findAllAssets(const QString &type, const QString &filter=QString(), SearchOptions options=NoSearchOptions)

References KoResourcePaths::findAllAssets(), and schemeFileLocations().

◆ shortcutSchemeFileName()

QString KisKShortcutSchemesHelper::shortcutSchemeFileName ( const QString & schemeName)
static
Returns
the name of the (writable) file to save the shortcut scheme to.

Definition at line 25 of file kshortcutschemeshelper.cpp.

26{
27 // Create a directory if one cannot be found.
28 return KoResourcePaths::locateLocal("kis_shortcuts", schemeName, true);
29}
static QString locateLocal(const QString &type, const QString &filename, bool createDir=false)

References KoResourcePaths::locateLocal().


The documentation for this class was generated from the following files: