[gnome-commander] [style] Adds explicit keyword to constructors where possible



commit 05180b9f65a7e24c8981d65d221a39c660c6cbab
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Sun Oct 2 19:23:56 2016 +0200

    [style] Adds explicit keyword to constructors where possible

 src/dialogs/gnome-cmd-advrename-dialog.h    |    2 +-
 src/dialogs/gnome-cmd-search-dialog.cc      |    4 ++--
 src/dialogs/gnome-cmd-search-dialog.h       |    2 +-
 src/gnome-cmd-advrename-profile-component.h |    2 +-
 src/gnome-cmd-data.h                        |    2 +-
 src/gnome-cmd-file-list.cc                  |    2 +-
 src/gnome-cmd-notebook.h                    |    2 +-
 src/gnome-cmd-plain-path.h                  |    8 ++++----
 src/gnome-cmd-smb-path.h                    |    2 +-
 src/gnome-cmd-xml-config.h                  |    4 ++--
 src/history.h                               |    2 +-
 src/tuple.h                                 |    2 +-
 12 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-advrename-dialog.h b/src/dialogs/gnome-cmd-advrename-dialog.h
index 5ed8553..f9946d4 100644
--- a/src/dialogs/gnome-cmd-advrename-dialog.h
+++ b/src/dialogs/gnome-cmd-advrename-dialog.h
@@ -59,7 +59,7 @@ struct GnomeCmdAdvrenameDialog
 
     GtkTreeModel *files;
 
-    GnomeCmdAdvrenameDialog(GnomeCmdData::AdvrenameConfig &defaults);
+    explicit GnomeCmdAdvrenameDialog(GnomeCmdData::AdvrenameConfig &defaults);
     ~GnomeCmdAdvrenameDialog();
 
     void set(GList *files);
diff --git a/src/dialogs/gnome-cmd-search-dialog.cc b/src/dialogs/gnome-cmd-search-dialog.cc
index 4171bd4..75e6eb8 100644
--- a/src/dialogs/gnome-cmd-search-dialog.cc
+++ b/src/dialogs/gnome-cmd-search-dialog.cc
@@ -97,7 +97,7 @@ struct SearchData
     gboolean stopped;                           /**< stops the search routine if set to TRUE. This is done 
by the stop_button */
     gboolean dialog_destroyed;                  /**< set when the search dialog is destroyed, also stops the 
search of course */
 
-    SearchData(GnomeCmdSearchDialog *dlg);
+    explicit SearchData(GnomeCmdSearchDialog *dlg);
 
     void set_statusmsg(const gchar *msg=NULL);
     gchar *build_search_command();
@@ -125,7 +125,7 @@ struct GnomeCmdSearchDialog::Private
     GtkWidget *pbar;
     GtkWidget *profile_menu_button;
 
-    Private(GnomeCmdSearchDialog *dlg);
+    explicit Private(GnomeCmdSearchDialog *dlg);
     ~Private();
 
     static gchar *translate_menu(const gchar *path, gpointer data);
diff --git a/src/dialogs/gnome-cmd-search-dialog.h b/src/dialogs/gnome-cmd-search-dialog.h
index 26270e0..a7d6381 100644
--- a/src/dialogs/gnome-cmd-search-dialog.h
+++ b/src/dialogs/gnome-cmd-search-dialog.h
@@ -57,7 +57,7 @@ struct GnomeCmdSearchDialog
 
     void show_and_set_focus();
 
-    GnomeCmdSearchDialog(GnomeCmdData::SearchConfig &defaults);
+    explicit GnomeCmdSearchDialog(GnomeCmdData::SearchConfig &defaults);
     ~GnomeCmdSearchDialog();
 };
 
diff --git a/src/gnome-cmd-advrename-profile-component.h b/src/gnome-cmd-advrename-profile-component.h
index 5312c47..797ce45 100644
--- a/src/gnome-cmd-advrename-profile-component.h
+++ b/src/gnome-cmd-advrename-profile-component.h
@@ -51,7 +51,7 @@ struct GnomeCmdAdvrenameProfileComponent
 
     GnomeCmdData::AdvrenameConfig::Profile &profile;
 
-    GnomeCmdAdvrenameProfileComponent(GnomeCmdData::AdvrenameConfig::Profile &profile);
+    explicit GnomeCmdAdvrenameProfileComponent(GnomeCmdData::AdvrenameConfig::Profile &profile);
     ~GnomeCmdAdvrenameProfileComponent()     {}
 
     void update();
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 029ed79..d418e9a 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -502,7 +502,7 @@ struct GnomeCmdData
 
         std::vector<Selection> &profiles;
 
-        SearchConfig(std::vector<Selection> &selections): width(600), height(400), 
name_patterns(SEARCH_HISTORY_SIZE), content_patterns(SEARCH_HISTORY_SIZE), profiles(selections)   {  
default_profile.name = "Default";  }
+        explicit SearchConfig(std::vector<Selection> &selections): width(600), height(400), 
name_patterns(SEARCH_HISTORY_SIZE), content_patterns(SEARCH_HISTORY_SIZE), profiles(selections)   {  
default_profile.name = "Default";  }
 
         friend XML::xstream &operator << (XML::xstream &xml, SearchConfig &cfg);
     };
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index f279a31..10e4c66 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -172,7 +172,7 @@ struct GnomeCmdFileList::Private
 
     GtkItemFactory *ifac;
 
-    Private(GnomeCmdFileList *fl);
+    explicit Private(GnomeCmdFileList *fl);
     ~Private();
 
     static gchar *translate_menu(const gchar *path, gpointer);
diff --git a/src/gnome-cmd-notebook.h b/src/gnome-cmd-notebook.h
index 6ebc86a..867ec4c 100644
--- a/src/gnome-cmd-notebook.h
+++ b/src/gnome-cmd-notebook.h
@@ -59,7 +59,7 @@ struct GnomeCmdNotebook
 
     TabBarVisibility tabs_visibility;
 
-    GnomeCmdNotebook(TabBarVisibility visibility=HIDE_TABS_IF_ONE);
+    explicit GnomeCmdNotebook(TabBarVisibility visibility=HIDE_TABS_IF_ONE);
 
     int size() const                    {  return gtk_notebook_get_n_pages (*this);       }
     bool empty() const                  {  return size()==0;                              }
diff --git a/src/gnome-cmd-plain-path.h b/src/gnome-cmd-plain-path.h
index e904938..480b7ce 100644
--- a/src/gnome-cmd-plain-path.h
+++ b/src/gnome-cmd-plain-path.h
@@ -38,11 +38,11 @@ class GnomeCmdPlainPath: public GnomeCmdPath
   public:
 
     GnomeCmdPlainPath(const GnomeCmdPlainPath &thePath);
-    GnomeCmdPlainPath(const gchar *path)        {  this->path = g_strdup (path);  }
-    virtual ~GnomeCmdPlainPath()                {  g_free (path);                 }
+    explicit GnomeCmdPlainPath(const gchar *path) {  this->path = g_strdup (path);  }
+    virtual ~GnomeCmdPlainPath()                  {  g_free (path);                 }
 
-    virtual const gchar *get_path()             {  return path;                   }
-    virtual const gchar *get_display_path()     {  return path;                   }
+    virtual const gchar *get_path()               {  return path;                   }
+    virtual const gchar *get_display_path()       {  return path;                   }
     virtual GnomeCmdPath *get_parent();
     virtual GnomeCmdPath *get_child(const gchar *child);
 };
diff --git a/src/gnome-cmd-smb-path.h b/src/gnome-cmd-smb-path.h
index 9225816..5937ff8 100644
--- a/src/gnome-cmd-smb-path.h
+++ b/src/gnome-cmd-smb-path.h
@@ -42,7 +42,7 @@ class GnomeCmdSmbPath: public GnomeCmdPath
 
     GnomeCmdSmbPath(const GnomeCmdSmbPath &thePath);
     GnomeCmdSmbPath(const gchar *workgroup, const gchar *resource, const gchar *path);
-    GnomeCmdSmbPath(const gchar *path_str);
+    explicit GnomeCmdSmbPath(const gchar *path_str);
     virtual ~GnomeCmdSmbPath();
 
     virtual const gchar *get_path()                 {  return path;                   }
diff --git a/src/gnome-cmd-xml-config.h b/src/gnome-cmd-xml-config.h
index d83a3e9..485e4d1 100644
--- a/src/gnome-cmd-xml-config.h
+++ b/src/gnome-cmd-xml-config.h
@@ -53,7 +53,7 @@ namespace XML
             std::string str;
 
             Controller(const Controller &c) : what(c.what), str(c.str) {}
-            Controller(const what_type _what) : what(_what)            {}
+            explicit Controller(const what_type _what) : what(_what)   {}
 
             // use template constructor because string field <str> may be initialized from different 
sources: char*, std::string etc
             template <typename T>
@@ -61,7 +61,7 @@ namespace XML
         };
 
         // xstream refers std::ostream object to perform actual output operations
-        xstream(std::ostream &_s) : s(_s), state(stateNone)
+        explicit xstream(std::ostream &_s) : s(_s), state(stateNone)
         {
             s << "<?xml version=\"" << versionMajor << '.' << versionMinor << "\" encoding=\"UTF-8\"?>";
         }
diff --git a/src/history.h b/src/history.h
index 33d50e3..a5c064e 100644
--- a/src/history.h
+++ b/src/history.h
@@ -33,7 +33,7 @@ class History
 
     GList *ents;
 
-    History(gint max): is_locked(FALSE), pos(NULL), ents(NULL)       {  this->max = max;  }
+    explicit History(gint max): is_locked(FALSE), pos(NULL), ents(NULL) { this->max = max;}
     ~History();
 
     History &operator = (GList *list);
diff --git a/src/tuple.h b/src/tuple.h
index 570d2b1..4abfc0a 100644
--- a/src/tuple.h
+++ b/src/tuple.h
@@ -33,7 +33,7 @@ struct triple: public std::pair<T1,T2>
 
     triple(): third(T3()) {}
     triple(const T1 &t1, const T2 &t2, const T3 &t3): std::pair<T1,T2>(t1,t2), third(t3) {}
-    template<typename U1, typename U2, typename U3> triple(const triple<U1,U2,U3> &t): 
std::pair<U1,U2>(t.first,t.second), third(third) {}
+    template<typename U1, typename U2, typename U3> explicit triple(const triple<U1,U2,U3> &t): 
std::pair<U1,U2>(t.first,t.second), third(third) {}
 };
 
 template <typename T1, typename T2, typename T3>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]