Bug 364134 - kaffeine-2.0.2: Searches for global scanfile under PREFIX/share
Summary: kaffeine-2.0.2: Searches for global scanfile under PREFIX/share
Status: RESOLVED FIXED
Alias: None
Product: kaffeine
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Exherbo Linux
: NOR normal
Target Milestone: ---
Assignee: Mauro Carvalho Chehab
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-09 09:07 UTC by Timo Gurr
Modified: 2016-06-09 10:20 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.