Manual fallback/workaround a kdelibs bug?

Andreas Pakulat apaku at gmx.de
Mon Jul 6 07:01:48 UTC 2009


On 06.07.09 00:26:23, David Nolden wrote:
> Am Sonntag 05 Juli 2009 23:13:53 schrieb Andreas Pakulat:
> > Hi,
> >
> > please have a short look at:
> > https://bugs.kde.org/show_bug.cgi?id=198477
> >
> > I'd like to know wether we should do a workaround inside
> > documentcontroller for this. Basically doing:
> >
> > KMimeType::Ptr mime = KMimeType::findByUrl();
> > if( !isTextType(mime) && url.isLocalFile() ) {
> >     // Try harder to workaround https://bugs.kde.org/show_bug.cgi?id=198477
> >     mime = KMimeType::findByFileContent( url.toLocalFile() );
> > }
> >
> > Opinions?
> 
> This doesn't look too hacky. Actually it's probably the right way to go. The 
> name "findByUrl" after all suggests that it only looks at the URL.

According to the docs it first looks at the extension, then checks the
content if its a local file. Whats not documented is that it apparently
also looks at the filename itself.
 
> The question is, would this also solve the syntax highlighting issue? Does 
> kate get the mimetype to use from KDevelop?

AFAIK, no. Kate uses KMimeType itself I think. I'll do some
experimenting as I'm also wondering wether we'll load the C++ plugin at
all.

Andreas

-- 
You will be recognized and honored as a community leader.




More information about the KDevelop-devel mailing list