drop active flag for alerts
This commit is contained in:
parent
1a1e675745
commit
892d170791
|
@ -27,8 +27,8 @@ Alert::Alert() :
|
||||||
d(nullptr)
|
d(nullptr)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Alert::Alert(const QString &name, const Icon &icon, bool active):
|
Alert::Alert(const QString &name, const Icon &icon):
|
||||||
d(new AlertData(name, icon, active))
|
d(new AlertData(name, icon))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Alert::Alert(const Alert &other):
|
Alert::Alert(const Alert &other):
|
||||||
|
@ -58,11 +58,6 @@ const Icon &Alert::icon() const
|
||||||
return d->m_icon;
|
return d->m_icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Alert::isActive() const
|
|
||||||
{
|
|
||||||
return d->m_active;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Alert::isValid() const
|
bool Alert::isValid() const
|
||||||
{
|
{
|
||||||
return d;
|
return d;
|
||||||
|
|
|
@ -44,11 +44,9 @@ public:
|
||||||
* Creates an alert
|
* Creates an alert
|
||||||
* @param name the name of the Alert
|
* @param name the name of the Alert
|
||||||
* @param icon the Icon of the Alert
|
* @param icon the Icon of the Alert
|
||||||
* @param active whether the alert is active, not used yet
|
|
||||||
* @todo is isActive of any use?
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
explicit Alert(const QString &name, const Icon &icon, bool active = true);
|
explicit Alert(const QString &name, const Icon &icon);
|
||||||
/**
|
/**
|
||||||
* Creates a copy of other
|
* Creates a copy of other
|
||||||
* @param other
|
* @param other
|
||||||
|
@ -74,12 +72,6 @@ public:
|
||||||
*/
|
*/
|
||||||
const Icon &icon() const;
|
const Icon &icon() const;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return whether the Alert is active
|
|
||||||
*/
|
|
||||||
bool isActive() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return whether the Alert is valid.
|
* @return whether the Alert is valid.
|
||||||
|
|
|
@ -20,10 +20,9 @@
|
||||||
|
|
||||||
using namespace Snore;
|
using namespace Snore;
|
||||||
|
|
||||||
AlertData::AlertData(const QString &name, const Icon &icon, bool active):
|
AlertData::AlertData(const QString &name, const Icon &icon):
|
||||||
m_name(name),
|
m_name(name),
|
||||||
m_icon(icon),
|
m_icon(icon)
|
||||||
m_active(active)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,12 +31,11 @@ class AlertData : public QSharedData
|
||||||
{
|
{
|
||||||
friend class Alert;
|
friend class Alert;
|
||||||
public:
|
public:
|
||||||
AlertData(const QString &name, const Icon &icon, bool active);
|
AlertData(const QString &name, const Icon &icon);
|
||||||
~AlertData();
|
~AlertData();
|
||||||
|
|
||||||
QString m_name;
|
QString m_name;
|
||||||
Icon m_icon;
|
Icon m_icon;
|
||||||
bool m_active;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(AlertData)
|
Q_DISABLE_COPY(AlertData)
|
||||||
|
|
|
@ -113,9 +113,6 @@ void Parser::parse(Notification &sNotification, const QString &msg, QTcpSocket *
|
||||||
SnoreCore::instance().registerApplication(app);
|
SnoreCore::instance().registerApplication(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!alert.isActive()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
sNotification = Notification(app, alert, title, text, icon, timeout);
|
sNotification = Notification(app, alert, title, text, icon, timeout);
|
||||||
sNotification.hints().setPrivateValue(snarl, "clientSocket", QVariant::fromValue(QPointer<QTcpSocket>(client)));
|
sNotification.hints().setPrivateValue(snarl, "clientSocket", QVariant::fromValue(QPointer<QTcpSocket>(client)));
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue