Define externally accessible contants with 'var' instead of 'const'

Just as we did with classes, define other constants that are (or
may be) used from other modules with 'var' to cut down on warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=785084
This commit is contained in:
Florian Müllner
2017-07-18 19:47:27 +02:00
parent 2582d16ca7
commit 033277b68f
70 changed files with 255 additions and 255 deletions

View File

@@ -1,19 +1,19 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* The name of this package (not localized) */
const PACKAGE_NAME = '@PACKAGE_NAME@';
var PACKAGE_NAME = '@PACKAGE_NAME@';
/* The version of this package */
const PACKAGE_VERSION = '@PACKAGE_VERSION@';
var PACKAGE_VERSION = '@PACKAGE_VERSION@';
/* 1 if gnome-bluetooth is available, 0 otherwise */
const HAVE_BLUETOOTH = @HAVE_BLUETOOTH@;
var HAVE_BLUETOOTH = @HAVE_BLUETOOTH@;
/* 1 if networkmanager is available, 0 otherwise */
const HAVE_NETWORKMANAGER = @HAVE_NETWORKMANAGER@;
var HAVE_NETWORKMANAGER = @HAVE_NETWORKMANAGER@;
/* gettext package */
const GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
var GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
/* locale dir */
const LOCALEDIR = '@datadir@/locale';
var LOCALEDIR = '@datadir@/locale';
/* other standard directories */
const LIBEXECDIR = '@libexecdir@';
const SYSCONFDIR = '@sysconfdir@';
var LIBEXECDIR = '@libexecdir@';
var SYSCONFDIR = '@sysconfdir@';
/* g-i package versions */
const LIBMUTTER_API_VERSION = '@LIBMUTTER_API_VERSION@'
var LIBMUTTER_API_VERSION = '@LIBMUTTER_API_VERSION@'

View File

@@ -11,13 +11,13 @@ const Gio = imports.gi.Gio;
const Config = imports.misc.config;
const FileUtils = imports.misc.fileUtils;
const ExtensionType = {
var ExtensionType = {
SYSTEM: 1,
PER_USER: 2
};
// Maps uuid -> metadata object
const extensions = {};
var extensions = {};
/**
* getCurrentExtension:

View File

@@ -16,7 +16,7 @@ const PresenceIface = '<node> \
</interface> \
</node>';
const PresenceStatus = {
var PresenceStatus = {
AVAILABLE: 0,
INVISIBLE: 1,
BUSY: 2,

View File

@@ -5,7 +5,7 @@ const Signals = imports.signals;
const Clutter = imports.gi.Clutter;
const Params = imports.misc.params;
const DEFAULT_LIMIT = 512;
var DEFAULT_LIMIT = 512;
var HistoryManager = new Lang.Class({
Name: 'HistoryManager',

View File

@@ -7,9 +7,9 @@ const Meta = imports.gi.Meta;
const Main = imports.ui.main;
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LAYOUT = 'us';
const DEFAULT_VARIANT = '';
var DEFAULT_LOCALE = 'en_US';
var DEFAULT_LAYOUT = 'us';
var DEFAULT_VARIANT = '';
let _xkbInfo = null;

View File

@@ -14,7 +14,7 @@ const Main = imports.ui.main;
const Tweener = imports.ui.tweener;
const Params = imports.misc.params;
const SCROLL_TIME = 0.1;
var SCROLL_TIME = 0.1;
// http://daringfireball.net/2010/07/improved_regex_for_matching_urls
const _balancedParens = '\\((?:[^\\s()<>]+|(?:\\(?:[^\\s()<>]+\\)))*\\)';

View File

@@ -11,7 +11,7 @@ const PermissionStore = imports.misc.permissionStore;
const Util = imports.misc.util;
// Minimum time between updates to show loading indication
const UPDATE_THRESHOLD = 10 * GLib.TIME_SPAN_MINUTE;
var UPDATE_THRESHOLD = 10 * GLib.TIME_SPAN_MINUTE;
var WeatherClient = new Lang.Class({
Name: 'WeatherClient',