Version: (using KDE KDE 3.4.2) Installed from: Compiled From Sources Hi, i have a website which uses a lot of form elements. These elements have xpath expressions as names. The names look like /foo/bar[1]/baz[2]/abc The problem here is that khtml stores formcompletions as KSimpleConfig with the element name as key. When the form element name contains [], the entry is ignored by KConfig. Attached is a quick hack which resolves the problem for me. It simply replaces all [ and ] with spaces.
Created attachment 12521 [details] formcompletion.diff
Dupe of this one #107170?
No i don't think so. #107170 is only about browsing files.
Created attachment 16811 [details] patch KConfigBase to handle entries with embedded [] This is actually a KConfig bug. KConfig uses [] to delimit the locale and options/flags on the entry, so an entry with embedded [ or ] confuses the parser when it tries to read the entry back in. After you apply this patch you can edit your config files to replace embedded [/] with %5b/%5d and KConfig should be able to read them back in.
SVN commit 556653 by braxton: allow embedded [] in entry names. This fixes the parser, instead of KConfigBase. BUG: 112379 M +22 -2 kconfigbackend.cpp --- branches/KDE/3.5/kdelibs/kdecore/kconfigbackend.cpp #556652:556653 @@ -211,6 +211,26 @@ return result; } +static QCString encodeKey(const char* key) +{ + QCString newKey(key); + + newKey.replace('[', "%5b"); + newKey.replace(']', "%5d"); + + return newKey; +} + +static QCString decodeKey(const char* key) +{ + QCString newKey(key); + + newKey.replace("%5b", "["); + newKey.replace("%5d", "]"); + + return newKey; +} + class KConfigBackEnd::KConfigBackEndPrivate { public: @@ -675,7 +695,7 @@ QCString val = printableToString(st, s - st); //qDebug("found key '%s' with value '%s'", key.data(), val.data()); - KEntryKey aEntryKey(aCurrentGroup, key); + KEntryKey aEntryKey(aCurrentGroup, decodeKey(key)); aEntryKey.bLocal = (locale != 0); aEntryKey.bDefault = bDefault; @@ -870,7 +890,7 @@ firstEntry = false; // it is data for a group - fputs(key.mKey.data(), pStream); // Key + fputs(encodeKey(key.mKey.data()), pStream); // Key if ( currentEntry.bNLS ) {