Commit bcdc041e authored by David Jarvie's avatar David Jarvie
Browse files

Remove overrides of non-virtual QWidget::show()

parent 9e1df4f7
Pipeline #38625 passed with stage
in 20 minutes and 54 seconds
......@@ -304,7 +304,7 @@ bool KAlarmApp::restoreSession()
if (win->isValid())
{
if (Resources::allCreated() && !mNotificationsInhibited)
win->show();
win->display();
else
mRestoredWindows += win;
}
......@@ -351,7 +351,7 @@ void KAlarmApp::showRestoredWindows()
{
// Display message windows restored at startup.
for (MessageWindow* win : mRestoredWindows)
win->show();
win->display();
mRestoredWindows.clear();
}
if (mRedisplayAlarms)
......
......@@ -68,6 +68,7 @@ using namespace KCalUtils;
#include <QMenu>
#include <QMimeDatabase>
#include <QInputDialog>
#include <QTimer>
#include <QUrl>
#include <QMenuBar>
#include <QSystemTrayIcon>
......@@ -371,19 +372,20 @@ void MainWindow::showEvent(QShowEvent* se)
}
MainWindowBase::showEvent(se);
mShown = true;
if (mMenuError)
QTimer::singleShot(0, this, &MainWindow::showMenuErrorMessage);
}
/******************************************************************************
* Display the window.
* Show the menu error message now that the main window has been displayed.
* Waiting until now lets the user easily associate the message with the main
* window which is faulty.
*/
void MainWindow::show()
void MainWindow::showMenuErrorMessage()
{
MainWindowBase::show();
if (mMenuError)
{
// Show error message now that the main window has been displayed.
// Waiting until now lets the user easily associate the message with
// the main window which is faulty.
KAMessageBox::error(this, xi18nc("@info", "Failure to create menus (perhaps <filename>%1</filename> missing or corrupted)", UI_FILE));
mMenuError = false;
}
......
......@@ -65,9 +65,6 @@ public:
static MainWindow* firstWindow() { return mWindowList.isEmpty() ? nullptr : mWindowList[0]; }
static int count() { return mWindowList.count(); }
public Q_SLOTS:
virtual void show();
Q_SIGNALS:
void selectionChanged();
......@@ -128,6 +125,7 @@ private Q_SLOTS:
void slotCalendarStatusChanged();
void slotAlarmListColumnsChanged();
void resourcesResized();
void showMenuErrorMessage();
void showErrorMessage(const QString&);
void editAlarmOk();
void editAlarmDeleted(QObject*);
......
......@@ -567,7 +567,7 @@ void MessageWindow::closeDisplay()
void MessageWindow::showDisplay()
{
if (!mAlwaysHidden())
show();
display();
}
void MessageWindow::raiseDisplay()
......@@ -815,12 +815,12 @@ bool MessageWindow::isSpread(const QPoint& topLeft)
}
/******************************************************************************
* Display the window.
* Display the window, if it should not already be auto-closed.
* If windows are being positioned away from the mouse cursor, it is initially
* positioned at the top left to slightly reduce the number of times the
* windows need to be moved in showEvent().
*/
void MessageWindow::show()
void MessageWindow::display()
{
if (mHelper->activateAutoClose())
{
......
......@@ -49,7 +49,12 @@ public:
void showDefer() override;
void showDateTime(const KAEvent&, const KAAlarm&) override;
void cancelReminder(const KAEvent&, const KAAlarm&) override;
virtual void show();
/** Use display() instead of show() to display a message window.
* This prevents windows which should be auto-closed from being shown.
*/
void display();
QSize sizeHint() const override;
static void redisplayAlarms();
static int windowCount(bool excludeAlwaysHidden = false);
......@@ -97,6 +102,7 @@ private:
void setButtonsReadOnly(bool);
bool getWorkAreaAndModal();
static bool isSpread(const QPoint& topLeft);
void show(); // ensure that display() is called instead of show() on a MessageWindow object
static QVector<MessageWindow*> mWindowList; // list of message window instances
// Properties needed by readProperties()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment