Merge branch 'sbinix-master'

This commit is contained in:
Florian Bruhin 2015-03-18 20:44:21 +01:00
commit 330e03d382
3 changed files with 21 additions and 8 deletions

View File

@ -142,6 +142,7 @@ Contributors, sorted by the number of commits in descending order:
* Martin Zimmermann
* Error 800
* Brian Jackson
* sbinix
* Johannes Altmanninger
* Samir Benmendil
* Regina Hug

View File

@ -369,7 +369,10 @@ MAPPINGS = {
def init():
"""Initialize the global QWebSettings."""
QWebSettings.setIconDatabasePath(standarddir.cache())
if config.get('general', 'private-browsing'):
QWebSettings.setIconDatabasePath('')
else:
QWebSettings.setIconDatabasePath(standarddir.cache())
QWebSettings.setOfflineWebApplicationCachePath(
os.path.join(standarddir.cache(), 'application-cache'))
QWebSettings.globalSettings().setLocalStoragePath(
@ -391,9 +394,15 @@ def init():
def update_settings(section, option):
"""Update global settings when qwebsettings changed."""
try:
mapping = MAPPINGS[section][option]
except KeyError:
return
value = config.get(section, option)
mapping.set(value)
if (section, option) == ('general', 'private-browsing'):
if config.get('general', 'private-browsing'):
QWebSettings.setIconDatabasePath('')
else:
QWebSettings.setIconDatabasePath(standarddir.cache())
else:
try:
mapping = MAPPINGS[section][option]
except KeyError:
return
value = config.get(section, option)
mapping.set(value)

View File

@ -324,8 +324,11 @@ def generate_settings(filename):
def _get_authors():
"""Get a list of authors based on git commit logs."""
corrections = {'binix': 'sbinix'}
commits = subprocess.check_output(['git', 'log', '--format=%aN'])
cnt = collections.Counter(commits.decode('utf-8').splitlines())
authors = [corrections.get(author, author)
for author in commits.decode('utf-8').splitlines()]
cnt = collections.Counter(authors)
return sorted(cnt, key=lambda k: (cnt[k], k), reverse=True)