Browse Source

b=598903, r=mgertner, Choosing a directory where to put the shortcut is broken due to a faulty return statement

matthew.gertner@gmail.com 14 years ago
parent
commit
f8d573b026
1 changed files with 8 additions and 3 deletions
  1. 8 3
      newapp/modules/arch/WinShortcutCreator.jsm

+ 8 - 3
newapp/modules/arch/WinShortcutCreator.jsm

@@ -25,6 +25,7 @@ var ShortcutCreator = {
     appIcon.append("default");
     appIcon.append(WebAppProperties.icon + ImageUtils.getNativeIconExtension());
 
+	var shortcut = null;
     var directory = null;
     for (var i=0; i<locations.length; i++)
     {
@@ -42,9 +43,13 @@ var ShortcutCreator = {
         continue;
       }
 
-      var shortcut = desktop.createShortcut(name, target, directory, extensionDir ? extensionDir.path : "", arguments, "", appIcon);
-      dump("Shortcut path: " + shortcut.path);
-      return shortcut;
+      shortcut = desktop.createShortcut(
+      	  name, target, directory, extensionDir ? extensionDir.path : "", 
+          arguments, "", appIcon);
     }
+    // Return one of the created shortcuts so that we can spawn the app when 
+    // everything's finished.
+    return shortcut;
   }
 };
+