[gnome-shell] Make <AppSystem>.load_from_desktop_file() raise an exception again
- From: Siegfried-Angel Gevatter Pujals <sgevatter src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-shell] Make <AppSystem>.load_from_desktop_file() raise an exception again
- Date: Sun, 9 Aug 2009 16:33:36 +0000 (UTC)
commit 185ccecec1844ccf9afd9574f2b2abe463789d8b
Author: Siegfried-Angel Gevatter Pujals <rainct ubuntu com>
Date: Sun Aug 9 18:32:22 2009 +0200
Make <AppSystem>.load_from_desktop_file() raise an exception again
Pass the error variable to g_key_file_load_from_data_dirs in
Shell.AppSystem.get_default().load_from_desktop_file again, and
use a try/catch in places.js.
js/ui/places.js | 8 +++++++-
src/shell-app-system.c | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/places.js b/js/ui/places.js
index a5f814d..dc6400c 100644
--- a/js/ui/places.js
+++ b/js/ui/places.js
@@ -65,7 +65,13 @@ Places.prototype = {
this._menuBox.append(home.actor, Big.BoxPackFlags.NONE);
- let networkApp = Shell.AppSystem.get_default().load_from_desktop_file('gnome-network-scheme.desktop');
+ let networkApp = null;
+ try {
+ networkApp = Shell.AppSystem.get_default().load_from_desktop_file('gnome-network-scheme.desktop');
+ } catch(e) {
+ log("Cannot create \"Network\" item: " + e);
+ }
+
if (networkApp != null) {
let networkIcon = networkApp.create_icon_texture(PLACES_ICON_SIZE);
let network = new PlaceDisplay(networkApp.get_name(), networkIcon, Lang.bind(this, function () {
diff --git a/src/shell-app-system.c b/src/shell-app-system.c
index 2cabeb5..dc2f53b 100644
--- a/src/shell-app-system.c
+++ b/src/shell-app-system.c
@@ -652,7 +652,7 @@ shell_app_system_load_from_desktop_file (ShellAppSystem *system,
{
char *app_path = g_build_filename ("applications", filename, NULL);
success = g_key_file_load_from_data_dirs (keyfile, app_path, &full_path,
- G_KEY_FILE_NONE, NULL);
+ G_KEY_FILE_NONE, error);
g_free (app_path);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]