Evil bug in KDE's mimetype/applnk handling

David Faure david at mandrakesoft.com
Mon Dec 2 01:47:36 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 30 November 2002 11:20, Matthias Welwarsky wrote:
> Hi,
> 
> Just stumbled over an ugly bug in KDE's application launcher.
In which version of KDE exactly?

> [...]
> Now, unfortunately, by assigning konqueror to application/x-zip, you created a 
> $KDEHOME/share/applnk/konqueror.desktop

With kopenwith.cpp version 1.66 (which is in KDE-3.1), it should instead create
a konqueror-2.desktop.

    // Check if there's already a service by that name, with the same Exec line
    do {
        KService::Ptr serv = KService::serviceByDesktopName( serviceName );
        bool ok = !serv; // ok if no such service yet
        // also ok if we find the exact same service (well, "kwrite" == "kwrite %U"
        if ( serv && (
                 serv->exec() == fullExec ||
                 serv->exec() == fullExec + " %u" ||
                 serv->exec() == fullExec + " %U" ||
                 serv->exec() == fullExec + " %f" ||
                 serv->exec() == fullExec + " %F"
                 ) )
        {
            ok = true;
            m_pService = serv;
        }
        if (!ok) // service was found, but it was different -> keep looking
        {
            ++i;
            serviceName = initialServiceName + "-" + QString::number(i);
        }
    }
    while (!ok);

Unless I'm missing something, I believe I have already fixed the bug you're 
talking about.

> Others may say the the applnk concept 
> is wrong and that mimetype->application links should be stored in the 
> mimetype files...
Surely not! What would happen when the application is deinstalled?
How would 3rd-party apps install themselves?
This was the KDE-1 mis-design, let's not go back there....

- -- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE96ru572KcVAmwbhARAnF+AJ99XBEDwVl7yC/cBe/MGTfGIcy+lQCeJ+NT
9XhcNXasK6EiKz9B1Tmf2po=
=0F89
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list