From 573624a490201920469503de0f9eeb1d67bcf5cd Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 25 Jan 2022 11:09:54 +0100 Subject: [PATCH] Remove some unused functions --- src/ChatPage.cpp | 2 ++ src/MainWindow.cpp | 41 ----------------------------------------- src/MainWindow.h | 12 ------------ 3 files changed, 2 insertions(+), 53 deletions(-) diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index f30e0466..fe6b08eb 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -777,6 +777,8 @@ ChatPage::inviteUser(QString userid, QString reason) userid.toStdString(), [this, userid, room](const mtx::responses::Empty &, mtx::http::RequestErr err) { if (err) { + nhlog::net()->error( + "Failed to invite {} to {}: {}", userid.toStdString(), room.toStdString(), *err); emit showNotification( tr("Failed to invite %1 to %2: %3") .arg(userid, room, QString::fromStdString(err->matrix_error.error))); diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 3efdc23f..d3395c68 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -357,23 +357,6 @@ MainWindow::saveCurrentWindowSize() settings->setValue(QStringLiteral("window/height"), current.height()); } -void -MainWindow::removeOverlayProgressBar() -{ - QTimer *timer = new QTimer(this); - timer->setSingleShot(true); - - connect(timer, &QTimer::timeout, this, [this, timer]() { timer->deleteLater(); }); - - // FIXME: Snackbar doesn't work if it's initialized in the constructor. - // QTimer::singleShot(0, this, [this]() { - // snackBar_ = new SnackBar(this); - // connect(chat_page_, &ChatPage::showNotification, snackBar_, &SnackBar::showMessage); - //}); - - timer->start(50); -} - void MainWindow::showChatPage() { @@ -388,8 +371,6 @@ MainWindow::showChatPage() userSettings_.data()->setDeviceId(device_id); userSettings_.data()->setHomeserver(homeserver); - showOverlayProgressBar(); - chat_page_->bootstrap(userid, homeserver, token); connect(cache::client(), &Cache::databaseReady, this, &MainWindow::secretsChanged); connect(cache::client(), &Cache::secretChanged, this, &MainWindow::secretsChanged); @@ -446,10 +427,6 @@ MainWindow::hasActiveUser() settings->contains(prefix + "auth/user_id"); } -void -MainWindow::showOverlayProgressBar() -{} - void MainWindow::openCreateRoomDialog( std::function callback) @@ -463,14 +440,6 @@ MainWindow::openCreateRoomDialog( showDialog(dialog); } -void -MainWindow::showTransparentOverlayModal(QWidget *, QFlags) -{} - -void -MainWindow::showSolidOverlayModal(QWidget *, QFlags) -{} - bool MainWindow::hasActiveDialogs() const { @@ -484,10 +453,6 @@ MainWindow::pageSupportsTray() const //! !register_page_->isVisible(); } -void -MainWindow::hideOverlay() -{} - inline void MainWindow::showDialog(QWidget *dialog) { @@ -496,12 +461,6 @@ MainWindow::showDialog(QWidget *dialog) dialog->show(); } -void -MainWindow::showWelcomePage() -{ - removeOverlayProgressBar(); -} - void MainWindow::showRegisterPage() {} diff --git a/src/MainWindow.h b/src/MainWindow.h index 5a351893..02213cdf 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -56,12 +56,6 @@ public: openCreateRoomDialog(std::function callback); void openJoinRoomDialog(std::function callback); - void hideOverlay(); - void showSolidOverlayModal(QWidget *content, QFlags flags = Qt::AlignCenter); - void - showTransparentOverlayModal(QWidget *content, - QFlags flags = Qt::AlignTop | Qt::AlignHCenter); - MxcImageProvider *imageProvider() { return imgProvider; } //! Show the chat page and start communicating with the given access token. @@ -75,15 +69,9 @@ private slots: //! Handle interaction with the tray icon. void iconActivated(QSystemTrayIcon::ActivationReason reason); - //! Show the welcome page in the main window. - void showWelcomePage(); - //! Show the register page in the main window. void showRegisterPage(); - void showOverlayProgressBar(); - void removeOverlayProgressBar(); - virtual void setWindowTitle(int notificationCount); signals: