Commit 16e6e805 authored by Alexandre Franke's avatar Alexandre Franke

passwd: Improve handling of uninstalled schemas

parent a5ae75ab
Pipeline #14908 passed with stages
in 19 minutes and 47 seconds
......@@ -398,7 +398,7 @@ dependencies = [
"gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gettext-rs 0.3.0 (git+https://github.com/danigm/gettext-rs?branch=no-gettext)",
"gio 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gspell 0.1.0 (git+https://gitlab.gnome.org/jsparber/gspell-rs)",
"gtk 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -469,7 +469,7 @@ dependencies = [
"cairo-sys-rs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -483,7 +483,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -539,7 +539,7 @@ dependencies = [
[[package]]
name = "gio"
version = "0.4.0"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -605,7 +605,7 @@ dependencies = [
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -645,7 +645,7 @@ dependencies = [
"gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -2062,7 +2062,7 @@ dependencies = [
"checksum gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3162ff940526ddff71bf1f630facee6b5e05d282d125ba0c4c803842819b80c3"
"checksum gettext-rs 0.3.0 (git+https://github.com/danigm/gettext-rs?branch=no-gettext)" = "<none>"
"checksum gettext-sys 0.19.8 (git+https://github.com/danigm/gettext-rs?branch=no-gettext)" = "<none>"
"checksum gio 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "071fd4e5592b39fdc31318e32d2497842501f539bcedb60c75cd365946642adc"
"checksum gio 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2db9fad8f1b0d4c7338a210a6cbdf081dcc1a3c223718c698c4f313f6c288acb"
"checksum gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2a57872499171d279f8577ce83837da4cae62b08dd32892236ed67ab7ea61030"
"checksum glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e0be1b1432e227bcd1a9b28db9dc1474a7e7fd4227e08e16f35304f32d09b61"
"checksum glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "615bef979b5838526aee99241afc80cfb2e34a8735d4bcb8ec6072598c18a408"
......
......@@ -10,7 +10,7 @@ failure = "0.1.1"
gdk = "0.8.0"
gdk-pixbuf = "0.4.0"
gdk-pixbuf-sys = "0.6.0"
gio = "0.4.0"
gio = "0.4.1"
glib = "0.5.0"
notify-rust = "3.4.2"
pango = "0.4.0"
......
extern crate secret_service;
extern crate serde_json;
use gio::Settings;
use gio::{Settings, SettingsSchemaSource};
use gio::SettingsExt;
use std;
......@@ -24,15 +24,19 @@ enum PWDConf {
fn pwd_conf() -> PWDConf {
if Settings::list_schemas().iter().filter(|x| &x[..] == "org.gnome.Fractal").count() == 0 {
return PWDConf::SecretService;
}
let settings: Settings = Settings::new("org.gnome.Fractal");
match settings.get_enum("password-storage") {
1 => PWDConf::PlainText,
_ => PWDConf::SecretService,
if let Some(source) = SettingsSchemaSource::get_default() {
if let Some(_schema) = source.lookup("org.gnome.Fractal", true) {
let settings: Settings = Settings::new("org.gnome.Fractal");
match settings.get_enum("password-storage") {
1 => PWDConf::PlainText,
_ => PWDConf::SecretService,
}
} else {
PWDConf::SecretService
}
} else {
PWDConf::SecretService
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment