Bug 378539

Summary: balooshow: always a kf5.kcoreaddons.kaboutdata error displayed
Product: [Frameworks and Libraries] frameworks-baloo Reporter: Don Curtis <bugrprt21882>
Component: generalAssignee: Pinak Ahuja <pinak.ahuja>
Status: RESOLVED FIXED    
Severity: major CC: alexey.min, cookie170, luigi.toscano
Priority: NOR    
Version First Reported In: 5.26.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Don Curtis 2017-04-07 13:55:31 UTC
Whenever balooshow is called, regardless of options and/or a file name, or not, the following error is displayed:
"kf5.kcoreaddons.kaboutdata: Could not initialize the equivalent properties of Q*Application: no instance (yet) existing."
Comment 1 Don Curtis 2017-04-07 14:10:09 UTC
While debugging the "balooshow" code and, comparing it to the "balooctl" and "baloosearch" code the following seems to be the cause of this issue:

"balooshow": main.cpp: lines 63 and 64:
 * KAboutData::setApplicationData is being called before the "QCoreApplication" constructor.

Swapping these two lines and recompiling resolves this issue.
Comment 2 Don Curtis 2017-04-07 14:14:03 UTC
And, while we're in this area of "balooshow" main.cpp, a spelling error, which has been reported by Bug 369470, and now also by me, can also be repaired:

"balooshow": main.cpp: line 71: -->> 'fiel' should be 'file'
   QStringLiteral("Inode number of the fiel to show")));
Comment 3 Alexander 2017-04-19 16:53:25 UTC
(In reply to Don Curtis from comment #0)
> Whenever balooshow is called, regardless of options and/or a file name, or
> not, the following error is displayed:
> "kf5.kcoreaddons.kaboutdata: Could not initialize the equivalent properties
> of Q*Application: no instance (yet) existing."

Same here.
Comment 4 Alexey Min 2017-04-19 19:43:32 UTC
(In reply to Don Curtis from comment #1)

> "balooshow": main.cpp: lines 63 and 64: KAboutData::setApplicationData is being called before the "QCoreApplication" constructor.
> Swapping these two lines and recompiling resolves this issue.

An easy fix would be, https://phabricator.kde.org/D5516
Comment 5 Luigi Toscano 2017-04-19 19:45:37 UTC
The QCoreApplication instance should be created even before the creation of KAboutData instance, not just before the setApplicationData, but for i18n reasons.
Comment 6 Luigi Toscano 2017-04-19 20:37:50 UTC
Git commit 74601ed37da9e5c738c83d0999f9f0c1922883ea by Luigi Toscano, on behalf of Alexey Min.
Committed on 19/04/2017 at 20:35.
Pushed by ltoscano into branch 'master'.

balooctl, baloosearch, balooshow: Fix order of QCoreApplication object creation

Summary:
QCoreApplication object should exist at the moment when
KAboutData::setApplicationData() is called. And it should be created
even before KAboutData object.

Test Plan:
As was mentioned in bug, swapping those two lines and recompiling
resolves the issue. No warning displayed anymore.

Reviewers: #frameworks, aacid, ltoscano

Reviewed By: ltoscano

Subscribers: ltoscano

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D5516

M  +2    -1    src/tools/balooctl/main.cpp
M  +2    -1    src/tools/baloosearch/main.cpp
M  +2    -1    src/tools/balooshow/main.cpp

https://commits.kde.org/baloo/74601ed37da9e5c738c83d0999f9f0c1922883ea