summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cord-Landwehr <cordlandwehr@kde.org>2016-10-30 10:06:00 (GMT)
committerAndreas Cord-Landwehr <cordlandwehr@kde.org>2016-10-30 10:06:00 (GMT)
commitac81d6b1e2014ab26b636f4af4f970dc3e2cf260 (patch)
tree0e8ef257518403242313ca61590715b2111ddf1d
parent297d641f30d5487a4ddc98d996ce0c554bf2e064 (diff)
Make compatible with latest Avogadro2 release
-rw-r--r--compoundviewer/kalziumglwidget.cpp8
-rw-r--r--src/tools/moleculeview.cpp4
2 files changed, 8 insertions, 4 deletions
diff --git a/compoundviewer/kalziumglwidget.cpp b/compoundviewer/kalziumglwidget.cpp
index 7a58b65..94b178d 100644
--- a/compoundviewer/kalziumglwidget.cpp
+++ b/compoundviewer/kalziumglwidget.cpp
@@ -94,9 +94,11 @@ KalziumGLWidget::~KalziumGLWidget()
bool KalziumGLWidget::openFile(const QString &file)
{
- auto tmpMol = IoWrapper::readMolecule(file);
- auto mol = new Avogadro::QtGui::Molecule(*tmpMol);
- delete tmpMol;
+ // workaround for missing copy-constructor: fixed in Avogadra2 > 0.9
+ Avogadro::QtGui::Molecule temp;
+ temp = *IoWrapper::readMolecule(file);
+ auto mol = new Avogadro::QtGui::Molecule(temp);
+
if (!mol) {
return false;
}
diff --git a/src/tools/moleculeview.cpp b/src/tools/moleculeview.cpp
index c54704e..48d6def 100644
--- a/src/tools/moleculeview.cpp
+++ b/src/tools/moleculeview.cpp
@@ -171,7 +171,9 @@ void MoleculeDialog::loadMolecule(const QString &filename)
qDebug() << "Filename to load: " << filename;
- Avogadro::QtGui::Molecule tmpMol = *IoWrapper::readMolecule(filename);
+ // workaround for missing copy-constructor: fixed in Avogadra2 > 0.9
+ Avogadro::QtGui::Molecule tmpMol;
+ tmpMol = *IoWrapper::readMolecule(filename);
auto molecule = new Avogadro::QtGui::Molecule(tmpMol);
// Check that a valid molecule object was returned