[geary: 1/2] Replace all tab indentation with 4 spaces
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary: 1/2] Replace all tab indentation with 4 spaces
- Date: Wed, 27 Feb 2019 22:49:05 +0000 (UTC)
commit 9ef6d7ccec12c7b4038e09ce5715fa9f21526aab
Author: Kristian Klausen <kristian klausen dk>
Date: Wed Feb 27 19:18:31 2019 +0100
Replace all tab indentation with 4 spaces
find . -name '*.vala' -type f -exec sed -i.orig 's/\t/ /g' {} +
and a few manual adjustment.
Fix #271
src/client/accounts/accounts-editor-row.vala | 22 ++--
src/client/composer/composer-web-view.vala | 4 +-
src/client/composer/composer-widget.vala | 4 +-
.../conversation-viewer/conversation-email.vala | 4 +-
.../conversation-viewer/conversation-message.vala | 2 +-
src/engine/api/geary-client-service.vala | 12 +--
src/engine/util/util-connectivity-manager.vala | 118 ++++++++++-----------
src/engine/util/util-error-context.vala | 2 +-
src/engine/util/util-stream.vala | 10 +-
test/client/accounts/accounts-manager-test.vala | 4 +-
test/engine/api/geary-engine-test.vala | 4 +-
test/test-case.vala | 68 ++++++------
12 files changed, 127 insertions(+), 127 deletions(-)
---
diff --git a/src/client/accounts/accounts-editor-row.vala b/src/client/accounts/accounts-editor-row.vala
index 0b201332..61b19470 100644
--- a/src/client/accounts/accounts-editor-row.vala
+++ b/src/client/accounts/accounts-editor-row.vala
@@ -469,23 +469,23 @@ internal class Accounts.TlsComboBox : Gtk.ComboBox {
Gtk.ListStore store = new Gtk.ListStore(
3, typeof(string), typeof(string), typeof(string)
);
- Gtk.TreeIter iter;
- store.append(out iter);
- store.set(
+ Gtk.TreeIter iter;
+ store.append(out iter);
+ store.set(
iter,
0, Geary.TlsNegotiationMethod.NONE.to_value(),
1, INSECURE_ICON,
2, _("None")
);
- store.append(out iter);
- store.set(
+ store.append(out iter);
+ store.set(
iter,
0, Geary.TlsNegotiationMethod.START_TLS.to_value(),
1, SECURE_ICON,
2, _("StartTLS")
);
- store.append(out iter);
- store.set(
+ store.append(out iter);
+ store.set(
iter,
0, Geary.TlsNegotiationMethod.TRANSPORT.to_value(),
1, SECURE_ICON,
@@ -496,12 +496,12 @@ internal class Accounts.TlsComboBox : Gtk.ComboBox {
set_id_column(0);
Gtk.CellRendererText text_renderer = new Gtk.CellRendererText();
- pack_start(text_renderer, true);
- add_attribute(text_renderer, "text", 2);
+ pack_start(text_renderer, true);
+ add_attribute(text_renderer, "text", 2);
Gtk.CellRendererPixbuf icon_renderer = new Gtk.CellRendererPixbuf();
- pack_start(icon_renderer, true);
- add_attribute(icon_renderer, "icon_name", 1);
+ pack_start(icon_renderer, true);
+ add_attribute(icon_renderer, "icon_name", 1);
}
}
diff --git a/src/client/composer/composer-web-view.vala b/src/client/composer/composer-web-view.vala
index 1fd3acd2..13236beb 100644
--- a/src/client/composer/composer-web-view.vala
+++ b/src/client/composer/composer-web-view.vala
@@ -372,11 +372,11 @@ public class ComposerWebView : ClientWebView {
}
public void insert_olist() {
- this.call.begin(Geary.JS.callable("geary.insertOrderedList"), null);
+ this.call.begin(Geary.JS.callable("geary.insertOrderedList"), null);
}
public void insert_ulist() {
- this.call.begin(Geary.JS.callable("geary.insertUnorderedList"), null);
+ this.call.begin(Geary.JS.callable("geary.insertUnorderedList"), null);
}
/**
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 53b8fa84..3582c517 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -1887,11 +1887,11 @@ public class ComposerWidget : Gtk.EventBox, Geary.BaseInterface {
}
private void on_olist(SimpleAction action, Variant? param) {
- this.editor.insert_olist();
+ this.editor.insert_olist();
}
private void on_ulist(SimpleAction action, Variant? param) {
- this.editor.insert_ulist();
+ this.editor.insert_ulist();
}
private void on_mouse_target_changed(WebKit.WebView web_view,
diff --git a/src/client/conversation-viewer/conversation-email.vala
b/src/client/conversation-viewer/conversation-email.vala
index 782efda6..3b461155 100644
--- a/src/client/conversation-viewer/conversation-email.vala
+++ b/src/client/conversation-viewer/conversation-email.vala
@@ -1104,12 +1104,12 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
len < this.displayed_attachments.size);
}
- private void on_service_status_change() {
+ private void on_service_status_change() {
if (this.message_body_state == FAILED &&
!this.load_cancellable.is_cancelled() &&
is_online()) {
this.fetch_remote_body.begin();
}
- }
+ }
}
diff --git a/src/client/conversation-viewer/conversation-message.vala
b/src/client/conversation-viewer/conversation-message.vala
index 7d6fe7f4..8e33505e 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -1173,7 +1173,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
if (y > 0) {
internal_link_activated(y);
} else {
- debug("Failed to get anchor destination");
+ debug("Failed to get anchor destination");
}
} catch (GLib.Error err) {
debug("Failed to get anchor destination");
diff --git a/src/engine/api/geary-client-service.vala b/src/engine/api/geary-client-service.vala
index 3d7a396a..4fbae488 100644
--- a/src/engine/api/geary-client-service.vala
+++ b/src/engine/api/geary-client-service.vala
@@ -387,7 +387,7 @@ public abstract class Geary.ClientService : BaseObject {
}
private void connect_handlers() {
- this.remote.connectivity.notify["is-reachable"].connect(
+ this.remote.connectivity.notify["is-reachable"].connect(
on_connectivity_change
);
this.remote.connectivity.remote_error_reported.connect(
@@ -397,7 +397,7 @@ public abstract class Geary.ClientService : BaseObject {
}
private void disconnect_handlers() {
- this.remote.connectivity.notify["is-reachable"].disconnect(
+ this.remote.connectivity.notify["is-reachable"].disconnect(
on_connectivity_change
);
this.remote.connectivity.remote_error_reported.disconnect(
@@ -424,7 +424,7 @@ public abstract class Geary.ClientService : BaseObject {
);
}
- private void on_connectivity_change() {
+ private void on_connectivity_change() {
if (this.is_running && this.current_status.automatically_reconnect()) {
if (this.remote.connectivity.is_reachable.is_certain()) {
this.became_reachable_timer.start();
@@ -435,15 +435,15 @@ public abstract class Geary.ClientService : BaseObject {
this.became_reachable_timer.reset();
}
}
- }
+ }
- private void on_connectivity_error(Error error) {
+ private void on_connectivity_error(Error error) {
if (this.is_running) {
this.became_reachable_timer.reset();
this.became_unreachable_timer.reset();
notify_connection_failed(new ErrorContext(error));
}
- }
+ }
private void on_untrusted_host(Endpoint remote,
GLib.TlsConnection cx) {
diff --git a/src/engine/util/util-connectivity-manager.vala b/src/engine/util/util-connectivity-manager.vala
index e8b42bed..6ec07ac0 100644
--- a/src/engine/util/util-connectivity-manager.vala
+++ b/src/engine/util/util-connectivity-manager.vala
@@ -26,24 +26,24 @@ public class Geary.ConnectivityManager : BaseObject {
/** The endpoint being monitored. */
public GLib.SocketConnectable remote { get; private set; default = null; }
- /** Determines if the managed endpoint is currently reachable. */
- public Trillian is_reachable {
+ /** Determines if the managed endpoint is currently reachable. */
+ public Trillian is_reachable {
get; private set; default = Geary.Trillian.UNKNOWN;
}
- /**
+ /**
* Determines if the remote endpoint could be resolved.
*
* This will become certain if the remote becomes reachable, and
* will become impossible if a fatal error is reported.
*/
- public Trillian is_valid {
+ public Trillian is_valid {
get; private set; default = Geary.Trillian.UNKNOWN;
}
private NetworkMonitor monitor;
- private Cancellable? existing_check = null;
+ private Cancellable? existing_check = null;
// Wall time the next already-connected check should not occur before
private int64 next_check = 0;
@@ -66,7 +66,7 @@ public class Geary.ConnectivityManager : BaseObject {
* Constructs a new manager for a specific remote.
*/
public ConnectivityManager(GLib.SocketConnectable remote) {
- this.remote = remote;
+ this.remote = remote;
this.monitor = NetworkMonitor.get_default();
this.monitor.network_changed.connect(on_network_changed);
@@ -83,33 +83,33 @@ public class Geary.ConnectivityManager : BaseObject {
this.monitor.network_changed.disconnect(on_network_changed);
}
- /**
+ /**
* Starts checking if the manager's remote is reachable.
*
* This will cancel any existing check, and start a new one
* running, updating the `is_reachable` property on completion.
*/
public async void check_reachable() {
- // We use a cancellable here as a guard instead of a boolean
- // "is_checking" var since when a series of checks are
- // requested in quick succession (as is the case when
- // e.g. connecting or disconnecting from a network), the
- // result of the *last* check is authoritative, not the first
- // one.
- cancel_check();
+ // We use a cancellable here as a guard instead of a boolean
+ // "is_checking" var since when a series of checks are
+ // requested in quick succession (as is the case when
+ // e.g. connecting or disconnecting from a network), the
+ // result of the *last* check is authoritative, not the first
+ // one.
+ cancel_check();
- Cancellable cancellable = new Cancellable();
- this.existing_check = cancellable;
+ Cancellable cancellable = new Cancellable();
+ this.existing_check = cancellable;
string endpoint = this.remote.to_string();
- bool is_reachable = false;
+ bool is_reachable = false;
try {
// Check first, and ask questions only if an error occurs,
// because if we can connect, then we can connect.
- debug("Checking if %s reachable...", endpoint);
+ debug("Checking if %s reachable...", endpoint);
is_reachable = yield this.monitor.can_reach_async(
- this.remote, cancellable
- );
+ this.remote, cancellable
+ );
this.next_check = (
GLib.get_real_time() + (CHECK_QUIESCENCE_MS * 1000)
);
@@ -131,16 +131,16 @@ public class Geary.ConnectivityManager : BaseObject {
endpoint, err.message);
} catch (GLib.Error err) {
if (err is IOError.NETWORK_UNREACHABLE &&
- this.monitor.network_available) {
- // If we get a network unreachable error, but the monitor
- // says there actually is a network available, we may be
- // running in a Flatpak and hitting Bug 777706. If so,
- // just assume the service is reachable is for now. :(
+ this.monitor.network_available) {
+ // If we get a network unreachable error, but the monitor
+ // says there actually is a network available, we may be
+ // running in a Flatpak and hitting Bug 777706. If so,
+ // just assume the service is reachable is for now. :(
// Pull this put once xdg-desktop-portal 1.x is widely
// installed.
- debug("Assuming %s is reachable, despite network unavailability",
+ debug("Assuming %s is reachable, despite network unavailability",
endpoint);
- is_reachable = true;
+ is_reachable = true;
} else {
// The monitor threw an error, but only notify if it
// looks like we *should* be able to connect
@@ -161,37 +161,37 @@ public class Geary.ConnectivityManager : BaseObject {
}
}
} finally {
- if (!cancellable.is_cancelled()) {
- set_reachable(is_reachable);
+ if (!cancellable.is_cancelled()) {
+ set_reachable(is_reachable);
// Kick off another delayed check in case the network
// changes without the monitor noticing.
this.delayed_check.start();
- }
+ }
this.existing_check = null;
}
}
- /**
+ /**
* Cancels any running or future reachability check, if any.
*/
public void cancel_check() {
- if (this.existing_check != null) {
- this.existing_check.cancel();
- this.existing_check = null;
- }
+ if (this.existing_check != null) {
+ this.existing_check.cancel();
+ this.existing_check = null;
+ }
this.delayed_check.reset();
- }
+ }
private void on_network_changed(bool some_available) {
// Always check if reachable because IMAP server could be on
// localhost. (This is a Linux program, after all...)
- debug("Network changed: %s",
+ debug("Network changed: %s",
some_available ? "some available" : "none available");
- if (some_available) {
- // Some networks may have dropped out despite some being
- // still available, so need to check again. Only run the
- // check if we are either currently:
+ if (some_available) {
+ // Some networks may have dropped out despite some being
+ // still available, so need to check again. Only run the
+ // check if we are either currently:
//
// 1. Unreachable
// 2. An existing check is already running (i.e. the
@@ -207,23 +207,23 @@ public class Geary.ConnectivityManager : BaseObject {
} else if (!this.delayed_check.is_running) {
this.delayed_check.start();
}
- } else {
- // None available, so definitely not reachable.
- set_reachable(false);
- }
+ } else {
+ // None available, so definitely not reachable.
+ set_reachable(false);
+ }
}
- private inline void set_reachable(bool reachable) {
- // Coalesce changes to is_reachable, since Vala <= 0.34 always
- // fires notify signals on set, even if the value doesn't
- // change. 0.36 fixes that, so pull this test out when we can
- // depend on that as a minimum.
- if ((reachable && !this.is_reachable.is_certain()) ||
+ private inline void set_reachable(bool reachable) {
+ // Coalesce changes to is_reachable, since Vala <= 0.34 always
+ // fires notify signals on set, even if the value doesn't
+ // change. 0.36 fixes that, so pull this test out when we can
+ // depend on that as a minimum.
+ if ((reachable && !this.is_reachable.is_certain()) ||
(!reachable && !this.is_reachable.is_impossible())) {
debug("Remote %s became %s",
this.remote.to_string(), reachable ? "reachable" : "unreachable");
- this.is_reachable = reachable ? Trillian.TRUE : Trillian.FALSE;
- }
+ this.is_reachable = reachable ? Trillian.TRUE : Trillian.FALSE;
+ }
// We only work out if the name is valid (or becomes valid
// again) if the remote becomes reachable.
@@ -231,13 +231,13 @@ public class Geary.ConnectivityManager : BaseObject {
this.is_valid = Trillian.TRUE;
}
- }
+ }
- private inline void set_invalid() {
- // Coalesce changes to is_reachable, since Vala <= 0.34 always
- // fires notify signals on set, even if the value doesn't
- // change. 0.36 fixes that, so pull this method out when we can
- // depend on that as a minimum.
+ private inline void set_invalid() {
+ // Coalesce changes to is_reachable, since Vala <= 0.34 always
+ // fires notify signals on set, even if the value doesn't
+ // change. 0.36 fixes that, so pull this method out when we can
+ // depend on that as a minimum.
if (this.is_valid != Trillian.FALSE) {
this.is_valid = Trillian.FALSE;
}
diff --git a/src/engine/util/util-error-context.vala b/src/engine/util/util-error-context.vala
index b4f3008f..ae0099af 100644
--- a/src/engine/util/util-error-context.vala
+++ b/src/engine/util/util-error-context.vala
@@ -32,7 +32,7 @@ public class Geary.ErrorContext : BaseObject {
internal StackFrame(Unwind.Cursor frame) {
uint8 proc_name[256];
int ret = -frame.get_proc_name(proc_name);
- if (ret == Unwind.Error.SUCCESS ||
+ if (ret == Unwind.Error.SUCCESS ||
ret == Unwind.Error.NOMEM) {
this.name = (string) proc_name;
}
diff --git a/src/engine/util/util-stream.vala b/src/engine/util/util-stream.vala
index 4ce86e69..2cffb05a 100644
--- a/src/engine/util/util-stream.vala
+++ b/src/engine/util/util-stream.vala
@@ -128,13 +128,13 @@ namespace Geary.Stream {
this.dest = dest;
}
- public override int64 length() {
+ public override int64 length() {
// This is a bit of a kludge, but we use it in
// ImapDB.Attachment
return this.written;
}
- public override ssize_t write(string buf, size_t len) {
+ public override ssize_t write(string buf, size_t len) {
ssize_t ret = -1;
try {
ret = this.dest.write(buf.data[0:len]);
@@ -145,7 +145,7 @@ namespace Geary.Stream {
return ret;
}
- public override int close() {
+ public override int close() {
int ret = -1;
try {
ret = this.dest.close() ? 0 : -1;
@@ -155,7 +155,7 @@ namespace Geary.Stream {
return ret;
}
- public override int flush () {
+ public override int flush () {
int ret = -1;
try {
ret = this.dest.flush() ? 0 : -1;
@@ -165,7 +165,7 @@ namespace Geary.Stream {
return ret;
}
- public override bool eos () {
+ public override bool eos () {
return this.dest.is_closed() || this.dest.is_closing();
}
}
diff --git a/test/client/accounts/accounts-manager-test.vala b/test/client/accounts/accounts-manager-test.vala
index 6f64628d..5a883957 100644
--- a/test/client/accounts/accounts-manager-test.vala
+++ b/test/client/accounts/accounts-manager-test.vala
@@ -63,13 +63,13 @@ class Accounts.ManagerTest : TestCase {
this.test = new Manager(this.mediator, config, data);
}
- public override void tear_down() throws GLib.Error {
+ public override void tear_down() throws GLib.Error {
this.account = null;
this.mediator = null;
this.test = null;
this.primary_mailbox = null;
@delete(this.tmp);
- }
+ }
public void create_account() throws GLib.Error {
bool was_added = false;
diff --git a/test/engine/api/geary-engine-test.vala b/test/engine/api/geary-engine-test.vala
index 4fb78ea0..87adde59 100644
--- a/test/engine/api/geary-engine-test.vala
+++ b/test/engine/api/geary-engine-test.vala
@@ -60,7 +60,7 @@ class Geary.EngineTest : TestCase {
);
}
- public override void tear_down () {
+ public override void tear_down () {
this.account = null;
try {
this.res.delete();
@@ -69,7 +69,7 @@ class Geary.EngineTest : TestCase {
} catch (Error err) {
assert_not_reached();
}
- }
+ }
public void add_account() throws GLib.Error {
assert_false(this.engine.has_account(this.account.id));
diff --git a/test/test-case.vala b/test/test-case.vala
index 12f8c67e..bb684967 100644
--- a/test/test-case.vala
+++ b/test/test-case.vala
@@ -201,21 +201,21 @@ public abstract class TestCase : Object {
protected MainContext main_loop = MainContext.default();
- private GLib.TestSuite suite;
- private Adaptor[] adaptors = new Adaptor[0];
+ private GLib.TestSuite suite;
+ private Adaptor[] adaptors = new Adaptor[0];
private AsyncQueue<AsyncResult> async_results = new AsyncQueue<AsyncResult>();
- public delegate void TestMethod() throws Error;
+ public delegate void TestMethod() throws Error;
- public TestCase(string name) {
- this.suite = new GLib.TestSuite(name);
- }
+ public TestCase(string name) {
+ this.suite = new GLib.TestSuite(name);
+ }
- public void add_test(string name, owned TestMethod test) {
- var adaptor = new Adaptor(name, (owned) test, this);
- this.adaptors += adaptor;
+ public void add_test(string name, owned TestMethod test) {
+ var adaptor = new Adaptor(name, (owned) test, this);
+ this.adaptors += adaptor;
- this.suite.add(
+ this.suite.add(
new GLib.TestCase(
adaptor.name,
adaptor.set_up,
@@ -223,17 +223,17 @@ public abstract class TestCase : Object {
adaptor.tear_down
)
);
- }
+ }
- public virtual void set_up() throws Error {
- }
+ public virtual void set_up() throws Error {
+ }
- public virtual void tear_down() throws Error {
- }
+ public virtual void tear_down() throws Error {
+ }
- public GLib.TestSuite get_suite() {
- return this.suite;
- }
+ public GLib.TestSuite get_suite() {
+ return this.suite;
+ }
protected void async_complete(AsyncResult result) {
this.async_results.push(result);
@@ -296,44 +296,44 @@ public abstract class TestCase : Object {
return handler.was_fired;
}
- private class Adaptor {
+ private class Adaptor {
- public string name { get; private set; }
- private TestMethod test;
- private TestCase test_case;
+ public string name { get; private set; }
+ private TestMethod test;
+ private TestCase test_case;
- public Adaptor(string name,
+ public Adaptor(string name,
owned TestMethod test,
TestCase test_case) {
- this.name = name;
- this.test = (owned) test;
- this.test_case = test_case;
- }
+ this.name = name;
+ this.test = (owned) test;
+ this.test_case = test_case;
+ }
- public void set_up(void* fixture) {
+ public void set_up(void* fixture) {
try {
this.test_case.set_up();
} catch (Error err) {
assert_no_error(err);
}
- }
+ }
- public void run(void* fixture) {
+ public void run(void* fixture) {
try {
this.test();
} catch (Error err) {
assert_no_error(err);
}
- }
+ }
- public void tear_down(void* fixture) {
+ public void tear_down(void* fixture) {
try {
this.test_case.tear_down();
} catch (Error err) {
assert_no_error(err);
}
- }
+ }
- }
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]