Remove support of old SIXTYFPS_ env variable, and sixtyfps_widgets.60

This commit is contained in:
Olivier Goffart 2023-01-26 12:40:27 +01:00 committed by Olivier Goffart
parent 52fb1ab9fe
commit a0fb8bc771
7 changed files with 7 additions and 53 deletions

View file

@ -300,10 +300,7 @@ pub fn compile_with_config(
let mut compiler_config = config.config;
let mut rerun_if_changed = String::new();
if std::env::var_os("SLINT_STYLE").is_none()
&& std::env::var_os("SIXTYFPS_STYLE").is_none()
&& compiler_config.style.is_none()
{
if std::env::var_os("SLINT_STYLE").is_none() && compiler_config.style.is_none() {
compiler_config.style = std::env::var_os("OUT_DIR").and_then(|path| {
// Same logic as in i-slint-backend-selector's build script to get the path
let path = Path::new(&path).parent()?.parent()?.join("SLINT_DEFAULT_STYLE.txt");
@ -362,7 +359,6 @@ pub fn compile_with_config(
}
}
println!("cargo:rerun-if-env-changed=SLINT_STYLE");
println!("cargo:rerun-if-env-changed=SIXTYFPS_STYLE");
println!("cargo:rerun-if-env-changed=SLINT_FONT_SIZES");
println!("cargo:rerun-if-env-changed=SLINT_SCALE_FACTOR");
println!("cargo:rerun-if-env-changed=SLINT_ASSET_SECTION");

View file

@ -329,7 +329,7 @@ pub fn slint(stream: TokenStream) -> TokenStream {
let mut compiler_config =
CompilerConfiguration::new(i_slint_compiler::generator::OutputFormat::Rust);
if std::env::var_os("SLINT_STYLE").is_none() && std::env::var_os("SIXTYFPS_STYLE").is_none() {
if std::env::var_os("SLINT_STYLE").is_none() {
// This file is written by the i-slint-backend-selector's built script.
// It is in the target/xxx/build directory
let target_path = match std::env::var_os("OUT_DIR") {
@ -383,7 +383,6 @@ pub fn slint(stream: TokenStream) -> TokenStream {
result.extend(reload);
result.extend(quote! {const _ : Option<&'static str> = ::core::option_env!("SLINT_STYLE");});
result.extend(quote! {const _ : Option<&'static str> = ::core::option_env!("SIXTYFPS_STYLE");});
result.into()
}

View file

@ -169,8 +169,8 @@ int main()
if (auto error = app->window().set_rendering_notifier(OpenGLUnderlay(app))) {
if (*error == slint::SetRenderingNotifierError::Unsupported) {
fprintf(stderr,
"This example requires the use of the GL backend. Please run with the "
"environment variable SIXTYFPS_BACKEND=GL set.\n");
"This example requires the use of a GL renderer. Please run with the "
"environment variable SLINT_BACKEND=winit set.\n");
} else {
fprintf(stderr, "Unknown error calling set_rendering_notifier\n");
}

View file

@ -34,13 +34,7 @@ cfg_if::cfg_if! {
))] {
pub fn create_backend() -> Box<dyn Platform + 'static> {
let backend_config = std::env::var("SLINT_BACKEND").or_else(|_| {
let legacy_fallback = std::env::var("SIXTYFPS_BACKEND");
if legacy_fallback.is_ok() {
eprintln!("Using `SIXTYFPS_BACKEND` environment variable for dynamic backend selection. This is deprecated, use `SLINT_BACKEND` instead.")
}
legacy_fallback
}).unwrap_or_default();
let backend_config = std::env::var("SLINT_BACKEND").unwrap_or_default();
let backend_config = backend_config.to_lowercase();
let (event_loop, _renderer) = backend_config.split_once('-').unwrap_or_else(|| match backend_config.as_str() {

View file

@ -1,13 +0,0 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
import { LineEdit } from "sixtyfps_widgets.60";
// ^warning{"sixtyfps_widgets\.60" was renamed "std-widgets\.slint". Use of the old file name is deprecated}
export Blah := Window {
LineEdit {} // Not an error
Button {} // Not imported
// ^error{Unknown type Button}
}

View file

@ -79,17 +79,6 @@ impl TypeLoader {
.style
.clone()
.or_else(|| std::env::var("SLINT_STYLE").ok())
.or_else(|| {
let legacy_fallback = std::env::var("SIXTYFPS_STYLE").ok();
if legacy_fallback.is_some() {
diag.push_diagnostic_with_span(
"Using `SIXTYFPS_STYLE` environment variable for dynamic backend selection. This is deprecated, use `SLINT_STYLE` instead".to_owned(),
Default::default(),
crate::diagnostics::DiagnosticLevel::Warning
)
}
legacy_fallback
})
.unwrap_or_else(|| {
let is_wasm = cfg!(target_arch = "wasm32")
|| std::env::var("TARGET").map_or(false, |t| t.starts_with("wasm"));
@ -143,15 +132,7 @@ impl TypeLoader {
let mut reexports = None;
for mut import in dependencies {
if import.file.ends_with(".60") || import.file.ends_with(".slint") {
let mut file = import.file.as_str();
if file == "sixtyfps_widgets.60" {
file = "std-widgets.slint";
diagnostics.push_warning(
"\"sixtyfps_widgets.60\" was renamed \"std-widgets.slint\". Use of the old file name is deprecated".into(),
&import.import_uri_token,
);
}
let file = import.file.as_str();
let doc_path = match self
.ensure_document_loaded(
file,

View file

@ -729,10 +729,7 @@ pub async fn load(
mut compiler_config: CompilerConfiguration,
guard: generativity::Guard<'_>,
) -> (Result<Rc<ComponentDescription<'_>>, ()>, i_slint_compiler::diagnostics::BuildDiagnostics) {
if compiler_config.style.is_none()
&& std::env::var("SLINT_STYLE").is_err()
&& std::env::var("SIXTYFPS_STYLE").is_err()
{
if compiler_config.style.is_none() && std::env::var("SLINT_STYLE").is_err() {
// Defaults to native if it exists:
compiler_config.style = Some(if i_slint_backend_selector::HAS_NATIVE_STYLE {
"native".to_owned()