Bug 364134

Summary: kaffeine-2.0.2: Searches for global scanfile under PREFIX/share
Product: [Applications] kaffeine Reporter: Timo Gurr <timo.gurr>
Component: generalAssignee: Mauro Carvalho Chehab <mchehab>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Exherbo   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Timo Gurr 2016-06-09 09:07:31 UTC
Due to our multiarch approach we install the architecture specific stuff in /usr/{host-triplet} and the architecture independent stuff in /usr/share:

[...]
-DCMAKE_INSTALL_PREFIX:PATH=/usr/x86_64-pc-linux-gnu
-DCMAKE_SYSTEM_PREFIX_PATH:PATH=/usr/x86_64-pc-linux-gnu
-DCMAKE_INSTALL_DATAROOTDIR:PATH=/usr/share/
[...]

[...]
/usr/x86_64-pc-linux-gnu/bin/kaffeine
/usr/share/kaffeine/scanfile.dvb
[...]

But Kaffeine still searches for the scanfile.dvb in PREFIX/share instead of DATAROOTDIR:

09-06-16 10:58:04.218 [System  ] DvbManager::loadDeviceManager: using built-in dvb device manager
09-06-16 10:58:08.550 [System  ] DvbManager::readScanData: cannot open global scanfile  "/usr/x86_64-pc-linux-gnu//usr/share/kaffeine/scanfile.dvb"

Reproducible: Always
Comment 1 Mauro Carvalho Chehab 2016-06-09 09:20:02 UTC
Kaffeine's logic is to seek for the scanfile.dvb on two places:
- at the place defined by KAFFEINE_INSTALL_DIR:
src/config-kaffeine.h.cmake:#define KAFFEINE_DATA_INSTALL_DIR "${KDE_INSTALL_FULL_DATADIR}"
src/dvb/dvbmanager.cpp: QFile globalFile(QString::fromUtf8(KAFFEINE_DATA_INSTALL_DIR "/kaffeine/scanfile.dvb"));

And at the user's data dir:

src/dvb/dvbmanager.cpp: QFile file(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1String("/scanfile.dvb"));

The change needed for your setup is to change kaffeine.h.cmake to point to CMAKE_INSTALL_DATAROOTDIR, instead of KDE_INSTALL_FULL_DATADIR. I need to check if this won't break for its normal usage, before committing such change upstream.
Comment 2 Timo Gurr 2016-06-09 09:43:55 UTC
Thanks for the hint! However it seems the problem is already resolved with this commit in git master:

https://quickgit.kde.org/?p=kaffeine.git&a=commitdiff&h=6e7c5f66c7654a62581ec851829bfa1de29d6f40

Applying it to 2.0.2 made the error message go away.