]> pilppa.org Git - vcard-tracker-import.git/blob - src/main.cpp
initial commit
[vcard-tracker-import.git] / src / main.cpp
1 /*
2  * Copyright (c) 2011, Mika Laitio. <lamikr@pilppa.org>
3  *
4  * This program is licensed under the terms and conditions of the
5  * Apache License, version 2.0.  The full text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9
10 #include <QCoreApplication>
11 #include <QDebug>
12
13 #include "VCardDirectoryImporter.h"
14
15 int main(int argc, char *argv[])
16 {
17     int                     ret_val;
18     int                     err_flg;
19     QCoreApplication        application(argc, argv);
20     VCardDirectoryImporter  importer;
21
22     ret_val = EXIT_FAILURE;
23     if (application.arguments().count() >= 2) {
24         err_flg = importer.importVCardsDirectoryContacts(application.arguments().at(1));
25         if (err_flg == 0) {
26             importer.saveContacts();
27             ret_val = application.exec();
28         }
29     }
30     else {
31         qDebug() << "Error, directory containing v-card contact files (*.vcr) not specified.";
32         qDebug() << "Please, give the v-card directory as a first parameter for the application.";
33     }
34     return ret_val;
35 }