https://bugs.kde.org/show_bug.cgi?id=407139

--- Comment #9 from crc <[email protected]> ---
(In reply to José Renan from comment #8)
> (In reply to crc from comment #7)
> > (In reply to crc from comment #6)
> > > (In reply to Christoph Feck from comment #4)
> > > > "é" is a Latin-1 character, but not ASCII. It needs an additional
> > > > ch.unicode() < 0x7F check.
> > > 
> > > Having just the same problem in Kglobalaccel after adding a shortcut to a
> > > desktop file with chinese characters. Adding this additional check may 
> > > solve
> > > it,but how can this be done?
> > 
> > I finally solved the problem by adding the additonal check to the soucecode
> > of Kglobalaccel cloning from https://anongit.kde.org/kglobalaccel.git and
> > compiling it in my system, then created a soft link from the compiled
> > Kglobalaccel5 file to /usr/bin, it just worked fine. So this is certainly
> > proved to be at least a temporary solution for the problem, many thanks!!!
> 
> Could you send a snippet with what exactly you added?
Sorry for replying late. I just modified Kglobalaccel source code in
src/runtime/component.cpp following your and Michael Pyne's suggestions. The
modification of component.cpp:203 is as follows:

QDBusObjectPath Component::dbusPath() const
    {
    QString dbusPath = _uniqueName;
    const int len = dbusPath.length();
    for ( int i = 0; i < len; ++i )
        {
        if ( !dbusPath[i].isLetterOrNumber() 
                 || dbusPath[i].unicode() >= 0x7F)
            dbusPath[i] = QLatin1Char('_');
        }
    return QDBusObjectPath( _registry->dbusPath().path() + "component/" +
dbusPath);
    }

I just add  "dbusPath[i].unicode() >= 0x7F" check after the original
".isLetterOrNumber()" check, which will translate all international characters
to "_". I have to admit that I'm no program developer and only learned some
basic c++ during college time, so I'm not quit sure whether this adding is all
correct. But after this modification the compile progress went smoothly and the
complied Kglobalaccel5 run all fine on my Manjaro system, the bug never
appeared again, so I think this can prove that the check adding just works.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to