mirror of
https://github.com/nix-community/home-manager
synced 2025-01-11 19:49:49 +01:00
qt: use warnings API
This commit is contained in:
parent
be2b17615c
commit
54e35e0e1c
2 changed files with 15 additions and 10 deletions
|
@ -187,22 +187,17 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config = let
|
||||||
warnGnomeDeprecation = option: name:
|
|
||||||
lib.warnIf (name == "gnome")
|
|
||||||
"The value `gnome` for option `${option}` is deprecated. Use `adwaita` instead."
|
|
||||||
name;
|
|
||||||
|
|
||||||
platformTheme = if (builtins.isString cfg.platformTheme) then {
|
platformTheme = if (builtins.isString cfg.platformTheme) then {
|
||||||
name = lib.warn
|
option = "qt.platformTheme";
|
||||||
"The option `qt.platformTheme` has been renamed to `qt.platformTheme.name`."
|
name = cfg.platformTheme;
|
||||||
(warnGnomeDeprecation "qt.platformTheme" cfg.platformTheme);
|
|
||||||
package = null;
|
package = null;
|
||||||
} else if cfg.platformTheme == null then {
|
} else if cfg.platformTheme == null then {
|
||||||
|
option = null;
|
||||||
name = null;
|
name = null;
|
||||||
package = null;
|
package = null;
|
||||||
} else {
|
} else {
|
||||||
name =
|
option = "qt.platformTheme.name";
|
||||||
warnGnomeDeprecation "cfg.platformTheme.name" cfg.platformTheme.name;
|
name = cfg.platformTheme.name;
|
||||||
package = cfg.platformTheme.package;
|
package = cfg.platformTheme.package;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -238,6 +233,12 @@ in {
|
||||||
'';
|
'';
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
warnings = (lib.lists.optional (platformTheme.option == "qt.platformTheme")
|
||||||
|
"The option `qt.platformTheme` has been renamed to `qt.platformTheme.name`.")
|
||||||
|
++ (lib.lists.optional
|
||||||
|
(platformTheme.name == "gnome" && platformTheme.package == null)
|
||||||
|
"The value `gnome` for option `${platformTheme.option}` is deprecated. Use `adwaita` instead.");
|
||||||
|
|
||||||
qt.style.package = lib.mkIf (cfg.style.name != null)
|
qt.style.package = lib.mkIf (cfg.style.name != null)
|
||||||
(lib.mkDefault (stylePackages.${lib.toLower cfg.style.name} or null));
|
(lib.mkDefault (stylePackages.${lib.toLower cfg.style.name} or null));
|
||||||
|
|
||||||
|
|
|
@ -19,5 +19,9 @@
|
||||||
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
|
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
|
||||||
'QML2_IMPORT_PATH'
|
'QML2_IMPORT_PATH'
|
||||||
'';
|
'';
|
||||||
|
test.asserts.warnings.expected = [
|
||||||
|
"The option `qt.platformTheme` has been renamed to `qt.platformTheme.name`."
|
||||||
|
"The value `gnome` for option `qt.platformTheme` is deprecated. Use `adwaita` instead."
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue