mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +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(
|
||||
ProviderMeta.ProviderTableMeta.CONTENT_URI_SYNCED_FOLDERS,
|
||||
null,
|
||||
ProviderMeta.ProviderTableMeta.SYNCED_FOLDER_LOCAL_PATH + "==" + localPath,
|
||||
ProviderMeta.ProviderTableMeta.SYNCED_FOLDER_LOCAL_PATH + "== \"" + localPath + "\"",
|
||||
null,
|
||||
null
|
||||
);
|
||||
|
|
|
@ -323,9 +323,13 @@ public class FolderSyncActivity extends FileActivity implements FolderSyncAdapte
|
|||
@Override
|
||||
public void onSyncStatusToggleClick(int section, SyncedFolderDisplayItem syncedFolderDisplayItem) {
|
||||
if (syncedFolderDisplayItem.getId() > UNPERSISTED_ID) {
|
||||
mSyncedFolderProvider.updateFolderSyncEnabled(syncedFolderDisplayItem.getId(), syncedFolderDisplayItem.isEnabled());
|
||||
mSyncedFolderProvider.updateFolderSyncEnabled(syncedFolderDisplayItem.getId(),
|
||||
syncedFolderDisplayItem.isEnabled());
|
||||
} 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) {
|
||||
// newly set up folder sync config
|
||||
mSyncedFolderProvider.storeFolderSync(item);
|
||||
long storedId = mSyncedFolderProvider.storeFolderSync(item);
|
||||
if (storedId != -1) {
|
||||
item.setId(storedId);
|
||||
}
|
||||
|
||||
} else {
|
||||
// existing synced folder setup to be updated
|
||||
mSyncedFolderProvider.updateSyncFolder(item);
|
||||
|
|
Loading…
Reference in a new issue