From: tobiasKaminsky Date: Sat, 21 Nov 2015 08:35:19 +0000 (+0100) Subject: Merge remote-tracking branch 'remotes/upstream/avoidDuplicateFiles' into beta X-Git-Tag: beta-20151122~4 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/45e95d494dca25b857d15d384d6d0e1d4cbf2899?ds=inline;hp=-c Merge remote-tracking branch 'remotes/upstream/avoidDuplicateFiles' into beta --- 45e95d494dca25b857d15d384d6d0e1d4cbf2899 diff --combined owncloud-android-library index 4f9a7528,b09969d0..ecc3415e --- a/owncloud-android-library +++ b/owncloud-android-library @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit 4f9a7528cab0563cb234a8b817e8ee371dd6cc25 -Subproject commit b09969d078b3a790b01c8d61a7298a37439a9f24 ++Subproject commit ecc3415e3e3c13fa8f73fdd51a88c1ab7087b199 diff --combined res/values-th-rTH/strings.xml index 562b39e2,aab35a24..1dc33c1d --- a/res/values-th-rTH/strings.xml +++ b/res/values-th-rTH/strings.xml @@@ -198,11 -198,11 +198,11 @@@ ออกจากรายการโปรด เปลี่ยนชื่อ ลบออก - คุณต้องการที่จะลบ %1$s? + คุณต้องการที่จะลบ %1$s? คุณต้องการที่จะลบ %1$s และเนื้อหาของมัน? เฉพาะต้นทางเท่านั้น เฉพาะต้นทางเท่านั้น - จากเซิฟเวอร์ + จากเซิร์ฟเวอร์ รีโมท & ต้นทาง ลบเรียบร้อยแล้ว ไม่สามารถลบได้ @@@ -262,7 -262,7 +262,7 @@@ ไฟล์ใดที่คุณต้องการที่จะเก็บ? หากคุณเลือกทั้งสองรุ่น ไฟล์ต้นทางจะมีจำนวนชื่อเพิ่ม เก็บไว้ทั้งสองอย่าง เวอร์ชันต้นทาง - เวอร์ชันเซิฟเวอร์ + เวอร์ชันเซิร์ฟเวอร์ แสดงรูปภาพตัวอย่าง ไม่สามารถแสดงรูปภาพนี้ได้ %1$s ไม่สามารถคัดลอกไปยังโฟลเดอร์ %2$s ในเครื่อง diff --combined src/com/owncloud/android/authentication/AuthenticatorActivity.java index 4173ca42,7b0398e8..418cdd5f --- a/src/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/src/com/owncloud/android/authentication/AuthenticatorActivity.java @@@ -176,6 -176,7 +176,6 @@@ public class AuthenticatorActivity exte private EditText mUsernameInput; private EditText mPasswordInput; private View mOkButton; - private View mCenteredRefreshButton; private TextView mAuthStatusView; private int mAuthStatusText = 0, mAuthStatusIcon = 0; @@@ -260,22 -261,16 +260,22 @@@ } }); - mCenteredRefreshButton = findViewById(R.id.centeredRefreshButton); - mCenteredRefreshButton.setOnClickListener(new View.OnClickListener() { + findViewById(R.id.centeredRefreshButton).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { checkOcServer(); } }); - - mOkButton = findViewById(R.id.buttonOK); + + findViewById(R.id.embeddedRefreshButton).setOnClickListener(new View.OnClickListener() { + + @Override + public void onClick(View v) { + checkOcServer(); + } + }); + /// initialize block to be moved to single Fragment to check server and get info about it initServerPreFragment(savedInstanceState); @@@ -707,7 -702,7 +707,7 @@@ mHostUrlInput.removeTextChangedListener(mHostUrlInputWatcher); mHostUrlInput.setOnFocusChangeListener(null); - + super.onPause(); } @@@ -747,7 -742,7 +747,7 @@@ mOAuthTokenEndpointText.getText().toString().trim()); getServerInfoIntent.putExtra( - OperationsService.EXTRA_OAUTH2_QUERY_PARAMETERS, + OperationsService.EXTRA_OAUTH2_QUERY_PARAMETERS, queryParameters); if (mOperationsServiceBinder != null) { @@@ -806,6 -801,8 +806,8 @@@ showRefreshButton(false); if (uri.length() != 0) { + uri = stripIndexPhpOrAppsFiles(uri, mHostUrlInput); + // Handle internationalized domain names uri = DisplayUtils.convertIdn(uri, true); @@@ -816,8 -813,8 +818,8 @@@ Intent getServerInfoIntent = new Intent(); getServerInfoIntent.setAction(OperationsService.ACTION_GET_SERVER_INFO); getServerInfoIntent.putExtra( - OperationsService.EXTRA_SERVER_URL, - normalizeUrlSuffix(uri) + OperationsService.EXTRA_SERVER_URL, + normalizeUrlSuffix(uri) ); if (mOperationsServiceBinder != null) { mWaitingForOpId = mOperationsServiceBinder.queueNewOperation(getServerInfoIntent); @@@ -1148,6 -1145,17 +1150,17 @@@ return url; } + private String stripIndexPhpOrAppsFiles(String url, EditText mHostUrlInput) { + if (url.endsWith("/index.php")) { + url = url.substring(0, url.lastIndexOf("/index.php")); + mHostUrlInput.setText(url); + } else if (url.contains("/index.php/apps/")) { + url = url.substring(0, url.lastIndexOf("/index.php/apps/")); + mHostUrlInput.setText(url); + } + + return url; + } // TODO remove, if possible private String trimUrlWebdav(String url){ @@@ -1630,6 -1638,18 +1643,6 @@@ } /** - * Called when the refresh button in the input field for ownCloud host is clicked. - * - * Performs a new check on the URL in the input field. - * - * @param view Refresh 'button' - */ - public void onRefreshClick(View view) { - checkOcServer(); - } - - - /** * Called when the eye icon in the password field is clicked. * * Toggles the visibility of the password in the field. diff --combined src/com/owncloud/android/operations/UploadFileOperation.java index a347192b,ab74e792..d6466c54 --- a/src/com/owncloud/android/operations/UploadFileOperation.java +++ b/src/com/owncloud/android/operations/UploadFileOperation.java @@@ -325,14 -325,14 +325,14 @@@ public class UploadFileOperation extend throw new OperationCancelledException(); } - result = mUploadOperation.execute(client); - /// move local temporal file or original file to its corresponding // location in the ownCloud local folder if (result.isSuccess()) { if (mLocalBehaviour == FileUploader.LOCAL_BEHAVIOUR_FORGET) { mFile.setStoragePath(null); - + } else if (mLocalBehaviour == FileUploader.LOCAL_BEHAVIOUR_REMOVE){ + mFile.setStoragePath(null); + originalFile.delete(); } else { mFile.setStoragePath(expectedPath); File fileToMove = null; @@@ -359,10 -359,9 +359,9 @@@ // return result; } } - FileDataStorageManager.triggerMediaScan(originalFile.getAbsolutePath()); - FileDataStorageManager.triggerMediaScan(expectedFile.getAbsolutePath()); } - + FileDataStorageManager.triggerMediaScan(originalFile.getAbsolutePath()); + FileDataStorageManager.triggerMediaScan(expectedFile.getAbsolutePath()); } else if (result.getHttpCode() == HttpStatus.SC_PRECONDITION_FAILED ) { result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT); } @@@ -374,9 -373,6 +373,9 @@@ if (temporalFile != null && !originalFile.equals(temporalFile)) { temporalFile.delete(); } + if (result == null){ + return new RemoteOperationResult(false, 404, null); + } if (result.isSuccess()) { Log_OC.i(TAG, "Upload of " + mOriginalStoragePath + " to " + mRemotePath + ": " + result.getLogMessage());