Make enum DataMeaning an enum class
This commit is contained in:
parent
dc97fa63e1
commit
db2594a87c
6 changed files with 11 additions and 11 deletions
|
|
@ -14,9 +14,9 @@ enum class ReferencedType {
|
|||
};
|
||||
|
||||
///
|
||||
enum DataMeaning {
|
||||
DataMeaningNormal,
|
||||
DataMeaningBytes ///< the value represents bytes pretty print in KiB, MiB, GiB, TiB, PiB, EiB
|
||||
enum class DataMeaning {
|
||||
Normal,
|
||||
Bytes ///< the value represents bytes pretty print in KiB, MiB, GiB, TiB, PiB, EiB
|
||||
};
|
||||
|
||||
enum CustomDataRole {
|
||||
|
|
|
|||
|
|
@ -24,5 +24,5 @@ QVariant BaseTableModel::data(const QModelIndex &index, int role) const
|
|||
|
||||
QVariant BaseTableModel::getDataMeaning(const QModelIndex &) const
|
||||
{
|
||||
return static_cast<int>(DataMeaningNormal);
|
||||
return static_cast<int>(DataMeaning::Normal);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ QVariant DatabasesTableModel::getDataMeaning(const QModelIndex &index) const
|
|||
{
|
||||
if (index.column() == SizeCol)
|
||||
{
|
||||
return static_cast<int>(DataMeaningBytes);
|
||||
return static_cast<int>(DataMeaning::Bytes);
|
||||
}
|
||||
return BaseTableModel::getDataMeaning(index);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,9 +133,9 @@ QVariant IndexModel::data(const QModelIndex &index, int role) const
|
|||
else if (role == CustomDataMeaningRole) {
|
||||
switch (index.column()) {
|
||||
case SizeCol:
|
||||
return static_cast<int>(DataMeaningBytes);
|
||||
return static_cast<int>(DataMeaning::Bytes);
|
||||
default:
|
||||
return static_cast<int>(DataMeaningNormal);
|
||||
return static_cast<int>(DataMeaning::Normal);
|
||||
}
|
||||
}
|
||||
return v;
|
||||
|
|
|
|||
|
|
@ -200,9 +200,9 @@ QVariant TablesTableModel::data(const QModelIndex &index, int role) const
|
|||
case TableSizeCol:
|
||||
case IndexSizeCol:
|
||||
case ToastSizeCol:
|
||||
return static_cast<int>(DataMeaningBytes);
|
||||
return static_cast<int>(DataMeaning::Bytes);
|
||||
default:
|
||||
return static_cast<int>(DataMeaningNormal);
|
||||
return static_cast<int>(DataMeaning::Normal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ void PgLabItemDelegate::initStyleOption(QStyleOptionViewItem *option,
|
|||
value = index.data(CustomDataMeaningRole);
|
||||
DataMeaning meaning = value.isValid()
|
||||
? static_cast<DataMeaning>(value.toInt())
|
||||
: DataMeaningNormal;
|
||||
: DataMeaning::Normal;
|
||||
|
||||
value = index.data(Qt::DisplayRole);
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ void PgLabItemDelegate::initStyleOption(QStyleOptionViewItem *option,
|
|||
}
|
||||
else {
|
||||
forground_color = GetDefaultColorForType(oid);
|
||||
if (meaning == DataMeaningBytes) {
|
||||
if (meaning == DataMeaning::Bytes) {
|
||||
QString suffix;
|
||||
auto s = value.toLongLong();
|
||||
double val;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue