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

2
src/package.cpp

@ -20,7 +20,7 @@
#include "util/shell.h"
#include "util/system.h"
Package::Package()
Package::Package(s)
{
}

6
src/package.h

@ -11,9 +11,11 @@
#include <string>
#include <vector>
class Package {
#include "util/singleton.h"
class Package : public Util::Singleton<Package> {
public:
Package();
Package(s);
virtual ~Package();
enum class Distro {

Loading…
Cancel
Save