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
This commit is contained in:
parent
a0fd4e195d
commit
bfd344cdec
@ -268,10 +268,7 @@ PlacesManager.prototype = {
|
|||||||
if (!GLib.file_test(this._bookmarksPath, GLib.FileTest.EXISTS))
|
if (!GLib.file_test(this._bookmarksPath, GLib.FileTest.EXISTS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let [success, bookmarksContent, len] = GLib.file_get_contents(this._bookmarksPath);
|
let bookmarksContent = Shell.get_file_contents_utf8_sync(this._bookmarksPath);
|
||||||
|
|
||||||
if (!success)
|
|
||||||
return;
|
|
||||||
|
|
||||||
let bookmarks = bookmarksContent.split('\n');
|
let bookmarks = bookmarksContent.split('\n');
|
||||||
|
|
||||||
|
@ -22,8 +22,7 @@ function getDimShader() {
|
|||||||
if (dimShader === null)
|
if (dimShader === null)
|
||||||
return null;
|
return null;
|
||||||
if (!dimShader) {
|
if (!dimShader) {
|
||||||
let [success, source, length] = GLib.file_get_contents(global.datadir +
|
let source = Shell.get_file_contents_utf8_sync(global.datadir + '/shaders/dim-window.glsl');
|
||||||
'/shaders/dim-window.glsl');
|
|
||||||
try {
|
try {
|
||||||
let shader = new Clutter.Shader();
|
let shader = new Clutter.Shader();
|
||||||
shader.set_fragment_source(source, -1);
|
shader.set_fragment_source(source, -1);
|
||||||
|
Loading…
Reference in New Issue
Block a user