From e5cce5f3a9464b51890944471d098b71ccfc0b16 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Mon, 7 Feb 2022 16:57:15 +0100 Subject: [PATCH] Manager: Convert package class to singleton --- src/main.cpp | 10 ++++------ src/package.cpp | 2 +- src/package.h | 6 ++++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0d16a01..81a9c31 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -83,19 +83,17 @@ int main(int argc, const char* argv[]) } } else if (packageOperation) { - Package package; - if (addOrAur) { - package.aurInstall(); + Package::the().aurInstall(); } if (install) { - package.install(); + Package::the().install(); } if (pushOrStore) { - package.store(); + Package::the().store(); } if (!addOrAur && !install && !pushOrStore) { - package.list(targets); + Package::the().list(targets); } } else if (helpOperation) { diff --git a/src/package.cpp b/src/package.cpp index b412cb1..029a81c 100644 --- a/src/package.cpp +++ b/src/package.cpp @@ -20,7 +20,7 @@ #include "util/shell.h" #include "util/system.h" -Package::Package() +Package::Package(s) { } diff --git a/src/package.h b/src/package.h index ff6ad90..de1fdbf 100644 --- a/src/package.h +++ b/src/package.h @@ -11,9 +11,11 @@ #include #include -class Package { +#include "util/singleton.h" + +class Package : public Util::Singleton { public: - Package(); + Package(s); virtual ~Package(); enum class Distro {