[geary/mjog/rfc822-cleanup: 1/21] src/engine/rfc822/rfc822.vala: Fix indentation to match style
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/rfc822-cleanup: 1/21] src/engine/rfc822/rfc822.vala: Fix indentation to match style
- Date: Wed, 6 May 2020 04:52:03 +0000 (UTC)
commit d7e128ae72a122de2c518bc3ce5e57b2c97c12e5
Author: Michael Gratton <mike vee net>
Date: Thu Nov 21 16:35:53 2019 +1100
src/engine/rfc822/rfc822.vala: Fix indentation to match style
src/engine/rfc822/rfc822.vala | 94 +++++++++++++++++++++++--------------------
1 file changed, 50 insertions(+), 44 deletions(-)
---
diff --git a/src/engine/rfc822/rfc822.vala b/src/engine/rfc822/rfc822.vala
index cef728a23..3d800508e 100644
--- a/src/engine/rfc822/rfc822.vala
+++ b/src/engine/rfc822/rfc822.vala
@@ -6,60 +6,66 @@
namespace Geary.RFC822 {
-/**
- * Common text formats supported by {@link Geary.RFC822}.
- */
-public enum TextFormat {
- PLAIN,
- HTML
-}
+ /**
+ * Common text formats supported by {@link Geary.RFC822}.
+ */
+ public enum TextFormat {
+ PLAIN,
+ HTML
+ }
-/**
- * Official IANA charset encoding name for the UTF-8 character set.
- */
-public const string UTF8_CHARSET = "UTF-8";
+ /**
+ * Official IANA charset encoding name for the UTF-8 character set.
+ */
+ public const string UTF8_CHARSET = "UTF-8";
-private int init_count = 0;
+ /**
+ * Official IANA charset encoding name for the ASCII character set.
+ */
+ public const string ASCII_CHARSET = "US-ASCII";
-internal Regex? invalid_filename_character_re = null;
+ internal Regex? invalid_filename_character_re = null;
-public void init() {
- if (init_count++ != 0)
- return;
+ private int init_count = 0;
- GMime.init();
- GMime.ParserOptions.get_default().set_allow_addresses_without_domain(true);
- try {
- invalid_filename_character_re = new Regex("[/\\0]");
- } catch (RegexError e) {
- assert_not_reached();
+ public void init() {
+ if (init_count++ != 0)
+ return;
+
+ GMime.init();
+ GMime.ParserOptions.get_default().set_allow_addresses_without_domain(true);
+
+ try {
+ invalid_filename_character_re = new Regex("[/\\0]");
+ } catch (RegexError e) {
+ assert_not_reached();
+ }
}
-}
-public GMime.FormatOptions get_format_options() {
- return GMime.FormatOptions.get_default().clone();
-}
+ public GMime.FormatOptions get_format_options() {
+ return GMime.FormatOptions.get_default().clone();
+ }
-public GMime.ParserOptions get_parser_options() {
- return GMime.ParserOptions.get_default().clone();
-}
+ public GMime.ParserOptions get_parser_options() {
+ return GMime.ParserOptions.get_default().clone();
+ }
-public string? get_charset() {
- return UTF8_CHARSET;
-}
+ public string? get_charset() {
+ return UTF8_CHARSET;
+ }
-internal bool is_utf_8(string charset) {
- string up = charset.up();
- return (
- // ASCII is a subset of UTF-8, so it's also valid
- up == "ASCII" ||
- up == "US-ASCII" ||
- up == "US_ASCII" ||
- up == "UTF-8" ||
- up == "UTF8" ||
- up == "UTF_8"
- );
-}
+ internal bool is_utf_8(string charset) {
+ string up = charset.up();
+ return (
+ // ASCII is a subset of UTF-8, so it's also valid
+ up == "ASCII" ||
+ up == "US-ASCII" ||
+ up == "US_ASCII" ||
+ up == "UTF-8" ||
+ up == "UTF8" ||
+ up == "UTF_8"
+ );
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]