[Patch] Qmake project manager Qt module include paths

Andreas Pakulat apaku at gmx.de
Sat Apr 11 23:35:23 UTC 2009


On 10.04.09 16:40:28, Sean Harmer wrote:
> Hi,
> 
> On Friday 10 April 2009 00:46:57 Andreas Pakulat wrote:
> > On 09.04.09 17:26:18, Sean Harmer wrote:
> > > On Thursday 09 April 2009 14:22:26 Sean Harmer wrote:
> > > > Could somebody please review the patch please?
> > >
> > > I have improved the patch a little more so that it now also resolves
> > > environment variables in the INCLUDEPATH qmake variable. Updated patch
> > > attached for review.
> >
> > Sorry, but not ok. Envvars need to be read via project config and the
> > envvar-stuff from kdevplatform. That way we get the standard env in
> > which kdevelop was started, but overriden by any user-chosen
> > env configuration via the project config.
> That's fine I'm just not very familiar with the kdevplatform code base yet. 
> Could you give me a pointer as to where to look for this environment support 
> please?

Its a class in kdevplatform/util/, check qmakebuilder in kdevelop/projectbuilders. It
uses the combobox for the kcm and the class for extracting the
environment.
 
> > > +    // Let's cache the Qt include dir
> > > +    QProcess qtInc;
> > > +    qtInc.start( "qmake", QStringList() << "-query" <<
> > > "QT_INSTALL_HEADERS" ); +    if ( !qtInc.waitForFinished() )
> > > +    {
> > > +        kDebug(9024) << "Failed to query Qt header path using qmake";
> > > +    } else
> > > +    {
> > > +        QByteArray result = qtInc.readAll();
> > > +        m_qtIncludeDir = result.simplified();
> > > +    }
> > > +
> >
> > This part is ok design-wise, but the conversion from QByteArray to
> > QString is broken - I suggest to make sure that qmake runs in an UTF8
> > locale and then use QString::fromUtf8().
> Fair enough, do you have a preferred way of launching apps with QProcess in a 
> UTF-8 locale?

Hmm, actually, there's no good way to do this. There's no "general
purpose" utf8 locale thats always enabled. So just make sure you convert
using QString::fromLocal8Bit, which uses the locale in which KDevelop
was started.

Andreas

-- 
You work very hard.  Don't try to think as well.




More information about the KDevelop-devel mailing list