1
/* This file is part of GPump, a Pump.io client.
3
* GPump (THE SOFTWARE) is made available under the terms and conditions of the
4
* GNU Lesser General Public Licence 3.0. A copy of the licence can be read
5
* in the file lgpl-3.0.txt in the root of this project.
9
const Secret = imports.gi.Secret;
10
const Lang = imports.lang;
13
let _default_account_data_object = null;
16
* More information on what is going on here can be found here:
17
* https://developer.gnome.org/libsecret/unstable/js-examples.html
21
* Get the default AccountData object.
23
function get_account_data () {
24
if (!_default_account_data_object) {
25
_default_account_data_object = new AccountData ();
27
return _default_account_data_object;
31
* The libsecret schema.
33
const GPUMP_SECRET_SCHEMA = new Secret.Schema ({
34
name: "org.gego.gpump.tokens",
35
flags: Secret.SchemaFlags.NONE,
37
"NickName": Secret.SchemaAttributeType.STRING, // The nickname of the user
38
"Server": Secret.SchemaAttributeType.STRING, // The server
39
"DisplayName": Secret.SchemaAttributeType.STRING
44
* Class to hold the the account intformation.
46
* Do not create instances of this object, use the get_account_data function
49
const AccountData = Lang.Class ({