From ab89fb0673843437bd476136222638ceb3e50be9 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Thu, 19 Dec 2024 12:36:08 -0500 Subject: [PATCH] Revert the deferred start for forcefields Hopefully this will avoid current issues with optimizing? Signed-off-by: Geoff Hutchison --- avogadro/qtplugins/forcefield/forcefield.cpp | 21 ++++++++------------ avogadro/qtplugins/forcefield/forcefield.h | 2 -- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/avogadro/qtplugins/forcefield/forcefield.cpp b/avogadro/qtplugins/forcefield/forcefield.cpp index 70bf78172f..49dadc94e9 100644 --- a/avogadro/qtplugins/forcefield/forcefield.cpp +++ b/avogadro/qtplugins/forcefield/forcefield.cpp @@ -117,19 +117,7 @@ Forcefield::Forcefield(QObject* parent_) connect(action, SIGNAL(triggered()), SLOT(unfreezeSelected())); m_actions.push_back(action); - // single-shot timer to allow the GUI to start up - QTimer::singleShot(500, this, SLOT(deferredStart())); -} - -Forcefield::~Forcefield() {} - -QList Forcefield::actions() const -{ - return m_actions; -} - -void Forcefield::deferredStart() -{ + // initialize the calculators // prefer to use Python interface scripts if available refreshScripts(); @@ -150,6 +138,13 @@ void Forcefield::deferredStart() #endif } +Forcefield::~Forcefield() {} + +QList Forcefield::actions() const +{ + return m_actions; +} + QStringList Forcefield::menuPath(QAction* action) const { QStringList path; diff --git a/avogadro/qtplugins/forcefield/forcefield.h b/avogadro/qtplugins/forcefield/forcefield.h index 7b8bcc98f9..a08e75675c 100644 --- a/avogadro/qtplugins/forcefield/forcefield.h +++ b/avogadro/qtplugins/forcefield/forcefield.h @@ -76,8 +76,6 @@ private slots: void freezeSelected(); void unfreezeSelected(); - void deferredStart(); - private: QList m_actions; QtGui::Molecule* m_molecule = nullptr;