File: main.cpp

package info (click to toggle)
ktp-contact-list 22.12.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,720 kB
  • sloc: cpp: 4,704; sh: 3; makefile: 2
file content (75 lines) | stat: -rw-r--r-- 2,601 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
 * This file is part of Telepathy Contact List
 *
 * Copyright (C) 2009-2010 Collabora Ltd. <info@collabora.co.uk>
 *   @Author George Goldberg <george.goldberg@collabora.co.uk>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include "main-widget.h"

#include <KAboutData>
#include <KLocalizedString>
#include <KDBusService>

#include <TelepathyQt/Types>
#include <TelepathyQt/Debug>

#include <QApplication>
#include <QCommandLineParser>

#include "version.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    KLocalizedString::setApplicationDomain("ktp-contactlist");

    KAboutData aboutData("ktpcontactlist", i18n("KDE Telepathy Contact List"), KTP_CONTACT_LIST_VERSION,
                         i18n("KDE Telepathy Contact List"), KAboutLicense::GPL,
                         i18n("(C) 2011, Martin Klapetek"));

    aboutData.addAuthor(i18nc("@info:credit", "Martin Klapetek"), i18n("Developer"),
                        "martin.klapetek@gmail.com");
    aboutData.setProductName("telepathy/contactlist"); //set the correct name for bug reporting
    QGuiApplication::setWindowIcon(QIcon::fromTheme("telepathy-kde"));
    KAboutData::setApplicationData(aboutData);

    KDBusService service(KDBusService::Unique);
    {
        QCommandLineParser parser;
        // Add --debug as commandline option
        parser.addOption(QCommandLineOption("debug", i18n("Show Telepathy debugging information")));

        aboutData.setupCommandLine(&parser);
        parser.addHelpOption();
        parser.addVersionOption();
        parser.process(app);
        aboutData.processCommandLine(&parser);

        Tp::registerTypes();
        Tp::enableDebug(parser.isSet("debug"));
        Tp::enableWarnings(true);
    }

    // Create the main widget and show it.
    MainWidget *mainWidget = new MainWidget(0);
    mainWidget->show();

    // Start event loop.
    app.exec();
}