From 621ec80bbef81b895ed65488c5163c2297ce6272 Mon Sep 17 00:00:00 2001 From: Florian Geyer Date: Tue, 15 May 2012 16:47:46 +0200 Subject: [PATCH] Use static constants for default icon numbers. --- src/core/Entry.cpp | 4 +++- src/core/Entry.h | 2 ++ src/core/Group.cpp | 4 +++- src/core/Group.h | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/core/Entry.cpp b/src/core/Entry.cpp index 9e70920fa..77235fecc 100644 --- a/src/core/Entry.cpp +++ b/src/core/Entry.cpp @@ -28,7 +28,7 @@ Entry::Entry() m_updateTimeinfo = true; m_tmpHistoryItem = 0; - m_data.iconNumber = 0; + m_data.iconNumber = DefaultIconNumber; m_data.autoTypeEnabled = true; m_data.autoTypeObfuscation = 0; @@ -56,6 +56,8 @@ Entry::~Entry() qDeleteAll(m_history); } +const int Entry::DefaultIconNumber = 0; + template bool Entry::set(T& property, const T& value) { if (property != value) { diff --git a/src/core/Entry.h b/src/core/Entry.h index 0b7123378..696e3606b 100644 --- a/src/core/Entry.h +++ b/src/core/Entry.h @@ -89,6 +89,8 @@ public: EntryAttachments* attachments(); const EntryAttachments* attachments() const; + static const int DefaultIconNumber; + void setUuid(const Uuid& uuid); void setIcon(int iconNumber); void setIcon(const Uuid& uuid); diff --git a/src/core/Group.cpp b/src/core/Group.cpp index 59e29bc35..8cb9bda5d 100644 --- a/src/core/Group.cpp +++ b/src/core/Group.cpp @@ -23,7 +23,7 @@ Group::Group() { - m_iconNumber = 48; + m_iconNumber = DefaultIconNumber; m_isExpanded = true; m_autoTypeEnabled = Inherit; m_searchingEnabled = Inherit; @@ -55,6 +55,8 @@ Group::~Group() } } +const int Group::DefaultIconNumber = 48; + template bool Group::set(P& property, const V& value) { if (property != value) { property = value; diff --git a/src/core/Group.h b/src/core/Group.h index ff987be26..13142c662 100644 --- a/src/core/Group.h +++ b/src/core/Group.h @@ -51,6 +51,8 @@ public: Group::TriState searchingEnabled() const; Entry* lastTopVisibleEntry() const; + static const int DefaultIconNumber; + void setUuid(const Uuid& uuid); void setName(const QString& name); void setNotes(const QString& notes);