Skip to content

Commit

Permalink
Standard code beautification
Browse files Browse the repository at this point in the history
  • Loading branch information
gpospelov committed Jan 26, 2021
1 parent 17ac443 commit ff32dfc
Show file tree
Hide file tree
Showing 21 changed files with 25 additions and 27 deletions.
3 changes: 1 addition & 2 deletions examples/concurrentplot/concurrentplotcore/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const QString size_key = "size";
const QString pos_key = "pos";
} // namespace

MainWindow::MainWindow()
: m_graph_model(std::make_unique<GraphModel>())
MainWindow::MainWindow() : m_graph_model(std::make_unique<GraphModel>())
{
setCentralWidget(new GraphWidget(m_graph_model.get()));
initApplication();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ QBoxLayout* ContainerEditorWidget::create_button_layout()
return result;
}

} // namespace DragAndView
} // namespace DragAndMove
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ private slots:
SampleModel* m_model{nullptr};
};

} // namespace DragAndView
} // namespace DragAndMove

#endif // CONTAINEREDITORWIDGET_H
2 changes: 1 addition & 1 deletion examples/dragandmove/dragandmovecore/dragviewmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ bool DragViewModel::dropMimeData(const QMimeData* data, Qt::DropAction action, i
return false;
}

} // namespace DragAndView
} // namespace DragAndMove
2 changes: 1 addition & 1 deletion examples/dragandmove/dragandmovecore/dragviewmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ class DragViewModel : public ModelView::PropertyTableViewModel {
const QModelIndex& parent) override;
};

} // namespace DragAndView
} // namespace DragAndMove

#endif // DRAGVIEWMODEL_H
2 changes: 1 addition & 1 deletion examples/dragandmove/dragandmovecore/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ class MainWindow : public QMainWindow {
std::unique_ptr<SampleModel> m_model;
};

} // namespace DragAndView
} // namespace DragAndMove

#endif // MAINWINDOW_H
2 changes: 1 addition & 1 deletion examples/dragandmove/dragandmovecore/modeleditorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ void ModelEditorWidget::setupActions()
}
}

} // namespace DragAndView
} // namespace DragAndMove
2 changes: 1 addition & 1 deletion examples/dragandmove/dragandmovecore/modeleditorwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ private slots:
SampleModel* m_model{nullptr};
};

} // namespace DragAndView
} // namespace DragAndMove

#endif // MODELEDITORWIDGET_H
2 changes: 1 addition & 1 deletion examples/dragandmove/dragandmovecore/sampleitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ DemoContainerItem::DemoContainerItem() : CompoundItem(DemoContainerItemType)
registerTag(TagInfo::universalTag(T_ITEMS, {DemoItemType}), /*set_default*/ true);
}

} // namespace DragAndView
} // namespace DragAndMove
2 changes: 1 addition & 1 deletion examples/dragandmove/dragandmovecore/sampleitems.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ class DemoContainerItem : public ModelView::CompoundItem {
DemoContainerItem();
};

} // namespace DragAndView
} // namespace DragAndMove

#endif // SAMPLEITEMS_H
2 changes: 1 addition & 1 deletion examples/dragandmove/dragandmovecore/samplemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// ************************************************************************** //

#include "samplemodel.h"
#include "sampleitems.h"
#include "mvvm/utils/numericutils.h"
#include "mvvm/widgets/widgetutils.h"
#include "sampleitems.h"
#include <QColor>

namespace DragAndMove {
Expand Down
2 changes: 1 addition & 1 deletion examples/flateditor/flateditorcore/samplemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// ************************************************************************** //

#include "samplemodel.h"
#include "mvvm/model/itemcatalogue.h"
#include "sampleitems.h"
#include "mvvm/model/itemcatalogue.h"

using namespace ModelView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#include "applicationmodels.h"
#include "customeditorfactory.h"
#include "customlayerrowstrategy.h"
#include "samplemodel.h"
#include "mvvm/factories/viewmodelfactory.h"
#include "mvvm/viewmodel/standardchildrenstrategies.h"
#include "mvvm/viewmodel/viewmodeldelegate.h"
#include "samplemodel.h"
#include <QHeaderView>
#include <QTreeView>
#include <QVBoxLayout>
Expand Down
2 changes: 1 addition & 1 deletion examples/layereditor/layereditorcore/samplewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#include "materialmodel.h"
#include "materialtablewidget.h"
#include "multilayertreeview.h"
#include "samplemodel.h"
#include "mvvm/factories/viewmodelfactory.h"
#include "mvvm/widgets/itemstreeview.h"
#include "samplemodel.h"
#include <QTreeView>
#include <QVBoxLayout>

Expand Down
3 changes: 1 addition & 2 deletions examples/plotgraphs/plotgraphscore/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ const QString pos_key = "pos";

namespace PlotGraphs {

MainWindow::MainWindow()
: m_graph_model(std::make_unique<GraphModel>())
MainWindow::MainWindow() : m_graph_model(std::make_unique<GraphModel>())
{
setCentralWidget(new GraphWidget(m_graph_model.get()));
initApplication();
Expand Down
3 changes: 2 additions & 1 deletion examples/saveloadproject/saveloadprojectcore/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ void MainWindow::closeEvent(QCloseEvent* event)
if (m_projectHandler->canCloseProject()) {
writeSettings();
event->accept();
} else {
}
else {
event->ignore();
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/libmvvm_model/mvvm/commands/insertnewitemcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ void InsertNewItemCommand::execute_command()
auto child = p_impl->factory_func().release();
// here we restore original identifier to get exactly same item on consequitive undo/redo
if (!p_impl->initial_identifier.empty())
child->setData(QVariant::fromValue(p_impl->initial_identifier),
ItemDataRole::IDENTIFIER, /*direct*/true);
child->setData(QVariant::fromValue(p_impl->initial_identifier), ItemDataRole::IDENTIFIER,
/*direct*/ true);

setDescription(generate_description(child->modelType(), p_impl->tagrow));
if (parent->insertItem(child, p_impl->tagrow)) {
Expand Down
2 changes: 1 addition & 1 deletion source/libmvvm_model/mvvm/commands/setvaluecommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void SetValueCommand::swap_values()
{
auto item = itemFromPath(p_impl->m_item_path);
auto old = item->data<Variant>(p_impl->m_role);
auto result = item->setData(p_impl->m_value, p_impl->m_role, /*direct*/true);
auto result = item->setData(p_impl->m_value, p_impl->m_role, /*direct*/ true);
setResult(result);
setObsolete(!result);
p_impl->m_value = old;
Expand Down
4 changes: 2 additions & 2 deletions source/libmvvm_model/mvvm/model/taginfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
namespace ModelView {

//! Holds info about single tag for SessionItem.
//! The tag specifies information about children that can be added to a SessionItem. A tag has a name,
//! min, max allowed number of children, and vector of all modelTypes that children can have.
//! The tag specifies information about children that can be added to a SessionItem. A tag has a
//! name, min, max allowed number of children, and vector of all modelTypes that children can have.

class MVVM_MODEL_EXPORT TagInfo {
public:
Expand Down
6 changes: 3 additions & 3 deletions source/libmvvm_model/mvvm/signals/modelmapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@ void ModelMapper::callOnDataChange(SessionItem* item, int role)

//! Notifies all callbacks subscribed to "item data is changed" event.

void ModelMapper::callOnItemInserted(SessionItem* parent, const TagRow &tagrow)
void ModelMapper::callOnItemInserted(SessionItem* parent, const TagRow& tagrow)
{
if (p_impl->m_active)
p_impl->m_on_item_inserted(parent, tagrow);
}

void ModelMapper::callOnItemRemoved(SessionItem* parent, const TagRow &tagrow)
void ModelMapper::callOnItemRemoved(SessionItem* parent, const TagRow& tagrow)
{
if (p_impl->m_active)
p_impl->m_on_item_removed(parent, tagrow);
}

void ModelMapper::callOnItemAboutToBeRemoved(SessionItem* parent, const TagRow &tagrow)
void ModelMapper::callOnItemAboutToBeRemoved(SessionItem* parent, const TagRow& tagrow)
{
if (p_impl->m_active)
p_impl->m_on_item_about_removed(parent, tagrow);
Expand Down
1 change: 0 additions & 1 deletion tests/testviewmodel/standardchildrenstrategies.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ TEST_F(StandardChildrenStrategiesTest, PropertyItemsStrategyWhenHidden)
}
}


//! Testing PropertyItemsFlatStrategy.

TEST_F(StandardChildrenStrategiesTest, PropertyItemsFlatStrategy)
Expand Down

0 comments on commit ff32dfc

Please sign in to comment.