Skip to content

Commit

Permalink
Use GLib.Environment.get_{user,real}_name() to provide reasonable def…
Browse files Browse the repository at this point in the history
…aults (#198)
  • Loading branch information
avojak authored Dec 3, 2021
1 parent 844adb8 commit b8b2940
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,18 @@ public class Iridium.Application : Gtk.Application {
// If network is available, next `true` value for network availability will be a reconnection
is_first_network_availability = false;
}

update_default_preferences ();
}

private void update_default_preferences () {
// Update values that cannot be defined as constants in the schema
if (settings.get_string ("default-nickname") == "") {
settings.set_string ("default-nickname", GLib.Environment.get_user_name ());
}
if (settings.get_string ("default-realname") == "") {
settings.set_string ("default-realname", GLib.Environment.get_real_name ());
}
}

public static int main (string[] args) {
Expand Down

0 comments on commit b8b2940

Please sign in to comment.