Notes to developers: what KAboutData::setApplicationData() is
Jeremy Whiting
jpwhiting at kde.org
Thu Jun 18 12:50:45 UTC 2015
Jaroslaw,
On Thu, Jun 18, 2015 at 3:20 AM, Jaroslaw Staniek <staniek at kde.org> wrote:
> Hi
> If you look at apps ported to KF5, KAboutData::setApplicationData() is
> used but there are also redundant lines in main(), at least these:
>
> app.setApplicationName(aboutData.componentName());
> app.setApplicationDisplayName(aboutData.displayName());
> app.setOrganizationDomain(aboutData.organizationDomain());
> app.setApplicationVersion(aboutData.version());
>
> Note, this is already performed by KAboutData::setApplicationData().
That may be, but if using QApplication instead of KApplication they
are needed. See the note at
https://community.kde.org/Frameworks/Porting_Notes#Application Maybe
KAboutData::setApplicationData is not needed anymore instead or can
get it's names and other values from QApplication's accessors?
>
> For example Kate --
> http://lxr.kde.org/source/kde/applications/kate/kate/src/main.cpp
>
> For the list see
> http://lxr.kde.org/search?_filestring=&_string=setApplicationDisplayName
>
> Sometimes there are even deeper duplication of names, e.g. despite of
> using KAboutData there's also:
>
> QApplication::setApplicationName("kanagram");
>
> -- http://lxr.kde.org/source/kde/applications/kate/kate/src/main.cpp
>
> If I am right, this is a note for developers to fix that -- KAboutData
> was designed to make main() easier but actually main() looks
> unnecessary complicated for a number of KDE apps. Looks like people
> take another app's code as a template and copy it :)
>
> No idea if more general improvement could be an addition to the
> apidocs of a crazy check.
BR,
Jeremy
>
> --
> regards, Jaroslaw Staniek
>
> KDE:
> : A world-wide network of software engineers, artists, writers, translators
> : and facilitators committed to Free Software development - http://kde.org
> Calligra Suite:
> : A graphic art and office suite - http://calligra.org
> Kexi:
> : A visual database apps builder - http://calligra.org/kexi
> Qt Certified Specialist:
> : http://www.linkedin.com/in/jstaniek
> _______________________________________________
> Kde-frameworks-devel mailing list
> Kde-frameworks-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
More information about the Kde-frameworks-devel
mailing list