[shotwell] Fix deprecation warnings
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] Fix deprecation warnings
- Date: Fri, 15 Mar 2019 19:31:28 +0000 (UTC)
commit ab9f99eeced6cef934d2a9a0e537edee3bf624e1
Author: Jens Georg <mail jensge org>
Date: Fri Mar 15 14:30:58 2019 +0100
Fix deprecation warnings
meson.build | 17 ++++++++++-------
plugins/common/RESTSupport.vala | 16 ++++++++--------
.../shotwell-publishing-extras/YandexPublishing.vala | 2 +-
plugins/shotwell-publishing/PhotosUploader.vala | 3 ++-
src/MapWidget.vala | 20 +++++++++++++++++---
src/VideoSupport.vala | 2 +-
src/events/EventDirectoryItem.vala | 2 +-
src/import-roll/ImportRollBranch.vala | 3 +--
src/sidebar/Tree.vala | 1 -
9 files changed, 41 insertions(+), 25 deletions(-)
---
diff --git a/meson.build b/meson.build
index 37ffcf08..0d4e86ee 100644
--- a/meson.build
+++ b/meson.build
@@ -22,13 +22,16 @@ shotwell_plugin_dir = join_paths(get_option('libdir'), 'shotwell', 'plugins', 'b
add_global_arguments(['-DHAVE_CONFIG_H=1'],
['-include'], ['config.h'],
language : 'c')
-add_global_arguments(['--target-glib=2.40',
- '--vapidir=@0@'.format(join_paths(meson.current_source_dir(),
- 'vapi')),
- '--enable-checking',
- '--fatal-warnings',
- '--enable-experimental',
- '--enable-deprecated'], language : 'vala')
+add_global_arguments(
+ [
+ '--target-glib=2.40',
+ '--vapidir=@0@'.format(join_paths(meson.current_source_dir(), 'vapi')),
+ '--enable-checking',
+ '--fatal-warnings',
+ '--enable-experimental',
+ ],
+ language : 'vala'
+)
version_h = vcs_tag(command: ['git', 'rev-parse', 'HEAD'], input: 'version.h.in', output: 'version.h',
fallback: '')
version = declare_dependency(sources : version_h, include_directories : include_directories('.'))
diff --git a/plugins/common/RESTSupport.vala b/plugins/common/RESTSupport.vala
index 0d0a3fbd..9966b85c 100644
--- a/plugins/common/RESTSupport.vala
+++ b/plugins/common/RESTSupport.vala
@@ -264,21 +264,21 @@ public class Transaction {
protected void check_response(Soup.Message message) throws Spit.Publishing.PublishingError {
switch (message.status_code) {
- case Soup.KnownStatusCode.OK:
- case Soup.KnownStatusCode.CREATED: // HTTP code 201 (CREATED) signals that a new
+ case Soup.Status.OK:
+ case Soup.Status.CREATED: // HTTP code 201 (CREATED) signals that a new
// resource was created in response to a PUT or POST
break;
- case Soup.KnownStatusCode.CANT_RESOLVE:
- case Soup.KnownStatusCode.CANT_RESOLVE_PROXY:
+ case Soup.Status.CANT_RESOLVE:
+ case Soup.Status.CANT_RESOLVE_PROXY:
throw new Spit.Publishing.PublishingError.NO_ANSWER("Unable to resolve %s (error code %u)",
get_endpoint_url(), message.status_code);
- case Soup.KnownStatusCode.CANT_CONNECT:
- case Soup.KnownStatusCode.CANT_CONNECT_PROXY:
+ case Soup.Status.CANT_CONNECT:
+ case Soup.Status.CANT_CONNECT_PROXY:
throw new Spit.Publishing.PublishingError.NO_ANSWER("Unable to connect to %s (error code
%u)",
get_endpoint_url(), message.status_code);
- case Soup.KnownStatusCode.SSL_FAILED:
+ case Soup.Status.SSL_FAILED:
throw new Spit.Publishing.PublishingError.SSL_FAILED ("Unable to connect to %s: Secure
connection failed",
get_endpoint_url ());
@@ -541,7 +541,7 @@ public class UploadTransaction : Transaction {
int payload_part_num = message_parts.get_length();
- Soup.Buffer bindable_data = new Soup.Buffer(Soup.MemoryUse.COPY, payload.data[0:payload_length]);
+ var bindable_data = new Soup.Buffer.take(payload.data[0:payload_length]);
message_parts.append_form_file("", publishable.get_serialized_file().get_path(), mime_type,
bindable_data);
diff --git a/plugins/shotwell-publishing-extras/YandexPublishing.vala
b/plugins/shotwell-publishing-extras/YandexPublishing.vala
index 04b28d20..2680df07 100644
--- a/plugins/shotwell-publishing-extras/YandexPublishing.vala
+++ b/plugins/shotwell-publishing-extras/YandexPublishing.vala
@@ -275,7 +275,7 @@ private class UploadTransaction: Transaction {
int image_part_num = message_parts.get_length();
- Soup.Buffer bindable_data = new Soup.Buffer(Soup.MemoryUse.COPY, photo_data.data[0:data_length]);
+ Soup.Buffer bindable_data = new Soup.Buffer.take(photo_data.data[0:data_length]);
message_parts.append_form_file("", photo.get_serialized_file().get_path(), "image/jpeg",
bindable_data);
unowned Soup.MessageHeaders image_part_header;
diff --git a/plugins/shotwell-publishing/PhotosUploader.vala b/plugins/shotwell-publishing/PhotosUploader.vala
index 83137ee9..5c73a10e 100644
--- a/plugins/shotwell-publishing/PhotosUploader.vala
+++ b/plugins/shotwell-publishing/PhotosUploader.vala
@@ -48,7 +48,8 @@ internal class UploadTransaction : Publishing.RESTSupport.GooglePublisher.Authen
// bind the binary image data read from disk into a Soup.Buffer object so that we
// can attach it to the multipart request, then actaully append the buffer
// to the multipart request. Then, set the MIME type for this part.
- Soup.Buffer bindable_data = new Soup.Buffer(Soup.MemoryUse.TEMPORARY, photo_data);
+ // FIXME: Passing no free function here only works because we are sync
+ Soup.Buffer bindable_data = new Soup.Buffer.with_owner(photo_data, mapped_file, null);
// create a message that can be sent over the wire whose payload is the multipart container
// that we've been building up
diff --git a/src/MapWidget.vala b/src/MapWidget.vala
index f929f957..3ee377b1 100644
--- a/src/MapWidget.vala
+++ b/src/MapWidget.vala
@@ -615,10 +615,19 @@ private class MapWidget : Gtk.Bin {
var map_attribution_text = create_attribution_actor();
map_attribution_text.content_gravity = Clutter.ContentGravity.BOTTOM_RIGHT;
+ map_attribution_text.set_x_align(Clutter.ActorAlign.END);
+ map_attribution_text.set_x_expand(true);
+ map_attribution_text.set_y_align(Clutter.ActorAlign.END);
+ map_attribution_text.set_y_expand(true);
// add lock/unlock button to top left corner of map
map_edit_lock_button.content_gravity = Clutter.ContentGravity.TOP_RIGHT;
map_edit_lock_button.reactive = true;
+ map_edit_lock_button.set_x_align(Clutter.ActorAlign.END);
+ map_edit_lock_button.set_x_expand(true);
+ map_edit_lock_button.set_y_align(Clutter.ActorAlign.START);
+ map_edit_lock_button.set_y_expand(true);
+
map_edit_lock_button.button_release_event.connect((a, e) => {
if (e.button != 1 /* CLUTTER_BUTTON_PRIMARY */)
return false;
@@ -627,8 +636,9 @@ private class MapWidget : Gtk.Bin {
map_edit_locked_image : map_edit_unlocked_image);
return true;
});
- map_view.bin_layout_add(map_edit_lock_button, Clutter.BinAlignment.END, Clutter.BinAlignment.START);
- map_view.bin_layout_add(map_attribution_text, Clutter.BinAlignment.END, Clutter.BinAlignment.END);
+ map_view.add_child(map_edit_lock_button);
+ map_view.add_child(map_attribution_text);
+
gtk_champlain_widget.has_tooltip = true;
gtk_champlain_widget.query_tooltip.connect((x, y, keyboard_tooltip, tooltip) => {
Gdk.Rectangle lock_rect = {
@@ -647,7 +657,11 @@ private class MapWidget : Gtk.Bin {
// add scale to bottom left corner of the map
map_scale.content_gravity = Clutter.ContentGravity.BOTTOM_LEFT;
map_scale.connect_view(map_view);
- map_view.bin_layout_add(map_scale, Clutter.BinAlignment.START, Clutter.BinAlignment.END);
+ map_scale.set_x_align(Clutter.ActorAlign.START);
+ map_scale.set_x_expand(true);
+ map_scale.set_y_align(Clutter.ActorAlign.END);
+ map_scale.set_y_expand(true);
+ map_view.add_child(map_scale);
map_view.set_zoom_on_double_click(false);
map_view.notify.connect((o, p) => {
diff --git a/src/VideoSupport.vala b/src/VideoSupport.vala
index 857a9011..f6371c40 100644
--- a/src/VideoSupport.vala
+++ b/src/VideoSupport.vala
@@ -232,7 +232,7 @@ public class VideoReader {
debug("Thumbnailer timer called");
if (thumbnailer_pid != 0) {
debug("Killing thumbnailer process: %d", thumbnailer_pid);
- Posix.kill(thumbnailer_pid, Posix.SIGKILL);
+ Posix.kill(thumbnailer_pid, Posix.Signal.KILL);
}
return false; // Don't call again.
}
diff --git a/src/events/EventDirectoryItem.vala b/src/events/EventDirectoryItem.vala
index 5b177fbb..dbab1b18 100644
--- a/src/events/EventDirectoryItem.vala
+++ b/src/events/EventDirectoryItem.vala
@@ -60,7 +60,7 @@ class EventDirectoryItem : CheckerboardItem {
pixbuf = media.get_preview_pixbuf(squared_scaling);
} catch (Error error) {
ThumbnailCache.fetch_async_scaled(media, ThumbnailCache.Size.BIG,
- new Dimensions(ThumbnailCache.Size.BIG,
ThumbnailCache.Size.BIG),
+ Dimensions(ThumbnailCache.Size.BIG, ThumbnailCache.Size.BIG),
ThumbnailCache.DEFAULT_INTERP, () => {});
if (media is LibraryPhoto) {
LibraryPhoto photo = (LibraryPhoto) media;
diff --git a/src/import-roll/ImportRollBranch.vala b/src/import-roll/ImportRollBranch.vala
index 32337cc7..0c582ac8 100644
--- a/src/import-roll/ImportRollBranch.vala
+++ b/src/import-roll/ImportRollBranch.vala
@@ -6,8 +6,7 @@ public class ImportRoll.Branch : Sidebar.Branch {
Sidebar.Branch.Options.HIDE_IF_EMPTY,
ImportRoll.Branch.comparator);
- this.entries = new Gee.HashMap<int64?,
ImportRoll.SidebarEntry>((Gee.HashDataFunc<int64?>)GLib.int64_hash,
- (Gee.EqualDataFunc<int64?>)GLib.int64_equal);
+ this.entries = new Gee.HashMap<int64?, ImportRoll.SidebarEntry>(int64_hash, int64_equal);
foreach (var source in MediaCollectionRegistry.get_instance().get_all()) {
on_import_rolls_altered(source);
diff --git a/src/sidebar/Tree.vala b/src/sidebar/Tree.vala
index ea039eaf..0750d778 100644
--- a/src/sidebar/Tree.vala
+++ b/src/sidebar/Tree.vala
@@ -97,7 +97,6 @@ public class Sidebar.Tree : Gtk.TreeView {
Gtk.TreeViewColumn text_column = new Gtk.TreeViewColumn();
text_column.set_expand(true);
Gtk.CellRendererPixbuf icon_renderer = new Gtk.CellRendererPixbuf();
- icon_renderer.follow_state = true;
text_column.pack_start (icon_renderer, false);
text_column.add_attribute(icon_renderer, "gicon", Columns.ICON);
text_column.set_cell_data_func(icon_renderer, icon_renderer_function);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]