diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 398ee8c9..ef62bba9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -82,7 +82,7 @@ build_reference: script: - apt-get -y install cargo - cd _build - - ../cargo.sh doc --no-deps --document-private-items --features 'glib_v0_14,zbus_v1_5,clap_v4' + - ../cargo.sh doc --no-deps --document-private-items --features 'zbus_v1_5,clap_v4' except: variables: - $PKG_ONLY == "1" diff --git a/Cargo.toml.in b/Cargo.toml.in index 557e6c6f..aee843c4 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -22,7 +22,6 @@ name = "find_orphan_layouts" path = "@path@/examples/find_orphan_layouts.rs" [features] -glib_v0_14 = [] zbus_v1_5 = [] clap_v4 = [] diff --git a/meson.build b/meson.build index 88eab2b8..b938b1f4 100644 --- a/meson.build +++ b/meson.build @@ -98,7 +98,7 @@ cargo_toml_base = configure_file( cargo_patch = [] -cargo_build_flags += ['--features', 'glib_v0_14,zbus_v1_5,clap_v4'] +cargo_build_flags += ['--features', 'zbus_v1_5,clap_v4'] cargo_deps = files('Cargo.deps') cargo_lock = files('Cargo.lock') diff --git a/src/main.rs b/src/main.rs index fd4e22ef..e6360bfa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -166,8 +166,6 @@ mod c { ControlFlow::Continue }, ); - #[cfg(not(feature = "glib_v0_14"))] - ctx.release(); } /// A single iteration of the UI loop. diff --git a/src/popover.rs b/src/popover.rs index 1fde031e..ac488f4e 100644 --- a/src/popover.rs +++ b/src/popover.rs @@ -108,10 +108,7 @@ mod variants { fn get_settings(schema_name: &str) -> Option { let mut error_handler = logging::Print{}; - #[cfg(feature = "glib_v0_14")] let ss = gio::SettingsSchemaSource::default(); - #[cfg(not(feature = "glib_v0_14"))] - let ss = gio::SettingsSchemaSource::get_default(); ss.or_warn( &mut error_handler, @@ -134,10 +131,7 @@ fn set_layout(kind: &str, name: &str) { if let Some(settings) = settings { let kind = String::from(kind); let name = String::from(name); - #[cfg(feature = "glib_v0_14")] let inputs = settings.value("sources"); - #[cfg(not(feature = "glib_v0_14"))] - let inputs = settings.get_value("sources").unwrap(); let current = (kind.clone(), name.clone()); let inputs = variants::get_tuples(inputs).into_iter() @@ -246,10 +240,7 @@ pub fn show( let settings = get_settings("org.gnome.desktop.input-sources"); let inputs = settings .map(|settings| { - #[cfg(feature = "glib_v0_14")] let inputs = settings.value("sources"); - #[cfg(not(feature = "glib_v0_14"))] - let inputs = settings.get_value("sources").unwrap(); variants::get_tuples(inputs) }) @@ -282,16 +273,10 @@ pub fn show( }); let model: gio::Menu = { - #[cfg(feature = "glib_v0_14")] { let builder = gtk::Builder::from_resource("/sm/puri/squeekboard/popover.ui"); builder.object("app-menu").unwrap() } - #[cfg(not(feature = "glib_v0_14"))] - { - let builder = gtk::Builder::new_from_resource("/sm/puri/squeekboard/popover.ui"); - builder.get_object("app-menu").unwrap() - } }; for (tr, l) in human_names.iter().rev() { @@ -300,10 +285,7 @@ pub fn show( model.prepend_item (&item); } - #[cfg(feature = "glib_v0_14")] let menu = gtk::Popover::from_model(Some(&window), &model); - #[cfg(not(feature = "glib_v0_14"))] - let menu = gtk::Popover::new_from_model(Some(&window), &model); menu.set_pointing_to(>k::Rectangle::new ( position.x.ceil() as i32, diff --git a/src/style.rs b/src/style.rs index 3f615b36..2715743e 100644 --- a/src/style.rs +++ b/src/style.rs @@ -41,10 +41,7 @@ pub mod c { fn squeek_load_style() -> *const gtk_sys::GtkCssProvider { unsafe { gtk::set_initialized() }; - #[cfg(feature = "glib_v0_14")] let theme = gtk::Settings::default(); - #[cfg(not(feature = "glib_v0_14"))] - let theme = gtk::Settings::get_default(); let theme = theme.map(|settings| get_theme_name(&settings)); @@ -98,22 +95,16 @@ fn get_theme_name(settings: >k::Settings) -> GtkTheme { e }).ok(); - #[cfg(feature = "glib_v0_14")] let prop = |s: >k::Settings, name| { if s.has_property(name, None) { return Ok(s.property_value(name)); } return Err("Key not found in settings"); }; - #[cfg(not(feature = "glib_v0_14"))] - let prop = |s: >k::Settings, name| s.get_property(name); - #[cfg(feature = "glib_v0_14")] fn check(v: Result) -> Option { v.or_print(logging::Problem::Surprise, "Key not of expected type") } - #[cfg(not(feature = "glib_v0_14"))] - fn check(v: Option) -> Option { v } match env_theme { Some(theme) => theme,