From 289ddff1ad6882edcb7b36db139e46f13c2c8bda Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 14 Jun 2007 08:03:21 +0000 Subject: create ->is_modified and internalize in the raw_X object the handling of saying wether it is modified --- lib/Xconfig/main.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/Xconfig/main.pm') diff --git a/lib/Xconfig/main.pm b/lib/Xconfig/main.pm index 37a02c3..7fb9c8a 100644 --- a/lib/Xconfig/main.pm +++ b/lib/Xconfig/main.pm @@ -17,9 +17,9 @@ use common; sub configure_monitor { my ($in) = @_; - my ($raw_X, $before) = Xconfig::xfree->read_and_prepare_write; + my $raw_X = Xconfig::xfree->read; Xconfig::monitor::configure($in, $raw_X, int($raw_X->get_devices)) or return; - if ($raw_X->prepare_write ne $before) { + if ($raw_X->is_modified) { $raw_X->write; 'need_restart'; } else { @@ -30,7 +30,7 @@ sub configure_monitor { sub configure_resolution { my ($in) = @_; - my ($raw_X, $before) = Xconfig::xfree->read_and_prepare_write; + my $raw_X = Xconfig::xfree->read; my $X = { card => Xconfig::card::from_raw_X($raw_X), monitors => [ $raw_X->get_monitors ], @@ -40,7 +40,7 @@ sub configure_resolution { } $X->{resolutions} = Xconfig::resolution_and_depth::configure($in, $raw_X, $X->{card}, $X->{monitors}) or return; - if ($raw_X->prepare_write ne $before) { + if ($raw_X->is_modified) { &write($raw_X, $X); } else { ''; @@ -161,10 +161,9 @@ sub configure_chooser { monitors => [ $raw_X->get_monitors ], resolutions => [ eval { $raw_X->get_resolutions } ], }; - my $before = $raw_X->prepare_write; my ($ok) = configure_chooser_raw($in, $raw_X, $do_pkgs, $options, $X); - if ($raw_X->prepare_write ne $before) { + if ($raw_X->is_modified) { may_write($in, $raw_X, $X, $ok); } else { ''; -- cgit v1.2.1