X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/8d3b028e7215def932d499b9f54c57c8927acf4e..15a2d8b8e6bcdac3791cc772af85a2806b87a3b6:/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java diff --git a/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java b/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java index 5245abf7..14637599 100644 --- a/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java +++ b/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java @@ -111,7 +111,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setSupportProgressBarIndeterminateVisibility(false); - Thread.setDefaultUncaughtExceptionHandler(new CrashHandler(getApplicationContext())); +// Thread.setDefaultUncaughtExceptionHandler(new CrashHandler(getApplicationContext())); if(savedInstanceState != null) { mDirs = savedInstanceState.getStringArray(KEY_DIR_ARRAY); @@ -160,6 +160,8 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements break; } case R.id.startSync: { + // This could be interesting + //ContentResolver.cancelSync(null, "org.owncloud"); // cancel the current synchronizations of any other ownCloud account Bundle bundle = new Bundle(); bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); ContentResolver.requestSync( @@ -614,29 +616,25 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements Log.d("FileDisplay", "sync of account " + account_name + " is in_progress: " + inProgress); - //if (account_name.equals(AccountUtils.getCurrentOwnCloudAccount(context).name)) { // TODO - probably this check should be added, but won't push it until really tests are done; no time now + if (account_name.equals(AccountUtils.getCurrentOwnCloudAccount(context).name)) { - /// try to refresh the view with every message received from the FileSyncAdapter; brute, but more user friendly when there are a lot of files in the server - OCFile currentDir; + String synchFolderRemotePath = intent.getStringExtra(FileSyncService.SYNC_FOLDER_REMOTE_PATH); + if (mCurrentDir == null) - currentDir = mStorageManager.getFileByPath("/"); - else - currentDir = mStorageManager.getFileByPath(mCurrentDir.getRemotePath()); - - if (currentDir != null) { - mCurrentDir = currentDir; + mCurrentDir = mStorageManager.getFileByPath("/"); + + if (synchFolderRemotePath != null && mCurrentDir != null && mCurrentDir.getRemotePath().equals(synchFolderRemotePath) ) { FileListFragment fileListFragment = (FileListFragment) getSupportFragmentManager() .findFragmentById(R.id.fileList); + mCurrentDir = getStorageManager().getFileByPath(synchFolderRemotePath); if (fileListFragment != null) { - if (!mCurrentDir.equals(fileListFragment.getCurrentFile())) { - fileListFragment.listDirectory(mCurrentDir); // only set the directory in the fragment first time - } else - fileListFragment.listDirectory(); // enough to show new files in the current directory if they are added after + fileListFragment.listDirectory(mCurrentDir); } } setSupportProgressBarIndeterminateVisibility(inProgress); - //} + + } } } @@ -719,7 +717,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements // If we are on a large device -> update fragment if (mDualPane) { - // buttons in the details view a are problematic when trying to reuse an existing fragment; create always a new one solves some of them, BUT no all; downloads are 'dangerous' + // buttons in the details view are problematic when trying to reuse an existing fragment; create always a new one solves some of them, BUT no all; downloads are 'dangerous' FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.replace(R.id.file_details_container, new FileDetailFragment(file, AccountUtils.getCurrentOwnCloudAccount(this)), FileDetailFragment.FTAG); transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);