IBackgroundChecker: allow to react on session loaded

MeetingSession: fix call to BackgroundManager
This commit is contained in:
Filippo Gentile 2022-11-02 20:15:49 +01:00
parent e5fc856c10
commit 0149217499
5 changed files with 10 additions and 5 deletions

View File

@ -138,11 +138,9 @@ DB_Error MeetingSession::openDB(const QString &str, bool ignoreVersion)
// }
#ifdef ENABLE_BACKGROUND_MANAGER
if(settings.getCheckRSWhenOpeningDB())
backgroundManager->startAllCheckers(); //FIXME
backgroundManager->handleSessionLoaded();
#endif
return DB_Error::NoError;
}

View File

@ -17,7 +17,7 @@ BackgroundManager::~BackgroundManager()
}
void BackgroundManager::startAllCheckers()
void BackgroundManager::handleSessionLoaded()
{
for(IBackgroundChecker *mgr : qAsConst(checkers))
mgr->startWorker();

View File

@ -16,7 +16,7 @@ public:
explicit BackgroundManager(QObject *parent = nullptr);
~BackgroundManager() override;
void startAllCheckers();
void handleSessionLoaded();
void abortAllTasks();
bool isRunning();

View File

@ -105,6 +105,11 @@ void IBackgroundChecker::abortTasks()
}
}
void IBackgroundChecker::sessionLoadedHandler()
{
//no-op
}
void IBackgroundChecker::addSubTask(IQuittableTask *task)
{
m_workers.append(task);

View File

@ -36,6 +36,8 @@ public:
virtual void clearModel() = 0;
virtual void showContextMenu(QWidget *panel, const QPoint& globalPos, const QModelIndex& idx) const = 0;
virtual void sessionLoadedHandler();
signals:
void progress(int val, int max);
void taskFinished();