mconnect - KDE Connect protocol implementation in Vala/C
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

  1. /* ex:ts=4:sw=4:sts=4:et */
  2. /* -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
  3. /**
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along
  14. * with this program; if not, write to the Free Software Foundation, Inc.,
  15. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  16. *
  17. * AUTHORS
  18. * Maciek Borzecki <maciek.borzecki (at] gmail.com>
  19. */
  20. using MConn;
  21. class Core : Object {
  22. public Crypt crypt { get; private set; default = null; }
  23. private static Core _instance = null;
  24. private Core(Crypt crypt) {
  25. debug("init core");
  26. this.crypt = crypt;
  27. }
  28. public static Core? instance() {
  29. if (Core._instance == null)
  30. {
  31. var crypt = new Crypt.for_key_path("private.pem");
  32. var core = new Core(crypt);
  33. Core._instance = core;
  34. }
  35. return Core._instance;
  36. }
  37. }