sbMigrate12To13pre.js
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2009 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25 */
26 
27 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
28 Components.utils.import("resource://app/jsmodules/ArrayConverter.jsm");
29 Components.utils.import("resource://app/jsmodules/sbLocalDatabaseMigrationUtils.jsm");
30 Components.utils.import("resource://app/jsmodules/SBJobUtils.jsm");
31 
32 const Cc = Components.classes;
33 const Ci = Components.interfaces;
34 const Cr = Components.results;
35 
36 function LOG(s) {
37  dump("----++++----++++sbLibraryMigration " +
38  sbLibraryMigration.versionString + ": " +
39  s +
40  "\n----++++----++++\n");
41 }
42 
44 {
45  SBLocalDatabaseMigrationUtils.BaseMigrationHandler.call(this);
46 
47  this.fromVersion = 19;
48  this.toVersion = 20;
49  this.versionString = this.fromVersion + " to " +
50  this.toVersion;
51 }
52 
53 //-----------------------------------------------------------------------------
54 // sbLocalDatabaseMigration Implementation
55 //-----------------------------------------------------------------------------
56 
57 sbLibraryMigration.prototype = {
58  __proto__: SBLocalDatabaseMigrationUtils.BaseMigrationHandler.prototype,
59  classDescription: 'Songbird Migration Handler, version 19 to 20',
60  classID: Components.ID("{783f8680-5156-11de-8a39-0800200c9a66}"),
61  contractID: SBLocalDatabaseMigrationUtils.baseHandlerContractID + ' 19 to 20',
62 
63  migrate: function sbLibraryMigration_migrate(aLibrary) {
64  try{
65 
66  this._databaseGUID = aLibrary.databaseGuid;
67  this._databaseLocation = aLibrary.databaseLocation;
68 
69  // Run a query that will mark the library as migrated
70  var query = this.createMigrationQuery(aLibrary);
71  query.addQuery("commit");
72  var retval;
73  query.setAsyncQuery(false);
74  query.execute(retval);
75 
76  // Raise a flag indicating that this library will need all
77  // sort info to be recomputed.
78  // Normally we'd call propertyCache.invalidateSortData(), but
79  // at this point in startup the property cache does not exist yet.
80  var prefs = Cc["@mozilla.org/preferences-service;1"]
81  .getService(Ci.nsIPrefBranch);
82  prefs.setBoolPref("songbird.propertycache." +
83  this._databaseGUID + ".invalidSortData", true);
84  prefs.QueryInterface(Ci.nsIPrefService).savePrefFile(null);
85  }
86  catch (e) {
87  dump("Exception occured: " + e);
88  throw e;
89  }
90  }
91 };
92 
93 //-----------------------------------------------------------------------------
94 // Module
95 //-----------------------------------------------------------------------------
96 function NSGetModule(compMgr, fileSpec) {
97  return XPCOMUtils.generateModule([
99  ]);
100 }
101 
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
function LOG(s)
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
function sbLibraryMigration()
const Cc
const Ci
return null
Definition: FeedWriter.js:1143
var prefs
Definition: FeedWriter.js:1169
const Cr
sbDeviceFirmwareAutoCheckForUpdate prototype classID
function NSGetModule(compMgr, fileSpec)