From 1ae8663decb3163b92d32b80cefb46eb678a5af6 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Thu, 2 Dec 2021 01:25:46 +0800 Subject: Add i18n Support 1. Remove Qt Linguist. 2. Add GNU gettext libraries. 3. Modified source codes to meet with i18n support. --- src/gpg/GpgFunctionObject.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/gpg/GpgFunctionObject.h') diff --git a/src/gpg/GpgFunctionObject.h b/src/gpg/GpgFunctionObject.h index a8746edf..6f1d60af 100644 --- a/src/gpg/GpgFunctionObject.h +++ b/src/gpg/GpgFunctionObject.h @@ -1,7 +1,7 @@ /** - * This file is part of GPGFrontend. + * This file is part of GpgFrontend. * - * GPGFrontend is free software: you can redistribute it and/or modify + * GpgFrontend is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -25,6 +25,8 @@ #ifndef GPGFRONTEND_ZH_CN_TS_FUNCTIONOBJECT_H #define GPGFRONTEND_ZH_CN_TS_FUNCTIONOBJECT_H +#include + #include #include #include @@ -32,8 +34,6 @@ #include #include -#include - namespace GpgFrontend { template @@ -42,8 +42,7 @@ class SingletonFunctionObject { static T& GetInstance(int channel = 0) { if (!channel) { std::lock_guard guard(_instance_mutex); - if (_instance == nullptr) - _instance = std::make_unique(); + if (_instance == nullptr) _instance = std::make_unique(); return *_instance; } else { // read _instances_map @@ -60,8 +59,7 @@ class SingletonFunctionObject { } static T& CreateInstance(int channel, std::unique_ptr p_obj = nullptr) { - if (!channel) - return *_instance; + if (!channel) return *_instance; // read _instances_map decltype(_instances_map.end()) _it; @@ -74,8 +72,7 @@ class SingletonFunctionObject { std::lock_guard guard(_default_channel_mutex); int tmp = channel; std::swap(_default_channel, tmp); - if (p_obj == nullptr) - p_obj = std::make_unique(); + if (p_obj == nullptr) p_obj = std::make_unique(); std::swap(_default_channel, tmp); } T* obj = p_obj.get(); -- cgit v1.2.3