~darkxst/ubuntu/saucy/gnome-shell-extensions/lp1212408-fix

« back to all changes in this revision

Viewing changes to debian/patches/fix-places-without-class.patch

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-07-21 16:34:14 UTC
  • mfrom: (2.1.4 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130721163414-dhgqlw4fgyb82a20
Tags: 3.8.3.1-0ubuntu2
* debian/patches/fix-hibernate.patch:
  - Backport patch to fix checking whether hibernate is allowed (LP: #1191181)
* debian/patches/look-in-data-home-for-themes.patch:
  - Backport commit to also look in XDG_DATA_HOME (usually ~/.local/share/)
    for user themes
* debian/patches/fix-applications-menu-resolution-change.patch:
  - Backport commit to not break applications menu when screen resolution
    changes
* debian/patches/fix-places-without-class.patch:
  - Backport patch to handle volumes like MTP that don't have a 'class' ID

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 76713a74beba78223c7b2d07a5f8c16daf695081 Mon Sep 17 00:00:00 2001
 
2
From: Giovanni Campagna <gcampagna@src.gnome.org>
 
3
Date: Mon, 17 Jun 2013 19:36:56 +0000
 
4
Subject: places-menu: null-check g_volume_get_identifier()
 
5
 
 
6
Not all volumes have the 'class' identifier (for example MTP doesn't),
 
7
and we can't apply indexOf on null.
 
8
---
 
9
diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js
 
10
index 6d0625b..a501494 100644
 
11
--- a/extensions/places-menu/placeDisplay.js
 
12
+++ b/extensions/places-menu/placeDisplay.js
 
13
@@ -292,8 +292,9 @@ const PlacesManager = new Lang.Class({
 
14
             let volumes = drives[i].get_volumes();
 
15
 
 
16
             for(let j = 0; j < volumes.length; j++) {
 
17
-                if (volumes[j].get_identifier('class').indexOf('network') >= 0) {
 
18
-                    networkVolumes.push(volumes[i]);
 
19
+                let identifier = volumes[j].get_identifier('class');
 
20
+                if (identifier && identifier.indexOf('network') >= 0) {
 
21
+                    networkVolumes.push(volumes[j]);
 
22
                 } else {
 
23
                     let mount = volumes[j].get_mount();
 
24
                     if(mount != null)
 
25
@@ -308,7 +309,8 @@ const PlacesManager = new Lang.Class({
 
26
             if(volumes[i].get_drive() != null)
 
27
                 continue;
 
28
 
 
29
-            if (volumes[i].get_identifier('class').indexOf('network') >= 0) {
 
30
+            let identifier = volumes[i].get_identifier('class');
 
31
+            if (identifier && identifier.indexOf('network') >= 0) {
 
32
                 networkVolumes.push(volumes[i]);
 
33
             } else {
 
34
                 let mount = volumes[i].get_mount();
 
35