Skip to content

Commit

Permalink
Replace Qt:endl with endl. (Fixes build on Ubuntu 20.04, but lot's of…
Browse files Browse the repository at this point in the history
… deprecation warnings on Ubuntu 21.04)
  • Loading branch information
koppi committed Jun 9, 2021
1 parent 0a506fd commit 2501c48
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 145 deletions.
16 changes: 8 additions & 8 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ int main(int argc, char **argv) {
QStringList luaExpression = parser.values(luaExpressionOption);

if (lua.isEmpty() && luaExpression.isEmpty() && !parser.isSet(luaStdinOption)) {
qStdErr() << QObject::tr("Error: Option '--lua' requires a Lua script file as an argument. Exiting.") << Qt::endl;
qStdErr() << QObject::tr("Error: Option '--lua' requires a Lua script file as an argument. Exiting.") << endl;
return EXIT_FAILURE;
}

Expand All @@ -111,7 +111,7 @@ int main(int argc, char **argv) {
QFile file(lua[0]);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QString errMsg = file.errorString();
qStdErr() << QObject::tr("Error: reading '%1': %2. Exiting.").arg(lua[0], errMsg) << Qt::endl;
qStdErr() << QObject::tr("Error: reading '%1': %2. Exiting.").arg(lua[0], errMsg) << endl;
return EXIT_FAILURE;
}

Expand All @@ -131,28 +131,28 @@ int main(int argc, char **argv) {

int n = parser.value(nOption).toInt();
if (n < 0) {
qStdErr() << QObject::tr("Error: -n must be >= 0. Exiting.") << Qt::endl;
qStdErr() << QObject::tr("Error: -n must be >= 0. Exiting.") << endl;
return EXIT_FAILURE;
}

Viewer *v = new Viewer(NULL, settings);

QObject::connect(v, &Viewer::scriptHasOutput, [=](QString o) {
qStdOut() << o << Qt::endl;
qStdOut() << o << endl;
});
QObject::connect(v, &Viewer::statusEvent, [=](QString e) {
qStdErr() << e << Qt::endl;
qStdErr() << e << endl;
});

if (parser.isSet("verbose")) {
QObject::connect(v, &Viewer::scriptStarts, [=]() {
qStdErr() << "scriptStarts()" << Qt::endl;
qStdErr() << "scriptStarts()" << endl;
});
QObject::connect(v, &Viewer::scriptStopped, [=]() {
qStdErr() << "scriptStoppend()" << Qt::endl;
qStdErr() << "scriptStoppend()" << endl;
});
QObject::connect(v, &Viewer::scriptFinished, [=]() {
qStdErr() << "scriptFinished()" << Qt::endl;
qStdErr() << "scriptFinished()" << endl;
});
}

Expand Down
22 changes: 11 additions & 11 deletions src/objects/cube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,35 +80,35 @@ void Cube::toPOV(QTextStream *s) const {
if (mPreSDL == NULL) {
*s << "box { <"
<< -lengths[0]/2.0 << ", "<< -lengths[1]/2.0 << ", " << -lengths[2]/2.0 << ">, <"
<< lengths[0]/2.0 << ", " << lengths[1]/2.0 << ", " << lengths[2]/2.0 << ">" << Qt::endl;
<< lengths[0]/2.0 << ", " << lengths[1]/2.0 << ", " << lengths[2]/2.0 << ">" << endl;
} else {
*s << mPreSDL
<< Qt::endl;
<< endl;
}

if (mSDL != NULL) {
*s << mSDL
<< Qt::endl;
<< endl;
} else {
*s << " pigment { rgb <"
<< color[0]/255.0 << ", "
<< color[1]/255.0 << ", "
<< color[2]/255.0 << "> }"
<< Qt::endl;
<< endl;
}

*s << " matrix <" << matrix[0] << "," << matrix[1] << "," << matrix[2] << "," << Qt::endl
<< " " << matrix[4] << "," << matrix[5] << "," << matrix[6] << "," << Qt::endl
<< " " << matrix[8] << "," << matrix[9] << "," << matrix[10] << "," << Qt::endl
<< " " << matrix[12] << "," << matrix[13] << "," << matrix[14] << ">" << Qt::endl;
*s << " matrix <" << matrix[0] << "," << matrix[1] << "," << matrix[2] << "," << endl
<< " " << matrix[4] << "," << matrix[5] << "," << matrix[6] << "," << endl
<< " " << matrix[8] << "," << matrix[9] << "," << matrix[10] << "," << endl
<< " " << matrix[12] << "," << matrix[13] << "," << matrix[14] << ">" << endl;

if (mPostSDL == NULL) {
*s << "}"
<< Qt::endl
<< Qt::endl;
<< endl
<< endl;
} else {
*s << mPostSDL
<< Qt::endl;
<< endl;
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions src/objects/cylinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,31 @@ void Cylinder::toPOV(QTextStream *s) const {
<< -lengths[2]/2.0 << "*z, "
<< lengths[2]/2.0 << "*z, "
<< lengths[0]
<< Qt::endl;
<< endl;
} else {
*s << mPreSDL << Qt::endl;
*s << mPreSDL << endl;
}

if (mSDL != NULL) {
*s << mSDL
<< Qt::endl;
<< endl;
} else {
*s << " pigment { rgb <"
<< color[0]/255.0 << ", "
<< color[1]/255.0 << ", "
<< color[2]/255.0 << "> }"
<< Qt::endl;
<< endl;
}

*s << " matrix <" << matrix[0] << "," << matrix[1] << "," << matrix[2] << "," << Qt::endl
<< " " << matrix[4] << "," << matrix[5] << "," << matrix[6] << "," << Qt::endl
<< " " << matrix[8] << "," << matrix[9] << "," << matrix[10] << "," << Qt::endl
<< " " << matrix[12] << "," << matrix[13] << "," << matrix[14] << ">" << Qt::endl;
*s << " matrix <" << matrix[0] << "," << matrix[1] << "," << matrix[2] << "," << endl
<< " " << matrix[4] << "," << matrix[5] << "," << matrix[6] << "," << endl
<< " " << matrix[8] << "," << matrix[9] << "," << matrix[10] << "," << endl
<< " " << matrix[12] << "," << matrix[13] << "," << matrix[14] << ">" << endl;

if (mPostSDL == NULL) {
*s << "}" << Qt::endl << Qt::endl;
*s << "}" << endl << endl;
} else {
*s << mPostSDL << Qt::endl;
*s << mPostSDL << endl;
}
}
}
Expand Down
42 changes: 21 additions & 21 deletions src/objects/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ void Mesh::toMesh2(QTextStream *s) const {
concaveMesh->processAllTriangles(&pov, pminaabb, pmaxaabb);

if (pov.idx.length() > 0) {
*s << "mesh2 {" << Qt::endl;
*s << " vertex_vectors {" << Qt::endl;
*s << "mesh2 {" << endl;
*s << " vertex_vectors {" << endl;
*s << " " << pov.idx.length()*3 << ", ";
for (int i = 0; i < pov.idx.length(); ++i) {
*s << "<"
Expand All @@ -248,7 +248,7 @@ void Mesh::toMesh2(QTextStream *s) const {
<< ">";
if (i != pov.idx.length() - 1) *s << ", \n";
}
*s << " }" << Qt::endl;
*s << " }" << endl;

/*
*s << " normal_vectors {\n";
Expand All @@ -265,10 +265,10 @@ void Mesh::toMesh2(QTextStream *s) const {
<< ">";
if (i != pov.idx.length() - 1) *s << ", \n";
}
*s << " }" << Qt::endl;
*s << " }" << endl;
*/

*s << " face_indices {" << Qt::endl;
*s << " face_indices {" << endl;
*s << " " << pov.idx.length() << ", ";
for (int i = 0; i < pov.idx.length(); ++i) {
*s << "<"
Expand All @@ -281,11 +281,11 @@ void Mesh::toMesh2(QTextStream *s) const {
if (i != pov.idx.length() - 1) *s << ", \n";
}
*s << " }"
<< Qt::endl;
<< endl;

*s << "}" << Qt::endl;
*s << "}" << endl;
} else {
*s << "union {}" << Qt::endl; // empty object in case of empty mesh
*s << "union {}" << endl; // empty object in case of empty mesh
}
}
}
Expand Down Expand Up @@ -341,39 +341,39 @@ void Mesh::toPOV(QTextStream *s) const {
// qDebug() << "mesh already exists " << incfile;
}

*s << "#include \"" + check_file.fileName() + "\"" << Qt::endl << Qt::endl;
*s << "#include \"" + check_file.fileName() + "\"" << endl << endl;

*s << "object { mesh_" + hash << Qt::endl;
*s << "object { mesh_" + hash << endl;

} else {
*s << mPreSDL
<< Qt::endl;
<< endl;
}

if (mSDL != NULL) {
*s << mSDL
<< Qt::endl;
<< endl;
} else {
*s << " pigment { rgb <"
<< color[0]/255.0 << ", "
<< color[1]/255.0 << ", "
<< color[2]/255.0 << "> }"
<< Qt::endl;
<< endl;
}

*s << " matrix <" << matrix[0] << "," << matrix[1] << "," << matrix[2] << "," << Qt::endl
<< " " << matrix[4] << "," << matrix[5] << "," << matrix[6] << "," << Qt::endl
<< " " << matrix[8] << "," << matrix[9] << "," << matrix[10] << "," << Qt::endl
<< " " << matrix[12] << "," << matrix[13] << "," << matrix[14] << ">" << Qt::endl;
*s << " matrix <" << matrix[0] << "," << matrix[1] << "," << matrix[2] << "," << endl
<< " " << matrix[4] << "," << matrix[5] << "," << matrix[6] << "," << endl
<< " " << matrix[8] << "," << matrix[9] << "," << matrix[10] << "," << endl
<< " " << matrix[12] << "," << matrix[13] << "," << matrix[14] << ">" << endl;

if (mPostSDL == NULL) {
*s << "}"
<< Qt::endl
<< Qt::endl;
<< endl
<< endl;
} else {
*s << mPostSDL
<< Qt::endl
<< Qt::endl;
<< endl
<< endl;
}
}
}
Expand Down
22 changes: 11 additions & 11 deletions src/objects/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,35 +94,35 @@ void Object::toPOV(QTextStream *s) const {

if (s != NULL) {
if (mPreSDL == NULL) {
*s << "sphere { <0,0,0>, 1" << Qt::endl;
*s << "sphere { <0,0,0>, 1" << endl;
} else {
*s << mPreSDL
<< Qt::endl;
<< endl;
}

if (mSDL != NULL) {
*s << mSDL
<< Qt::endl;
<< endl;
} else {
*s << " pigment { rgb <"
<< color[0]/255.0 << ", "
<< color[1]/255.0 << ", "
<< color[2]/255.0 << "> }"
<< Qt::endl;
<< endl;
}

*s << " matrix <" << matrix[0] << "," << matrix[1] << "," << matrix[2] << "," << Qt::endl
<< " " << matrix[4] << "," << matrix[5] << "," << matrix[6] << "," << Qt::endl
<< " " << matrix[8] << "," << matrix[9] << "," << matrix[10] << "," << Qt::endl
<< " " << matrix[12] << "," << matrix[13] << "," << matrix[14] << ">" << Qt::endl;
*s << " matrix <" << matrix[0] << "," << matrix[1] << "," << matrix[2] << "," << endl
<< " " << matrix[4] << "," << matrix[5] << "," << matrix[6] << "," << endl
<< " " << matrix[8] << "," << matrix[9] << "," << matrix[10] << "," << endl
<< " " << matrix[12] << "," << matrix[13] << "," << matrix[14] << ">" << endl;

if (mPostSDL == NULL) {
*s << "}"
<< Qt::endl
<< Qt::endl;
<< endl
<< endl;
} else {
*s << mPostSDL
<< Qt::endl;
<< endl;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/objects/palette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Palette::Palette(QString fileName) : QObject() {
f.close();
} else {
qDebug() << "Cannot open file for reading: "
<< qPrintable(f.errorString()) << Qt::endl;
<< qPrintable(f.errorString()) << endl;
return;
}
}
Expand Down
20 changes: 10 additions & 10 deletions src/objects/plane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,31 @@ void Plane::toPOV(QTextStream *s) const {
<< planeNormal[0] << ", "
<< planeNormal[1] << ", "
<< planeNormal[2] << ">, "
<< planeConst << Qt::endl;
<< planeConst << endl;
} else {
*s << mPreSDL << Qt::endl;
*s << mPreSDL << endl;
}

if (mSDL != NULL) {
*s << mSDL
<< Qt::endl;
<< endl;
} else {
*s << " pigment { rgb <"
<< color[0]/255.0 << ", "
<< color[1]/255.0 << ", "
<< color[2]/255.0 << "> }"
<< Qt::endl;
<< endl;
}

*s << " matrix <" << matrix[0] << "," << matrix[1] << "," << matrix[2] << "," << Qt::endl
<< " " << matrix[4] << "," << matrix[5] << "," << matrix[6] << "," << Qt::endl
<< " " << matrix[8] << "," << matrix[9] << "," << matrix[10] << "," << Qt::endl
<< " " << matrix[12] << "," << matrix[13] << "," << matrix[14] << ">" << Qt::endl;
*s << " matrix <" << matrix[0] << "," << matrix[1] << "," << matrix[2] << "," << endl
<< " " << matrix[4] << "," << matrix[5] << "," << matrix[6] << "," << endl
<< " " << matrix[8] << "," << matrix[9] << "," << matrix[10] << "," << endl
<< " " << matrix[12] << "," << matrix[13] << "," << matrix[14] << ">" << endl;

if (mPostSDL == NULL) {
*s << "}" << Qt::endl << Qt::endl;
*s << "}" << endl << endl;
} else {
*s << mPostSDL << Qt::endl;
*s << mPostSDL << endl;
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions src/objects/sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,31 @@ void Sphere::toPOV(QTextStream *s) const {

if (s != NULL) {
if (mPreSDL == NULL) {
*s << "sphere { <.0,.0,.0>, " << radius << Qt::endl;
*s << "sphere { <.0,.0,.0>, " << radius << endl;
} else {
*s << mPreSDL << Qt::endl;
*s << mPreSDL << endl;
}

if (mSDL != NULL) {
*s << mSDL
<< Qt::endl;
<< endl;
} else {
*s << " pigment { rgb <"
<< color[0]/255.0 << ", "
<< color[1]/255.0 << ", "
<< color[2]/255.0 << "> }"
<< Qt::endl;
<< endl;
}

*s << " matrix <" << matrix[0] << "," << matrix[1] << "," << matrix[2] << "," << Qt::endl
<< " " << matrix[4] << "," << matrix[5] << "," << matrix[6] << "," << Qt::endl
<< " " << matrix[8] << "," << matrix[9] << "," << matrix[10] << "," << Qt::endl
<< " " << matrix[12] << "," << matrix[13] << "," << matrix[14] << ">" << Qt::endl;
*s << " matrix <" << matrix[0] << "," << matrix[1] << "," << matrix[2] << "," << endl
<< " " << matrix[4] << "," << matrix[5] << "," << matrix[6] << "," << endl
<< " " << matrix[8] << "," << matrix[9] << "," << matrix[10] << "," << endl
<< " " << matrix[12] << "," << matrix[13] << "," << matrix[14] << ">" << endl;

if (mPostSDL == NULL) {
*s << "}" << Qt::endl << Qt::endl;
*s << "}" << endl << endl;
} else {
*s << mPostSDL << Qt::endl;
*s << mPostSDL << endl;
}
}
}
Expand Down
Loading

0 comments on commit 2501c48

Please sign in to comment.