Expose IndexerState enum to QML
AcceptedPublic

Authored by davidedmundson on Dec 4 2019, 3:19 PM.

Details

Reviewers
ngraham
Group Reviewers
Baloo
Summary

The relevant namespace is exported and exposed to QML. Intended to help
tidy up the patch D25447 that shadows the enum values manually.

Test Plan

Compiles.
Hopefully @ngraham can test using it in the linked patch

Diff Detail

Repository
R293 Baloo
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 21268
Build 21286: arc lint + arc unit
davidedmundson created this revision.Dec 4 2019, 3:19 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptDec 4 2019, 3:19 PM
Restricted Application added subscribers: Baloo, kde-frameworks-devel. · View Herald Transcript
davidedmundson requested review of this revision.Dec 4 2019, 3:19 PM

This doesn't compile for me:

[ 11%] Building CXX object src/engine/CMakeFiles/KF5BalooEngine.dir/indexerstate.cpp.o
In file included from /home/nate/kde/src/baloo/src/engine/indexerstate.cpp:1:
/home/nate/kde/src/baloo/src/engine/indexerstate.h:32:19: error: expected constructor, destructor, or type conversion before ‘(’ token
   32 | Q_NAMESPACE_EXPORT(BALOO_ENGINE_EXPORT)
      |                   ^
davidedmundson planned changes to this revision.Dec 4 2019, 4:48 PM

Q_NAMESPACE_EXPORT is too new :(

davidedmundson edited the summary of this revision. (Show Details)

redo without the export

Thanks, now it compiles! I'm not sure it's working perfectly though. I updated D25447 to use this, but it's claiming that my indexer is suspended, while balooctl status disagrees.

@davidedmundson ping. This needs to make it into Frameworks 5.66 this is tagged in a week if the dependent patches are to land in Plasma 5.18.

Thanks, now it compiles! I'm not sure it's working perfectly though. I updated D25447 to use this, but it's claiming that my indexer is suspended, while balooctl status disagrees.

There were several other problems with the QML plugin which I've hopefully fixed up separately.

Now this patch no longer applies cleanly after those changes; needs a rebase.

Thanks!

Baloo::Suspended doesn't seem to be exported properly or set. Also it seems like toggleSuspendState() only ever suspends and never resumes. Looking at the code in monitor.cpp, it seems like these may be related.

@broulik discovered that this needs qRegisterMetaType<Baloo::IndexerState>(); added

broulik added inline comments.Jan 17 2020, 3:26 PM
src/qml/experimental/baloomonitorplugin.cpp
31

I have to also add a

qRegisterMetaType<Baloo::IndexerState>();

in order to be able to use that type in a Q_PROPERTY. How odd.

ngraham accepted this revision.Feb 12 2020, 5:30 AM
This revision is now accepted and ready to land.Feb 12 2020, 5:30 AM

Ping.

Will do on Sunday (after tagging)

bruns added a subscriber: bruns.Mar 13 2020, 11:08 PM

Ping.

Will do on Sunday (after tagging)

Which Sunday? ;-)

Can we please continue this over on Gitlab?