projects
/
pub
/
Android
/
ownCloud.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
041bc26
)
Add boolean parameter 'ignoreTag' to SyncronizeFolderOperation constructor and pass...
author
jabarros
<jabarros@solidgear.es>
Mon, 15 Sep 2014 11:14:32 +0000
(13:14 +0200)
committer
jabarros
<jabarros@solidgear.es>
Mon, 15 Sep 2014 11:14:32 +0000
(13:14 +0200)
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/syncadapter/FileSyncAdapter.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/activity/MoveActivity.java
patch
|
blob
|
blame
|
history
diff --git
a/src/com/owncloud/android/operations/SynchronizeFolderOperation.java
b/src/com/owncloud/android/operations/SynchronizeFolderOperation.java
index
fc4a74e
..
31e4e7a
100644
(file)
--- a/
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
+++ b/
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
@@
-109,6
+109,9
@@
public class SynchronizeFolderOperation extends RemoteOperation {
/** 'True' means that the remote folder changed from last synchronization and should be fetched */
private boolean mRemoteFolderChanged;
/** 'True' means that the remote folder changed from last synchronization and should be fetched */
private boolean mRemoteFolderChanged;
+ /** 'True' means that Etag will be ignored */
+ private boolean mIgnoreTag;
+
/**
* Creates a new instance of {@link SynchronizeFolderOperation}.
/**
* Creates a new instance of {@link SynchronizeFolderOperation}.
@@
-126,6
+129,7
@@
public class SynchronizeFolderOperation extends RemoteOperation {
long currentSyncTime,
boolean syncFullAccount,
boolean isShareSupported,
long currentSyncTime,
boolean syncFullAccount,
boolean isShareSupported,
+ boolean ignoreTag,
FileDataStorageManager dataStorageManager,
Account account,
Context context ) {
FileDataStorageManager dataStorageManager,
Account account,
Context context ) {
@@
-138,6
+142,7
@@
public class SynchronizeFolderOperation extends RemoteOperation {
mContext = context;
mForgottenLocalFiles = new HashMap<String, String>();
mRemoteFolderChanged = false;
mContext = context;
mForgottenLocalFiles = new HashMap<String, String>();
mRemoteFolderChanged = false;
+ mIgnoreTag = ignoreTag;
}
}
@@
-215,7
+220,7
@@
public class SynchronizeFolderOperation extends RemoteOperation {
private RemoteOperationResult checkForChanges(OwnCloudClient client) {
private RemoteOperationResult checkForChanges(OwnCloudClient client) {
- mRemoteFolderChanged =
fals
e;
+ mRemoteFolderChanged =
tru
e;
RemoteOperationResult result = null;
String remotePath = null;
RemoteOperationResult result = null;
String remotePath = null;
@@
-227,10
+232,12
@@
public class SynchronizeFolderOperation extends RemoteOperation {
result = operation.execute(client);
if (result.isSuccess()){
OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
result = operation.execute(client);
if (result.isSuccess()){
OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
-
- // check if remote and local folder are different
- mRemoteFolderChanged = !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag()));
-
+
+ if (!mIgnoreTag) {
+ // check if remote and local folder are different
+ mRemoteFolderChanged = !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag()));
+ }
+
result = new RemoteOperationResult(ResultCode.OK);
Log_OC.i(TAG, "Checked " + mAccount.name + remotePath + " : " + (mRemoteFolderChanged ? "changed" : "not changed"));
result = new RemoteOperationResult(ResultCode.OK);
Log_OC.i(TAG, "Checked " + mAccount.name + remotePath + " : " + (mRemoteFolderChanged ? "changed" : "not changed"));
diff --git
a/src/com/owncloud/android/syncadapter/FileSyncAdapter.java
b/src/com/owncloud/android/syncadapter/FileSyncAdapter.java
index
2ac8983
..
8096404
100644
(file)
--- a/
src/com/owncloud/android/syncadapter/FileSyncAdapter.java
+++ b/
src/com/owncloud/android/syncadapter/FileSyncAdapter.java
@@
-264,6
+264,7
@@
public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
mCurrentSyncTime,
true,
mIsShareSupported,
mCurrentSyncTime,
true,
mIsShareSupported,
+ true,
getStorageManager(),
getAccount(),
getContext()
getStorageManager(),
getAccount(),
getContext()
diff --git
a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java
b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java
index
6329833
..
90a6f48
100644
(file)
--- a/
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
+++ b/
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
@@
-251,7
+251,7
@@
OnSslUntrustedCertListener, SwipeRefreshLayout.OnRefreshListener {
Log_OC.e(TAG, "Initializing Fragments in onAccountChanged..");
initFragmentsWithFile();
if (file.isFolder()) {
Log_OC.e(TAG, "Initializing Fragments in onAccountChanged..");
initFragmentsWithFile();
if (file.isFolder()) {
- startSyncFolderOperation(file);
+ startSyncFolderOperation(file
, false
);
}
} else {
}
} else {
@@
-1153,7
+1153,7
@@
OnSslUntrustedCertListener, SwipeRefreshLayout.OnRefreshListener {
OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
listOfFiles.listDirectory(root);
setFile(listOfFiles.getCurrentFile());
OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
listOfFiles.listDirectory(root);
setFile(listOfFiles.getCurrentFile());
- startSyncFolderOperation(root);
+ startSyncFolderOperation(root
, false
);
}
cleanSecondFragment();
}
}
cleanSecondFragment();
}
@@
-1168,7
+1168,7
@@
OnSslUntrustedCertListener, SwipeRefreshLayout.OnRefreshListener {
setNavigationListWithFolder(folder);
listOfFiles.listDirectory(folder);
setFile(listOfFiles.getCurrentFile());
setNavigationListWithFolder(folder);
listOfFiles.listDirectory(folder);
setFile(listOfFiles.getCurrentFile());
- startSyncFolderOperation(folder);
+ startSyncFolderOperation(folder
, false
);
} else {
Log_OC.e(TAG, "Unexpected null when accessing list fragment");
}
} else {
Log_OC.e(TAG, "Unexpected null when accessing list fragment");
}
@@
-1187,7
+1187,7
@@
OnSslUntrustedCertListener, SwipeRefreshLayout.OnRefreshListener {
cleanSecondFragment();
// Sync Folder
cleanSecondFragment();
// Sync Folder
- startSyncFolderOperation(directory);
+ startSyncFolderOperation(directory
, false
);
}
}
@@
-1304,7
+1304,7
@@
OnSslUntrustedCertListener, SwipeRefreshLayout.OnRefreshListener {
@Override
public void onSavedCertificate() {
@Override
public void onSavedCertificate() {
- startSyncFolderOperation(getCurrentDir()
);
+ startSyncFolderOperation(getCurrentDir()
, false);
}
}
@@
-1592,7
+1592,7
@@
OnSslUntrustedCertListener, SwipeRefreshLayout.OnRefreshListener {
return null;
}
return null;
}
- public void startSyncFolderOperation(OCFile folder) {
+ public void startSyncFolderOperation(OCFile folder
, boolean ignoreTag
) {
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;
@@
-1602,6
+1602,7
@@
OnSslUntrustedCertListener, SwipeRefreshLayout.OnRefreshListener {
currentSyncTime,
false,
getFileOperationsHelper().isSharedSupported(),
currentSyncTime,
false,
getFileOperationsHelper().isSharedSupported(),
+ ignoreTag,
getStorageManager(),
getAccount(),
getApplicationContext()
getStorageManager(),
getAccount(),
getApplicationContext()
@@
-1721,7
+1722,7
@@
OnSslUntrustedCertListener, SwipeRefreshLayout.OnRefreshListener {
if (folder != null) {
/*mFile = mContainerActivity.getStorageManager().getFileById(mFile.getFileId());
listDirectory(mFile);*/
if (folder != null) {
/*mFile = mContainerActivity.getStorageManager().getFileById(mFile.getFileId());
listDirectory(mFile);*/
- startSyncFolderOperation(folder);
+ startSyncFolderOperation(folder
, true
);
}
}
}
}
}
}
diff --git
a/src/com/owncloud/android/ui/activity/MoveActivity.java
b/src/com/owncloud/android/ui/activity/MoveActivity.java
index
be8fce1
..
f6a9529
100644
(file)
--- a/
src/com/owncloud/android/ui/activity/MoveActivity.java
+++ b/
src/com/owncloud/android/ui/activity/MoveActivity.java
@@
-145,7
+145,7
@@
public class MoveActivity extends HookActivity implements FileFragment.Container
OCFileListFragment listOfFolders = getListOfFilesFragment();
listOfFolders.listDirectory(folder);
OCFileListFragment listOfFolders = getListOfFilesFragment();
listOfFolders.listDirectory(folder);
- startSyncFolderOperation(folder);
+ startSyncFolderOperation(folder
, false
);
}
updateNavigationElementsInActionBar();
}
updateNavigationElementsInActionBar();
@@
-201,12
+201,12
@@
public class MoveActivity extends HookActivity implements FileFragment.Container
setFile(directory);
updateNavigationElementsInActionBar();
// Sync Folder
setFile(directory);
updateNavigationElementsInActionBar();
// Sync Folder
- startSyncFolderOperation(directory);
+ startSyncFolderOperation(directory
, false
);
}
}
- public void startSyncFolderOperation(OCFile folder) {
+ public void startSyncFolderOperation(OCFile folder
, boolean ignoreTag
) {
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;
@@
-216,6
+216,7
@@
public class MoveActivity extends HookActivity implements FileFragment.Container
currentSyncTime,
false,
getFileOperationsHelper().isSharedSupported(),
currentSyncTime,
false,
getFileOperationsHelper().isSharedSupported(),
+ ignoreTag,
getStorageManager(),
getAccount(),
getApplicationContext()
getStorageManager(),
getAccount(),
getApplicationContext()
@@
-323,7
+324,7
@@
public class MoveActivity extends HookActivity implements FileFragment.Container
listOfFiles.listDirectory(root);
setFile(listOfFiles.getCurrentFile());
updateNavigationElementsInActionBar();
listOfFiles.listDirectory(root);
setFile(listOfFiles.getCurrentFile());
updateNavigationElementsInActionBar();
- startSyncFolderOperation(root);
+ startSyncFolderOperation(root
, false
);
}
}
}
}
@@
-560,7
+561,7
@@
public class MoveActivity extends HookActivity implements FileFragment.Container
if (listOfFiles != null) {
OCFile folder = listOfFiles.getCurrentFile();
if (folder != null) {
if (listOfFiles != null) {
OCFile folder = listOfFiles.getCurrentFile();
if (folder != null) {
- startSyncFolderOperation(folder);
+ startSyncFolderOperation(folder
, true
);
}
}
}
}
}
}