Skip to content

Commit

Permalink
Merge pull request #21881 from osmandapp/fix_#21743
Browse files Browse the repository at this point in the history
Fix #21743
  • Loading branch information
Chumva authored Feb 10, 2025
2 parents e0f9548 + 654018f commit c30b4c8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion OsmAnd/src/net/osmand/plus/backup/ui/ChangesTabFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.osmand.plus.backup.SyncBackupTask.OnBackupSyncListener;
import net.osmand.plus.backup.ui.ChangesFragment.RecentChangesType;
import net.osmand.plus.base.BaseOsmAndFragment;
import net.osmand.plus.settings.backend.backup.items.FileSettingsItem;
import net.osmand.plus.settings.backend.backup.items.SettingsItem;

import java.util.ArrayList;
Expand Down Expand Up @@ -151,7 +152,7 @@ public void downloadCloudVersions() {
private void updateAdapter() {
if (adapter != null) {
items = generateData();
Collections.sort(items, (o1, o2) -> -Long.compare(o1.time, o2.time));
Collections.sort(items, (o1, o2) -> o1.name.compareTo(o2.name));
adapter.setCloudChangeItems(items);
}
}
Expand All @@ -178,6 +179,7 @@ static class FileInfo {

public static class CloudChangeItem {

public String name;
public String title;
public String fileName;
public String description;
Expand Down Expand Up @@ -215,6 +217,14 @@ protected CloudChangeItem createChangeItem(@NonNull SyncOperationType operationT
item.remoteFile = remoteFile;
item.fileName = BackupUtils.getItemFileName(settingsItem);

String type;
if (settingsItem instanceof FileSettingsItem fileItem) {
type = fileItem.getSubtype().name();
} else {
type = settingsItem.getType().name();
}
item.name = type + "/" + item.title;

return item;
}
return null;
Expand Down

0 comments on commit c30b4c8

Please sign in to comment.