drop active flag for alerts

This commit is contained in:
Patrick von Reth 2015-07-09 11:24:48 +02:00
parent 1a1e675745
commit 892d170791
5 changed files with 6 additions and 24 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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)
{ {
} }

View File

@ -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)

View File

@ -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;