[patch] Appwizard VCS extract method

Manuel Breugelmans mbr.nxi at gmail.com
Fri Aug 29 13:57:44 UTC 2008


On Friday 29 August 2008 14:46:54 Andreas Pakulat wrote:
> On 29.08.08 07:53:00, Kris Wong wrote:
> > > >  QString AppWizardPlugin::createProject(const ApplicationInfo& info)
> > > >  {
> > > >      QFileInfo templateInfo(info.appTemplate);
> > > >      if (!templateInfo.exists())
> > > > -        return "";
> > > > +        return QString();
> > >
> > > This isn't really needed. QString() == "" in Qt4, unless you use
> > > QString::isNull() which is to be avoided by all means.
> >
> > Is that true?  I would bet that
> >
> > return "";
> >
> > Initializes heap space, while
> >
> > return QString();
> >
> > Does not.
>
> So you're saying we save a heap allocation? Well, I don't really care
> which one is used, just changing from one to the other without reason is
> not good.
>
> Andreas

I was under the impression this was a krazy rule but appear to be wrong. 
Anyway I suppose "" is slightly more error-prone, it is all to easy to type 
" " instead ...


Manuel




More information about the KDevelop-devel mailing list