[KDE/Mac] Thoughts on standard directories in Qt5 - QStandardPaths
Marko Käning
mk-lists at email.de
Sat Dec 6 17:06:56 UTC 2014
Hi all,
looking again at the QSP code additions I made by picking the corresponding sections
from qtbase/src/corelib/io/qstandardpaths_unix.cpp I realise now that all my trial up
to now have been without real effect:
---
+ case ConfigLocation:
+ case GenericConfigLocation:
+ {
+ // http://standards.freedesktop.org/basedir-spec/latest/
+ QString xdgConfigHome = QFile::decodeName(qgetenv("XDG_CONFIG_HOME"));
+ if (isTestModeEnabled())
+ xdgConfigHome = QDir::homePath() + QLatin1String("/.qttest/Library/Preferences");
+ if (xdgConfigHome.isEmpty())
+ xdgConfigHome = QDir::homePath() + QLatin1String("/Library/Preferences");
+ return xdgConfigHome;
+ }
---
since only now I realised, that my environment doesn’t set the XDG_CONFIG_HOME env variable,
and not a whole list of directories, as in XDG_CONFIG_DIRS! The whole time I thought the
patch was using the latter and resolving the list internally somehow!
How mistaken I was! ;-/
BUT, if I start bovo using XDG_CONFIG_HOME like this:
---
$ XDG_CONFIG_HOME=/opt/kde/install/darwin/mavericks/clang/kf5-qt5/frameworks/kxmlgui/inst/etc/xdg /opt/kde/install/darwin/mavericks/clang/kf5-qt5/kde/kdegames/bovo/inst/Applications/KF5/bovo.app/Contents/MacOS/bovo
Could not find drkonqi at /opt/kde/install/darwin/mavericks/clang/kf5-qt5/frameworks/kcrash/inst/lib/libexec/drkonqi
Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kglobalaccel was not provided by any .service files")
RC file: ""
games.ui: KStandardGameAction::create( 1 = game_new , KActionCollection(0x7fcd88d12bc0, name = "KXMLGUIClient-KActionCollection") )
games.ui: KStandardGameAction::create( 11 = game_quit , KActionCollection(0x7fcd88d12bc0, name = "KXMLGUIClient-KActionCollection") )
games.ui: KStandardGameAction::create( 23 = move_hint , KActionCollection(0x7fcd88d12bc0, name = "KXMLGUIClient-KActionCollection") )
games.ui: KStandardGameAction::create( 13 = move_undo , KActionCollection(0x7fcd88d12bc0, name = "KXMLGUIClient-KActionCollection") )
QFSFileEngine::open: No file name specified
Cannot open file '', because: No file name specified
cannot find .rc file "bovoui.rc" for component "bovo”
---
the kxmlgui5’s ui_standards.rc file is eventually found!!! :-)
But we’re still short the bovoui.rc, so let’s try setting XDG_DATA_HOME as well:
---
$ XDG_CONFIG_HOME=/opt/kde/install/darwin/mavericks/clang/kf5-qt5/frameworks/kxmlgui/inst/etc/xdg XDG_DATA_HOME=/opt/kde/install/darwin/mavericks/clang/kf5-qt5/kde/kdegames/bovo/inst/share /opt/kde/install/darwin/mavericks/clang/kf5-qt5/kde/kdegames/bovo/inst/Applications/KF5/bovo.app/Contents/MacOS/bovo
Could not find drkonqi at /opt/kde/install/darwin/mavericks/clang/kf5-qt5/frameworks/kcrash/inst/lib/libexec/drkonqi
Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kglobalaccel was not provided by any .service files")
RC file: "/opt/kde/install/darwin/mavericks/clang/kf5-qt5/frameworks/kxmlgui/inst/etc/xdg/bovorc"
games.ui: KStandardGameAction::create( 1 = game_new , KActionCollection(0x7f96b5032290, name = "KXMLGUIClient-KActionCollection") )
games.ui: KStandardGameAction::create( 11 = game_quit , KActionCollection(0x7f96b5032290, name = "KXMLGUIClient-KActionCollection") )
games.ui: KStandardGameAction::create( 23 = move_hint , KActionCollection(0x7f96b5032290, name = "KXMLGUIClient-KActionCollection") )
games.ui: KStandardGameAction::create( 13 = move_undo , KActionCollection(0x7f96b5032290, name = "KXMLGUIClient-KActionCollection") )
QFSFileEngine::open: No file name specified
Cannot open file '', because: No file name specified
Icon theme "oxygen" not found.
kf5.kiconthemes: Couldn't find current icon theme, falling back to default.
Icon theme "oxygen" not found.
Error: standard icon theme "oxygen" not found!
---
Now we also have bovoui.rc and finally reached the icon themes!!! :-)
According to
---
const QStringList themeDirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("themes"), QStandardPaths::LocateDirectory);
---
the themes should also be found via the “DataLocation” path type, but they reside in “/Library/Application Support/bovo/themes”
as shown in one of my previous posts. This can’t be found, since it doesn’t coincide with the current
XDG_DATA_HOME setting "/opt/kde/install/darwin/mavericks/clang/kf5-qt5/kde/kdegames/bovo/inst/share".
This means, there is a *mixup* with all these different paths! Perhaps I am myself to be blamed for
that, since I set these configuration parameters globally for the OSX/CI system:
---
configurePlatformArgs=-DCMAKE_INSTALL_BUNDLEDIR="Applications/KF5" -DDATA_INSTALL_DIR="Library/Application Support"
---
where DATA_INSTALL_DIR could be responsible for this. I should perhaps have relied on the build system’s
defaults for it?
Well, at least I DO SEE a toolbar now and the menu structure!!! :-)
That’s a bit better, but this still leaves me confused, as I am surprised about that I have to set
those XDG_*_HOME vars myself, as I thought this would be taken care of by the CI system's scripts.
On exit the program still crashes.
Greets,
Marko
More information about the kde-mac
mailing list