From f2c284688bc6a2a375b0641bcb8cf79abc69656f Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 25 Dec 2023 11:29:36 +0400 Subject: [PATCH] Make content selector tooltip localizable --- components/contentselector/model/esmfile.cpp | 7 ------- components/contentselector/model/esmfile.hpp | 11 +++++++++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/contentselector/model/esmfile.cpp b/components/contentselector/model/esmfile.cpp index 741ed173a2..75a0adb45e 100644 --- a/components/contentselector/model/esmfile.cpp +++ b/components/contentselector/model/esmfile.cpp @@ -4,13 +4,6 @@ #include int ContentSelectorModel::EsmFile::sPropertyCount = 7; -QString ContentSelectorModel::EsmFile::sToolTip = QString( - "Author: %1
\ - Version: %2
\ - Modified: %3
\ - Path:
%4
\ -
Description:
%5
\ -
Dependencies: %6
"); ContentSelectorModel::EsmFile::EsmFile(const QString& fileName, ModelItem* parent) : ModelItem(parent) diff --git a/components/contentselector/model/esmfile.hpp b/components/contentselector/model/esmfile.hpp index 1ffaa8fe72..5a04ec8b38 100644 --- a/components/contentselector/model/esmfile.hpp +++ b/components/contentselector/model/esmfile.hpp @@ -59,7 +59,7 @@ namespace ContentSelectorModel QString description() const { return mDescription; } QString toolTip() const { - return sToolTip.arg(mAuthor) + return mTooltipTemlate.arg(mAuthor) .arg(mVersion) .arg(mModified.toString(Qt::ISODate)) .arg(mPath) @@ -72,9 +72,16 @@ namespace ContentSelectorModel public: static int sPropertyCount; - static QString sToolTip; private: + QString mTooltipTemlate = tr( + "Author: %1
" + "Version: %2
" + "Modified: %3
" + "Path:
%4
" + "
Description:
%5
" + "
Dependencies: %6
"); + QString mFileName; QString mAuthor; QDateTime mModified;