Commit 996a6df1 authored by Vitaly Fanaskov's avatar Vitaly Fanaskov Committed by Volker Krause

Make store and load methods public

Summary:
Some sort of applications require to store or load settings in a custom
period of time. For example, if an application is a plugin, it might be
unloaded before qApp exists. In this case all settings will be lost.

Reviewers: vkrause

Reviewed By: vkrause

Differential Revision: https://phabricator.kde.org/D19882
parent 037e1a08
...@@ -609,6 +609,16 @@ void Provider::surveyCompleted(const SurveyInfo &info) ...@@ -609,6 +609,16 @@ void Provider::surveyCompleted(const SurveyInfo &info)
d->storeOneGlobal(QStringLiteral("LastSurvey"), d->lastSurveyTime); d->storeOneGlobal(QStringLiteral("LastSurvey"), d->lastSurveyTime);
} }
void Provider::load()
{
d->load();
}
void Provider::store()
{
d->store();
}
void Provider::submit() void Provider::submit()
{ {
if (!isEnabled()) { if (!isEnabled()) {
......
...@@ -247,6 +247,18 @@ public Q_SLOTS: ...@@ -247,6 +247,18 @@ public Q_SLOTS:
*/ */
void surveyCompleted(const KUserFeedback::SurveyInfo &info); void surveyCompleted(const KUserFeedback::SurveyInfo &info);
/*! Manually load settings of the provider and all added data sources.
* Automatically invoked after object construction and changing product ID.
* @note Potentially long operation.
*/
void load();
/*! Manually store settings of the provider and all added data sources.
* Will be autromatically invoked upon @p QCoreApplication::aboutToQuit signal.
* @note Potentially long operation.
*/
void store();
Q_SIGNALS: Q_SIGNALS:
/*! Emitted whenever there is a new survey available that can be presented /*! Emitted whenever there is a new survey available that can be presented
* to the user. * to the user.
...@@ -274,8 +286,6 @@ private: ...@@ -274,8 +286,6 @@ private:
// for UI // for UI
Q_PRIVATE_SLOT(d, QByteArray jsonData(KUserFeedback::Provider::TelemetryMode)) Q_PRIVATE_SLOT(d, QByteArray jsonData(KUserFeedback::Provider::TelemetryMode))
// for testing // for testing
Q_PRIVATE_SLOT(d, void load())
Q_PRIVATE_SLOT(d, void store())
Q_PRIVATE_SLOT(d, bool selectSurvey(const KUserFeedback::SurveyInfo&)) Q_PRIVATE_SLOT(d, bool selectSurvey(const KUserFeedback::SurveyInfo&))
}; };
......
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