[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: win32 KUriFilterData problem with ERROR define
From: Ralf Habacker <ralf.habacker () freenet ! de>
Date: 2007-09-02 17:13:16
Message-ID: 46DAEF2C.1050500 () freenet ! de
[Download RAW message or body]
Andreas Pakulat schrieb:
> On 29.08.07 14:45:49, Christian Ehrlicher wrote:
>
> > > Von: Ralf Habacker <ralf.habacker@freenet.de>
> > > in kio's KUriFilterData class
> > > (http://lxr.kde.org/source/KDE/kdelibs/kio/kio/kurifilter.h#098)
> > >
> > > there are the following enums defined
> > >
> > > m UriTypes { NET_PROTOCOL=0, LOCAL_FILE, LOCAL_DIR, EXECUTABLE, HELP,
> > > SHELL, BLOCKED, ERROR, UNKNOWN };
> > >
> > > Because they are all uppercase at least the ERROR value collidates with
> > > a win 32 preprozessor macro definition.
> > >
> > > I recognized this when compiling kdebase with msvc
> > >
> > > In
> > >
> > > KonqMisc::konqFilteredURL
> > >
> > > the line
> > > 193: if( data.uriType() == KUriFilterData::ERROR &&
> > > !data.errorMsg().isEmpty() )
> > >
> > > is converted to
> > >
> > > 193: if( data.uriType() == KUriFilterData::0 && !data.errorMsg().isEmpty()
> > > )
> > >
> > > which results in a error.
> > >
> > > I can correct this problem in konqmisc.cpp by undefining ERROR after
> > > all includes as shown below
> > >
> > > #ifdef Q_WS_WIN
> > > // windows defines ERROR
> > > #undef ERROR
> > > #endif
> > >
> > > I remember that there were other similar cases and that they were fixed
> > > by using non-all-uppercase enum values.
> > >
> > > How to proceed ?
> > >
> > >
> > Write to k-c-d and ask if we still can change it. If yes -> do it next monday. \
> > Otherwise include fixwin.h (it's from kdelibs/kdecore) - it should do nearly the \
> > same like you did.
>
> Isn't there a general exception to "fix broken API", this is broken API - IMHO.
> I'd say if you can find all usages and port them, just make it camel-case.
>
I like to ask if there are objectivities against using CamelCase
UriTypes enum values in class KUriFilterData.
I have prepared patches for the related parts identified by a
UriFilterData search in lxr.kde.org.
I would apply them tomorrow.
Ralf
["kurifilterdata-patch.zip" (application/x-zip-compressed)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic