-->\r
<manifest package="eu.alefzero.owncloud"\r
android:versionCode="1"\r
- android:versionName="0.1.140B" xmlns:android="http://schemas.android.com/apk/res/android">\r
+ android:versionName="0.1.142B" xmlns:android="http://schemas.android.com/apk/res/android">\r
\r
<uses-permission android:name="android.permission.GET_ACCOUNTS" />\r
<uses-permission android:name="android.permission.USE_CREDENTIALS" />\r
<activity android:name="CrashlogSendActivity"></activity>\r
</application>\r
\r
-</manifest>
\ No newline at end of file
+</manifest>
<string name="prefs_trackmydevice_interval_summary">Update every %1$s minutes</string>
<string name="prefs_accounts">Accounts</string>
- <string name="auth_host_url">ownCloud location</string>
+ <string name="auth_host_url">ownCloud URL</string>
<string name="auth_username">Username</string>
<string name="auth_password">Password</string>
<string name="new_session_uri_error">Wrong URL given</string>
<string name="uploader_upload_succeed">Uploading completed successfully</string>
<string name="uploader_upload_failed">Upload failed: </string>
<string name="uploader_files_uploaded_suffix"> files uploaded</string>
+ <string name="downloader_download_failed">Download could not be completed</string>
<string name="common_choose_account">Choose account</string>
<string name="sync_string_contacts">Contacts</string>
<string name="use_ssl">Use Secure Connection</string>
\r
public class FileDownloader extends Service implements OnDatatransferProgressListener {\r
public static final String DOWNLOAD_FINISH_MESSAGE = "DOWNLOAD_FINISH";\r
+ public static final String BAD_DOWNLOAD_MESSAGE = "BAD_DOWNLOAD"; \r
public static final String EXTRA_ACCOUNT = "ACCOUNT";\r
public static final String EXTRA_FILE_PATH = "FILE_PATH";\r
public static final String EXTRA_REMOTE_PATH = "REMOTE_PATH";\r
\r
Log.e(TAG, file.getAbsolutePath() + " " + oc_url.toString());\r
Log.e(TAG, mFilePath+"");\r
+ String message;\r
if (wdc.downloadFile(mRemotePath, file)) {\r
ContentValues cv = new ContentValues();\r
cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getAbsolutePath());\r
new String[] {\r
mFilePath.substring(mFilePath.lastIndexOf('/') + 1),\r
mAccount.name }); \r
+ message = DOWNLOAD_FINISH_MESSAGE;\r
+ } else {\r
+ message = BAD_DOWNLOAD_MESSAGE;\r
}\r
+ \r
mNotificationMngr.cancel(1);\r
- Intent end = new Intent(DOWNLOAD_FINISH_MESSAGE);\r
+ Intent end = new Intent(message);\r
end.putExtra(EXTRA_FILE_PATH, file.getAbsolutePath());\r
sendBroadcast(end);\r
}\r
message = getString(R.string.uploader_upload_failed);
if (mLocalPaths.length > 1)
message += " (" + mSuccessCounter + " / " + mLocalPaths.length + getString(R.string.uploader_files_uploaded_suffix) + ")";
- Toast.makeText(this, "Upload could not be completed", Toast.LENGTH_SHORT).show();
}
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
}
\r
Log.d(TAG, "syncing owncloud account " + account.name);\r
\r
- sendStickyBroadcast(true, -1); // starting message to the main IU\r
+ sendStickyBroadcast(true, -1); // starting message to UI\r
\r
PropFindMethod query;\r
try {\r
getStorageManager().removeFile(file);\r
}\r
\r
- // synched folder -> notice to main thread\r
+ // synched folder -> notice to IU\r
sendStickyBroadcast(true, parentId);\r
\r
// recursive fetch\r
case R.id.startSync: {\r
Bundle bundle = new Bundle();\r
bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);\r
- bundle.putString("PROBANDO", "PARAMETRO PASADO AL SYNC");\r
ContentResolver.requestSync(\r
AccountUtils.getCurrentOwnCloudAccount(this),\r
"org.owncloud", bundle);\r
\r
fileName.setText(name);\r
ImageView fileIcon = (ImageView) view.findViewById(R.id.imageView1);\r
- if (!file.getMimetype().equals("DIR")) {\r
+ if (file.getMimetype() == null || !file.getMimetype().equals("DIR")) {\r
fileIcon.setImageResource(R.drawable.file);\r
} else {\r
fileIcon.setImageResource(R.drawable.ic_menu_archive);\r
i.putExtra(FileDownloader.EXTRA_REMOTE_PATH, mFile.getRemotePath());\r
i.putExtra(FileDownloader.EXTRA_FILE_PATH, mFile.getURLDecodedRemotePath());\r
i.putExtra(FileDownloader.EXTRA_FILE_SIZE, mFile.getFileLength());\r
+ v.setEnabled(false);\r
getActivity().startService(i);\r
}\r
\r
}\r
\r
/**\r
- * In ownCloud 3.0.3 and 4.0.0 there is a bug that SabreDAV does not return\r
+ * In ownCloud 3.X.X and 4.X.X there is a bug that SabreDAV does not return\r
* the time that the file was created. There is a chance that this will\r
* be fixed in future versions. Use this method to check if this version of\r
* ownCloud has this fix.\r
- * @return True, if ownCloud the ownCloud version is > 3.0.4 and 4.0.4\r
+ * @return True, if ownCloud the ownCloud version is supporting creationg time\r
*/\r
private boolean ocVersionSupportsTimeCreated(){\r
if(mIntent != null){\r
AccountManager accManager = (AccountManager) getActivity().getSystemService(Context.ACCOUNT_SERVICE);\r
OwnCloudVersion ocVersion = new OwnCloudVersion(accManager\r
.getUserData(ocAccount, AccountAuthenticator.KEY_OC_VERSION));\r
- if(ocVersion.compareTo(new OwnCloudVersion(0x030004)) >= 0 || ocVersion.compareTo(new OwnCloudVersion(0x040004)) >= 0){\r
+ if(ocVersion.compareTo(new OwnCloudVersion(0x030000)) < 0) {\r
return true;\r
}\r
}\r
private class DownloadFinishReceiver extends BroadcastReceiver {\r
@Override\r
public void onReceive(Context context, Intent intent) {\r
- ((OCFile)mIntent.getParcelableExtra(EXTRA_FILE)).setStoragePath(intent.getStringExtra(FileDownloader.EXTRA_FILE_PATH));\r
- updateFileDetails(mIntent);\r
+ getView().findViewById(R.id.fdDownloadBtn).setEnabled(true);\r
+ if (intent.getAction().equals(FileDownloader.BAD_DOWNLOAD_MESSAGE)) {\r
+ Toast.makeText(context, R.string.downloader_download_failed , Toast.LENGTH_SHORT).show();\r
+ \r
+ } else if (intent.getAction().equals(FileDownloader.DOWNLOAD_FINISH_MESSAGE)) {\r
+ ((OCFile)mIntent.getParcelableExtra(EXTRA_FILE)).setStoragePath(intent.getStringExtra(FileDownloader.EXTRA_FILE_PATH));\r
+ updateFileDetails(mIntent);\r
+ }\r
}\r
\r
}\r