Wrap code for better readability

This commit is contained in:
Simon De Backer
2020-09-07 22:03:40 +02:00
parent 8ee38fab9e
commit 5d92393ee7
202 changed files with 4031 additions and 2153 deletions

View File

@@ -55,7 +55,8 @@ bool ChangeElementInformationCommand::mergeWith(const QUndoCommand *other)
/**
@brief ChangeElementInformationCommand::undo
*/
void ChangeElementInformationCommand::undo() {
void ChangeElementInformationCommand::undo()
{
m_element -> setElementInformations(m_old_info);
updateProjectDB();
}
@@ -63,7 +64,8 @@ void ChangeElementInformationCommand::undo() {
/**
@brief ChangeElementInformationCommand::redo
*/
void ChangeElementInformationCommand::redo() {
void ChangeElementInformationCommand::redo()
{
m_element -> setElementInformations(m_new_info);
updateProjectDB();
}

View File

@@ -46,8 +46,7 @@ class ChangeElementInformationCommand : public QUndoCommand
private:
Element *m_element;
DiagramContext m_old_info,
m_new_info;
DiagramContext m_old_info, m_new_info;
};
#endif // CHANGEELEMENTINFORMATIONCOMMAND_H

View File

@@ -38,7 +38,8 @@ ChangeTitleBlockCommand::ChangeTitleBlockCommand(
new_titleblock(new_ip)
{}
ChangeTitleBlockCommand::~ChangeTitleBlockCommand() {}
ChangeTitleBlockCommand::~ChangeTitleBlockCommand()
{}
void ChangeTitleBlockCommand::undo()
{

View File

@@ -109,7 +109,8 @@ DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand(
m_diagram->qgiManager().manage(m_removed_contents.items(DiagramContent::All));
}
DeleteQGraphicsItemCommand::~DeleteQGraphicsItemCommand() {
DeleteQGraphicsItemCommand::~DeleteQGraphicsItemCommand()
{
m_diagram->qgiManager().release(m_removed_contents.items(DiagramContent::All));
}

View File

@@ -50,7 +50,8 @@ void ModelIndexCommand::setData(const QVariant &value, int role)
@brief ModelIndexCommand::redo
Reimplemented from QUndoCommand
*/
void ModelIndexCommand::redo() {
void ModelIndexCommand::redo()
{
if (m_model && m_index.isValid()) {
m_model->setData(m_index, m_new_value, m_role);
}
@@ -60,7 +61,8 @@ void ModelIndexCommand::redo() {
@brief ModelIndexCommand::undo
Reimplemented from QUndoCommand
*/
void ModelIndexCommand::undo() {
void ModelIndexCommand::undo()
{
if (m_model && m_index.isValid()) {
m_model->setData(m_index, m_old_value, m_role);
}

View File

@@ -163,7 +163,8 @@ void LinkElementCommand::unlink(QList<Element *> element_list)
@brief LinkElementCommand::unlinkAll
Unlink all element of the edited element
*/
void LinkElementCommand::unlinkAll() {
void LinkElementCommand::unlinkAll()
{
m_linked_after.clear();
}
@@ -230,11 +231,11 @@ void LinkElementCommand::redo()
@param element_list
@param already_link
*/
void LinkElementCommand::setUpNewLink(const QList<Element *> &element_list,
bool already_link)
void LinkElementCommand::setUpNewLink(
const QList<Element *> &element_list, bool already_link)
{
//m_element is a master we can connect several element to it
//if m_element isn't master (may be a report or slave) we can connect only one element
//m_element is a master we can connect several element to it
//if m_element isn't master (may be a report or slave) we can connect only one element
if (m_element->linkType() == Element::Master || element_list.size() == 1)
{
foreach(Element *elmt, element_list)