Skip to content

Commit

Permalink
ErrorOverlay: fix dialogs being disabled by the mainwindow
Browse files Browse the repository at this point in the history
Testcase: open "jump to folder", cancel, restart akonadi,
reopen the dialog, it was disabled.

This happened because disabling the window actually disables
the child dialog too, so the saved state for the dialog was
"disabled". The fix is to save the "explicitly disabled" state
rather than isDisabled(). Thanks to Volker for helping me figure
this out.

Differential Revision: https://phabricator.kde.org/D2717
  • Loading branch information
dfaure committed Sep 10, 2016
1 parent cfe1079 commit 4e5c3eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/widgets/erroroverlay.cpp
Expand Up @@ -94,7 +94,7 @@ ErrorOverlay::ErrorOverlay(QWidget *baseWidget, QWidget *parent)
sInstanceOverlay->baseWidgets.append(qMakePair(mBaseWidget, QPointer<QWidget>(this)));

connect(baseWidget, &QObject::destroyed, this, &QObject::deleteLater);
mPreviousState = mBaseWidget->isEnabled();
mPreviousState = !mBaseWidget->testAttribute(Qt::WA_ForceDisabled);

ui->setupUi(this);
ui->notRunningIcon->setPixmap(QIcon::fromTheme(QStringLiteral("akonadi")).pixmap(64));
Expand Down Expand Up @@ -220,7 +220,7 @@ void ErrorOverlay::serverStateChanged(ServerManager::State state)
}

if (!mBaseWidgetIsParent) {
mPreviousState = mBaseWidget->isEnabled();
mPreviousState = !mBaseWidget->testAttribute(Qt::WA_ForceDisabled);
mBaseWidget->setEnabled(false);
}

Expand Down

0 comments on commit 4e5c3eb

Please sign in to comment.