mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kio: return key as is if there is no hash character in it
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
28c44664ee
commit
7fd2f9572f
1 changed files with 3 additions and 18 deletions
|
@ -29,7 +29,7 @@ QString KNfoTranslator::translation(const KUrl& uri)
|
|||
{
|
||||
typedef std::map<QString,QString> TranslationMap;
|
||||
|
||||
// TODO: a lot of NFOs are missing yet
|
||||
// TODO: a lot of NFOs are missing
|
||||
static const TranslationMap s_translations = {
|
||||
{ "kfileitem#modified", i18nc("@label", "Modified") },
|
||||
{ "kfileitem#owner", i18nc("@label", "Owner") },
|
||||
|
@ -127,24 +127,9 @@ QString KNfoTranslator::translation(const KUrl& uri)
|
|||
}
|
||||
|
||||
// fallback if the URI is not translated
|
||||
QString label;
|
||||
const int index = key.indexOf(QChar('#'));
|
||||
if (index >= 0) {
|
||||
label = key.right(key.size() - index - 1);
|
||||
return key.right(key.size() - index - 1);
|
||||
}
|
||||
QString tunedLabel;
|
||||
const int labelLength = label.length();
|
||||
if (labelLength > 0) {
|
||||
tunedLabel.reserve(labelLength);
|
||||
tunedLabel = label[0].toUpper();
|
||||
for (int i = 1; i < labelLength; ++i) {
|
||||
if (label[i].isUpper() && !label[i - 1].isSpace() && !label[i - 1].isUpper()) {
|
||||
tunedLabel += ' ';
|
||||
tunedLabel += label[i].toLower();
|
||||
} else {
|
||||
tunedLabel += label[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return tunedLabel;
|
||||
return key;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue