mirror of
https://github.com/status-im/snorenotify.git
synced 2025-01-25 07:49:12 +00:00
style
This commit is contained in:
parent
97d7031719
commit
e78af06b9a
@ -80,7 +80,7 @@ void SnorePlugin::setDefaultValue(const QString &key, const QVariant &value, con
|
||||
|
||||
Snore::PluginSettingsWidget *SnorePlugin::settingsWidget()
|
||||
{
|
||||
if(type() != SnorePlugin::BACKEND) {
|
||||
if (type() != SnorePlugin::BACKEND) {
|
||||
// don't display a useless default widget for backends
|
||||
return new PluginSettingsWidget(this);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ bool SnoreBackend::initialize()
|
||||
connect(this, SIGNAL(notificationClosed(Snore::Notification)), SnoreCorePrivate::instance(), SLOT(slotNotificationClosed(Snore::Notification)), Qt::QueuedConnection);
|
||||
connect(SnoreCorePrivate::instance(), SIGNAL(notify(Snore::Notification)), this, SLOT(slotNotify(Snore::Notification)), Qt::QueuedConnection);
|
||||
|
||||
for(const Application & a : SnoreCore::instance().aplications()) {
|
||||
for (const Application &a : SnoreCore::instance().aplications()) {
|
||||
this->slotRegisterApplication(a);
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ bool SnoreBackend::deinitialize()
|
||||
requestCloseNotification(n, Notification::DISMISSED);
|
||||
}
|
||||
|
||||
for(const Application & a : SnoreCore::instance().aplications()) {
|
||||
for (const Application &a : SnoreCore::instance().aplications()) {
|
||||
slotDeregisterApplication(a);
|
||||
}
|
||||
disconnect(SnoreCorePrivate::instance(), SIGNAL(applicationRegistered(Snore::Application)), this, SLOT(slotRegisterApplication(Snore::Application)));
|
||||
|
@ -100,8 +100,7 @@ void SnoreCore::broadcastNotification(Notification notification)
|
||||
{
|
||||
Q_D(SnoreCore);
|
||||
snoreDebug(SNORE_DEBUG) << "Broadcasting" << notification << "timeout:" << notification.timeout();
|
||||
if(!notification.isUpdate())
|
||||
{
|
||||
if (!notification.isUpdate()) {
|
||||
d->syncSettings();
|
||||
}
|
||||
if (d->m_notificationBackend != nullptr) {
|
||||
|
@ -129,9 +129,10 @@ bool SnoreCorePrivate::initPrimaryNotificationBackend()
|
||||
return false;
|
||||
}
|
||||
|
||||
void SnoreCorePrivate::syncSettings() {
|
||||
void SnoreCorePrivate::syncSettings()
|
||||
{
|
||||
setBackendIfAvailible(m_settings->value("PrimaryBackend").toString());
|
||||
for(auto pluginName : m_pluginNames[SnorePlugin::SECONDARY_BACKEND]) {
|
||||
for (auto pluginName : m_pluginNames[SnorePlugin::SECONDARY_BACKEND]) {
|
||||
SnorePlugin *plugin = m_plugins.value(pluginName);
|
||||
bool enable = m_plugins[pluginName]->value("Enabled").toBool();
|
||||
if (!plugin->isInitialized() && enable) {
|
||||
|
@ -76,7 +76,7 @@ private slots:
|
||||
void slotNotificationClosed(Snore::Notification);
|
||||
void slotAboutToQuit();
|
||||
|
||||
private:
|
||||
private:
|
||||
SnoreCorePrivate();
|
||||
SnoreCore *q_ptr;
|
||||
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
if (msg->message == SNARL_GLOBAL_MESSAGE) {
|
||||
int action = msg->wParam;
|
||||
if (action == SnarlEnums::SnarlLaunched) {
|
||||
for(const Application & a : SnoreCore::instance().aplications()) {
|
||||
for (const Application &a : SnoreCore::instance().aplications()) {
|
||||
m_snarl->slotRegisterApplication(a);
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ bool FreedesktopFrontend::initialize()
|
||||
m_adaptor = new NotificationsAdaptor(this);
|
||||
QDBusConnection dbus = QDBusConnection::sessionBus();
|
||||
if (dbus.registerService("org.freedesktop.Notifications")) {
|
||||
if(dbus.registerObject("/org/freedesktop/Notifications", this)) {
|
||||
if (dbus.registerObject("/org/freedesktop/Notifications", this)) {
|
||||
return SnoreFrontend::initialize();
|
||||
} else {
|
||||
snoreDebug(SNORE_WARNING) << "Failed to initialize" << name() << "failed to register object";
|
||||
|
@ -19,7 +19,7 @@ int main(int argc, char *argv[])
|
||||
Snore::SettingsDialog diag;
|
||||
diag.setWindowTitle("SnoreSettings");
|
||||
diag.show();
|
||||
QObject::connect(&diag,&Snore::SettingsDialog::finished,&app,&QApplication::quit);
|
||||
QObject::connect(&diag, &Snore::SettingsDialog::finished, &app, &QApplication::quit);
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user