[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 07/20: Use default and deleted function declarations.

noreply at xfce.org noreply at xfce.org
Thu Feb 6 12:03:24 CET 2020


This is an automated email from the git hooks/post-receive script.

g   o   t   t   c   o   d   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 56f37de4106b54b82961d11289c8099c9bfac74a
Author: Graeme Gott <graeme at gottcode.org>
Date:   Sat Feb 1 19:49:15 2020 -0500

    Use default and deleted function declarations.
---
 panel-plugin/command-edit.h         |  7 ++++++-
 panel-plugin/command.h              |  5 +++++
 panel-plugin/configuration-dialog.h |  5 +++++
 panel-plugin/element.h              | 27 +++++++++++----------------
 panel-plugin/launcher-view.h        | 16 ++++++++--------
 panel-plugin/page.h                 |  7 ++++++-
 panel-plugin/plugin.h               |  7 ++++++-
 panel-plugin/profile-picture.h      |  7 ++++++-
 panel-plugin/query.cpp              | 13 -------------
 panel-plugin/query.h                |  5 ++---
 panel-plugin/resizer-widget.h       |  7 ++++++-
 panel-plugin/section-button.h       |  7 ++++++-
 panel-plugin/settings.h             |  9 ++++++---
 panel-plugin/window.h               |  7 ++++++-
 14 files changed, 79 insertions(+), 50 deletions(-)

diff --git a/panel-plugin/command-edit.h b/panel-plugin/command-edit.h
index 243acb5..97c815a 100644
--- a/panel-plugin/command-edit.h
+++ b/panel-plugin/command-edit.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013-2020 Graeme Gott <graeme at gottcode.org>
  *
  * This library is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -30,6 +30,11 @@ class CommandEdit
 public:
 	CommandEdit(Command* command, GtkSizeGroup* label_size_group);
 
+	CommandEdit(const CommandEdit&) = delete;
+	CommandEdit(CommandEdit&&) = delete;
+	CommandEdit& operator=(const CommandEdit&) = delete;
+	CommandEdit& operator=(CommandEdit&&) = delete;
+
 	GtkWidget* get_widget() const
 	{
 		return m_widget;
diff --git a/panel-plugin/command.h b/panel-plugin/command.h
index c7097ce..1e812c7 100644
--- a/panel-plugin/command.h
+++ b/panel-plugin/command.h
@@ -29,6 +29,11 @@ public:
 	Command(const gchar* icon, const gchar* text, const gchar* command, const gchar* error_text, const gchar* confirm_question = nullptr, const gchar* confirm_status = nullptr);
 	~Command();
 
+	Command(const Command&) = delete;
+	Command(Command&&) = delete;
+	Command& operator=(const Command&) = delete;
+	Command& operator=(Command&&) = delete;
+
 	GtkWidget* get_button();
 	GtkWidget* get_menuitem();
 
diff --git a/panel-plugin/configuration-dialog.h b/panel-plugin/configuration-dialog.h
index 81fa338..d6d2f42 100644
--- a/panel-plugin/configuration-dialog.h
+++ b/panel-plugin/configuration-dialog.h
@@ -35,6 +35,11 @@ public:
 	explicit ConfigurationDialog(Plugin* plugin);
 	~ConfigurationDialog();
 
+	ConfigurationDialog(const ConfigurationDialog&) = delete;
+	ConfigurationDialog(ConfigurationDialog&&) = delete;
+	ConfigurationDialog& operator=(const ConfigurationDialog&) = delete;
+	ConfigurationDialog& operator=(ConfigurationDialog&&) = delete;
+
 	GtkWidget* get_widget() const
 	{
 		return m_window;
diff --git a/panel-plugin/element.h b/panel-plugin/element.h
index a59c9fc..47f6060 100644
--- a/panel-plugin/element.h
+++ b/panel-plugin/element.h
@@ -29,14 +29,6 @@ class Query;
 class Element
 {
 public:
-	Element() :
-		m_icon(nullptr),
-		m_text(nullptr),
-		m_tooltip(nullptr),
-		m_sort_key(nullptr)
-	{
-	}
-
 	virtual ~Element()
 	{
 		if (m_icon)
@@ -48,6 +40,11 @@ public:
 		g_free(m_sort_key);
 	}
 
+	Element(const Element&) = delete;
+	Element(Element&&) = delete;
+	Element& operator=(const Element&) = delete;
+	Element& operator=(Element&&) = delete;
+
 	GIcon* get_icon() const
 	{
 		return m_icon;
@@ -78,6 +75,8 @@ public:
 	}
 
 protected:
+	Element() = default;
+
 	void set_icon(const gchar* icon);
 
 	void set_text(const gchar* text)
@@ -103,14 +102,10 @@ protected:
 	}
 
 private:
-	Element(const Element&);
-	Element& operator=(const Element&);
-
-private:
-	GIcon* m_icon;
-	gchar* m_text;
-	gchar* m_tooltip;
-	gchar* m_sort_key;
+	GIcon* m_icon = nullptr;
+	gchar* m_text = nullptr;
+	gchar* m_tooltip = nullptr;
+	gchar* m_sort_key = nullptr;
 };
 
 }
diff --git a/panel-plugin/launcher-view.h b/panel-plugin/launcher-view.h
index ef96751..216e4cc 100644
--- a/panel-plugin/launcher-view.h
+++ b/panel-plugin/launcher-view.h
@@ -26,14 +26,12 @@ namespace WhiskerMenu
 class LauncherView
 {
 public:
-	LauncherView() :
-		m_model(nullptr)
-	{
-	}
+	virtual ~LauncherView() = default;
 
-	virtual ~LauncherView()
-	{
-	}
+	LauncherView(const LauncherView&) = delete;
+	LauncherView(LauncherView&&) = delete;
+	LauncherView& operator=(const LauncherView&) = delete;
+	LauncherView& operator=(LauncherView&&) = delete;
 
 	virtual GtkWidget* get_widget() const=0;
 
@@ -79,7 +77,9 @@ public:
 	};
 
 protected:
-	GtkTreeModel* m_model;
+	LauncherView() = default;
+
+	GtkTreeModel* m_model = nullptr;
 };
 
 }
diff --git a/panel-plugin/page.h b/panel-plugin/page.h
index 7c5ab8a..8189037 100644
--- a/panel-plugin/page.h
+++ b/panel-plugin/page.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2017, 2018, 2019, 2020 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013-2020 Graeme Gott <graeme at gottcode.org>
  *
  * This library is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -34,6 +34,11 @@ public:
 	explicit Page(WhiskerMenu::Window *window);
 	virtual ~Page();
 
+	Page(const Page&) = delete;
+	Page(Page&&) = delete;
+	Page& operator=(const Page&) = delete;
+	Page& operator=(Page&&) = delete;
+
 	GtkWidget* get_widget() const
 	{
 		return m_widget;
diff --git a/panel-plugin/plugin.h b/panel-plugin/plugin.h
index c21e9fb..3e51fcb 100644
--- a/panel-plugin/plugin.h
+++ b/panel-plugin/plugin.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013-2020 Graeme Gott <graeme at gottcode.org>
  *
  * This library is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,6 +36,11 @@ public:
 	explicit Plugin(XfcePanelPlugin* plugin);
 	~Plugin();
 
+	Plugin(const Plugin&) = delete;
+	Plugin(Plugin&&) = delete;
+	Plugin& operator=(const Plugin&) = delete;
+	Plugin& operator=(Plugin&&) = delete;
+
 	GtkWidget* get_button() const
 	{
 		return m_button;
diff --git a/panel-plugin/profile-picture.h b/panel-plugin/profile-picture.h
index 72cd3a4..f2e5541 100644
--- a/panel-plugin/profile-picture.h
+++ b/panel-plugin/profile-picture.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014, 2016, 2020 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2014-2020 Graeme Gott <graeme at gottcode.org>
  *
  * This library is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,6 +31,11 @@ public:
 	ProfilePicture(Window* window);
 	~ProfilePicture();
 
+	ProfilePicture(const ProfilePicture&) = delete;
+	ProfilePicture(ProfilePicture&&) = delete;
+	ProfilePicture& operator=(const ProfilePicture&) = delete;
+	ProfilePicture& operator=(ProfilePicture&&) = delete;
+
 	GtkWidget* get_widget() const
 	{
 		return m_container;
diff --git a/panel-plugin/query.cpp b/panel-plugin/query.cpp
index 6b98c12..589b0f9 100644
--- a/panel-plugin/query.cpp
+++ b/panel-plugin/query.cpp
@@ -35,12 +35,6 @@ static inline bool is_start_word(const std::string& string, std::string::size_ty
 
 //-----------------------------------------------------------------------------
 
-Query::Query()
-{
-}
-
-//-----------------------------------------------------------------------------
-
 Query::Query(const std::string& query)
 {
 	set(query);
@@ -48,13 +42,6 @@ Query::Query(const std::string& query)
 
 //-----------------------------------------------------------------------------
 
-Query::~Query()
-{
-	clear();
-}
-
-//-----------------------------------------------------------------------------
-
 unsigned int Query::match(const std::string& haystack) const
 {
 	// Make sure haystack is longer than query
diff --git a/panel-plugin/query.h b/panel-plugin/query.h
index 0c1fa75..aac35ee 100644
--- a/panel-plugin/query.h
+++ b/panel-plugin/query.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2015 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013-2020 Graeme Gott <graeme at gottcode.org>
  *
  * This library is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,9 +27,8 @@ namespace WhiskerMenu
 class Query
 {
 public:
-	Query();
+	Query() = default;
 	explicit Query(const std::string& query);
-	~Query();
 
 	bool empty() const
 	{
diff --git a/panel-plugin/resizer-widget.h b/panel-plugin/resizer-widget.h
index a3e7428..b87b6af 100644
--- a/panel-plugin/resizer-widget.h
+++ b/panel-plugin/resizer-widget.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2016 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013-2020 Graeme Gott <graeme at gottcode.org>
  *
  * This library is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,6 +31,11 @@ public:
 	explicit ResizerWidget(GtkWindow* window);
 	~ResizerWidget();
 
+	ResizerWidget(const ResizerWidget&) = delete;
+	ResizerWidget(ResizerWidget&&) = delete;
+	ResizerWidget& operator=(const ResizerWidget&) = delete;
+	ResizerWidget& operator=(ResizerWidget&&) = delete;
+
 	GtkWidget* get_widget() const
 	{
 		return m_drawing;
diff --git a/panel-plugin/section-button.h b/panel-plugin/section-button.h
index 5faccb9..9e90936 100644
--- a/panel-plugin/section-button.h
+++ b/panel-plugin/section-button.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2016, 2017, 2020 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013-2020 Graeme Gott <graeme at gottcode.org>
  *
  * This library is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -29,6 +29,11 @@ public:
 	SectionButton(GIcon* icon, const gchar* text);
 	~SectionButton();
 
+	SectionButton(const SectionButton&) = delete;
+	SectionButton(SectionButton&&) = delete;
+	SectionButton& operator=(const SectionButton&) = delete;
+	SectionButton& operator=(SectionButton&&) = delete;
+
 	GtkWidget* get_widget() const
 	{
 		return GTK_WIDGET(m_button);
diff --git a/panel-plugin/settings.h b/panel-plugin/settings.h
index c77cf72..20f4d93 100644
--- a/panel-plugin/settings.h
+++ b/panel-plugin/settings.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2014, 2016, 2018, 2019 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013-2020 Graeme Gott <graeme at gottcode.org>
  *
  * This library is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -33,10 +33,13 @@ class SearchAction;
 class Settings
 {
 	Settings();
-	Settings(const Settings&);
-	Settings& operator=(const Settings&);
 	~Settings();
 
+	Settings(const Settings&) = delete;
+	Settings(Settings&&) = delete;
+	Settings& operator=(const Settings&) = delete;
+	Settings& operator=(Settings&&) = delete;
+
 	void load(char* file);
 	void save(char* file);
 
diff --git a/panel-plugin/window.h b/panel-plugin/window.h
index f7181d9..c09ef82 100644
--- a/panel-plugin/window.h
+++ b/panel-plugin/window.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2014, 2015, 2016, 2018, 2020 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013-2020 Graeme Gott <graeme at gottcode.org>
  *
  * This library is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -41,6 +41,11 @@ public:
 	explicit Window(Plugin* plugin);
 	~Window();
 
+	Window(const Window&) = delete;
+	Window(Window&&) = delete;
+	Window& operator=(const Window&) = delete;
+	Window& operator=(Window&&) = delete;
+
 	enum Position
 	{
 		PositionHorizontal = GTK_ORIENTATION_HORIZONTAL,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list