Skip to content

Conversation

@schumacb
Copy link
Contributor

No description provided.

schumacb added 4 commits May 12, 2017 10:06
Surpessed warnings for unused parameters (-Wunused-parameter) in NodeDataModel
Q_OBJECT macro removed, as it is already in base class
explicitly deleted copy constructor and assignment operator for classes with pointer members
@schumacb schumacb closed this May 12, 2017
, public Serializable
{

Q_OBJECT
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. By removing the Q_OBJECT you hide this class from qt meta object generator

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right, my bad.

PortType _requiredPort;

Node* _lastHoveredNode = nullptr;
Node* _lastHoveredNode{nullptr};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference to the previous version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case not very much, but List initialization should be preferred as it does not allow narrowing.

NodeDataType DestinationType;
RegistryItemPtr Model{};
NodeDataType SourceType{};
NodeDataType DestinationType{};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It properly initializes the members, and thus silences compiler warnings.

Copy link
Owner

@paceholder paceholder May 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I mistakenly assumed that std::unique_ptr and a struct of two std::string are properly initialized without special statements, i.e. the default-constructor for smart pointer would initialize it to nullptr and strings will be empty.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But yes, if we would add some int to the NodeDataType struct we would become some garbage without a proper initialization.

schumacb added 4 commits May 12, 2017 12:43
removed unnecessary breaks after return statements
replaced default branch of switch case with explicit enum value
hack to silence warning, this needs some proper handling
@paceholder
Copy link
Owner

Hi Bastian,

wirst Du diesen Pull-Request zurücksetzen?

Grüße,
Dmitry

@schumacb
Copy link
Contributor Author

Hallo Dmitry,
durch das entfernen des Q_OBJECT Makros ist das Kompilieren auf Appveyor und TravisCI fehlgeschlagen. Deshalb hatte ich den request geschlossen. Mittlerweile wird mein Fork jedoch einwandfrei erstellt.

Ich hoffe dass die änderungen beim erneuten öffnen mit hinzugefügt werden.

Gruß,
Bastian

@schumacb schumacb reopened this May 13, 2017
@paceholder paceholder merged commit abf6a41 into paceholder:master May 13, 2017
@paceholder
Copy link
Owner

Danke für die Korrekturen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants