~ubuntu-branches/ubuntu/wily/psi/wily

« back to all changes in this revision

Viewing changes to src/shortcutmanager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
 */
61
61
QList<QKeySequence> ShortcutManager::shortcuts(const QString& name)
62
62
{
 
63
        return readShortcutsFromOptions(name, PsiOptions::instance());
 
64
}
 
65
 
 
66
/**
 
67
 * \brief read the QVariantList associated with the keyname "name" in given PsiOptions
 
68
 * \param name, the shortcut name e.g. "misc.sendmessage" which is in the options xml then
 
69
 *        mirrored as options.shortcuts.misc.sendmessage
 
70
 * \param options, options instance to read from
 
71
 * \return List of sequences
 
72
 */
 
73
QList<QKeySequence> ShortcutManager::readShortcutsFromOptions(const QString& name, const PsiOptions* options)
 
74
{
63
75
        QList<QKeySequence> list;
64
 
        QVariant variant = PsiOptions::instance()->getOption(QString("options.shortcuts.%1").arg(name));
 
76
        QVariant variant = options->getOption(QString("options.shortcuts.%1").arg(name));
65
77
        QString type = variant.typeName();
66
78
        if (type == "QVariantList") {
67
79
                foreach(QVariant variant, variant.toList()) {
76
88
        return list;
77
89
}
78
90
 
79
 
 
80
91
/**
81
92
 * \brief this function connects the Key or Keys associated with the keyname "path" with the slot "slot"
82
93
 *        of the Widget "parent"