File fix-compilation.patch of Package molsketch
From 42949476e07960deaaa4907a2af87742d5c6eec0 Mon Sep 17 00:00:00 2001
Message-Id: <42949476e07960deaaa4907a2af87742d5c6eec0.1609602170.git.matthias@mailaender.name>
From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= <matthias@mailaender.name>
Date: Sat, 2 Jan 2021 16:42:43 +0100
Subject: [PATCH] Fix compilation.
---
libmolsketch/atom.cpp | 12 ++++++------
libmolsketch/bond.cpp | 4 ++--
libmolsketch/librarymodel.cpp | 2 +-
libmolsketch/molecule.cpp | 10 +++++-----
molsketch/mainwindow.cpp | 4 ++--
5 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/libmolsketch/atom.cpp b/libmolsketch/atom.cpp
index bdfba59..270faae 100644
--- a/libmolsketch/atom.cpp
+++ b/libmolsketch/atom.cpp
@@ -985,19 +985,19 @@ namespace Molsketch {
QPointF intersection;
QLineF topEdge{bounds.topLeft(), bounds.topRight()};
- if (topEdge.intersects(line, &intersection) == QLineF::BoundedIntersection)
+ if (topEdge.intersect(line, &intersection) == QLineF::BoundedIntersection)
return IntersectionData(intersection, topEdge);
QLineF bottomEdge{bounds.bottomLeft(), bounds.bottomRight()};
- if (bottomEdge.intersects(line, &intersection) == QLineF::BoundedIntersection)
+ if (bottomEdge.intersect(line, &intersection) == QLineF::BoundedIntersection)
return IntersectionData(intersection, bottomEdge);
QLineF leftEdge{bounds.topLeft(), bounds.bottomLeft()};
- if (leftEdge.intersects(line, &intersection) == QLineF::BoundedIntersection)
+ if (leftEdge.intersect(line, &intersection) == QLineF::BoundedIntersection)
return IntersectionData(intersection, leftEdge);
QLineF rightEdge{bounds.topRight(), bounds.bottomRight()};
- if (rightEdge.intersects(line, &intersection) == QLineF::BoundedIntersection)
+ if (rightEdge.intersect(line, &intersection) == QLineF::BoundedIntersection)
return IntersectionData(intersection, rightEdge);
// TODO pick the edge it intersects with first (i.e. closest to the middle)
return IntersectionData(QPointF(), QLineF());
@@ -1034,7 +1034,7 @@ namespace Molsketch {
qreal Atom::getExtentForIntersectionOfOuterLineAndEdge(const IntersectionData &edgeIntersection, const QLineF &outer) const {
QPointF intersectionOfOuterAndEdge;
- QLineF::IntersectType intersectType = edgeIntersection.getEdge().intersects(outer, &intersectionOfOuterAndEdge);
+ QLineF::IntersectType intersectType = edgeIntersection.getEdge().intersect(outer, &intersectionOfOuterAndEdge);
return QLineF::BoundedIntersection == intersectType
? QLineF(intersectionOfOuterAndEdge, outer.p1()).length() / outer.length()
: 0;
@@ -1098,7 +1098,7 @@ namespace Molsketch {
{
QLineF edge(corners[i], corners[i+1]);
QPointF result;
- if (connection.intersects(edge, &result) == QLineF::BoundedIntersection)
+ if (connection.intersect(edge, &result) == QLineF::BoundedIntersection)
return result;
}
return connection.p1();
diff --git a/libmolsketch/bond.cpp b/libmolsketch/bond.cpp
index 0a8f951..6dadd33 100644
--- a/libmolsketch/bond.cpp
+++ b/libmolsketch/bond.cpp
@@ -231,10 +231,10 @@ namespace Molsketch {
if (m_bondType != DoubleLegacy) return;
m_bondType = DoubleSymmetric;
auto beginBondList = m_beginAtom->bonds();
- auto beginBonds = QSet<Bond*>(beginBondList.begin(), beginBondList.end());
+ auto beginBonds = QSet<Bond*>::fromList(beginBondList);
beginBonds -= this;
auto endBondList = m_endAtom->bonds();
- auto endBonds = QSet<Bond*>(endBondList.begin(), endBondList.end());
+ auto endBonds = QSet<Bond*>::fromList(endBondList);
endBonds -= this;
// no other bonds: symmetric
if (beginBonds.empty() && endBonds.empty()) return;
diff --git a/libmolsketch/librarymodel.cpp b/libmolsketch/librarymodel.cpp
index 0da451a..ccb54c6 100644
--- a/libmolsketch/librarymodel.cpp
+++ b/libmolsketch/librarymodel.cpp
@@ -40,7 +40,7 @@ namespace Molsketch {
int fetchCount;
void cleanMolecules() {
qInfo("Clearing list of molecules. Count: %d", items.size());
- auto itemSet = QSet<MoleculeModelItem*>(items.begin(), items.end());
+ auto itemSet = QSet<MoleculeModelItem*>::fromList(items);
for (auto molecule : itemSet) delete molecule;
items.clear();
fetchCount = 0;
diff --git a/libmolsketch/molecule.cpp b/libmolsketch/molecule.cpp
index f18fd8d..3caa42a 100644
--- a/libmolsketch/molecule.cpp
+++ b/libmolsketch/molecule.cpp
@@ -127,7 +127,7 @@ namespace Molsketch {
{
setDefaults();
auto atoms = mol.atoms();
- auto atomSet = QSet<Atom*>(atoms.begin(), atoms.end());
+ auto atomSet = QSet<Atom*>::fromList(atoms);
clone(atomSet);
setPos(mol.pos());
updateElectronSystems();
@@ -304,7 +304,7 @@ namespace Molsketch {
QList<Molecule*> molList;
auto atomList = atoms();
- auto atomSet = QSet<Atom*>(atomList.begin(), atomList.end());
+ auto atomSet = QSet<Atom*>::fromList(atomList);
while (!atomSet.empty())
{
QSet<Atom*> subgroup = getConnectedAtoms(*(atomSet.begin()));
@@ -396,7 +396,7 @@ namespace Molsketch {
{
if (atoms().isEmpty()) return false;
auto atomList = atoms();
- auto atomSet = QSet<Atom*>(atomList.begin(), atomList.end());
+ auto atomSet = QSet<Atom*>::fromList(atomList);
return getConnectedAtoms(atoms().first()) != atomSet;
}
@@ -595,9 +595,9 @@ void Molecule::paintElectronSystems(QPainter *painter) const {
bool canMerge(const ElectronSystem *es1, const ElectronSystem *es2)
{
auto firstListOfAtoms = es1->atoms();
- auto firstSetOfAtoms = QSet<Atom*>(firstListOfAtoms.begin(), firstListOfAtoms.end());
+ auto firstSetOfAtoms = QSet<Atom*>::fromList(firstListOfAtoms);
auto secondListOfAtoms = es2->atoms();
- auto secondSetOfAtoms = QSet<Atom*>(secondListOfAtoms.begin(), secondListOfAtoms.end()); // TODO utility function
+ auto secondSetOfAtoms = QSet<Atom*>::fromList(secondListOfAtoms); // TODO utility function
// may not share an atom
if (!(firstSetOfAtoms & secondSetOfAtoms).empty()) return false;
diff --git a/molsketch/mainwindow.cpp b/molsketch/mainwindow.cpp
index 0cc54ea..8751c2e 100644
--- a/molsketch/mainwindow.cpp
+++ b/molsketch/mainwindow.cpp
@@ -399,7 +399,7 @@ void MainWindow::openAssistant()
stream << QLatin1String("setSource ")
<< file.absoluteFilePath()
<< QLatin1Char('\0')
- << Qt::endl;
+ << ('\n');
#endif
}
@@ -567,7 +567,7 @@ void MainWindow::initializeAssistant()
stream << QLatin1String("register ")
<< file.absoluteFilePath()
<< QLatin1Char('\0')
- << Qt::endl;
+ << ('\n');
#endif
}
--
2.26.2