Re: Notes to developers: what KAboutData::setApplicationData() is
Jaroslaw, On Thu, Jun 18, 2015 at 3:20 AM, Jaroslaw Staniek stan...@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@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Re: Notes to developers: what KAboutData::setApplicationData() is
On 18 June 2015 at 14:50, Jeremy Whiting jpwhit...@kde.org wrote: Jaroslaw, On Thu, Jun 18, 2015 at 3:20 AM, Jaroslaw Staniek stan...@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 Hi Jeremy, KAboutData::setApplicationData() works with any QCoreApplication. What I meant is to recommend calling it in main() instead of placing the app.* calls when KApplication isn't used. I don't use KApplication already and quite a few of the apps listed by lxr do not but they still have the app.* calls, indeed maybe because of the porting notes. Maybe KAboutData::setApplicationData is not needed anymore instead or can get it's names and other values from QApplication's accessors? The current way looks cleaner to me, KAboutData is a nice data structure. -- 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@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Re: Notes to developers: what KAboutData::setApplicationData() is
(I am sorry, forgot to include kde-devel too) On 18 June 2015 at 11:20, Jaroslaw Staniek stan...@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(). 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. -- 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 -- 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@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Notes to developers: what KAboutData::setApplicationData() is
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(). 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. -- 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@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel