Skip to content

Commit 1919a96

Browse files
committed
fix #1154
1 parent 979b6a5 commit 1919a96

16 files changed

+2561
-323
lines changed

core/Services/CalDAV.vala

+43-42
Original file line numberDiff line numberDiff line change
@@ -629,56 +629,57 @@ public class Services.CalDAV : GLib.Object {
629629
GXml.DomHTMLCollection status = element.get_elements_by_tag_name ("d:status");
630630
string ics = get_task_ics_from_url (element);
631631
bool is_vtodo = is_vtodo (element);
632-
print ("is_vtodo: %s\n".printf (is_vtodo.to_string ()));
632+
633+
if (!is_vtodo) {
634+
continue;
635+
}
636+
637+
if (status.length > 0 && status.get_element (0).text_content == "HTTP/1.1 404 Not Found") {
638+
Objects.Item? item = Services.Database.get_default ().get_item_by_ics (ics);
639+
if (item != null) {
640+
Services.Database.get_default ().delete_item (item);
641+
}
642+
} else {
643+
string vtodo = yield get_vtodo_by_url (project.id, ics);
633644

634-
if (is_vtodo) {
635-
if (status.length > 0 && status.get_element (0).text_content == "HTTP/1.1 404 Not Found") {
636-
Objects.Item? item = Services.Database.get_default ().get_item_by_ics (ics);
637-
if (item != null) {
638-
Services.Database.get_default ().delete_item (item);
645+
ICal.Component ical = new ICal.Component.from_string (vtodo);
646+
Objects.Item? item = Services.Database.get_default ().get_item (ical.get_uid ());
647+
648+
if (item != null) {
649+
string old_project_id = item.project_id;
650+
string old_parent_id = item.parent_id;
651+
652+
item.update_from_vtodo (vtodo, ics);
653+
item.project_id = project.id;
654+
Services.Database.get_default ().update_item (item);
655+
656+
if (old_project_id != item.project_id || old_parent_id != item.parent_id) {
657+
Services.EventBus.get_default ().item_moved (item, old_project_id, "", old_parent_id);
639658
}
640-
} else {
641-
string vtodo = yield get_vtodo_by_url (project.id, ics);
642659

643-
ICal.Component ical = new ICal.Component.from_string (vtodo);
644-
Objects.Item? item = Services.Database.get_default ().get_item (ical.get_uid ());
645-
646-
if (item != null) {
647-
string old_project_id = item.project_id;
648-
string old_parent_id = item.parent_id;
649-
650-
item.update_from_vtodo (vtodo, ics);
651-
item.project_id = project.id;
652-
Services.Database.get_default ().update_item (item);
653-
654-
if (old_project_id != item.project_id || old_parent_id != item.parent_id) {
655-
Services.EventBus.get_default ().item_moved (item, old_project_id, "", old_parent_id);
656-
}
657-
658-
bool old_checked = item.checked;
659-
if (old_checked != item.checked) {
660-
Services.Database.get_default ().checked_toggled (item, old_checked);
661-
}
662-
} else {
663-
string parent_id = Util.find_string_value ("RELATED-TO", vtodo);
664-
if (parent_id != "") {
665-
Objects.Item? parent_item = Services.Database.get_default ().get_item (parent_id);
666-
if (parent_item != null) {
667-
var new_item = new Objects.Item.from_vtodo (vtodo, ics);
668-
new_item.project_id = project.id;
669-
parent_item.add_item_if_not_exists (new_item);
670-
} else {
671-
var new_item = new Objects.Item.from_vtodo (vtodo, ics);
672-
new_item.project_id = project.id;
673-
project.add_item_if_not_exists (new_item);
674-
}
660+
bool old_checked = item.checked;
661+
if (old_checked != item.checked) {
662+
Services.Database.get_default ().checked_toggled (item, old_checked);
663+
}
664+
} else {
665+
string parent_id = Util.find_string_value ("RELATED-TO", vtodo);
666+
if (parent_id != "") {
667+
Objects.Item? parent_item = Services.Database.get_default ().get_item (parent_id);
668+
if (parent_item != null) {
669+
var new_item = new Objects.Item.from_vtodo (vtodo, ics);
670+
new_item.project_id = project.id;
671+
parent_item.add_item_if_not_exists (new_item);
675672
} else {
676673
var new_item = new Objects.Item.from_vtodo (vtodo, ics);
677674
new_item.project_id = project.id;
678675
project.add_item_if_not_exists (new_item);
679676
}
680-
}
681-
}
677+
} else {
678+
var new_item = new Objects.Item.from_vtodo (vtodo, ics);
679+
new_item.project_id = project.id;
680+
project.add_item_if_not_exists (new_item);
681+
}
682+
}
682683
}
683684
}
684685

data/io.github.alainm23.planify.appdata.xml.in.in

+12
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@
6767
<url type="donation">https://www.patreon.com/alainm23</url>
6868
<launchable type="desktop-id">@appid@.desktop</launchable>
6969
<releases>
70+
<release version="4.5.11" date="2024-03-28">
71+
<description translatable="no">
72+
<ul>
73+
<li>Improved performance when using the Completed view.</li>
74+
<li>Added the option to delete a completed task from the context menu.</li>
75+
<li>The sync keyboard shortcut also syncs your Nextcloud account.</li>
76+
<li>Fixed error when viewing calendar event as a task in Nextcloud.</li>
77+
<li>Hindu translations added thanks to Nitin.</li>
78+
</ul>
79+
</description>
80+
</release>
81+
7082
<release version="4.5.10" date="2024-03-26">
7183
<description translatable="no">
7284
<ul>

meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project(
22
'io.github.alainm23.planify',
33
'vala', 'c',
4-
version: '4.5.10'
4+
version: '4.5.11'
55
)
66

77
gnome = import('gnome')

po/LINGUAS

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ ru
77
pt_PT
88
de
99
nl
10+
hi

po/de.po

+28-28
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: io.github.alainm23.planify\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2024-03-27 18:42-0500\n"
10+
"POT-Creation-Date: 2024-03-28 07:34-0500\n"
1111
"PO-Revision-Date: 2024-02-13 23:44+0100\n"
1212
"Last-Translator: bestlinuxgamers <52172848+bestlinuxgamers@users.noreply."
1313
"github.com>\n"
@@ -113,7 +113,7 @@ msgstr "Dunkel"
113113
msgid "Dark Blue"
114114
msgstr "Dunkelblau"
115115

116-
#: core/Util/Util.vala:224 src/Layouts/ItemRow.vala:1062
116+
#: core/Util/Util.vala:224 src/Layouts/ItemRow.vala:1094
117117
#: src/Layouts/ItemView.vala:536
118118
#: src/Dialogs/Preferences/PreferencesWindow.vala:441
119119
#, fuzzy
@@ -133,7 +133,7 @@ msgstr "Eingang"
133133
#: core/Util/Util.vala:230 core/Util/Util.vala:395 core/Enum.vala:105
134134
#: core/Widgets/DateTimePicker/DateTimePicker.vala:81
135135
#: core/Objects/Filters/Today.vala:66 src/Layouts/FilterPaneRow.vala:111
136-
#: src/Layouts/ItemRow.vala:843 src/Layouts/ItemBoard.vala:585
136+
#: src/Layouts/ItemRow.vala:864 src/Layouts/ItemBoard.vala:585
137137
#: src/Views/Today.vala:51 src/Views/Today.vala:127
138138
#: src/Dialogs/DatePicker.vala:64
139139
#: src/Dialogs/Preferences/PreferencesWindow.vala:313
@@ -146,7 +146,7 @@ msgid "Today + Inbox"
146146
msgstr "Heute + Eingang"
147147

148148
#: core/Util/Util.vala:397 core/Widgets/DateTimePicker/DateTimePicker.vala:82
149-
#: src/Layouts/ItemRow.vala:846 src/Layouts/ItemBoard.vala:588
149+
#: src/Layouts/ItemRow.vala:867 src/Layouts/ItemBoard.vala:588
150150
#: src/Views/Filter.vala:175 src/Dialogs/WhatsNew.vala:120
151151
#: src/Dialogs/DatePicker.vala:68
152152
msgid "Tomorrow"
@@ -601,7 +601,7 @@ msgstr "Der Server ist derzeit nicht in der Lage, die Anfrage zu bearbeiten."
601601
msgid "Unknown error"
602602
msgstr "Unbekannter Fehler"
603603

604-
#: core/Widgets/PinButton.vala:34 src/Layouts/ItemRow.vala:849
604+
#: core/Widgets/PinButton.vala:34 src/Layouts/ItemRow.vala:870
605605
#: src/Layouts/ItemBoard.vala:196 src/Layouts/ItemBoard.vala:591
606606
msgid "Pinned"
607607
msgstr "Angeheftet"
@@ -723,7 +723,7 @@ msgid "Clear"
723723
msgstr ""
724724

725725
#: core/Widgets/DateTimePicker/DateTimePicker.vala:145
726-
#: src/Layouts/ItemRow.vala:968
726+
#: src/Layouts/ItemRow.vala:995
727727
#, fuzzy
728728
msgid "Back"
729729
msgstr "Sicherungen"
@@ -786,7 +786,7 @@ msgstr "Ohne Abschnitt"
786786
msgid "Task copied to clipboard"
787787
msgstr "Aufgabe in die Zwischenablage kopiert"
788788

789-
#: core/Objects/Item.vala:1235 src/Layouts/ItemRow.vala:971
789+
#: core/Objects/Item.vala:1235 src/Layouts/ItemRow.vala:998
790790
#: src/Layouts/ItemView.vala:449
791791
#, c-format
792792
msgid "Duplicate"
@@ -1044,98 +1044,98 @@ msgstr "Reihenfolge der Abschnitte verändern"
10441044
msgid "Delete Section"
10451045
msgstr "Abschnitt löschen"
10461046

1047-
#: src/Layouts/ItemRow.vala:400
1047+
#: src/Layouts/ItemRow.vala:412
10481048
#, fuzzy
10491049
msgid "Add Subtasks"
10501050
msgstr "Unteraufgabe hinzufügen"
10511051

1052-
#: src/Layouts/ItemRow.vala:851 src/Layouts/ItemBoard.vala:593
1052+
#: src/Layouts/ItemRow.vala:872 src/Layouts/ItemBoard.vala:593
10531053
#: src/Dialogs/DatePicker.vala:77
10541054
msgid "No Date"
10551055
msgstr "Kein Datum"
10561056

1057-
#: src/Layouts/ItemRow.vala:854 src/Layouts/ItemRow.vala:972
1057+
#: src/Layouts/ItemRow.vala:875 src/Layouts/ItemRow.vala:999
10581058
#: src/Layouts/ItemBoard.vala:595 src/Layouts/ItemBoard.vala:988
10591059
#: src/Layouts/ItemView.vala:450
10601060
#: src/Dialogs/ProjectPicker/ProjectPicker.vala:74
10611061
#: src/Dialogs/ProjectPicker/ProjectPicker.vala:106
10621062
msgid "Move"
10631063
msgstr "Verschieben"
10641064

1065-
#: src/Layouts/ItemRow.vala:856 src/Layouts/ItemBoard.vala:597
1065+
#: src/Layouts/ItemRow.vala:877 src/Layouts/ItemBoard.vala:597
10661066
msgid "Add Subtask"
10671067
msgstr "Unteraufgabe hinzufügen"
10681068

1069-
#: src/Layouts/ItemRow.vala:857 src/Layouts/ItemBoard.vala:598
1069+
#: src/Layouts/ItemRow.vala:878 src/Layouts/ItemBoard.vala:598
10701070
msgid "Complete"
10711071
msgstr "Erledigen"
10721072

1073-
#: src/Layouts/ItemRow.vala:858 src/Layouts/ItemBoard.vala:599
1073+
#: src/Layouts/ItemRow.vala:879 src/Layouts/ItemBoard.vala:599
10741074
msgid "Edit"
10751075
msgstr "Bearbeiten"
10761076

1077-
#: src/Layouts/ItemRow.vala:860 src/Layouts/ItemRow.vala:976
1077+
#: src/Layouts/ItemRow.vala:881 src/Layouts/ItemRow.vala:1003
10781078
#: src/Layouts/ItemBoard.vala:601 src/Layouts/ItemView.vala:457
10791079
msgid "Delete Task"
10801080
msgstr "Aufgabe löschen"
10811081

1082-
#: src/Layouts/ItemRow.vala:956 src/Layouts/ItemView.vala:436
1082+
#: src/Layouts/ItemRow.vala:983 src/Layouts/ItemView.vala:436
10831083
msgid "Added at"
10841084
msgstr "Hinzugefügt am"
10851085

1086-
#: src/Layouts/ItemRow.vala:957 src/Layouts/ItemView.vala:437
1086+
#: src/Layouts/ItemRow.vala:984 src/Layouts/ItemView.vala:437
10871087
msgid "Updated at"
10881088
msgstr "Aktualisiert am"
10891089

1090-
#: src/Layouts/ItemRow.vala:959 src/Layouts/ItemView.vala:439
1090+
#: src/Layouts/ItemRow.vala:986 src/Layouts/ItemView.vala:439
10911091
msgid "Not available"
10921092
msgstr "Nicht verfügbar"
10931093

1094-
#: src/Layouts/ItemRow.vala:970 src/Layouts/ItemView.vala:448
1094+
#: src/Layouts/ItemRow.vala:997 src/Layouts/ItemView.vala:448
10951095
msgid "Copy to Clipboard"
10961096
msgstr "In die Zwischenablage kopieren"
10971097

1098-
#: src/Layouts/ItemRow.vala:973 src/Layouts/ItemView.vala:451
1098+
#: src/Layouts/ItemRow.vala:1000 src/Layouts/ItemView.vala:451
10991099
#: src/Dialogs/RepeatConfig.vala:90
11001100
msgid "Repeat"
11011101
msgstr "Wiederholen"
11021102

1103-
#: src/Layouts/ItemRow.vala:1063 src/Layouts/ItemView.vala:537
1103+
#: src/Layouts/ItemRow.vala:1095 src/Layouts/ItemView.vala:537
11041104
msgid "Daily"
11051105
msgstr "Täglich"
11061106

1107-
#: src/Layouts/ItemRow.vala:1064 src/Layouts/ItemView.vala:538
1107+
#: src/Layouts/ItemRow.vala:1096 src/Layouts/ItemView.vala:538
11081108
msgid "Weekly"
11091109
msgstr "Wöchentlich"
11101110

1111-
#: src/Layouts/ItemRow.vala:1065 src/Layouts/ItemView.vala:539
1111+
#: src/Layouts/ItemRow.vala:1097 src/Layouts/ItemView.vala:539
11121112
msgid "Monthly"
11131113
msgstr "Monatlich"
11141114

1115-
#: src/Layouts/ItemRow.vala:1066 src/Layouts/ItemView.vala:540
1115+
#: src/Layouts/ItemRow.vala:1098 src/Layouts/ItemView.vala:540
11161116
msgid "Yearly"
11171117
msgstr "Jährlich"
11181118

1119-
#: src/Layouts/ItemRow.vala:1067 src/Layouts/ItemView.vala:541
1119+
#: src/Layouts/ItemRow.vala:1099 src/Layouts/ItemView.vala:541
11201120
msgid "Custom"
11211121
msgstr "Benutzerdefiniert"
11221122

1123-
#: src/Layouts/ItemRow.vala:1271 src/Layouts/ItemBoard.vala:499
1123+
#: src/Layouts/ItemRow.vala:1303 src/Layouts/ItemBoard.vala:499
11241124
#: src/Layouts/ItemView.vala:355
11251125
#, c-format
11261126
msgid "Completed. Next occurrence: %s"
11271127
msgstr "Erledigt. Nächstes vorkommen: %s"
11281128

1129-
#: src/Layouts/ItemRow.vala:1313 src/Layouts/ItemBoard.vala:947
1129+
#: src/Layouts/ItemRow.vala:1345 src/Layouts/ItemBoard.vala:947
11301130
#, c-format
11311131
msgid "%s was deleted"
11321132
msgstr "%s wurde gelöscht"
11331133

1134-
#: src/Layouts/ItemRow.vala:1314 src/Layouts/ItemBoard.vala:948
1134+
#: src/Layouts/ItemRow.vala:1346 src/Layouts/ItemBoard.vala:948
11351135
msgid "Undo"
11361136
msgstr "Rückgängig machen"
11371137

1138-
#: src/Layouts/ItemRow.vala:1509 src/Layouts/ItemBoard.vala:848
1138+
#: src/Layouts/ItemRow.vala:1541 src/Layouts/ItemBoard.vala:848
11391139
msgid "Order changed to 'Custom sort order'"
11401140
msgstr "Sortierung wurde in 'Benutzerdefinierte Sortierreihenfolge' geändert."
11411141

0 commit comments

Comments
 (0)