This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH setup 04/10] Make PrereqChecker::setTrust() a static method
- From: Jon Turney <jon dot turney at dronecode dot org dot uk>
- To: cygwin-apps at cygwin dot com
- Cc: Jon Turney <jon dot turney at dronecode dot org dot uk>
- Date: Tue, 23 May 2017 17:45:52 +0100
- Subject: [PATCH setup 04/10] Make PrereqChecker::setTrust() a static method
- Authentication-results: sourceware.org; auth=none
- References: <20170523164558.50320-1-jon.turney@dronecode.org.uk>
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