From: Janne Koschinski Date: Sun, 4 Aug 2019 20:46:26 +0000 (+0200) Subject: Remove debug console and QtScript, which was deprecated with Qt5 X-Git-Tag: test-travis-01~30 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=42d328e94a3bed8e6b0a32e7a234281e6d184325 Remove debug console and QtScript, which was deprecated with Qt5 - reduces dependencies, allows building quasselcore on most distros without pulling in X11 - removes unused code and dependencies, reduces size --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c3acc218..cd9f79d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,7 +169,7 @@ if (BUILD_GUI) list(APPEND qt_components Gui Widgets) endif() if (BUILD_CORE) - list(APPEND qt_components Script Sql) + list(APPEND qt_components Sql) endif() find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS ${qt_components}) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 230f370d..017bccfb 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -49,7 +49,6 @@ target_link_libraries(${TARGET} PUBLIC Qt5::Core Qt5::Network - Qt5::Script Qt5::Sql Quassel::Common ) diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index f4196b0a..961fcafe 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -22,8 +22,6 @@ #include -#include - #include "core.h" #include "corebacklogmanager.h" #include "corebuffersyncer.h" @@ -78,7 +76,6 @@ CoreSession::CoreSession(UserId uid, bool restoreState, bool strictIdentEnabled, , _sessionEventProcessor(new CoreSessionEventProcessor(this)) , _ctcpParser(new CtcpParser(this)) , _ircParser(new IrcParser(this)) - , scriptEngine(new QScriptEngine(this)) , _processMessages(false) , _ignoreListManager(this) , _highlightRuleManager(this) @@ -121,7 +118,6 @@ CoreSession::CoreSession(UserId uid, bool restoreState, bool strictIdentEnabled, _coreInfo->setCoreData(data); loadSettings(); - initScriptEngine(); eventManager()->registerObject(ircParser(), EventManager::NormalPriority); eventManager()->registerObject(sessionEventProcessor(), EventManager::HighPriority); // needs to process events *before* the stringifier! @@ -532,21 +528,6 @@ Protocol::SessionState CoreSession::sessionState() const return Protocol::SessionState(identities, bufferInfos, networkIds); } -void CoreSession::initScriptEngine() -{ - signalProxy()->attachSlot(SIGNAL(scriptRequest(QString)), this, &CoreSession::scriptRequest); - signalProxy()->attachSignal(this, &CoreSession::scriptResult); - - // FIXME - // QScriptValue storage_ = scriptEngine->newQObject(storage); - // scriptEngine->globalObject().setProperty("storage", storage_); -} - -void CoreSession::scriptRequest(QString script) -{ - emit scriptResult(scriptEngine->evaluate(script).toString()); -} - /*** Identity Handling ***/ void CoreSession::createIdentity(const Identity& identity, const QVariantMap& additional) { diff --git a/src/core/coresession.h b/src/core/coresession.h index cfa04e3f..3e08eacc 100644 --- a/src/core/coresession.h +++ b/src/core/coresession.h @@ -58,8 +58,6 @@ class SignalProxy; struct NetworkInfo; -class QScriptEngine; - class CoreSession : public QObject { Q_OBJECT @@ -173,8 +171,6 @@ signals: void displayMsg(Message message); void displayStatusMsg(QString, QString); - void scriptResult(QString result); - //! Identity has been created. /** This signal is propagated to the clients to tell them that the given identity has been created. * \param identity The new identity. @@ -206,8 +202,6 @@ private slots: void destroyNetwork(NetworkId); - void scriptRequest(QString script); - void clientsConnected(); void clientsDisconnected(); @@ -221,7 +215,6 @@ private: void processMessages(); void loadSettings(); - void initScriptEngine(); /// Hook for converting events to the old displayMsg() handlers Q_INVOKABLE void processMessageEvent(MessageEvent* event); @@ -253,8 +246,6 @@ private: CtcpParser* _ctcpParser; IrcParser* _ircParser; - QScriptEngine* scriptEngine; - /** * This method obtains the prefixes of the message's sender within a channel, by looking up their channelmodes, and * processing them to prefixes based on the network's settings. diff --git a/src/qtui/CMakeLists.txt b/src/qtui/CMakeLists.txt index eee27cb3..034d6c6e 100644 --- a/src/qtui/CMakeLists.txt +++ b/src/qtui/CMakeLists.txt @@ -24,7 +24,6 @@ target_sources(${TARGET} PRIVATE coreinfodlg.cpp coresessionwidget.cpp debugbufferviewoverlay.cpp - debugconsole.cpp debuglogdlg.cpp debugmessagemodelfilter.cpp inputwidget.cpp @@ -71,7 +70,6 @@ target_sources(${TARGET} PRIVATE coreinfodlg.ui coresessionwidget.ui debugbufferviewoverlay.ui - debugconsole.ui debuglogdlg.ui inputwidget.ui msgprocessorstatuswidget.ui diff --git a/src/qtui/debugconsole.cpp b/src/qtui/debugconsole.cpp deleted file mode 100644 index 8f7c7580..00000000 --- a/src/qtui/debugconsole.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2019 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 "debugconsole.h" - -#include "client.h" -#include "signalproxy.h" - -DebugConsole::DebugConsole(QWidget* parent) - : QDialog(parent) -{ - ui.setupUi(this); - - Client::signalProxy()->attachSignal(this, &DebugConsole::scriptRequest); - Client::signalProxy()->attachSlot(SIGNAL(scriptResult(QString)), this, &DebugConsole::scriptResult); -} - -void DebugConsole::on_evalButton_clicked() -{ - if (ui.selectCore->isChecked()) { - emit scriptRequest(ui.scriptEdit->toPlainText()); - } -} - -void DebugConsole::scriptResult(QString result) -{ - ui.resultLabel->setText(result); -} diff --git a/src/qtui/debugconsole.h b/src/qtui/debugconsole.h deleted file mode 100644 index c973f325..00000000 --- a/src/qtui/debugconsole.h +++ /dev/null @@ -1,46 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2019 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 DEBUGCONSOLE_H -#define DEBUGCONSOLE_H - -#include "ui_debugconsole.h" - -class DebugConsole : public QDialog -{ - Q_OBJECT - -public: - DebugConsole(QWidget* parent = nullptr); - -public slots: - void scriptResult(QString result); - -signals: - void scriptRequest(QString script); - -private slots: - void on_evalButton_clicked(); - -private: - Ui::DebugConsole ui; -}; - -#endif diff --git a/src/qtui/debugconsole.ui b/src/qtui/debugconsole.ui deleted file mode 100644 index aa0dc345..00000000 --- a/src/qtui/debugconsole.ui +++ /dev/null @@ -1,103 +0,0 @@ - - - DebugConsole - - - - 0 - 0 - 490 - 435 - - - - Debug Console - - - - 2 - - - 3 - - - - - 10 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - local - - - false - - - - - - - core - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - Evaluate! - - - - - - - - - - - - - - selectLocal - selectCore - scriptEdit - evalButton - - - -