[geary/wip/ricotz/abstract-ctors] Constructors of abstract classes should not be public



commit a125db664ff07bb8fef826dfdd324e1540827e52
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Mar 14 16:59:24 2019 +0100

    Constructors of abstract classes should not be public

 src/client/accounts/accounts-editor-add-pane.vala              |  4 ++--
 src/client/accounts/accounts-editor-row.vala                   | 10 +++++-----
 src/client/components/client-web-view.vala                     |  4 ++--
 src/client/folder-list/folder-list-abstract-folder-entry.vala  |  2 +-
 src/engine/api/geary-email-properties.vala                     |  2 +-
 .../app/conversation-monitor/app-conversation-operation.vala   |  4 ++--
 src/engine/common/common-message-data.vala                     |  8 ++++----
 src/engine/imap-engine/imap-engine-generic-account.vala        |  8 ++++----
 src/engine/imap-engine/imap-engine-replay-operation.vala       |  2 +-
 .../replay-ops/imap-engine-abstract-list-email.vala            |  2 +-
 src/engine/imap/message/imap-flag.vala                         |  2 +-
 src/engine/imap/message/imap-flags.vala                        |  2 +-
 src/engine/imap/response/imap-fetch-data-decoder.vala          |  2 +-
 src/engine/imap/response/imap-server-response.vala             |  2 +-
 src/engine/smtp/smtp-authenticator.vala                        |  2 +-
 src/engine/util/util-reference-semantics.vala                  |  2 +-
 test/client/components/client-web-view-test-case.vala          |  2 +-
 test/test-case.vala                                            |  2 +-
 18 files changed, 31 insertions(+), 31 deletions(-)
---
diff --git a/src/client/accounts/accounts-editor-add-pane.vala 
b/src/client/accounts/accounts-editor-add-pane.vala
index 6c9a61c3..72f2517b 100644
--- a/src/client/accounts/accounts-editor-add-pane.vala
+++ b/src/client/accounts/accounts-editor-add-pane.vala
@@ -506,7 +506,7 @@ private abstract class Accounts.AddPaneRow<Value> :
     internal Components.Validator? validator { get; protected set; }
 
 
-    public AddPaneRow(string label, Value value) {
+    protected AddPaneRow(string label, Value value) {
         base(label, new Gtk.Entry());
         this.activatable = false;
     }
@@ -517,7 +517,7 @@ private abstract class Accounts.AddPaneRow<Value> :
 private abstract class Accounts.EntryRow : AddPaneRow<Gtk.Entry> {
 
 
-    public EntryRow(string label, string? placeholder = null) {
+    protected EntryRow(string label, string? placeholder = null) {
         base(label, new Gtk.Entry());
 
         this.value.placeholder_text = placeholder ?? "";
diff --git a/src/client/accounts/accounts-editor-row.vala b/src/client/accounts/accounts-editor-row.vala
index 0b201332..5aa3c3a3 100644
--- a/src/client/accounts/accounts-editor-row.vala
+++ b/src/client/accounts/accounts-editor-row.vala
@@ -310,7 +310,7 @@ internal abstract class Accounts.AccountRow<PaneType,V> :
     internal Geary.AccountInformation account { get; private set; }
 
 
-    public AccountRow(Geary.AccountInformation account, string label, V value) {
+    protected AccountRow(Geary.AccountInformation account, string label, V value) {
         base(label, value);
         this.account = account;
         this.account.changed.connect(on_account_changed);
@@ -351,10 +351,10 @@ private abstract class Accounts.ServiceRow<PaneType,V> : AccountRow<PaneType,V>
     }
 
 
-    public ServiceRow(Geary.AccountInformation account,
-                      Geary.ServiceInformation service,
-                      string label,
-                      V value) {
+    protected ServiceRow(Geary.AccountInformation account,
+                         Geary.ServiceInformation service,
+                         string label,
+                         V value) {
         base(account, label, value);
         this.service = service;
         this.service.notify.connect_after(on_notify);
diff --git a/src/client/components/client-web-view.vala b/src/client/components/client-web-view.vala
index f122e60f..e9148a34 100644
--- a/src/client/components/client-web-view.vala
+++ b/src/client/components/client-web-view.vala
@@ -279,8 +279,8 @@ public abstract class ClientWebView : WebKit.WebView, Geary.BaseInterface {
     public signal void remote_image_load_blocked();
 
 
-    public ClientWebView(Configuration config,
-                         WebKit.UserContentManager? custom_manager = null) {
+    protected ClientWebView(Configuration config,
+                            WebKit.UserContentManager? custom_manager = null) {
         WebKit.Settings setts = new WebKit.Settings();
         setts.allow_modal_dialogs = false;
         setts.default_charset = "UTF-8";
diff --git a/src/client/folder-list/folder-list-abstract-folder-entry.vala 
b/src/client/folder-list/folder-list-abstract-folder-entry.vala
index f53dfcd0..e4b34239 100644
--- a/src/client/folder-list/folder-list-abstract-folder-entry.vala
+++ b/src/client/folder-list/folder-list-abstract-folder-entry.vala
@@ -12,7 +12,7 @@
 public abstract class FolderList.AbstractFolderEntry : Geary.BaseObject, Sidebar.Entry, 
Sidebar.SelectableEntry {
     public Geary.Folder folder { get; private set; }
     
-    public AbstractFolderEntry(Geary.Folder folder) {
+    protected AbstractFolderEntry(Geary.Folder folder) {
         this.folder = folder;
     }
     
diff --git a/src/engine/api/geary-email-properties.vala b/src/engine/api/geary-email-properties.vala
index de9d9dbe..0b197ea2 100644
--- a/src/engine/api/geary-email-properties.vala
+++ b/src/engine/api/geary-email-properties.vala
@@ -26,7 +26,7 @@ public abstract class Geary.EmailProperties : BaseObject {
      */
     public int64 total_bytes { get; protected set; }
     
-    public EmailProperties(DateTime date_received, int64 total_bytes) {
+    protected EmailProperties(DateTime date_received, int64 total_bytes) {
         this.date_received = date_received;
         this.total_bytes = total_bytes;
     }
diff --git a/src/engine/app/conversation-monitor/app-conversation-operation.vala 
b/src/engine/app/conversation-monitor/app-conversation-operation.vala
index 08e2c4a2..b0948a6f 100644
--- a/src/engine/app/conversation-monitor/app-conversation-operation.vala
+++ b/src/engine/app/conversation-monitor/app-conversation-operation.vala
@@ -23,8 +23,8 @@ internal abstract class Geary.App.ConversationOperation : BaseObject {
     protected weak ConversationMonitor? monitor = null;
 
 
-    public ConversationOperation(ConversationMonitor? monitor,
-                                 bool allow_duplicates = true) {
+    protected ConversationOperation(ConversationMonitor? monitor,
+                                    bool allow_duplicates = true) {
         this.monitor = monitor;
         this.allow_duplicates = allow_duplicates;
     }
diff --git a/src/engine/common/common-message-data.vala b/src/engine/common/common-message-data.vala
index cafc68b0..7b9ee743 100644
--- a/src/engine/common/common-message-data.vala
+++ b/src/engine/common/common-message-data.vala
@@ -36,7 +36,7 @@ public abstract class Geary.MessageData.StringMessageData : AbstractMessageData,
     
     private uint stored_hash = uint.MAX;
     
-    public StringMessageData(string value) {
+    protected StringMessageData(string value) {
         this.value = value;
     }
     
@@ -66,7 +66,7 @@ public abstract class Geary.MessageData.IntMessageData : AbstractMessageData,
     Gee.Hashable<IntMessageData> {
     public int value { get; private set; }
     
-    public IntMessageData(int value) {
+    protected IntMessageData(int value) {
         this.value = value;
     }
     
@@ -89,7 +89,7 @@ public abstract class Geary.MessageData.Int64MessageData : AbstractMessageData,
     
     private uint stored_hash = uint.MAX;
     
-    public Int64MessageData(int64 value) {
+    protected Int64MessageData(int64 value) {
         this.value = value;
     }
     
@@ -113,7 +113,7 @@ public abstract class Geary.MessageData.BlockMessageData : AbstractMessageData {
     public string data_name { get; private set; }
     public Geary.Memory.Buffer buffer { get; private set; }
     
-    public BlockMessageData(string data_name, Geary.Memory.Buffer buffer) {
+    protected BlockMessageData(string data_name, Geary.Memory.Buffer buffer) {
         this.data_name = data_name;
         this.buffer = buffer;
     }
diff --git a/src/engine/imap-engine/imap-engine-generic-account.vala 
b/src/engine/imap-engine/imap-engine-generic-account.vala
index 0ca058f5..c8e4ba25 100644
--- a/src/engine/imap-engine/imap-engine-generic-account.vala
+++ b/src/engine/imap-engine/imap-engine-generic-account.vala
@@ -60,10 +60,10 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
         new Gee.HashMap<Geary.SpecialFolderType, Gee.List<string>>();
 
 
-    public GenericAccount(AccountInformation config,
-                          ImapDB.Account local,
-                          Endpoint incoming_remote,
-                          Endpoint outgoing_remote) {
+    protected GenericAccount(AccountInformation config,
+                             ImapDB.Account local,
+                             Endpoint incoming_remote,
+                             Endpoint outgoing_remote) {
         Imap.ClientService imap = new Imap.ClientService(
             config,
             config.incoming,
diff --git a/src/engine/imap-engine/imap-engine-replay-operation.vala 
b/src/engine/imap-engine/imap-engine-replay-operation.vala
index ab2d891d..e5ee089e 100644
--- a/src/engine/imap-engine/imap-engine-replay-operation.vala
+++ b/src/engine/imap-engine/imap-engine-replay-operation.vala
@@ -55,7 +55,7 @@ private abstract class Geary.ImapEngine.ReplayOperation : Geary.BaseObject, Gee.
     
     private Nonblocking.Semaphore semaphore = new Nonblocking.Semaphore();
     
-    public ReplayOperation(string name, Scope scope, OnError on_remote_error = OnError.THROW) {
+    protected ReplayOperation(string name, Scope scope, OnError on_remote_error = OnError.THROW) {
         this.name = name;
         this.scope = scope;
         this.on_remote_error = on_remote_error;
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-abstract-list-email.vala 
b/src/engine/imap-engine/replay-ops/imap-engine-abstract-list-email.vala
index 9285f0fa..6ea23ab5 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-abstract-list-email.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-abstract-list-email.vala
@@ -87,7 +87,7 @@ private abstract class Geary.ImapEngine.AbstractListEmail : Geary.ImapEngine.Sen
     
     private Gee.HashMap<Imap.UID, Geary.Email.Field> unfulfilled = new Gee.HashMap<Imap.UID, 
Geary.Email.Field>();
     
-    public AbstractListEmail(string name, MinimalFolder owner, Geary.Email.Field required_fields,
+    protected AbstractListEmail(string name, MinimalFolder owner, Geary.Email.Field required_fields,
         Folder.ListFlags flags, Cancellable? cancellable) {
         base(name, OnError.IGNORE_REMOTE);
         
diff --git a/src/engine/imap/message/imap-flag.vala b/src/engine/imap/message/imap-flag.vala
index 96dbfa56..e43830ef 100644
--- a/src/engine/imap/message/imap-flag.vala
+++ b/src/engine/imap/message/imap-flag.vala
@@ -21,7 +21,7 @@ public abstract class Geary.Imap.Flag : BaseObject, Gee.Hashable<Geary.Imap.Flag
      *
      * The given keyword must be an IMAP atom.
      */
-    public Flag(string name) {
+    protected Flag(string name) {
         this.value = name;
     }
 
diff --git a/src/engine/imap/message/imap-flags.vala b/src/engine/imap/message/imap-flags.vala
index 4ec67064..3c020c30 100644
--- a/src/engine/imap/message/imap-flags.vala
+++ b/src/engine/imap/message/imap-flags.vala
@@ -14,7 +14,7 @@ public abstract class Geary.Imap.Flags : Geary.MessageData.AbstractMessageData,
     
     protected Gee.Set<Flag> list;
     
-    public Flags(Gee.Collection<Flag> flags) {
+    protected Flags(Gee.Collection<Flag> flags) {
         list = new Gee.HashSet<Flag>();
         list.add_all(flags);
     }
diff --git a/src/engine/imap/response/imap-fetch-data-decoder.vala 
b/src/engine/imap/response/imap-fetch-data-decoder.vala
index 5bd7c95d..7140c5e7 100644
--- a/src/engine/imap/response/imap-fetch-data-decoder.vala
+++ b/src/engine/imap/response/imap-fetch-data-decoder.vala
@@ -19,7 +19,7 @@
 public abstract class Geary.Imap.FetchDataDecoder : BaseObject {
     public FetchDataSpecifier data_item { get; private set; }
     
-    public FetchDataDecoder(FetchDataSpecifier data_item) {
+    protected FetchDataDecoder(FetchDataSpecifier data_item) {
         this.data_item = data_item;
     }
     
diff --git a/src/engine/imap/response/imap-server-response.vala 
b/src/engine/imap/response/imap-server-response.vala
index 43565196..7b57d34a 100644
--- a/src/engine/imap/response/imap-server-response.vala
+++ b/src/engine/imap/response/imap-server-response.vala
@@ -25,7 +25,7 @@ public abstract class Geary.Imap.ServerResponse : RootParameters {
      *
      * The supplied root is "stripped" of its children.
      */
-    public ServerResponse.migrate(RootParameters root) throws ImapError {
+    protected ServerResponse.migrate(RootParameters root) throws ImapError {
         base.migrate(root);
         
         if (!has_tag())
diff --git a/src/engine/smtp/smtp-authenticator.vala b/src/engine/smtp/smtp-authenticator.vala
index 76dbee08..62782a1a 100644
--- a/src/engine/smtp/smtp-authenticator.vala
+++ b/src/engine/smtp/smtp-authenticator.vala
@@ -18,7 +18,7 @@ public abstract class Geary.Smtp.Authenticator : BaseObject {
     
     public Credentials credentials { get; private set; }
     
-    public Authenticator(string name, Credentials credentials) {
+    protected Authenticator(string name, Credentials credentials) {
         this.name = name;
         this.credentials = credentials;
         
diff --git a/src/engine/util/util-reference-semantics.vala b/src/engine/util/util-reference-semantics.vala
index 56b3ed90..5ca0df3a 100644
--- a/src/engine/util/util-reference-semantics.vala
+++ b/src/engine/util/util-reference-semantics.vala
@@ -81,7 +81,7 @@ public abstract class Geary.SmartReference : BaseObject {
     public virtual signal void reference_broken() {
     }
     
-    public SmartReference(ReferenceSemantics reffed) {
+    protected SmartReference(ReferenceSemantics reffed) {
         this.reffed = reffed;
         
         reffed.release_now.connect(on_release_now);
diff --git a/test/client/components/client-web-view-test-case.vala 
b/test/client/components/client-web-view-test-case.vala
index 5bbfb959..0f185083 100644
--- a/test/client/components/client-web-view-test-case.vala
+++ b/test/client/components/client-web-view-test-case.vala
@@ -13,7 +13,7 @@ public abstract class ClientWebViewTestCase<V> : TestCase {
     protected V? test_view = null;
     protected Configuration? config = null;
 
-    public ClientWebViewTestCase(string name) {
+    protected ClientWebViewTestCase(string name) {
         base(name);
         this.config = new Configuration(GearyApplication.APP_ID);
         ClientWebView.init_web_context(
diff --git a/test/test-case.vala b/test/test-case.vala
index 12f8c67e..100b0241 100644
--- a/test/test-case.vala
+++ b/test/test-case.vala
@@ -207,7 +207,7 @@ public abstract class TestCase : Object {
 
        public delegate void TestMethod() throws Error;
 
-       public TestCase(string name) {
+       protected TestCase(string name) {
                this.suite = new GLib.TestSuite(name);
        }
 


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