Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit e42ee4aa authored by Laurent Montel's avatar Laurent Montel 😁

Read/write config

parent 17612b42
......@@ -18,17 +18,35 @@
#include "gravatarupdatedialog.h"
#include <QVBoxLayout>
#include <KLocalizedString>
#include <KConfigGroup>
#include <KGlobal>
#include <KSharedConfig>
using namespace KABGravatar;
GravatarUpdateDialog::GravatarUpdateDialog(QWidget *parent)
: QDialog(parent)
{
readConfig();
}
GravatarUpdateDialog::~GravatarUpdateDialog()
{
writeConfig();
}
void GravatarUpdateDialog::readConfig()
{
KConfigGroup grp( KGlobal::config(), "GravatarUpdateDialog" );
const QSize size = grp.readEntry( "Size", QSize(300, 200) );
if ( size.isValid() ) {
resize( size );
}
}
void GravatarUpdateDialog::writeConfig()
{
KConfigGroup grp( KGlobal::config(), "GravatarUpdateDialog");
grp.writeEntry( "Size", size() );
grp.sync();
}
......@@ -26,6 +26,9 @@ class GravatarUpdateDialog : public QDialog
public:
explicit GravatarUpdateDialog(QWidget *parent=0);
~GravatarUpdateDialog();
private:
void readConfig();
void writeConfig();
};
}
#endif // GRAVATARUPDATEDIALOG_H
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