Fix window hiding issue (closes #589070)

This commit is contained in:
Christophe Dumez
2010-06-10 19:42:54 +00:00
parent ac3a88d3e3
commit 6070fac3f5

View File

@@ -580,10 +580,12 @@ bool GUI::event(QEvent * e) {
qDebug("minimisation"); qDebug("minimisation");
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
if(systrayIcon && settings.value(QString::fromUtf8("Preferences/General/MinimizeToTray"), false).toBool()) { if(systrayIcon && settings.value(QString::fromUtf8("Preferences/General/MinimizeToTray"), false).toBool()) {
qDebug("Minimize to Tray enabled, hiding!"); if(!qApp->activeWindow() || !qApp->activeWindow()->isModal()) {
e->accept(); qDebug("Minimize to Tray enabled, hiding!");
QTimer::singleShot(0, this, SLOT(hide())); e->accept();
return true; QTimer::singleShot(0, this, SLOT(hide()));
return true;
}
} }
} }
} }