Use a special enum for inherit/enable/disable variables.
This commit is contained in:
@@ -88,12 +88,12 @@ QString Group::defaultAutoTypeSequence() const
|
||||
return m_defaultAutoTypeSequence;
|
||||
}
|
||||
|
||||
int Group::autoTypeEnabled() const
|
||||
Group::TriState Group::autoTypeEnabled() const
|
||||
{
|
||||
return m_autoTypeEnabled;
|
||||
}
|
||||
|
||||
int Group::searchingEnabed() const
|
||||
Group::TriState Group::searchingEnabed() const
|
||||
{
|
||||
return m_searchingEnabled;
|
||||
}
|
||||
@@ -155,17 +155,13 @@ void Group::setDefaultAutoTypeSequence(const QString& sequence)
|
||||
m_defaultAutoTypeSequence = sequence;
|
||||
}
|
||||
|
||||
void Group::setAutoTypeEnabled(int enable)
|
||||
void Group::setAutoTypeEnabled(TriState enable)
|
||||
{
|
||||
Q_ASSERT(enable >= -1 && enable <= 1);
|
||||
|
||||
m_autoTypeEnabled = enable;
|
||||
}
|
||||
|
||||
void Group::setSearchingEnabled(int enable)
|
||||
void Group::setSearchingEnabled(TriState enable)
|
||||
{
|
||||
Q_ASSERT(enable >= -1 && enable <= 1);
|
||||
|
||||
m_searchingEnabled = enable;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ class Group : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum TriState { Inherit, Enable, Disable };
|
||||
|
||||
Group();
|
||||
~Group();
|
||||
Uuid uuid() const;
|
||||
@@ -42,8 +44,8 @@ public:
|
||||
TimeInfo timeInfo() const;
|
||||
bool isExpanded() const;
|
||||
QString defaultAutoTypeSequence() const;
|
||||
int autoTypeEnabled() const;
|
||||
int searchingEnabed() const;
|
||||
Group::TriState autoTypeEnabled() const;
|
||||
Group::TriState searchingEnabed() const;
|
||||
Entry* lastTopVisibleEntry() const;
|
||||
|
||||
void setUuid(const Uuid& uuid);
|
||||
@@ -54,8 +56,8 @@ public:
|
||||
void setTimeInfo(const TimeInfo& timeInfo);
|
||||
void setExpanded(bool expanded);
|
||||
void setDefaultAutoTypeSequence(const QString& sequence);
|
||||
void setAutoTypeEnabled(int enable);
|
||||
void setSearchingEnabled(int enable);
|
||||
void setAutoTypeEnabled(TriState enable);
|
||||
void setSearchingEnabled(TriState enable);
|
||||
void setLastTopVisibleEntry(Entry* entry);
|
||||
|
||||
Group* parentGroup();
|
||||
@@ -98,8 +100,8 @@ private:
|
||||
TimeInfo m_timeInfo;
|
||||
bool m_isExpanded;
|
||||
QString m_defaultAutoTypeSequence;
|
||||
int m_autoTypeEnabled;
|
||||
int m_searchingEnabled;
|
||||
TriState m_autoTypeEnabled;
|
||||
TriState m_searchingEnabled;
|
||||
Entry* m_lastTopVisibleEntry;
|
||||
QList<Group*> m_children;
|
||||
QList<Entry*> m_entries;
|
||||
|
||||
Reference in New Issue
Block a user