[geary/cherry-pick-b61621f8] Merge branch 'wip/vala-abstract-ctors' into 'master'



commit 64e80c8f07625422311162fd67f7fdcd5971c383
Author: Michael Gratton <mike vee net>
Date:   Thu Mar 14 23:05:41 2019 +0000

    Merge branch 'wip/vala-abstract-ctors' into 'master'
    
    Constructors of abstract classes should not be public
    
    See merge request GNOME/geary!171
    
    (cherry picked from commit b61621f8ce8d23020d1d2b30c28b45ec13c38cbc)
    
    e09475e8 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 61b19470..0906bbbd 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 65d96f46..11864084 100644
--- a/src/client/components/client-web-view.vala
+++ b/src/client/components/client-web-view.vala
@@ -295,8 +295,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 24825296..534513cf 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 b1b89f30..1eb35b96 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 e4b3438d..50717586 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 567887d6..56e6477c 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 a410e64c..5a82de55 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 de072056..59ce9468 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 6edf0028..0135fcc5 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 b2f5956b..d945b5d4 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 2b3eae91..429f4979 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 fad1d274..7d2ace51 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 a4089c37..7b9c60fd 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 05093207..d56ec9cf 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 1837cc99..9de2995e 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 ef4228ec..f6999e64 100644
--- a/test/test-case.vala
+++ b/test/test-case.vala
@@ -213,7 +213,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]