[sushi/alex-changes: 8/11] Handle non-utf8 filenames/basenames correctly
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi/alex-changes: 8/11] Handle non-utf8 filenames/basenames correctly
- Date: Fri, 29 Apr 2011 14:27:46 +0000 (UTC)
commit 2a415f5baea6bc36eac87729a695b9e15ac1381f
Author: Alexander Larsson <alexl redhat com>
Date: Fri Apr 29 11:19:30 2011 +0200
Handle non-utf8 filenames/basenames correctly
src/js/viewers/folder.js | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/js/viewers/folder.js b/src/js/viewers/folder.js
index 58ad92d..8fb03cf 100644
--- a/src/js/viewers/folder.js
+++ b/src/js/viewers/folder.js
@@ -75,10 +75,16 @@ FolderRenderer.prototype = {
},
_applyLabels : function() {
- let titleStr =
- "<b><big>" +
- ((this._folderLoader.name) ? (this._folderLoader.name) : (this._folderLoader.file.get_basename()))
- + "</big></b>";
+ let name = this._folderLoader.name;
+ if (!name) {
+ try {
+ name = this._folderLoader.file.get_basename()
+ } catch (e) {
+ name = "";
+ }
+ }
+ let titleStr =
+ "<b><big>" + name + "</big></b>";
let sizeStr =
"<small><b>" + Gettext.gettext("Size") + " </b>" +
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]