# HG changeset patch # User Teemu Piippo # Date 1488753623 -7200 # Node ID 0908803938f977f3270574220e1959739d78ffa7 # Parent fead30e6c557ee3fe5e69b0e981d28d2535ed8d6 NewPartDialog is no longer a HierarchyElement. diff -r fead30e6c557 -r 0908803938f9 src/dialogs/newpartdialog.cpp --- 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 #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); diff -r fead30e6c557 -r 0908803938f9 src/dialogs/newpartdialog.h --- 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: diff -r fead30e6c557 -r 0908803938f9 src/hierarchyelement.cpp --- 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 : ""; -} diff -r fead30e6c557 -r 0908803938f9 src/hierarchyelement.h --- 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 void print(QString formatString, Args... args) diff -r fead30e6c557 -r 0908803938f9 src/miscallenous.cpp --- 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 : ""; +} diff -r fead30e6c557 -r 0908803938f9 src/miscallenous.h --- 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 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.