Qt4/Qt5 neutral changes:

+ add missing header files/remove old headers
+ fix flaws in use of timer
This commit is contained in:
wmayer
2016-12-12 16:28:28 +01:00
parent 4933e17a75
commit ad7234ff9e
2 changed files with 5 additions and 14 deletions

View File

@@ -291,7 +291,7 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f)
d->activityTimer = new QTimer(this);
d->activityTimer->setObjectName(QString::fromLatin1("activityTimer"));
connect(d->activityTimer, SIGNAL(timeout()),this, SLOT(updateActions()));
d->activityTimer->setSingleShot(true);
d->activityTimer->setSingleShot(false);
d->activityTimer->start(300);
// show main window timer
@@ -1088,15 +1088,9 @@ void MainWindow::appendRecentFile(const QString& filename)
void MainWindow::updateActions()
{
static QTime cLastCall;
if (cLastCall.elapsed() > 250 && isVisible()) {
if (isVisible()) {
Application::Instance->commandManager().testActive();
cLastCall.start();
}
d->activityTimer->setSingleShot(true);
d->activityTimer->start(300);
}
void MainWindow::switchToTopLevelMode()