Blame 0002-use-latest-compatible-crates.patch

9bea750
diff --git a/cargo.sh b/cargo.sh
9bea750
index c4be97b..9ba7ed7 100755
9bea750
--- a/cargo.sh
9bea750
+++ b/cargo.sh
9bea750
@@ -14,9 +14,5 @@ export CARGO_TARGET_DIR
80357c2
 
9bea750
 cd "$SOURCE_DIR"
80357c2
 
9bea750
-# the 'run" command takes arguments at the end,
9bea750
-# so --manifest-path must not be last
9bea750
-CMD="$1"
9bea750
-shift
9bea750
-cargo "$CMD" --manifest-path "$CARGO_TARGET_DIR"/Cargo.toml "$@"
9bea750
+cargo "$@"
80357c2
 
9bea750
diff --git a/meson.build b/meson.build
9bea750
index 559bb30..12cb612 100644
9bea750
--- a/meson.build
9bea750
+++ b/meson.build
9bea750
@@ -61,32 +61,6 @@ summary = [
9bea750
 ]
9bea750
 message('\n'.join(summary))
80357c2
 
9bea750
-# Rust deps are changing, depending on compile flags. Cargo can't handle it alone.
9bea750
-cargo_toml_in = files('Cargo.toml.in')
9bea750
-path_data = configuration_data()
9bea750
-path_data.set('path', meson.source_root())
9bea750
-cargo_toml_base = configure_file(
9bea750
-    input: 'Cargo.toml.in',
9bea750
-    output: 'Cargo.toml.base',
9bea750
-    configuration: path_data,
9bea750
-)
9bea750
-
9bea750
-
9bea750
-cargo_deps = files('Cargo.deps')
9bea750
-
9bea750
-if get_option('legacy') == true
9bea750
-    cargo_build_flags += ['--features', 'gtk_v0_5,gio_v0_5']
9bea750
-    cargo_deps = files('Cargo.deps.legacy')
9bea750
-endif
9bea750
-    
9bea750
-cat = find_program('cat')
9bea750
-cargo_toml = custom_target(
9bea750
-    'Cargo.toml',
9bea750
-    output: 'Cargo.toml',
9bea750
-    command: [cat, cargo_toml_base, cargo_deps],
9bea750
-    capture: true,
9bea750
-)
9bea750
-
9bea750
 dep_cargo = find_program('cargo')
9bea750
 cargo_script = find_program('cargo.sh')
9bea750
 cargo_build = find_program('cargo_build.sh')
8961911
diff --git a/src/layout.rs b/src/layout.rs
9bea750
index 41515bc..b1cae8e 100644
8961911
--- a/src/layout.rs
8961911
+++ b/src/layout.rs
9bea750
@@ -107,8 +107,8 @@ pub mod c {
8961911
 
8961911
     impl Bounds {
8961911
         pub fn contains(&self, point: &Point) -> bool {
8961911
-            (point.x > self.x && point.x < self.x + self.width
8961911
-                && point.y > self.y && point.y < self.y + self.height)
8961911
+            point.x > self.x && point.x < self.x + self.width
8961911
+                && point.y > self.y && point.y < self.y + self.height
8961911
         }
8961911
     }
8961911
 
9bea750
diff --git a/src/meson.build b/src/meson.build
9bea750
index 0106381..31bda17 100644
9bea750
--- a/src/meson.build
9bea750
+++ b/src/meson.build
9bea750
@@ -56,8 +56,7 @@ rslibs = custom_target(
9bea750
     output: ['librs.a'],
9bea750
     install: false,
9bea750
     console: true,
9bea750
-    command: [cargo_build] + ['@OUTPUT@', '--lib'] + cargo_build_flags,
9bea750
-    depends: cargo_toml,
9bea750
+    command: [cargo_build] + ['@OUTPUT@', '--lib'] + cargo_build_flags
9bea750
 )
9bea750
 
9bea750
 build_rstests = custom_target(
9bea750
@@ -72,7 +71,7 @@ build_rstests = custom_target(
9bea750
     install: false,
9bea750
     console: true,
9bea750
     command: [cargo_script, 'test', '--no-run'] + cargo_build_flags,
9bea750
-    depends: [rslibs, cargo_toml], # no point building tests if the code itself fails
9bea750
+    depends: rslibs # no point building tests if the code itself fails
9bea750
 )
9bea750
 
9bea750
 test(
9bea750
@@ -81,7 +80,7 @@ test(
9bea750
     args: ['test'] + cargo_build_flags,
9bea750
     # this is a whole Carg-based test suite, let it run for a while
9bea750
     timeout: 900,
9bea750
-    depends: [build_rstests, cargo_toml],
9bea750
+    depends: build_rstests,
9bea750
 )
9bea750
 
9bea750
 libsqueekboard = static_library('libsqueekboard',
80357c2
diff --git a/src/popover.rs b/src/popover.rs
9bea750
index 65551a2..4077b8a 100644
80357c2
--- a/src/popover.rs
80357c2
+++ b/src/popover.rs
9bea750
@@ -14,12 +14,9 @@ use ::resources;
9bea750
 // Traits
80357c2
 use gio::ActionMapExt;
80357c2
 use gio::SettingsExt;
9bea750
-#[cfg(feature = "gio_v0_5")]
80357c2
-use gio::SimpleActionExt;
80357c2
+use gtk::prelude::BuilderExtManual;
80357c2
 use glib::translate::FromGlibPtrNone;
80357c2
 use glib::variant::ToVariant;
9bea750
-#[cfg(not(feature = "gtk_v0_5"))]
9bea750
-use gtk::BuilderExtManual;
80357c2
 use gtk::PopoverExt;
9bea750
 use gtk::WidgetExt;
9bea750
 use std::io::Write;
9bea750
@@ -131,7 +128,7 @@ fn make_menu_builder(inputs: Vec<(&str, OwnedTranslation)>) -> gtk::Builder {
d3e167b
   </menu>
d3e167b
 </interface>"
d3e167b
     ).unwrap();
d3e167b
-    gtk::Builder::new_from_string(
d3e167b
+    gtk::Builder::from_string(
d3e167b
         &String::from_utf8(xml).expect("Bad menu definition")
d3e167b
     )
d3e167b
 }
9bea750
@@ -158,7 +155,7 @@ fn get_settings(schema_name: &str) -> Option<gio::Settings> {
80357c2
 fn set_layout(kind: String, name: String) {
8961911
     let settings = get_settings("org.gnome.desktop.input-sources");
8961911
     if let Some(settings) = settings {
8961911
-        let inputs = settings.get_value("sources").unwrap();
9bea750
+    	let inputs = settings.get_value("sources");
8961911
         let current = (kind.clone(), name.clone());
8961911
         let inputs = variants::get_tuples(inputs).into_iter()
8961911
             .filter(|t| t != ¤t;;
9bea750
@@ -312,7 +309,7 @@ pub fn show(
8961911
     let settings = get_settings("org.gnome.desktop.input-sources");
8961911
     let inputs = settings
8961911
         .map(|settings| {
8961911
-            let inputs = settings.get_value("sources").unwrap();
8961911
+            let inputs = settings.get_value("sources");
8961911
             variants::get_tuples(inputs)
8961911
         })
8961911
         .unwrap_or_else(|| Vec::new());
9bea750
@@ -365,7 +362,7 @@ pub fn show(
d3e167b
     // than add items imperatively
d3e167b
     let model: gio::MenuModel = builder.get_object("app-menu").unwrap();
d3e167b
 
d3e167b
-    let menu = gtk::Popover::new_from_model(Some(&window), &model);
d3e167b
+    let menu = gtk::Popover::from_model(Some(&window), &model);
d3e167b
     menu.set_pointing_to(&gtk::Rectangle {
d3e167b
         x: position.x.ceil() as i32,
d3e167b
         y: position.y.ceil() as i32,
80357c2
diff --git a/src/style.rs b/src/style.rs
9bea750
index 153431a..2d7d539 100644
80357c2
--- a/src/style.rs
80357c2
+++ b/src/style.rs
80357c2
@@ -99,13 +99,13 @@ fn get_theme_name(settings: &gtk::Settings) -> GtkTheme {
80357c2
             name: {
80357c2
                 settings.get_property("gtk-theme-name")
80357c2
                     .or_print(logging::Problem::Surprise, "No theme name")
80357c2
-                    .and_then(|value| value.get::<String>())
80357c2
+                    .and_then(|value| value.get::<String>().unwrap())
80357c2
                     .unwrap_or(DEFAULT_THEME_NAME.into())
80357c2
             },
80357c2
             variant: {
80357c2
                 settings.get_property("gtk-application-prefer-dark-theme")
80357c2
                     .or_print(logging::Problem::Surprise, "No settings key")
80357c2
-                    .and_then(|value| value.get::<bool>())
80357c2
+                    .and_then(|value| value.get::<bool>().unwrap())
80357c2
                     .and_then(|dark_preferred| match dark_preferred {
80357c2
                         true => Some("dark".into()),
80357c2
                         false => None,
9bea750
diff --git a/tools/meson.build b/tools/meson.build
9bea750
index 75a7e17..cc8b83b 100644
9bea750
--- a/tools/meson.build
9bea750
+++ b/tools/meson.build
9bea750
@@ -15,6 +15,5 @@ test_layout = custom_target('squeekboard-test-layout',
9bea750
     command: [cargo_build, '--rename', 'test_layout', '@OUTPUT@', '--bin', 'test_layout']
9bea750
         + cargo_build_flags,
9bea750
     install: true,
9bea750
-    install_dir: bindir,
9bea750
-    depends: cargo_toml,
9bea750
+    install_dir: bindir
9bea750
 )