Commit c297b06b authored by Boudewijn Rempt's avatar Boudewijn Rempt

Make it possible to change the set of enabled/disabled metadata filters

So we can restore settings in the export dialogs.
parent a6b1db52
......@@ -18,6 +18,7 @@
#include "kis_meta_data_filter_registry_model.h"
#include "kis_debug.h"
#include <QStringList>
using namespace KisMetaData;
......@@ -78,3 +79,13 @@ QList<const Filter*> FilterRegistryModel::enabledFilters() const
}
return enabledFilters;
}
void FilterRegistryModel::setEnabledFilters(const QStringList &enabledFilters)
{
d->enabled.clear();
QList<QString> keys = FilterRegistry::instance()->keys();
foreach (QString key, keys) {
d->enabled.append(enabledFilters.contains(key));
}
}
......@@ -23,6 +23,8 @@
#include <KoGenericRegistryModel.h>
class QStringList;
namespace KisMetaData
{
......@@ -41,6 +43,8 @@ public:
virtual bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
/// @return a list of filters that are enabled
QList<const Filter*> enabledFilters() const;
/// enable the filters in the given list; others will be disabled.
virtual void setEnabledFilters(const QStringList &enabledFilters);
private:
struct Private;
Private* const d;
......
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