[Pkg-mozext-commits] [nosquint] 39/47: Do not open about:nosquint for bugfix releases

David Prévot taffit at moszumanska.debian.org
Tue Apr 28 01:41:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 2.1.6
in repository nosquint.

commit eec28b4b2fd3f36b39c3bdf8a5952ff5e78eabf1
Author: Jason Tackaberry <tack at urandom.ca>
Date:   Wed Jan 25 20:34:32 2012 -0500

    Do not open about:nosquint for bugfix releases
---
 src/content/prefs.js | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/content/prefs.js b/src/content/prefs.js
index e459e8a..005e5a5 100644
--- a/src/content/prefs.js
+++ b/src/content/prefs.js
@@ -832,13 +832,17 @@ NoSquint.prefs = NoSquint.ns(function() { with(NoSquint) {
                 }
             });
 
-            /* XXX: if we change this to > rather than !=, we need to be smarter than
-             * a simple lexographic comparison, because '2.1b1' > '2.1' which isn't
-             * expected behaviour.
-             */
-            if (addon.version != NSQ.prefs.lastVersion) {
-                if (!found)
-                    NSQ.browser.gBrowser.selectedTab = gBrowser.addTab('about:nosquint');
+             if (addon.version != NSQ.prefs.lastVersion) {
+                /* Compare only the first two components of the version string.
+                 * We don't open about:nosquint on bugfix releases to reduce
+                 * the spamminess of upgrades, which was a complaint by a few
+                 * users.
+                 */
+                cur_parts = addon.version.split('.');
+                last_parts = (NSQ.prefs.lastVersion || '0.0').split('.');
+                if (cur_parts[0] > last_parts[0] || (cur_parts[0] == last_parts[0] && cur_parts[1] > last_parts[1]))
+                    if (!found)
+                        NSQ.browser.gBrowser.selectedTab = gBrowser.addTab('about:nosquint');
                 branchNS.setCharPref('version', addon.version);
                 NoSquint.prefs.save();
             }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nosquint.git



More information about the Pkg-mozext-commits mailing list