Skip to content

Commit

Permalink
kde.cfg: added some *i18n() and *i18nc() functions (#6365)
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave authored May 1, 2024
1 parent 1f0ab48 commit 6535192
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
37 changes: 37 additions & 0 deletions cfg/kde.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,41 @@
<not-uninit/>
</arg>
</function>
<!-- QString i18n(const char*) -->
<!-- QString xi18n(const char*) -->
<function name="i18n,xi18n">
<noreturn>false</noreturn>
<pure/>
<leak-ignore/>
<returnValue type="QString"/>
<arg nr="1" direction="in"/>
</function>
<!-- KLocalizedString ki18n(const char*) -->
<function name="ki18n">
<noreturn>false</noreturn>
<pure/>
<leak-ignore/>
<returnValue type="KLocalizedString"/>
<arg nr="1" direction="in"/>
</function>
ki18ncp()
<!-- QString i18nc(const char*, const char*) -->
<!-- QString xi18nc(const char*, const char*) -->
<function name="i18nc,xi18nc">
<noreturn>false</noreturn>
<pure/>
<leak-ignore/>
<returnValue type="QString"/>
<arg nr="1" direction="in"/>
<arg nr="2" direction="in"/>
</function>
<!-- KLocalizedString ki18nc(const char*, const char*) -->
<function name="ki18nc">
<noreturn>false</noreturn>
<pure/>
<leak-ignore/>
<returnValue type="KLocalizedString"/>
<arg nr="1" direction="in"/>
<arg nr="2" direction="in"/>
</function>
</def>
11 changes: 11 additions & 0 deletions test/cfg/kde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <cstdio>
#include <KDE/KGlobal>
#include <KDE/KConfigGroup>
#include <klocalizedstring.h>

class k_global_static_testclass1 {};
K_GLOBAL_STATIC(k_global_static_testclass1, k_global_static_testinstance1);
Expand All @@ -30,3 +31,13 @@ void ignoredReturnValue(const KConfigGroup& cfgGroup)
// cppcheck-suppress ignoredReturnValue
cfgGroup.readEntry("test");
}

void i18n_test()
{
(void)i18n("Text");
(void)xi18n("Text");
(void)ki18n("Text");
(void)i18nc("Text", "Context");
(void)xi18nc("Text", "Context");
(void)ki18nc("Text", "Context");
}
4 changes: 2 additions & 2 deletions tools/donate_cpu_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
# changes)
CLIENT_VERSION = "1.3.57"
CLIENT_VERSION = "1.3.58"

# Timeout for analysis with Cppcheck in seconds
CPPCHECK_TIMEOUT = 30 * 60
Expand Down Expand Up @@ -685,7 +685,7 @@ def __init__(self):
'ginac': ['<ginac/', '"ginac/'],
'googletest': ['<gtest/gtest.h>'],
'gtk': ['<gtk', '<glib.h>', '<glib-', '<glib/', '<gdk/', '<gnome'],
'kde': ['<KGlobal>', '<KApplication>', '<KDE/'],
'kde': ['<KGlobal>', '<KApplication>', '<KDE/', '<klocalizedstring.h>'],
'libcerror': ['<libcerror.h>'],
'libcurl': ['<curl/curl.h>'],
'libsigc++': ['<sigc++/'],
Expand Down

0 comments on commit 6535192

Please sign in to comment.