Commit 41ddf217 authored by Lukas Appelhans's avatar Lukas Appelhans

More small changes, nothing big yet

parent da13da89
...@@ -12,16 +12,14 @@ ...@@ -12,16 +12,14 @@
#include <kdebug.h> #include <kdebug.h>
#include <QStringList> #include <QStringList>
#include <QTextStream> #include <QTextStream>
#include <QCoreApplication>
#include <QTimer>
APM::APM(QObject * parent) APM::APM(OperationType type, QList<Operation> operations, QStringList args, QObject * parent)
: QObject(parent) : QObject(parent),
{ m_operationType(type),
} m_operations(operations),
m_args(args)
APM::~APM()
{}
void APM::start(OperationType type, QList<Operation> operations, QStringList args)
{ {
QTextStream out(stdout); QTextStream out(stdout);
//out << endl; //out << endl;
...@@ -31,6 +29,12 @@ void APM::start(OperationType type, QList<Operation> operations, QStringList arg ...@@ -31,6 +29,12 @@ void APM::start(OperationType type, QList<Operation> operations, QStringList arg
kDebug() << "Start"; kDebug() << "Start";
printf("Start\n"); printf("Start\n");
kDebug() << "Type" << type << "Operations" << operations << "Args" << args; kDebug() << "Type" << type << "Operations" << operations << "Args" << args;
//QTimer::singleShot(0, AkabeiClient::Backend::instance(), SLOT(initialize()));
//QCoreApplication::instance()->quit();
QTimer::singleShot(0, QCoreApplication::instance(), SLOT(quit()));
} }
APM::~APM()
{}
#include "apm.moc" #include "apm.moc"
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#define APM_H #define APM_H
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QStringList>
class APM : public QObject class APM : public QObject
{ {
...@@ -29,10 +30,13 @@ public: ...@@ -29,10 +30,13 @@ public:
UpdateDatabases = 1, UpdateDatabases = 1,
UpdateSystem = 2 UpdateSystem = 2
}; };
explicit APM(QObject* parent = 0); explicit APM(OperationType type, QList<Operation> operations, QStringList args, QObject* parent = 0);
virtual ~APM(); virtual ~APM();
void start(OperationType type, QList<Operation> operations, QStringList args); private:
OperationType m_operationType;
QList<Operation> m_operations;
QStringList m_args;
}; };
#endif //APM:H #endif //APM:H
...@@ -84,8 +84,7 @@ int main(int argc, char** argv) ...@@ -84,8 +84,7 @@ int main(int argc, char** argv)
args->clear(); // Free up some memory args->clear(); // Free up some memory
APM apm; APM apm(type, list, rest);
apm.start(type, list, rest);
/* // A binary option (on / off) /* // A binary option (on / off)
if (args->isSet("some-option")) if (args->isSet("some-option"))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment