File indexing completed on 2024-04-28 11:40:00
0001 /* This file is part of the KDE libraries 0002 SPDX-FileCopyrightText: 2008 Chusslove Illich <caslav.ilic@gmx.net> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef COMMON_HELPERS_P_H 0008 #define COMMON_HELPERS_P_H 0009 0010 #include <QString> 0011 0012 // Standalone (pure Qt) functionality needed internally in more than 0013 // one source file on localization. 0014 0015 /** 0016 * @internal 0017 * 0018 * Removes accelerator marker from a UI text label. 0019 * 0020 * Accelerator marker is not always a plain ampersand (&), 0021 * so it is not enough to just remove it by @c QString::remove(). 0022 * The label may contain escaped markers ("&&") which must be resolved 0023 * and skipped, as well as CJK-style markers ("Foo (&F)") where 0024 * the whole parenthesis construct should be removed. 0025 * Therefore always use this function to remove accelerator marker 0026 * from UI labels. 0027 * 0028 * @param label UI label which may contain an accelerator marker 0029 * @return label without the accelerator marker 0030 */ 0031 QString removeAcceleratorMarker(const QString &label); 0032 0033 #endif