public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin-apps@cygwin.com
Cc: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
Subject: [PATCH setup v3 6/6] Display area and location of mirrors, and add these to the sort key
Date: Wed, 06 Dec 2017 20:46:00 -0000	[thread overview]
Message-ID: <20171206204559.4756-7-kbrown@cornell.edu> (raw)
In-Reply-To: <20171206204559.4756-1-kbrown@cornell.edu>

From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>

Also change site_list_type::operator== to compare URLs rather than
keys, since the key no longer depends only on the URL.
---
 site.cc | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/site.cc b/site.cc
index 1dd42d8..72e8e80 100644
--- a/site.cc
+++ b/site.cc
@@ -187,8 +187,14 @@ site_list_type::site_list_type (const string &_url,
       idx = 0;
   } while (idx > 0);
   key += url;
-  /* Display the full URL (without trailing slash) of a non-mirror.  */
-  if (!from_mirrors_lst)
+  /* Display the area and location of a mirror; display the full URL
+     (without the trailing slash) of a non-mirror.  */
+  if (from_mirrors_lst)
+    {
+      displayed_url = area + " - " + location + " - " + displayed_url;
+      key = area + " " + location + " " + displayed_url;
+    }
+  else
     {
       displayed_url = url;
       displayed_url.erase (displayed_url.end () - 1);
@@ -222,7 +228,7 @@ site_list_type::operator= (site_list_type const &rhs)
 bool
 site_list_type::operator == (site_list_type const &rhs) const
 {
-  return stricmp (key.c_str(), rhs.key.c_str()) == 0; 
+  return stricmp (url.c_str(), rhs.url.c_str()) == 0;
 }
 
 bool
-- 
2.15.1

  parent reply	other threads:[~2017-12-06 20:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 20:46 [PATCH setup v3 0/6] Distinguish between user URLs and cygwin mirrors in UI Ken Brown
2017-12-06 20:46 ` [PATCH setup v3 3/6] Create new page UserSitePage for user URLs Ken Brown
2017-12-06 20:46 ` [PATCH setup v3 1/6] Use the IDD_SITE dialog for cygwin.com mirrors only Ken Brown
2017-12-06 20:46 ` [PATCH setup v3 4/6] Display full URLs in the user site list Ken Brown
2017-12-06 20:46 ` Ken Brown [this message]
2017-12-06 20:46 ` [PATCH setup v3 5/6] Keep the mirror list sorted properly Ken Brown
2017-12-06 20:46 ` [PATCH setup v3 2/6] Use SitePage for cygwin.com mirrors only Ken Brown
2017-12-06 21:08 ` [PATCH setup v3 0/6] Distinguish between user URLs and cygwin mirrors in UI Brian Inglis
2017-12-06 21:55   ` Ken Brown
2017-12-06 22:15     ` Brian Inglis
2017-12-07 13:55       ` Jon Turney
2017-12-07 15:08         ` Ken Brown
2017-12-07 19:08           ` Jon Turney
2017-12-07 20:15             ` Achim Gratz
2017-12-07 21:49             ` Ken Brown
2017-12-08 18:53               ` Achim Gratz

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=20171206204559.4756-7-kbrown@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=Brian.Inglis@SystematicSw.ab.ca \
    --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).