2
// This file is part of the Marble Virtual Globe.
4
// This program is free software licensed under the GNU LGPL. You can
5
// find a copy of this license in LICENSE.txt in the top directory of
8
// Copyright 2011 Dennis Nienhüser <earthwings@gentoo.org>
11
#include "jobmanager.h"
15
#include <QtCore/QCoreApplication>
16
#include <QtCore/QDebug>
18
void usage(const QString &app)
20
qDebug() << "Usage: " << app << "[options] regions.xml log.sqlite [resume-id]";
21
qDebug() << "\nOptions:";
22
qDebug() << "\t-h, --help................. Show this help";
23
qDebug() << "\t-cd, --cache-data.......... Do not delete downloaded .osm.pbf and converted .tar.gz files after a successful conversion and upload";
24
qDebug() << "\t-nu, --no-uploads.......... Do not upload converted files to files.kde.org";
27
int main(int argc, char *argv[])
29
QCoreApplication app(argc, argv);
31
QStringList arguments;
32
bool cacheData(false);
33
bool uploadFiles(true);
34
for (int i=1; i<argc; ++i) {
35
QString const arg = argv[i];
36
if (arg == "-h" || arg == "--help") {
39
} else if (arg == "-cd" || arg == "--cache-data") {
41
} else if (arg == "-nu" || arg == "--no-uploads") {
48
if (arguments.size() < 2) {
53
Logger::instance().setFilename(arguments.at(1));
55
QFileInfo tempDir = QFileInfo(QDir::tempPath(), "osm-sisyphus");
56
JobParameters parameters;
57
parameters.setBase(QDir(tempDir.absoluteFilePath()));
58
parameters.setCacheData(cacheData);
60
Upload::instance().setJobParameters(parameters);
61
Upload::instance().setUploadFiles(uploadFiles);
64
manager.setRegionsFile(arguments.at(0));
65
manager.setJobParameters(parameters);
66
if (arguments.size() == 3) {
67
manager.setResumeId(arguments.at(2));