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) {
|
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
@@ -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
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user