public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH setup 04/10] Make PrereqChecker::setTrust() a static method
Date: Tue, 23 May 2017 16:47:00 -0000	[thread overview]
Message-ID: <20170523164558.50320-5-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <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

  parent reply	other threads:[~2017-05-23 16:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23 16:46 [PATCH setup 00/10] Various setup patches Jon Turney
2017-05-23 16:47 ` [PATCH setup 06/10] Fold IniDBBuilderPackage::buildInstallSize() into buildPackageInstall() Jon Turney
2017-05-23 16:47 ` [PATCH setup 01/10] isBinary() should return true for orphaned packages Jon Turney
2017-05-23 16:47 ` [PATCH setup 03/10] Rename category "Misc" to "Orphaned" Jon Turney
2017-05-23 16:47 ` [PATCH setup 07/10] Fold build(Install|Source)(MD5|SHA512) into buildPackage(Install|Source) Jon Turney
2017-05-23 16:47 ` [PATCH setup 05/10] Move and rename dumpAndList() Jon Turney
2017-05-23 16:47 ` Jon Turney [this message]
2017-05-23 16:47 ` [PATCH setup 02/10] Correctly calculate total data to checksum when using IncludeSource Jon Turney
2017-05-23 16:59 ` [PATCH setup 08/10] Fix infinite recursion in grammar for depends Jon Turney
2017-05-23 16:59   ` [PATCH setup 09/10] Improve error recovery in setup.ini parsing Jon Turney
2017-05-23 16:59   ` [PATCH setup 10/10] Remove OR from grammar Jon Turney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170523164558.50320-5-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).