Browse Source

Manager: Convert package class to singleton

master
Riyyi 3 years ago
parent
commit
e5cce5f3a9
  1. 10
      src/main.cpp
  2. 2
      src/package.cpp
  3. 6
      src/package.h

10
src/main.cpp

@ -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) {

2
src/package.cpp

@ -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)
{ {
} }

6
src/package.h

@ -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 {

Loading…
Cancel
Save