[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:25:10 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=aa1323b

The following commit has been merged in the master branch:
commit aa1323ba2eb178f8afa25b086638eeed14a3ab1a
Author: Martin Klapetek <mklapetek at kde.org>
Date:   Tue Jan 13 17:31:00 2015 +0100

    [logviewer] Port KCmdLineArgs and friends to QCommandLineParser ...and friends
---
 logviewer/entity-view.cpp | 15 ++++++++-------
 logviewer/main.cpp        | 43 +++++++++++++++++++++++++------------------
 2 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/logviewer/entity-view.cpp b/logviewer/entity-view.cpp
index e62f4c1..7efc8dd 100644
--- a/logviewer/entity-view.cpp
+++ b/logviewer/entity-view.cpp
@@ -19,12 +19,11 @@
 
 #include "entity-view.h"
 
-#include <KCmdLineArgs>
-
 #include <KTp/Logger/log-entity.h>
 #include <KTp/types.h>
 
 #include <QAbstractItemModel>
+#include <QCoreApplication>
 
 #include <TelepathyQt/Account>
 
@@ -56,8 +55,10 @@ void EntityView::rowsInserted(const QModelIndex &parent, int start, int end)
     }
 
     QModelIndex selectedIndex;
-    if (KCmdLineArgs::parsedArgs()->count() == 1 && KTp::kpeopleEnabled()) {
-        const QString selectedPersonaId = KCmdLineArgs::parsedArgs()->arg(0);
+    QCommandLineParser parser;
+
+    if (QCoreApplication::arguments().count() == 1 && KTp::kpeopleEnabled()) {
+        const QString selectedPersonaId = QCoreApplication::arguments().at(0);
         for (int i = start; i <= end; i++) {
             const QModelIndex index = model()->index(i, 0, parent);
             if (index.data(KTp::PersonIdRole).toUrl() == selectedPersonaId) {
@@ -65,9 +66,9 @@ void EntityView::rowsInserted(const QModelIndex &parent, int start, int end)
                 break;
             }
         }
-    } else if (KCmdLineArgs::parsedArgs()->count() == 2) {
-        QString selectAccountId = KCmdLineArgs::parsedArgs()->arg(0);
-        QString selectContactId = KCmdLineArgs::parsedArgs()->arg(1);
+    } else if (QCoreApplication::arguments().count() == 2) {
+        QString selectAccountId = QCoreApplication::arguments().at(0);
+        QString selectContactId = QCoreApplication::arguments().at(1);
 
         for (int i = start; i <= end; i++) {
             QModelIndex index = model()->index(i, 0, parent);
diff --git a/logviewer/main.cpp b/logviewer/main.cpp
index 5af1e0f..03790d8 100644
--- a/logviewer/main.cpp
+++ b/logviewer/main.cpp
@@ -17,9 +17,11 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-#include <KUniqueApplication>
-#include <KCmdLineArgs>
-#include <k4aboutdata.h>
+#include <QApplication>
+#include <QCommandLineParser>
+
+#include <KAboutData>
+#include <KLocalizedString>
 
 #include "log-viewer.h"
 #include "../ktptextui_version.h"
@@ -33,26 +35,31 @@ Q_LOGGING_CATEGORY(KTP_LOGVIEWER, "ktp-logviewer")
 
 int main(int argc, char *argv[])
 {
-    K4AboutData aboutData("ktp-log-viewer",
-                         0,
-                         ki18n("KDE IM Log Viewer"),
-                         KTP_TEXT_UI_VERSION_STRING);
-    aboutData.addAuthor(ki18n("David Edmundson"), ki18n("Developer"), "kde at davidedmundson.co.uk");
-    aboutData.addAuthor(ki18n("Daniele E. Domenichelli"), ki18n("Developer"), "daniele.domenichelli at gmail.com");
-    aboutData.addAuthor(ki18n("Dan Vrátil"), ki18n("Developer"), "dvratil at redhat.com");
+    QApplication app(argc, argv);
+
+    KAboutData aboutData("ktp-log-viewer",
+                         i18n("KDE IM Log Viewer"),
+                         QStringLiteral(KTP_TEXT_UI_VERSION_STRING));
+    aboutData.addAuthor(i18n("David Edmundson"), i18n("Developer"), "kde at davidedmundson.co.uk");
+    aboutData.addAuthor(i18n("Daniele E. Domenichelli"), i18n("Developer"), "daniele.domenichelli at gmail.com");
+    aboutData.addAuthor(i18n("Dan Vrátil"), i18n("Developer"), "dvratil at redhat.com");
     aboutData.setProductName("telepathy/log-viewer"); //set the correct name for bug reporting
-    aboutData.setProgramIconName(QLatin1String("documentation"));
-    aboutData.setLicense(K4AboutData::License_GPL_V2);
+    aboutData.setLicense(KAboutLicense::GPL_V2);
+
+    KAboutData::setApplicationData(aboutData);
+    QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("documentation")));
 
-    KCmdLineArgs::init(argc, argv, &aboutData);
+    QCommandLineParser parser;
+    parser.addHelpOption();
+    parser.addVersionOption();
 
-    KCmdLineOptions options;
-    options.add("+accountID", ki18n("The UID of the account to preselect"));
-    options.add("+contactID", ki18n("The UID of the contact to preselect"));
+    QCommandLineOption accountId(QStringLiteral("accountID"), i18n("The UID of the account to preselect"));
+    QCommandLineOption contactId(QStringLiteral("contactID"), i18n("The UID of the contact to preselect"));
 
-    KCmdLineArgs::addCmdLineOptions(options);
+    parser.addOption(accountId);
+    parser.addOption(contactId);
 
-    KApplication app;
+    parser.process(app);
 
     Tp::registerTypes();
 

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list