Bug 386701 - K4AboutData::operator KAboutData() does not convert the credits
Summary: K4AboutData::operator KAboutData() does not convert the credits
Status: RESOLVED UNMAINTAINED
Alias: None
Product: frameworks-kdelibs4support
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.38.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-10 04:06 UTC by Kevin Kofler
Modified: 2023-07-03 20:51 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Kofler 2017-11-10 04:06:34 UTC
K4AboutData::operator KAboutData() does not convert the credits. I had to manually add:
#if KDE_IS_VERSION(5, 0, 0)
  // Workaround: K4AboutData fails to do this.
  KAboutData aboutData5 = KAboutData::applicationData();
  if (aboutData5.credits().isEmpty()) // do not duplicate if fixed upstream
    aboutData5.addCredit(aboutData.credits().first().name());
  KAboutData::setApplicationData(aboutData5);
#endif
to my application to work around that.

Note that I use:
#if KDE_IS_VERSION(5, 0, 0)
#include <K4AboutData>
#else
#define K4AboutData KAboutData
#endif
to get the code to compile with either kdelibs 4 or KF5.
Comment 1 Kevin Kofler 2017-11-10 04:16:40 UTC
By the way, it took me quite some time to find the correct spot to insert the workaround. There is exactly one spot in main() where it can happen, between:
  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
and:
  MainWindow *mainWindow = new MainWindow;

Do it too early and it won't work because KAboutData was not converted yet. Do it too late and it won't work because KMainWindow is already initialized.
Comment 2 Kevin Kofler 2017-11-10 04:19:31 UTC
(Note that my workaround as written here obviously assumes that there is only one credit and that only the name field is filled. Both are the case for my application. A generic conversion code needs to do better.)
Comment 3 Justin Zobel 2022-11-10 08:51:42 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 4 Kevin Kofler 2022-11-10 14:13:03 UTC
The only 2 commits to k4aboutdata.cpp since I reported this have not fixed this.
Comment 5 Christoph Cullmann 2023-07-03 20:51:41 UTC
kdelibs4support was already in pure maintenance mode in kf5, for kf6 it got removed,
there will be no future work spend on this beside critical security issues, if
at all.