#2770 Fracture : Extract startTimer()

This commit is contained in:
Magne Sjaastad
2018-04-20 13:20:46 +02:00
parent 95151193e9
commit 4eec46cbdc
3 changed files with 27 additions and 20 deletions

View File

@@ -17,12 +17,15 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RiaCompletionTypeCalculationScheduler.h"
#include "RiaApplication.h"
#include "Rim3dView.h"
#include "RimEclipseCase.h"
#include "RimEclipseCaseCollection.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RiuMainWindow.h"
#include "RiuViewer.h"
@@ -53,14 +56,7 @@ void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAnd
m_eclipseCasesToRecalculate.push_back(eclipseCase);
}
if (!m_recalculateCompletionTypeTimer)
{
m_recalculateCompletionTypeTimer = new QTimer(this);
m_recalculateCompletionTypeTimer->setSingleShot(true);
connect(m_recalculateCompletionTypeTimer, SIGNAL(timeout()), this, SLOT(slotRecalculateCompletionType()));
}
m_recalculateCompletionTypeTimer->start(1500);
startTimer();
}
//--------------------------------------------------------------------------------------------------
@@ -70,14 +66,7 @@ void RiaCompletionTypeCalculationScheduler::scheduleRecalculateCompletionTypeAnd
{
m_eclipseCasesToRecalculate.push_back(eclipseCase);
if (!m_recalculateCompletionTypeTimer)
{
m_recalculateCompletionTypeTimer = new QTimer(this);
m_recalculateCompletionTypeTimer->setSingleShot(true);
connect(m_recalculateCompletionTypeTimer, SIGNAL(timeout()), this, SLOT(slotRecalculateCompletionType()));
}
m_recalculateCompletionTypeTimer->start(1500);
startTimer();
}
//--------------------------------------------------------------------------------------------------
@@ -120,3 +109,18 @@ RiaCompletionTypeCalculationScheduler::~RiaCompletionTypeCalculationScheduler()
{
delete m_recalculateCompletionTypeTimer;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaCompletionTypeCalculationScheduler::startTimer()
{
if (!m_recalculateCompletionTypeTimer)
{
m_recalculateCompletionTypeTimer = new QTimer(this);
m_recalculateCompletionTypeTimer->setSingleShot(true);
connect(m_recalculateCompletionTypeTimer, SIGNAL(timeout()), this, SLOT(slotRecalculateCompletionType()));
}
m_recalculateCompletionTypeTimer->start(1500);
}