Manager: Convert package class to singleton
This commit is contained in:
+4
-6
@@ -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) {
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
#include "util/shell.h"
|
||||
#include "util/system.h"
|
||||
|
||||
Package::Package()
|
||||
Package::Package(s)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user