aboutsummaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2023-10-07 14:29:26 +0200
committerfiaxh <git@lightrise.org>2023-10-07 14:34:23 +0200
commit1e167eeea67f18f3d5788dc34d97d94e6f401499 (patch)
treedf73a70a25fb02d7a2e70623b3ab5ecbe86ced53 /main
parent0c45387bf903e5b0d02502d27642dd2a78aa6539 (diff)
downloaddino-1e167eeea67f18f3d5788dc34d97d94e6f401499.tar.gz
dino-1e167eeea67f18f3d5788dc34d97d94e6f401499.zip
Fix some compiler warnings
Diffstat (limited to 'main')
-rw-r--r--main/src/ui/call_window/call_window.vala3
-rw-r--r--main/src/ui/conversation_content_view/conversation_view.vala2
-rw-r--r--main/src/ui/conversation_content_view/file_image_widget.vala1
-rw-r--r--main/src/ui/conversation_details.vala9
-rw-r--r--main/src/ui/conversation_selector/conversation_selector.vala1
-rw-r--r--main/src/ui/notifier_gnotifications.vala2
-rw-r--r--main/src/ui/occupant_menu/list.vala1
-rw-r--r--main/src/ui/util/data_forms.vala1
-rw-r--r--main/src/ui/util/label_hybrid.vala4
9 files changed, 11 insertions, 13 deletions
diff --git a/main/src/ui/call_window/call_window.vala b/main/src/ui/call_window/call_window.vala
index 14b67449..08ea4b21 100644
--- a/main/src/ui/call_window/call_window.vala
+++ b/main/src/ui/call_window/call_window.vala
@@ -253,11 +253,12 @@ namespace Dino.Ui {
}
private bool on_get_child_position(Widget widget, out Gdk.Rectangle allocation) {
+ allocation = Gdk.Rectangle();
+
if (widget == own_video_box) {
int width = get_size(Orientation.HORIZONTAL);
int height = get_size(Orientation.VERTICAL);
- allocation = Gdk.Rectangle();
allocation.width = own_video_width;
allocation.height = own_video_height;
allocation.x = width - own_video_width - 20;
diff --git a/main/src/ui/conversation_content_view/conversation_view.vala b/main/src/ui/conversation_content_view/conversation_view.vala
index 4006a02f..33cb3b22 100644
--- a/main/src/ui/conversation_content_view/conversation_view.vala
+++ b/main/src/ui/conversation_content_view/conversation_view.vala
@@ -329,7 +329,7 @@ public class ConversationView : Widget, Plugins.ConversationItemCollection, Plug
do_insert_item(item);
}
ContentMetaItem meta_item = content_populator.get_content_meta_item(content_item);
- Widget w = insert_new(meta_item);
+ insert_new(meta_item);
content_items.add(meta_item);
meta_items.add(meta_item);
diff --git a/main/src/ui/conversation_content_view/file_image_widget.vala b/main/src/ui/conversation_content_view/file_image_widget.vala
index 43c3b74d..a3579185 100644
--- a/main/src/ui/conversation_content_view/file_image_widget.vala
+++ b/main/src/ui/conversation_content_view/file_image_widget.vala
@@ -45,7 +45,6 @@ public class FileImageWidget : Box {
image.add_controller(gesture_click_controller);
FileInfo file_info = file.query_info("*", FileQueryInfoFlags.NONE);
- string? mime_type = file_info.get_content_type();
MenuButton button = new MenuButton();
button.icon_name = "view-more";
diff --git a/main/src/ui/conversation_details.vala b/main/src/ui/conversation_details.vala
index 70c8ce6d..82d6ae54 100644
--- a/main/src/ui/conversation_details.vala
+++ b/main/src/ui/conversation_details.vala
@@ -26,15 +26,18 @@ namespace Dino.Ui.ConversationDetails {
model.display_name.bind_property("display-name", view_model, "name", BindingFlags.SYNC_CREATE);
model.conversation.bind_property("notify-setting", view_model, "notification", BindingFlags.SYNC_CREATE, (_, from, ref to) => {
switch (model.conversation.get_notification_setting(stream_interactor)) {
- case Conversation.NotifySetting.ON:
+ case ON:
to = ViewModel.ConversationDetails.NotificationSetting.ON;
break;
- case Conversation.NotifySetting.OFF:
+ case OFF:
to = ViewModel.ConversationDetails.NotificationSetting.OFF;
break;
- case Conversation.NotifySetting.HIGHLIGHT:
+ case HIGHLIGHT:
to = ViewModel.ConversationDetails.NotificationSetting.HIGHLIGHT;
break;
+ case DEFAULT:
+ // A "default" setting should have been resolved to the actual default value
+ assert_not_reached();
}
return true;
});
diff --git a/main/src/ui/conversation_selector/conversation_selector.vala b/main/src/ui/conversation_selector/conversation_selector.vala
index 535a61b0..d16ef3ee 100644
--- a/main/src/ui/conversation_selector/conversation_selector.vala
+++ b/main/src/ui/conversation_selector/conversation_selector.vala
@@ -14,7 +14,6 @@ public class ConversationSelector : Widget {
ListBox list_box = new ListBox() { hexpand=true };
private StreamInteractor stream_interactor;
- private uint? drag_timeout;
private HashMap<Conversation, ConversationSelectorRow> rows = new HashMap<Conversation, ConversationSelectorRow>(Conversation.hash_func, Conversation.equals_func);
public ConversationSelector init(StreamInteractor stream_interactor) {
diff --git a/main/src/ui/notifier_gnotifications.vala b/main/src/ui/notifier_gnotifications.vala
index 90c8ca8c..4d36620d 100644
--- a/main/src/ui/notifier_gnotifications.vala
+++ b/main/src/ui/notifier_gnotifications.vala
@@ -109,6 +109,8 @@ namespace Dino.Ui {
case ConnectionManager.ConnectionError.Source.TLS:
notification.set_body("Invalid TLS certificate");
break;
+ default:
+ break;
}
GLib.Application.get_default().send_notification(account.id.to_string() + "-connection-error", notification);
}
diff --git a/main/src/ui/occupant_menu/list.vala b/main/src/ui/occupant_menu/list.vala
index b9a4a74f..ce5a1981 100644
--- a/main/src/ui/occupant_menu/list.vala
+++ b/main/src/ui/occupant_menu/list.vala
@@ -153,7 +153,6 @@ public class List : Box {
if (affiliation1 < affiliation2) return -1;
else if (affiliation1 > affiliation2) return 1;
else return row_wrapper1.name_label.label.collate(row_wrapper2.name_label.label);
- return 0;
}
private int get_affiliation_ranking(Xmpp.Xep.Muc.Affiliation affiliation) {
diff --git a/main/src/ui/util/data_forms.vala b/main/src/ui/util/data_forms.vala
index d10196ab..39dce3ee 100644
--- a/main/src/ui/util/data_forms.vala
+++ b/main/src/ui/util/data_forms.vala
@@ -75,7 +75,6 @@ public static ViewModel.PreferencesRow.Any? get_data_form_field_view_model(DataF
if (option.value == list_single_field.value) combobox_model.active_item = i;
}
combobox_model.bind_property("active-item", list_single_field, "value", BindingFlags.DEFAULT, (binding, from, ref to) => {
- var src_field = (DataForms.DataForm.ListSingleField) binding.dup_target();
var active_item = (int) from;
to = list_single_field.options[active_item].value;
return true;
diff --git a/main/src/ui/util/label_hybrid.vala b/main/src/ui/util/label_hybrid.vala
index f426de7e..0059d2ae 100644
--- a/main/src/ui/util/label_hybrid.vala
+++ b/main/src/ui/util/label_hybrid.vala
@@ -97,10 +97,6 @@ public class EntryLabelHybrid : LabelHybrid {
}
}
- private void on_focus_leave() {
- show_label();
- }
-
private void update_label() {
if (visibility) {
label.label = entry.text;