[sushi: 12/12] mainwindow: bind the query_info_async callback
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi: 12/12] mainwindow: bind the query_info_async callback
- Date: Fri, 29 Apr 2011 21:39:01 +0000 (UTC)
commit e017ad123e0320d2b2b60a0aeeaec57902a52ce0
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Fri Apr 29 17:26:35 2011 -0400
mainwindow: bind the query_info_async callback
src/js/ui/mainWindow.js | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 477ece2..68f91ba 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -459,16 +459,17 @@ MainWindow.prototype = {
_updateLabel : function(file) {
- file.query_info_async(Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, Gio.FileQueryInfoFlags.NONE, GLib.PRIORITY_DEFAULT, null,
- function (obj, res) {
- try {
- let info = obj.query_info_finish(res);
-
- if (info.has_attribute(Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME))
- this._titleLabel.set_label(info.get_attribute_string(Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME));
- } catch (e) {
- }
- });
+ file.query_info_async(Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+ Gio.FileQueryInfoFlags.NONE,
+ GLib.PRIORITY_DEFAULT, null,
+ Lang.bind (this,
+ function (obj, res) {
+ try {
+ let info = obj.query_info_finish(res);
+ this._titleLabel.set_label(info.get_display_name());
+ } catch (e) {
+ }
+ }));
},
/**************************************************************************
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]