properly import events without title

This commit is contained in:
tibbi 2017-07-28 21:59:21 +02:00
parent 890a7f34a6
commit 77eeb1aba7
17 changed files with 20 additions and 3 deletions

View File

@ -30,6 +30,7 @@ class FetchGoogleEventsTask(val context: Context, val googleSyncListener: Google
private var eventColors = SparseIntArray()
private var service = context.getGoogleSyncService()
private var parseError: Exception? = null
private var noTitleText = context.getString(R.string.no_title)
override fun doInBackground(vararg params: Void): String {
if (!context.isGoogleSyncActive() || !context.isOnline())
@ -149,11 +150,12 @@ class FetchGoogleEventsTask(val context: Context, val googleSyncListener: Google
endTS = DateTime(end.dateTime).seconds()
}
val summary = googleEvent.summary ?: "($noTitleText)"
val description = googleEvent.description ?: ""
val reminders = getReminders(googleEvent.reminders)
val repeatRule = getRepeatRule(googleEvent, startTS)
val eventTypeId = getEventTypeId(googleEvent.colorId)
val event = Event(eventId, startTS, endTS, googleEvent.summary, description, reminders.getOrElse(0, { -1 }),
val event = Event(eventId, startTS, endTS, summary, description, reminders.getOrElse(0, { -1 }),
reminders.getOrElse(1, { -1 }), reminders.getOrElse(2, { -1 }), repeatRule.repeatInterval, importId, flags, repeatRule.repeatLimit,
repeatRule.repeatRule, eventTypeId, lastUpdated = lastUpdate, source = SOURCE_GOOGLE_SYNC)

View File

@ -3,5 +3,5 @@ package com.simplemobiletools.calendar.models
import com.google.gson.JsonArray
import com.google.gson.JsonObject
data class GoogleEvent(val summary: String, val description: String?, val status: String, val start: GoogleEventDateTime, val end: GoogleEventDateTime,
data class GoogleEvent(val summary: String?, val description: String?, val status: String, val start: GoogleEventDateTime, val end: GoogleEventDateTime,
val reminders: JsonObject, val recurrence: JsonArray?, val id: String, val colorId: Int, val updated: String)

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">vergagene Termine auch exportieren</string>
<string name="include_event_types">Include event types</string>
<string name="filename_without_ics">Filename (without .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">Titel</string>

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">También exportar eventos pasados</string>
<string name="include_event_types">Include event types</string>
<string name="filename_without_ics">Filename (without .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">Título</string>

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">Export past events too</string>
<string name="include_event_types">Include event types</string>
<string name="filename_without_ics">Filename (without .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">Titre</string>

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">Export past events too</string>
<string name="include_event_types">Include event types</string>
<string name="filename_without_ics">Filename (without .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">शीर्षक</string>

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">Export past events too</string>
<string name="include_event_types">Include event types</string>
<string name="filename_without_ics">Filename (without .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">Név</string>

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">Export past events too</string>
<string name="include_event_types">Include event types</string>
<string name="filename_without_ics">Filename (without .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">Titolo</string>

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">Export past events too</string>
<string name="include_event_types">Include event types</string>
<string name="filename_without_ics">Filename (without .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">כותרת</string>

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">Export past events too</string>
<string name="include_event_types">Include event types</string>
<string name="filename_without_ics">Filename (without .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">タイトル</string>

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">Export past events too</string>
<string name="include_event_types">Include event types</string>
<string name="filename_without_ics">Filename (without .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">Título</string>

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">Exportar eventos antigos</string>
<string name="include_event_types">Incluir tipos de eventos</string>
<string name="filename_without_ics">Nome do ficheiro (sem .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">Título</string>

View File

@ -156,6 +156,7 @@
<string name="export_past_events_too">Экспортировать прошедшие события</string>
<string name="include_event_types">Включать типы событий</string>
<string name="filename_without_ics">Имя файла (без .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">Заголовок</string>

View File

@ -97,7 +97,7 @@
<plurals name="years">
<item quantity="one">%1$d rok</item>
<item quantity="two">%1$d roky</item>
<item quantity="few">%1$d roky</item>
<item quantity="other">%1$d rokov</item>
</plurals>
@ -149,6 +149,7 @@
<string name="export_past_events_too">Exportovať aj minulé udalosti</string>
<string name="include_event_types">Zahrnúť typy udalostí</string>
<string name="filename_without_ics">Názov súboru (bez .ics)</string>
<string name="no_title">Bez názvu</string>
<!-- Event details -->
<string name="title">Názov</string>

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">Exportera även tidigare händelser</string>
<string name="include_event_types">Inkludera händelsetyper</string>
<string name="filename_without_ics">Filnamn (utan .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">Titel</string>

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">Geçmişteki etkinlikleri de dışa aktar</string>
<string name="include_event_types">Include event types</string>
<string name="filename_without_ics">Filename (without .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">Başlık</string>

View File

@ -142,6 +142,7 @@
<string name="export_past_events_too">Export past events too</string>
<string name="include_event_types">Include event types</string>
<string name="filename_without_ics">Filename (without .ics)</string>
<string name="no_title">No title</string>
<!-- Event details -->
<string name="title">Title</string>