Skip to content

Commit

Permalink
Drop --debug option
Browse files Browse the repository at this point in the history
It's been doing nothing for years, and there's no clear way of making
it useful. From the looks of it, the option name is ambiguous: is it
to enable execution of Quaternion with a debugger? Extra checks? Debug
logging, as #415 hints (though one switch for debug logging is
not really enough)?

This commit drops the option and the related functions (that do
effectively nothing). Closes #415 in its current form; #787 is created
to track logging categories support in Quaternion and also introduction
of handy command-line switches with better names than --debug.
  • Loading branch information
KitsuneRal committed Sep 4, 2021
1 parent 37e797d commit c2b5a1c
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 23 deletions.
1 change: 1 addition & 0 deletions client/chatedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <QtGui/QKeyEvent>
#include <QtCore/QMimeData>
#include <QtCore/QStringBuilder>
#include <QtCore/QDebug>

#include <util.h>

Expand Down
6 changes: 0 additions & 6 deletions client/chatroomwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,6 @@ ChatRoomWidget::ChatRoomWidget(QWidget* parent)
setLayout(layout);
}

void ChatRoomWidget::enableDebug()
{
QQmlContext* ctxt = m_timelineWidget->rootContext();
ctxt->setContextProperty(QStringLiteral("debug"), true);
}

QuaternionRoom* ChatRoomWidget::currentRoom() const { return m_messageModel->room(); }

void ChatRoomWidget::setRoom(QuaternionRoom* newRoom)
Expand Down
1 change: 0 additions & 1 deletion client/chatroomwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class ChatRoomWidget: public QWidget

explicit ChatRoomWidget(QWidget* parent = nullptr);

void enableDebug();
bool pendingMarkRead() const;
QuaternionRoom* currentRoom() const;

Expand Down
9 changes: 0 additions & 9 deletions client/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,6 @@ int main( int argc, char* argv[] )
QCommandLineOption hideMainWindow { QStringLiteral("hide-mainwindow"),
QApplication::translate("main", "Hide main window on startup") };
options.append(hideMainWindow);
QCommandLineOption debug { QStringLiteral("debug"),
QApplication::translate("main", "Display debug information") };
debug.setFlags(QCommandLineOption::HiddenFromHelp); // FIXME, #415
options.append(debug);
// Add more command line options before this line

if (!parser.addOptions(options))
Expand Down Expand Up @@ -190,11 +186,6 @@ int main( int argc, char* argv[] )
Quotient::NetworkSettings().setupApplicationProxy();

MainWindow window;
if (parser.isSet(debug))
{
qInfo() << "Debug mode enabled";
window.enableDebug();
}

ActivityDetector ad(app, window); Q_UNUSED(ad);
if (parser.isSet(hideMainWindow)) {
Expand Down
5 changes: 0 additions & 5 deletions client/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,11 +763,6 @@ bool MainWindow::saveAccessTokenToKeyChain(const AccountSettings& account,
}
#endif

void MainWindow::enableDebug()
{
chatRoomWidget->enableDebug();
}

void MainWindow::addConnection(Connection* c, const QString& deviceName)
{
Q_ASSERT_X(c, __FUNCTION__, "Attempt to add a null connection");
Expand Down
2 changes: 0 additions & 2 deletions client/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ class MainWindow: public QMainWindow, public Quotient::UriResolverBase {
MainWindow();
~MainWindow() override;

void enableDebug();

void addConnection(Connection* c, const QString& deviceName);
void dropConnection(Connection* c);

Expand Down

0 comments on commit c2b5a1c

Please sign in to comment.