List<SynchronizeFileOperation> filesToSyncContents = new Vector<SynchronizeFileOperation>();
// get current data about local contents of the folder to synchronize
- List<OCFile> localFiles = mStorageManager.getFolderContent(mLocalFolder, true);
+ List<OCFile> localFiles = mStorageManager.getFolderContent(mLocalFolder, false);
Map<String, OCFile> localFilesMap = new HashMap<String, OCFile>(localFiles.size());
for (OCFile file : localFiles) {
localFilesMap.put(file.getRemotePath(), file);
}
// get current data about local contents of the folder to synchronize
- List<OCFile> localFiles = storageManager.getFolderContent(mLocalFolder, true);
+ List<OCFile> localFiles = storageManager.getFolderContent(mLocalFolder, false);
Map<String, OCFile> localFilesMap = new HashMap<String, OCFile>(localFiles.size());
for (OCFile file : localFiles) {
localFilesMap.put(file.getRemotePath(), file);
private void prepareOpsFromLocalKnowledge() throws OperationCancelledException {
// TODO TOBI ist das richtig?
- List<OCFile> children = getStorageManager().getFolderContent(mLocalFolder, true);
+ List<OCFile> children = getStorageManager().getFolderContent(mLocalFolder, false);
for (OCFile child : children) {
/// classify file to sync/download contents later
if (child.isFolder()) {
private static String DIALOG_UPLOAD_SOURCE = "DIALOG_UPLOAD_SOURCE";
private static String DIALOG_CERT_NOT_SAVED = "DIALOG_CERT_NOT_SAVED";
+ private NavigationDrawerListAdapter adapter = null;
private OCFile mWaitingToSend;
// ListView
ListView listView = (ListView) notificatonDrawer.findViewById(R.id.drawer_list);
- final NavigationDrawerListAdapter adapter = new NavigationDrawerListAdapter(getApplicationContext(), this);
+ adapter = new NavigationDrawerListAdapter(getApplicationContext(), this);
listView.setAdapter(adapter);
// Username
TextView username = (TextView) notificatonDrawer.findViewById(R.id.drawer_username);
Account account = AccountUtils.getCurrentOwnCloudAccount(getApplicationContext());
- int lastAtPos = account.name.lastIndexOf("@");
- username.setText(account.name.substring(0, lastAtPos));
+
+ if (account != null) {
+ int lastAtPos = account.name.lastIndexOf("@");
+ username.setText(account.name.substring(0, lastAtPos));
+ }
// Set the drawer toggle as the DrawerListener
mDrawerLayout.setDrawerListener(mDrawerToggle);
Log_OC.v(TAG, "onResume() start");
super.onResume();
+ // refresh Navigation Drawer account list
+ adapter.updateAccountList();
+
// refresh list of files
refreshListOfFilesFragment();
mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);\r
}\r
if (mStorageManager != null) {\r
- mFiles = mStorageManager.getFolderContent(mFile, false);\r
+ mFiles = mStorageManager.getFolderContent(mFile, onlyOnDevice);\r
mFilesOrig.clear();\r
mFilesOrig.addAll(mFiles);\r
\r
mDrawerItems.add(string);
}
+ updateAccountList();
+
+ all.addAll(mDrawerItems);
+ }
+
+ public void updateAccountList(){
AccountManager am = (AccountManager) mContext.getSystemService(mContext.ACCOUNT_SERVICE);
mAccounts = am.getAccountsByType(MainApp.getAccountType());
currentAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);
-
- all.addAll(mDrawerItems);
}
@Override
return convertView;
}
+ // TODO update Account List after creating a new account and on fresh installation
public void setShowAccounts(boolean value){
all.clear();
all.addAll(mDrawerItems);