Commit 4c25d449 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

avoid that we create invalid file names

e.g. many special characters haev issues, not
just the / mentioned in the bug report

BUG: 453272
parent 6c81d92c
......@@ -10,6 +10,7 @@
#include <QMetaType>
#include <QString>
#include <QStringList>
#include <QUrl>
class KConfigGroup;
......@@ -122,17 +123,14 @@ public:
QString translatedCategory() const;
/**
* Returns the config file name for this tool, created based on the tool "name", e.g.
* "Clang Format Full File" -> clang_format_full_file
* Returns the config file name for this tool, created based on the tool "name".
* this will be the name of the config file in e.g. ~/.config/kate/externaltools/
* will ensure we end up with some valid file name
*/
static QString configFileName(QString name)
{
name.replace(QLatin1Char(' '), QLatin1Char('_'));
// '(' and ')' are problematic as file names in the .qrc file
name.replace(QLatin1Char('('), QLatin1Char('_'));
name.replace(QLatin1Char(')'), QLatin1Char('_'));
return name.toLower();
// just percent encode the name, see bug 453272
return QString::fromUtf8(QUrl::toPercentEncoding(name));
}
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment