Bug 490674

Summary: MacOS error: no member named 'org' in global namespace
Product: [Frameworks and Libraries] frameworks-kparts Reporter: Kurt Hindenburg <khindenburg>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED NOT A BUG    
Severity: normal CC: christoph, kdelibs-bugs, khindenburg, nicolas.fella
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: macOS   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: build log from kdesrc-build

Description Kurt Hindenburg 2024-07-22 21:46:08 UTC
Created attachment 171912 [details]
build log from kdesrc-build

I'm not sure why this started failing now since the code went in 2014.  Using current master for all frameworks.   It was suggested in M that this might be due to recent dbus removal on macOS.

/Users/kurthindenburg/Devel/KDE/src6/kparts/src/readwritepart.cpp:282:11: error: no member named 'org' in the global namespace
        ::org::kde::KDirNotify::emitFilesAdded(m_url.adjusted(QUrl::RemoveFilename));
        ~~^

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY


STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 David Faure 2024-07-22 22:01:12 UTC
KIO installs a header called kdirnotify.h which defines OrgKdeKDirNotifyInterface and org::kde::etc. but all within `#ifdef QT_DBUS_LIB`
So indeed if you don't have QtDBus you're screwed. How can that be possible? You won't get far compiling KF5 or KF6 without DBus.
I don't know how I can help you. Get DBus back ;)
Comment 2 Nicolas Fella 2024-07-22 22:42:20 UTC
A lot of recent effort went into building without DBus on macOS, so it's certainly supposed to work.

The usage of  ::org::kde::KDirNotify::emitFilesAdded is guarded with HAVE_KDIRNOTIFY, which is defined as

#define HAVE_KDIRNOTIFY __has_include(<KDirNotify>)

The KDirNotify header is only installed if KIO is built with DBus support. Could it be that you have an old KDirNotify header from a previous KIO version in your include path?
Comment 3 Kurt Hindenburg 2024-07-22 23:21:25 UTC
I think it is due to kio 6bdab620; it doesn't revert clearly but if I go to the previous commit and fix the version, kparts builds.
Comment 4 Kurt Hindenburg 2024-07-22 23:34:19 UTC
(In reply to Nicolas Fella from comment #2)
> A lot of recent effort went into building without DBus on macOS, so it's
> certainly supposed to work.
> 
> The usage of  ::org::kde::KDirNotify::emitFilesAdded is guarded with
> HAVE_KDIRNOTIFY, which is defined as
> 
> #define HAVE_KDIRNOTIFY __has_include(<KDirNotify>)
> 
> The KDirNotify header is only installed if KIO is built with DBus support.
> Could it be that you have an old KDirNotify header from a previous KIO
> version in your include path?

I'll try to test this as it might be the case and I usually don't clear out the destination directories.
Comment 5 Kurt Hindenburg 2024-07-23 16:32:41 UTC
Nicolas must have been correct that I had leftover files in the destination.  Once I did a purge and re-compiled everything worked.  Thanks.
Comment 6 Christoph Cullmann 2024-07-23 16:35:43 UTC
Ok, thanks for checking, that should work fine with clean build, at least the CI jobs and Craft macOS builds show that.