[SCM] ktp-common-internals packaging branch, master, updated. debian/16.04.2-1-111-g6e00b1c

Maximiliano Curia maxy at moszumanska.debian.org
Tue Sep 12 14:08:54 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=17b0f5e

The following commit has been merged in the master branch:
commit 17b0f5e4a7600487b9d92e766c6f1f44b8aa014a
Author: Alexandr Akulich <akulichalexander at gmail.com>
Date:   Wed Aug 31 21:30:00 2016 +0500

    [debugger] Cleanup and reformat, no any change of logic
    
    REVIEW: 128845
---
 tools/debugger/debug-message-view.cpp | 37 +++++++++++++----------------------
 tools/debugger/debug-message-view.h   | 14 +++++--------
 tools/debugger/main-window.h          |  1 +
 3 files changed, 20 insertions(+), 32 deletions(-)

diff --git a/tools/debugger/debug-message-view.cpp b/tools/debugger/debug-message-view.cpp
index af09715..ea09d79 100644
--- a/tools/debugger/debug-message-view.cpp
+++ b/tools/debugger/debug-message-view.cpp
@@ -25,13 +25,10 @@
 #include <QDebug>
 #include <QAction>
 #include <QFileDialog>
-#include <KColorScheme>
 #include <KStandardAction>
 #include <KLocalizedString>
-#include <KFindDialog>
 #include <KService>
 #include <KTextEditor/View>
-#include <kfind.h>
 #include <KTextEditor/Document>
 
 #include <ctime>
@@ -49,8 +46,7 @@ DebugMessageView::DebugMessageView(QWidget *parent)
     if (service) {
         m_editor = qobject_cast<KTextEditor::Document*>(service->createInstance<KParts::ReadWritePart>(this));
         Q_ASSERT(m_editor && "Failed to instantiate a KatePart");
-    }
-    else {
+    } else {
         qCritical() << "Could not find kate part";
     }
 
@@ -64,6 +60,17 @@ DebugMessageView::DebugMessageView(QWidget *parent)
     view->contextMenu()->addAction(KStandardAction::clear(this, SLOT(clear()), this));
 }
 
+DebugMessageView::~DebugMessageView()
+{
+    if (m_debugReceiver && m_ready) {
+        //disable monitoring and do it synchronously before all the objects are destroyed
+        Tp::PendingOperation *op = m_debugReceiver->setMonitoringEnabled(false);
+        QEventLoop loop;
+        connect(op, SIGNAL(finished(Tp::PendingOperation*)), &loop, SLOT(quit()));
+        loop.exec();
+    }
+}
+
 void DebugMessageView::clear()
 {
     m_editor->setReadWrite(true);
@@ -86,17 +93,6 @@ void DebugMessageView::addDelayedMessages()
     m_tmpCache.clear();
 }
 
-DebugMessageView::~DebugMessageView()
-{
-    if (m_debugReceiver && m_ready) {
-        //disable monitoring and do it synchronously before all the objects are destroyed
-        Tp::PendingOperation *op = m_debugReceiver->setMonitoringEnabled(false);
-        QEventLoop loop;
-        connect(op, SIGNAL(finished(Tp::PendingOperation*)), &loop, SLOT(quit()));
-        loop.exec();
-    }
-}
-
 void DebugMessageView::setService(const QString &service)
 {
     m_serviceName = service;
@@ -199,7 +195,6 @@ void DebugMessageView::onNewDebugMessage(const Tp::DebugMessage & msg)
     }
 }
 
-
 //taken from empathy
 static inline QString formatTimestamp(double timestamp)
 {
@@ -223,15 +218,14 @@ static inline QString formatTimestamp(double timestamp)
 
 void DebugMessageView::appendMessage(const Tp::DebugMessage &msg)
 {
-    if ( isVisible() ) {
+    if (isVisible()) {
         QString message = QString(formatTimestamp(msg.timestamp) %
                                 QLatin1Literal(" - [") % msg.domain % QLatin1Literal("] ") %
                                 msg.message);
         m_editor->setReadWrite(true);
         m_editor->insertText(m_editor->documentEnd(), message + QString::fromLatin1("
"));
         m_editor->setReadWrite(false);
-    }
-    else {
+    } else {
         m_tmpCache.append(msg);
     }
 }
@@ -241,6 +235,3 @@ void DebugMessageView::saveLogFile()
     QUrl savedFile = QUrl::fromUserInput(QFileDialog::getSaveFileName(this, i18nc("@title:window", "Save Log")));
     m_editor->saveAs(savedFile);
 }
-
-
-
diff --git a/tools/debugger/debug-message-view.h b/tools/debugger/debug-message-view.h
index 0bde707..ae745db 100644
--- a/tools/debugger/debug-message-view.h
+++ b/tools/debugger/debug-message-view.h
@@ -18,21 +18,20 @@
 #ifndef DEBUG_MESSAGES_MODEL_H
 #define DEBUG_MESSAGES_MODEL_H
 
-#include <QTextEdit>
+#include <QWidget>
 #include <TelepathyQt/Types>
 #include <TelepathyQt/PendingOperation>
-#include <kparts/part.h>
 #include <KTextEditor/Document>
 
-
 class DebugMessageView : public QWidget
 {
 Q_OBJECT
 public:
     explicit DebugMessageView(QWidget *parent = 0);
-    void setService(const QString & service);
     virtual ~DebugMessageView();
-    virtual void showEvent(QShowEvent* );
+
+    void setService(const QString & service);
+    virtual void showEvent(QShowEvent *event);
     void saveLogFile();
 
 private Q_SLOTS:
@@ -46,9 +45,6 @@ private Q_SLOTS:
     void addDelayedMessages();
     void clear();
 
-Q_SIGNALS:
-    void statusMessage(const QString& msg);
-
 private:
     void appendMessage(const Tp::DebugMessage &msg);
 
@@ -57,7 +53,7 @@ private:
     Tp::DebugMessageList m_tmpCache;
     QDBusServiceWatcher *m_serviceWatcher;
     bool m_ready;
-    KTextEditor::Document* m_editor;
+    KTextEditor::Document *m_editor;
 };
 
 #endif // DEBUG_MESSAGES_MODEL_H
diff --git a/tools/debugger/main-window.h b/tools/debugger/main-window.h
index 2e7c968..86eeaed 100644
--- a/tools/debugger/main-window.h
+++ b/tools/debugger/main-window.h
@@ -21,6 +21,7 @@
 #include "ui_main-window.h"
 
 #include <TelepathyQt/Types>
+#include <TelepathyQt/PendingOperation>
 
 #include <KXmlGuiWindow>
 

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list