as Im using namespaces there is no reason to call it SnoreIcion

This commit is contained in:
Patrick von Reth 2013-07-22 21:23:02 +02:00
parent 1af5f8d43c
commit 17d899f151
8 changed files with 46 additions and 46 deletions

View File

@ -21,7 +21,7 @@
namespace Snore{
Application::Application (const QString &name, const SnoreIcon &icon) :
Application::Application (const QString &name, const Icon &icon) :
m_name ( name ),
m_icon(icon),
m_initialized ( false )
@ -50,7 +50,7 @@ const QString &Application::name() const
return m_name;
}
const SnoreIcon &Application::icon()const
const Icon &Application::icon()const
{
return m_icon;
}
@ -70,7 +70,7 @@ void Application::setInitialized ( bool b )
m_initialized = b;
}
Alert::Alert (const QString &name, const QString &title, const SnoreIcon &icon, bool active) :
Alert::Alert (const QString &name, const QString &title, const Icon &icon, bool active) :
m_name ( name ),
m_title ( title ),
m_icon(icon),
@ -92,7 +92,7 @@ const QString &Alert::title() const
return m_title;
}
const SnoreIcon &Alert::icon() const
const Icon &Alert::icon() const
{
return m_icon;
}

View File

@ -34,12 +34,12 @@ class SNORE_EXPORT Application:public QObject
{
Q_OBJECT
public:
Application ( const QString &name, const SnoreIcon &icon = SnoreIcon(":/root/snore.png"));
Application ( const QString &name, const Icon &icon = Icon(":/root/snore.png"));
Application();
~Application();
void addAlert ( Alert *alert );
const QString &name() const;
const SnoreIcon &icon() const;
const Icon &icon() const;
const AlertList &alerts() const;
bool isInitialized();
void setInitialized ( bool b );
@ -47,7 +47,7 @@ public:
private:
QString m_name;
SnoreIcon m_icon;
Icon m_icon;
AlertList m_alerts;
bool m_initialized;
@ -57,17 +57,17 @@ class SNORE_EXPORT Alert:public QObject
{
Q_OBJECT
public:
Alert ( const QString &name,const QString &title="",const SnoreIcon &icon = SnoreIcon(":/root/snore.png"),bool active=true );
Alert ( const QString &name,const QString &title="",const Icon &icon = Icon(":/root/snore.png"),bool active=true );
Alert();
const QString &name() const;
const QString &title() const;
const SnoreIcon &icon() const;
const Icon &icon() const;
bool isActive() const;
private:
QString m_name;
QString m_title;
SnoreIcon m_icon;
Icon m_icon;
bool m_active;
};

View File

@ -22,47 +22,47 @@
using namespace Snore;
QHash<QString,QString> SnoreIcon::hasedImages;
QHash<QString,QString> Icon::hasedImages;
SnoreIcon::SnoreIcon() :
Icon::Icon() :
d(NULL)
{
}
SnoreIcon::SnoreIcon(const QImage &img):
Icon::Icon(const QImage &img):
d(new IconData(img))
{
}
SnoreIcon::SnoreIcon(const QString &url):
Icon::Icon(const QString &url):
d(new IconData(url))
{
}
SnoreIcon::SnoreIcon(const SnoreIcon &other):
Icon::Icon(const Icon &other):
d(other.d)
{
}
SnoreIcon &SnoreIcon::operator=(const SnoreIcon &other)
Icon &Icon::operator=(const Icon &other)
{
d = other.d;
return *this;
}
SnoreIcon::~SnoreIcon()
Icon::~Icon()
{
}
const QImage &SnoreIcon::image() const{
const QImage &Icon::image() const{
if(d->m_img.isNull()){
d->m_img = QImage(d->m_url);
}
return d->m_img;
}
QString SnoreIcon::localUrl()const{
QString Icon::localUrl()const{
if(d->m_localUrl.isEmpty())
{
if(hasedImages.contains(hash()))
@ -79,14 +79,14 @@ QString SnoreIcon::localUrl()const{
return d->m_localUrl;
}
const QByteArray &SnoreIcon::imageData() const{
const QByteArray &Icon::imageData() const{
if(d->m_data.isEmpty() && !image().isNull()){
d->setImageData();
}
return d->m_data;
}
QString SnoreIcon::hash() const{
QString Icon::hash() const{
if(d->m_isLocalFile)
{
return "";
@ -97,21 +97,21 @@ QString SnoreIcon::hash() const{
return d->m_hash;
}
bool SnoreIcon::isLocalFile() const
bool Icon::isLocalFile() const
{
return d->m_isLocalFile;
}
bool SnoreIcon::isEmpty() const{
bool Icon::isEmpty() const{
return d->m_hash.isEmpty() && d->m_img.isNull() && d->m_localUrl.isEmpty();
}
bool SnoreIcon::isValid() const
bool Icon::isValid() const
{
return d;
}
QString SnoreIcon::url() const
QString Icon::url() const
{
return d->m_url;
}

View File

@ -25,15 +25,15 @@ namespace Snore{
class IconData;
class SNORE_EXPORT SnoreIcon
class SNORE_EXPORT Icon
{
public:
SnoreIcon();
SnoreIcon(const QImage &img);
SnoreIcon(const class QString &url);
SnoreIcon(const SnoreIcon &other);
SnoreIcon &operator=(const SnoreIcon &other);
~SnoreIcon();
Icon();
Icon(const QImage &img);
Icon(const class QString &url);
Icon(const Icon &other);
Icon &operator=(const Icon &other);
~Icon();
const QImage &image() const;
QString localUrl() const;
@ -53,15 +53,15 @@ private:
}
inline QDebug operator<< ( QDebug debug, const Snore::SnoreIcon &icon )
inline QDebug operator<< ( QDebug debug, const Snore::Icon &icon )
{
if(icon.isValid())
{
debug << "Snore::SnoreIcon(" << icon.url() << ")" ;
debug << "Snore::Icon(" << icon.url() << ")" ;
}
else
{
debug << "Snore::SnoreIcon(0x00)" ;
debug << "Snore::Icon(0x00)" ;
}
return debug.maybeSpace();
}

View File

@ -40,7 +40,7 @@ Notification::Notification () :
{
}
Notification::Notification ( const QString &application, const QString &alert, const QString &title, const QString &text, const SnoreIcon &icon, int timeout,NotificationEnums::Prioritys::prioritys priority ):
Notification::Notification ( const QString &application, const QString &alert, const QString &title, const QString &text, const Icon &icon, int timeout,NotificationEnums::Prioritys::prioritys priority ):
d(new NotificationData(application,alert,title,text,icon,timeout,priority))
{
}
@ -65,7 +65,7 @@ const uint &Notification::id() const
return d->m_id;
}
const SnoreIcon &Notification::icon() const
const Icon &Notification::icon() const
{
return d->m_icon;
}

View File

@ -51,7 +51,7 @@ public:
public:
Notification ();
Notification (const QString &application,const QString &alert,const QString &title,const QString &text,const SnoreIcon &icon,int timeout=10, NotificationEnums::Prioritys::prioritys priority = NotificationEnums::Prioritys::NORMAL );
Notification (const QString &application,const QString &alert,const QString &title,const QString &text,const Icon &icon,int timeout=10, NotificationEnums::Prioritys::prioritys priority = NotificationEnums::Prioritys::NORMAL );
Notification ( const Notification &other );
Notification &operator=(const Notification &other);
~Notification();
@ -70,7 +70,7 @@ public:
const QString &application() const;
const QString &title() const;
const QString &text() const;
const SnoreIcon &icon() const;
const Icon &icon() const;
const QString &alert() const;
void setSticky();
bool sticky() const;

View File

@ -13,7 +13,7 @@ class NotificationData : public QSharedData
{
public:
NotificationData ( const QString &application,const QString &alert,const QString &title,const QString &text,const SnoreIcon &icon,
NotificationData ( const QString &application,const QString &alert,const QString &title,const QString &text,const Icon &icon,
int timeout,NotificationEnums::Prioritys::prioritys priority ):
m_id ( m_idCount++ ),
m_updateID(0),
@ -47,7 +47,7 @@ public:
QString m_alert;
QString m_title;
QString m_text;
SnoreIcon m_icon;
Icon m_icon;
NotificationEnums::Prioritys::prioritys m_priority;
NotificationEnums::CloseReasons::closeReasons m_closeReason;
QHash<int,Notification::Action*> m_actions;

View File

@ -67,24 +67,24 @@ uint FreedesktopFrontend::Notify(const QString &app_name, uint replaces_id,
const QString &app_icon, const QString &summary, const QString &body,
const QStringList &actions, const QVariantMap &hints, int timeout)
{
SnoreIcon icon;
Icon icon;
NotificationEnums::Prioritys::prioritys priotity = NotificationEnums::Prioritys::NORMAL;
if(hints.contains("image_data")){
FreedesktopImageHint image;
hints["image_data"].value<QDBusArgument>()>>image;
icon = SnoreIcon(image.toQImage());
icon = Icon(image.toQImage());
}
else
{
icon = SnoreIcon(":/root/images/freedesktop-dbus.png");
icon = Icon(":/root/images/freedesktop-dbus.png");
}
if(!snore()->aplications().contains(app_name)){
#ifdef HAVE_KDE
SnoreIcon appIcon = SnoreIcon(KIconLoader::global()->iconPath(app_icon, KIconLoader::Desktop));
Icon appIcon(KIconLoader::global()->iconPath(app_icon, KIconLoader::Desktop));
#else
SnoreIcon appIcon = SnoreIcon(":/root/images/freedesktop-dbus.png");
Icon appIcon(":/root/images/freedesktop-dbus.png");
#endif
Application *a = new Application(app_name,appIcon);
a->addAlert(new Alert("DBus Alert","DBus Alert",appIcon));