OSDN Git Service

kuassel: remove leftover logger code
authorIvailo Monev <xakepa10@gmail.com>
Tue, 27 Jan 2015 20:56:12 +0000 (20:56 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Tue, 27 Jan 2015 20:56:12 +0000 (20:56 +0000)
kuassel/src/client/client.cpp
kuassel/src/client/client.h
kuassel/src/core/abstractsqlstorage.cpp
kuassel/src/qtui/CMakeLists.txt
kuassel/src/qtui/debuglogwidget.cpp [deleted file]
kuassel/src/qtui/debuglogwidget.h [deleted file]
kuassel/src/qtui/mainwin.cpp
kuassel/src/qtui/mainwin.h
kuassel/src/qtui/qtuiapplication.cpp
kuassel/src/qtui/ui/debuglogwidget.ui [deleted file]

index 0da5e4a..c032b45 100644 (file)
@@ -108,8 +108,7 @@ Client::Client(QObject *parent)
     _messageProcessor(0),
     _coreAccountModel(new CoreAccountModel(this)),
     _coreConnection(new CoreConnection(this)),
-    _connected(false),
-    _debugLog(&_debugLogBuffer)
+    _connected(false)
 {
     _signalProxy->synchronize(_ircListHelper);
 }
@@ -644,48 +643,3 @@ void Client::markBufferAsRead(BufferId id)
     if (bufferSyncer() && id.isValid())
         bufferSyncer()->requestMarkBufferAsRead(id);
 }
-
-
-#if QT_VERSION < 0x050000
-void Client::logMessage(QtMsgType type, const char *msg)
-{
-    fprintf(stderr, "%s\n", msg);
-    fflush(stderr);
-    if (type == QtFatalMsg) {
-        Quassel::logFatalMessage(msg);
-    }
-    else {
-        QString msgString = QString("%1\n").arg(msg);
-
-        //Check to see if there is an instance around, else we risk recursions
-        //when calling instance() and creating new ones.
-        if (!instanceExists())
-            return;
-
-        instance()->_debugLog << msgString;
-        emit instance()->logUpdated(msgString);
-    }
-}
-#else
-void Client::logMessage(QtMsgType type, const QMessageLogContext &context, const QString &msg)
-{
-    Q_UNUSED(context);
-
-    fprintf(stderr, "%s\n", msg.toLocal8Bit().constData());
-    fflush(stderr);
-    if (type == QtFatalMsg) {
-        Quassel::logFatalMessage(msg.toLocal8Bit().constData());
-    }
-    else {
-        QString msgString = QString("%1\n").arg(msg);
-
-        //Check to see if there is an instance around, else we risk recursions
-        //when calling instance() and creating new ones.
-        if (!instanceExists())
-            return;
-
-        instance()->_debugLog << msgString;
-        emit instance()->logUpdated(msgString);
-    }
-}
-#endif
index d93c62b..9ea669e 100644 (file)
@@ -142,13 +142,6 @@ public:
     static void mergeBuffersPermanently(BufferId bufferId1, BufferId bufferId2);
     static void purgeKnownBufferIds();
 
-#if QT_VERSION < 0x050000
-    static void logMessage(QtMsgType type, const char *msg);
-#else
-    static void logMessage(QtMsgType, const QMessageLogContext&, const QString&);
-#endif
-    static inline const QString &debugLog() { return instance()->_debugLogBuffer; }
-
 signals:
     void requestNetworkStates();
 
@@ -257,9 +250,6 @@ private:
     bool _connected;
     static Quassel::Features _coreFeatures;
 
-    QString _debugLogBuffer;
-    QTextStream _debugLog;
-
     QList<QPair<BufferInfo, QString> > _userInputBuffer;
 
     friend class CoreConnection;
index 363c01e..1316c04 100644 (file)
@@ -105,8 +105,6 @@ Storage::State AbstractSqlStorage::init(const QVariantMap &settings)
 {
     setConnectionProperties(settings);
 
-    _debug = Quassel::isOptionSet("debug");
-
     QSqlDatabase db = logDb();
     if (!db.isValid() || !db.isOpen())
         return NotAvailable;
@@ -252,7 +250,7 @@ int AbstractSqlStorage::schemaVersion()
 bool AbstractSqlStorage::watchQuery(QSqlQuery &query)
 {
     bool queryError = query.lastError().isValid();
-    if (queryError || _debug) {
+    if (queryError) {
         if (queryError)
             qCritical() << "unhandled Error in QSqlQuery!";
         qCritical() << "                  last Query:\n" << qPrintable(query.lastQuery());
index 5865247..60d22f1 100644 (file)
@@ -23,7 +23,6 @@ set(SOURCES
     coreinfodlg.cpp
     debugbufferviewoverlay.cpp
     debugconsole.cpp
-    debuglogwidget.cpp
     debugmessagemodelfilter.cpp
     inputwidget.cpp
     ircconnectionwizard.cpp
@@ -64,7 +63,6 @@ set(FORMS
     coreinfodlg.ui
     debugbufferviewoverlay.ui
     debugconsole.ui
-    debuglogwidget.ui
     inputwidget.ui
     msgprocessorstatuswidget.ui
     nicklistwidget.ui
diff --git a/kuassel/src/qtui/debuglogwidget.cpp b/kuassel/src/qtui/debuglogwidget.cpp
deleted file mode 100644 (file)
index 6f7f6d8..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program 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 General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#include "debuglogwidget.h"
-
-#include "client.h"
-
-DebugLogWidget::DebugLogWidget(QWidget *parent)
-    : QWidget(parent)
-{
-    ui.setupUi(this);
-    setAttribute(Qt::WA_DeleteOnClose, true);
-    ui.textEdit->setPlainText(Client::debugLog());
-    connect(Client::instance(), SIGNAL(logUpdated(const QString &)), this, SLOT(logUpdated(const QString &)));
-    ui.textEdit->setReadOnly(true);
-}
-
-
-void DebugLogWidget::logUpdated(const QString &msg)
-{
-    ui.textEdit->moveCursor(QTextCursor::End);
-    ui.textEdit->insertPlainText(msg);
-    ui.textEdit->moveCursor(QTextCursor::End);
-}
diff --git a/kuassel/src/qtui/debuglogwidget.h b/kuassel/src/qtui/debuglogwidget.h
deleted file mode 100644 (file)
index 85e1a1c..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
- *   devel@quassel-irc.org                                                 *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
- *                                                                         *
- *   This program 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 General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
- ***************************************************************************/
-
-#ifndef DEBUGLOGWIDGET_H
-#define DEBUGLOGWIDGET_H
-
-#include "ui_debuglogwidget.h"
-
-class DebugLogWidget : public QWidget
-{
-    Q_OBJECT
-
-public:
-    DebugLogWidget(QWidget *parent = 0);
-
-private slots:
-    void logUpdated(const QString &msg);
-
-private:
-    Ui::DebugLogWidget ui;
-};
-
-
-#endif //DEBUGLOGWIDGET_H
index c1538fa..d8727b6 100644 (file)
@@ -71,7 +71,6 @@
 #include "coreinfodlg.h"
 #include "contextmenuactionprovider.h"
 #include "debugbufferviewoverlay.h"
-#include "debuglogwidget.h"
 #include "debugmessagemodelfilter.h"
 #include "flatproxymodel.h"
 #include "inputwidget.h"
@@ -332,11 +331,8 @@ void MainWin::setupActions()
             this, SLOT(on_actionDebugMessageModel_triggered())));
     coll->addAction("DebugHotList", new Action(KIcon("tools-report-bug"), i18n("Debug &HotList"), coll,
             this, SLOT(on_actionDebugHotList_triggered())));
-    coll->addAction("DebugLog", new Action(KIcon("tools-report-bug"), i18n("Debug &Log"), coll,
-            this, SLOT(on_actionDebugLog_triggered())));
     coll->addAction("ReloadStyle", new Action(KIcon("view-refresh"), i18n("Reload Stylesheet"), coll,
             QtUi::style(), SLOT(reload()), QKeySequence::Refresh));
-    
     coll->addAction("HideCurrentBuffer", new Action(i18n("Hide Current Buffer"), coll,
             this, SLOT(hideCurrentBuffer()), QKeySequence::Close));
 
@@ -460,7 +456,6 @@ void MainWin::setupMenus()
     _helpDebugMenu->addAction(coll->action("DebugBufferViewOverlay"));
     _helpDebugMenu->addAction(coll->action("DebugMessageModel"));
     _helpDebugMenu->addAction(coll->action("DebugHotList"));
-    _helpDebugMenu->addAction(coll->action("DebugLog"));
     _helpDebugMenu->addSeparator();
     _helpDebugMenu->addAction(coll->action("ReloadStyle"));
 
@@ -1563,13 +1558,6 @@ void MainWin::on_actionDebugMessageModel_triggered()
 }
 
 
-void MainWin::on_actionDebugLog_triggered()
-{
-    DebugLogWidget *logWidget = new DebugLogWidget(0);
-    logWidget->show();
-}
-
-
 void MainWin::showStatusBarMessage(const QString &message)
 {
     statusBar()->showMessage(message, 10000);
index 1acc9eb..7c58582 100644 (file)
@@ -133,7 +133,6 @@ private slots:
     void on_actionDebugBufferViewOverlay_triggered();
     void on_actionDebugMessageModel_triggered();
     void on_actionDebugHotList_triggered();
-    void on_actionDebugLog_triggered();
 
     void bindJumpKey();
     void onJumpKey();
index 7a8f867..674e0d0 100644 (file)
@@ -47,12 +47,6 @@ QtUiApplication::QtUiApplication(int &argc, char **argv)
 
     disableCrashhandler();
     setRunMode(Quassel::ClientOnly);
-
-#if QT_VERSION < 0x050000
-    qInstallMsgHandler(Client::logMessage);
-#else
-    qInstallMessageHandler(Client::logMessage);
-#endif
 }
 
 
diff --git a/kuassel/src/qtui/ui/debuglogwidget.ui b/kuassel/src/qtui/ui/debuglogwidget.ui
deleted file mode 100644 (file)
index fc853c5..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<ui version="4.0" >
- <class>DebugLogWidget</class>
- <widget class="QWidget" name="DebugLogWidget" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>Debug Log</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout" >
-   <property name="spacing" >
-    <number>0</number>
-   </property>
-   <property name="margin" >
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QTextEdit" name="textEdit" />
-   </item>
-   <item>
-    <layout class="QHBoxLayout" name="horizontalLayout" >
-     <item>
-      <spacer name="horizontalSpacer" >
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0" >
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="pushButton" >
-       <property name="text" >
-        <string>Close</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer_2" >
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0" >
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections>
-  <connection>
-   <sender>pushButton</sender>
-   <signal>clicked()</signal>
-   <receiver>DebugLogWidget</receiver>
-   <slot>close()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>217</x>
-     <y>284</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>179</x>
-     <y>-16</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>