Commit 495c9f69 authored by Guido Gunther's avatar Guido Gunther
Browse files

Drop all patches

Applied upstream
parent caa1668b
From 3b6dd303323cfc5b7bebe5b1d88170f1030f2de2 Mon Sep 17 00:00:00 2001
From: Michael Gratton <mike@vee.net>
Date: Sat, 5 Sep 2020 14:13:01 +1000
Subject: [PATCH 001/124] Geary.Db.Context: Update access to
DatabaseConnections
Ensure internal code can access a DatabaseConnection from context
objects to get access to connection-specific code, but make the
polymorphic context accessors internal so transactions can't access
them.
---
src/engine/db/db-connection.vala | 5 +++--
src/engine/db/db-context.vala | 8 ++++----
src/engine/db/db-database-connection.vala | 8 ++++----
src/engine/db/db-database.vala | 8 ++++----
src/engine/db/db-result.vala | 8 ++++----
src/engine/db/db-statement.vala | 19 ++++++++++++-------
src/engine/db/db-transaction-connection.vala | 11 +----------
src/engine/imap-db/imap-db-attachment.vala | 2 +-
8 files changed, 33 insertions(+), 36 deletions(-)
diff --git a/src/engine/db/db-connection.vala b/src/engine/db/db-connection.vala
index 4f0859e1..ebce27dc 100644
--- a/src/engine/db/db-connection.vala
+++ b/src/engine/db/db-connection.vala
@@ -18,7 +18,7 @@
* A connection will be automatically closed when its last reference
* is dropped.
*/
-public interface Geary.Db.Connection : Context {
+public interface Geary.Db.Connection : BaseObject {
private const string PRAGMA_FOREIGN_KEYS = "foreign_keys";
private const string PRAGMA_RECURSIVE_TRIGGERS = "recursive_triggers";
@@ -278,7 +278,8 @@ public interface Geary.Db.Connection : Context {
*
* @see exec
*/
- public abstract Result query(string sql, GLib.Cancellable? cancellable = null)
+ public abstract Result query(string sql,
+ GLib.Cancellable? cancellable = null)
throws GLib.Error;
/**
diff --git a/src/engine/db/db-context.vala b/src/engine/db/db-context.vala
index 9bbb8503..a59f6c4c 100644
--- a/src/engine/db/db-context.vala
+++ b/src/engine/db/db-context.vala
@@ -37,19 +37,19 @@ public abstract class Geary.Db.Context : BaseObject, Logging.Source {
private weak Logging.Source? _logging_parent = null;
- public virtual Database? get_database() {
+ internal virtual Database? get_database() {
return get_connection() != null ? get_connection().database : null;
}
- public virtual Connection? get_connection() {
+ internal virtual DatabaseConnection? get_connection() {
return get_statement() != null ? get_statement().connection : null;
}
- public virtual Statement? get_statement() {
+ internal virtual Statement? get_statement() {
return get_result() != null ? get_result().statement : null;
}
- public virtual Result? get_result() {
+ internal virtual Result? get_result() {
return null;
}
diff --git a/src/engine/db/db-database-connection.vala b/src/engine/db/db-database-connection.vala
index 4e7ceb78..dd311bea 100644
--- a/src/engine/db/db-database-connection.vala
+++ b/src/engine/db/db-database-connection.vala
@@ -255,13 +255,13 @@ public class Geary.Db.DatabaseConnection : Context, Connection {
return yield job.wait_for_completion_async();
}
- public override Connection? get_connection() {
- return this;
- }
-
/** {@inheritDoc} */
public override Logging.State to_logging_state() {
return new Logging.State(this, "%u", this.cx_number);
}
+ internal override DatabaseConnection? get_connection() {
+ return this;
+ }
+
}
diff --git a/src/engine/db/db-database.vala b/src/engine/db/db-database.vala
index 592bd306..a807e7ba 100644
--- a/src/engine/db/db-database.vala
+++ b/src/engine/db/db-database.vala
@@ -358,10 +358,6 @@ public class Geary.Db.Database : Context {
}
- public override Database? get_database() {
- return this;
- }
-
/** {@inheritDoc} */
public override Logging.State to_logging_state() {
return new Logging.State(
@@ -386,6 +382,10 @@ public class Geary.Db.Database : Context {
this.thread_pool.add(new_job);
}
+ internal override Database? get_database() {
+ return this;
+ }
+
/**
* Hook for subclasses to modify a new SQLite connection before use.
*
diff --git a/src/engine/db/db-result.vala b/src/engine/db/db-result.vala
index 1ec3ed55..64c78756 100644
--- a/src/engine/db/db-result.vala
+++ b/src/engine/db/db-result.vala
@@ -294,15 +294,15 @@ public class Geary.Db.Result : Geary.Db.Context {
return column;
}
- public override Result? get_result() {
- return this;
- }
-
/** {@inheritDoc} */
public override Logging.State to_logging_state() {
return new Logging.State(this, this.finished ? "finished" : "not finished");
}
+ internal override Result? get_result() {
+ return this;
+ }
+
[PrintfFormat]
private void log_result(string fmt, ...) {
if (Db.Context.enable_sql_logging) {
diff --git a/src/engine/db/db-statement.vala b/src/engine/db/db-statement.vala
index 0a36dfb1..088b882b 100644
--- a/src/engine/db/db-statement.vala
+++ b/src/engine/db/db-statement.vala
@@ -13,7 +13,7 @@ public class Geary.Db.Statement : Context {
get { return this.stmt.sql(); }
}
- public Connection connection { get; private set; }
+ internal DatabaseConnection connection { get; private set; }
internal Sqlite.Statement stmt;
@@ -36,9 +36,14 @@ public class Geary.Db.Statement : Context {
private Gee.HashSet<Memory.Buffer> held_buffers = new Gee.HashSet<Memory.Buffer>();
- internal Statement(Connection connection, string sql) throws DatabaseError {
+ internal Statement(DatabaseConnection connection, string sql)
+ throws DatabaseError {
this.connection = connection;
- throw_on_error("Statement.ctor", connection.db.prepare_v2(sql, -1, out stmt, null), sql);
+ throw_on_error(
+ "Statement.ctor",
+ connection.db.prepare_v2(sql, -1, out stmt, null),
+ sql
+ );
}
/** Returns SQL for the statement with bound parameters expanded. */
@@ -271,13 +276,13 @@ public class Geary.Db.Statement : Context {
return this;
}
- public override Statement? get_statement() {
- return this;
- }
-
/** {@inheritDoc} */
public override Logging.State to_logging_state() {
return new Logging.State(this, this.sql);
}
+ internal override Statement? get_statement() {
+ return this;
+ }
+
}
diff --git a/src/engine/db/db-transaction-connection.vala b/src/engine/db/db-transaction-connection.vala
index 48244dbc..ebdd18b4 100644
--- a/src/engine/db/db-transaction-connection.vala
+++ b/src/engine/db/db-transaction-connection.vala
@@ -9,7 +9,7 @@
/**
* A connection to the database for transactions.
*/
-internal class Geary.Db.TransactionConnection : Context, Connection {
+internal class Geary.Db.TransactionConnection : BaseObject, Connection {
/** {@inheritDoc} */
@@ -54,13 +54,4 @@ internal class Geary.Db.TransactionConnection : Context, Connection {
this.db_cx.exec_file(file, cancellable);
}
- public override Connection? get_connection() {
- return this;
- }
-
- /** {@inheritDoc} */
- public override Logging.State to_logging_state() {
- return new Logging.State(this, "");
- }
-
}
diff --git a/src/engine/imap-db/imap-db-attachment.vala b/src/engine/imap-db/imap-db-attachment.vala
index d8e8f9db..fa94b630 100644
--- a/src/engine/imap-db/imap-db-attachment.vala
+++ b/src/engine/imap-db/imap-db-attachment.vala
@@ -245,7 +245,7 @@ private class Geary.ImapDB.Attachment : Geary.Attachment {
}
// Ensure they're dead, Jim.
- Db.Statement stmt = new Db.Statement(cx, """
+ Db.Statement stmt = cx.prepare("""
DELETE FROM MessageAttachmentTable WHERE message_id = ?
""");
stmt.bind_rowid(0, message_id);
--
2.29.2
From e6fd0fe1742bd2143c1fa16fa30e82a5ea7996ed Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Thu, 23 Apr 2020 10:11:06 +0200
Subject: [PATCH 1/8] accounts-editor: Wrap the welcome panel labels
This helps the accounts editor fit in narrow screens.
---
ui/accounts_editor_list_pane.ui | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ui/accounts_editor_list_pane.ui b/ui/accounts_editor_list_pane.ui
index 59f8c632..a40604e3 100644
--- a/ui/accounts_editor_list_pane.ui
+++ b/ui/accounts_editor_list_pane.ui
@@ -60,6 +60,8 @@
<property name="halign">start</property>
<property name="valign">start</property>
<property name="label" translatable="yes">To get started, select an email provider below.</property>
+ <property name="xalign">0</property>
+ <property name="wrap">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -73,6 +75,8 @@
<property name="halign">start</property>
<property name="valign">end</property>
<property name="label" translatable="yes">Welcome to Geary</property>
+ <property name="xalign">0</property>
+ <property name="wrap">True</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
--
2.29.2
From c0a89a86e48667b17dcae934e5f3b15a2475abf3 Mon Sep 17 00:00:00 2001
From: Julian Sparber <julian@sparber.net>
Date: Thu, 22 Oct 2020 15:47:09 +0200
Subject: [PATCH 1/2] conversation-email-row: use is-expanded to add/remove css
class
---
.../conversation-viewer/conversation-list-box.vala | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/client/conversation-viewer/conversation-list-box.vala b/src/client/conversation-viewer/conversation-list-box.vala
index 3eb8240b..f860a2df 100644
--- a/src/client/conversation-viewer/conversation-list-box.vala
+++ b/src/client/conversation-viewer/conversation-list-box.vala
@@ -284,6 +284,7 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
}
protected set {
this._is_expanded = value;
+ notify_property("is-expanded");
}
}
private bool _is_expanded = false;
@@ -301,6 +302,7 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
protected ConversationRow(Geary.Email? email) {
base_ref();
this.email = email;
+ notify["is-expanded"].connect(update_css_class);
show();
}
@@ -325,6 +327,13 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
this.size_allocate.connect(on_size_allocate);
}
+ private void update_css_class() {
+ if (this.is_expanded)
+ get_style_context().add_class(EXPANDED_CLASS);
+ else
+ get_style_context().remove_class(EXPANDED_CLASS);
+ }
+
protected inline void set_style_context_class(string class_name, bool value) {
if (value) {
get_style_context().add_class(class_name);
@@ -392,10 +401,8 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
private inline void update_row_expansion() {
if (this.is_expanded || this.is_pinned) {
- get_style_context().add_class(EXPANDED_CLASS);
this.view.expand_email();
} else {
- get_style_context().remove_class(EXPANDED_CLASS);
this.view.collapse_email();
}
}
@@ -436,7 +443,6 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
base(view.referred);
this.view = view;
this.is_expanded = true;
- get_style_context().add_class(EXPANDED_CLASS);
add(this.view);
}
--
2.29.2
From f30f5d77095abff8d4d170fcc6480409188b71d0 Mon Sep 17 00:00:00 2001
From: Julian Sparber <julian@sparber.net>
Date: Mon, 23 Nov 2020 12:16:41 +0100
Subject: [PATCH 1/3] folder-list: Don't expand folder list automatically
---
src/client/folder-list/folder-list-account-branch.vala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/client/folder-list/folder-list-account-branch.vala b/src/client/folder-list/folder-list-account-branch.vala
index 00ac05b8..7b541512 100644
--- a/src/client/folder-list/folder-list-account-branch.vala
+++ b/src/client/folder-list/folder-list-account-branch.vala
@@ -34,7 +34,7 @@ public class FolderList.AccountBranch : Sidebar.Branch {
public AccountBranch(Geary.Account account) {
base(new Sidebar.Header(account.information.display_name),
- Sidebar.Branch.Options.AUTO_OPEN_ON_NEW_CHILD, normal_folder_comparator, special_folder_comparator);
+ Sidebar.Branch.Options.NONE, normal_folder_comparator, special_folder_comparator);
this.account = account;
// Translators: The name of the folder group containing
--
2.29.2
From 0923de098f2e9ae6a94c5bb82e26b7d80c5181dc Mon Sep 17 00:00:00 2001
From: Julian Sparber <julian@sparber.net>
Date: Fri, 9 Oct 2020 15:55:57 +0200
Subject: [PATCH 1/6] main-window: remove shadow from folder/conversation list
---
ui/application-main-window.ui | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/application-main-window.ui b/ui/application-main-window.ui
index 547b063f..c55e42ab 100644
--- a/ui/application-main-window.ui
+++ b/ui/application-main-window.ui
@@ -49,7 +49,7 @@
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<property name="label_xalign">0</property>
- <property name="shadow_type">in</property>
+ <property name="shadow_type">none</property>
<child>
<object class="GtkScrolledWindow" id="folder_list_scrolled">
<property name="width_request">100</property>
@@ -95,7 +95,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
- <property name="shadow_type">in</property>
+ <property name="shadow_type">none</property>
<child>
<object class="GtkScrolledWindow" id="conversation_list_scrolled">
<property name="width_request">250</property>
--
2.29.2
From a1d31847b115e8ac81520226ff121fabc1f2e2ef Mon Sep 17 00:00:00 2001
From: Michael Gratton <mike@vee.net>
Date: Sat, 5 Sep 2020 14:15:28 +1000
Subject: [PATCH 002/124] Geary.Db.Result: Log large elapsed query times as a
warning
Help ensure that long-running queries get some visibility during
development.
---
src/engine/db/db-result.vala | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/engine/db/db-result.vala b/src/engine/db/db-result.vala
index 64c78756..300d3afa 100644
--- a/src/engine/db/db-result.vala
+++ b/src/engine/db/db-result.vala
@@ -38,10 +38,23 @@ public class Geary.Db.Result : Geary.Db.Context {
check_cancelled("Result.next", cancellable);
if (!finished) {
- Timer timer = new Timer();
+ var timer = new GLib.Timer();
finished = throw_on_error("Result.next", statement.stmt.step(), statement.sql) != Sqlite.ROW;
- if (timer.elapsed() > 1.0)
- debug("\n\nDB QUERY STEP \"%s\"\nelapsed=%lf\n\n", statement.sql, timer.elapsed());
+ var elapsed = timer.elapsed();
+ var threshold = (get_connection().busy_timeout * 1000.0) / 2.0;
+ if (threshold > 0 && elapsed > threshold) {
+ warning(
+ "Step for \"%s\" took elapsed time: %lfs (>50%)",
+ statement.sql,
+ elapsed
+ );
+ } else if (elapsed > 1.0) {
+ debug(
+ "Step for \"%s\" took elapsed time: %lfs (>1s)",
+ statement.sql,
+ elapsed
+ );
+ }
log_result(finished ? "NO ROW" : "ROW");
}
--
2.29.2
From c128b1be5f571315ae8a0f34cd9d00fd20c30cdc Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Mon, 27 Apr 2020 10:42:16 +0200
Subject: [PATCH 2/8] accounts-editor-add-pane: Drop the useless shadow
---
ui/accounts_editor_add_pane.ui | 1 -
1 file changed, 1 deletion(-)
diff --git a/ui/accounts_editor_add_pane.ui b/ui/accounts_editor_add_pane.ui
index 0c01a4c1..336b73ea 100644
--- a/ui/accounts_editor_add_pane.ui
+++ b/ui/accounts_editor_add_pane.ui
@@ -89,7 +89,6 @@
<property name="vexpand">True</property>
<property name="vadjustment">pane_adjustment</property>
<property name="hscrollbar_policy">never</property>
- <property name="shadow_type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
--
2.29.2
From 51da28b7c0ec32883b923f82b3d85ba4285dc623 Mon Sep 17 00:00:00 2001
From: Julian Sparber <julian@sparber.net>
Date: Fri, 23 Oct 2020 13:05:19 +0200
Subject: [PATCH 2/2] conversation-list-box: remove shadow and make the rows
rounded
This also makes the expander row look like in HdyExpander row.
---
.../conversation-list-box.vala | 56 +++++++++++++++++
.../conversation-web-view.vala | 26 ++++++++
ui/geary.css | 61 ++++++++++++-------
3 files changed, 120 insertions(+), 23 deletions(-)
diff --git a/src/client/conversation-viewer/conversation-list-box.vala b/src/client/conversation-viewer/conversation-list-box.vala
index f860a2df..f94ddea9 100644
--- a/src/client/conversation-viewer/conversation-list-box.vala
+++ b/src/client/conversation-viewer/conversation-list-box.vala
@@ -332,6 +332,33 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
get_style_context().add_class(EXPANDED_CLASS);
else
get_style_context().remove_class(EXPANDED_CLASS);
+
+ update_previous_sibling_css_class();
+ }
+
+ // This is mostly taken form libhandy HdyExpanderRow
+ private Gtk.Widget? get_previous_sibling() {
+ if (this.parent is Gtk.Container) {
+ var siblings = this.parent.get_children();
+ unowned List<weak Gtk.Widget> l;
+ for (l = siblings; l != null && l.next != null && l.next.data != this; l = l.next);
+
+ if (l != null && l.next != null && l.next.data == this) {
+ return l.data;
+ }
+ }
+
+ return null;
+ }
+
+ private void update_previous_sibling_css_class() {
+ var previous_sibling = get_previous_sibling();
+ if (previous_sibling != null) {
+ if (this.is_expanded)
+ previous_sibling.get_style_context().add_class("geary-expanded-previous-sibling");
+ else
+ previous_sibling.get_style_context().remove_class("geary-expanded-previous-sibling");
+ }
}
protected inline void set_style_context_class(string class_name, bool value) {
@@ -675,9 +702,14 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
this.selection_mode = NONE;
+ get_style_context().add_class("content");
get_style_context().add_class("background");
get_style_context().add_class("conversation-listbox");
+ /* we need to update the previous sibling style class when rows are added or removed */
+ add.connect(update_previous_sibling_css_class);
+ remove.connect(update_previous_sibling_css_class);
+
set_adjustment(adjustment);
set_sort_func(ConversationListBox.on_sort);
@@ -703,6 +735,30 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
base.destroy();
}
+ // For some reason insert doesn't emit the add event
+ public new void insert(Gtk.Widget child, int position) {
+ base.insert(child, position);
+ update_previous_sibling_css_class();
+ }
+
+ // This is mostly taken form libhandy HdyExpanderRow
+ private void update_previous_sibling_css_class() {
+ var siblings = this.get_children();
+ unowned List<weak Gtk.Widget> l;
+ for (l = siblings; l != null && l.next != null && l.next.data != this; l = l.next) {
+ if (l != null && l.next != null) {
+ var row = l.next.data as ConversationRow;
+ if (row != null) {
+ if (row.is_expanded) {
+ l.data.get_style_context().add_class("geary-expanded-previous-sibling");
+ } else {
+ l.data.get_style_context().remove_class("geary-expanded-previous-sibling");
+ }
+ }
+ }
+ }
+ }
+
public async void load_conversation(Gee.Collection<Geary.EmailIdentifier> scroll_to,
Geary.SearchQuery? query)
throws GLib.Error {
diff --git a/src/client/conversation-viewer/conversation-web-view.vala b/src/client/conversation-viewer/conversation-web-view.vala
index a1ba21a6..ad11415e 100644
--- a/src/client/conversation-viewer/conversation-web-view.vala
+++ b/src/client/conversation-viewer/conversation-web-view.vala
@@ -197,6 +197,32 @@ public class ConversationWebView : Components.WebView {
}
+ // Clip round bottom corner
+ // This is based on
+ // https://gitlab.gnome.org/GNOME/gnome-weather/-/commit/9b6336454cc90669d1ee8387bdfc6627e3659e83
+ public override bool draw(Cairo.Context cr) {
+ var frameWidth = this.get_allocated_width();
+ var frameHeight = this.get_allocated_height();
+ var borderRadius = 8;
+
+ var arc0 = 0.0;
+ var arc1 = Math.PI * 0.5;
+ var arc2 = Math.PI;
+
+ cr.new_sub_path();
+ cr.line_to(frameWidth, 0);
+ cr.arc(frameWidth - borderRadius, frameHeight - borderRadius, borderRadius, arc0, arc1);
+ cr.arc(borderRadius, frameHeight - borderRadius, borderRadius, arc1, arc2);
+ cr.line_to(0, 0);
+ cr.close_path();