/gpump/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/gpump/trunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* This file is part of GPump, a Pump.io client.
 *
 * GPump (THE SOFTWARE) is made available under the terms and conditions of the
 * GNU Lesser General Public Licence 3.0. A copy of the licence can be read
 * in the file lgpl-3.0.txt in the root of this project.
 */


const Secret = imports.gi.Secret;
const Lang = imports.lang;


let _default_account_data_object = null;

/** @file
 * More information on what is going on here can be found here:
 * https://developer.gnome.org/libsecret/unstable/js-examples.html
 */

/** @function
 * Get the default AccountData object.
 */
function get_account_data () {
  if (!_default_account_data_object) {
    _default_account_data_object = new AccountData ();
  }
  return _default_account_data_object;
}

/**
 * The libsecret schema.
 */
const GPUMP_SECRET_SCHEMA = new Secret.Schema ({
  name: "org.gego.gpump.tokens",
  flags: Secret.SchemaFlags.NONE,
  attributes: {
      "NickName": Secret.SchemaAttributeType.STRING, // The nickname of the user
      "Server": Secret.SchemaAttributeType.STRING, // The server
      "DisplayName": Secret.SchemaAttributeType.STRING
    }
});

/** @class
 * Class to hold the the account intformation.
 *
 * Do not create instances of this object, use the get_account_data function
 * instad.
 */
const AccountData = Lang.Class ({
  Name: "AccountData",
  
  _init: function () {
    
    
  }
});