[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [mula] core: Reimplement the internals of the reload dictionary
From: Laszlo Papp <ext-laszlo.papp () nokia ! com>
Date: 2011-09-25 18:14:35
Message-ID: 20110925181435.68F42A60B9 () git ! kde ! org
[Download RAW message or body]
Git commit c80c9ba4f44fa831a4c406f2287af025cb847fba by Laszlo Papp.
Committed on 25/09/2011 at 23:14.
Pushed by lpapp into branch 'master'.
Reimplement the internals of the reload dictionary functionarliy.
M +10 -10 core/dictionarymanager.cpp
http://commits.kde.org/mula/c80c9ba4f44fa831a4c406f2287af025cb847fba
diff --git a/core/dictionarymanager.cpp b/core/dictionarymanager.cpp
index 9ed5b49..03842a9 100644
--- a/core/dictionarymanager.cpp
+++ b/core/dictionarymanager.cpp
@@ -132,8 +132,8 @@ DictionaryManager::availableDictionaryList() const
{
DictionaryPlugin *dictionaryPlugin = \
MulaCore::PluginManager::instance()->plugin(pluginName);
QStringList dictionaries = dictionaryPlugin->availableDictionaryList();
- foreach (const QString& dictionary, dictionaries)
- availableDictionaryList.insert(pluginName, dictionary);
+ foreach (const QString& dictionaryName, dictionaries)
+ availableDictionaryList.insert(pluginName, dictionaryName);
}
return availableDictionaryList;
@@ -202,14 +202,14 @@ void
DictionaryManager::reloadDictionaryList()
{
QMultiHash<QString, QString> loadedDictionaryList;
- // for (QHash<QString, QPluginLoader*>::const_iterator i = d->plugins.begin(); i \
!= d->plugins.end(); ++i)
- // {
- // DictionaryPlugin *plugin = \
qobject_cast<DictionaryPlugin*>((*i)->instance());
- // plugin->setLoadedDictionaryList(plugin->loadedDictionaryList());
-
- // foreach(const QString& dictionaryName, plugin->loadedDictionaryList())
- // loadedDictionaryList.append(DictionaryDataItem(i.key(), \
dictionaryName));
- // }
+ foreach (const QString& pluginName, \
MulaCore::PluginManager::instance()->availablePlugins()) + {
+ DictionaryPlugin *dictionaryPlugin = \
MulaCore::PluginManager::instance()->plugin(pluginName); + \
dictionaryPlugin->setLoadedDictionaryList(dictionaryPlugin->loadedDictionaryList()); \
+ QStringList dictionaries = dictionaryPlugin->availableDictionaryList(); + \
foreach (const QString& dictionaryName, dictionaryPlugin->loadedDictionaryList()) + \
loadedDictionaryList.insert(pluginName, dictionaryName); + }
QMultiHash<QString, QString> oldDictionaryList = d->loadedDictionaryList;
d->loadedDictionaryList.clear();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic