1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-31 09:05:14 +01:00

Fixed plugin parameters saving

This commit is contained in:
Martin Tůma 2021-12-05 00:57:58 +01:00
parent 1e3132c9b3
commit 3e0fb14a75
2 changed files with 8 additions and 5 deletions

View File

@ -42,8 +42,6 @@ void PluginParameters::setPlugin(const QString &plugin)
le->setObjectName(params.at(i)); le->setObjectName(params.at(i));
le->setText(_params[plugin].value(params.at(i)).toString()); le->setText(_params[plugin].value(params.at(i)).toString());
l->addRow(params.at(i) + ":", le); l->addRow(params.at(i) + ":", le);
connect(le, &QLineEdit::editingFinished, this,
&PluginParameters::saveParameters);
} }
deleteLayout(layout()); deleteLayout(layout());
@ -52,6 +50,12 @@ void PluginParameters::setPlugin(const QString &plugin)
_plugin = plugin; _plugin = plugin;
} }
const QMap<QString, QVariantMap> &PluginParameters::parameters()
{
saveParameters();
return _params;
}
void PluginParameters::saveParameters() void PluginParameters::saveParameters()
{ {
QVariantMap &map(_params[_plugin]); QVariantMap &map(_params[_plugin]);

View File

@ -12,15 +12,14 @@ public:
PluginParameters(const QString &plugin, PluginParameters(const QString &plugin,
const QMap<QString, QVariantMap> &params, QWidget *parent = 0); const QMap<QString, QVariantMap> &params, QWidget *parent = 0);
const QMap<QString, QVariantMap> &parameters() const {return _params;} const QMap<QString, QVariantMap> &parameters();
public slots: public slots:
void setPlugin(const QString &plugin); void setPlugin(const QString &plugin);
private slots: private:
void saveParameters(); void saveParameters();
private:
QMap<QString, QVariantMap> _params; QMap<QString, QVariantMap> _params;
QString _plugin; QString _plugin;
}; };