Bug 468779

Summary: Fails to build without KActivities (wrong #if check)
Product: [Applications] dolphin Reporter: Christoph Feck <cfeck>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: 1i5t5.duncan, kfm-devel
Priority: NOR Keywords: junior-jobs
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: #ifdef HAVE_KACTIVITIES -> #if HAVE_KACTIVITIES patch

Description Christoph Feck 2023-04-21 22:23:05 UTC
SUMMARY
Commit b99f6f50eef395a3ceb88fb3d4b7357cbbc13c85 fails to build without KActivties, because of wrong #if checks: cmakedefine01 HAVE_KACTIVITIES will always define the variable, either to 0 or to 1.

To check for HAVE_KACTIVITIES, use #if instead of #ifdef (see also usage in dolphinviewcontainer.cpp)
Comment 1 Duncan 2023-04-30 19:50:43 UTC
Created attachment 158576 [details]
#ifdef HAVE_KACTIVITIES -> #if HAVE_KACTIVITIES patch

Confirmed bisect to b99f6f50e.  Confirmed it builds with (gentoo) USE=kactivites.  Here's the error without:

src/global.cpp:20:10: fatal error: KActivities/Consumer: No such file or directory
20 | #include <KActivities/Consumer>

And a patch confirmed to fix it since I have it.  I'm not a dev and don't know how to do PRs, but given cfeck's #IFDEF -> #IF hint and the commit, on gentoo a patch was trivial to do and test, so I might as well post it.
Comment 2 Duncan 2023-05-11 02:52:03 UTC
Fixed with c3fb0dc15