Browse Source

Use Qt built-in non-breaking space variable

adaptive-webui-19844
Chocobo1 1 year ago
parent
commit
ff80e0ce66
  1. 1
      src/base/unicodestrings.h
  2. 3
      src/base/utils/misc.cpp
  3. 3
      src/gui/properties/speedplotview.cpp

1
src/base/unicodestrings.h

@ -37,7 +37,6 @@
inline const QString C_COPYRIGHT = u"©"_s; inline const QString C_COPYRIGHT = u"©"_s;
inline const QString C_INEQUALITY = u""_s; inline const QString C_INEQUALITY = u""_s;
inline const QString C_INFINITY = u""_s; inline const QString C_INFINITY = u""_s;
inline const QString C_NON_BREAKING_SPACE = u" "_s;
inline const QString C_THIN_SPACE = u""_s; inline const QString C_THIN_SPACE = u""_s;
inline const QString C_UTP = u"μTP"_s; inline const QString C_UTP = u"μTP"_s;

3
src/base/utils/misc.cpp

@ -267,8 +267,7 @@ QString Utils::Misc::friendlyUnit(const qint64 bytes, const bool isSpeed, const
const int digitPrecision = (precision >= 0) ? precision : friendlyUnitPrecision(result->unit); const int digitPrecision = (precision >= 0) ? precision : friendlyUnitPrecision(result->unit);
return Utils::String::fromDouble(result->value, digitPrecision) return Utils::String::fromDouble(result->value, digitPrecision)
+ C_NON_BREAKING_SPACE + QChar::Nbsp + unitString(result->unit, isSpeed);
+ unitString(result->unit, isSpeed);
} }
int Utils::Misc::friendlyUnitPrecision(const SizeUnit unit) int Utils::Misc::friendlyUnitPrecision(const SizeUnit unit)

3
src/gui/properties/speedplotview.cpp

@ -94,8 +94,7 @@ namespace
// check is there need for digits after decimal separator // check is there need for digits after decimal separator
const int precision = (argValue < 10) ? friendlyUnitPrecision(unit) : 0; const int precision = (argValue < 10) ? friendlyUnitPrecision(unit) : 0;
return QLocale::system().toString(argValue, 'f', precision) return QLocale::system().toString(argValue, 'f', precision)
+ C_NON_BREAKING_SPACE + QChar::Nbsp + unitString(unit, true);
+ unitString(unit, true);
} }
} }

Loading…
Cancel
Save