[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: branches/KDE/3.5/kdebase/kcontrol/ebrowsing/plugins/shorturi
From: David Faure <faure () kde ! org>
Date: 2006-08-23 10:14:13
Message-ID: 200608231214.13509.faure () kde ! org
[Download RAW message or body]
On Wednesday 23 August 2006 11:08, Dirk Mueller wrote:
> SVN commit 576149 by mueller:
>
> make the FQDN match a bit more specific
>
>
> M +7 -0 kshorturifilter.cpp
>
>
> --- branches/KDE/3.5/kdebase/kcontrol/ebrowsing/plugins/shorturi/kshorturifilter.cpp #576148:576149
> @@ -34,6 +34,7 @@
> #include <kprotocolinfo.h>
> #include <kstandarddirs.h>
> #include <kconfig.h>
> +#include <kmimetype.h>
>
> #include "kshorturifilter.h"
>
> @@ -70,6 +71,12 @@
> if (verbose)
> kdDebug() << "KShortURIFilter::isValidShortURL: " << cmd
> << " matches FQDN_PATTERN" << endl;
> +
> + // stuff like wallpaper.png matches the FQDN_PATTERN but is most
> + // likely not a domain
> + if (KMimeType::findByPath(cmd) != KMimeType::defaultMimeTypePtr()) {
> + return false;
BTW why is this not just QFile::exists(cmd)?
What's the point of determining the mimetype of the file (which could possibly be slow,
since it might even read its contents if the extension is unknown)?
--
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic