Don't use Ui::Text::String copy construct/assign.

This commit is contained in:
John Preston 2022-06-23 15:34:34 +04:00
parent 182c07db7f
commit 368bc283a1
2 changed files with 4 additions and 5 deletions

View file

@ -305,9 +305,8 @@ std::vector<ListSection> Provider::fillSections(
return {};
}
auto result = std::vector<ListSection>(
1,
ListSection(Type::File, sectionDelegate()));
auto result = std::vector<ListSection>();
result.emplace_back(Type::File, sectionDelegate());
auto &section = result.back();
for (const auto &element : ranges::views::reverse(_elements)) {
if (search && !element.found) {

View file

@ -249,8 +249,8 @@ void AnimatedLabel::setText(const QString &text) {
if (_text.toString() == text) {
return;
}
_previousText = _text;
_text.setText(_st.style, text, _options);
_previousText = std::move(_text);
_text = Ui::Text::String(_st.style, text, _options);
const auto width = std::max(
_st.style.font->width(_text.toString()),