aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJuhani Krekelä2021-10-23 00:33:18 +0300
committerWolfgang Müller2021-11-27 14:05:19 +0100
commit1b111d590d527d39f169ffcdb5c9f6a0488458f5 (patch)
treedda3bc213cd9f79762709b314d7ac058ba5dad53
parent71388f94c694a36b0ac360b34f09d7c16a51f803 (diff)
downloadweltschmerz-1b111d590d527d39f169ffcdb5c9f6a0488458f5.tar.gz
Make configuration object accessible outside of load_config
Currently the configuration object is located in the function level scope of load_config() and deleted once the function exits. Any flags that control the program behaviour must therefore be copied into separate variables, which pollutes the the upper level namespace. This change keeps the configuration object around after load_config() exits and makes it accessible by other functions from the shared namespace. An upcoming change needs this access.
-rw-r--r--terminal.vala3
1 files changed, 2 insertions, 1 deletions
diff --git a/terminal.vala b/terminal.vala
index 1005996..bb66715 100644
--- a/terminal.vala
+++ b/terminal.vala
@@ -38,6 +38,7 @@ class Terminal : Gtk.Overlay {
Gtk.Clipboard primary;
Gtk.Settings settings;
+ Config conf;
Gtk.MenuItem[] open_with_items = {};
Pid child_pid;
@@ -102,7 +103,7 @@ class Terminal : Gtk.Overlay {
}
public void load_config(bool reload) {
- var conf = new Config();
+ conf = new Config();
scrolled_window.set_policy(Gtk.PolicyType.NEVER, get_scrollbar_policy(conf.scrollbar));