mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
Fix a bug with SyncedFolderProvider
This commit is contained in:
parent
1973705356
commit
4e90222439
2 changed files with 12 additions and 4 deletions
|
@ -165,7 +165,7 @@ public class SyncedFolderProvider extends Observable {
|
||||||
Cursor cursor = mContentResolver.query(
|
Cursor cursor = mContentResolver.query(
|
||||||
ProviderMeta.ProviderTableMeta.CONTENT_URI_SYNCED_FOLDERS,
|
ProviderMeta.ProviderTableMeta.CONTENT_URI_SYNCED_FOLDERS,
|
||||||
null,
|
null,
|
||||||
ProviderMeta.ProviderTableMeta.SYNCED_FOLDER_LOCAL_PATH + "==" + localPath,
|
ProviderMeta.ProviderTableMeta.SYNCED_FOLDER_LOCAL_PATH + "== \"" + localPath + "\"",
|
||||||
null,
|
null,
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
|
|
|
@ -323,9 +323,13 @@ public class FolderSyncActivity extends FileActivity implements FolderSyncAdapte
|
||||||
@Override
|
@Override
|
||||||
public void onSyncStatusToggleClick(int section, SyncedFolderDisplayItem syncedFolderDisplayItem) {
|
public void onSyncStatusToggleClick(int section, SyncedFolderDisplayItem syncedFolderDisplayItem) {
|
||||||
if (syncedFolderDisplayItem.getId() > UNPERSISTED_ID) {
|
if (syncedFolderDisplayItem.getId() > UNPERSISTED_ID) {
|
||||||
mSyncedFolderProvider.updateFolderSyncEnabled(syncedFolderDisplayItem.getId(), syncedFolderDisplayItem.isEnabled());
|
mSyncedFolderProvider.updateFolderSyncEnabled(syncedFolderDisplayItem.getId(),
|
||||||
|
syncedFolderDisplayItem.isEnabled());
|
||||||
} else {
|
} else {
|
||||||
mSyncedFolderProvider.storeFolderSync(syncedFolderDisplayItem);
|
long storedId = mSyncedFolderProvider.storeFolderSync(syncedFolderDisplayItem);
|
||||||
|
if (storedId != -1) {
|
||||||
|
syncedFolderDisplayItem.setId(storedId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,7 +366,11 @@ public class FolderSyncActivity extends FileActivity implements FolderSyncAdapte
|
||||||
|
|
||||||
if (syncedFolder.getId() == UNPERSISTED_ID) {
|
if (syncedFolder.getId() == UNPERSISTED_ID) {
|
||||||
// newly set up folder sync config
|
// newly set up folder sync config
|
||||||
mSyncedFolderProvider.storeFolderSync(item);
|
long storedId = mSyncedFolderProvider.storeFolderSync(item);
|
||||||
|
if (storedId != -1) {
|
||||||
|
item.setId(storedId);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// existing synced folder setup to be updated
|
// existing synced folder setup to be updated
|
||||||
mSyncedFolderProvider.updateSyncFolder(item);
|
mSyncedFolderProvider.updateSyncFolder(item);
|
||||||
|
|
Loading…
Reference in a new issue