Use static constants for default icon numbers.

This commit is contained in:
Florian Geyer 2012-05-15 16:47:46 +02:00
parent 62073fa74d
commit 621ec80bbe
4 changed files with 10 additions and 2 deletions

View File

@ -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 <class T> bool Entry::set(T& property, const T& value)
{
if (property != value) {

View File

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

View File

@ -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 <class P, class V> bool Group::set(P& property, const V& value) {
if (property != value) {
property = value;

View File

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