[gnome-shell] Use Shell.get_file_contents_utf8_sync over GLib.file_get_contents
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Use Shell.get_file_contents_utf8_sync over GLib.file_get_contents
- Date: Thu, 19 May 2011 19:27:31 +0000 (UTC)
commit bfd344cdece5de6230ff611e3e1c66d90913dc47
Author: Colin Walters <walters verbum org>
Date: Wed May 11 14:19:24 2011 -0400
Use Shell.get_file_contents_utf8_sync over GLib.file_get_contents
We need to fix the latter to return a byte array, which gjs doesn't
deal with well right now.
https://bugzilla.gnome.org/show_bug.cgi?id=649981
js/ui/placeDisplay.js | 5 +----
js/ui/windowManager.js | 3 +--
2 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js
index 59ca4a6..9354247 100644
--- a/js/ui/placeDisplay.js
+++ b/js/ui/placeDisplay.js
@@ -268,10 +268,7 @@ PlacesManager.prototype = {
if (!GLib.file_test(this._bookmarksPath, GLib.FileTest.EXISTS))
return;
- let [success, bookmarksContent, len] = GLib.file_get_contents(this._bookmarksPath);
-
- if (!success)
- return;
+ let bookmarksContent = Shell.get_file_contents_utf8_sync(this._bookmarksPath);
let bookmarks = bookmarksContent.split('\n');
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index b113a1a..52a00da 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -22,8 +22,7 @@ function getDimShader() {
if (dimShader === null)
return null;
if (!dimShader) {
- let [success, source, length] = GLib.file_get_contents(global.datadir +
- '/shaders/dim-window.glsl');
+ let source = Shell.get_file_contents_utf8_sync(global.datadir + '/shaders/dim-window.glsl');
try {
let shader = new Clutter.Shader();
shader.set_fragment_source(source, -1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]