[geary/mjog/493-undo-send: 16/37] Rename Config class and source file to match code style
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/493-undo-send: 16/37] Rename Config class and source file to match code style
- Date: Sun, 17 Nov 2019 09:02:19 +0000 (UTC)
commit e426517b302445b98a9ed1bfeecdc5bd4c8dcc28
Author: Michael Gratton <mike vee net>
Date: Thu Nov 7 13:26:47 2019 +1100
Rename Config class and source file to match code style
Rename `Configuration` => `Application.Configuration` and
`geary-config.vala to `application-config.vala`. Update call sites and
test cases.
po/POTFILES.in | 1 +
.../accounts/accounts-signature-web-view.vala | 2 +-
...-config.vala => application-configuration.vala} | 31 +++++++++++-----------
src/client/application/geary-application.vala | 6 ++---
src/client/components/client-web-view.vala | 12 +++++----
.../components/components-inspector-log-view.vala | 2 +-
src/client/components/main-toolbar.vala | 12 ++++++---
src/client/components/main-window.vala | 24 +++++++++--------
src/client/composer/composer-headerbar.vala | 6 ++---
src/client/composer/composer-web-view.vala | 2 +-
src/client/composer/composer-widget.vala | 2 +-
src/client/composer/composer-window.vala | 4 +--
src/client/composer/spell-check-popover.vala | 4 +--
.../conversation-list/conversation-list-store.vala | 5 ++--
.../conversation-list/conversation-list-view.vala | 5 ++--
.../conversation-viewer/conversation-email.vala | 4 +--
.../conversation-viewer/conversation-list-box.vala | 4 +--
.../conversation-viewer/conversation-message.vala | 8 +++---
.../conversation-viewer/conversation-viewer.vala | 4 +--
.../conversation-viewer/conversation-web-view.vala | 2 +-
src/client/dialogs/attachment-dialog.vala | 4 +--
src/client/dialogs/preferences-dialog.vala | 10 +++----
src/client/meson.build | 2 +-
.../desktop-notifications.vala | 2 +-
...st.vala => application-configuration-test.vala} | 2 +-
.../components/client-web-view-test-case.vala | 4 +--
test/client/components/client-web-view-test.vala | 4 ++-
test/js/client-page-state-test.vala | 2 +-
test/meson.build | 2 +-
test/test-client.vala | 2 +-
30 files changed, 94 insertions(+), 80 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4cc9fb4d..98c77885 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -18,6 +18,7 @@ src/client/application/application-attachment-manager.vala
src/client/application/application-avatar-store.vala
src/client/application/application-certificate-manager.vala
src/client/application/application-command.vala
+src/client/application/application-configuration.vala
src/client/application/application-contact-store.vala
src/client/application/application-contact.vala
src/client/application/application-controller.vala
diff --git a/src/client/accounts/accounts-signature-web-view.vala
b/src/client/accounts/accounts-signature-web-view.vala
index 4a7b5fbb..ca31ad5e 100644
--- a/src/client/accounts/accounts-signature-web-view.vala
+++ b/src/client/accounts/accounts-signature-web-view.vala
@@ -21,7 +21,7 @@ public class Accounts.SignatureWebView : ClientWebView {
}
- public SignatureWebView(Configuration config) {
+ public SignatureWebView(Application.Configuration config) {
base(config);
this.user_content_manager.add_script(SignatureWebView.app_script);
}
diff --git a/src/client/application/geary-config.vala b/src/client/application/application-configuration.vala
similarity index 99%
rename from src/client/application/geary-config.vala
rename to src/client/application/application-configuration.vala
index 03074088..10464c5a 100644
--- a/src/client/application/geary-config.vala
+++ b/src/client/application/application-configuration.vala
@@ -7,26 +7,27 @@
/**
* Provides convenience properties to current Geary GSettings values.
*/
-public class Configuration {
+public class Application.Configuration {
- public const string WINDOW_WIDTH_KEY = "window-width";
- public const string WINDOW_HEIGHT_KEY = "window-height";
- public const string WINDOW_MAXIMIZE_KEY = "window-maximize";
- public const string FOLDER_LIST_PANE_POSITION_KEY = "folder-list-pane-position";
+
+ public const string ASK_OPEN_ATTACHMENT_KEY = "ask-open-attachment";
+ public const string AUTOSELECT_KEY = "autoselect";
+ public const string COMPOSER_WINDOW_SIZE_KEY = "composer-window-size";
+ public const string COMPOSE_AS_HTML_KEY = "compose-as-html";
+ public const string CONVERSATION_VIEWER_ZOOM_KEY = "conversation-viewer-zoom";
+ public const string DISPLAY_PREVIEW_KEY = "display-preview";
+ public const string FOLDER_LIST_PANE_HORIZONTAL_KEY = "folder-list-pane-horizontal";
public const string FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY = "folder-list-pane-position-horizontal";
+ public const string FOLDER_LIST_PANE_POSITION_KEY = "folder-list-pane-position";
public const string FOLDER_LIST_PANE_POSITION_VERTICAL_KEY = "folder-list-pane-position-vertical";
- public const string FOLDER_LIST_PANE_HORIZONTAL_KEY = "folder-list-pane-horizontal";
public const string MESSAGES_PANE_POSITION_KEY = "messages-pane-position";
- public const string AUTOSELECT_KEY = "autoselect";
- public const string DISPLAY_PREVIEW_KEY = "display-preview";
- public const string STARTUP_NOTIFICATIONS_KEY = "startup-notifications";
- public const string ASK_OPEN_ATTACHMENT_KEY = "ask-open-attachment";
- public const string COMPOSE_AS_HTML_KEY = "compose-as-html";
- public const string SPELL_CHECK_VISIBLE_LANGUAGES = "spell-check-visible-languages";
- public const string SPELL_CHECK_LANGUAGES = "spell-check-languages";
public const string SEARCH_STRATEGY_KEY = "search-strategy";
- public const string CONVERSATION_VIEWER_ZOOM_KEY = "conversation-viewer-zoom";
- public const string COMPOSER_WINDOW_SIZE_KEY = "composer-window-size";
+ public const string SPELL_CHECK_LANGUAGES = "spell-check-languages";
+ public const string SPELL_CHECK_VISIBLE_LANGUAGES = "spell-check-visible-languages";
+ public const string STARTUP_NOTIFICATIONS_KEY = "startup-notifications";
+ public const string WINDOW_HEIGHT_KEY = "window-height";
+ public const string WINDOW_MAXIMIZE_KEY = "window-maximize";
+ public const string WINDOW_WIDTH_KEY = "window-width";
public enum DesktopEnvironment {
diff --git a/src/client/application/geary-application.vala b/src/client/application/geary-application.vala
index 2b633edc..4cf4bc72 100644
--- a/src/client/application/geary-application.vala
+++ b/src/client/application/geary-application.vala
@@ -197,7 +197,7 @@ public class GearyApplication : Gtk.Application {
* This will be null until {@link startup} has been called, and
* hence will only ever become non-null for the primary instance.
*/
- public Configuration? config {
+ public Application.Configuration? config {
get; private set; default = null;
}
@@ -393,7 +393,7 @@ public class GearyApplication : Gtk.Application {
Environment.set_application_name(NAME);
Util.International.init(GETTEXT_PACKAGE, this.binary);
- Configuration.init(this.is_installed, GSETTINGS_DIR);
+ Application.Configuration.init(this.is_installed, GSETTINGS_DIR);
Geary.Logging.init();
Geary.Logging.log_to(stderr);
GLib.Log.set_writer_func(Geary.Logging.default_log_writer);
@@ -408,7 +408,7 @@ public class GearyApplication : Gtk.Application {
// Calls Gtk.init(), amongst other things
base.startup();
- this.config = new Configuration(SCHEMA_ID);
+ this.config = new Application.Configuration(SCHEMA_ID);
this.autostart = new Application.StartupManager(
this.config, this.get_desktop_directory()
);
diff --git a/src/client/components/client-web-view.vala b/src/client/components/client-web-view.vala
index 950c8f2b..5046ab65 100644
--- a/src/client/components/client-web-view.vala
+++ b/src/client/components/client-web-view.vala
@@ -71,7 +71,7 @@ public abstract class ClientWebView : WebKit.WebView, Geary.BaseInterface {
/**
* Initialises WebKit.WebContext for use by the client.
*/
- public static void init_web_context(Configuration config,
+ public static void init_web_context(Application.Configuration config,
File web_extension_dir,
File cache_dir) {
WebsiteDataManager data_manager = new WebsiteDataManager(cache_dir.get_path());
@@ -107,7 +107,9 @@ public abstract class ClientWebView : WebKit.WebView, Geary.BaseInterface {
});
update_spellcheck(context, config);
- config.settings.changed[Configuration.SPELL_CHECK_LANGUAGES].connect(() => {
+ config.settings.changed[
+ Application.Configuration.SPELL_CHECK_LANGUAGES
+ ].connect(() => {
update_spellcheck(context, config);
});
@@ -181,7 +183,7 @@ public abstract class ClientWebView : WebKit.WebView, Geary.BaseInterface {
}
private static inline void update_spellcheck(WebKit.WebContext context,
- Configuration config) {
+ Application.Configuration config) {
context.set_spell_checking_enabled(config.spell_check_languages.length > 0);
context.set_spell_checking_languages(config.spell_check_languages);
}
@@ -296,7 +298,7 @@ public abstract class ClientWebView : WebKit.WebView, Geary.BaseInterface {
public signal void remote_image_load_blocked();
- protected ClientWebView(Configuration config,
+ protected ClientWebView(Application.Configuration config,
WebKit.UserContentManager? custom_manager = null) {
WebKit.Settings setts = new WebKit.Settings();
setts.allow_modal_dialogs = false;
@@ -357,7 +359,7 @@ public abstract class ClientWebView : WebKit.WebView, Geary.BaseInterface {
);
// Manage zoom level, ensure it's sane
- config.bind(Configuration.CONVERSATION_VIEWER_ZOOM_KEY, this, "zoom_level");
+ config.bind(Application.Configuration.CONVERSATION_VIEWER_ZOOM_KEY, this, "zoom_level");
if (this.zoom_level < ZOOM_MIN) {
this.zoom_level = ZOOM_MIN;
} else if (this.zoom_level > ZOOM_MAX) {
diff --git a/src/client/components/components-inspector-log-view.vala
b/src/client/components/components-inspector-log-view.vala
index e61895cf..e09649af 100644
--- a/src/client/components/components-inspector-log-view.vala
+++ b/src/client/components/components-inspector-log-view.vala
@@ -58,7 +58,7 @@ public class Components.InspectorLogView : Gtk.Grid {
public signal void record_selection_changed();
- public InspectorLogView(Configuration config,
+ public InspectorLogView(Application.Configuration config,
Geary.AccountInformation? filter_by = null) {
GLib.Settings system = config.gnome_interface;
system.bind(
diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala
index 8d40bf7e..554d154f 100644
--- a/src/client/components/main-toolbar.vala
+++ b/src/client/components/main-toolbar.vala
@@ -58,13 +58,17 @@ public class MainToolbar : Gtk.Box {
private Gtk.Image delete_image = new Gtk.Image.from_icon_name("edit-delete-symbolic", Gtk.IconSize.MENU);
- public MainToolbar(Configuration config) {
+ public MainToolbar(Application.Configuration config) {
// Sync headerbar width with left pane
- config.bind(Configuration.MESSAGES_PANE_POSITION_KEY, this, "left-pane-width",
- SettingsBindFlags.GET);
+ config.bind(
+ Application.Configuration.MESSAGES_PANE_POSITION_KEY,
+ this,
+ "left-pane-width",
+ SettingsBindFlags.GET
+ );
this.bind_property("left-pane-width", this.folder_header, "width-request", BindingFlags.SYNC_CREATE);
- if (config.desktop_environment != Configuration.DesktopEnvironment.UNITY) {
+ if (config.desktop_environment != UNITY) {
this.bind_property("account", this.folder_header, "title", BindingFlags.SYNC_CREATE);
this.bind_property("folder", this.folder_header, "subtitle", BindingFlags.SYNC_CREATE);
}
diff --git a/src/client/components/main-window.vala b/src/client/components/main-window.vala
index 3779edee..5fef1733 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -690,21 +690,22 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
this.folder_list.remove_account(to_remove);
}
- private void load_config(Configuration config) {
+ private void load_config(Application.Configuration config) {
// This code both loads AND saves the pane positions with live updating. This is more
// resilient against crashes because the value in dconf changes *immediately*, and
// stays saved in the event of a crash.
- config.bind(Configuration.MESSAGES_PANE_POSITION_KEY, this.conversations_paned, "position");
- config.bind(Configuration.WINDOW_WIDTH_KEY, this, "window-width");
- config.bind(Configuration.WINDOW_HEIGHT_KEY, this, "window-height");
- config.bind(Configuration.WINDOW_MAXIMIZE_KEY, this, "window-maximized");
+ config.bind(Application.Configuration.MESSAGES_PANE_POSITION_KEY, this.conversations_paned,
"position");
+ config.bind(Application.Configuration.WINDOW_WIDTH_KEY, this, "window-width");
+ config.bind(Application.Configuration.WINDOW_HEIGHT_KEY, this, "window-height");
+ config.bind(Application.Configuration.WINDOW_MAXIMIZE_KEY, this, "window-maximized");
// Update to layout
if (config.folder_list_pane_position_horizontal == -1) {
config.folder_list_pane_position_horizontal = config.folder_list_pane_position_old;
config.messages_pane_position += config.folder_list_pane_position_old;
}
- config.settings.changed[Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY]
- .connect(on_change_orientation);
+ config.settings.changed[
+ Application.Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY
+ ].connect(on_change_orientation);
}
private void restore_saved_window_state() {
@@ -801,7 +802,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
}
}
- private void setup_layout(Configuration config) {
+ private void setup_layout(Application.Configuration config) {
this.notify["has-toplevel-focus"].connect(on_has_toplevel_focus);
// Search bar
@@ -841,7 +842,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL);
this.main_toolbar.bind_property("find-open", this.conversation_viewer.conversation_find_bar,
"search-mode-enabled", BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL);
- if (config.desktop_environment == Configuration.DesktopEnvironment.UNITY) {
+ if (config.desktop_environment == UNITY) {
BindingTransformFunc title_func = (binding, source, ref target) => {
string folder = selected_folder != null ? selected_folder.get_display_name() + " " : "";
string account = main_toolbar.account != null ? "(%s)".printf(main_toolbar.account) : "";
@@ -1340,8 +1341,9 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
}
this.application.config.bind(
- horizontal ? Configuration.FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY
- : Configuration.FOLDER_LIST_PANE_POSITION_VERTICAL_KEY,
+ horizontal
+ ? Application.Configuration.FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY
+ : Application.Configuration.FOLDER_LIST_PANE_POSITION_VERTICAL_KEY,
this.folder_paned, "position");
}
diff --git a/src/client/composer/composer-headerbar.vala b/src/client/composer/composer-headerbar.vala
index 146bf607..337d6890 100644
--- a/src/client/composer/composer-headerbar.vala
+++ b/src/client/composer/composer-headerbar.vala
@@ -7,7 +7,7 @@
[GtkTemplate (ui = "/org/gnome/Geary/composer-headerbar.ui")]
public class ComposerHeaderbar : Gtk.HeaderBar {
- public Configuration config { get; set; }
+ public Application.Configuration config { get; set; }
public ComposerWidget.ComposerState state { get; set; }
@@ -32,7 +32,7 @@ public class ComposerHeaderbar : Gtk.HeaderBar {
/** Fired when the user wants to expand a compact composer. */
public signal void expand_composer();
- public ComposerHeaderbar(Configuration config, bool is_compact) {
+ public ComposerHeaderbar(Application.Configuration config, bool is_compact) {
this.config = config;
this.recipients_button.set_visible(is_compact);
@@ -64,7 +64,7 @@ public class ComposerHeaderbar : Gtk.HeaderBar {
}
private void set_detach_button_side() {
- if (config.desktop_environment == Configuration.DesktopEnvironment.UNITY) {
+ if (config.desktop_environment == UNITY) {
detach_start.visible = false;
detach_end.visible = true;
} else {
diff --git a/src/client/composer/composer-web-view.vala b/src/client/composer/composer-web-view.vala
index 642e6a8e..32481ae8 100644
--- a/src/client/composer/composer-web-view.vala
+++ b/src/client/composer/composer-web-view.vala
@@ -115,7 +115,7 @@ public class ComposerWebView : ClientWebView {
internal signal bool button_release_event_done(Gdk.Event event);
- public ComposerWebView(Configuration config) {
+ public ComposerWebView(Application.Configuration config) {
base(config);
add_events(Gdk.EventMask.KEY_PRESS_MASK | Gdk.EventMask.KEY_RELEASE_MASK);
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 44fcbcf8..9bacc8bc 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -2168,7 +2168,7 @@ public class ComposerWidget : Gtk.EventBox, Geary.BaseInterface {
private void on_select_dictionary(SimpleAction action, Variant? param) {
if (this.spell_check_popover == null) {
- Configuration config = this.application.config;
+ Application.Configuration config = this.application.config;
this.spell_check_popover = new SpellCheckPopover(
this.select_dictionary_button, config
);
diff --git a/src/client/composer/composer-window.vala b/src/client/composer/composer-window.vala
index 28629dce..8a134ca4 100644
--- a/src/client/composer/composer-window.vala
+++ b/src/client/composer/composer-window.vala
@@ -39,7 +39,7 @@ public class ComposerWindow : Gtk.ApplicationWindow, ComposerContainer {
add(this.composer);
- if (application.config.desktop_environment == Configuration.DesktopEnvironment.UNITY) {
+ if (application.config.desktop_environment == UNITY) {
composer.embed_header();
} else {
composer.header.show_close_button = true;
@@ -129,7 +129,7 @@ public class ComposerWindow : Gtk.ApplicationWindow, ComposerContainer {
}
switch (this.application.config.desktop_environment) {
- case Configuration.DesktopEnvironment.UNITY:
+ case UNITY:
this.title = subject;
break;
diff --git a/src/client/composer/spell-check-popover.vala b/src/client/composer/spell-check-popover.vala
index 81da94cd..2c0fa1c8 100644
--- a/src/client/composer/spell-check-popover.vala
+++ b/src/client/composer/spell-check-popover.vala
@@ -21,7 +21,7 @@ public class SpellCheckPopover {
private Gtk.SearchEntry search_box;
private Gtk.ScrolledWindow view;
private Gtk.Box content;
- private Configuration config;
+ private Application.Configuration config;
private enum SpellCheckStatus {
INACTIVE,
@@ -175,7 +175,7 @@ public class SpellCheckPopover {
}
- public SpellCheckPopover(Gtk.Widget button, Configuration config) {
+ public SpellCheckPopover(Gtk.Widget button, Application.Configuration config) {
this.popover = new Gtk.Popover(button);
this.config = config;
this.selected_rows = new GLib.GenericSet<string>(GLib.str_hash, GLib.str_equal);
diff --git a/src/client/conversation-list/conversation-list-store.vala
b/src/client/conversation-list/conversation-list-store.vala
index ec72a312..3917f2ca 100644
--- a/src/client/conversation-list/conversation-list-store.vala
+++ b/src/client/conversation-list/conversation-list-store.vala
@@ -110,8 +110,9 @@ public class ConversationListStore : Gtk.ListStore {
this.email_store = new Geary.App.EmailStore(
conversations.base_folder.account
);
- GearyApplication.instance.config.settings.changed[Configuration.DISPLAY_PREVIEW_KEY].connect(
- on_display_preview_changed);
+ GearyApplication.instance.config.settings.changed[
+ Application.Configuration.DISPLAY_PREVIEW_KEY
+ ].connect(on_display_preview_changed);
conversations.scan_completed.connect(on_scan_completed);
conversations.conversations_added.connect(on_conversations_added);
diff --git a/src/client/conversation-list/conversation-list-view.vala
b/src/client/conversation-list/conversation-list-view.vala
index 66e352c2..d489429f 100644
--- a/src/client/conversation-list/conversation-list-view.vala
+++ b/src/client/conversation-list/conversation-list-view.vala
@@ -56,8 +56,9 @@ public class ConversationListView : Gtk.TreeView, Geary.BaseInterface {
Gtk.drag_source_set(this, Gdk.ModifierType.BUTTON1_MASK, FolderList.Tree.TARGET_ENTRY_LIST,
Gdk.DragAction.COPY | Gdk.DragAction.MOVE);
- GearyApplication.instance.config.settings.changed[Configuration.DISPLAY_PREVIEW_KEY].connect(
- on_display_preview_changed);
+ GearyApplication.instance.config.settings.changed[
+ Application.Configuration.DISPLAY_PREVIEW_KEY
+ ].connect(on_display_preview_changed);
// Watch for mouse events.
motion_notify_event.connect(on_motion_notify_event);
diff --git a/src/client/conversation-viewer/conversation-email.vala
b/src/client/conversation-viewer/conversation-email.vala
index 3e34b304..8b021b3a 100644
--- a/src/client/conversation-viewer/conversation-email.vala
+++ b/src/client/conversation-viewer/conversation-email.vala
@@ -218,7 +218,7 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
// Cancellable to use when loading message content
private GLib.Cancellable load_cancellable;
- private Configuration config;
+ private Application.Configuration config;
private Geary.TimeoutManager body_loading_timeout;
@@ -280,7 +280,7 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
Geary.Email email,
Geary.App.EmailStore email_store,
Application.ContactStore contacts,
- Configuration config,
+ Application.Configuration config,
bool is_sent,
bool is_draft,
GLib.Cancellable load_cancellable) {
diff --git a/src/client/conversation-viewer/conversation-list-box.vala
b/src/client/conversation-viewer/conversation-list-box.vala
index b4034909..04bd989d 100644
--- a/src/client/conversation-viewer/conversation-list-box.vala
+++ b/src/client/conversation-viewer/conversation-list-box.vala
@@ -515,7 +515,7 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
private Application.ContactStore contacts;
// App config
- private Configuration config;
+ private Application.Configuration config;
// Cancellable for this conversation's data loading.
private Cancellable cancellable = new Cancellable();
@@ -610,7 +610,7 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
bool suppress_mark_timer,
Geary.App.EmailStore email_store,
Application.ContactStore contacts,
- Configuration config,
+ Application.Configuration config,
Gtk.Adjustment adjustment) {
base_ref();
this.conversation = conversation;
diff --git a/src/client/conversation-viewer/conversation-message.vala
b/src/client/conversation-viewer/conversation-message.vala
index 94fcd45a..d289fb00 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -228,7 +228,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
// The message headers represented by this view
private Geary.EmailHeaderSet headers;
- private Configuration config;
+ private Application.Configuration config;
// Store from which to lookup contacts
private Application.ContactStore contacts;
@@ -357,7 +357,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
public ConversationMessage.from_email(Geary.Email email,
bool load_remote_resources,
Application.ContactStore contacts,
- Configuration config) {
+ Application.Configuration config) {
this(
email,
email.preview != null ? email.preview.buffer.get_valid_utf8() : null,
@@ -377,7 +377,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
public ConversationMessage.from_message(Geary.RFC822.Message message,
bool load_remote_resources,
Application.ContactStore contacts,
- Configuration config) {
+ Application.Configuration config) {
this(
message,
message.get_preview(),
@@ -391,7 +391,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
string? preview,
bool load_remote_resources,
Application.ContactStore contacts,
- Configuration config) {
+ Application.Configuration config) {
base_ref();
this.headers = headers;
this.load_remote_resources = load_remote_resources;
diff --git a/src/client/conversation-viewer/conversation-viewer.vala
b/src/client/conversation-viewer/conversation-viewer.vala
index f7dcde19..661429b4 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -24,7 +24,7 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface {
get; private set; default = null;
}
- private Configuration config;
+ private Application.Configuration config;
private Gee.Set<Geary.App.Conversation>? selection_while_composing = null;
private GLib.Cancellable? find_cancellable = null;
@@ -71,7 +71,7 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface {
/**
* Constructs a new conversation view instance.
*/
- public ConversationViewer(Configuration config) {
+ public ConversationViewer(Application.Configuration config) {
base_ref();
this.config = config;
diff --git a/src/client/conversation-viewer/conversation-web-view.vala
b/src/client/conversation-viewer/conversation-web-view.vala
index 52f296ef..217528ab 100644
--- a/src/client/conversation-viewer/conversation-web-view.vala
+++ b/src/client/conversation-viewer/conversation-web-view.vala
@@ -56,7 +56,7 @@ public class ConversationWebView : ClientWebView {
);
- public ConversationWebView(Configuration config) {
+ public ConversationWebView(Application.Configuration config) {
base(config);
this.user_content_manager.add_script(ConversationWebView.app_script);
this.user_content_manager.add_style_sheet(ConversationWebView.app_stylesheet);
diff --git a/src/client/dialogs/attachment-dialog.vala b/src/client/dialogs/attachment-dialog.vala
index cb5e4af7..6167d34b 100644
--- a/src/client/dialogs/attachment-dialog.vala
+++ b/src/client/dialogs/attachment-dialog.vala
@@ -12,7 +12,7 @@ public class AttachmentDialog : Object {
private const int PREVIEW_SIZE = 180;
private const int PREVIEW_PADDING = 3;
- private Configuration config;
+ private Application.Configuration config;
private Gtk.FileChooserNative? chooser = null;
@@ -20,7 +20,7 @@ public class AttachmentDialog : Object {
public delegate bool Attacher(File attachment_file, bool alert_errors = true);
- public AttachmentDialog(Gtk.Window? parent, Configuration config) {
+ public AttachmentDialog(Gtk.Window? parent, Application.Configuration config) {
this.config = config;
this.chooser = new Gtk.FileChooserNative(_("Choose a file"), parent, Gtk.FileChooserAction.OPEN,
_("_Attach"), Stock._CANCEL);
diff --git a/src/client/dialogs/preferences-dialog.vala b/src/client/dialogs/preferences-dialog.vala
index 72459c1c..5d77c685 100644
--- a/src/client/dialogs/preferences-dialog.vala
+++ b/src/client/dialogs/preferences-dialog.vala
@@ -29,11 +29,11 @@ public class PreferencesDialog : Gtk.Dialog {
set_titlebar(this.header);
this.app = app;
- Configuration config = app.config;
- config.bind(Configuration.AUTOSELECT_KEY, autoselect, "active");
- config.bind(Configuration.DISPLAY_PREVIEW_KEY, display_preview, "active");
- config.bind(Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY, three_pane_view, "active");
- config.bind(Configuration.STARTUP_NOTIFICATIONS_KEY, startup_notifications, "active");
+ Application.Configuration config = app.config;
+ config.bind(Application.Configuration.AUTOSELECT_KEY, autoselect, "active");
+ config.bind(Application.Configuration.DISPLAY_PREVIEW_KEY, display_preview, "active");
+ config.bind(Application.Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY, three_pane_view, "active");
+ config.bind(Application.Configuration.STARTUP_NOTIFICATIONS_KEY, startup_notifications, "active");
}
public new void run() {
diff --git a/src/client/meson.build b/src/client/meson.build
index 405e93af..09b5c685 100644
--- a/src/client/meson.build
+++ b/src/client/meson.build
@@ -4,6 +4,7 @@ geary_client_vala_sources = files(
'application/application-avatar-store.vala',
'application/application-certificate-manager.vala',
'application/application-command.vala',
+ 'application/application-configuration.vala',
'application/application-contact-store.vala',
'application/application-contact.vala',
'application/application-controller.vala',
@@ -11,7 +12,6 @@ geary_client_vala_sources = files(
'application/application-plugin-manager.vala',
'application/application-startup-manager.vala',
'application/geary-application.vala',
- 'application/geary-config.vala',
'application/goa-mediator.vala',
'application/secret-mediator.vala',
diff --git a/src/client/plugin/desktop-notifications/desktop-notifications.vala
b/src/client/plugin/desktop-notifications/desktop-notifications.vala
index 700a0db6..021a25a9 100644
--- a/src/client/plugin/desktop-notifications/desktop-notifications.vala
+++ b/src/client/plugin/desktop-notifications/desktop-notifications.vala
@@ -177,7 +177,7 @@ public class Plugin.DesktopNotifications : Notification {
/* We do not show notification action under Unity */
- if (this.application.config.desktop_environment == Configuration.DesktopEnvironment.UNITY) {
+ if (this.application.config.desktop_environment == UNITY) {
this.application.send_notification(id, notification);
return notification;
} else {
diff --git a/test/client/application/geary-configuration-test.vala
b/test/client/application/application-configuration-test.vala
similarity index 95%
rename from test/client/application/geary-configuration-test.vala
rename to test/client/application/application-configuration-test.vala
index 5d9d43b7..d31d6749 100644
--- a/test/client/application/geary-configuration-test.vala
+++ b/test/client/application/application-configuration-test.vala
@@ -5,7 +5,7 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
-class ConfigurationTest : TestCase {
+public class Application.ConfigurationTest : TestCase {
private Configuration test_config = null;
diff --git a/test/client/components/client-web-view-test-case.vala
b/test/client/components/client-web-view-test-case.vala
index 0a5a092c..10f9846b 100644
--- a/test/client/components/client-web-view-test-case.vala
+++ b/test/client/components/client-web-view-test-case.vala
@@ -9,11 +9,11 @@
public abstract class ClientWebViewTestCase<V> : TestCase {
protected V? test_view = null;
- protected Configuration? config = null;
+ protected Application.Configuration? config = null;
protected ClientWebViewTestCase(string name) {
base(name);
- this.config = new Configuration(GearyApplication.SCHEMA_ID);
+ this.config = new Application.Configuration(GearyApplication.SCHEMA_ID);
this.config.enable_debug = true;
ClientWebView.init_web_context(
this.config,
diff --git a/test/client/components/client-web-view-test.vala
b/test/client/components/client-web-view-test.vala
index 933f84d7..8ff91f90 100644
--- a/test/client/components/client-web-view-test.vala
+++ b/test/client/components/client-web-view-test.vala
@@ -14,7 +14,9 @@ public class ClientWebViewTest : TestCase {
}
public void init_web_context() throws Error {
- Configuration config = new Configuration(GearyApplication.SCHEMA_ID);
+ Application.Configuration config = new Application.Configuration(
+ GearyApplication.SCHEMA_ID
+ );
config.enable_debug = true;
ClientWebView.init_web_context(
config,
diff --git a/test/js/client-page-state-test.vala b/test/js/client-page-state-test.vala
index 01145916..d763dcc3 100644
--- a/test/js/client-page-state-test.vala
+++ b/test/js/client-page-state-test.vala
@@ -10,7 +10,7 @@ class ClientPageStateTest : ClientWebViewTestCase<ClientWebView> {
private class TestClientWebView : ClientWebView {
- public TestClientWebView(Configuration config) {
+ public TestClientWebView(Application.Configuration config) {
base(config);
}
diff --git a/test/meson.build b/test/meson.build
index 95c24de8..073da675 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -80,8 +80,8 @@ geary_test_client_sources = [
'engine/api/geary-credentials-mediator-mock.vala',
'client/accounts/accounts-manager-test.vala',
+ 'client/application/application-configuration-test.vala',
'client/application/geary-application-test.vala',
- 'client/application/geary-configuration-test.vala',
'client/components/client-web-view-test.vala',
'client/components/client-web-view-test-case.vala',
'client/composer/composer-web-view-test.vala',
diff --git a/test/test-client.vala b/test/test-client.vala
index 25567a3a..72486677 100644
--- a/test/test-client.vala
+++ b/test/test-client.vala
@@ -49,9 +49,9 @@ int main(string[] args) {
// Keep this before other ClientWebView based tests since it tests
// WebContext init
client.add_suite(new Accounts.ManagerTest().get_suite());
+ client.add_suite(new Application.ConfigurationTest().get_suite());
client.add_suite(new ClientWebViewTest().get_suite());
client.add_suite(new ComposerWebViewTest().get_suite());
- client.add_suite(new ConfigurationTest().get_suite());
client.add_suite(new GearyApplicationTest().get_suite());
client.add_suite(new Util.Avatar.Test().get_suite());
client.add_suite(new Util.Cache.Test().get_suite());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]