remove settings description
This commit is contained in:
parent
882941d3af
commit
fff339be3a
|
@ -35,7 +35,7 @@ SnorePlugin::SnorePlugin(const QString &name) :
|
||||||
if (thread() != qApp->thread()) {
|
if (thread() != qApp->thread()) {
|
||||||
moveToThread(qApp->thread());
|
moveToThread(qApp->thread());
|
||||||
}
|
}
|
||||||
setDefaultValue("Enabled", true, "Whether the plugin is enabled");
|
setDefaultValue("Enabled", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
SnorePlugin::~SnorePlugin()
|
SnorePlugin::~SnorePlugin()
|
||||||
|
@ -69,10 +69,9 @@ void SnorePlugin::setValue(const QString &key, const QVariant &value)
|
||||||
SnoreCore::instance().settings()->setValue(normaliseKey(key), value);
|
SnoreCore::instance().settings()->setValue(normaliseKey(key), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SnorePlugin::setDefaultValue(const QString &key, const QVariant &value, const QString &help)
|
void SnorePlugin::setDefaultValue(const QString &key, const QVariant &value)
|
||||||
{
|
{
|
||||||
QString pk(normaliseKey(key));
|
QString pk(normaliseKey(key));
|
||||||
SnoreCorePrivate::instance()->addSettingsDescription(pk, help);
|
|
||||||
if (!SnoreCore::instance().settings()->contains(pk)) {
|
if (!SnoreCore::instance().settings()->contains(pk)) {
|
||||||
SnoreCore::instance().settings()->setValue(normaliseKey(key), value);
|
SnoreCore::instance().settings()->setValue(normaliseKey(key), value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
|
|
||||||
QVariant value(const QString &key) const;
|
QVariant value(const QString &key) const;
|
||||||
void setValue(const QString &key, const QVariant &value);
|
void setValue(const QString &key, const QVariant &value);
|
||||||
void setDefaultValue(const QString &key, const QVariant &value, const QString &help);
|
void setDefaultValue(const QString &key, const QVariant &value);
|
||||||
|
|
||||||
virtual PluginSettingsWidget *settingsWidget();
|
virtual PluginSettingsWidget *settingsWidget();
|
||||||
|
|
||||||
|
|
|
@ -209,12 +209,6 @@ const QSettings *SnoreCore::settings() const
|
||||||
return d->m_settings;
|
return d->m_settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QHash<QString, QString> &SnoreCore::settingsDescription() const
|
|
||||||
{
|
|
||||||
Q_D(const SnoreCore);
|
|
||||||
return d->m_help;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SnoreCore::setSettingsPrefix(const QString &prefix)
|
void SnoreCore::setSettingsPrefix(const QString &prefix)
|
||||||
{
|
{
|
||||||
Q_D(SnoreCore);
|
Q_D(SnoreCore);
|
||||||
|
|
|
@ -156,12 +156,6 @@ public:
|
||||||
QSettings *settings();
|
QSettings *settings();
|
||||||
const QSettings *settings() const;
|
const QSettings *settings() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* @return a hashmap containing the documentation of the settings keys.
|
|
||||||
*/
|
|
||||||
const QHash<QString, QString> &settingsDescription() const;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Some settings can be uniqe to your application.
|
* Some settings can be uniqe to your application.
|
||||||
* @param appName the name of your application.
|
* @param appName the name of your application.
|
||||||
|
|
|
@ -165,11 +165,6 @@ bool SnoreCorePrivate::primaryBackendCanUpdateNotification() const
|
||||||
return m_notificationBackend->canUpdateNotification();
|
return m_notificationBackend->canUpdateNotification();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SnoreCorePrivate::addSettingsDescription(const QString &key, const QString &help) const
|
|
||||||
{
|
|
||||||
m_help[key] = help;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SnoreCorePrivate::slotNotificationClosed(Notification n)
|
void SnoreCorePrivate::slotNotificationClosed(Notification n)
|
||||||
{
|
{
|
||||||
Q_Q(SnoreCore);
|
Q_Q(SnoreCore);
|
||||||
|
@ -181,7 +176,7 @@ void SnoreCorePrivate::slotNotificationClosed(Notification n)
|
||||||
|
|
||||||
void SnoreCorePrivate::slotAboutToQuit()
|
void SnoreCorePrivate::slotAboutToQuit()
|
||||||
{
|
{
|
||||||
foreach(PluginContainer * p, PluginContainer::pluginCache(SnorePlugin::ALL)) {
|
for(PluginContainer * p : PluginContainer::pluginCache(SnorePlugin::ALL)) {
|
||||||
if (p->isLoaded()) {
|
if (p->isLoaded()) {
|
||||||
snoreDebug(SNORE_DEBUG) << "deinitialize" << p->name();
|
snoreDebug(SNORE_DEBUG) << "deinitialize" << p->name();
|
||||||
p->load()->deinitialize();
|
p->load()->deinitialize();
|
||||||
|
|
|
@ -61,8 +61,6 @@ public:
|
||||||
*/
|
*/
|
||||||
bool primaryBackendCanUpdateNotification() const;
|
bool primaryBackendCanUpdateNotification() const;
|
||||||
|
|
||||||
void addSettingsDescription(const QString &key, const QString &help) const;
|
|
||||||
|
|
||||||
bool initPrimaryNotificationBackend();
|
bool initPrimaryNotificationBackend();
|
||||||
|
|
||||||
void syncSettings();
|
void syncSettings();
|
||||||
|
@ -94,7 +92,6 @@ private:
|
||||||
Application m_defaultApp;
|
Application m_defaultApp;
|
||||||
|
|
||||||
QSettings *m_settings;
|
QSettings *m_settings;
|
||||||
mutable QHash<QString, QString> m_help;
|
|
||||||
|
|
||||||
Hint m_hints;
|
Hint m_hints;
|
||||||
};
|
};
|
||||||
|
|
|
@ -138,7 +138,7 @@ void SnoreNotifier::setup()
|
||||||
bool SnoreNotifier::initialize()
|
bool SnoreNotifier::initialize()
|
||||||
{
|
{
|
||||||
if (SnoreBackend::initialize()) {
|
if (SnoreBackend::initialize()) {
|
||||||
setDefaultValue("Position", Qt::TopRightCorner, "The position for the notification.");
|
setDefaultValue("Position", Qt::TopRightCorner);
|
||||||
return metaObject()->invokeMethod(this, "setup", Qt::QueuedConnection);
|
return metaObject()->invokeMethod(this, "setup", Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -29,6 +29,7 @@ using namespace Snore;
|
||||||
Toasty::Toasty():
|
Toasty::Toasty():
|
||||||
SnoreSecondaryBackend("Toasty", false)
|
SnoreSecondaryBackend("Toasty", false)
|
||||||
{
|
{
|
||||||
|
setDefaultValue("DeviceID", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
Toasty::~Toasty()
|
Toasty::~Toasty()
|
||||||
|
@ -86,15 +87,6 @@ void Toasty::slotNotify(Notification notification)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Toasty::initialize()
|
|
||||||
{
|
|
||||||
if (SnoreSecondaryBackend::initialize()) {
|
|
||||||
setDefaultValue("DeviceID", "", "The ID provided for your device by Toasty");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
PluginSettingsWidget *Toasty::settingsWidget()
|
PluginSettingsWidget *Toasty::settingsWidget()
|
||||||
{
|
{
|
||||||
return new ToastySettings(this);
|
return new ToastySettings(this);
|
||||||
|
|
|
@ -30,7 +30,6 @@ class Toasty : public Snore::SnoreSecondaryBackend
|
||||||
public:
|
public:
|
||||||
Toasty();
|
Toasty();
|
||||||
~Toasty();
|
~Toasty();
|
||||||
bool initialize() override;
|
|
||||||
|
|
||||||
Snore::PluginSettingsWidget *settingsWidget() override;
|
Snore::PluginSettingsWidget *settingsWidget() override;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue