mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-05 02:53:06 +02:00
Update gallery when photo markers are deleted
This commit is contained in:
@@ -95,7 +95,7 @@ public class DeleteAsyncTask extends AsyncTask<Void, Integer, Boolean> {
|
||||
context, R.string.drive_sync_key, PreferencesUtils.DRIVE_SYNC_DEFAULT);
|
||||
SyncUtils.disableSync(context);
|
||||
SyncUtils.clearSyncState(context);
|
||||
myTracksProviderUtils.deleteAllTracks();
|
||||
myTracksProviderUtils.deleteAllTracks(context);
|
||||
return true;
|
||||
} else {
|
||||
for (long id : trackIds) {
|
||||
@@ -103,7 +103,7 @@ public class DeleteAsyncTask extends AsyncTask<Void, Integer, Boolean> {
|
||||
return false;
|
||||
}
|
||||
Track track = myTracksProviderUtils.getTrack(id);
|
||||
myTracksProviderUtils.deleteTrack(id);
|
||||
myTracksProviderUtils.deleteTrack(context, id);
|
||||
if (track != null) {
|
||||
String driveId = track.getDriveId();
|
||||
if (driveId != null && !driveId.equals("")) {
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ public class DeleteMarkerDialogFragment extends AbstractMyTracksDialogFragment {
|
||||
MyTracksProviderUtils myTracksProviderUtils = MyTracksProviderUtils.Factory.get(
|
||||
fragmentActivity);
|
||||
for (long markerId : markerIds) {
|
||||
myTracksProviderUtils.deleteWaypoint(
|
||||
myTracksProviderUtils.deleteWaypoint(fragmentActivity,
|
||||
markerId, new DescriptionGeneratorImpl(fragmentActivity));
|
||||
}
|
||||
caller.onDeleteMarkerDone();
|
||||
|
||||
+2
-2
@@ -310,7 +310,7 @@ abstract class AbstractFileTrackImporter extends DefaultHandler implements Track
|
||||
"Cannot import more than one track to an existing track " + importTrackId));
|
||||
}
|
||||
trackId = importTrackId;
|
||||
myTracksProviderUtils.clearTrack(trackId);
|
||||
myTracksProviderUtils.clearTrack(context, trackId);
|
||||
}
|
||||
trackIds.add(trackId);
|
||||
trackData.track.setId(trackId);
|
||||
@@ -614,7 +614,7 @@ abstract class AbstractFileTrackImporter extends DefaultHandler implements Track
|
||||
*/
|
||||
private void cleanImport() {
|
||||
for (long trackId : trackIds) {
|
||||
myTracksProviderUtils.deleteTrack(trackId);
|
||||
myTracksProviderUtils.deleteTrack(context, trackId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,13 +171,13 @@ public class ImportActivity extends Activity {
|
||||
final Dialog dialog = new AlertDialog.Builder(this).setCancelable(true).setIcon(iconId)
|
||||
.setMessage(message).setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
dialog.dismiss();
|
||||
public void onCancel(DialogInterface dialogInterface) {
|
||||
dialogInterface.dismiss();
|
||||
finish();
|
||||
}
|
||||
}).setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
public void onClick(DialogInterface dialogInterface, int which) {
|
||||
if (successCount == totalCount && !importAll && trackId != -1L) {
|
||||
Intent intent = IntentUtils.newIntent(
|
||||
ImportActivity.this, TrackDetailActivity.class)
|
||||
@@ -186,7 +186,7 @@ public class ImportActivity extends Activity {
|
||||
.addParentStack(TrackDetailActivity.class).addNextIntent(intent)
|
||||
.startActivities();
|
||||
}
|
||||
dialog.dismiss();
|
||||
dialogInterface.dismiss();
|
||||
finish();
|
||||
}
|
||||
}).setTitle(titleId).create();
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ public class KmzTrackImporter implements TrackImporter {
|
||||
private void cleanImport(long trackId) {
|
||||
if (trackId != -1L) {
|
||||
MyTracksProviderUtils myTracksProviderUtils = MyTracksProviderUtils.Factory.get(context);
|
||||
myTracksProviderUtils.deleteTrack(trackId);
|
||||
myTracksProviderUtils.deleteTrack(context, trackId);
|
||||
}
|
||||
|
||||
if (importTrackId != -1L) {
|
||||
|
||||
@@ -197,7 +197,7 @@ public class SyncAdapter extends AbstractThreadedSyncAdapter {
|
||||
do {
|
||||
Track track = myTracksProviderUtils.createTrack(cursor);
|
||||
if (!syncedDriveIds.contains(track.getDriveId())) {
|
||||
myTracksProviderUtils.deleteTrack(track.getId());
|
||||
myTracksProviderUtils.deleteTrack(context, track.getId());
|
||||
}
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
@@ -314,7 +314,7 @@ public class SyncAdapter extends AbstractThreadedSyncAdapter {
|
||||
File driveFile = changes.get(driveId);
|
||||
if (driveFile == null) {
|
||||
Log.d(TAG, "Delete local track " + track.getName());
|
||||
myTracksProviderUtils.deleteTrack(track.getId());
|
||||
myTracksProviderUtils.deleteTrack(context, track.getId());
|
||||
} else {
|
||||
if (SyncUtils.isInMyTracksAndValid(driveFile, getFolderId())
|
||||
|| SyncUtils.isInSharedWithMe(driveFile)) {
|
||||
@@ -532,7 +532,7 @@ public class SyncAdapter extends AbstractThreadedSyncAdapter {
|
||||
if (!success) {
|
||||
// if the track is new, delete it
|
||||
if (trackId == -1L && track != null) {
|
||||
myTracksProviderUtils.deleteTrack(track.getId());
|
||||
myTracksProviderUtils.deleteTrack(context, track.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ public class SyncUtils {
|
||||
do {
|
||||
Track track = myTracksProviderUtils.createTrack(cursor);
|
||||
if (track.isSharedWithMe()) {
|
||||
myTracksProviderUtils.deleteTrack(track.getId());
|
||||
myTracksProviderUtils.deleteTrack(context, track.getId());
|
||||
} else {
|
||||
SyncUtils.updateTrack(myTracksProviderUtils, track, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user