Manager: Convert package class to singleton

This commit is contained in:
Riyyi
2022-02-07 16:57:15 +01:00
parent 63d011d00a
commit e5cce5f3a9
3 changed files with 9 additions and 9 deletions
+4 -6
View File
@@ -83,19 +83,17 @@ int main(int argc, const char* argv[])
} }
} }
else if (packageOperation) { else if (packageOperation) {
Package package;
if (addOrAur) { if (addOrAur) {
package.aurInstall(); Package::the().aurInstall();
} }
if (install) { if (install) {
package.install(); Package::the().install();
} }
if (pushOrStore) { if (pushOrStore) {
package.store(); Package::the().store();
} }
if (!addOrAur && !install && !pushOrStore) { if (!addOrAur && !install && !pushOrStore) {
package.list(targets); Package::the().list(targets);
} }
} }
else if (helpOperation) { else if (helpOperation) {
+1 -1
View File
@@ -20,7 +20,7 @@
#include "util/shell.h" #include "util/shell.h"
#include "util/system.h" #include "util/system.h"
Package::Package() Package::Package(s)
{ {
} }
+4 -2
View File
@@ -11,9 +11,11 @@
#include <string> #include <string>
#include <vector> #include <vector>
class Package { #include "util/singleton.h"
class Package : public Util::Singleton<Package> {
public: public:
Package(); Package(s);
virtual ~Package(); virtual ~Package();
enum class Distro { enum class Distro {