~neon/kmouth/master

« back to all changes in this revision

Viewing changes to wordcompletion/wordcompletion.cpp

  • Committer: Jeremy Whiting
  • Date: 2015-05-07 02:51:46 UTC
  • Revision ID: git-v1:d3e2a75c3d4ecc99dcf99af4b928f889538dd590
Port from KConfig to KSharedConfig.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#include <QStandardPaths>
7
7
#include <QTextStream>
8
8
 
9
 
#include <KConfig>
10
9
#include <KConfigGroup>
 
10
#include <KSharedConfig>
11
11
 
12
12
class WordCompletion::WordCompletionPrivate
13
13
{
106
106
 
107
107
bool WordCompletion::isConfigured()
108
108
{
109
 
    KConfig *config = new KConfig(QLatin1String("kmouthrc"));
110
 
    bool result = config->hasGroup("Dictionary 0");
111
 
    delete config;
 
109
    bool result = KSharedConfig::openConfig()->hasGroup("Dictionary 0");
112
110
 
113
111
    return result;
114
112
}
122
120
    d->dictionaries.clear();
123
121
    d->dictDetails.clear();
124
122
 
125
 
    KConfig *config = new KConfig(QLatin1String("kmouthrc"));
126
 
    const QStringList groups = config->groupList();
 
123
    const QStringList groups = KSharedConfig::openConfig()->groupList();
127
124
    for (QStringList::const_iterator it = groups.constBegin(); it != groups.constEnd(); ++it)
128
125
        if ((*it).startsWith(QLatin1String("Dictionary "))) {
129
 
            KConfigGroup cg(config, *it);
 
126
            KConfigGroup cg(KSharedConfig::openConfig(), *it);
130
127
            WordCompletionPrivate::DictionaryDetails details;
131
128
            details.filename = cg.readEntry("Filename");
132
129
            details.language = cg.readEntry("Language");
134
131
            d->dictDetails[name] = details;
135
132
            d->dictionaries += name;
136
133
        }
137
 
    delete config;
138
134
 
139
135
    d->blockCurrentListSignal = true;
140
136
    setWordList(d->current);