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()) {
|
||||
moveToThread(qApp->thread());
|
||||
}
|
||||
setDefaultValue("Enabled", true, "Whether the plugin is enabled");
|
||||
setDefaultValue("Enabled", true);
|
||||
}
|
||||
|
||||
SnorePlugin::~SnorePlugin()
|
||||
|
@ -69,10 +69,9 @@ void SnorePlugin::setValue(const QString &key, const QVariant &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));
|
||||
SnoreCorePrivate::instance()->addSettingsDescription(pk, help);
|
||||
if (!SnoreCore::instance().settings()->contains(pk)) {
|
||||
SnoreCore::instance().settings()->setValue(normaliseKey(key), value);
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
|
||||
QVariant value(const QString &key) const;
|
||||
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();
|
||||
|
||||
|
|
|
@ -209,12 +209,6 @@ const QSettings *SnoreCore::settings() const
|
|||
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)
|
||||
{
|
||||
Q_D(SnoreCore);
|
||||
|
|
|
@ -156,12 +156,6 @@ public:
|
|||
QSettings *settings();
|
||||
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.
|
||||
* @param appName the name of your application.
|
||||
|
|
|
@ -165,11 +165,6 @@ bool SnoreCorePrivate::primaryBackendCanUpdateNotification() const
|
|||
return m_notificationBackend->canUpdateNotification();
|
||||
}
|
||||
|
||||
void SnoreCorePrivate::addSettingsDescription(const QString &key, const QString &help) const
|
||||
{
|
||||
m_help[key] = help;
|
||||
}
|
||||
|
||||
void SnoreCorePrivate::slotNotificationClosed(Notification n)
|
||||
{
|
||||
Q_Q(SnoreCore);
|
||||
|
@ -181,7 +176,7 @@ void SnoreCorePrivate::slotNotificationClosed(Notification n)
|
|||
|
||||
void SnoreCorePrivate::slotAboutToQuit()
|
||||
{
|
||||
foreach(PluginContainer * p, PluginContainer::pluginCache(SnorePlugin::ALL)) {
|
||||
for(PluginContainer * p : PluginContainer::pluginCache(SnorePlugin::ALL)) {
|
||||
if (p->isLoaded()) {
|
||||
snoreDebug(SNORE_DEBUG) << "deinitialize" << p->name();
|
||||
p->load()->deinitialize();
|
||||
|
|
|
@ -61,8 +61,6 @@ public:
|
|||
*/
|
||||
bool primaryBackendCanUpdateNotification() const;
|
||||
|
||||
void addSettingsDescription(const QString &key, const QString &help) const;
|
||||
|
||||
bool initPrimaryNotificationBackend();
|
||||
|
||||
void syncSettings();
|
||||
|
@ -94,7 +92,6 @@ private:
|
|||
Application m_defaultApp;
|
||||
|
||||
QSettings *m_settings;
|
||||
mutable QHash<QString, QString> m_help;
|
||||
|
||||
Hint m_hints;
|
||||
};
|
||||
|
|
|
@ -138,7 +138,7 @@ void SnoreNotifier::setup()
|
|||
bool SnoreNotifier::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 false;
|
||||
|
|
|
@ -28,7 +28,8 @@ using namespace Snore;
|
|||
|
||||
Toasty::Toasty():
|
||||
SnoreSecondaryBackend("Toasty", false)
|
||||
{
|
||||
{
|
||||
setDefaultValue("DeviceID", "");
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
return new ToastySettings(this);
|
||||
|
|
|
@ -30,7 +30,6 @@ class Toasty : public Snore::SnoreSecondaryBackend
|
|||
public:
|
||||
Toasty();
|
||||
~Toasty();
|
||||
bool initialize() override;
|
||||
|
||||
Snore::PluginSettingsWidget *settingsWidget() override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue