Warning, file /network/ktp-contact-list/main.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  * This file is part of Telepathy Contact List
0003  *
0004  * Copyright (C) 2009-2010 Collabora Ltd. <info@collabora.co.uk>
0005  *   @Author George Goldberg <george.goldberg@collabora.co.uk>
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General Public
0018  * License along with this library; if not, write to the Free Software
0019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
0020  */
0021 
0022 #include "main-widget.h"
0023 
0024 #include <KAboutData>
0025 #include <KLocalizedString>
0026 #include <KDBusService>
0027 
0028 #include <TelepathyQt/Types>
0029 #include <TelepathyQt/Debug>
0030 
0031 #include <QApplication>
0032 #include <QCommandLineParser>
0033 
0034 #include "version.h"
0035 
0036 int main(int argc, char *argv[])
0037 {
0038     QApplication app(argc, argv);
0039     KLocalizedString::setApplicationDomain("ktp-contactlist");
0040 
0041     KAboutData aboutData("ktpcontactlist", i18n("KDE Telepathy Contact List"), KTP_CONTACT_LIST_VERSION,
0042                          i18n("KDE Telepathy Contact List"), KAboutLicense::GPL,
0043                          i18n("(C) 2011, Martin Klapetek"));
0044 
0045     aboutData.addAuthor(i18nc("@info:credit", "Martin Klapetek"), i18n("Developer"),
0046                         "martin.klapetek@gmail.com");
0047     aboutData.setProductName("telepathy/contactlist"); //set the correct name for bug reporting
0048     QGuiApplication::setWindowIcon(QIcon::fromTheme("telepathy-kde"));
0049     KAboutData::setApplicationData(aboutData);
0050 
0051     KDBusService service(KDBusService::Unique);
0052     {
0053         QCommandLineParser parser;
0054         // Add --debug as commandline option
0055         parser.addOption(QCommandLineOption("debug", i18n("Show Telepathy debugging information")));
0056 
0057         aboutData.setupCommandLine(&parser);
0058         parser.addHelpOption();
0059         parser.addVersionOption();
0060         parser.process(app);
0061         aboutData.processCommandLine(&parser);
0062 
0063         Tp::registerTypes();
0064         Tp::enableDebug(parser.isSet("debug"));
0065         Tp::enableWarnings(true);
0066     }
0067 
0068     // Create the main widget and show it.
0069     MainWidget *mainWidget = new MainWidget(0);
0070     mainWidget->show();
0071 
0072     // Start event loop.
0073     app.exec();
0074 }
0075