Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

packages-apps-Calendar: Commit

packages/apps/Calendar


Commit MetaInfo

Revision061db49b29e5a3036398d70599b726c4dff6259f (tree)
Zeit2010-04-27 03:24:42
AutorErik <roboerik@andr...>
CommiterErik

Log Message

Revert "b/2622128 Exception events now get updated to be 'canceled' when deleted"

This reverts commit a9dd45e7a7f422c3c7d74f10d1e65880c181d43b. Moving to master
instead of Froyo.

Ändern Zusammenfassung

Diff

--- a/src/com/android/calendar/DeleteEventHelper.java
+++ b/src/com/android/calendar/DeleteEventHelper.java
@@ -84,12 +84,10 @@ public class DeleteEventHelper {
8484 Events.DTSTART,
8585 Events._SYNC_ID,
8686 Events.EVENT_TIMEZONE,
87- Events.ORIGINAL_EVENT,
8887 };
8988
9089 private int mEventIndexId;
9190 private int mEventIndexRrule;
92- private int mEventIndexOriginalEvent;
9391 private String mSyncId;
9492
9593 public DeleteEventHelper(Activity parent, boolean exitWhenDone) {
@@ -118,16 +116,6 @@ public class DeleteEventHelper {
118116 };
119117
120118 /**
121- * This callback is used when an exception to an event is deleted
122- */
123- private DialogInterface.OnClickListener mDeleteExceptionDialogListener =
124- new DialogInterface.OnClickListener() {
125- public void onClick(DialogInterface dialog, int button) {
126- deleteExceptionEvent();
127- }
128- };
129-
130- /**
131119 * This callback is used when a list item for a repeating event is selected
132120 */
133121 private DialogInterface.OnClickListener mDeleteListListener =
@@ -214,7 +202,6 @@ public class DeleteEventHelper {
214202 mCursor = cursor;
215203 mEventIndexId = mCursor.getColumnIndexOrThrow(Events._ID);
216204 mEventIndexRrule = mCursor.getColumnIndexOrThrow(Events.RRULE);
217- mEventIndexOriginalEvent = mCursor.getColumnIndexOrThrow(Events.ORIGINAL_EVENT);
218205 int eventIndexSyncId = mCursor.getColumnIndexOrThrow(Events._SYNC_ID);
219206 mSyncId = mCursor.getString(eventIndexSyncId);
220207
@@ -222,27 +209,15 @@ public class DeleteEventHelper {
222209 // user if they want to delete all of the repeating events or
223210 // just some of them.
224211 String rRule = mCursor.getString(mEventIndexRrule);
225- String originalEvent = mCursor.getString(this.mEventIndexOriginalEvent);
226212 if (rRule == null) {
227- AlertDialog dialog = new AlertDialog.Builder(mParent)
213+ // This is a normal event. Pop up a confirmation dialog.
214+ new AlertDialog.Builder(mParent)
228215 .setTitle(R.string.delete_title)
229216 .setMessage(R.string.delete_this_event_title)
230217 .setIcon(android.R.drawable.ic_dialog_alert)
218+ .setPositiveButton(android.R.string.ok, mDeleteNormalDialogListener)
231219 .setNegativeButton(android.R.string.cancel, null)
232- .create();
233-
234- if (originalEvent == null) {
235- // This is a normal event. Pop up a confirmation dialog.
236- dialog.setButton(DialogInterface.BUTTON_POSITIVE,
237- mParent.getText(android.R.string.ok),
238- mDeleteNormalDialogListener);
239- } else {
240- // This is an exception event. Pop up a confirmation dialog.
241- dialog.setButton(DialogInterface.BUTTON_POSITIVE,
242- mParent.getText(android.R.string.ok),
243- mDeleteExceptionDialogListener);
244- }
245- dialog.show();
220+ .show();
246221 } else {
247222 // This is a repeating event. Pop up a dialog asking which events
248223 // to delete.
@@ -268,17 +243,6 @@ public class DeleteEventHelper {
268243 }
269244 }
270245
271- private void deleteExceptionEvent() {
272- long id = mCursor.getInt(mEventIndexId);
273-
274- // update a recurrence exception by setting its status to "canceled"
275- ContentValues values = new ContentValues();
276- values.put(Events.STATUS, Events.STATUS_CANCELED);
277-
278- Uri uri = ContentUris.withAppendedId(Calendar.Events.CONTENT_URI, id);
279- mContentResolver.update(uri, values, null, null);
280- }
281-
282246 private void deleteRepeatingEvent(int which) {
283247 int indexDtstart = mCursor.getColumnIndexOrThrow(Events.DTSTART);
284248 int indexAllDay = mCursor.getColumnIndexOrThrow(Events.ALL_DAY);
Show on old repository browser