Skip to content

Commit

Permalink
Use =default and remove duplicate constructor calls
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Oct 31, 2023
1 parent 46c6410 commit 659f0b8
Show file tree
Hide file tree
Showing 23 changed files with 35 additions and 70 deletions.
4 changes: 1 addition & 3 deletions src/Dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ Dialog::Dialog()
}

/////////////////////////////////////////////////
Dialog::~Dialog()
{
}
Dialog::~Dialog() = default;

/////////////////////////////////////////////////
QQuickWindow *Dialog::QuickWindow() const
Expand Down
4 changes: 1 addition & 3 deletions src/MainWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ MainWindow::MainWindow()
}

/////////////////////////////////////////////////
MainWindow::~MainWindow()
{
}
MainWindow::~MainWindow() = default;

/////////////////////////////////////////////////
QStringList MainWindow::PluginListModel() const
Expand Down
8 changes: 2 additions & 6 deletions src/PlottingInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ PlotData::PlotData() :
}

//////////////////////////////////////////////////////
PlotData::~PlotData()
{
}
PlotData::~PlotData() = default;

//////////////////////////////////////////////////////
void PlotData::SetValue(const double _value)
Expand Down Expand Up @@ -496,9 +494,7 @@ PlottingInterface::PlottingInterface() : QObject(),
}

//////////////////////////////////////////////////////
PlottingInterface::~PlottingInterface()
{
}
PlottingInterface::~PlottingInterface() = default;

//////////////////////////////////////////////////////
void PlottingInterface::unsubscribe(int _chart,
Expand Down
6 changes: 2 additions & 4 deletions src/plugins/camera_fps/CameraFps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,12 @@ void CameraFps::OnRender()

/////////////////////////////////////////////////
CameraFps::CameraFps()
: Plugin(), dataPtr(new CameraFpsPrivate)
: dataPtr(new CameraFpsPrivate)
{
}

/////////////////////////////////////////////////
CameraFps::~CameraFps()
{
}
CameraFps::~CameraFps() = default;

/////////////////////////////////////////////////
void CameraFps::LoadConfig(const tinyxml2::XMLElement *)
Expand Down
6 changes: 2 additions & 4 deletions src/plugins/camera_tracking/CameraTracking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ void CameraTrackingPrivate::OnRender()

/////////////////////////////////////////////////
CameraTracking::CameraTracking()
: Plugin(), dataPtr(new CameraTrackingPrivate)
: dataPtr(new CameraTrackingPrivate)
{
this->dataPtr->timer = new QTimer(this);
this->connect(this->dataPtr->timer, &QTimer::timeout, [=]()
Expand All @@ -446,9 +446,7 @@ CameraTracking::CameraTracking()
}

/////////////////////////////////////////////////
CameraTracking::~CameraTracking()
{
}
CameraTracking::~CameraTracking() = default;

/////////////////////////////////////////////////
void CameraTracking::LoadConfig(const tinyxml2::XMLElement *)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grid_config/GridConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace gz::gui

/////////////////////////////////////////////////
GridConfig::GridConfig()
: gz::gui::Plugin(), dataPtr(std::make_unique<GridConfigPrivate>())
: dataPtr(std::make_unique<GridConfigPrivate>())
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/image_display/ImageDisplay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ImageDisplayPrivate

/////////////////////////////////////////////////
ImageDisplay::ImageDisplay()
: Plugin(), dataPtr(new ImageDisplayPrivate)
: dataPtr(new ImageDisplayPrivate)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ bool InteractiveViewControlPrivate::OnViewControlSensitivity(

/////////////////////////////////////////////////
InteractiveViewControl::InteractiveViewControl()
: Plugin(), dataPtr(std::make_unique<InteractiveViewControlPrivate>())
: dataPtr(std::make_unique<InteractiveViewControlPrivate>())
{
}

Expand Down
6 changes: 2 additions & 4 deletions src/plugins/key_publisher/KeyPublisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,15 @@ class KeyPublisherPrivate
};

/////////////////////////////////////////////////
KeyPublisher::KeyPublisher(): Plugin(), dataPtr(new KeyPublisherPrivate)
KeyPublisher::KeyPublisher(): dataPtr(new KeyPublisherPrivate)
{
// Advertise publisher node
this->dataPtr->pub = this->dataPtr->node.Advertise<msgs::Int32>
(this->dataPtr->topic);
}

/////////////////////////////////////////////////
KeyPublisher::~KeyPublisher()
{
}
KeyPublisher::~KeyPublisher() = default;

/////////////////////////////////////////////////
void KeyPublisher::LoadConfig(const tinyxml2::XMLElement *)
Expand Down
6 changes: 2 additions & 4 deletions src/plugins/marker_manager/MarkerManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -659,14 +659,12 @@ void MarkerManagerPrivate::OnWorldStatsMsg(

/////////////////////////////////////////////////
MarkerManager::MarkerManager()
: Plugin(), dataPtr(new MarkerManagerPrivate)
: dataPtr(new MarkerManagerPrivate)
{
}

/////////////////////////////////////////////////
MarkerManager::~MarkerManager()
{
}
MarkerManager::~MarkerManager() = default;

/////////////////////////////////////////////////
void MarkerManager::LoadConfig(const tinyxml2::XMLElement * _pluginElem)
Expand Down
6 changes: 2 additions & 4 deletions src/plugins/navsat_map/NavSatMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@ class NavSatMapPrivate

/////////////////////////////////////////////////
NavSatMap::NavSatMap()
: Plugin(), dataPtr(new NavSatMapPrivate)
: dataPtr(new NavSatMapPrivate)
{
}

/////////////////////////////////////////////////
NavSatMap::~NavSatMap()
{
}
NavSatMap::~NavSatMap() = default;

/////////////////////////////////////////////////
void NavSatMap::LoadConfig(const tinyxml2::XMLElement *_pluginElem)
Expand Down
6 changes: 2 additions & 4 deletions src/plugins/plotting/TransportPlotting.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
namespace gz::gui::plugins
{
//////////////////////////////////////////
TransportPlotting::~TransportPlotting()
{
}
TransportPlotting::~TransportPlotting() = default;

//////////////////////////////////////////
void TransportPlotting::LoadConfig(const tinyxml2::XMLElement *)
Expand All @@ -32,7 +30,7 @@ void TransportPlotting::LoadConfig(const tinyxml2::XMLElement *)
}

//////////////////////////////////////////
TransportPlotting::TransportPlotting() : Plugin(),
TransportPlotting::TransportPlotting() :
dataPtr(new PlottingInterface)
{
}
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/point_cloud/PointCloud.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ using namespace plugins;

/////////////////////////////////////////////////
PointCloud::PointCloud()
: gz::gui::Plugin(),
dataPtr(std::make_unique<PointCloudPrivate>())
: dataPtr(std::make_unique<PointCloudPrivate>())
{
}

Expand Down
6 changes: 2 additions & 4 deletions src/plugins/publisher/Publisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@ class PublisherPrivate

/////////////////////////////////////////////////
Publisher::Publisher()
: Plugin(), dataPtr(new PublisherPrivate)
: dataPtr(new PublisherPrivate)
{
}

/////////////////////////////////////////////////
Publisher::~Publisher()
{
}
Publisher::~Publisher() = default;

/////////////////////////////////////////////////
void Publisher::LoadConfig(const tinyxml2::XMLElement *_pluginElem)
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/screenshot/Screenshot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ class ScreenshotPrivate

/////////////////////////////////////////////////
Screenshot::Screenshot()
: gui::Plugin(),
dataPtr(std::make_unique<ScreenshotPrivate>())
: dataPtr(std::make_unique<ScreenshotPrivate>())
{
std::string home;
common::env(GZ_HOMEDIR, home);
Expand Down
4 changes: 1 addition & 3 deletions src/plugins/shutdown_button/ShutdownButton.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
namespace gz::gui::plugins
{
/////////////////////////////////////////////////
ShutdownButton::ShutdownButton() : Plugin()
{
}
ShutdownButton::ShutdownButton() = default;

/////////////////////////////////////////////////
ShutdownButton::~ShutdownButton() = default;
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/tape_measure/TapeMeasure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ class TapeMeasurePrivate

/////////////////////////////////////////////////
TapeMeasure::TapeMeasure()
: gz::gui::Plugin(),
dataPtr(std::make_unique<TapeMeasurePrivate>())
: dataPtr(std::make_unique<TapeMeasurePrivate>())
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/teleop/Teleop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class TeleopPrivate
};

/////////////////////////////////////////////////
Teleop::Teleop(): Plugin(), dataPtr(std::make_unique<TeleopPrivate>())
Teleop::Teleop(): dataPtr(std::make_unique<TeleopPrivate>())
{
// Initialize publisher using default topic.
this->dataPtr->cmdVelPub = transport::Node::Publisher();
Expand Down
6 changes: 2 additions & 4 deletions src/plugins/topic_echo/TopicEcho.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,15 @@ class TopicEchoPrivate

/////////////////////////////////////////////////
TopicEcho::TopicEcho()
: Plugin(), dataPtr(new TopicEchoPrivate)
: dataPtr(new TopicEchoPrivate)
{
// Connect model
App()->Engine()->rootContext()->setContextProperty("TopicEchoMsgList",
&this->dataPtr->msgList);
}

/////////////////////////////////////////////////
TopicEcho::~TopicEcho()
{
}
TopicEcho::~TopicEcho() = default;

/////////////////////////////////////////////////
void TopicEcho::LoadConfig(const tinyxml2::XMLElement * /*_pluginElem*/)
Expand Down
6 changes: 2 additions & 4 deletions src/plugins/topic_viewer/TopicViewer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class TopicViewerPrivate
public: std::vector<google::protobuf::FieldDescriptor::Type> plotableTypes;
};

TopicViewer::TopicViewer() : Plugin(), dataPtr(new TopicViewerPrivate)
TopicViewer::TopicViewer() : dataPtr(new TopicViewerPrivate)
{
using namespace google::protobuf;
this->dataPtr->plotableTypes.push_back(FieldDescriptor::Type::TYPE_DOUBLE);
Expand All @@ -161,9 +161,7 @@ TopicViewer::TopicViewer() : Plugin(), dataPtr(new TopicViewerPrivate)
}

//////////////////////////////////////////////////
TopicViewer::~TopicViewer()
{
}
TopicViewer::~TopicViewer() = default;

//////////////////////////////////////////////////
void TopicViewer::LoadConfig(const tinyxml2::XMLElement *)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class TransportSceneManagerPrivate

/////////////////////////////////////////////////
TransportSceneManager::TransportSceneManager()
: Plugin(), dataPtr(new TransportSceneManagerPrivate)
: dataPtr(new TransportSceneManagerPrivate)
{
}

Expand Down
6 changes: 2 additions & 4 deletions src/plugins/world_control/WorldControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,12 @@ class WorldControlPrivate

/////////////////////////////////////////////////
WorldControl::WorldControl()
: Plugin(), dataPtr(new WorldControlPrivate)
: dataPtr(new WorldControlPrivate)
{
}

/////////////////////////////////////////////////
WorldControl::~WorldControl()
{
}
WorldControl::~WorldControl() = default;

/////////////////////////////////////////////////
void WorldControl::LoadConfig(const tinyxml2::XMLElement *_pluginElem)
Expand Down
6 changes: 2 additions & 4 deletions src/plugins/world_stats/WorldStats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ class WorldStatsPrivate

/////////////////////////////////////////////////
WorldStats::WorldStats()
: Plugin(), dataPtr(new WorldStatsPrivate)
: dataPtr(new WorldStatsPrivate)
{
}

/////////////////////////////////////////////////
WorldStats::~WorldStats()
{
}
WorldStats::~WorldStats() = default;

/////////////////////////////////////////////////
void WorldStats::LoadConfig(const tinyxml2::XMLElement *_pluginElem)
Expand Down

0 comments on commit 659f0b8

Please sign in to comment.