[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:14:56 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=dd7ad05
The following commit has been merged in the master branch:
commit dd7ad05c9e41ef61c2816cf8c4ddca43ec51be1c
Author: Aleix Pol <aleixpol at kde.org>
Date: Tue Oct 21 16:49:46 2014 +0200
Port the main.cpp to KF5 idioms
Also remove the unneeded ContactListApplication, and use QCoreApplication
directly.
---
CMakeLists.txt | 2 +-
contact-list-application.cpp | 38 -------------------------------------
contact-list-application.h | 41 ----------------------------------------
main-widget.cpp | 4 +---
main.cpp | 45 +++++++++++++++++++++++++-------------------
5 files changed, 28 insertions(+), 102 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 984ed60..17b21ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,7 +34,6 @@ set (ktp_contactlist_SRCS
contact-list-widget.cpp
context-menu.cpp
abstract-contact-delegate.cpp
- contact-list-application.cpp
contact-view-hover-button.cpp
contact-overlays.cpp
contact-delegate-overlay.cpp
@@ -77,6 +76,7 @@ target_link_libraries (ktp-contactlist ${ktp_contactlist_LIBS}
KF5::KIOWidgets
KF5::KCMUtils
KF5::NotifyConfig
+ KF5::DBusAddons
KF5::KDELibs4Support
KTp::Models
KTp::Widgets
diff --git a/contact-list-application.cpp b/contact-list-application.cpp
deleted file mode 100644
index 8b2a8e0..0000000
--- a/contact-list-application.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Contact List Application
- *
- * Copyright (C) 2011 David Edmundson <kde at davidedmundson.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 "contact-list-application.h"
-
-ContactListApplication::ContactListApplication() :
- KUniqueApplication(),
- m_isShuttingDown(false)
-{
-}
-
-void ContactListApplication::commitData(QSessionManager &sm)
-{
- m_isShuttingDown = true;
- KUniqueApplication::commitData(sm);
-}
-
-bool ContactListApplication::isShuttingDown() const
-{
- return m_isShuttingDown;
-}
diff --git a/contact-list-application.h b/contact-list-application.h
deleted file mode 100644
index a514cd6..0000000
--- a/contact-list-application.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Contact List Application
- *
- * Copyright (C) 2011 David Edmundson <kde at davidedmundson.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
- */
-
-#ifndef CONTACTLISTAPPLICATION_H
-#define CONTACTLISTAPPLICATION_H
-
-#include <KUniqueApplication>
-
-class ContactListApplication : public KUniqueApplication
-{
- Q_OBJECT
-public:
- explicit ContactListApplication();
- virtual void commitData(QSessionManager &sm);
-
- /** Returns true if the application is starting to shut down, if set no warning dialogs should be shown to the user*/
- bool isShuttingDown() const;
-
-private:
- bool m_isShuttingDown;
-
-};
-
-#endif // CONTACTLISTAPPLICATION_H
diff --git a/main-widget.cpp b/main-widget.cpp
index 6c00c70..491f05a 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -73,7 +73,6 @@
#include "ui_main-widget.h"
#include "account-buttons-panel.h"
-#include "contact-list-application.h"
#include "tooltips/tooltipmanager.h"
#include "context-menu.h"
#include "filter-bar.h"
@@ -298,8 +297,7 @@ void MainWidget::closeEvent(QCloseEvent* e)
KConfigGroup notifyConigGroup(config, "Notification Messages");
KConfigGroup guiConfigGroup(config, "GUI");
- ContactListApplication *app = qobject_cast<ContactListApplication*>(kapp);
- if (!app->isShuttingDown()) {
+ if (qApp->closingDown()) {
//the standard KMessageBox control saves "true" if you select the checkbox, therefore the reversed var name
bool dontCheckForPlasmoid = notifyConigGroup.readEntry("dont_check_for_plasmoid", false);
diff --git a/main.cpp b/main.cpp
index 0e4459f..5424ca6 100644
--- a/main.cpp
+++ b/main.cpp
@@ -21,40 +21,47 @@
#include "main-widget.h"
-#include <k4aboutdata.h>
-#include <KCmdLineArgs>
-#include <KDebug>
-#include <KUniqueApplication>
+#include <KAboutData>
+#include <KLocalizedString>
+#include <KDBusService>
#include <TelepathyQt/Types>
#include <TelepathyQt/Debug>
-#include "contact-list-application.h"
+#include <QApplication>
+#include <QCommandLineParser>
+
#include "version.h"
int main(int argc, char *argv[])
{
- K4AboutData aboutData("ktp-contactlist", 0, ki18n("KDE Telepathy Contact List"), KTP_CONTACT_LIST_VERSION,
- ki18n("KDE Telepathy Contact List"), K4AboutData::License_GPL,
- ki18n("(C) 2011, Martin Klapetek"));
+ QApplication app(argc, argv);
+ 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(ki18nc("@info:credit", "Martin Klapetek"), ki18n("Developer"),
+ aboutData.addAuthor(i18nc("@info:credit", "Martin Klapetek"), i18n("Developer"),
"martin.klapetek at gmail.com");
aboutData.setProductName("telepathy/contactlist"); //set the correct name for bug reporting
aboutData.setProgramIconName("telepathy-kde");
+ KAboutData::setApplicationData(aboutData);
- KCmdLineArgs::init(argc, argv, &aboutData);
-
- // Add --debug as commandline option
- KCmdLineOptions options;
- options.add("debug", ki18n("Show Telepathy debugging information"));
- KCmdLineArgs::addCmdLineOptions(options);
+ KDBusService service(KDBusService::Unique);
+ {
+ QCommandLineParser parser;
+ // Add --debug as commandline option
+ parser.addOption(QCommandLineOption("debug", i18n("Show Telepathy debugging information")));
- ContactListApplication app;
+ aboutData.setupCommandLine(&parser);
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.process(app);
+ aboutData.processCommandLine(&parser);
- Tp::registerTypes();
- Tp::enableDebug(KCmdLineArgs::parsedArgs()->isSet("debug"));
- Tp::enableWarnings(true);
+ Tp::registerTypes();
+ Tp::enableDebug(parser.isSet("debug"));
+ Tp::enableWarnings(true);
+ }
// Create the main widget and show it.
MainWidget *mainWidget = new MainWidget(0);
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list