Commit 44c11e10 authored by Lukas Appelhans's avatar Lukas Appelhans

Use our parameters

parent 325b52cc
......@@ -29,12 +29,16 @@ APM::APM(OperationType type, QList<Operation> operations, QMultiHash<Operation,
m_options(options),
m_args(args)
{
//QTimer::singleShot(0, AkabeiClient::Backend::instance(), SLOT(initialize()));
//QCoreApplication::instance()->quit();
//QTimer::singleShot(0, QCoreApplication::instance(), SLOT(quit()));
connect(AkabeiClient::Backend::instance(), SIGNAL(statusChanged(Akabei::Backend::Status)), SLOT(statusChanged(Akabei::Backend::Status)));
AkabeiClient::Backend::instance()->initialize();
QString root = options.value(APM::RootDir);
QString cache = options.value(APM::CacheDir);
QString dbs = options.value(APM::DBPath);
kDebug() << root << cache << dbs;
AkabeiClient::Backend::instance()->initialize(root, cache, dbs);
}
APM::~APM()
......
......@@ -29,7 +29,7 @@ int main(int argc, char** argv)
KCmdLineOptions options;
options.add("r");
//options.add("r");
options.add("root <path>", ki18n("Set a different root dir"));
options.add("b");
options.add("dbpath <path>", ki18n("Set a different database dir"));
......@@ -221,17 +221,14 @@ int main(int argc, char** argv)
fprintf(stderr, "Please select an operation to do!\nCall akabei --help for explanation.\n");
return app.exec();
}
QString root = args->getOption("r");
if (!root.isEmpty())
opts.insert(APM::RootDir, root);
QString root = args->getOption("root");
opts.insert(APM::RootDir, root);
QString dbs = args->getOption("b");
if (!dbs.isEmpty())
opts.insert(APM::DBPath, dbs);
opts.insert(APM::DBPath, dbs);
QString cache = args->getOption("cachedir");
if (!cache.isEmpty())
opts.insert(APM::CacheDir, cache);
opts.insert(APM::CacheDir, cache);
QStringList rest;
......
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