util: rename from utils, avoid RegExp literal

Rename imports.misc.utils to imports.misc.util for more consistency
(eg, with shell-util).

Also, use the string-based RegExp() constructor rather than a RegExp
literal, since the literal is extremely difficult to parse correctly,
and confuses emacs and probably other editors and thus messes up
autoindentation, etc.

https://bugzilla.gnome.org/show_bug.cgi?id=635089
This commit is contained in:
Dan Winship
2010-11-30 11:16:10 -05:00
parent 7322a4e4ef
commit a65a0f03d4
3 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ const Tweener = imports.ui.tweener;
const Main = imports.ui.main;
const BoxPointer = imports.ui.boxpointer;
const Params = imports.misc.params;
const Utils = imports.misc.utils;
const Util = imports.misc.util;
const Gettext = imports.gettext.domain('gnome-shell');
const _ = Gettext.gettext;
@ -138,13 +138,13 @@ URLHighlighter.prototype = {
this.actor.clutter_text.set_markup(text);
/* clutter_text.text contain text without markup */
this._urls = Utils.findUrls(this.actor.clutter_text.text);
this._urls = Util.findUrls(this.actor.clutter_text.text);
this._highlightUrls();
},
_highlightUrls: function() {
// text here contain markup
let urls = Utils.findUrls(this._text);
let urls = Util.findUrls(this._text);
let markup = '';
let pos = 0;
for (let i = 0; i < urls.length; i++) {