[vlc-devel] [PATCH 06/29] qt: make default controlbar profile names translatable

Fatih Uzunoglu fuzun54 at outlook.com
Thu Apr 1 22:22:18 UTC 2021


---
 .../dialogs/toolbar/controlbar_profile_model.cpp   | 14 ++++----------
 .../dialogs/toolbar/controlbar_profile_model.hpp   |  2 +-
 po/POTFILES.in                                     |  2 ++
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/modules/gui/qt/dialogs/toolbar/controlbar_profile_model.cpp b/modules/gui/qt/dialogs/toolbar/controlbar_profile_model.cpp
index a052048bb0..2e6a0cda01 100644
--- a/modules/gui/qt/dialogs/toolbar/controlbar_profile_model.cpp
+++ b/modules/gui/qt/dialogs/toolbar/controlbar_profile_model.cpp
@@ -36,9 +36,7 @@ decltype (ControlbarProfileModel::m_defaults)
     ControlbarProfileModel::m_defaults =
         {
             {
-                {
-                    "Minimalist Style"
-                },
+                N_("Minimalist Style"),
                 {
                     {
                         {
@@ -94,9 +92,7 @@ decltype (ControlbarProfileModel::m_defaults)
                 }
             },
             {
-                {
-                    "One-liner Style"
-                },
+                N_("One-liner Style"),
                 {
                     {
                         {
@@ -156,9 +152,7 @@ decltype (ControlbarProfileModel::m_defaults)
                 }
             },
             {
-                {
-                    "Simplest Style"
-                },
+                N_("Simplest Style"),
                 {
                     {
                         {
@@ -241,7 +235,7 @@ void ControlbarProfileModel::insertDefaults()
     // Add default profiles:
     for (const auto& i : m_defaults)
     {
-        const auto ptrNewProfile = newProfile(i.name);
+        const auto ptrNewProfile = newProfile(qtr(i.name));
         if (!ptrNewProfile)
             continue;
 
diff --git a/modules/gui/qt/dialogs/toolbar/controlbar_profile_model.hpp b/modules/gui/qt/dialogs/toolbar/controlbar_profile_model.hpp
index 108229bbe7..ebcb6981ff 100644
--- a/modules/gui/qt/dialogs/toolbar/controlbar_profile_model.hpp
+++ b/modules/gui/qt/dialogs/toolbar/controlbar_profile_model.hpp
@@ -92,7 +92,7 @@ private:
     int m_selectedProfile = -1;
 
     struct Profile {
-        QString name;
+        const char* name;
         QVector<ControlbarProfile::Configuration> modelData;
     };
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index d060836721..0df7774a5e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -760,6 +760,8 @@ modules/gui/qt/dialogs/extensions/extensions_manager.cpp
 modules/gui/qt/dialogs/extensions/extensions_manager.hpp
 modules/gui/qt/dialogs/playlists/playlists.cpp
 modules/gui/qt/dialogs/playlists/playlists.hpp
+modules/gui/qt/dialogs/toolbar/controlbar_profile_model.cpp
+modules/gui/qt/dialogs/toolbar/controlbar_profile_model.hpp
 modules/gui/qt/maininterface/main_interface.cpp
 modules/gui/qt/maininterface/main_interface.hpp
 modules/gui/qt/maininterface/main_interface_win32.cpp
-- 
2.27.0



More information about the vlc-devel mailing list