[PATCH setup 04/10] Make PrereqChecker::setTrust() a static method
Jon Turney
jon.turney@dronecode.org.uk
Tue May 23 16:47:00 GMT 2017
Rather than instantiating PrereqChecker just to call an accessor method
which changes a static data member, make that method static as well.
---
choose.cc | 3 +--
prereq.h | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/choose.cc b/choose.cc
index 4ac5aae..1bc4c0b 100644
--- a/choose.cc
+++ b/choose.cc
@@ -373,8 +373,7 @@ ChooserPage::changeTrust(trusts aTrust)
SetBusy ();
chooser->defaultTrust (aTrust);
chooser->refresh();
- PrereqChecker p;
- p.setTrust (aTrust);
+ PrereqChecker::setTrust (aTrust);
ClearBusy ();
}
diff --git a/prereq.h b/prereq.h
index 2aed63a..163af6e 100644
--- a/prereq.h
+++ b/prereq.h
@@ -45,7 +45,7 @@ public:
void selectMissing ();
// notes the current trust (for use in selectMissing)
- void setTrust (trusts t) { theTrust = t; };
+ static void setTrust (trusts t) { theTrust = t; };
private:
--
2.12.3
More information about the Cygwin-apps
mailing list