Commit b69e8669 authored by Sven Langkamp's avatar Sven Langkamp

load old style favorite presets and add tags for the new system

parent ab8f2ab3
......@@ -171,11 +171,25 @@ KisFavoriteResourceManager::KisFavoriteResourceManager(KisPaintopBox *paintopBox
KoResourceServer<KisPaintOpPreset>* rServer = KisResourceServerProvider::instance()->paintOpPresetServer();
rServer->addObserver(this);
connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(updateFavoritePresets()));
KConfigGroup group(KGlobal::config(), "favoriteList");
QStringList oldFavoritePresets = (group.readEntry("favoritePresets")).split(',', QString::SkipEmptyParts);
KisConfig cfg;
m_currentTag = cfg.readEntry<QString>("favoritePresetsTag", QString());
if (!oldFavoritePresets.isEmpty() && m_currentTag.isEmpty()) {
m_currentTag = i18n("Favorite Presets");
foreach( const QString& name, oldFavoritePresets) {
KisPaintOpPreset* preset = rServer->resourceByName(name);
rServer->addTag(preset, m_currentTag);
}
rServer->tagCategoryAdded(m_currentTag);
cfg.writeEntry<QString>("favoritePresets", QString());
}
connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(updateFavoritePresets()));
updateFavoritePresets();
}
......
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