kde/{kate,konqueror,okular}: decrease text mimetype preference

These .desktop files set InitialPreference>1 which will override other
associations even the .desktop appears first in XDG_DATA_DIRS. This
applies to:

- org.kde.kate.desktop
- org.kde.kwrite.desktop
- kfmclient_html.desktop
- okularApplication_txt.desktop

Fixes #86137
This commit is contained in:
Matthew Bauer 2020-04-27 16:39:11 -05:00
parent 5e6adf78e9
commit b3f812688c
3 changed files with 28 additions and 1 deletions

View File

@ -14,6 +14,16 @@ mkDerivation {
maintainers = [ lib.maintainers.ttuegel ]; maintainers = [ lib.maintainers.ttuegel ];
}; };
# InitialPreference values are too high and end up making kate &
# kwrite defaults for anything considered text/plain. Resetting to
# 1, which is the default.
postPatch = ''
substituteInPlace kate/data/org.kde.kate.desktop \
--replace InitialPreference=9 InitialPreference=1
substituteInPlace kwrite/data/org.kde.kwrite.desktop \
--replace InitialPreference=8 InitialPreference=1
'';
nativeBuildInputs = [ extra-cmake-modules kdoctools ]; nativeBuildInputs = [ extra-cmake-modules kdoctools ];
buildInputs = [ buildInputs = [
libgit2 libgit2

View File

@ -12,9 +12,17 @@ mkDerivation {
kdelibs4support kcmutils khtml kdesu kdelibs4support kcmutils khtml kdesu
qtwebkit qtwebengine qtx11extras qtscript qtwayland qtwebkit qtwebengine qtx11extras qtscript qtwayland
]; ];
# InitialPreference values are too high and any text/html ends up
# opening konqueror, even if firefox or chromium are also available.
# Resetting to 1, which is the default.
postPatch = ''
substituteInPlace kfmclient_html.desktop \
--replace InitialPreference=9 InitialPreference=1
'';
meta = { meta = {
license = with lib.licenses; [ gpl2 ]; license = with lib.licenses; [ gpl2 ];
maintainers = with lib.maintainers; [ ]; maintainers = with lib.maintainers; [ ];
}; };
} }

View File

@ -18,6 +18,15 @@ mkDerivation {
kwindowsystem libkexiv2 libspectre libzip phonon poppler qca-qt5 kwindowsystem libkexiv2 libspectre libzip phonon poppler qca-qt5
qtdeclarative qtsvg threadweaver kcrash qtdeclarative qtsvg threadweaver kcrash
] ++ lib.optional (!stdenv.isAarch64) chmlib; ] ++ lib.optional (!stdenv.isAarch64) chmlib;
# InitialPreference values are too high and end up making okular
# default for anything considered text/plain. Resetting to 1, which
# is the default.
postPatch = ''
substituteInPlace generators/txt/okularApplication_txt.desktop \
--replace InitialPreference=3 InitialPreference=1
'';
meta = with lib; { meta = with lib; {
homepage = "http://www.kde.org"; homepage = "http://www.kde.org";
license = with licenses; [ gpl2 lgpl21 fdl12 bsd3 ]; license = with licenses; [ gpl2 lgpl21 fdl12 bsd3 ];