Mon, 06 Mar 2017 00:40:23 +0200
NewPartDialog is no longer a HierarchyElement.
--- a/src/dialogs/newpartdialog.cpp Mon Mar 06 00:36:40 2017 +0200 +++ b/src/dialogs/newpartdialog.cpp Mon Mar 06 00:40:23 2017 +0200 @@ -21,15 +21,15 @@ #include <QCheckBox> #include "../lddocument.h" #include "../mainwindow.h" -#include "newpartdialog.h" -#include "ui_newpartdialog.h" #include "../linetypes/comment.h" #include "../linetypes/empty.h" +#include "../miscallenous.h" +#include "newpartdialog.h" +#include "ui_newpartdialog.h" NewPartDialog::NewPartDialog (QWidget *parent) : - QDialog (parent), - HierarchyElement (parent), - ui (*new Ui_NewPart) + QDialog {parent}, + ui {*new Ui_NewPart} { ui.setupUi (this);
--- a/src/dialogs/newpartdialog.h Mon Mar 06 00:36:40 2017 +0200 +++ b/src/dialogs/newpartdialog.h Mon Mar 06 00:40:23 2017 +0200 @@ -21,7 +21,7 @@ #include "../main.h" #include "../linetypes/modelobject.h" -class NewPartDialog : public QDialog, HierarchyElement +class NewPartDialog : public QDialog { Q_OBJECT public:
--- a/src/hierarchyelement.cpp Mon Mar 06 00:36:40 2017 +0200 +++ b/src/hierarchyelement.cpp Mon Mar 06 00:40:23 2017 +0200 @@ -73,10 +73,3 @@ { return m_window->mathFunctions(); } - - -QString HierarchyElement::preferredLicenseText() const -{ - QString caLicenseText = "!LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt"; - return configuration().useCaLicense() ? caLicenseText : ""; -}
--- a/src/hierarchyelement.h Mon Mar 06 00:36:40 2017 +0200 +++ b/src/hierarchyelement.h Mon Mar 06 00:40:23 2017 +0200 @@ -45,9 +45,6 @@ Grid* grid() const; MathFunctions* math() const; - // Utility functions - QString preferredLicenseText() const; - // Format and print the given args to the message log. template<typename... Args> void print(QString formatString, Args... args)
--- a/src/miscallenous.cpp Mon Mar 06 00:36:40 2017 +0200 +++ b/src/miscallenous.cpp Mon Mar 06 00:40:23 2017 +0200 @@ -91,3 +91,9 @@ magnitude = qBound(0, magnitude, countof(suffixes) - 1); return QString::number(size / pow(1000, magnitude)) + suffixes[magnitude]; } + +QString preferredLicenseText() +{ + QString caLicenseText = "!LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt"; + return configuration().useCaLicense() ? caLicenseText : ""; +}
--- a/src/miscallenous.h Mon Mar 06 00:36:40 2017 +0200 +++ b/src/miscallenous.h Mon Mar 06 00:40:23 2017 +0200 @@ -36,6 +36,7 @@ QString joinStrings (QList<StringFormatArg> vals, QString delim = " "); void roundToDecimals (double& value, int decimals); void simplify (int& numer, int& denom); +QString preferredLicenseText(); /* * Rounds the input value to the nearest multiple of the provided interval.