This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH setup 04/10] Make PrereqChecker::setTrust() a static method


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]