summaryrefslogtreecommitdiff
path: root/plugins/common
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-08 11:11:41 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-08 11:11:41 +0100
commit360a72d4363f513a3acaebb084ab39fe3ff22832 (patch)
treeb3d41d58cbb1d52e3871e40258539ac760cd265e /plugins/common
parentfa4d70ea3101f5a70b33977ba9b7673ddfb36762 (diff)
parent1ef9b86df1cca6dde71529f03b66407953d000c9 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'plugins/common')
-rw-r--r--plugins/common/RESTSupport.vala12
-rw-r--r--plugins/common/Resources.vala24
2 files changed, 10 insertions, 26 deletions
diff --git a/plugins/common/RESTSupport.vala b/plugins/common/RESTSupport.vala
index cc810fe..13286de 100644
--- a/plugins/common/RESTSupport.vala
+++ b/plugins/common/RESTSupport.vala
@@ -4,6 +4,8 @@
* (version 2.1 or later). See the COPYING file in this distribution.
*/
+extern const string _VERSION;
+
namespace Publishing.RESTSupport {
// Ported from librest
@@ -34,9 +36,11 @@ public abstract class Session {
public signal void authenticated();
public signal void authentication_failed(Spit.Publishing.PublishingError err);
- protected Session(string? endpoint_url = null) {
+ protected Session(string? endpoint_url = null, Soup.SessionFeature[] features = {}) {
this.endpoint_url = endpoint_url;
soup_session = new Soup.Session ();
+ // The trailing space is intentional to make libsoup append its version info
+ soup_session.set_user_agent("Shotwell/%s ".printf(_VERSION));
if (Environment.get_variable("SHOTWELL_SOUP_LOG") != null) {
var logger = new Soup.Logger(Soup.LoggerLogLevel.BODY);
logger.set_request_filter((logger, msg) => {
@@ -49,6 +53,10 @@ public abstract class Session {
});
soup_session.add_feature (logger);
}
+
+ foreach (var feature in features) {
+ soup_session.add_feature(feature);
+ }
}
protected void notify_wire_message_unqueued(Soup.Message message) {
@@ -361,7 +369,7 @@ public class Transaction {
protected virtual void add_header(string key, string value) {
message.request_headers.append(key, value);
}
-
+
// set custom_payload to null to have this transaction send the default payload of
// key-value pairs appended through add_argument(...) (this is how most REST requests work).
// To send a payload other than traditional key-value pairs (such as an XML document or a JPEG
diff --git a/plugins/common/Resources.vala b/plugins/common/Resources.vala
index 16306f2..d8c3fd3 100644
--- a/plugins/common/Resources.vala
+++ b/plugins/common/Resources.vala
@@ -30,30 +30,6 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
public const string TRANSLATORS = _("translator-credits");
-// TODO: modify to load multiple icons
-//
-// provided all the icons in the set follow a known naming convention (such as iconName_nn.png,
-// where 'nn' is a size value in pixels, for example plugins_16.png -- this convention seems
-// pretty common in the GNOME world), then this function can be modified to load an entire icon
-// set without its interface needing to change, since given one icon filename, we can
-// determine the others.
-public Gdk.Pixbuf[]? load_icon_set(GLib.File? icon_file) {
- Gdk.Pixbuf? icon = null;
- try {
- icon = new Gdk.Pixbuf.from_file(icon_file.get_path());
- } catch (Error err) {
- warning("couldn't load icon set from %s: %s", icon_file.get_path(), err.message);
- }
-
- if (icon != null) {
- Gdk.Pixbuf[] icon_pixbuf_set = new Gdk.Pixbuf[0];
- icon_pixbuf_set += icon;
- return icon_pixbuf_set;
- }
-
- return null;
-}
-
public Gdk.Pixbuf[]? load_from_resource (string resource_path) {
Gdk.Pixbuf? icon = null;
try {