Merge remote-tracking branch 'remotes/upstream/master' into beta
authortobiasKaminsky <tobias@kaminsky.me>
Sat, 31 Oct 2015 07:48:10 +0000 (08:48 +0100)
committertobiasKaminsky <tobias@kaminsky.me>
Sat, 31 Oct 2015 07:48:10 +0000 (08:48 +0100)
63 files changed:
1  2 
owncloud-android-library
res/menu/file_actions_menu.xml
res/values-ar/strings.xml
res/values-az/strings.xml
res/values-bg-rBG/strings.xml
res/values-bn-rBD/strings.xml
res/values-ca/strings.xml
res/values-cs-rCZ/strings.xml
res/values-da/strings.xml
res/values-de-rDE/strings.xml
res/values-de/strings.xml
res/values-el/strings.xml
res/values-en-rGB/strings.xml
res/values-eo/strings.xml
res/values-es-rAR/strings.xml
res/values-es-rCL/strings.xml
res/values-es/strings.xml
res/values-et-rEE/strings.xml
res/values-eu/strings.xml
res/values-fi-rFI/strings.xml
res/values-fr/strings.xml
res/values-gl/strings.xml
res/values-he/strings.xml
res/values-hu-rHU/strings.xml
res/values-id/strings.xml
res/values-it/strings.xml
res/values-ja-rJP/strings.xml
res/values-ko/strings.xml
res/values-lb/strings.xml
res/values-lt-rLT/strings.xml
res/values-mk/strings.xml
res/values-nb-rNO/strings.xml
res/values-nl/strings.xml
res/values-oc/strings.xml
res/values-pl/strings.xml
res/values-pt-rBR/strings.xml
res/values-pt-rPT/strings.xml
res/values-ro/strings.xml
res/values-ru/strings.xml
res/values-sk-rSK/strings.xml
res/values-sl/strings.xml
res/values-sr/strings.xml
res/values-sv/strings.xml
res/values-th-rTH/strings.xml
res/values-tr/strings.xml
res/values-uk/strings.xml
res/values-zh-rCN/strings.xml
res/values-zh-rTW/strings.xml
res/values/strings.xml
src/com/owncloud/android/datamodel/FileDataStorageManager.java
src/com/owncloud/android/datamodel/OCFile.java
src/com/owncloud/android/files/FileMenuFilter.java
src/com/owncloud/android/files/FileOperationsHelper.java
src/com/owncloud/android/files/services/FileUploader.java
src/com/owncloud/android/operations/RefreshFolderOperation.java
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
src/com/owncloud/android/operations/UploadFileOperation.java
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
src/com/owncloud/android/ui/adapter/FileListListAdapter.java
src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
src/com/owncloud/android/utils/DisplayUtils.java
src/com/owncloud/android/utils/FileStorageUtils.java

diff --combined owncloud-android-library
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit 652cd28bb15672eaedfe8c1d9a46cf293c909b89
 -Subproject commit f02dffb1d3c46305c70d246f696cde7b8c3b0971
++Subproject commit 59fb61601de4dd8bfcab1afb619e016e1a7b904d
@@@ -1,5 -1,4 +1,5 @@@
 -<?xml version="1.0" encoding="utf-8"?><!--
 +<?xml version="1.0" encoding="utf-8"?>
 +<!--
    ownCloud Android client application
  
    Copyright (C) 2012  Bartek Przybylski
          android:icon="@drawable/ic_action_refresh"
          android:orderInCategory="1" />
      <item
-         android:id="@+id/action_cancel_download"
-         android:title="@string/common_cancel_download"
-         android:icon="@android:drawable/ic_menu_close_clear_cancel"
-         android:orderInCategory="1" />
-     <item
-         android:id="@+id/action_cancel_upload"
-         android:title="@string/common_cancel_upload"
+         android:id="@+id/action_cancel_sync"
+         android:title="@string/common_cancel_sync"
          android:icon="@android:drawable/ic_menu_close_clear_cancel"
          android:orderInCategory="1" />
      <item
    <string name="filedetails_created">انشئ في :</string>
    <string name="filedetails_modified">عُدل في :</string>
    <string name="filedetails_download">تحميل</string>
-   <string name="filedetails_sync_file">تحديث الملف</string>
    <string name="filedetails_renamed_in_upload_msg">تم تغيير اسم الملف إلى  %1$s أثناء الرفع</string>
    <string name="action_share_file">شارك الرابط</string>
    <string name="action_unshare_file">الغاء مشاركة الرابط</string>
    <string name="common_yes">نعم</string>
    <string name="common_no">لا</string>
    <string name="common_ok">تم</string>
-   <string name="common_cancel_download">إلغاء التحميل</string>
-   <string name="common_cancel_upload">إلغاء الرفع</string>
    <string name="common_cancel">إلغاء</string>
    <string name="common_save_exit">حفظ + خروج</string>
    <string name="common_error">خطأ</string>
    <string name="favorite">المفضلة</string>
    <string name="common_rename">إعادة التسمية</string>
    <string name="common_remove">حذف</string>
 -  <string name="confirmation_remove_alert">هل تريد حقاً حذف %1$s ؟</string>
 +  <string name="confirmation_remove_file_alert">هل تريد حقاً حذف %1$s ؟</string>
    <string name="confirmation_remove_folder_alert">هل ترغب في حذف %1$s و جهات الإتصال التابعة له؟ </string>
    <string name="confirmation_remove_local">محليا فقط</string>
    <string name="confirmation_remove_folder_local">محليا فقط</string>
    <string name="filedetails_created">Yaradıldı:</string>
    <string name="filedetails_modified">Dəyişdirildi:</string>
    <string name="filedetails_download">Yüklə</string>
-   <string name="filedetails_sync_file">Faylı yenilə</string>
    <string name="filedetails_renamed_in_upload_msg">Yüklənmə müddətində fayl buna %1$s yeniləndi</string>
    <string name="action_share_file">Linki yayımla</string>
    <string name="action_unshare_file">Link yayımlanmasını dayandır</string>
    <string name="common_yes">Bəli</string>
    <string name="common_no">Xeyir</string>
    <string name="common_ok">Oldu</string>
-   <string name="common_cancel_download">Endirimi dayandır</string>
-   <string name="common_cancel_upload">Yüklənməni dayandır</string>
    <string name="common_cancel">Dayandır</string>
    <string name="common_save_exit">Saxla &amp; Çıx</string>
    <string name="common_error">Səhv</string>
@@@ -184,7 -181,7 +181,7 @@@ Aşağıda göstərilən %5$s-də olan 
    <string name="favorite">İstəkli</string>
    <string name="common_rename">Adı dəyiş</string>
    <string name="common_remove">Sil</string>
 -  <string name="confirmation_remove_alert">Siz həqiqətən %1$s silmək istəyirsiniz?</string>
 +  <string name="confirmation_remove_file_alert">Siz həqiqətən %1$s silmək istəyirsiniz?</string>
    <string name="confirmation_remove_folder_alert">Siz həqiqətəndə %1$s və onun kontentini silmək istəyirsiniz?</string>
    <string name="confirmation_remove_local">Yalnız daxili</string>
    <string name="confirmation_remove_folder_local">Yalnız daxili</string>
@@@ -288,7 -285,6 +285,6 @@@ inzibatçınızla əlaqə saxlayasını
    <string name="prefs_category_instant_uploading">Anında yükləmələr</string>
    <string name="prefs_category_security">Təhlükəsizlik</string>
    <string name="prefs_instant_video_upload_path_title">Video ünvanını yüklə</string>
-   <string name="download_folder_failed_content">Qovluğun endirilməsinin %1$s hissəsi tamamlana bilməz </string>
    <string name="auth_refresh_button">Qoşulmanı yenilə</string>
    <string name="auth_host_address">Server ünvanı</string>
  </resources>
@@@ -78,7 -78,6 +78,6 @@@
    <string name="filedetails_created">Създаден на:</string>
    <string name="filedetails_modified">Променен на:</string>
    <string name="filedetails_download">Изтегляне</string>
-   <string name="filedetails_sync_file">Обновяване на файла</string>
    <string name="filedetails_renamed_in_upload_msg">Файлът беше преименуван на %1$s по време на качването.</string>
    <string name="list_layout">Списък с изгледи</string>
    <string name="action_share_file">Връзка за споделяне</string>
@@@ -86,8 -85,6 +85,6 @@@
    <string name="common_yes">Да</string>
    <string name="common_no">Не</string>
    <string name="common_ok">ОК</string>
-   <string name="common_cancel_download">Отказване на тегленето</string>
-   <string name="common_cancel_upload">Отказване на качването</string>
    <string name="common_cancel">Отказ</string>
    <string name="common_save_exit">Запазване и изход</string>
    <string name="common_error">Грешка</string>
    <string name="favorite">Любими</string>
    <string name="common_rename">Преименуване</string>
    <string name="common_remove">Премахване</string>
 -  <string name="confirmation_remove_alert">Наистина ли искате да изтриете %1$s ?</string>
 +  <string name="confirmation_remove_file_alert">Наистина ли искате да изтриете %1$s ?</string>
    <string name="confirmation_remove_folder_alert">Наистина ли искате да премахнете %1$s и съдържанието му?</string>
    <string name="confirmation_remove_local">Само локално</string>
    <string name="confirmation_remove_folder_local">Само локално</string>
    <string name="prefs_category_instant_uploading">Незабавно качване</string>
    <string name="prefs_category_security">Сигурност</string>
    <string name="prefs_instant_video_upload_path_title">Качване на видео път</string>
-   <string name="download_folder_failed_content">Свалянето на директорията %1$s не може да бъде завършено</string>
    <string name="shared_subject_header">споделен</string>
    <string name="with_you_subject_header">с теб</string>
    <string name="subject_token">%1$s споделен \"%2$s\" с теб</string>
    <string name="filedetails_created">তৈরীর নির্ঘন্টঃ</string>
    <string name="filedetails_modified">পরিবর্তিতঃ</string>
    <string name="filedetails_download">ডাউনলোড</string>
-   <string name="filedetails_sync_file">ফাইল নবোদ্যম করুন</string>
    <string name="filedetails_renamed_in_upload_msg">আপলোডের সময় ফাইলের পূণঃনামকরণ করা হয়েছে %1$s</string>
    <string name="action_share_file">লিংক ভাগাভাগি করেন</string>
    <string name="action_unshare_file">লিংক ছিনন করেন</string>
    <string name="common_yes">হ্যাঁ</string>
    <string name="common_no">না</string>
    <string name="common_ok">তথাস্তু</string>
-   <string name="common_cancel_download">ডাউনলোড বাতিল করেন</string>
-   <string name="common_cancel_upload">আপলোড বাতিল কর</string>
    <string name="common_cancel">বাতিল</string>
    <string name="common_save_exit">সংরক্ষণ কর এবং &amp;প্রস্থান</string>
    <string name="common_error">সমস্যা</string>
    <string name="favorite">প্রিয়জন</string>
    <string name="common_rename">পূনঃনামকরণ</string>
    <string name="common_remove">অপসারণ</string>
 -  <string name="confirmation_remove_alert">আপনি কি সত্যিই %1$s অপসারণ করতে চান?</string>
 +  <string name="confirmation_remove_file_alert">আপনি কি সত্যিই %1$s অপসারণ করতে চান?</string>
    <string name="confirmation_remove_folder_alert">আপনি কি সত্যিই %1$s এবং এর কনটেন্ট অপসারণ করতে চান?</string>
    <string name="confirmation_remove_local">শুধুমাত্র লোকাল</string>
    <string name="confirmation_remove_folder_local">শুধুমাত্র লোকাল</string>
    <string name="filedetails_created">Creat:</string>
    <string name="filedetails_modified">Modificat:</string>
    <string name="filedetails_download">Baixa</string>
-   <string name="filedetails_sync_file">Actualitza el fitxer</string>
    <string name="filedetails_renamed_in_upload_msg">L\'arxiu s\'ha canviat de nom a %1$s durant la càrrega</string>
    <string name="action_share_file">Enllaç de compartició</string>
    <string name="action_unshare_file">Deixa de compartir l\'enllaç</string>
    <string name="common_yes">Sí</string>
    <string name="common_no">No</string>
    <string name="common_ok">D\'acord</string>
-   <string name="common_cancel_download">Cancelar la descàrrega</string>
-   <string name="common_cancel_upload">Cancel·la la pujada</string>
    <string name="common_cancel">Cancel·la</string>
    <string name="common_save_exit">Desa &amp; Surt</string>
    <string name="common_error">Error</string>
    <string name="favorite">Preferits</string>
    <string name="common_rename">Reanomena</string>
    <string name="common_remove">Elimina</string>
 -  <string name="confirmation_remove_alert">Esteu segur que voleu eliminar %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Esteu segur que voleu eliminar %1$s?</string>
    <string name="confirmation_remove_folder_alert">Estàs segur que vols esborrar %1$s i els seus continguts?</string>
    <string name="confirmation_remove_local">Només local</string>
    <string name="confirmation_remove_folder_local">Només local</string>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">Vytvořen:</string>
    <string name="filedetails_modified">Upraven:</string>
    <string name="filedetails_download">Stáhnout</string>
-   <string name="filedetails_sync_file">Obnovit soubor</string>
    <string name="filedetails_renamed_in_upload_msg">Soubor byl v průběhu odesílání přejmenován na %1$s</string>
    <string name="list_layout">Náhled seznamu</string>
    <string name="action_share_file">Sdílet odkaz</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">Ano</string>
    <string name="common_no">Ne</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Zrušit stahování</string>
-   <string name="common_cancel_upload">Zrušit odesílání</string>
    <string name="common_cancel">Zrušit</string>
    <string name="common_save_exit">Uložit a ukončit</string>
    <string name="common_error">Chyba</string>
    <string name="unfavorite">Odebrat z oblíbených</string>
    <string name="common_rename">Přejmenovat</string>
    <string name="common_remove">Odstranit</string>
 -  <string name="confirmation_remove_alert">Opravdu chcete odstranit %1$s ?</string>
 +  <string name="confirmation_remove_file_alert">Opravdu chcete odstranit %1$s ?</string>
    <string name="confirmation_remove_folder_alert">Opravdu chcete odstranit %1$s a jeho obsah?</string>
    <string name="confirmation_remove_local">Pouze místní</string>
    <string name="confirmation_remove_folder_local">Pouze místní</string>
 -  <string name="confirmation_remove_remote">Ze serveru</string>
 +  <string name="confirmation_remove_file_remote">Ze serveru</string>
    <string name="confirmation_remove_remote_and_local">Vzdálený &amp; místní</string>
    <string name="remove_success_msg">Úspěšně odstraněno</string>
    <string name="remove_fail_msg">Odstranění nelze dokončit</string>
@@@ -315,7 -312,6 +312,6 @@@ správce systému.</string
    <string name="prefs_category_instant_uploading">Okamžitá odesílání</string>
    <string name="prefs_category_security">Zabezpečení</string>
    <string name="prefs_instant_video_upload_path_title">Cesta pro nahrávání videí</string>
-   <string name="download_folder_failed_content">Stažení adresáře %1$s nemohlo být dokončeno</string>
    <string name="shared_subject_header">sdílené</string>
    <string name="with_you_subject_header">s vámi</string>
    <string name="subject_token">%1$s s vámi sdílí \"%2$s\"</string>
@@@ -78,7 -78,6 +78,6 @@@
    <string name="filedetails_created">Oprettet:</string>
    <string name="filedetails_modified">Ændret:</string>
    <string name="filedetails_download">Hent</string>
-   <string name="filedetails_sync_file">Genopfrisk fil</string>
    <string name="filedetails_renamed_in_upload_msg">Filen blev omdøbt til %1$s under upload</string>
    <string name="list_layout">Listevisning</string>
    <string name="action_share_file">Del link</string>
@@@ -86,8 -85,6 +85,6 @@@
    <string name="common_yes">Ja</string>
    <string name="common_no">Nej</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Afbryd download</string>
-   <string name="common_cancel_upload">Fortryd upload</string>
    <string name="common_cancel">Annuller</string>
    <string name="common_save_exit">Gem &amp; Afslut</string>
    <string name="common_error">Fejl</string>
    <string name="unfavorite">Fjern markering som foretrukket</string>
    <string name="common_rename">Omdøb</string>
    <string name="common_remove">Fjern</string>
 -  <string name="confirmation_remove_alert">Er du sikker på at du vil fjerne %1$s ?</string>
 +  <string name="confirmation_remove_file_alert">Er du sikker på at du vil fjerne %1$s ?</string>
    <string name="confirmation_remove_folder_alert">Ønsker du virkelig at slette %1$s og dets indhold?</string>
    <string name="confirmation_remove_local">Kun lokal</string>
    <string name="confirmation_remove_folder_local">Kun lokal</string>
 -  <string name="confirmation_remove_remote">Fra server</string>
 +  <string name="confirmation_remove_file_remote">Fra server</string>
    <string name="confirmation_remove_remote_and_local">Fjernbeliggende og lokalt</string>
    <string name="remove_success_msg">Vellykket fjernelse</string>
    <string name="remove_fail_msg">Fjernelse kunne ikke fuldføres</string>
    <string name="prefs_category_instant_uploading">Øjeblikkelige uploads</string>
    <string name="prefs_category_security">Sikkerhed</string>
    <string name="prefs_instant_video_upload_path_title">Sti til videoupload</string>
-   <string name="download_folder_failed_content">Download af %1$s mappe kunne ikke fuldføres</string>
    <string name="shared_subject_header">delt</string>
    <string name="with_you_subject_header">med dig</string>
    <string name="subject_token">%1$s delte \"%2$s\" med dig</string>
@@@ -78,7 -78,6 +78,6 @@@
    <string name="filedetails_created">Erstellt:</string>
    <string name="filedetails_modified">Geändert:</string>
    <string name="filedetails_download">Herunterladen</string>
-   <string name="filedetails_sync_file">Datei aktualisieren</string>
    <string name="filedetails_renamed_in_upload_msg">Datei wurde wärend des Uploads zu %1$s umbenannt</string>
    <string name="list_layout">Listen-Layout</string>
    <string name="action_share_file">Link teilen</string>
@@@ -86,8 -85,6 +85,6 @@@
    <string name="common_yes">Ja</string>
    <string name="common_no">Nein</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Download abbrechen</string>
-   <string name="common_cancel_upload">Upload abbrechen</string>
    <string name="common_cancel">Abbrechen</string>
    <string name="common_save_exit">Speichern &amp; Schließen</string>
    <string name="common_error">Fehler</string>
    <string name="unfavorite">Nicht mehr favorisieren</string>
    <string name="common_rename">Umbenennen</string>
    <string name="common_remove">Löschen</string>
 -  <string name="confirmation_remove_alert">Möchten Sie %1$s wirklich löschen?</string>
 +  <string name="confirmation_remove_file_alert">Möchten Sie %1$s wirklich löschen?</string>
    <string name="confirmation_remove_folder_alert">Möchten Sie wirklich %1$s und dessen Inhalte entfernen?</string>
    <string name="confirmation_remove_local">Nur lokal</string>
    <string name="confirmation_remove_folder_local">Nur lokal</string>
    <string name="prefs_category_instant_uploading">Sofortiges Hochladen</string>
    <string name="prefs_category_security">Sicherheit</string>
    <string name="prefs_instant_video_upload_path_title">Verzeichnis zum Hochladen der Videos</string>
-   <string name="download_folder_failed_content">Herunterladen des %1$s - Ordners konnte nicht abgeschlossen werden</string>
    <string name="shared_subject_header">geteilt</string>
    <string name="with_you_subject_header">Mit Ihnen</string>
    <string name="subject_token">%1$s hat \"%2$s\" mit Ihnen geteilt</string>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">Erstellt:</string>
    <string name="filedetails_modified">Geändert:</string>
    <string name="filedetails_download">Herunterladen</string>
-   <string name="filedetails_sync_file">Datei aktualisieren</string>
    <string name="filedetails_renamed_in_upload_msg">Datei wurde wärend des Uploads zu %1$s umbenannt</string>
    <string name="list_layout">Listen-Layout</string>
    <string name="action_share_file">Link teilen</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">Ja</string>
    <string name="common_no">Nein</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Download abbrechen</string>
-   <string name="common_cancel_upload">Upload abbrechen</string>
    <string name="common_cancel">Abbrechen</string>
    <string name="common_save_exit">Speichern &amp; schließen</string>
    <string name="common_error">Fehler</string>
    <string name="unfavorite">Favorit entfernen</string>
    <string name="common_rename">Umbenennen</string>
    <string name="common_remove">Löschen</string>
 -  <string name="confirmation_remove_alert">Möchtest Du %1$s wirklich löschen?</string>
 +  <string name="confirmation_remove_file_alert">Möchtest Du %1$s wirklich löschen?</string>
    <string name="confirmation_remove_folder_alert">Möchtest Du wirklich %1$s und dessen Inhalte entfernen?</string>
    <string name="confirmation_remove_local">Nur lokal</string>
    <string name="confirmation_remove_folder_local">Nur lokal</string>
    <string name="prefs_category_instant_uploading">Sofortiges Hochladen</string>
    <string name="prefs_category_security">Sicherheit</string>
    <string name="prefs_instant_video_upload_path_title">Verzeichnis zum Hochladen der Videos</string>
-   <string name="download_folder_failed_content">Herunterladen des %1$s - Ordners konnte nicht abgeschlossen werden</string>
    <string name="shared_subject_header">geteilt</string>
    <string name="with_you_subject_header">Mit Dir</string>
    <string name="subject_token">%1$s hat \"%2$s\" mit Dir geteilt</string>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">Δημιουργήθηκε:</string>
    <string name="filedetails_modified">Τροποποιήθηκε:</string>
    <string name="filedetails_download">Λήψη</string>
-   <string name="filedetails_sync_file">Ανανέωση αρχείου</string>
    <string name="filedetails_renamed_in_upload_msg">Το αρχείο μετονομάστηκε σε %1$s κατά τη μεταφόρτωση</string>
    <string name="list_layout">Διάταξη Λίστας</string>
    <string name="action_share_file">Διαμοιρασμός συνδέσμου</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">Ναι</string>
    <string name="common_no">Όχι</string>
    <string name="common_ok">ΟΚ</string>
-   <string name="common_cancel_download">Ακύρωση λήψης</string>
-   <string name="common_cancel_upload">Ακύρωση μεταφόρτωσης</string>
    <string name="common_cancel">Άκυρο</string>
    <string name="common_save_exit">Αποθήκευση &amp; Έξοδος</string>
    <string name="common_error">Σφάλμα</string>
    <string name="unfavorite">Κατάργηση από τα αγαπημένα</string>
    <string name="common_rename">Μετονομασία</string>
    <string name="common_remove">Αφαίρεση</string>
 -  <string name="confirmation_remove_alert">Θέλετε στ\' αλήθεια να αφαιρέσετε το  %1$s;</string>
 +  <string name="confirmation_remove_file_alert">Θέλετε στ\' αλήθεια να αφαιρέσετε το  %1$s;</string>
    <string name="confirmation_remove_folder_alert">Θέλετε στ\' αλήθεια να διαγράψετε το %1$s και τα περιεχόμενά του;</string>
    <string name="confirmation_remove_local">Μόνο τοπικά</string>
    <string name="confirmation_remove_folder_local">Μόνο τοπικά</string>
 -  <string name="confirmation_remove_remote">Από το διακομιστή</string>
 +  <string name="confirmation_remove_file_remote">Από το διακομιστή</string>
    <string name="confirmation_remove_remote_and_local">Απομακρυσμένα &amp; τοπικά</string>
    <string name="remove_success_msg">Αφαίρεση επιτυχής</string>
    <string name="remove_fail_msg">Η αφαίρεση απέτυχε</string>
    <string name="prefs_category_instant_uploading">Στιγμιαίες Μεταφορτώσεις</string>
    <string name="prefs_category_security">Ασφάλεια</string>
    <string name="prefs_instant_video_upload_path_title">Διαδρομή Μεταφόρτωσης Βίντεο</string>
-   <string name="download_folder_failed_content">Η λήψη του φακέλου %1$s δεν ολοκληρώθηκε με επιτυχία.</string>
    <string name="shared_subject_header">διαμοιρασμένα</string>
    <string name="with_you_subject_header">με εσάς</string>
    <string name="subject_token">Ο %1$s διαμοιράστηκε το \"%2$s\" με εσάς</string>
    <string name="filedetails_created">Created:</string>
    <string name="filedetails_modified">Modified:</string>
    <string name="filedetails_download">Download</string>
-   <string name="filedetails_sync_file">Refresh file</string>
    <string name="filedetails_renamed_in_upload_msg">File was renamed to %1$s during upload</string>
    <string name="action_share_file">Share link</string>
    <string name="action_unshare_file">Unshare link</string>
    <string name="common_yes">Yes</string>
    <string name="common_no">No</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Cancel download</string>
-   <string name="common_cancel_upload">Cancel upload</string>
    <string name="common_cancel">Cancel</string>
    <string name="common_save_exit">Save &amp; Exit</string>
    <string name="common_error">Error</string>
    <string name="unfavorite">Unfavourite</string>
    <string name="common_rename">Rename</string>
    <string name="common_remove">Remove</string>
 -  <string name="confirmation_remove_alert">Do you really want to remove %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Do you really want to remove %1$s?</string>
    <string name="confirmation_remove_folder_alert">Do you really want to remove %1$s and its contents?</string>
    <string name="confirmation_remove_local">Local only</string>
    <string name="confirmation_remove_folder_local">Local only</string>
    <string name="prefs_category_instant_uploading">Instant Uploads</string>
    <string name="prefs_category_security">Security</string>
    <string name="prefs_instant_video_upload_path_title">Upload Video Path</string>
-   <string name="download_folder_failed_content">Download of %1$s folder could not be completed</string>
    <string name="auth_refresh_button">Refresh connection</string>
    <string name="auth_host_address">Server address</string>
    <string name="common_error_out_memory">Not enough memory</string>
@@@ -53,8 -53,6 +53,6 @@@
    <string name="common_yes">Jes</string>
    <string name="common_no">Ne</string>
    <string name="common_ok">Akcepti</string>
-   <string name="common_cancel_download">Nuligi elŝuton</string>
-   <string name="common_cancel_upload">Nuligi alŝuton</string>
    <string name="common_cancel">Nuligi</string>
    <string name="common_save_exit">Konservi kaj forlasi</string>
    <string name="common_error">Eraro</string>
    <string name="unfavorite">Nefavoratigi</string>
    <string name="common_rename">Alinomigi</string>
    <string name="common_remove">Forigi</string>
 -  <string name="confirmation_remove_alert">Ĉu vi vere volas forigi %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Ĉu vi vere volas forigi %1$s?</string>
    <string name="confirmation_remove_folder_alert">Ĉu vi vere volas forigi %1$s kaj ĝia enhavo?</string>
    <string name="confirmation_remove_local">Nur loka</string>
    <string name="confirmation_remove_folder_local">Nur loka</string>
    <string name="filedetails_created">Creado:</string>
    <string name="filedetails_modified">Modificado:</string>
    <string name="filedetails_download">Descargar</string>
-   <string name="filedetails_sync_file">Actualizar archivo</string>
    <string name="filedetails_renamed_in_upload_msg">El archivo fue renombrado como %1$s durante la subida</string>
    <string name="action_share_file">Compartir vínculo</string>
    <string name="action_unshare_file">Dejar de compartir vínculo</string>
    <string name="common_yes">Sí</string>
    <string name="common_no">No</string>
    <string name="common_ok">Aceptar</string>
-   <string name="common_cancel_download">Cancelar descarga</string>
-   <string name="common_cancel_upload">Cancelar subida</string>
    <string name="common_cancel">Cancelar</string>
    <string name="common_save_exit">Guardar y salir</string>
    <string name="common_error">Error</string>
    <string name="favorite">Favorito</string>
    <string name="common_rename">Renombrar</string>
    <string name="common_remove">Borrar</string>
 -  <string name="confirmation_remove_alert">¿Realmente quieres eliminar %1$s?</string>
 +  <string name="confirmation_remove_file_alert">¿Realmente quieres eliminar %1$s?</string>
    <string name="confirmation_remove_folder_alert">¿Realmente deseas eliminar %1$s y todo su contenido?</string>
    <string name="confirmation_remove_local">Sólo local</string>
    <string name="confirmation_remove_folder_local">Sólo local</string>
    <string name="prefs_category_instant_uploading">Subida Instantánea </string>
    <string name="prefs_category_security">Seguridad</string>
    <string name="prefs_instant_video_upload_path_title">Dirección de subida del video</string>
-   <string name="download_folder_failed_content">La descarga de la carpeta %1$s no pudo ser completada</string>
    <string name="auth_host_address">Dirección del servidor</string>
  </resources>
    <string name="filedetails_created">Creado:</string>
    <string name="filedetails_modified">Modificado:</string>
    <string name="filedetails_download">Descargar</string>
-   <string name="filedetails_sync_file">refrescar archivo</string>
    <string name="filedetails_renamed_in_upload_msg">El archivo fue renombrado a %1$s durante la subida</string>
    <string name="common_yes">Si</string>
    <string name="common_no">No</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">cancelar bajada</string>
-   <string name="common_cancel_upload">cancelar subida</string>
    <string name="common_cancel">Cancelar</string>
    <string name="common_save_exit">Guardar&amp;Salir</string>
    <string name="common_error">Error</string>
    <string name="auth_unauthorized">usuario o clave incorrecta</string>
    <string name="common_rename">Renombrar</string>
    <string name="common_remove">Remover</string>
 -  <string name="confirmation_remove_alert">¿Realmente desea eliminar %1$s?</string>
 +  <string name="confirmation_remove_file_alert">¿Realmente desea eliminar %1$s?</string>
    <string name="confirmation_remove_folder_alert">¿Realmente desea eliminar el archivo %1$s y su contenido?</string>
    <string name="confirmation_remove_local">Solo local</string>
    <string name="confirmation_remove_folder_local">Solo local</string>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">Creado:</string>
    <string name="filedetails_modified">Modificado:</string>
    <string name="filedetails_download">Descargar</string>
-   <string name="filedetails_sync_file">Actualizar archivo</string>
    <string name="filedetails_renamed_in_upload_msg">El fichero fue renombrado como %1$s durante la subida</string>
    <string name="list_layout">Diseño de lista</string>
    <string name="action_share_file">Compartir con enlace</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">Sí</string>
    <string name="common_no">No</string>
    <string name="common_ok">Aceptar</string>
-   <string name="common_cancel_download">Cancelar descarga</string>
-   <string name="common_cancel_upload">Cancelar subida</string>
    <string name="common_cancel">Cancelar</string>
    <string name="common_save_exit">Guardar &amp; Salir</string>
    <string name="common_error">Error</string>
    <string name="unfavorite">No-favorito</string>
    <string name="common_rename">Renombrar</string>
    <string name="common_remove">Borrar</string>
 -  <string name="confirmation_remove_alert">¿Realmente desea eliminar %1$s?</string>
 +  <string name="confirmation_remove_file_alert">¿Realmente desea eliminar %1$s?</string>
    <string name="confirmation_remove_folder_alert">¿Realmente desea eliminar %1$s y todo su contenido?</string>
    <string name="confirmation_remove_local">Sólo local</string>
    <string name="confirmation_remove_folder_local">Sólo local</string>
 -  <string name="confirmation_remove_remote">Desde el servidor</string>
 +  <string name="confirmation_remove_file_remote">Desde el servidor</string>
    <string name="confirmation_remove_remote_and_local">Remoto &amp; local</string>
    <string name="remove_success_msg">Borrado correctamente</string>
    <string name="remove_fail_msg">El borrado no pudo ser completado</string>
    <string name="prefs_category_instant_uploading">Subidas instantáneas</string>
    <string name="prefs_category_security">Seguridad</string>
    <string name="prefs_instant_video_upload_path_title">Guardar videos subidos en la carpeta:</string>
-   <string name="download_folder_failed_content">La descarga de la carpeta %1$s no ha podido ser completada</string>
    <string name="shared_subject_header">compartido</string>
    <string name="with_you_subject_header">con usted</string>
    <string name="subject_token">%1$s compartió \"%2$s\" conmigo</string>
@@@ -78,7 -78,6 +78,6 @@@
    <string name="filedetails_created">Loodud:</string>
    <string name="filedetails_modified">Muudetud:</string>
    <string name="filedetails_download">Lae alla</string>
-   <string name="filedetails_sync_file">Värskenda faili</string>
    <string name="filedetails_renamed_in_upload_msg">Fail nimetati üleslaadimise käigus ümber %1$ </string>
    <string name="list_layout">Nimekirja paigutus</string>
    <string name="action_share_file">Jaga linki</string>
@@@ -86,8 -85,6 +85,6 @@@
    <string name="common_yes">Jah</string>
    <string name="common_no">Ei</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Tühista allalaadimine</string>
-   <string name="common_cancel_upload">Tühista üleslaadimine</string>
    <string name="common_cancel">Loobu</string>
    <string name="common_save_exit">Salvesta &amp; Välju</string>
    <string name="common_error">Viga</string>
@@@ -202,11 -199,11 +199,11 @@@ Allpool on loend kohalikest failidest n
    <string name="unfavorite">Eemalda lemmik</string>
    <string name="common_rename">Nimeta ümber</string>
    <string name="common_remove">Eemalda</string>
 -  <string name="confirmation_remove_alert">Oled sa kindel, et soovid %1$s eemaldada?</string>
 +  <string name="confirmation_remove_file_alert">Oled sa kindel, et soovid %1$s eemaldada?</string>
    <string name="confirmation_remove_folder_alert">Kas sa tõesti soovid eemaldada %1$s ja selle sisu?</string>
    <string name="confirmation_remove_local">Ainult kohalik</string>
    <string name="confirmation_remove_folder_local">Ainult kohalik</string>
 -  <string name="confirmation_remove_remote">Serverist</string>
 +  <string name="confirmation_remove_file_remote">Serverist</string>
    <string name="confirmation_remove_remote_and_local">Kaugfail &amp; kohalik</string>
    <string name="remove_success_msg">Eemaldamine oli edukas</string>
    <string name="remove_fail_msg">Eemaldamine ebaõnnestus</string>
    <string name="prefs_category_instant_uploading">Kohesed üleslaadimised</string>
    <string name="prefs_category_security">Turvalisus</string>
    <string name="prefs_instant_video_upload_path_title">Video üleslaadimise asukoht</string>
-   <string name="download_folder_failed_content">Kausta %1$s  allalaadimine ei õnnestunud</string>
    <string name="shared_subject_header">jagatud</string>
    <string name="with_you_subject_header">sinuga</string>
    <string name="subject_token">%1$s jagas sinuga \"%2$s\"</string>
    <string name="filedetails_created">Sortuta:</string>
    <string name="filedetails_modified">Aldatuta:</string>
    <string name="filedetails_download">Deskargatu</string>
-   <string name="filedetails_sync_file">Freskatu fitxaegia</string>
    <string name="filedetails_renamed_in_upload_msg">Fitxategiaren izena %1$sra aldatu da igotzean</string>
    <string name="action_share_file">Elkarbanatu lotura</string>
    <string name="action_unshare_file">Lotura partekatzeari utzi</string>
    <string name="common_yes">Bai</string>
    <string name="common_no">Ez</string>
    <string name="common_ok">Ados</string>
-   <string name="common_cancel_download">Utzi deskarga bertan behera </string>
-   <string name="common_cancel_upload">Ezeztatu igoera</string>
    <string name="common_cancel">Ezeztatu</string>
    <string name="common_save_exit">Gorde eta Irten</string>
    <string name="common_error">Errorea</string>
@@@ -177,7 -174,7 +174,7 @@@ Mesedez, baimendu berriz</string
    <string name="favorite">Gogokoa</string>
    <string name="common_rename">Berrizendatu</string>
    <string name="common_remove">Ezabatu</string>
 -  <string name="confirmation_remove_alert">Ziur zaude %1$s ezabatu nahi duzula?</string>
 +  <string name="confirmation_remove_file_alert">Ziur zaude %1$s ezabatu nahi duzula?</string>
    <string name="confirmation_remove_folder_alert">Ziru zaude %1$s eta bere edukiak ezabatu nahi dituzula?</string>
    <string name="confirmation_remove_local">Bertakoa bakarrik</string>
    <string name="confirmation_remove_folder_local">Bertakoa bakarrik</string>
    <string name="prefs_category_instant_uploading">Berehalako Igoerak</string>
    <string name="prefs_category_security">Segurtasuna</string>
    <string name="prefs_instant_video_upload_path_title">Bideo Igoera Bidea</string>
-   <string name="download_folder_failed_content">%1$s karpetaren deskarga ezin izan da burutu</string>
    <string name="auth_host_address">Zerbitzariaren helbidea</string>
  </resources>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">Luotu:</string>
    <string name="filedetails_modified">Muokattu:</string>
    <string name="filedetails_download">Lataa</string>
-   <string name="filedetails_sync_file">Päivitä tiedosto</string>
    <string name="filedetails_renamed_in_upload_msg">Tiedoston nimeksi muutettiin %1$s siirron yhteydessä</string>
    <string name="list_layout">Luettelon asettelu</string>
    <string name="action_share_file">Jaa linkki</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">Kyllä</string>
    <string name="common_no">Ei</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Peru lataus</string>
-   <string name="common_cancel_upload">Peru lähetys</string>
    <string name="common_cancel">Peru</string>
    <string name="common_save_exit">Tallenna ja poistu</string>
    <string name="common_error">Virhe</string>
    <string name="unfavorite">Poista suosikeista</string>
    <string name="common_rename">Nimeä uudelleen</string>
    <string name="common_remove">Poista</string>
 -  <string name="confirmation_remove_alert">Haluatko varmasti poistaa kohteen %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Haluatko varmasti poistaa kohteen %1$s?</string>
    <string name="confirmation_remove_folder_alert">Haluatko varmasti poistaa kohteen %1$s ja sen sisällön?</string>
    <string name="confirmation_remove_local">Vain paikallinen</string>
    <string name="confirmation_remove_folder_local">Vain paikallinen</string>
 -  <string name="confirmation_remove_remote">Palvelimelta</string>
 +  <string name="confirmation_remove_file_remote">Palvelimelta</string>
    <string name="confirmation_remove_remote_and_local">Etä ja paikallinen</string>
    <string name="remove_success_msg">Poistettu onnistuneesti</string>
    <string name="remove_fail_msg">Poistamista ei voitu suorittaa loppuun asti</string>
@@@ -80,7 -80,6 +80,6 @@@ Téléchargez-le ici : %2$s</string
    <string name="filedetails_created">Créé le :</string>
    <string name="filedetails_modified">Modifié le :</string>
    <string name="filedetails_download">Télécharger</string>
-   <string name="filedetails_sync_file">Actualiser le fichier</string>
    <string name="filedetails_renamed_in_upload_msg">Le fichier a été renommé en %s pendant le téléversement</string>
    <string name="list_layout">Affichage en liste</string>
    <string name="action_share_file">Partager le lien</string>
@@@ -88,8 -87,6 +87,6 @@@
    <string name="common_yes">Oui</string>
    <string name="common_no">Non</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Annuler le téléchargement</string>
-   <string name="common_cancel_upload">Annuler le téléversement</string>
    <string name="common_cancel">Annuler</string>
    <string name="common_save_exit">Sauvegarder &amp; Quitter</string>
    <string name="common_error">Erreur</string>
@@@ -204,11 -201,11 +201,11 @@@ Ci-dessous la liste des fichiers locaux
    <string name="unfavorite">Retirer des favoris</string>
    <string name="common_rename">Renommer</string>
    <string name="common_remove">Supprimer</string>
 -  <string name="confirmation_remove_alert">Voulez-vous vraiment supprimer %1$s ?</string>
 +  <string name="confirmation_remove_file_alert">Voulez-vous vraiment supprimer %1$s ?</string>
    <string name="confirmation_remove_folder_alert">Voulez-vous vraiment supprimer %1$s et son contenu ?</string>
    <string name="confirmation_remove_local">Local seulement</string>
    <string name="confirmation_remove_folder_local">Local seulement</string>
 -  <string name="confirmation_remove_remote">Depuis le serveur</string>
 +  <string name="confirmation_remove_file_remote">Depuis le serveur</string>
    <string name="confirmation_remove_remote_and_local">Distant &amp; local</string>
    <string name="remove_success_msg">Suppression effectuée avec succès</string>
    <string name="remove_fail_msg">Suppression impossible</string>
    <string name="prefs_category_instant_uploading">Téléversement immédiat</string>
    <string name="prefs_category_security">Sécurité</string>
    <string name="prefs_instant_video_upload_path_title">Répertoire de téléversement des vidéos</string>
-   <string name="download_folder_failed_content">Le téléchargement du dossier %1$s n\'a pas pu être achevé</string>
    <string name="shared_subject_header">a partagé</string>
    <string name="with_you_subject_header">avec vous</string>
    <string name="subject_token">%1$s a partagé \"%2$s\" avec vous</string>
@@@ -79,7 -79,6 +79,6 @@@ Descárgueo de aquí: %2$s</string
    <string name="filedetails_created">Creado:</string>
    <string name="filedetails_modified">Modificado:</string>
    <string name="filedetails_download">Descargar</string>
-   <string name="filedetails_sync_file">Actualizar o ficheiro</string>
    <string name="filedetails_renamed_in_upload_msg">O ficheiro foi renomeado a %1$s durante o envío</string>
    <string name="list_layout">Deseño da lista</string>
    <string name="action_share_file">Ligazón para compartir</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">Si</string>
    <string name="common_no">Non</string>
    <string name="common_ok">Aceptar</string>
-   <string name="common_cancel_download">Cancelar a descarga</string>
-   <string name="common_cancel_upload">Cancelar o envío</string>
    <string name="common_cancel">Cancelar</string>
    <string name="common_save_exit">Gardar e saír</string>
    <string name="common_error">Erro</string>
    <string name="unfavorite">Retirar de favoritos</string>
    <string name="common_rename">Renomear</string>
    <string name="common_remove">Retirar</string>
 -  <string name="confirmation_remove_alert">Confirma que quere retirar %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Confirma que quere retirar %1$s?</string>
    <string name="confirmation_remove_folder_alert">Confirma que quere retirar %1$s e o seu contido?</string>
    <string name="confirmation_remove_local">Só local</string>
    <string name="confirmation_remove_folder_local">Só local</string>
    <string name="prefs_category_instant_uploading">Envío instantáneo</string>
    <string name="prefs_category_security">Seguridade</string>
    <string name="prefs_instant_video_upload_path_title">Enviar a ruta do vídeo</string>
-   <string name="download_folder_failed_content">Non foi posíbel completar a descarga do cartafol %1$s</string>
    <string name="shared_subject_header">compartido</string>
    <string name="with_you_subject_header">con vostede</string>
    <string name="subject_token">%1$s compartiu «%2$s» con vostede</string>
    <string name="filedetails_created">מועד היצירה:</string>
    <string name="filedetails_modified">מועד השינוי:</string>
    <string name="filedetails_download">הורדה</string>
-   <string name="filedetails_sync_file">רענון קובץ</string>
    <string name="filedetails_renamed_in_upload_msg">שם הקובץ השתנה ל־ %1$s במהלך ההעלאה</string>
    <string name="action_share_file">קישור לשיתוף</string>
    <string name="action_unshare_file">ביטול קישור לשיתוף</string>
    <string name="common_yes">כן</string>
    <string name="common_no">לא</string>
    <string name="common_ok">אישור</string>
-   <string name="common_cancel_download">ביטול ההורדה</string>
-   <string name="common_cancel_upload">ביטול ההעלאה</string>
    <string name="common_cancel">ביטול</string>
    <string name="common_save_exit">לשמור ולצאת</string>
    <string name="common_error">שגיאה</string>
    <string name="favorite">מועדף</string>
    <string name="common_rename">שינוי שם</string>
    <string name="common_remove">הסרה</string>
 -  <string name="confirmation_remove_alert">האם באמת להסיר %1$s?</string>
 +  <string name="confirmation_remove_file_alert">האם באמת להסיר %1$s?</string>
    <string name="confirmation_remove_folder_alert">האם באמת להסיר %1$s ואת כל התכולה?</string>
    <string name="confirmation_remove_local">מקומי בלבד</string>
    <string name="confirmation_remove_folder_local">מקומי בלבד</string>
    <string name="filedetails_created">Készült:</string>
    <string name="filedetails_modified">Módosítva:</string>
    <string name="filedetails_download">Letöltés</string>
-   <string name="filedetails_sync_file">File frissítése</string>
    <string name="filedetails_renamed_in_upload_msg">A feltöltés során az állmányt erre neveztük át: %1$s</string>
    <string name="action_share_file">Megosztás hivatkozással</string>
    <string name="action_unshare_file">Megosztás visszavonása</string>
    <string name="common_yes">Igen</string>
    <string name="common_no">Nem</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">A letöltés megszakítása</string>
-   <string name="common_cancel_upload">A feltöltés megszakítása</string>
    <string name="common_cancel">Mégsem</string>
    <string name="common_save_exit">Mentés &amp; Kilépés</string>
    <string name="common_error">Hiba</string>
    <string name="unfavorite">Nem kedvenc</string>
    <string name="common_rename">Átnevezés</string>
    <string name="common_remove">Eltávolítás</string>
 -  <string name="confirmation_remove_alert">Tényleg el akarod távolítani %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Tényleg el akarod távolítani %1$s?</string>
    <string name="confirmation_remove_folder_alert">Tényleg el akarod távolítani a %1$s és tartalmát?</string>
    <string name="confirmation_remove_local">Csak a helyi példány</string>
    <string name="confirmation_remove_folder_local">Csak a helyi példány</string>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">Dibuat:</string>
    <string name="filedetails_modified">Diubah:</string>
    <string name="filedetails_download">Unduh</string>
-   <string name="filedetails_sync_file">Segarkan berkas</string>
    <string name="filedetails_renamed_in_upload_msg">Berkas diubah namanya menjadi %1$s saat pengunggahan</string>
    <string name="list_layout">Daftar Tata Letak</string>
    <string name="action_share_file">Bagikan tautan</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">Ya</string>
    <string name="common_no">Tidak</string>
    <string name="common_ok">Oke</string>
-   <string name="common_cancel_download">Batal mengunduh</string>
-   <string name="common_cancel_upload">Batal mengunggah</string>
    <string name="common_cancel">Batal</string>
    <string name="common_save_exit">Simpan &amp; Keluar</string>
    <string name="common_error">Kesalahan</string>
    <string name="unfavorite">Hapus favorit</string>
    <string name="common_rename">Ubah nama</string>
    <string name="common_remove">Hapus</string>
 -  <string name="confirmation_remove_alert">Apakah Anda yakin ingin menghapus %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Apakah Anda yakin ingin menghapus %1$s?</string>
    <string name="confirmation_remove_folder_alert">Apakah Anda yakin ingin menghapus %1$s dan isinya?</string>
    <string name="confirmation_remove_local">Lokal saja</string>
    <string name="confirmation_remove_folder_local">Lokal saja</string>
 -  <string name="confirmation_remove_remote">Dari server</string>
 +  <string name="confirmation_remove_file_remote">Dari server</string>
    <string name="confirmation_remove_remote_and_local">Remot &amp; lokal</string>
    <string name="remove_success_msg">Penghapusan berhasil</string>
    <string name="remove_fail_msg">Penghapusan gagal</string>
    <string name="prefs_category_instant_uploading">Unggah Cepat</string>
    <string name="prefs_category_security">Keamanan</string>
    <string name="prefs_instant_video_upload_path_title">Unggah Lokasi Video</string>
-   <string name="download_folder_failed_content">Mengunduh folder %1$s  tidak selesai</string>
    <string name="shared_subject_header">dibagikan</string>
    <string name="with_you_subject_header">kepada Anda</string>
    <string name="subject_token">%1$s dibagikan \"%2$s\" kepada Anda</string>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">Creato:</string>
    <string name="filedetails_modified">Modificato:</string>
    <string name="filedetails_download">Scarica</string>
-   <string name="filedetails_sync_file">Aggiorna file</string>
    <string name="filedetails_renamed_in_upload_msg">Il file è stato rinominato in %1$s durante il caricamento</string>
    <string name="list_layout">Struttura elenco</string>
    <string name="action_share_file">Condividi collegamento</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">Sì</string>
    <string name="common_no">No</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Annulla lo scaricamento</string>
-   <string name="common_cancel_upload">Annulla caricamento</string>
    <string name="common_cancel">Annulla</string>
    <string name="common_save_exit">Salva ed esci</string>
    <string name="common_error">Errore</string>
    <string name="unfavorite">Rimuovi dai preferiti</string>
    <string name="common_rename">Rinomina</string>
    <string name="common_remove">Rimuovi</string>
 -  <string name="confirmation_remove_alert">Vuoi davvero rimuovere %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Vuoi davvero rimuovere %1$s?</string>
    <string name="confirmation_remove_folder_alert">Vuoi davvero rimuovere %1$s e il suo contenuto?</string>
    <string name="confirmation_remove_local">Solo localmente</string>
    <string name="confirmation_remove_folder_local">Solo locale</string>
 -  <string name="confirmation_remove_remote">Dal server</string>
 +  <string name="confirmation_remove_file_remote">Dal server</string>
    <string name="confirmation_remove_remote_and_local">Remota e locale</string>
    <string name="remove_success_msg">Rimozione effettuata con successo</string>
    <string name="remove_fail_msg">La rimozione non può essere completata</string>
    <string name="prefs_category_instant_uploading">Caricamenti istantanei</string>
    <string name="prefs_category_security">Protezione</string>
    <string name="prefs_instant_video_upload_path_title">Percorso di caricamento video</string>
-   <string name="download_folder_failed_content">Lo scaricamento della cartella %1$s non può essere completato</string>
    <string name="shared_subject_header">condiviso</string>
    <string name="with_you_subject_header">con te</string>
    <string name="subject_token">%1$s ha condiviso \"%2$s\" con te</string>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">作成:</string>
    <string name="filedetails_modified">更新:</string>
    <string name="filedetails_download">ダウンロード</string>
-   <string name="filedetails_sync_file">ファイルを同期</string>
    <string name="filedetails_renamed_in_upload_msg">アップロード中にファイル名を %1$s に変更しました</string>
    <string name="list_layout">リストレイアウト</string>
    <string name="action_share_file">URLで共有</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">はい</string>
    <string name="common_no">いいえ</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">ダウンロードをキャンセル</string>
-   <string name="common_cancel_upload">アップロードをキャンセル</string>
    <string name="common_cancel">キャンセル</string>
    <string name="common_save_exit">保存して終了</string>
    <string name="common_error">エラー</string>
    <string name="unfavorite">お気に入りを解除</string>
    <string name="common_rename">名前を変更</string>
    <string name="common_remove">削除</string>
 -  <string name="confirmation_remove_alert">本当に %1$s を削除しますか?</string>
 +  <string name="confirmation_remove_file_alert">本当に %1$s を削除しますか?</string>
    <string name="confirmation_remove_folder_alert">本当に %1$s およびそのコンテンツを削除してもよろしいですか?</string>
    <string name="confirmation_remove_local">ローカルのみ</string>
    <string name="confirmation_remove_folder_local">ローカルのみ</string>
    <string name="prefs_category_instant_uploading">自動アップロード</string>
    <string name="prefs_category_security">セキュリティ</string>
    <string name="prefs_instant_video_upload_path_title">動画のアップロードパス</string>
-   <string name="download_folder_failed_content">%1$s フォルダーのダウンロードが完了しませんでした</string>
    <string name="shared_subject_header">共有中</string>
    <string name="with_you_subject_header">あなたと</string>
    <string name="subject_token">%1$s は \"%2$s\" をあなたと共有しました</string>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">만든 날짜:</string>
    <string name="filedetails_modified">수정한 날짜:</string>
    <string name="filedetails_download">다운로드</string>
-   <string name="filedetails_sync_file">파일 새로 고침</string>
    <string name="filedetails_renamed_in_upload_msg">업로드 중 파일 이름을 %1$s(으)로 변경하였습니다</string>
    <string name="list_layout">목록 레이아웃</string>
    <string name="action_share_file">링크 공유</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">예</string>
    <string name="common_no">아니요</string>
    <string name="common_ok">확인</string>
-   <string name="common_cancel_download">다운로드 취소</string>
-   <string name="common_cancel_upload">업로드 취소</string>
    <string name="common_cancel">취소</string>
    <string name="common_save_exit">저장하고 끝내기</string>
    <string name="common_error">오류</string>
    <string name="unfavorite">책갈피 해제</string>
    <string name="common_rename">이름 바꾸기</string>
    <string name="common_remove">삭제</string>
 -  <string name="confirmation_remove_alert">%1$s을(를) 삭제하시겠습니까?</string>
 +  <string name="confirmation_remove_file_alert">%1$s을(를) 삭제하시겠습니까?</string>
    <string name="confirmation_remove_folder_alert">%1$s 및 포함된 내용을 삭제하시겠습니까?</string>
    <string name="confirmation_remove_local">로컬만</string>
    <string name="confirmation_remove_folder_local">로컬만</string>
    <string name="prefs_category_instant_uploading">즉시 업로드</string>
    <string name="prefs_category_security">보안</string>
    <string name="prefs_instant_video_upload_path_title">동영상 업로드 경로</string>
-   <string name="download_folder_failed_content">폴더 %1$s을(를) 다운로드할 수 없음</string>
    <string name="shared_subject_header">공유됨</string>
    <string name="with_you_subject_header">여러분과</string>
    <string name="subject_token">%1$s 님이 \"%2$s\" 항목을 여러분과 공유하였습니다</string>
    <string name="filedetails_created">Erstallt:</string>
    <string name="filedetails_modified">Geännert:</string>
    <string name="filedetails_download">Eroflueden</string>
-   <string name="filedetails_sync_file">Fichier opfrëschen</string>
    <string name="action_share_file">Link deelen</string>
    <string name="common_yes">Jo</string>
    <string name="common_no">Nee</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Eroflueden ofbriechen</string>
-   <string name="common_cancel_upload">Eroplueden ofbriechen</string>
    <string name="common_cancel">Ofbriechen</string>
    <string name="common_save_exit">Späicheren an Zoumaachen</string>
    <string name="common_error">Feeler</string>
    <string name="auth_unsupported_auth_method">De Server ënnerstëtzt dës Authentifizéierungsmethod net</string>
    <string name="common_rename">Ëmbenennen</string>
    <string name="common_remove">Läschen</string>
 -  <string name="confirmation_remove_alert">Wëlls du %1$s wierklech läschen?</string>
 +  <string name="confirmation_remove_file_alert">Wëlls du %1$s wierklech läschen?</string>
    <string name="confirmation_remove_folder_alert">Wëlls du %1$s an de ganzen Inhalt wierklech läschen?</string>
    <string name="confirmation_remove_local">Nemme lokal</string>
    <string name="confirmation_remove_folder_local">Nemme lokal</string>
    <string name="prefs_category_instant_uploading">Direkt eropgeluede Fichieren</string>
    <string name="prefs_category_security">Sécherheet</string>
    <string name="prefs_instant_video_upload_path_title">Pad fir d\'Eropluede vun de Videoen</string>
-   <string name="download_folder_failed_content">D\'Erofluede vum %1$s-Dossier konnt net ofgeschloss ginn</string>
    <string name="auth_refresh_button">Connectioun opfrëschen</string>
    <string name="auth_host_address">Server-Adress</string>
  </resources>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">Sukurta:</string>
    <string name="filedetails_modified">Modifikuota:</string>
    <string name="filedetails_download">Atsisiųsti</string>
-   <string name="filedetails_sync_file">Atnaujinti failą</string>
    <string name="filedetails_renamed_in_upload_msg">Įkėlimo metu failas buvo pervadintas į %1$s</string>
    <string name="list_layout">Sąrašo išdėstymas</string>
    <string name="action_share_file">Dalintis nuoroda</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">Taip</string>
    <string name="common_no">Ne</string>
    <string name="common_ok">Gerai</string>
-   <string name="common_cancel_download">Atšaukti parsiuntimą</string>
-   <string name="common_cancel_upload">Atšaukti siuntimą</string>
    <string name="common_cancel">Atšaukti</string>
    <string name="common_save_exit">Išsaugoti ir Išeiti</string>
    <string name="common_error">Klaida</string>
    <string name="unfavorite">Nebemėgti</string>
    <string name="common_rename">Pervadinti</string>
    <string name="common_remove">Pašalinti</string>
 -  <string name="confirmation_remove_alert">Ar tikrai norite pašalinti %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Ar tikrai norite pašalinti %1$s?</string>
    <string name="confirmation_remove_folder_alert">Ar tikrai norite pašalinti %1$s ir ten esantį turinį?</string>
    <string name="confirmation_remove_local">Tik vietiniai</string>
    <string name="confirmation_remove_folder_local">Tik vietiniai</string>
    <string name="prefs_category_instant_uploading">Momentinis įkėlimas</string>
    <string name="prefs_category_security">Saugumas</string>
    <string name="prefs_instant_video_upload_path_title">Vaizdo įrašų įkėlimo kelias</string>
-   <string name="download_folder_failed_content">Nepavyko baigti %1$s atsiuntimo</string>
    <string name="shared_subject_header">Dalinamasi</string>
    <string name="with_you_subject_header">su jumis</string>
    <string name="subject_token">%1$s dalinamasi \"%2$s\" su jumis</string>
    <string name="filedetails_created">Создадено:</string>
    <string name="filedetails_modified">Изменето:</string>
    <string name="filedetails_download">Преземање</string>
-   <string name="filedetails_sync_file">Освежи ја датотеката</string>
    <string name="filedetails_renamed_in_upload_msg">Датотеката беше преименувана во %1$s за време на префрлањето</string>
    <string name="action_share_file">Сподели ја врската</string>
    <string name="action_unshare_file">Тргнете го споделувањето на врската</string>
    <string name="common_yes">Да</string>
    <string name="common_no">Не</string>
    <string name="common_ok">Во ред</string>
-   <string name="common_cancel_download">Откажи превземање</string>
-   <string name="common_cancel_upload">Откажи прикачување</string>
    <string name="common_cancel">Откажи</string>
    <string name="common_save_exit">Сними &amp; Излез</string>
    <string name="common_error">Грешка</string>
    <string name="auth_account_does_not_exist">Сметката сеуште не постои на овој уред</string>
    <string name="common_rename">Преименувај</string>
    <string name="common_remove">Отстрани</string>
 -  <string name="confirmation_remove_alert">Дали навистина сакаш да ја отстраниш %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Дали навистина сакаш да ја отстраниш %1$s?</string>
    <string name="confirmation_remove_folder_alert">Дали навистина сакаш да го отстранам %1$s и неговата содржина?</string>
    <string name="confirmation_remove_local">Само локално</string>
    <string name="confirmation_remove_folder_local">Само локално</string>
    <string name="prefs_category_instant_uploading">Инстант прикачувања</string>
    <string name="prefs_category_security">Безбедност</string>
    <string name="prefs_instant_video_upload_path_title">Прикачи патека на видео</string>
-   <string name="download_folder_failed_content">Превземањето на папката %1$s не може да се заврши</string>
    <string name="auth_refresh_button">Освежи ја конекцијата</string>
    <string name="auth_host_address">Адреса на сервер</string>
  </resources>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">Opprettet:</string>
    <string name="filedetails_modified">Endret:</string>
    <string name="filedetails_download">Last ned</string>
-   <string name="filedetails_sync_file">Oppdater fil</string>
    <string name="filedetails_renamed_in_upload_msg">Filnavnet ble endret til  %1$s under opplasting</string>
    <string name="list_layout">Listeoppsett</string>
    <string name="action_share_file">Del lenke</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">Ja</string>
    <string name="common_no">Nei</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Avbryt nedlasting</string>
-   <string name="common_cancel_upload">Avbryt opplasting</string>
    <string name="common_cancel">Avbryt</string>
    <string name="common_save_exit">Lagre og avslutt</string>
    <string name="common_error">Feil</string>
    <string name="unfavorite">Fjern favoritt</string>
    <string name="common_rename">Endre navn</string>
    <string name="common_remove">Fjern</string>
 -  <string name="confirmation_remove_alert">Vil du virkelig fjerne %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Vil du virkelig fjerne %1$s?</string>
    <string name="confirmation_remove_folder_alert">Vil du virkelig fjerne %1$s inkludert innholdet?</string>
    <string name="confirmation_remove_local">Kun lokalt</string>
    <string name="confirmation_remove_folder_local">Kun lokalt</string>
 -  <string name="confirmation_remove_remote">Fra server</string>
 +  <string name="confirmation_remove_file_remote">Fra server</string>
    <string name="confirmation_remove_remote_and_local">Ekstern &amp; lokal</string>
    <string name="remove_success_msg">Fjerning var vellykket</string>
    <string name="remove_fail_msg">Fjerning mislyktes</string>
    <string name="prefs_category_instant_uploading">Umiddelbare opplastinger</string>
    <string name="prefs_category_security">Sikkerhet</string>
    <string name="prefs_instant_video_upload_path_title">Sti til video-opplasting</string>
-   <string name="download_folder_failed_content">Nedlasting av %1$s mappen kunne ikke fullføres</string>
    <string name="shared_subject_header">delte</string>
    <string name="with_you_subject_header">med deg</string>
    <string name="subject_token">%1$s delte \"%2$s\" med deg</string>
@@@ -80,7 -80,6 +80,6 @@@ Download hier: %2$s</string
    <string name="filedetails_created">Aangemaakt:</string>
    <string name="filedetails_modified">Aangepast:</string>
    <string name="filedetails_download">Download</string>
-   <string name="filedetails_sync_file">Bestand verversen</string>
    <string name="filedetails_renamed_in_upload_msg">Bestand is tijdens het uploaden hernoemd naar %1$s</string>
    <string name="list_layout">Lijst layout</string>
    <string name="action_share_file">Deel link</string>
@@@ -88,8 -87,6 +87,6 @@@
    <string name="common_yes">Ja</string>
    <string name="common_no">Nee</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Annuleer download</string>
-   <string name="common_cancel_upload">Upload afbreken</string>
    <string name="common_cancel">Annuleren</string>
    <string name="common_save_exit">Opslaan &amp; Afsluiten</string>
    <string name="common_error">Fout</string>
@@@ -202,11 -199,11 +199,11 @@@ Hieronder staan de lokale bestanden en 
    <string name="unfavorite">Niet meer favoriet</string>
    <string name="common_rename">Hernoemen</string>
    <string name="common_remove">Verwijderen</string>
 -  <string name="confirmation_remove_alert">Wilt u %1$s werkelijk verwijderen?</string>
 +  <string name="confirmation_remove_file_alert">Wilt u %1$s werkelijk verwijderen?</string>
    <string name="confirmation_remove_folder_alert">Wilt u %1$s en de inhoud ervan werkelijk verwijderen?</string>
    <string name="confirmation_remove_local">Alleen lokaal</string>
    <string name="confirmation_remove_folder_local">Alleen lokaal</string>
 -  <string name="confirmation_remove_remote">Van server</string>
 +  <string name="confirmation_remove_file_remote">Van server</string>
    <string name="confirmation_remove_remote_and_local">Extern &amp; lokaal</string>
    <string name="remove_success_msg">Succesvol verwijderd</string>
    <string name="remove_fail_msg">Verwijdering kon niet voltooid worden</string>
    <string name="prefs_category_instant_uploading">Directe uploads</string>
    <string name="prefs_category_security">Beveiliging</string>
    <string name="prefs_instant_video_upload_path_title">Upload Video Pad</string>
-   <string name="download_folder_failed_content">Download van %1$s map kon niet worden voltooid</string>
    <string name="shared_subject_header">gedeeld</string>
    <string name="with_you_subject_header">met u</string>
    <string name="subject_token">%1$s deelde \"%2$s\" met u</string>
@@@ -80,7 -80,6 +80,6 @@@ Telecargatz-lo aicí : %2$s</string
    <string name="filedetails_created">Creat lo :</string>
    <string name="filedetails_modified">Modificat lo :</string>
    <string name="filedetails_download">Telecargar</string>
-   <string name="filedetails_sync_file">Actualizar lo fichièr</string>
    <string name="filedetails_renamed_in_upload_msg">Lo fichièr es estat renomenat en %s pendent lo mandadís</string>
    <string name="list_layout">Afichatge en lista</string>
    <string name="action_share_file">Partejar lo ligam</string>
@@@ -88,8 -87,6 +87,6 @@@
    <string name="common_yes">Òc</string>
    <string name="common_no">Non</string>
    <string name="common_ok">D\'acòrdi</string>
-   <string name="common_cancel_download">Anullar lo telecargament</string>
-   <string name="common_cancel_upload">Anullar lo mandadís</string>
    <string name="common_cancel">Anullar</string>
    <string name="common_save_exit">Salvar &amp; Quitar</string>
    <string name="common_error">Error</string>
@@@ -204,11 -201,11 +201,11 @@@ En rason d\'aquesta modificacion, tote
    <string name="unfavorite">Suprimir dels favorits</string>
    <string name="common_rename">Renomenar</string>
    <string name="common_remove">Suprimir</string>
 -  <string name="confirmation_remove_alert">Sètz segur que volètz suprimir %1$s ?</string>
 +  <string name="confirmation_remove_file_alert">Sètz segur que volètz suprimir %1$s ?</string>
    <string name="confirmation_remove_folder_alert">Sètz segur que volètz suprimir %1$s e son contengut ?</string>
    <string name="confirmation_remove_local">Local solament</string>
    <string name="confirmation_remove_folder_local">Local solament</string>
 -  <string name="confirmation_remove_remote">Dempuèi lo servidor</string>
 +  <string name="confirmation_remove_file_remote">Dempuèi lo servidor</string>
    <string name="confirmation_remove_remote_and_local">Distant &amp; local</string>
    <string name="remove_success_msg">Supression efectuada amb succès</string>
    <string name="remove_fail_msg">Supression impossibla</string>
    <string name="prefs_category_instant_uploading">Mandadís immediat</string>
    <string name="prefs_category_security">Seguretat</string>
    <string name="prefs_instant_video_upload_path_title">Repertòri de mandadís de las vidèos</string>
-   <string name="download_folder_failed_content">Lo telecargament del dorsièr %1$s a pas pogut èsser acabat</string>
    <string name="shared_subject_header">a partejat</string>
    <string name="with_you_subject_header">amb vos</string>
    <string name="subject_token">%1$s a partejat \"%2$s\" amb vos</string>
@@@ -78,7 -78,6 +78,6 @@@
    <string name="filedetails_created">Utworzono:</string>
    <string name="filedetails_modified">Zmodyfikowano:</string>
    <string name="filedetails_download">Pobierz</string>
-   <string name="filedetails_sync_file">Odśwież plik</string>
    <string name="filedetails_renamed_in_upload_msg">Podczas wysyłania nazwa pliku została zmieniona na %1$s</string>
    <string name="list_layout">Lista szablonów wyglądu</string>
    <string name="action_share_file">Udostępnij link</string>
@@@ -86,8 -85,6 +85,6 @@@
    <string name="common_yes">Tak</string>
    <string name="common_no">Nie</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Anuluj pobieranie</string>
-   <string name="common_cancel_upload">Anuluj wysyłanie</string>
    <string name="common_cancel">Anuluj</string>
    <string name="common_save_exit">Zapisz i wyjdź</string>
    <string name="common_error">Błąd</string>
    <string name="unfavorite">Usuń z ulubionych</string>
    <string name="common_rename">Zmień nazwę</string>
    <string name="common_remove">Usuń</string>
 -  <string name="confirmation_remove_alert">Czy naprawdę chcesz usunąć %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Czy naprawdę chcesz usunąć %1$s?</string>
    <string name="confirmation_remove_folder_alert">Czy naprawdę chcesz usunąć %1$s i jego zawartość?</string>
    <string name="confirmation_remove_local">Tylko lokalnie</string>
    <string name="confirmation_remove_folder_local">Tylko lokalnie</string>
 -  <string name="confirmation_remove_remote">Z serwera</string>
 +  <string name="confirmation_remove_file_remote">Z serwera</string>
    <string name="remove_success_msg">Usunięto</string>
    <string name="remove_fail_msg">Nie można usunąć</string>
    <string name="rename_dialog_title">Wprowadź nową nazwę</string>
    <string name="prefs_category_instant_uploading">Automatyczne wysyłanie</string>
    <string name="prefs_category_security">Bezpieczeństwo</string>
    <string name="prefs_instant_video_upload_path_title">Katalog wysyłania dla wideo</string>
-   <string name="download_folder_failed_content">Pobieranie %1$s katalogu nie może zostać ukończone</string>
    <string name="shared_subject_header">udostępniony</string>
    <string name="with_you_subject_header">z tobą</string>
    <string name="auth_refresh_button">Odśwież połączenie</string>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">Criado:</string>
    <string name="filedetails_modified">Modificado:</string>
    <string name="filedetails_download">Baixar</string>
-   <string name="filedetails_sync_file">Atualizar arquivo</string>
    <string name="filedetails_renamed_in_upload_msg">Arquivo foi renomeado para %1$s durante o envio</string>
    <string name="list_layout">Lista de Layout</string>
    <string name="action_share_file">Compartilhar link</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">Sim</string>
    <string name="common_no">Não</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Cancelar o download</string>
-   <string name="common_cancel_upload">Cancelar envio</string>
    <string name="common_cancel">Cancelar</string>
    <string name="common_save_exit">Salvar &amp; Sair</string>
    <string name="common_error">Erro</string>
    <string name="unfavorite">Nãofavorito</string>
    <string name="common_rename">Renomear</string>
    <string name="common_remove">Remover</string>
 -  <string name="confirmation_remove_alert">Você realmente deseja remover %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Você realmente deseja remover %1$s?</string>
    <string name="confirmation_remove_folder_alert">Você realmente deseja remover %1$s e seus conteúdos?</string>
    <string name="confirmation_remove_local">Somente local</string>
    <string name="confirmation_remove_folder_local">Somente local</string>
 -  <string name="confirmation_remove_remote">Do servidor</string>
 +  <string name="confirmation_remove_file_remote">Do servidor</string>
    <string name="confirmation_remove_remote_and_local">Remoto &amp; local</string>
    <string name="remove_success_msg">Removido com sucesso</string>
    <string name="remove_fail_msg">Erro ao remover</string>
    <string name="prefs_category_instant_uploading">Envios Instantâneos</string>
    <string name="prefs_category_security">Segurança</string>
    <string name="prefs_instant_video_upload_path_title">Enviar o Caminho do Vídeo</string>
-   <string name="download_folder_failed_content">Baixar %1$s da pasta não pode ser completado</string>
    <string name="shared_subject_header">compartilhado</string>
    <string name="with_you_subject_header">com você</string>
    <string name="subject_token">%1$s compartilhado \"%2$s\" com você</string>
@@@ -71,6 -71,7 +71,7 @@@
    <string name="file_list_seconds_ago">segundos atrás</string>
    <string name="file_list_empty">Aqui não existe nada. Envie alguma coisa!</string>
    <string name="file_list_loading">A carregar...</string>
+   <string name="file_list_no_app_for_file_type">Nenhuma App encontrada por tipo de ficheiro!</string>
    <string name="local_file_list_empty">Não existem ficheiros nesta pasta.</string>
    <string name="filedetails_select_file">Toque num ficheiro para visualizar a informação adicional.</string>
    <string name="filedetails_size">Tamanho:</string>
@@@ -78,7 -79,6 +79,6 @@@
    <string name="filedetails_created">Criado:</string>
    <string name="filedetails_modified">Modificado:</string>
    <string name="filedetails_download">Transferir</string>
-   <string name="filedetails_sync_file">Atualizar ficheiro</string>
    <string name="filedetails_renamed_in_upload_msg">O ficheiro foi renomeado para %1$s durante o envio.</string>
    <string name="list_layout">Apresentação da Lista</string>
    <string name="action_share_file">Partilhar a hiperligação</string>
@@@ -86,8 -86,6 +86,6 @@@
    <string name="common_yes">Sim</string>
    <string name="common_no">Não</string>
    <string name="common_ok">ACEITAR</string>
-   <string name="common_cancel_download">Cancelar a transferência</string>
-   <string name="common_cancel_upload">Cancelar o envio</string>
    <string name="common_cancel">Cancelar</string>
    <string name="common_save_exit">Guardar &amp; Sair</string>
    <string name="common_error">Erro</string>
    <string name="unfavorite">Retirar Favorito</string>
    <string name="common_rename">Renomear</string>
    <string name="common_remove">Remover</string>
 -  <string name="confirmation_remove_alert">Tem a certeza que deseja remover %1$s ?</string>
 +  <string name="confirmation_remove_file_alert">Tem a certeza que deseja remover %1$s ?</string>
    <string name="confirmation_remove_folder_alert">Deseja realmente remover %1$s e o seu conteúdo?</string>
    <string name="confirmation_remove_local">Apenas localmente</string>
    <string name="confirmation_remove_folder_local">Apenas localmente</string>
 -  <string name="confirmation_remove_remote">Do servidor</string>
 +  <string name="confirmation_remove_file_remote">Do servidor</string>
    <string name="confirmation_remove_remote_and_local">Remoto &amp; local</string>
    <string name="remove_success_msg">Removido com sucesso</string>
    <string name="remove_fail_msg">Não foi possível remover</string>
    <string name="prefs_category_instant_uploading">Envios Instantâneos</string>
    <string name="prefs_category_security">Segurança</string>
    <string name="prefs_instant_video_upload_path_title">Envio do Caminho do Vídeo</string>
-   <string name="download_folder_failed_content">Não foi possível completar o download da pasta %1$s</string>
    <string name="shared_subject_header">partilhado</string>
    <string name="with_you_subject_header">consigo</string>
    <string name="subject_token">%1$s partilhou \"%2$s\" consigo</string>
@@@ -78,7 -78,6 +78,6 @@@
    <string name="filedetails_created">Creat:</string>
    <string name="filedetails_modified">Modificat:</string>
    <string name="filedetails_download">Descarcă</string>
-   <string name="filedetails_sync_file">Împrospătare fișier</string>
    <string name="filedetails_renamed_in_upload_msg">Fișierul a fost redenumit %1$s în timpul încărcării</string>
    <string name="list_layout">Aspect listă</string>
    <string name="action_share_file">Partajază legătură</string>
@@@ -86,8 -85,6 +85,6 @@@
    <string name="common_yes">Da</string>
    <string name="common_no">Nu</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Anulează descărcarea</string>
-   <string name="common_cancel_upload">Anulează încărcarea</string>
    <string name="common_cancel">Anulează</string>
    <string name="common_save_exit">Salvare și ieșire</string>
    <string name="common_error">Eroare</string>
    <string name="unfavorite">Defavoritați</string>
    <string name="common_rename">Redenumește</string>
    <string name="common_remove">Elimină</string>
 -  <string name="confirmation_remove_alert">Doriti sigur sa stergeti %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Doriti sigur sa stergeti %1$s?</string>
    <string name="confirmation_remove_folder_alert">Sigur vrei să elimini %1$s și conținutul său?</string>
    <string name="confirmation_remove_local">Doar local</string>
    <string name="confirmation_remove_folder_local">Doar local</string>
 -  <string name="confirmation_remove_remote">De pe server</string>
 +  <string name="confirmation_remove_file_remote">De pe server</string>
    <string name="confirmation_remove_remote_and_local">Ambele</string>
    <string name="remove_success_msg">Eliminat cu succes</string>
    <string name="remove_fail_msg">Eliminarea nu a reușit</string>
    <string name="prefs_category_instant_uploading">Încărcări instante</string>
    <string name="prefs_category_security">Securitate</string>
    <string name="prefs_instant_video_upload_path_title">Calea de încărcare Video</string>
-   <string name="download_folder_failed_content">Descărcarea fișierului %1$s nu s-a finisat</string>
    <string name="shared_subject_header">partajat</string>
    <string name="with_you_subject_header">cu tine</string>
    <string name="subject_token">%1$s a partajat fișierul \"%2$s\" cu tine</string>
@@@ -80,7 -80,6 +80,6 @@@
    <string name="filedetails_created">Создан:</string>
    <string name="filedetails_modified">Изменён:</string>
    <string name="filedetails_download">Скачать</string>
-   <string name="filedetails_sync_file">Обновить файл</string>
    <string name="filedetails_renamed_in_upload_msg">Файл был переименован в %1$s во время загрузки</string>
    <string name="list_layout">Макет списка</string>
    <string name="action_share_file">Поделиться ссылкой</string>
@@@ -88,8 -87,6 +87,6 @@@
    <string name="common_yes">Да</string>
    <string name="common_no">Нет</string>
    <string name="common_ok">ОК</string>
-   <string name="common_cancel_download">Отменить скачивание</string>
-   <string name="common_cancel_upload">Отменить загрузку</string>
    <string name="common_cancel">Отмена</string>
    <string name="common_save_exit">Сохранить и выйти</string>
    <string name="common_error">Ошибка</string>
    <string name="unfavorite">Убрать из избранного</string>
    <string name="common_rename">Переименовать</string>
    <string name="common_remove">Удалить</string>
 -  <string name="confirmation_remove_alert">Вы действительно хотите удалить %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Вы действительно хотите удалить %1$s?</string>
    <string name="confirmation_remove_folder_alert">Вы действительно хотите удалить %1$s и его содержимое?</string>
    <string name="confirmation_remove_local">Только локально</string>
    <string name="confirmation_remove_folder_local">Только локально</string>
    <string name="prefs_category_instant_uploading">Мгновенные загрузки</string>
    <string name="prefs_category_security">Безопасность</string>
    <string name="prefs_instant_video_upload_path_title">Путь для загрузки Видео</string>
-   <string name="download_folder_failed_content">Не удалось завершить скачивание каталога %1$s</string>
    <string name="shared_subject_header">поделился</string>
    <string name="with_you_subject_header">с вами</string>
    <string name="subject_token">%1$s предоставил вам доступ к \"%2$s\"</string>
@@@ -78,7 -78,6 +78,6 @@@
    <string name="filedetails_created">Vytvorený:</string>
    <string name="filedetails_modified">Zmenený:</string>
    <string name="filedetails_download">Stiahnuť</string>
-   <string name="filedetails_sync_file">Obnoviť súbor</string>
    <string name="filedetails_renamed_in_upload_msg">Súbor bol premenovaný na %1$s počas nahrávania</string>
    <string name="list_layout">Rozvrhnutie zoznamu</string>
    <string name="action_share_file">Zdieľať linku</string>
@@@ -86,8 -85,6 +85,6 @@@
    <string name="common_yes">Áno</string>
    <string name="common_no">Nie</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Zrušiť sťahovanie</string>
-   <string name="common_cancel_upload">Zrušiť odosielanie</string>
    <string name="common_cancel">Zrušiť</string>
    <string name="common_save_exit">Uložiť a ukončiť</string>
    <string name="common_error">Chyba</string>
    <string name="unfavorite">Odobrať z obľúbených</string>
    <string name="common_rename">Premenuj</string>
    <string name="common_remove">Odober</string>
 -  <string name="confirmation_remove_alert">Naozaj chcete odstrániť %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Naozaj chcete odstrániť %1$s?</string>
    <string name="confirmation_remove_folder_alert">Naozaj chcete odstrániť %1$s a jeho obsah?</string>
    <string name="confirmation_remove_local">Iba lokálne</string>
    <string name="confirmation_remove_folder_local">Iba lokálne</string>
 -  <string name="confirmation_remove_remote">Zo servera</string>
 +  <string name="confirmation_remove_file_remote">Zo servera</string>
    <string name="confirmation_remove_remote_and_local">Vzdialene aj lokálne</string>
    <string name="remove_success_msg">Úspešne odstránené</string>
    <string name="remove_fail_msg">Odstránenie zlyhalo</string>
    <string name="prefs_category_instant_uploading">Okamžité nahratie</string>
    <string name="prefs_category_security">Zabezpečenie</string>
    <string name="prefs_instant_video_upload_path_title">Cesta pre nahrávanie videí</string>
-   <string name="download_folder_failed_content">Sťahovanie %1$s priečinka nebolo dokončené</string>
    <string name="shared_subject_header">zdieľané</string>
    <string name="with_you_subject_header">s vami</string>
    <string name="subject_token">%1$s vám zdieľal \"%2$s\"</string>
@@@ -78,7 -78,6 +78,6 @@@
    <string name="filedetails_created">Ustvarjeno:</string>
    <string name="filedetails_modified">Spremenjeno:</string>
    <string name="filedetails_download">Prejmi</string>
-   <string name="filedetails_sync_file">Osveži datoteko</string>
    <string name="filedetails_renamed_in_upload_msg">Datoteka je bila med nalaganjem preimenovana v %1$s</string>
    <string name="list_layout">Postavitev seznama</string>
    <string name="action_share_file">Povezava za souporabo</string>
@@@ -86,8 -85,6 +85,6 @@@
    <string name="common_yes">Da</string>
    <string name="common_no">Ne</string>
    <string name="common_ok">V redu</string>
-   <string name="common_cancel_download">Prekliči prejem</string>
-   <string name="common_cancel_upload">Prekliči pošiljanje</string>
    <string name="common_cancel">Prekliči</string>
    <string name="common_save_exit">Shrani in končaj</string>
    <string name="common_error">Napaka</string>
    <string name="unfavorite">Odstrani priljubljeno</string>
    <string name="common_rename">Preimenuj</string>
    <string name="common_remove">Odstrani</string>
 -  <string name="confirmation_remove_alert">Ali res želite odstraniti %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Ali res želite odstraniti %1$s?</string>
    <string name="confirmation_remove_folder_alert">Ali res želite odstraniti %1$s skupaj s celotno vsebino?</string>
    <string name="confirmation_remove_local">Le krajevno</string>
    <string name="confirmation_remove_folder_local">Le krajevno</string>
 -  <string name="confirmation_remove_remote">S strežnika</string>
 +  <string name="confirmation_remove_file_remote">S strežnika</string>
    <string name="confirmation_remove_remote_and_local">Oddaljeno &amp; krajevno</string>
    <string name="remove_success_msg">Odstranitev je uspešno končana</string>
    <string name="remove_fail_msg">Odstranjevanje je spodletelo</string>
    <string name="prefs_category_instant_uploading">Takojšnje pošiljanje v oblak</string>
    <string name="prefs_category_security">Varnost</string>
    <string name="prefs_instant_video_upload_path_title">Pot videa za pošiljanje</string>
-   <string name="download_folder_failed_content">Imenika %1$s  ni mogoče prejeti v celoti</string>
    <string name="shared_subject_header">v souporabi</string>
    <string name="with_you_subject_header">z vami</string>
    <string name="subject_token">Uporabnik %1$s je omogočil souporabo \"%2$s\" z vami</string>
@@@ -78,7 -78,6 +78,6 @@@
    <string name="filedetails_created">Направљен:</string>
    <string name="filedetails_modified">Измењен:</string>
    <string name="filedetails_download">Преузми</string>
-   <string name="filedetails_sync_file">Освежи фајл</string>
    <string name="filedetails_renamed_in_upload_msg">Фајл је преименован у %1$s током отпремања</string>
    <string name="list_layout">Распоред листе</string>
    <string name="action_share_file">Веза дељења</string>
@@@ -86,8 -85,6 +85,6 @@@
    <string name="common_yes">Да</string>
    <string name="common_no">Не</string>
    <string name="common_ok">У реду</string>
-   <string name="common_cancel_download">Откажи преузимање</string>
-   <string name="common_cancel_upload">Откажи отпремање</string>
    <string name="common_cancel">Откажи</string>
    <string name="common_save_exit">Сачувај и изађи</string>
    <string name="common_error">Грешка</string>
    <string name="unfavorite">Неомиљени</string>
    <string name="common_rename">Преименуј</string>
    <string name="common_remove">Уклони</string>
 -  <string name="confirmation_remove_alert">Желите да уклоните %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Желите да уклоните %1$s?</string>
    <string name="confirmation_remove_folder_alert">Желите да уклоните %1$s и њен садржај?</string>
    <string name="confirmation_remove_local">Само локално</string>
    <string name="confirmation_remove_folder_local">Само локално</string>
    <string name="prefs_category_instant_uploading">Тренутна отпремања</string>
    <string name="prefs_category_security">Безбедност</string>
    <string name="prefs_instant_video_upload_path_title">Путања отпремања видеа</string>
-   <string name="download_folder_failed_content">Преузимање фасцикле %1$s не може бити довршено</string>
    <string name="shared_subject_header">дељено</string>
    <string name="with_you_subject_header">са вама</string>
    <string name="subject_token">%1$s подели „%2$s“ са вама</string>
    <string name="filedetails_created">Skapad:</string>
    <string name="filedetails_modified">Ändrad:</string>
    <string name="filedetails_download">Ladda ner</string>
-   <string name="filedetails_sync_file">Ladda om fil</string>
    <string name="filedetails_renamed_in_upload_msg">Filen bytte namn till %1$s under uppladdningen</string>
    <string name="action_share_file">Dela länk</string>
    <string name="action_unshare_file">Sluta dela länk</string>
    <string name="common_yes">Ja</string>
    <string name="common_no">Nej</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Avbryt nedladdning</string>
-   <string name="common_cancel_upload">Avbryt uppladdning</string>
    <string name="common_cancel">Avbryt</string>
    <string name="common_save_exit">Spara &amp; Avsluta</string>
    <string name="common_error">Fel</string>
    <string name="unfavorite">Avfavoritisera</string>
    <string name="common_rename">Byt namn</string>
    <string name="common_remove">Radera</string>
 -  <string name="confirmation_remove_alert">Vill du verkligen ta bort %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Vill du verkligen ta bort %1$s?</string>
    <string name="confirmation_remove_folder_alert">Vill du verkligen ta bort %1$s och dess innehåll?</string>
    <string name="confirmation_remove_local">Endast lokalt</string>
    <string name="confirmation_remove_folder_local">Endast lokalt</string>
    <string name="prefs_category_instant_uploading">Direktuppladning</string>
    <string name="prefs_category_security">Säkerhet</string>
    <string name="prefs_instant_video_upload_path_title">Uppladdnings-sökväg för video</string>
-   <string name="download_folder_failed_content">Neddladning utav %1$s mappen kunde inte slutföras</string>
    <string name="auth_host_address">Serveradress</string>
  </resources>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">สร้างเมื่อ:</string>
    <string name="filedetails_modified">แก้ไขเมื่อ:</string>
    <string name="filedetails_download">ดาวน์โหลด</string>
-   <string name="filedetails_sync_file">ฟื้นฟูไฟล์</string>
    <string name="filedetails_renamed_in_upload_msg">ไฟล์ได้ถูกเปลี่ยนชื่อเป็น %1$s ในระหว่างการอัพโหลด</string>
    <string name="list_layout">เค้าโครงรายการ</string>
    <string name="action_share_file">แชร์ลิงค์</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">ตกลง</string>
    <string name="common_no">ไม่ตกลง</string>
    <string name="common_ok">ตกลง</string>
-   <string name="common_cancel_download">ยกเลิกการดาวน์โหลด</string>
-   <string name="common_cancel_upload">ยกเลิกการอัพโหลด</string>
    <string name="common_cancel">ยกเลิก</string>
    <string name="common_save_exit">บันทึก &amp; ออก</string>
    <string name="common_error">ข้อผิดพลาด</string>
    <string name="unfavorite">ออกจากรายการโปรด</string>
    <string name="common_rename">เปลี่ยนชื่อ</string>
    <string name="common_remove">ลบออก</string>
 -  <string name="confirmation_remove_alert">คุณต้องการที่จะลบ %1$s?</string>
 +  <string name="confirmation_remove_file_alert">คุณต้องการที่จะลบ %1$s?</string>
    <string name="confirmation_remove_folder_alert">คุณต้องการที่จะลบ %1$s และเนื้อหาของมัน?</string>
    <string name="confirmation_remove_local">เฉพาะต้นทางเท่านั้น</string>
    <string name="confirmation_remove_folder_local">เฉพาะต้นทางเท่านั้น</string>
 -  <string name="confirmation_remove_remote">จากเซิฟเวอร์</string>
 +  <string name="confirmation_remove_file_remote">จากเซิฟเวอร์</string>
    <string name="confirmation_remove_remote_and_local">รีโมท &amp; ต้นทาง</string>
    <string name="remove_success_msg">ลบเรียบร้อยแล้ว</string>
    <string name="remove_fail_msg">ไม่สามารถลบได้</string>
    <string name="prefs_category_instant_uploading">อัพโหลดทันที</string>
    <string name="prefs_category_security">ความปลอดภัย</string>
    <string name="prefs_instant_video_upload_path_title">อัพโหลดเส้นทางวิดีโอ</string>
-   <string name="download_folder_failed_content">การดาวน์โหลดโฟลเดอร์ %1$s อาจไม่สำเร็จ</string>
    <string name="shared_subject_header">ถูกแชร์</string>
    <string name="with_you_subject_header">กับคุณ</string>
    <string name="subject_token">%1$s ได้แชร์ \"%2$s\" กับคุณ</string>
@@@ -78,7 -78,6 +78,6 @@@
    <string name="filedetails_created">Oluşturulma:</string>
    <string name="filedetails_modified">Değiştirilme:</string>
    <string name="filedetails_download">İndir</string>
-   <string name="filedetails_sync_file">Dosyayı yenile</string>
    <string name="filedetails_renamed_in_upload_msg">Dosya adı, yükleme sırasında %1$s olarak değiştirildi</string>
    <string name="list_layout">Liste Yerleşimi</string>
    <string name="action_share_file">Paylaşma bağlantısı</string>
@@@ -86,8 -85,6 +85,6 @@@
    <string name="common_yes">Evet</string>
    <string name="common_no">Hayır</string>
    <string name="common_ok">Tamam</string>
-   <string name="common_cancel_download">İndirmeyi iptal et</string>
-   <string name="common_cancel_upload">Yüklemeyi iptal et</string>
    <string name="common_cancel">İptal</string>
    <string name="common_save_exit">Kaydet ve Çık</string>
    <string name="common_error">Hata</string>
    <string name="unfavorite">Favoriden kaldır</string>
    <string name="common_rename">Yeniden adlandır</string>
    <string name="common_remove">Kaldır</string>
 -  <string name="confirmation_remove_alert">Gerçekten %1$s dosyasını kaldırmak istiyor musunuz?</string>
 +  <string name="confirmation_remove_file_alert">Gerçekten %1$s dosyasını kaldırmak istiyor musunuz?</string>
    <string name="confirmation_remove_folder_alert">Gerçekten %1$s ve içeriğini kaldırmak istediğinizden emin misiniz?</string>
    <string name="confirmation_remove_local">Sadece yerel</string>
    <string name="confirmation_remove_folder_local">Sadece yerel</string>
 -  <string name="confirmation_remove_remote">Sunucudan</string>
 +  <string name="confirmation_remove_file_remote">Sunucudan</string>
    <string name="confirmation_remove_remote_and_local">Uzak ve yerel</string>
    <string name="remove_success_msg">Kaldırma başarılı</string>
    <string name="remove_fail_msg">Kaldırma başarısız</string>
    <string name="prefs_category_instant_uploading">Anında Yüklemeler</string>
    <string name="prefs_category_security">Güvenlik</string>
    <string name="prefs_instant_video_upload_path_title">Video Yükleme Yolu</string>
-   <string name="download_folder_failed_content">%1$s klasörün indirilmesi tamamlanamadı</string>
    <string name="shared_subject_header">sizinle</string>
    <string name="with_you_subject_header">paylaştı</string>
    <string name="subject_token">%1$s, sizinle \"%2$s\" paylaşımını yaptı</string>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">Створено:</string>
    <string name="filedetails_modified">Змінено:</string>
    <string name="filedetails_download">Завантажити</string>
-   <string name="filedetails_sync_file">Оновити файл</string>
    <string name="filedetails_renamed_in_upload_msg">Файл був переіменований в %1$s протягом вивантаження</string>
    <string name="list_layout">Вигляд списку</string>
    <string name="action_share_file">Опублікувати посилання</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">Так</string>
    <string name="common_no">Ні</string>
    <string name="common_ok">OK</string>
-   <string name="common_cancel_download">Скасувати завантаження</string>
-   <string name="common_cancel_upload">Перервати завантаження</string>
    <string name="common_cancel">Відмінити</string>
    <string name="common_save_exit">Зберегти &amp; Вихід</string>
    <string name="common_error">Помилка</string>
    <string name="unfavorite">Прибрати з вибраного</string>
    <string name="common_rename">Перейменувати</string>
    <string name="common_remove">Видалити</string>
 -  <string name="confirmation_remove_alert">Ви дійсно бажаєте видалити %1$s?</string>
 +  <string name="confirmation_remove_file_alert">Ви дійсно бажаєте видалити %1$s?</string>
    <string name="confirmation_remove_folder_alert">Ви дійсно бажаєте видалити %1$s та весь вміст?</string>
    <string name="confirmation_remove_local">Лише локально</string>
    <string name="confirmation_remove_folder_local">Лише локально</string>
    <string name="prefs_category_instant_uploading">Миттєво завантаження</string>
    <string name="prefs_category_security">Безпека</string>
    <string name="prefs_instant_video_upload_path_title">Шлях завантаження відео</string>
-   <string name="download_folder_failed_content">Скачування теки %1$s не може бути завершено</string>
    <string name="shared_subject_header">поширений</string>
    <string name="with_you_subject_header">з Вами</string>
    <string name="subject_token">%1$s поділився \"%2$s\" з вами</string>
@@@ -79,7 -79,6 +79,6 @@@
    <string name="filedetails_created">创建于:</string>
    <string name="filedetails_modified">修改于:</string>
    <string name="filedetails_download">下载</string>
-   <string name="filedetails_sync_file">刷新文件</string>
    <string name="filedetails_renamed_in_upload_msg">上传过程中文件被更名为了 %1$s</string>
    <string name="list_layout">列表布局</string>
    <string name="action_share_file">分享链接</string>
@@@ -87,8 -86,6 +86,6 @@@
    <string name="common_yes">是</string>
    <string name="common_no">否</string>
    <string name="common_ok">确定</string>
-   <string name="common_cancel_download">取消下载</string>
-   <string name="common_cancel_upload">取消上传</string>
    <string name="common_cancel">取消</string>
    <string name="common_save_exit">保存并退出</string>
    <string name="common_error">错误</string>
    <string name="unfavorite">取消收藏</string>
    <string name="common_rename">重命名</string>
    <string name="common_remove">删除</string>
 -  <string name="confirmation_remove_alert">你确定要删除 %1$s 吗?</string>
 +  <string name="confirmation_remove_file_alert">你确定要删除 %1$s 吗?</string>
    <string name="confirmation_remove_folder_alert">您确定要删除 %1$s 及其内容吗?</string>
    <string name="confirmation_remove_local">仅本地</string>
    <string name="confirmation_remove_folder_local">仅本地</string>
 -  <string name="confirmation_remove_remote">来自服务器</string>
 +  <string name="confirmation_remove_file_remote">来自服务器</string>
    <string name="confirmation_remove_remote_and_local">远程 &amp; 本地</string>
    <string name="remove_success_msg">成功删除</string>
    <string name="remove_fail_msg">无法完成删除</string>
    <string name="prefs_category_instant_uploading">即时上传</string>
    <string name="prefs_category_security">安全</string>
    <string name="prefs_instant_video_upload_path_title">视频上传路径</string>
-   <string name="download_folder_failed_content">%1$s 文件夹的下载无法完成</string>
    <string name="shared_subject_header">已共享</string>
    <string name="with_you_subject_header">与你</string>
    <string name="subject_token">%1$s和你分享了“%2$s”</string>
@@@ -78,7 -78,6 +78,6 @@@
    <string name="filedetails_created">建立:</string>
    <string name="filedetails_modified">修改:</string>
    <string name="filedetails_download">下載</string>
-   <string name="filedetails_sync_file">更新檔案列表</string>
    <string name="filedetails_renamed_in_upload_msg">檔案名稱在上傳時已被更改為 %1$s</string>
    <string name="list_layout">列表版型</string>
    <string name="action_share_file">分享連結</string>
@@@ -86,8 -85,6 +85,6 @@@
    <string name="common_yes">是</string>
    <string name="common_no">否</string>
    <string name="common_ok">好</string>
-   <string name="common_cancel_download">取消下載</string>
-   <string name="common_cancel_upload">取消上傳</string>
    <string name="common_cancel">取消</string>
    <string name="common_save_exit">儲存並離開</string>
    <string name="common_error">錯誤</string>
    <string name="unfavorite">不喜愛的</string>
    <string name="common_rename">重新命名</string>
    <string name="common_remove">移除</string>
 -  <string name="confirmation_remove_alert">您真的要移除 %1$s ?</string>
 +  <string name="confirmation_remove_file_alert">您真的要移除 %1$s ?</string>
    <string name="confirmation_remove_folder_alert">您真的要移除 %1$s 與裡頭的檔案?</string>
    <string name="confirmation_remove_local">只有本地</string>
    <string name="confirmation_remove_folder_local">只有本地</string>
 -  <string name="confirmation_remove_remote">來自伺服器</string>
 +  <string name="confirmation_remove_file_remote">來自伺服器</string>
    <string name="confirmation_remove_remote_and_local">遠端 &amp; 本地</string>
    <string name="remove_success_msg">成功地移除</string>
    <string name="remove_fail_msg">刪除失敗</string>
    <string name="prefs_category_instant_uploading">即時上傳</string>
    <string name="prefs_category_security">安全性</string>
    <string name="prefs_instant_video_upload_path_title">影片上傳路徑</string>
-   <string name="download_folder_failed_content">%1$s 目錄的下載未完成</string>
    <string name="shared_subject_header">以分享的</string>
    <string name="with_you_subject_header">與你</string>
    <string name="subject_token">%1$s 分享了 \"%2$s\" 給您</string>
diff --combined res/values/strings.xml
@@@ -23,7 -23,8 +23,7 @@@
      <!-- TODO re-enable when "Accounts" is available in Navigation Drawer -->
      <!--<string name="drawer_item_accounts">Accounts</string>-->
      <string name="drawer_item_all_files">All files</string>
 -    <!-- TODO re-enable when "On Device" is available
 -    <string name="drawer_item_on_device">On device</string>-->
 +    <string name="drawer_item_on_device">On device</string>
      <string name="drawer_item_settings">Settings</string>
      <string name="drawer_item_logs">Logs</string>
        <string name="drawer_close">Close</string>
@@@ -81,7 -82,7 +81,7 @@@
      <string name="filedetails_created">Created:</string>
      <string name="filedetails_modified">Modified:</string>
      <string name="filedetails_download">Download</string>
-     <string name="filedetails_sync_file">Refresh file</string>
+     <string name="filedetails_sync_file">Synchronize</string>
      <string name="filedetails_renamed_in_upload_msg">File was renamed to %1$s during upload</string>
      <string name="list_layout">List Layout</string>
      <string name="action_share_file">Share link</string>
@@@ -89,8 -90,7 +89,7 @@@
      <string name="common_yes">Yes</string>
      <string name="common_no">No</string>
      <string name="common_ok">OK</string>
-     <string name="common_cancel_download">Cancel download</string>
-     <string name="common_cancel_upload">Cancel upload</string>
+     <string name="common_cancel_sync">Cancel synchronization</string>
      <string name="common_cancel">Cancel</string>
      <string name="common_save_exit">Save &amp; Exit</string>
      <string name="common_error">Error</string>
      <string name="unfavorite">Unfavorite</string>
      <string name="common_rename">Rename</string>
      <string name="common_remove">Remove</string>
 -    <string name="confirmation_remove_alert">"Do you really want to remove %1$s?"</string>
 +    <string name="confirmation_remove_file_alert">"Do you really want to remove %1$s?"</string>
      <string name="confirmation_remove_folder_alert">"Do you really want to remove %1$s and its contents?"</string>
      <string name="confirmation_remove_local">Local only</string>
      <string name="confirmation_remove_folder_local">Local only</string>
 -    <string name="confirmation_remove_remote">From server</string>
 +    <string name="confirmation_remove_file_remote">From server</string>
      <string name="confirmation_remove_remote_and_local">Remote &amp; local</string>
      <string name="remove_success_msg">"Removal succeeded"</string>
      <string name="remove_fail_msg">"Removal failed"</string>
      <string name="placeholder_filesize">389 KB</string>
      <string name="placeholder_timestamp">2012/05/18 12:23 PM</string>
      <string name="placeholder_media_time">12:23:45</string>
 -
 -    <string name="instant_upload_on_wifi">Upload pictures via WiFi only</string>
 -    <string name="instant_video_upload_on_wifi">Upload videos via WiFi only</string>
 +    
 +    <string name="instant_upload_on_wifi">Upload pictures via wifi only</string>
 +    <string name="instant_upload_on_charging">Upload when charging only</string>
 +    <string name="instant_video_upload_on_wifi">Upload videos via wifi only</string>
 +    <string name="instant_video_upload_on_charging">Upload when charging only</string>
      <string name="instant_upload_path">/InstantUpload</string>
      <string name="conflict_title">File conflict</string>
      <string name="conflict_message">Which files do you want to keep? If you select both versions, the local file will have a number added to its name.</string>
      <string name="preview_image_error_unknown_format">This image cannot be shown</string>
  
      <string name="error__upload__local_file_not_copied">%1$s could not be copied to %2$s local folder</string>
 -    <string name="prefs_instant_upload_path_title">Upload Path</string>
 +    <string name="prefs_instant_upload_path_title">Upload path</string>
  
        <string name="share_link_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your
                administrator.</string>
      <string name="prefs_category_instant_uploading">Instant Uploads</string>
        <string name="prefs_category_security">Security</string>
  
 -      <string name="prefs_instant_video_upload_path_title">Upload Video Path</string>
 +      <string name="prefs_instant_video_upload_path_title">Upload video path</string>
 +    <string name="download_folder_failed_content">Download of %1$s folder could not be completed</string>
+     <string name="sync_folder_failed_content">Synchronization of %1$s folder could not be completed</string>
  
        <string name="shared_subject_header">shared</string>
        <string name="with_you_subject_header">with you</string>
      <string name="file_list__footer__files">%1$d files</string>
      <string name="file_list__footer__files_and_folder">%1$d files, 1 folder</string>
      <string name="file_list__footer__files_and_folders">%1$d files, %2$d folders</string>
 +    <string name="action_switch_grid_view">Switch to grid view</string>
 +    <string name="action_switch_list_view">Switch to list view</string>
 +    <string name="common_category">Common</string>
 +    <string name="pref_cache_size">Cache size</string>
 +    <string name="prefs_instant_behaviour_dialogTitle">Upload file to server and ...</string>
 +    <string name="prefs_instant_behaviour_title">Behaviour</string>
 +    <string name="upload_copy_files">Copy file</string>
 +    <string name="upload_move_files">Move file</string>
 +
 +    <string name="pref_behaviour_entries_do_nothing">do nothing</string>
 +    <string name="pref_behaviour_entries_copy">copy file to OC folder</string>
 +    <string name="pref_behaviour_entries_move">move file to OC folder</string>
 +    <string name="pref_behaviour_entries_delete">delete origin file</string>
 +    <string name="confirmation_remove_files_alert">Do you really want to remove selected items?</string>
 +    <string name="confirmation_remove_folders_alert">Do you really want to remove a folder and its content?</string>
 +    <string name="confirmation_remove_files">selected items</string>
  
  </resources>
@@@ -24,8 -24,10 +24,10 @@@ import java.io.File
  import java.util.ArrayList;
  import java.util.Collection;
  import java.util.Collections;
+ import java.util.HashSet;
  import java.util.Iterator;
  import java.util.List;
+ import java.util.Set;
  import java.util.Vector;
  
  import android.accounts.Account;
@@@ -88,18 -90,10 +90,10 @@@ public class FileDataStorageManager 
          return mAccount;
      }
  
-     public void setContentResolver(ContentResolver cr) {
-         mContentResolver = cr;
-     }
      public ContentResolver getContentResolver() {
          return mContentResolver;
      }
  
-     public void setContentProviderClient(ContentProviderClient cp) {
-         mContentProviderClient = cp;
-     }
      public ContentProviderClient getContentProviderClient() {
          return mContentProviderClient;
      }
      }
  
  
 -    public Vector<OCFile> getFolderContent(OCFile f/*, boolean onlyOnDevice*/) {
 +    public Vector<OCFile> getFolderContent(OCFile f, boolean onlyOnDevice) {
          if (f != null && f.isFolder() && f.getFileId() != -1) {
 -            // TODO Enable when "On Device" is recovered ?
 -            return getFolderContent(f.getFileId()/*, onlyOnDevice*/);
 +            return getFolderContent(f.getFileId(), onlyOnDevice);
  
          } else {
              return new Vector<OCFile>();
      }
  
  
 -    public Vector<OCFile> getFolderImages(OCFile folder/*, boolean onlyOnDevice*/) {
 +    public Vector<OCFile> getFolderImages(OCFile folder, boolean onlyOnDevice) {
          Vector<OCFile> ret = new Vector<OCFile>(); 
          if (folder != null) {
              // TODO better implementation, filtering in the access to database instead of here
 -            // TODO Enable when "On Device" is recovered ?
 -            Vector<OCFile> tmp = getFolderContent(folder/*, onlyOnDevice*/);
 +            Vector<OCFile> tmp = getFolderContent(folder, onlyOnDevice);
              OCFile current = null; 
              for (int i=0; i<tmp.size(); i++) {
                  current = tmp.get(i);
          cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, file.getFileLength());
          cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, file.getMimetype());
          cv.put(ProviderTableMeta.FILE_NAME, file.getFileName());
-         //if (file.getParentId() != DataStorageManager.ROOT_PARENT_ID)
          cv.put(ProviderTableMeta.FILE_PARENT, file.getParentId());
          cv.put(ProviderTableMeta.FILE_PATH, file.getRemotePath());
          if (!file.isFolder())
          cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
          cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail());
          cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading());
-         
+         cv.put(ProviderTableMeta.FILE_ETAG_IN_CONFLICT, file.getEtagInConflict());
          boolean sameRemotePath = fileExists(file.getRemotePath());
          if (sameRemotePath ||                fileExists(file.getFileId())) {           // for renamed files; no more delete and create
  
-             OCFile oldFile = null;
+             OCFile oldFile;
              if (sameRemotePath) {
                  oldFile = getFileByPath(file.getRemotePath());
                  file.setFileId(oldFile.getFileId());
              }
          }
  
- //        if (file.isFolder()) {
- //            updateFolderSize(file.getFileId());
- //        } else {
- //            updateFolderSize(file.getParentId());
- //        }
          return overriden;
      }
  
              cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
              cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail());
              cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading());
+             cv.put(ProviderTableMeta.FILE_ETAG_IN_CONFLICT, file.getEtagInConflict());
  
              boolean existsByPath = fileExists(file.getRemotePath());
              if (existsByPath || fileExists(file.getFileId())) {
          for (OCFile file : filesToRemove) {
              if (file.getParentId() == folder.getFileId()) {
                  whereArgs = new String[]{mAccount.name, file.getRemotePath()};
-                 //Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_FILE, "" + file.getFileId());
                  if (file.isFolder()) {
                      operations.add(ContentProviderOperation.newDelete(
                              ContentUris.withAppendedId(
              }
          }
  
-         //updateFolderSize(folder.getFileId());
      }
  
  
- //    /**
- //     * 
- //     * @param id
- //     */
- //    private void updateFolderSize(long id) {
- //        if (id > FileDataStorageManager.ROOT_PARENT_ID) {
- //            Log_OC.d(TAG, "Updating size of " + id);
- //            if (getContentResolver() != null) {
- //                getContentResolver().update(ProviderTableMeta.CONTENT_URI_DIR, 
- //                        new ContentValues(),    
-                             // won't be used, but cannot be null; crashes in KLP
- //                        ProviderTableMeta._ID + "=?",
- //                        new String[] { String.valueOf(id) });
- //            } else {
- //                try {
- //                    getContentProviderClient().update(ProviderTableMeta.CONTENT_URI_DIR, 
- //                            new ContentValues(),    
-                                 // won't be used, but cannot be null; crashes in KLP
- //                            ProviderTableMeta._ID + "=?",
- //                            new String[] { String.valueOf(id) });
- //                    
- //                } catch (RemoteException e) {
- //                    Log_OC.e(
- //    TAG, "Exception in update of folder size through compatibility patch " + e.getMessage());
- //                }
- //            }
- //        } else {
- //            Log_OC.e(TAG,  "not updating size for folder " + id);
- //        }
- //    }
      public boolean removeFile(OCFile file, boolean removeDBData, boolean removeLocalCopy) {
          boolean success = true;
          if (file != null) {
                          // maybe unnecessary, but should be checked TODO remove if unnecessary
                          file.setStoragePath(null);
                          saveFile(file);
+                         saveConflict(file, null);
                      }
                  }
              }
          File localFolder = new File(localFolderPath);
          if (localFolder.exists()) {
              // stage 1: remove the local files already registered in the files database
 -            // TODO Enable when "On Device" is recovered ?
 -            Vector<OCFile> files = getFolderContent(folder.getFileId()/*, false*/);
 +            Vector<OCFile> files = getFolderContent(folder.getFileId(), false);
              if (files != null) {
                  for (OCFile file : files) {
                      if (file.isFolder()) {
      }
  
      
 -    private Vector<OCFile> getFolderContent(long parentId/*, boolean onlyOnDevice*/) {
 +    private Vector<OCFile> getFolderContent(long parentId, boolean onlyOnDevice) {
  
          Vector<OCFile> ret = new Vector<OCFile>();
  
          if (c.moveToFirst()) {
              do {
                  OCFile child = createFileInstance(c);
 -                // TODO Enable when "On Device" is recovered ?
 -                // if (child.isFolder() || !onlyOnDevice || onlyOnDevice && child.isDown()){
 +                 if (child.isFolder() || !onlyOnDevice || onlyOnDevice && child.isDown()){
                      ret.add(child);
 -                // }
 +                 }
              } while (c.moveToNext());
          }
  
                      c.getColumnIndex(ProviderTableMeta.FILE_UPDATE_THUMBNAIL)) == 1 ? true : false);
              file.setDownloading(c.getInt(
                      c.getColumnIndex(ProviderTableMeta.FILE_IS_DOWNLOADING)) == 1 ? true : false);
-                     
-         }
-         return file;
-     }
-     /**
-      * Returns if the file/folder is shared by link or not
-      *
-      * @param path Path of the file/folder
-      * @return
-      */
-     public boolean isShareByLink(String path) {
-         Cursor c = getCursorForValue(ProviderTableMeta.FILE_STORAGE_PATH, path);
-         OCFile file = null;
-         if (c.moveToFirst()) {
-             file = createFileInstance(c);
-         }
-         c.close();
-         return file.isShareByLink();
-     }
+             file.setEtagInConflict(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_ETAG_IN_CONFLICT)));
  
-     /**
-      * Returns the public link of the file/folder
-      *
-      * @param path Path of the file/folder
-      * @return
-      */
-     public String getPublicLink(String path) {
-         Cursor c = getCursorForValue(ProviderTableMeta.FILE_STORAGE_PATH, path);
-         OCFile file = null;
-         if (c.moveToFirst()) {
-             file = createFileInstance(c);
          }
-         c.close();
-         return file.getPublicLink();
+         return file;
      }
  
      // Methods for Shares
      public boolean saveShare(OCShare share) {
          boolean overriden = false;
                          ProviderTableMeta.FILE_IS_DOWNLOADING,
                          file.isDownloading() ? 1 : 0
                  );
+                 cv.put(ProviderTableMeta.FILE_ETAG_IN_CONFLICT, file.getEtagInConflict());
  
                  boolean existsByPath = fileExists(file.getRemotePath());
                  if (existsByPath || fileExists(file.getFileId())) {
                      + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
              String [] whereArgs = new String[]{ "", mAccount.name };
  
 -            // TODO Enable when "On Device" is recovered ?
 -            Vector<OCFile> files = getFolderContent(folder /*, false*/);
 +            Vector<OCFile> files = getFolderContent(folder, false);
              
              for (OCFile file : files) {
                  whereArgs[0] = file.getRemotePath();
              }
          }
          return preparedOperations;
-         
-         /*
-         if (operations.size() > 0) {
-             try {
-                 if (getContentResolver() != null) {
-                     getContentResolver().applyBatch(MainApp.getAuthority(), operations);
-                 } else {
-                     getContentProviderClient().applyBatch(operations);
-                 }
-             } catch (OperationApplicationException e) {
-                 Log_OC.e(TAG, "Exception in batch of operations " + e.getMessage());
-             } catch (RemoteException e) {
-                 Log_OC.e(TAG, "Exception in batch of operations  " + e.getMessage());
-             }
-         }            
-         */
-             
-             /*
-             if (getContentResolver() != null) {
-                 
-                 getContentResolver().delete(ProviderTableMeta.CONTENT_URI_SHARE, 
-                                             where,
-                                             whereArgs);
-             } else {
-                 try {
-                     getContentProviderClient().delete(  ProviderTableMeta.CONTENT_URI_SHARE, 
-                                                         where,
-                                                         whereArgs);
-                 } catch (RemoteException e) {
-                     Log_OC.e(TAG, "Exception deleting shares in a folder " + e.getMessage());
-                 }
-             }
-             */
-         //}
      }
  
 -    public void triggerMediaScan(String path) {
 +    public static void triggerMediaScan(String path) {
          Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
          intent.setData(Uri.fromFile(new File(path)));
          MainApp.getAppContext().sendBroadcast(intent);
  
      }
  
+     public void saveConflict(OCFile file, String etagInConflict) {
+         if (!file.isDown()) {
+             etagInConflict = null;
+         }
+         ContentValues cv = new ContentValues();
+         cv.put(ProviderTableMeta.FILE_ETAG_IN_CONFLICT, etagInConflict);
+         int updated = 0;
+         if (getContentResolver() != null) {
+             updated = getContentResolver().update(
+                     ProviderTableMeta.CONTENT_URI_FILE,
+                     cv,
+                     ProviderTableMeta._ID + "=?",
+                     new String[] { String.valueOf(file.getFileId())}
+             );
+         } else {
+             try {
+                 updated = getContentProviderClient().update(
+                         ProviderTableMeta.CONTENT_URI_FILE,
+                         cv,
+                         ProviderTableMeta._ID + "=?",
+                         new String[]{String.valueOf(file.getFileId())}
+                 );
+             } catch (RemoteException e) {
+                 Log_OC.e(TAG, "Failed saving conflict in database " + e.getMessage());
+             }
+         }
+         Log_OC.d(TAG, "Number of files updated with CONFLICT: " + updated);
+         if (updated > 0) {
+             if (etagInConflict != null) {
+                 /// set conflict in all ancestor folders
+                 long parentId = file.getParentId();
+                 Set<String> ancestorIds = new HashSet<String>();
+                 while (parentId != FileDataStorageManager.ROOT_PARENT_ID) {
+                     ancestorIds.add(Long.toString(parentId));
+                     parentId = getFileById(parentId).getParentId();
+                 }
+                 if (ancestorIds.size() > 0) {
+                     StringBuffer whereBuffer = new StringBuffer();
+                     whereBuffer.append(ProviderTableMeta._ID).append(" IN (");
+                     for (int i = 0; i < ancestorIds.size() - 1; i++) {
+                         whereBuffer.append("?,");
+                     }
+                     whereBuffer.append("?");
+                     whereBuffer.append(")");
+                     if (getContentResolver() != null) {
+                         updated = getContentResolver().update(
+                                 ProviderTableMeta.CONTENT_URI_FILE,
+                                 cv,
+                                 whereBuffer.toString(),
+                                 ancestorIds.toArray(new String[]{})
+                         );
+                     } else {
+                         try {
+                             updated = getContentProviderClient().update(
+                                     ProviderTableMeta.CONTENT_URI_FILE,
+                                     cv,
+                                     whereBuffer.toString(),
+                                     ancestorIds.toArray(new String[]{})
+                             );
+                         } catch (RemoteException e) {
+                             Log_OC.e(TAG, "Failed saving conflict in database " + e.getMessage());
+                         }
+                     }
+                 } // else file is ROOT folder, no parent to set in conflict
+             } else {
+                 /// update conflict in ancestor folders
+                 // (not directly unset; maybe there are more conflicts below them)
+                 String parentPath = file.getRemotePath();
+                 if (parentPath.endsWith(OCFile.PATH_SEPARATOR)) {
+                     parentPath = parentPath.substring(0, parentPath.length() - 1);
+                 }
+                 parentPath = parentPath.substring(0, parentPath.lastIndexOf(OCFile.PATH_SEPARATOR) + 1);
+                 Log_OC.d(TAG, "checking parents to remove conflict; STARTING with " + parentPath);
+                 while (parentPath.length() > 0) {
+                     String where =
+                             ProviderTableMeta.FILE_ETAG_IN_CONFLICT + " IS NOT NULL AND " +
+                                     ProviderTableMeta.FILE_CONTENT_TYPE + " != 'DIR' AND " +
+                                     ProviderTableMeta.FILE_ACCOUNT_OWNER + " = ? AND " +
+                                     ProviderTableMeta.FILE_PATH + " LIKE ?";
+                     Cursor descendentsInConflict = getContentResolver().query(
+                             ProviderTableMeta.CONTENT_URI_FILE,
+                             new String[]{ProviderTableMeta._ID},
+                             where,
+                             new String[]{mAccount.name, parentPath + "%"},
+                             null
+                     );
+                     if (descendentsInConflict == null || descendentsInConflict.getCount() == 0) {
+                         Log_OC.d(TAG, "NO MORE conflicts in " + parentPath);
+                         if (getContentResolver() != null) {
+                             updated = getContentResolver().update(
+                                     ProviderTableMeta.CONTENT_URI_FILE,
+                                     cv,
+                                     ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " +
+                                             ProviderTableMeta.FILE_PATH + "=?",
+                                     new String[]{mAccount.name, parentPath}
+                             );
+                         } else {
+                             try {
+                                 updated = getContentProviderClient().update(
+                                         ProviderTableMeta.CONTENT_URI_FILE,
+                                         cv,
+                                         ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " +
+                                                 ProviderTableMeta.FILE_PATH + "=?"
+                                         , new String[]{mAccount.name, parentPath}
+                                 );
+                             } catch (RemoteException e) {
+                                 Log_OC.e(TAG, "Failed saving conflict in database " + e.getMessage());
+                             }
+                         }
+                     } else {
+                         Log_OC.d(TAG, "STILL " + descendentsInConflict.getCount() + " in " + parentPath);
+                     }
+                     if (descendentsInConflict != null) {
+                         descendentsInConflict.close();
+                     }
+                     parentPath = parentPath.substring(0, parentPath.length() - 1);  // trim last /
+                     parentPath = parentPath.substring(0, parentPath.lastIndexOf(OCFile.PATH_SEPARATOR) + 1);
+                     Log_OC.d(TAG, "checking parents to remove conflict; NEXT " + parentPath);
+                 }
+             }
+         }
+     }
  }
@@@ -31,11 -31,13 +31,11 @@@ import java.io.File
  import third_parties.daveKoeller.AlphanumComparator;
  public class OCFile implements Parcelable, Comparable<OCFile> {
  
 -    public static final Parcelable.Creator<OCFile> CREATOR = new Parcelable.Creator<OCFile>() {
 -        @Override
 +    public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
          public OCFile createFromParcel(Parcel source) {
              return new OCFile(source);
          }
  
 -        @Override
          public OCFile[] newArray(int size) {
              return new OCFile[size];
          }
  
      private boolean mIsDownloading;
  
 +    private boolean mShowGridView;
 +
+     private String mEtagInConflict;    // Save file etag in the server, when there is a conflict. No conflict =  null
  
      /**
       * Create new {@link OCFile} with given path.
          mPublicLink = source.readString();
          mPermissions = source.readString();
          mRemoteId = source.readString();
-         mNeedsUpdateThumbnail = source.readInt() == 0;
-         mIsDownloading = source.readInt() == 0;
+         mNeedsUpdateThumbnail = source.readInt() == 1;
+         mIsDownloading = source.readInt() == 1;
+         mEtagInConflict = source.readString();
  
      }
  
          dest.writeString(mRemoteId);
          dest.writeInt(mNeedsUpdateThumbnail ? 1 : 0);
          dest.writeInt(mIsDownloading ? 1 : 0);
+         dest.writeString(mEtagInConflict);
      }
  
      /**
      }
  
      /**
-      * Adds a file to this directory. If this file is not a directory, an
-      * exception gets thrown.
-      *
-      * @param file to add
-      * @throws IllegalStateException if you try to add a something and this is
-      *                               not a directory
-      */
-     public void addFile(OCFile file) throws IllegalStateException {
-         if (isFolder()) {
-             file.mParentId = mId;
-             mNeedsUpdating = true;
-             return;
-         }
-         throw new IllegalStateException(
-                 "This is not a directory where you can add stuff to!");
-     }
-     /**
       * Used internally. Reset all file properties
       */
      private void resetData() {
          mRemoteId = null;
          mNeedsUpdateThumbnail = false;
          mIsDownloading = false;
+         mEtagInConflict = null;
      }
  
      /**
      }
  
      public void setEtag(String etag) {
-         this.mEtag = etag;
+         this.mEtag = (etag != null ? etag : "");
      }
  
      public boolean isShareByLink() {
          return mShareByLink;
      }
          this.mIsDownloading = isDownloading;
      }
  
-     public boolean isSynchronizing() {
-         // TODO real implementation
-         return false;
+     public String getEtagInConflict() {
+         return mEtagInConflict;
+     }
+     public void setEtagInConflict(String etagInConflict) {
+         mEtagInConflict = etagInConflict;
      }
  }
@@@ -34,7 -34,6 +34,6 @@@ import com.owncloud.android.files.servi
  import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
  import com.owncloud.android.files.services.FileUploader;
  import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
- import com.owncloud.android.services.OperationsService;
  import com.owncloud.android.services.OperationsService.OperationsServiceBinder;
  import com.owncloud.android.ui.activity.ComponentsGetter;
  
@@@ -106,21 -105,25 +105,25 @@@ public class FileMenuFilter 
       * @param toHide            List to save the options that must be shown in the menu.
       */
      private void filter(List<Integer> toShow, List <Integer> toHide) {
-         boolean downloading = false;
-         boolean uploading = false;
+         boolean synchronizing = false;
          if (mComponentsGetter != null && mFile != null && mAccount != null) {
-             FileDownloaderBinder downloaderBinder = mComponentsGetter.getFileDownloaderBinder();
-             downloading = (downloaderBinder != null && downloaderBinder.isDownloading(mAccount, mFile));
              OperationsServiceBinder opsBinder = mComponentsGetter.getOperationsServiceBinder();
-             downloading |= (opsBinder != null && opsBinder.isSynchronizing(mAccount, mFile.getRemotePath()));
              FileUploaderBinder uploaderBinder = mComponentsGetter.getFileUploaderBinder();
-             uploading = (uploaderBinder != null && uploaderBinder.isUploading(mAccount, mFile));
+             FileDownloaderBinder downloaderBinder = mComponentsGetter.getFileDownloaderBinder();
+             synchronizing = (
+                 // comparing local and remote
+                 (opsBinder != null && opsBinder.isSynchronizing(mAccount, mFile.getRemotePath())) ||
+                 // downloading
+                 (downloaderBinder != null && downloaderBinder.isDownloading(mAccount, mFile)) ||
+                 // uploading
+                 (uploaderBinder != null && uploaderBinder.isUploading(mAccount, mFile))
+             );
          }
  
          /// decision is taken for each possible action on a file in the menu
  
          // DOWNLOAD 
-         if (mFile == null || mFile.isDown() || downloading || uploading) {
+         if (mFile == null || mFile.isDown() || mFile.isFolder() || synchronizing) {
              toHide.add(R.id.action_download_file);
  
          } else {
          }
  
          // RENAME
-         if (mFile == null || downloading || uploading) {
+         if (mFile == null || synchronizing) {
              toHide.add(R.id.action_rename_file);
  
          } else {
          }
  
          // MOVE & COPY
-         if (mFile == null || downloading || uploading) {
+         if (mFile == null || synchronizing) {
              toHide.add(R.id.action_move);
              toHide.add(R.id.action_copy);
          } else {
          }
  
          // REMOVE
-         if (mFile == null || downloading || uploading) {
+         if (mFile == null || synchronizing) {
              toHide.add(R.id.action_remove_file);
  
          } else {
          }
  
          // OPEN WITH (different to preview!)
-         if (mFile == null || mFile.isFolder() || !mFile.isDown() || downloading || uploading) {
+         if (mFile == null || mFile.isFolder() || !mFile.isDown() || synchronizing) {
              toHide.add(R.id.action_open_file_with);
  
          } else {
              toShow.add(R.id.action_open_file_with);
          }
  
+         // CANCEL SYNCHRONIZATION
+         if (mFile == null || !synchronizing) {
+             toHide.add(R.id.action_cancel_sync);
  
-         // CANCEL DOWNLOAD
-         if (mFile == null || !downloading) {
-             toHide.add(R.id.action_cancel_download);
-         } else {
-             toShow.add(R.id.action_cancel_download);
-         }
-         // CANCEL UPLOAD
-         if (mFile == null || !uploading || mFile.isFolder()) {
-             toHide.add(R.id.action_cancel_upload);
          } else {
-             toShow.add(R.id.action_cancel_upload);
+             toShow.add(R.id.action_cancel_sync);
          }
  
-         // SYNC FILE CONTENTS
-         if (mFile == null || mFile.isFolder() || !mFile.isDown() || downloading || uploading) {
+         // SYNC CONTENTS (BOTH FILE AND FOLDER)
+         if (mFile == null || (!mFile.isFolder() && !mFile.isDown()) || synchronizing) {
              toHide.add(R.id.action_sync_file);
          } else {
              toShow.add(R.id.action_sync_file);
          }
          // SEND
          boolean sendAllowed = (mContext != null &&
                  mContext.getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on"));
-         if (mFile == null || !sendAllowed || mFile.isFolder() || uploading || downloading) {
+         if (mFile == null || !sendAllowed || mFile.isFolder() || synchronizing) {
              toHide.add(R.id.action_send_file);
          } else {
              toShow.add(R.id.action_send_file);
          }
  
          // FAVORITES
-         if (mFile == null || downloading || uploading || mFile.isFolder() || mFile.isFavorite()) {
+         if (mFile == null || synchronizing || mFile.isFolder() || mFile.isFavorite()) {
              toHide.add(R.id.action_favorite_file);
          } else {
              toShow.add(R.id.action_favorite_file);
          }
  
          // UNFAVORITES
-         if (mFile == null || downloading || uploading || mFile.isFolder() || !mFile.isFavorite()) {
+         if (mFile == null || synchronizing || mFile.isFolder() || !mFile.isFavorite()) {
              toHide.add(R.id.action_unfavorite_file);
          } else {
              toShow.add(R.id.action_unfavorite_file);
          }
 -
      }
  
  }
@@@ -27,17 -27,14 +27,17 @@@ import android.content.Context
  import android.content.Intent;
  import android.content.pm.PackageManager;
  import android.content.pm.ResolveInfo;
 +import android.graphics.Bitmap;
  import android.net.Uri;
  import android.support.v4.app.DialogFragment;
  import android.webkit.MimeTypeMap;
  import android.widget.Toast;
  
 +import com.owncloud.android.MainApp;
  import com.owncloud.android.R;
  import com.owncloud.android.authentication.AccountUtils;
  import com.owncloud.android.datamodel.OCFile;
 +import com.owncloud.android.datamodel.ThumbnailsCacheManager;
  import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
  import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
  import com.owncloud.android.lib.common.network.WebdavUtils;
@@@ -46,21 -43,12 +46,21 @@@ import com.owncloud.android.lib.resourc
  import com.owncloud.android.services.OperationsService;
  import com.owncloud.android.services.observer.FileObserverService;
  import com.owncloud.android.ui.activity.FileActivity;
 +import com.owncloud.android.ui.adapter.DiskLruImageCacheFileProvider;
  import com.owncloud.android.ui.dialog.ShareLinkToDialog;
  
  import org.apache.http.protocol.HTTP;
  
  import java.util.List;
  
 +import java.io.ByteArrayOutputStream;
 +import java.io.File;
 +import java.io.FileNotFoundException;
 +import java.io.FileOutputStream;
 +import java.io.IOException;
 +
 +import java.util.ArrayList;
 +
  /**
   *
   */
@@@ -248,32 -236,13 +248,37 @@@ public class FileOperationsHelper 
          }
      }
  
 +    public void sendCachedImage(OCFile file) {
 +        if (file != null) {
 +            Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND);
 +            // set MimeType
 +            sendIntent.setType(file.getMimetype());
 +//            sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("content://" + DiskLruImageCacheFileProvider.AUTHORITY + "/#" + file.getRemoteId() + "#" + file.getFileName()));
 +            sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("content://" + DiskLruImageCacheFileProvider.AUTHORITY + file.getRemotePath()));
 +            sendIntent.putExtra(Intent.ACTION_SEND, true);      // Send Action
 +
 +            // Show dialog, without the own app
 +            String[] packagesToExclude = new String[] { mFileActivity.getPackageName() };
 +            DialogFragment chooserDialog = ShareLinkToDialog.newInstance(sendIntent, packagesToExclude, file);
 +            chooserDialog.show(mFileActivity.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG);
 +        } else {
 +            Log_OC.wtf(TAG, "Trying to send a NULL OCFile");
 +        }
 +    }
 +
 +    public void syncFiles(ArrayList<OCFile> files) {
 +        for (OCFile file: files) {
 +            syncFile(file);
 +        }
 +    }
 +
+     /**
+      * Request the synchronization of a file or folder with the OC server, including its contents.
+      *
+      * @param file          The file or folder to synchronize
+      */
      public void syncFile(OCFile file) {
-         if (!file.isFolder()) {
+         if (!file.isFolder()){
              Intent intent = new Intent(mFileActivity, OperationsService.class);
              intent.setAction(OperationsService.ACTION_SYNC_FILE);
              intent.putExtra(OperationsService.EXTRA_ACCOUNT, mFileActivity.getAccount());
              intent.putExtra(OperationsService.EXTRA_SYNC_FILE_CONTENTS, true);
              mWaitingForOpId = mFileActivity.getOperationsServiceBinder().queueNewOperation(intent);
              mFileActivity.showLoadingDialog();
 -            
 +
          } else {
              Intent intent = new Intent(mFileActivity, OperationsService.class);
              intent.setAction(OperationsService.ACTION_SYNC_FOLDER);
              intent.putExtra(OperationsService.EXTRA_ACCOUNT, mFileActivity.getAccount());
              intent.putExtra(OperationsService.EXTRA_REMOTE_PATH, file.getRemotePath());
              mFileActivity.startService(intent);
          }
      }
  
 +    public void toggleFavorites(ArrayList<OCFile> files, boolean isFavorite){
 +        for (OCFile file: files) {
 +            toggleFavorite(file, isFavorite);
 +        }
 +    }
 +
      public void toggleFavorite(OCFile file, boolean isFavorite) {
          file.setFavorite(isFavorite);
          mFileActivity.getStorageManager().saveFile(file);
  
          // for both files and folders
          FileDownloaderBinder downloaderBinder = mFileActivity.getFileDownloaderBinder();
-         FileUploaderBinder uploaderBinder = mFileActivity.getFileUploaderBinder();
          if (downloaderBinder != null && downloaderBinder.isDownloading(account, file)) {
              downloaderBinder.cancel(account, file);
-             // TODO - review why is this here, and solve in a better way
-             // Remove etag for parent, if file is a favorite
-             if (file.isFavorite()) {
-                 OCFile parent = mFileActivity.getStorageManager().getFileById(file.getParentId());
-                 parent.setEtag("");
-                 mFileActivity.getStorageManager().saveFile(parent);
-             }
-         } else if (uploaderBinder != null && uploaderBinder.isUploading(account, file)) {
+         }
+         FileUploaderBinder uploaderBinder = mFileActivity.getFileUploaderBinder();
+         if (uploaderBinder != null && uploaderBinder.isUploading(account, file)) {
              uploaderBinder.cancel(account, file);
          }
      }
          service.putExtra(OperationsService.EXTRA_ACCOUNT, mFileActivity.getAccount());
          mWaitingForOpId =  mFileActivity.getOperationsServiceBinder().queueNewOperation(service);
  
 -        mFileActivity.showLoadingDialog();
 +        // TODO Tobi loading dialog?
 +        // mFileActivity.showLoadingDialog();
      }
  
      /**
  package com.owncloud.android.files.services;
  
  import java.io.File;
- import java.io.IOException;
  import java.util.AbstractList;
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.Map;
  import java.util.Vector;
- import java.util.concurrent.ConcurrentHashMap;
- import java.util.concurrent.ConcurrentMap;
  
  import android.accounts.Account;
  import android.accounts.AccountManager;
- import android.accounts.AccountsException;
  import android.accounts.OnAccountsUpdateListener;
  import android.app.NotificationManager;
  import android.app.PendingIntent;
@@@ -46,6 -42,7 +42,7 @@@ import android.os.Looper
  import android.os.Message;
  import android.os.Process;
  import android.support.v4.app.NotificationCompat;
+ import android.util.Pair;
  import android.webkit.MimeTypeMap;
  
  import com.owncloud.android.R;
@@@ -86,6 -83,7 +83,7 @@@ public class FileUploader extends Servi
      public static final String EXTRA_REMOTE_PATH = "REMOTE_PATH";
      public static final String EXTRA_OLD_REMOTE_PATH = "OLD_REMOTE_PATH";
      public static final String EXTRA_OLD_FILE_PATH = "OLD_FILE_PATH";
+     public static final String EXTRA_LINKED_TO_PATH = "LINKED_TO";
      public static final String ACCOUNT_NAME = "ACCOUNT_NAME";
  
      public static final String KEY_FILE = "FILE";
      public static final int LOCAL_BEHAVIOUR_COPY = 0;
      public static final int LOCAL_BEHAVIOUR_MOVE = 1;
      public static final int LOCAL_BEHAVIOUR_FORGET = 2;
 +    public static final int LOCAL_BEHAVIOUR_REMOVE = 3;
  
      public static final int UPLOAD_SINGLE_FILE = 0;
      public static final int UPLOAD_MULTIPLE_FILES = 1;
      private ServiceHandler mServiceHandler;
      private IBinder mBinder;
      private OwnCloudClient mUploadClient = null;
-     private Account mLastAccount = null;
+     private Account mCurrentAccount = null;
      private FileDataStorageManager mStorageManager;
  
-     private ConcurrentMap<String, UploadFileOperation> mPendingUploads =
-             new ConcurrentHashMap<String, UploadFileOperation>();
+     private IndexedForest<UploadFileOperation> mPendingUploads = new IndexedForest<UploadFileOperation>();
      private UploadFileOperation mCurrentUpload = null;
  
      private NotificationManager mNotificationManager;
      }
  
      /**
-      * Builds a key for mPendingUploads from the account and file to upload
-      *
-      * @param account   Account where the file to upload is stored
-      * @param file      File to upload
-      */
-     private String buildRemoteName(Account account, OCFile file) {
-         return account.name + file.getRemotePath();
-     }
-     private String buildRemoteName(Account account, String remotePath) {
-         return account.name + remotePath;
-     }
-     /**
       * Checks if an ownCloud server version should support chunked uploads.
       *
       * @param version OwnCloud version instance corresponding to an ownCloud
       *            server.
       * @return 'True' if the ownCloud server with version supports chunked
       *         uploads.
+      *
+      * TODO - move to OCClient
       */
      private static boolean chunkedUploadIsSupported(OwnCloudVersion version) {
          return (version != null && version.compareTo(OwnCloudVersion.owncloud_v4_5) >= 0);
              files = new OCFile[localPaths.length];
              for (int i = 0; i < localPaths.length; i++) {
                  files[i] = obtainNewOCFileToUpload(remotePaths[i], localPaths[i],
-                         ((mimeTypes != null) ? mimeTypes[i] : null), storageManager);
+                         ((mimeTypes != null) ? mimeTypes[i] : null));
                  if (files[i] == null) {
                      // TODO @andomaex add failure Notification
                      return Service.START_NOT_STICKY;
          UploadFileOperation newUpload = null;
          try {
              for (int i = 0; i < files.length; i++) {
-                 uploadKey = buildRemoteName(account, files[i].getRemotePath());
-                 newUpload = new UploadFileOperation(account, files[i], chunked, isInstant,
+                 newUpload = new UploadFileOperation(
+                         account,
+                         files[i],
+                         chunked,
+                         isInstant,
                          forceOverwrite, localAction,
-                         getApplicationContext());
+                         getApplicationContext()
+                 );
                  if (isInstant) {
                      newUpload.setRemoteFolderToBeCreated();
                  }
-                 // Grants that the file only upload once time
-                 mPendingUploads.putIfAbsent(uploadKey, newUpload);
                  newUpload.addDatatransferProgressListener(this);
-                 newUpload.addDatatransferProgressListener((FileUploaderBinder)mBinder);
+                 newUpload.addDatatransferProgressListener((FileUploaderBinder) mBinder);
+                 Pair<String, String> putResult = mPendingUploads.putIfAbsent(
+                         account, files[i].getRemotePath(), newUpload
+                 );
+                 uploadKey = putResult.first;
                  requestedUploads.add(uploadKey);
              }
  
              msg.obj = requestedUploads;
              mServiceHandler.sendMessage(msg);
          }
-         Log_OC.i(TAG, "mPendingUploads size:" + mPendingUploads.size());
          return Service.START_NOT_STICKY;
      }
  
          /**
           * Cancels a pending or current upload of a remote file.
           *
-          * @param account Owncloud account where the remote file will be stored.
-          * @param file A file in the queue of pending uploads
+          * @param account   ownCloud account where the remote file will be stored.
+          * @param file      A file in the queue of pending uploads
           */
          public void cancel(Account account, OCFile file) {
-             UploadFileOperation upload;
-             synchronized (mPendingUploads) {
-                 upload = mPendingUploads.remove(buildRemoteName(account, file));
-             }
+             Pair<UploadFileOperation, String> removeResult = mPendingUploads.remove(account, file.getRemotePath());
+             UploadFileOperation upload = removeResult.first;
              if (upload != null) {
                  upload.cancel();
+             } else {
+                 if (mCurrentUpload != null && mCurrentAccount != null &&
+                         mCurrentUpload.getRemotePath().startsWith(file.getRemotePath()) &&
+                         account.name.equals(mCurrentAccount.name)) {
+                     mCurrentUpload.cancel();
+                 }
              }
          }
  
          /**
-          * Cancels a pending or current upload for an account
+          * Cancels all the uploads for an account
           *
-          * @param account Owncloud accountName where the remote file will be stored.
+          * @param account   ownCloud account.
           */
          public void cancel(Account account) {
              Log_OC.d(TAG, "Account= " + account.name);
                  }
              }
              // Cancel pending uploads
-             cancelUploadForAccount(account.name);
+             cancelUploadsForAccount(account);
          }
  
          public void clearListeners() {
              mBoundListeners.clear();
          }
  
          /**
           * Returns True when the file described by 'file' is being uploaded to
           * the ownCloud account 'account' or waiting for it
           * @param file      A file that could be in the queue of pending uploads
           */
          public boolean isUploading(Account account, OCFile file) {
-             if (account == null || file == null)
-                 return false;
-             String targetKey = buildRemoteName(account, file);
-             synchronized (mPendingUploads) {
-                 if (file.isFolder()) {
-                     // this can be slow if there are many uploads :(
-                     Iterator<String> it = mPendingUploads.keySet().iterator();
-                     boolean found = false;
-                     while (it.hasNext() && !found) {
-                         found = it.next().startsWith(targetKey);
-                     }
-                     return found;
-                 } else {
-                     return (mPendingUploads.containsKey(targetKey));
-                 }
-             }
+             if (account == null || file == null) return false;
+             return (mPendingUploads.contains(account, file.getRemotePath()));
          }
  
  
          }
  
          /**
-          * Review uploads and cancel it if its account doesn't exist
+          * Builds a key for the map of listeners.
+          *
+          * TODO remove and replace key with file.getFileId() after changing current policy (upload file, then
+          * add to local database) to better policy (add to local database, then upload)
+          *
+          * @param account       ownCloud account where the file to upload belongs.
+          * @param file          File to upload
+          * @return              Key
           */
-         public void checkAccountOfCurrentUpload() {
-             if (mCurrentUpload != null &&
-                     !AccountUtils.exists(mCurrentUpload.getAccount(), getApplicationContext())) {
-                 mCurrentUpload.cancel();
-             }
-             // The rest of uploads are cancelled when they try to start
+         private String buildRemoteName(Account account, OCFile file) {
+             return account.name + file.getRemotePath();
          }
      }
  
      /**
      /**
       * Core upload method: sends the file(s) to upload
       *
-      * @param uploadKey Key to access the upload to perform, contained in
-      *            mPendingUploads
+      * @param uploadKey Key to access the upload to perform, contained in mPendingUploads
       */
      public void uploadFile(String uploadKey) {
  
-         synchronized (mPendingUploads) {
-             mCurrentUpload = mPendingUploads.get(uploadKey);
-         }
+         mCurrentUpload = mPendingUploads.get(uploadKey);
  
          if (mCurrentUpload != null) {
              // Detect if the account exists
              if (AccountUtils.exists(mCurrentUpload.getAccount(), getApplicationContext())) {
                  Log_OC.d(TAG, "Account " + mCurrentUpload.getAccount().name + " exists");
                  RemoteOperationResult uploadResult = null, grantResult;
  
                  try {
-                     /// prepare client object to send requests to the ownCloud server
-                     if (mUploadClient == null ||
-                             !mLastAccount.equals(mCurrentUpload.getAccount())) {
-                         mLastAccount = mCurrentUpload.getAccount();
-                         mStorageManager =
-                                 new FileDataStorageManager(mLastAccount, getContentResolver());
-                         OwnCloudAccount ocAccount = new OwnCloudAccount(mLastAccount, this);
-                         mUploadClient = OwnCloudClientManagerFactory.getDefaultSingleton().
-                                 getClientFor(ocAccount, this);
-                     }
+                     /// prepare client object to send the request to the ownCloud server
+                     if (mCurrentAccount == null || !mCurrentAccount.equals(mCurrentUpload.getAccount())) {
+                         mCurrentAccount = mCurrentUpload.getAccount();
+                         mStorageManager = new FileDataStorageManager(
+                                 mCurrentAccount,
+                                 getContentResolver()
+                         );
+                     }   // else, reuse storage manager from previous operation
+                     // always get client from client manager, to get fresh credentials in case of update
+                     OwnCloudAccount ocAccount = new OwnCloudAccount(mCurrentAccount, this);
+                     mUploadClient = OwnCloudClientManagerFactory.getDefaultSingleton().
+                             getClientFor(ocAccount, this);
  
                      /// check the existence of the parent folder for the file to upload
                      String remoteParentPath = new File(mCurrentUpload.getRemotePath()).getParent();
                          uploadResult = mCurrentUpload.execute(mUploadClient);
                          if (uploadResult.isSuccess()) {
                              saveUploadedFile();
+                         } else if (uploadResult.getCode() == ResultCode.SYNC_CONFLICT) {
+                             mStorageManager.saveConflict(mCurrentUpload.getFile(),
+                                     mCurrentUpload.getFile().getEtagInConflict());
                          }
                      } else {
                          uploadResult = grantResult;
                      }
  
-                 } catch (AccountsException e) {
-                     Log_OC.e(TAG, "Error while trying to get autorization for " +
-                             mLastAccount.name, e);
-                     uploadResult = new RemoteOperationResult(e);
-                 } catch (IOException e) {
-                     Log_OC.e(TAG, "Error while trying to get autorization for " +
-                             mLastAccount.name, e);
+                 } catch (Exception e) {
+                     Log_OC.e(TAG, "Error uploading", e);
                      uploadResult = new RemoteOperationResult(e);
  
                  } finally {
-                     synchronized (mPendingUploads) {
-                         mPendingUploads.remove(uploadKey);
-                         Log_OC.i(TAG, "Remove CurrentUploadItem from pending upload Item Map.");
-                     }
-                     if (uploadResult != null && uploadResult.isException()) {
-                         // enforce the creation of a new client object for next uploads;
-                         // this grant that a new socket will be created in the future if
-                         // the current exception is due to an abrupt lose of network connection
-                         mUploadClient = null;
+                     Pair<UploadFileOperation, String> removeResult;
+                     if (mCurrentUpload.wasRenamed()) {
+                         removeResult = mPendingUploads.removePayload(
+                                 mCurrentAccount,
+                                 mCurrentUpload.getOldFile().getRemotePath()
+                         );
+                     } else {
+                         removeResult = mPendingUploads.removePayload(
+                                 mCurrentAccount,
+                                 mCurrentUpload.getRemotePath()
+                         );
                      }
-                 }
  
-                 /// notify result
-                 notifyUploadResult(uploadResult, mCurrentUpload);
-                 sendFinalBroadcast(mCurrentUpload, uploadResult);
+                     /// notify result
+                     notifyUploadResult(mCurrentUpload, uploadResult);
+                     sendBroadcastUploadFinished(mCurrentUpload, uploadResult, removeResult.second);
+                 }
  
              } else {
                  // Cancel the transfer
                  Log_OC.d(TAG, "Account " + mCurrentUpload.getAccount().toString() +
                          " doesn't exist");
-                 cancelUploadForAccount(mCurrentUpload.getAccount().name);
+                 cancelUploadsForAccount(mCurrentUpload.getAccount());
  
              }
          }
       * synchronized with the server, specially the modification time and Etag
       * (where available)
       *
-      * TODO refactor this ugly thing
+      * TODO move into UploadFileOperation
       */
      private void saveUploadedFile() {
          OCFile file = mCurrentUpload.getFile();
          if (result.isSuccess()) {
              updateOCFile(file, (RemoteFile) result.getData().get(0));
              file.setLastSyncDateForProperties(syncDate);
+         } else {
+             Log_OC.e(TAG, "Error reading properties of file after successful upload; this is gonna hurt...");
          }
  
          // / maybe this would be better as part of UploadFileOperation... or
              if (oldFile.fileExists()) {
                  oldFile.setStoragePath(null);
                  mStorageManager.saveFile(oldFile);
+                 mStorageManager.saveConflict(oldFile, null);
  
              } // else: it was just an automatic renaming due to a name
              // coincidence; nothing else is needed, the storagePath is right
          }
          file.setNeedsUpdateThumbnail(true);
          mStorageManager.saveFile(file);
+         mStorageManager.saveConflict(file, null);
+         
          mStorageManager.triggerMediaScan(file.getStoragePath());
      }
  
      private void updateOCFile(OCFile file, RemoteFile remoteFile) {
          file.setMimetype(remoteFile.getMimeType());
          file.setModificationTimestamp(remoteFile.getModifiedTimestamp());
          file.setModificationTimestampAtLastSyncForData(remoteFile.getModifiedTimestamp());
-         // file.setEtag(remoteFile.getEtag());    // TODO Etag, where available
+         file.setEtag(remoteFile.getEtag());
          file.setRemoteId(remoteFile.getRemoteId());
      }
  
-     private OCFile obtainNewOCFileToUpload(String remotePath, String localPath, String mimeType,
-                                            FileDataStorageManager storageManager) {
+     private OCFile obtainNewOCFileToUpload(String remotePath, String localPath, String mimeType) {
  
          // MIME type
          if (mimeType == null || mimeType.length() <= 0) {
      /**
       * Updates the status notification with the result of an upload operation.
       *
-      * @param uploadResult Result of the upload operation.
-      * @param upload Finished upload operation
+      * @param uploadResult  Result of the upload operation.
+      * @param upload        Finished upload operation
       */
-     private void notifyUploadResult(
-             RemoteOperationResult uploadResult, UploadFileOperation upload) {
+     private void notifyUploadResult(UploadFileOperation upload,
+                                     RemoteOperationResult uploadResult) {
          Log_OC.d(TAG, "NotifyUploadResult with resultCode: " + uploadResult.getCode());
          // / cancelled operation or success -> silent removal of progress notification
          mNotificationManager.cancel(R.string.uploader_upload_in_progress_ticker);
       * Sends a broadcast in order to the interested activities can update their
       * view
       *
-      * @param upload Finished upload operation
-      * @param uploadResult Result of the upload operation
+      * @param upload                    Finished upload operation
+      * @param uploadResult              Result of the upload operation
+      * @param unlinkedFromRemotePath    Path in the uploads tree where the upload was unlinked from
       */
-     private void sendFinalBroadcast(UploadFileOperation upload, RemoteOperationResult uploadResult) {
+     private void sendBroadcastUploadFinished(
+             UploadFileOperation upload,
+             RemoteOperationResult uploadResult,
+             String unlinkedFromRemotePath) {
          Intent end = new Intent(getUploadFinishMessage());
          end.putExtra(EXTRA_REMOTE_PATH, upload.getRemotePath()); // real remote
          // path, after
          end.putExtra(EXTRA_OLD_FILE_PATH, upload.getOriginalStoragePath());
          end.putExtra(ACCOUNT_NAME, upload.getAccount().name);
          end.putExtra(EXTRA_UPLOAD_RESULT, uploadResult.isSuccess());
+         if (unlinkedFromRemotePath != null) {
+             end.putExtra(EXTRA_LINKED_TO_PATH, unlinkedFromRemotePath);
+         }
          sendStickyBroadcast(end);
      }
  
       * @param localPath         Full path to a file in the local file system.
       * @param mimeType          MIME type of the file.
       * @return true if is needed to add the pdf file extension to the file
+      *
+      * TODO - move to OCFile or Utils class
       */
      private boolean isPdfFileFromContentProviderWithoutExtension(String localPath,
                                                                   String mimeType) {
  
      /**
       * Remove uploads of an account
-      * @param accountName       Name of an OC account
+      *
+      * @param account       Downloads account to remove
       */
-     private void cancelUploadForAccount(String accountName){
-         // this can be slow if there are many uploads :(
-         Iterator<String> it = mPendingUploads.keySet().iterator();
-         Log_OC.d(TAG, "Number of pending updloads= "  + mPendingUploads.size());
-         while (it.hasNext()) {
-             String key = it.next();
-             Log_OC.d(TAG, "mPendingUploads CANCELLED " + key);
-             if (key.startsWith(accountName)) {
-                 synchronized (mPendingUploads) {
-                     mPendingUploads.remove(key);
-                 }
-             }
-         }
+     private void cancelUploadsForAccount(Account account){
+         // Cancel pending uploads
+         mPendingUploads.remove(account);
      }
  }
  
  package com.owncloud.android.operations;
  
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.OutputStream;
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  import java.util.Vector;
  
- import org.apache.http.HttpStatus;
  import android.accounts.Account;
  import android.content.Context;
  import android.content.Intent;
  import android.util.Log;
- //import android.support.v4.content.LocalBroadcastManager;
  
- import com.owncloud.android.MainApp;
  import com.owncloud.android.datamodel.FileDataStorageManager;
  import com.owncloud.android.datamodel.OCFile;
  
@@@ -50,7 -41,6 +41,6 @@@ import com.owncloud.android.lib.common.
  import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
  import com.owncloud.android.lib.common.utils.Log_OC;
  import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation;
- import com.owncloud.android.lib.resources.files.FileUtils;
  import com.owncloud.android.lib.resources.files.ReadRemoteFileOperation;
  import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation;
  import com.owncloud.android.lib.resources.files.RemoteFile;
@@@ -120,7 -110,10 +110,10 @@@ public class RefreshFolderOperation ext
      /** 'True' means that Etag will be ignored */
      private boolean mIgnoreETag;
  
-     
+     private List<SynchronizeFileOperation> mFilesToSyncContents;
+     // this will be used for every file when 'folder synchronization' replaces 'folder download'
      /**
       * Creates a new instance of {@link RefreshFolderOperation}.
       * 
          mForgottenLocalFiles = new HashMap<String, String>();
          mRemoteFolderChanged = false;
          mIgnoreETag = ignoreETag;
+         mFilesToSyncContents = new Vector<SynchronizeFileOperation>();
      }
      
      
          mConflictsFound = 0;
          mForgottenLocalFiles.clear();
          
-         if (FileUtils.PATH_SEPARATOR.equals(mLocalFolder.getRemotePath()) && !mSyncFullAccount) {
+         if (OCFile.ROOT_PATH.equals(mLocalFolder.getRemotePath()) && !mSyncFullAccount) {
              updateOCVersion(client);
          }
          
              if (mRemoteFolderChanged) {
                  result = fetchAndSyncRemoteFolder(client);
              } else {
 -                mChildren = mStorageManager.getFolderContent(mLocalFolder/*, false*/);
+                 fetchFavoritesToSyncFromLocalData();
 +                mChildren = mStorageManager.getFolderContent(mLocalFolder, false);
              }
+             if (result.isSuccess()) {
+                 // request for the synchronization of KEPT-IN-SYNC file contents
+                 startContentSynchronizations(mFilesToSyncContents, client);
+             }
          }
          
          if (!mSyncFullAccount) {            
      private RemoteOperationResult checkForChanges(OwnCloudClient client) {
          mRemoteFolderChanged = true;
          RemoteOperationResult result = null;
-         String remotePath = null;
+         String remotePath = mLocalFolder.getRemotePath();
  
-         remotePath = mLocalFolder.getRemotePath();
          Log_OC.d(TAG, "Checking changes in " + mAccount.name + remotePath);
          
          // remote request 
  
              result = new RemoteOperationResult(ResultCode.OK);
          
-             Log_OC.i(TAG, "Checked " + mAccount.name + remotePath + " : " + 
+             Log_OC.i(TAG, "Checked " + mAccount.name + remotePath + " : " +
                      (mRemoteFolderChanged ? "changed" : "not changed"));
              
          } else {
          mLocalFolder = mStorageManager.getFileByPath(mLocalFolder.getRemotePath());
  
          // parse data from remote folder 
-         OCFile remoteFolder = fillOCFile((RemoteFile)folderAndFiles.get(0));
+         OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) folderAndFiles.get(0));
          remoteFolder.setParentId(mLocalFolder.getParentId());
          remoteFolder.setFileId(mLocalFolder.getFileId());
          
-         Log_OC.d(TAG, "Remote folder " + mLocalFolder.getRemotePath() 
+         Log_OC.d(TAG, "Remote folder " + mLocalFolder.getRemotePath()
                  + " changed - starting update of local data ");
          
          List<OCFile> updatedFiles = new Vector<OCFile>(folderAndFiles.size() - 1);
-         List<SynchronizeFileOperation> filesToSyncContents = new Vector<SynchronizeFileOperation>();
+         mFilesToSyncContents.clear();
  
          // get current data about local contents of the folder to synchronize
 -        // TODO Enable when "On Device" is recovered ?
 -        List<OCFile> localFiles = mStorageManager.getFolderContent(mLocalFolder/*, false*/);
 +        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);
          }
          
          // loop to update every child
-         OCFile remoteFile = null, localFile = null;
+         OCFile remoteFile = null, localFile = null, updatedFile = null;
+         RemoteFile r;
          for (int i=1; i<folderAndFiles.size(); i++) {
              /// new OCFile instance with the data from the server
-             remoteFile = fillOCFile((RemoteFile)folderAndFiles.get(i));
-             remoteFile.setParentId(mLocalFolder.getFileId());
+             r = (RemoteFile) folderAndFiles.get(i);
+             remoteFile = FileStorageUtils.fillOCFile(r);
+             /// new OCFile instance to merge fresh data from server with local state
+             updatedFile = FileStorageUtils.fillOCFile(r);
+             updatedFile.setParentId(mLocalFolder.getFileId());
  
              /// retrieve local data for the read file 
              //  localFile = mStorageManager.getFileByPath(remoteFile.getRemotePath());
              localFile = localFilesMap.remove(remoteFile.getRemotePath());
              
-             /// add to the remoteFile (the new one) data about LOCAL STATE (not existing in server)
-             remoteFile.setLastSyncDateForProperties(mCurrentSyncTime);
+             /// add to updatedFile data about LOCAL STATE (not existing in server)
+             updatedFile.setLastSyncDateForProperties(mCurrentSyncTime);
              if (localFile != null) {
-                 // some properties of local state are kept unmodified
-                 remoteFile.setFileId(localFile.getFileId());
-                 remoteFile.setFavorite(localFile.isFavorite());
-                 remoteFile.setLastSyncDateForData(localFile.getLastSyncDateForData());
-                 remoteFile.setModificationTimestampAtLastSyncForData(
+                 updatedFile.setFileId(localFile.getFileId());
+                 updatedFile.setFavorite(localFile.isFavorite());
+                 updatedFile.setLastSyncDateForData(localFile.getLastSyncDateForData());
+                 updatedFile.setModificationTimestampAtLastSyncForData(
                          localFile.getModificationTimestampAtLastSyncForData()
                  );
-                 remoteFile.setStoragePath(localFile.getStoragePath());
-                 // eTag will not be updated unless contents are synchronized 
-                 //  (Synchronize[File|Folder]Operation with remoteFile as parameter)
-                 remoteFile.setEtag(localFile.getEtag());    
-                 if (remoteFile.isFolder()) {
-                     remoteFile.setFileLength(localFile.getFileLength()); 
+                 updatedFile.setStoragePath(localFile.getStoragePath());
+                 // eTag will not be updated unless file CONTENTS are synchronized
+                 updatedFile.setEtag(localFile.getEtag());
+                 if (updatedFile.isFolder()) {
+                     updatedFile.setFileLength(localFile.getFileLength());
                          // TODO move operations about size of folders to FileContentProvider
                  } else if (mRemoteFolderChanged && remoteFile.isImage() &&
                          remoteFile.getModificationTimestamp() !=
                                  localFile.getModificationTimestamp()) {
-                     remoteFile.setNeedsUpdateThumbnail(true);
+                     updatedFile.setNeedsUpdateThumbnail(true);
                      Log.d(TAG, "Image " + remoteFile.getFileName() + " updated on the server");
                  }
-                 remoteFile.setPublicLink(localFile.getPublicLink());
-                 remoteFile.setShareByLink(localFile.isShareByLink());
+                 updatedFile.setPublicLink(localFile.getPublicLink());
+                 updatedFile.setShareByLink(localFile.isShareByLink());
+                 updatedFile.setEtagInConflict(localFile.getEtagInConflict());
              } else {
-                 // remote eTag will not be updated unless contents are synchronized 
-                 //  (Synchronize[File|Folder]Operation with remoteFile as parameter)
-                 remoteFile.setEtag(""); 
+                 // remote eTag will not be updated unless file CONTENTS are synchronized
+                 updatedFile.setEtag("");
              }
  
              /// check and fix, if needed, local storage path
-             checkAndFixForeignStoragePath(remoteFile);      // policy - local files are COPIED 
-                                                             // into the ownCloud local folder;
-             searchForLocalFileInDefaultPath(remoteFile);    // legacy   
+             FileStorageUtils.searchForLocalFileInDefaultPath(updatedFile, mAccount);
  
              /// prepare content synchronization for kept-in-sync files
-             if (remoteFile.isFavorite()) {
+             if (updatedFile.isFavorite()) {
                  SynchronizeFileOperation operation = new SynchronizeFileOperation(  localFile,        
                                                                                      remoteFile, 
                                                                                      mAccount, 
                                                                                      mContext
                                                                                      );
                  
-                 filesToSyncContents.add(operation);
+                 mFilesToSyncContents.add(operation);
              }
-             
-             updatedFiles.add(remoteFile);
+             updatedFiles.add(updatedFile);
          }
  
          // save updated contents in local database
          mStorageManager.saveFolder(remoteFolder, updatedFiles, localFilesMap.values());
  
-         // request for the synchronization of file contents AFTER saving current remote properties
-         startContentSynchronizations(filesToSyncContents, client);
          mChildren = updatedFiles;
      }
  
      }
  
  
-     public boolean isMultiStatus(int status) {
-         return (status == HttpStatus.SC_MULTI_STATUS); 
-     }
-     /**
-      * Creates and populates a new {@link OCFile} object with the data read from the server.
-      * 
-      * @param remote    remote file read from the server (remote file or folder).
-      * @return          New OCFile instance representing the remote resource described by we.
-      */
-     private OCFile fillOCFile(RemoteFile remote) {
-         OCFile file = new OCFile(remote.getRemotePath());
-         file.setCreationTimestamp(remote.getCreationTimestamp());
-         file.setFileLength(remote.getLength());
-         file.setMimetype(remote.getMimeType());
-         file.setModificationTimestamp(remote.getModifiedTimestamp());
-         file.setEtag(remote.getEtag());
-         file.setPermissions(remote.getPermissions());
-         file.setRemoteId(remote.getRemoteId());
-         return file;
-     }
-     
-     /**
-      * Checks the storage path of the OCFile received as parameter. 
-      * If it's out of the local ownCloud folder, tries to copy the file inside it. 
-      * 
-      * If the copy fails, the link to the local file is nullified. The account of forgotten 
-      * files is kept in {@link #mForgottenLocalFiles}
-      *) 
-      * @param file      File to check and fix.
-      */
-     private void checkAndFixForeignStoragePath(OCFile file) {
-         String storagePath = file.getStoragePath();
-         String expectedPath = FileStorageUtils.getDefaultSavePathFor(mAccount.name, file);
-         if (storagePath != null && !storagePath.equals(expectedPath)) {
-             /// fix storagePaths out of the local ownCloud folder
-             File originalFile = new File(storagePath);
-             if (FileStorageUtils.getUsableSpace(mAccount.name) < originalFile.length()) {
-                 mForgottenLocalFiles.put(file.getRemotePath(), storagePath);
-                 file.setStoragePath(null);
-                     
-             } else {
-                 InputStream in = null;
-                 OutputStream out = null;
-                 try {
-                     File expectedFile = new File(expectedPath);
-                     File expectedParent = expectedFile.getParentFile();
-                     expectedParent.mkdirs();
-                     if (!expectedParent.isDirectory()) {
-                         throw new IOException(
-                                 "Unexpected error: parent directory could not be created"
-                         );
-                     }
-                     expectedFile.createNewFile();
-                     if (!expectedFile.isFile()) {
-                         throw new IOException("Unexpected error: target file could not be created");
-                     }                    
-                     in = new FileInputStream(originalFile);
-                     out = new FileOutputStream(expectedFile);
-                     byte[] buf = new byte[1024];
-                     int len;
-                     while ((len = in.read(buf)) > 0){
-                         out.write(buf, 0, len);
-                     }
-                     file.setStoragePath(expectedPath);
-                     
-                 } catch (Exception e) {
-                     Log_OC.e(TAG, "Exception while copying foreign file " + expectedPath, e);
-                     mForgottenLocalFiles.put(file.getRemotePath(), storagePath);
-                     file.setStoragePath(null);
-                     
-                 } finally {
-                     try {
-                         if (in != null) in.close();
-                     } catch (Exception e) {
-                         Log_OC.d(TAG, "Weird exception while closing input stream for " 
-                                 + storagePath + " (ignoring)", e);
-                     }
-                     try {
-                         if (out != null) out.close();
-                     } catch (Exception e) {
-                         Log_OC.d(TAG, "Weird exception while closing output stream for " 
-                                 + expectedPath + " (ignoring)", e);
-                     }
-                 }
-             }
-         }
-     }
-     
-     
      private RemoteOperationResult refreshSharesForFolder(OwnCloudClient client) {
          RemoteOperationResult result = null;
          
      
  
      /**
-      * Scans the default location for saving local copies of files searching for
-      * a 'lost' file with the same full name as the {@link OCFile} received as 
-      * parameter.
-      *  
-      * @param file      File to associate a possible 'lost' local file.
-      */
-     private void searchForLocalFileInDefaultPath(OCFile file) {
-         if (file.getStoragePath() == null && !file.isFolder()) {
-             File f = new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file));
-             if (f.exists()) {
-                 file.setStoragePath(f.getAbsolutePath());
-                 file.setLastSyncDateForData(f.lastModified());
-             }
-         }
-     }
-     
-     /**
       * Sends a message to any application component interested in the progress 
       * of the synchronization.
       * 
      }
  
  
-     public boolean getRemoteFolderChanged() {
-         return mRemoteFolderChanged;
+     private void fetchFavoritesToSyncFromLocalData() {
 -        List<OCFile> children = mStorageManager.getFolderContent(mLocalFolder);
++        List<OCFile> children = mStorageManager.getFolderContent(mLocalFolder, false);
+         for (OCFile child : children) {
+             if (!child.isFolder() && child.isFavorite()) {
+                 SynchronizeFileOperation operation = new SynchronizeFileOperation(
+                         child,
+                         child,  // cheating with the remote file to get an update to server; to refactor
+                         mAccount,
+                         true,
+                         mContext
+                 );
+                 mFilesToSyncContents.add(operation);
+             }
+         }
      }
  
  }
@@@ -60,7 -60,8 +60,8 @@@ import java.util.concurrent.atomic.Atom
   *  Fetches the list and properties of the files contained in the given folder, including their 
   *  properties, and updates the local database with them.
   *  
-  *  Does NOT enter in the child folders to synchronize their contents also.
+  *  Does NOT enter in the child folders to synchronize their contents also, BUT requests for a new operation instance
+  *  doing so.
   */
  public class SynchronizeFolderOperation extends SyncOperation {
  
      private List<OCFile> mFilesForDirectDownload;
          // to avoid extra PROPFINDs when there was no change in the folder
      
-     private List<SyncOperation> mFilesToSyncContentsWithoutUpload;
-         // this will go out when 'folder synchronization' replaces 'folder download'; step by step  
-     private List<SyncOperation> mFavouriteFilesToSyncContents;
+     private List<SyncOperation> mFilesToSyncContents;
          // this will be used for every file when 'folder synchronization' replaces 'folder download' 
  
      private final AtomicBoolean mCancellationRequested;
          mContext = context;
          mRemoteFolderChanged = false;
          mFilesForDirectDownload = new Vector<OCFile>();
-         mFilesToSyncContentsWithoutUpload = new Vector<SyncOperation>();
-         mFavouriteFilesToSyncContents = new Vector<SyncOperation>();
+         mFilesToSyncContents = new Vector<SyncOperation>();
          mCancellationRequested = new AtomicBoolean(false);
      }
  
          FileDataStorageManager storageManager = getStorageManager();
          
          // parse data from remote folder
-         OCFile remoteFolder = fillOCFile((RemoteFile)folderAndFiles.get(0));
+         OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) folderAndFiles.get(0));
          remoteFolder.setParentId(mLocalFolder.getParentId());
          remoteFolder.setFileId(mLocalFolder.getFileId());
  
  
          List<OCFile> updatedFiles = new Vector<OCFile>(folderAndFiles.size() - 1);
          mFilesForDirectDownload.clear();
-         mFilesToSyncContentsWithoutUpload.clear();
-         mFavouriteFilesToSyncContents.clear();
+         mFilesToSyncContents.clear();
  
          if (mCancellationRequested.get()) {
              throw new OperationCancelledException();
          }
  
          // get current data about local contents of the folder to synchronize
 -        // TODO Enable when "On Device" is recovered ?
 -        List<OCFile> localFiles = storageManager.getFolderContent(mLocalFolder/*, false*/);
 +        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);
          }
  
          // loop to synchronize every child
-         OCFile remoteFile = null, localFile = null;
+         OCFile remoteFile = null, localFile = null, updatedFile = null;
+         RemoteFile r;
          for (int i=1; i<folderAndFiles.size(); i++) {
              /// new OCFile instance with the data from the server
-             remoteFile = fillOCFile((RemoteFile)folderAndFiles.get(i));
-             remoteFile.setParentId(mLocalFolder.getFileId());
+             r = (RemoteFile) folderAndFiles.get(i);
+             remoteFile = FileStorageUtils.fillOCFile(r);
+             /// new OCFile instance to merge fresh data from server with local state
+             updatedFile = FileStorageUtils.fillOCFile(r);
+             updatedFile.setParentId(mLocalFolder.getFileId());
  
              /// retrieve local data for the read file
              //  localFile = mStorageManager.getFileByPath(remoteFile.getRemotePath());
              localFile = localFilesMap.remove(remoteFile.getRemotePath());
  
-             /// add to the remoteFile (the new one) data about LOCAL STATE (not existing in server)
-             remoteFile.setLastSyncDateForProperties(mCurrentSyncTime);
+             /// add to updatedFile data about LOCAL STATE (not existing in server)
+             updatedFile.setLastSyncDateForProperties(mCurrentSyncTime);
              if (localFile != null) {
-                 // some properties of local state are kept unmodified
-                 remoteFile.setFileId(localFile.getFileId());
-                 remoteFile.setFavorite(localFile.isFavorite());
-                 remoteFile.setLastSyncDateForData(localFile.getLastSyncDateForData());
-                 remoteFile.setModificationTimestampAtLastSyncForData(
+                 updatedFile.setFileId(localFile.getFileId());
+                 updatedFile.setFavorite(localFile.isFavorite());
+                 updatedFile.setLastSyncDateForData(localFile.getLastSyncDateForData());
+                 updatedFile.setModificationTimestampAtLastSyncForData(
                          localFile.getModificationTimestampAtLastSyncForData()
                  );
-                 remoteFile.setStoragePath(localFile.getStoragePath());
-                 // eTag will not be updated unless contents are synchronized
-                 //  (Synchronize[File|Folder]Operation with remoteFile as parameter)
-                 remoteFile.setEtag(localFile.getEtag());
-                 if (remoteFile.isFolder()) {
-                     remoteFile.setFileLength(localFile.getFileLength());
+                 updatedFile.setStoragePath(localFile.getStoragePath());
+                 // eTag will not be updated unless file CONTENTS are synchronized
+                 updatedFile.setEtag(localFile.getEtag());
+                 if (updatedFile.isFolder()) {
+                     updatedFile.setFileLength(localFile.getFileLength());
                          // TODO move operations about size of folders to FileContentProvider
                  } else if (mRemoteFolderChanged && remoteFile.isImage() &&
                          remoteFile.getModificationTimestamp() !=
                                  localFile.getModificationTimestamp()) {
-                     remoteFile.setNeedsUpdateThumbnail(true);
+                     updatedFile.setNeedsUpdateThumbnail(true);
                      Log.d(TAG, "Image " + remoteFile.getFileName() + " updated on the server");
                  }
-                 remoteFile.setPublicLink(localFile.getPublicLink());
-                 remoteFile.setShareByLink(localFile.isShareByLink());
+                 updatedFile.setPublicLink(localFile.getPublicLink());
+                 updatedFile.setShareByLink(localFile.isShareByLink());
+                 updatedFile.setEtagInConflict(localFile.getEtagInConflict());
              } else {
-                 // remote eTag will not be updated unless contents are synchronized
-                 //  (Synchronize[File|Folder]Operation with remoteFile as parameter)
-                 remoteFile.setEtag("");
+                 // remote eTag will not be updated unless file CONTENTS are synchronized
+                 updatedFile.setEtag("");
              }
  
              /// check and fix, if needed, local storage path
-             searchForLocalFileInDefaultPath(remoteFile);
+             searchForLocalFileInDefaultPath(updatedFile);
              
              /// classify file to sync/download contents later
              if (remoteFile.isFolder()) {
                  /// to download children files recursively
-                 synchronized(mCancellationRequested) {
+                 synchronized (mCancellationRequested) {
                      if (mCancellationRequested.get()) {
                          throw new OperationCancelledException();
                      }
                      startSyncFolderOperation(remoteFile.getRemotePath());
                  }
  
-             } else if (remoteFile.isFavorite()) {
-                 /// prepare content synchronization for kept-in-sync files
-                 SynchronizeFileOperation operation = new SynchronizeFileOperation(
-                         localFile,
-                         remoteFile,
-                         mAccount,
-                         true,
-                         mContext
-                     );
-                 mFavouriteFilesToSyncContents.add(operation);
-                 
              } else {
-                 /// prepare limited synchronization for regular files
+                 /// prepare content synchronization for files (any file, not just favorites)
                  SynchronizeFileOperation operation = new SynchronizeFileOperation(
                          localFile,
                          remoteFile,
                          mAccount,
                          true,
-                         false,
                          mContext
                      );
-                 mFilesToSyncContentsWithoutUpload.add(operation);
+                 mFilesToSyncContents.add(operation);
+                 
              }
  
-             updatedFiles.add(remoteFile);
+             updatedFiles.add(updatedFile);
          }
  
          // save updated contents in local database
      
      
      private void prepareOpsFromLocalKnowledge() throws OperationCancelledException {
 -        // TODO Enable when "On Device" is recovered ?
 -        List<OCFile> children = getStorageManager().getFolderContent(mLocalFolder/*, false*/);
 +        List<OCFile> children = getStorageManager().getFolderContent(mLocalFolder, false);
          for (OCFile child : children) {
              /// classify file to sync/download contents later
              if (child.isFolder()) {
                  }
  
              } else {
-                 /// prepare limited synchronization for regular files
+                 /// synchronization for regular files
                  if (!child.isDown()) {
                      mFilesForDirectDownload.add(child);
+                 } else {
+                     /// this should result in direct upload of files that were locally modified
+                     SynchronizeFileOperation operation = new SynchronizeFileOperation(
+                             child,
+                             (child.getEtagInConflict() != null ? child : null),
+                             mAccount,
+                             true,
+                             mContext
+                     );
+                     mFilesToSyncContents.add(operation);
                  }
              }
          }
      }
  
      private void syncContents(OwnCloudClient client) throws OperationCancelledException {
          startDirectDownloads();
-         startContentSynchronizations(mFilesToSyncContentsWithoutUpload, client);
-         startContentSynchronizations(mFavouriteFilesToSyncContents, client);
+         startContentSynchronizations(mFilesToSyncContents, client);
      }
  
      
  
      
      /**
-      * Creates and populates a new {@link com.owncloud.android.datamodel.OCFile}
-      * object with the data read from the server.
-      *
-      * @param remote    remote file read from the server (remote file or folder).
-      * @return          New OCFile instance representing the remote resource described by we.
-      */
-     private OCFile fillOCFile(RemoteFile remote) {
-         OCFile file = new OCFile(remote.getRemotePath());
-         file.setCreationTimestamp(remote.getCreationTimestamp());
-         file.setFileLength(remote.getLength());
-         file.setMimetype(remote.getMimeType());
-         file.setModificationTimestamp(remote.getModifiedTimestamp());
-         file.setEtag(remote.getEtag());
-         file.setPermissions(remote.getPermissions());
-         file.setRemoteId(remote.getRemoteId());
-         return file;
-     }
-     /**
       * Scans the default location for saving local copies of files searching for
       * a 'lost' file with the same full name as the {@link com.owncloud.android.datamodel.OCFile}
       * received as parameter.
@@@ -31,7 -31,7 +31,7 @@@ import java.util.Iterator
  import java.util.Set;
  import java.util.concurrent.atomic.AtomicBoolean;
  
- import org.apache.commons.httpclient.methods.PutMethod;
+ import org.apache.commons.httpclient.HttpStatus;
  import org.apache.commons.httpclient.methods.RequestEntity;
  
  import android.accounts.Account;
@@@ -39,7 -39,6 +39,7 @@@ import android.content.Context
  import android.net.Uri;
  
  import com.owncloud.android.MainApp;
 +import com.owncloud.android.datamodel.FileDataStorageManager;
  import com.owncloud.android.datamodel.OCFile;
  import com.owncloud.android.files.services.FileUploader;
  import com.owncloud.android.lib.common.OwnCloudClient;
@@@ -76,7 -75,6 +76,6 @@@ public class UploadFileOperation extend
      private boolean mWasRenamed = false;
      private String mOriginalFileName = null;
      private String mOriginalStoragePath = null;
-     PutMethod mPutMethod = null;
      private Set<OnDatatransferProgressListener> mDataTransferListeners = new HashSet<OnDatatransferProgressListener>();
      private AtomicBoolean mCancellationRequested = new AtomicBoolean(false);
      private Context mContext;
                      (new File(mFile.getStoragePath())).length() >
                              ChunkedUploadRemoteFileOperation.CHUNK_SIZE ) {
                  mUploadOperation = new ChunkedUploadRemoteFileOperation(mFile.getStoragePath(),
-                         mFile.getRemotePath(), mFile.getMimetype());
+                         mFile.getRemotePath(), mFile.getMimetype(), mFile.getEtagInConflict());
              } else {
                  mUploadOperation = new UploadRemoteFileOperation(mFile.getStoragePath(),
-                         mFile.getRemotePath(), mFile.getMimetype());
+                         mFile.getRemotePath(), mFile.getMimetype(), mFile.getEtagInConflict());
              }
              Iterator <OnDatatransferProgressListener> listener = mDataTransferListeners.iterator();
              while (listener.hasNext()) {
                  mUploadOperation.addDatatransferProgressListener(listener.next());
              }
-             if (!mCancellationRequested.get()) {
-                 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;
-                         if (temporalFile != null) { // FileUploader.LOCAL_BEHAVIOUR_COPY
-                             // ; see where temporalFile was
-                             // set
-                             fileToMove = temporalFile;
-                         } else { // FileUploader.LOCAL_BEHAVIOUR_MOVE
-                             fileToMove = originalFile;
-                         }
-                         if (!expectedFile.equals(fileToMove)) {
-                             File expectedFolder = expectedFile.getParentFile();
-                             expectedFolder.mkdirs();
-                             if (!expectedFolder.isDirectory() || !fileToMove.renameTo(expectedFile)) {
-                                 mFile.setStoragePath(null); // forget the local file
-                                 // by now, treat this as a success; the file was
-                                 // uploaded; the user won't like that the local file
-                                 // is not linked, but this should be a very rare
-                                 // fail;
-                                 // the best option could be show a warning message
-                                 // (but not a fail)
-                                 // result = new
-                                 // RemoteOperationResult(ResultCode.LOCAL_STORAGE_NOT_MOVED);
-                                 // return result;
-                             }
+             if (mCancellationRequested.get()) {
+                 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 {
+                     mFile.setStoragePath(expectedPath);
+                     File fileToMove = null;
+                     if (temporalFile != null) { // FileUploader.LOCAL_BEHAVIOUR_COPY
+                         // ; see where temporalFile was
+                         // set
+                         fileToMove = temporalFile;
+                     } else { // FileUploader.LOCAL_BEHAVIOUR_MOVE
+                         fileToMove = originalFile;
+                     }
+                     if (!expectedFile.equals(fileToMove)) {
+                         File expectedFolder = expectedFile.getParentFile();
+                         expectedFolder.mkdirs();
+                         if (!expectedFolder.isDirectory() || !fileToMove.renameTo(expectedFile)) {
+                             mFile.setStoragePath(null); // forget the local file
+                             // by now, treat this as a success; the file was
+                             // uploaded; the user won't like that the local file
+                             // is not linked, but this should be a very rare
+                             // fail;
+                             // the best option could be show a warning message
+                             // (but not a fail)
+                             // result = new
+                             // RemoteOperationResult(ResultCode.LOCAL_STORAGE_NOT_MOVED);
+                             // return result;
                          }
                      }
 +                    FileDataStorageManager.triggerMediaScan(originalFile.getAbsolutePath());
 +                    FileDataStorageManager.triggerMediaScan(expectedFile.getAbsolutePath());
                  }
+             } else if (result.getHttpCode() == HttpStatus.SC_PRECONDITION_FAILED ) {
+                 result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT);
              }
  
          } catch (Exception e) {
-             // TODO something cleaner with cancellations
-             if (mCancellationRequested.get()) {
-                 result = new RemoteOperationResult(new OperationCancelledException());
-             } else {
-                 result = new RemoteOperationResult(e);
-             }
+             result = new RemoteOperationResult(e);
  
          } finally {
              if (temporalFile != null && !originalFile.equals(temporalFile)) {
          newFile.setModificationTimestamp(mFile.getModificationTimestamp());
          newFile.setModificationTimestampAtLastSyncForData(
                  mFile.getModificationTimestampAtLastSyncForData());
-         // newFile.setEtag(mFile.getEtag())
+         newFile.setEtag(mFile.getEtag());
          newFile.setFavorite(mFile.isFavorite());
          newFile.setLastSyncDateForProperties(mFile.getLastSyncDateForProperties());
          newFile.setLastSyncDateForData(mFile.getLastSyncDateForData());
@@@ -26,7 -26,6 +26,7 @@@ import android.accounts.Account
  import android.accounts.AccountManager;
  import android.accounts.AuthenticatorException;
  import android.annotation.TargetApi;
 +import android.os.Parcelable;
  import android.support.v7.app.AlertDialog;
  import android.content.BroadcastReceiver;
  import android.content.ComponentName;
@@@ -108,8 -107,6 +108,8 @@@ import com.owncloud.android.utils.FileS
  import com.owncloud.android.utils.UriUtils;
  
  import java.io.File;
 +import java.util.ArrayList;
 +import java.util.Iterator;
  
  /**
   * Displays, what files the user has available in his ownCloud.
@@@ -152,14 -149,13 +152,14 @@@ public class FileDisplayActivity extend
      private boolean mSyncInProgress = false;
  
      private static String DIALOG_UNTRUSTED_CERT = "DIALOG_UNTRUSTED_CERT";
 -    private static String DIALOG_CREATE_FOLDER = "DIALOG_CREATE_FOLDER";
 +    public static String DIALOG_CREATE_FOLDER = "DIALOG_CREATE_FOLDER";
      private static String DIALOG_UPLOAD_SOURCE = "DIALOG_UPLOAD_SOURCE";
      private static String DIALOG_CERT_NOT_SAVED = "DIALOG_CERT_NOT_SAVED";
  
      private OCFile mWaitingToSend;
 +    private Menu mOptionsMenu;
 +
  
 -    
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          Log_OC.v(TAG, "onCreate() start");
              setFile(file);
  
              if (mAccountWasSet) {
 -                RelativeLayout navigationDrawerLayout = (RelativeLayout) findViewById(R.id.left_drawer);
 -                if (navigationDrawerLayout != null && getAccount() != null) {
 -                    TextView username = (TextView) navigationDrawerLayout.findViewById(R.id.drawer_username);
 -                    int lastAtPos = getAccount().name.lastIndexOf("@");
 -                    username.setText(getAccount().name.substring(0, lastAtPos));
 -                }
 +                setUsernameInDrawer((RelativeLayout) findViewById(R.id.left_drawer), getAccount());
              }
  
              if (!stateWasRecovered) {
              /// First fragment
              OCFileListFragment listOfFiles = getListOfFilesFragment();
              if (listOfFiles != null) {
 -                listOfFiles.listDirectory(getCurrentDir());
 -                // TODO Enable when "On Device" is recovered
 -                // listOfFiles.listDirectory(getCurrentDir(), MainApp.getOnlyOnDevice());
 -
 +                listOfFiles.listDirectory(getCurrentDir(), MainApp.getOnlyOnDevice());
              } else {
                  Log_OC.e(TAG, "Still have a chance to lose the initializacion of list fragment >(");
              }
                      startTextPreview(file);
              }
  
 +            if (DisplayUtils.isGridView(getFile(), getStorageManager())){
 +                switchToGridView();
 +            } else {
 +                switchToListView();
 +            }
 +
          } else {
              Log_OC.wtf(TAG, "initFragments() called with invalid NULLs!");
              if (getAccount() == null) {
      protected void refreshListOfFilesFragment() {
          OCFileListFragment fileListFragment = getListOfFilesFragment();
          if (fileListFragment != null) {
 -            fileListFragment.listDirectory();
 -            // TODO Enable when "On Device" is recovered ?
 -            // fileListFragment.listDirectory(MainApp.getOnlyOnDevice());
 +            fileListFragment.listDirectory(MainApp.getOnlyOnDevice());
          }
      }
  
      @Override
      public boolean onPrepareOptionsMenu(Menu menu) {
          boolean drawerOpen = mDrawerLayout.isDrawerOpen(GravityCompat.START);
 -        menu.findItem(R.id.action_upload).setVisible(!drawerOpen);
 -        menu.findItem(R.id.action_create_dir).setVisible(!drawerOpen);
          menu.findItem(R.id.action_sort).setVisible(!drawerOpen);
          menu.findItem(R.id.action_sync_account).setVisible(!drawerOpen);
 +        menu.findItem(R.id.action_switch_view).setVisible(!drawerOpen);
          
          return super.onPrepareOptionsMenu(menu);
      }
      public boolean onCreateOptionsMenu(Menu menu) {
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.main_menu, menu);
 +        menu.findItem(R.id.action_create_dir).setVisible(false);
 +        mOptionsMenu = menu;
 +
 +        MenuItem menuItem = mOptionsMenu.findItem(R.id.action_switch_view);
 +
 +        changeGridIcon();
 +
          return true;
      }
      
      public boolean onOptionsItemSelected(MenuItem item) {
          boolean retval = true;
          switch (item.getItemId()) {
 -            case R.id.action_create_dir: {
 -                CreateFolderDialogFragment dialog =
 -                        CreateFolderDialogFragment.newInstance(getCurrentDir());
 -                dialog.show(getSupportFragmentManager(), DIALOG_CREATE_FOLDER);
 -                break;
 -            }
 -
              case R.id.action_sync_account: {
                  startSynchronization();
                  break;
              }
 -            case R.id.action_upload: {
 -                UploadSourceDialogFragment dialog =
 -                        UploadSourceDialogFragment.newInstance(getAccount());
 -                dialog.show(getSupportFragmentManager(), DIALOG_UPLOAD_SOURCE);
 -                break;
 -            }
              case android.R.id.home: {
                  FileFragment second = getSecondFragment();
                  OCFile currentDir = getCurrentDir();
                  builder.create().show();
                  break;
              }
 +            case R.id.action_switch_view:{
 +                if (isGridView()){
 +                    item.setTitle(getApplicationContext().getString(R.string.action_switch_grid_view));
 +                    item.setIcon(ContextCompat.getDrawable(getApplicationContext(),
 +                            R.drawable.ic_view_module));
 +                    DisplayUtils.setViewMode(getFile(), false);
 +                    switchToListView();
 +                } else {
 +                    item.setTitle(getApplicationContext().getString(R.string.action_switch_list_view));
 +                    item.setIcon(ContextCompat.getDrawable(getApplicationContext(),
 +                            R.drawable.ic_view_list));
 +                    DisplayUtils.setViewMode(getFile(), true);
 +                    switchToGridView();
 +                }
 +
 +                return true;
 +            }
          default:
              retval = super.onOptionsItemSelected(item);
          }
          return retval;
      }
  
 +    public void createFolder() {
 +        CreateFolderDialogFragment dialog =
 +                CreateFolderDialogFragment.newInstance(getCurrentDir());
 +        dialog.show(getSupportFragmentManager(), DIALOG_CREATE_FOLDER);
 +    }
 +
 +    public void uploadLocalFilesSelected() {
 +        Intent action = new Intent(this, UploadFilesActivity.class);
 +        action.putExtra(
 +                UploadFilesActivity.EXTRA_ACCOUNT,
 +                getAccount()
 +        );
 +        startActivityForResult(action, ACTION_SELECT_MULTIPLE_FILES);
 +    }
 +
 +    public void uploadFromOtherAppsSelected() {
 +        Intent action = new Intent(Intent.ACTION_GET_CONTENT);
 +        action = action.setType("*/*").addCategory(Intent.CATEGORY_OPENABLE);
 +        //Intent.EXTRA_ALLOW_MULTIPLE is only supported on api level 18+, Jelly Bean
 +        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
 +            action.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
 +        }
 +        startActivityForResult(
 +                Intent.createChooser(action, getString(R.string.upload_chooser_title)),
 +                ACTION_SELECT_CONTENT_FROM_APPS
 +        );
 +    }
 +
      private void startSynchronization() {
          Log_OC.d(TAG, "Got to start sync");
          if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.KITKAT) {
       */
      private void requestMoveOperation(Intent data, int resultCode) {
          OCFile folderToMoveAt = (OCFile) data.getParcelableExtra(FolderPickerActivity.EXTRA_FOLDER);
 -        OCFile targetFile = (OCFile) data.getParcelableExtra(FolderPickerActivity.EXTRA_FILE);
 -        getFileOperationsHelper().moveFile(folderToMoveAt, targetFile);
 +
 +        ArrayList<OCFile> files = data.getParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES);
 +
 +        for (Parcelable file : files) {
 +            getFileOperationsHelper().moveFile(folderToMoveAt, (OCFile) file);
 +        }
      }
  
      /**
       */
      private void requestCopyOperation(Intent data, int resultCode) {
          OCFile folderToMoveAt = data.getParcelableExtra(FolderPickerActivity.EXTRA_FOLDER);
 -        OCFile targetFile = data.getParcelableExtra(FolderPickerActivity.EXTRA_FILE);
 -        getFileOperationsHelper().copyFile(folderToMoveAt, targetFile);
 +
 +        ArrayList<OCFile> files = data.getParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES);
 +
 +        for (Parcelable file : files) {
 +            getFileOperationsHelper().copyFile(folderToMoveAt, (OCFile) file);
 +        }
      }
  
      @Override
      public void onBackPressed() {
 -        if (!isDrawerOpen()){
 +        boolean isFabOpen = isFabOpen();
 +        boolean isDrawerOpen = isDrawerOpen();
 +
 +        /*
 +         * BackPressed priority/hierarchy:
 +         *    1. close drawer if opened
 +         *    2. close FAB if open (only if drawer isn't open)
 +         *    3. navigate up (only if drawer and FAB aren't open)
 +         */
 +        if(isDrawerOpen && isFabOpen) {
 +            // close drawer first
 +            super.onBackPressed();
 +        } else if(isDrawerOpen && !isFabOpen) {
 +            // close drawer
 +            super.onBackPressed();
 +        } else if (!isDrawerOpen && isFabOpen) {
 +            // close fab
 +            getListOfFilesFragment().getFabMain().collapse();
 +        } else {
 +            // all closed
              OCFileListFragment listOfFiles = getListOfFilesFragment();
              if (mDualPane || getSecondFragment() == null) {
                  OCFile currentDir = getCurrentDir();
                  setFile(listOfFiles.getCurrentFile());
              }
              cleanSecondFragment();
 +            changeGridIcon();
 +        }
 +    }
 +
 +    private void changeGridIcon(){
 +        MenuItem menuItem = mOptionsMenu.findItem(R.id.action_switch_view);
 +        if (DisplayUtils.isGridView(getFile(), getStorageManager())){
 +            menuItem.setTitle(getApplicationContext().getString(R.string.action_switch_list_view));
 +            menuItem.setIcon(ContextCompat.getDrawable(getApplicationContext(),
 +                    R.drawable.ic_view_list));
          } else {
 -            super.onBackPressed();
 +            menuItem.setTitle(getApplicationContext().getString(R.string.action_switch_grid_view));
 +            menuItem.setIcon(ContextCompat.getDrawable(getApplicationContext(),
 +                    R.drawable.ic_view_module));
          }
      }
  
          Log_OC.v(TAG, "onPause() end");
      }
  
 +    public boolean isFabOpen() {
 +        if(getListOfFilesFragment() != null && getListOfFilesFragment().getFabMain() != null && getListOfFilesFragment().getFabMain().isExpanded()) {
 +            return true;
 +        } else {
 +            return false;
 +        }
 +    }
 +
  
      private class SyncBroadcastReceiver extends BroadcastReceiver {
  
                                      currentDir.getRemotePath().equals(synchFolderRemotePath)) {
                                  OCFileListFragment fileListFragment = getListOfFilesFragment();
                                  if (fileListFragment != null) {
 -                                    fileListFragment.listDirectory();
 -                                    // TODO Enable when "On Device" is recovered ?
 -                                    // fileListFragment.listDirectory(currentDir,
 -                                    // MainApp.getOnlyOnDevice());
 +                                    fileListFragment.listDirectory(currentDir,
 +                                    MainApp.getOnlyOnDevice());
                                  }
                              }
                              setFile(currentFile);
                          (uploadedRemotePath.startsWith(currentDir.getRemotePath()));
  
                  if (sameAccount && isDescendant) {
-                     refreshListOfFilesFragment();
+                     String linkedToRemotePath =
+                             intent.getStringExtra(FileDownloader.EXTRA_LINKED_TO_PATH);
+                     if (linkedToRemotePath == null || isAscendant(linkedToRemotePath)) {
+                         refreshListOfFilesFragment();
+                     }
                  }
  
                  boolean uploadWasFine = intent.getBooleanExtra(FileUploader.EXTRA_UPLOAD_RESULT,
  
          }
  
+         // TODO refactor this receiver, and maybe DownloadFinishReceiver; this method is duplicated :S
+         private boolean isAscendant(String linkedToRemotePath) {
+             OCFile currentDir = getCurrentDir();
+             return (
+                     currentDir != null &&
+                             currentDir.getRemotePath().startsWith(linkedToRemotePath)
+             );
+         }
      }
  
  
       */
      private class DownloadFinishReceiver extends BroadcastReceiver {
  
-         //int refreshCounter = 0;
          @Override
          public void onReceive(Context context, Intent intent) {
              try {
-                 boolean sameAccount = isSameAccount(context, intent);
+                 boolean sameAccount = isSameAccount(intent);
                  String downloadedRemotePath =
                          intent.getStringExtra(FileDownloader.EXTRA_REMOTE_PATH);
                  boolean isDescendant = isDescendant(downloadedRemotePath);
                      String linkedToRemotePath =
                              intent.getStringExtra(FileDownloader.EXTRA_LINKED_TO_PATH);
                      if (linkedToRemotePath == null || isAscendant(linkedToRemotePath)) {
-                         //Log_OC.v(TAG, "refresh #" + ++refreshCounter);
                          refreshListOfFilesFragment();
                      }
                      refreshSecondFragment(
              );
          }
  
-         private boolean isSameAccount(Context context, Intent intent) {
+         private boolean isSameAccount(Intent intent) {
              String accountName = intent.getStringExtra(FileDownloader.ACCOUNT_NAME);
              return (accountName != null && getAccount() != null &&
                      accountName.equals(getAccount().name));
          OCFileListFragment listOfFiles = getListOfFilesFragment();
          if (listOfFiles != null) {  // should never be null, indeed
              OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
 -            listOfFiles.listDirectory(root);
 -            // TODO Enable when "On Device" is recovered ?
 -            // listOfFiles.listDirectory(root, MainApp.getOnlyOnDevice());
 +            listOfFiles.listDirectory(root, MainApp.getOnlyOnDevice());
              setFile(listOfFiles.getCurrentFile());
              startSyncFolderOperation(root, false);
          }
          cleanSecondFragment();
          // Sync Folder
          startSyncFolderOperation(directory, false);
 +
 +        MenuItem menuItem = mOptionsMenu.findItem(R.id.action_switch_view);
 +
 +        changeGridIcon();
 +        if (DisplayUtils.isGridView(directory, getStorageManager())){
 +            switchToGridView();
 +        } else {
 +            switchToListView();
 +        }
      }
  
      /**
              // getFileDownloadBinder() - THIS IS A MESS
              OCFileListFragment listOfFiles = getListOfFilesFragment();
              if (listOfFiles != null) {
 -                listOfFiles.listDirectory();
 -                // TODO Enable when "On Device" is recovered ?
 -                // listOfFiles.listDirectory(MainApp.getOnlyOnDevice());
 +                listOfFiles.listDirectory(MainApp.getOnlyOnDevice());
              }
              FileFragment secondFragment = getSecondFragment();
              if (secondFragment != null && secondFragment instanceof FileDetailFragment) {
      private void sortByName(boolean ascending) {
          getListOfFilesFragment().sortByName(ascending);
      }
 +    private boolean isGridView(){ return getListOfFilesFragment().isGridView(); }
 +    private void switchToGridView() {
 +        getListOfFilesFragment().switchToGridView();
 +    }
 +    private void switchToListView() {
 +        getListOfFilesFragment().switchToListView();
 +    }
  
     public void allFilesOption() {
         browseToRoot();
     }
 +
 +    public void refreshDirectory(){
 +        getListOfFilesFragment().refreshDirectory();
 +    }
  }
@@@ -25,16 -25,12 +25,16 @@@ package com.owncloud.android.ui.adapter
  \r
  \r
  import java.io.File;\r
 +import java.util.ArrayList;\r
 +import java.util.HashMap;\r
 +import java.util.Map;\r
  import java.util.Vector;\r
  \r
  import android.accounts.Account;\r
  import android.content.Context;\r
  import android.content.SharedPreferences;\r
  import android.graphics.Bitmap;\r
 +import android.graphics.Color;\r
  import android.os.Build;\r
  import android.preference.PreferenceManager;\r
  import android.text.format.DateUtils;\r
@@@ -83,8 -79,6 +83,8 @@@ public class FileListListAdapter extend
      private enum ViewType {LIST_ITEM, GRID_IMAGE, GRID_ITEM };\r
  \r
      private SharedPreferences mAppPreferences;\r
 +\r
 +    private HashMap<Integer, Boolean> mSelection = new HashMap<Integer, Boolean>();\r
      \r
      public FileListListAdapter(\r
              boolean justFolders, \r
          ViewType viewType;\r
          if (!mGridMode){\r
              viewType = ViewType.LIST_ITEM;\r
 -        } else if (file.isImage()){\r
 +        } else if (file.isImage() || file.isVideo()){\r
              viewType = ViewType.GRID_IMAGE;\r
          } else {\r
              viewType = ViewType.GRID_ITEM;\r
              switch (viewType){\r
                  case LIST_ITEM:\r
                      TextView fileSizeV = (TextView) view.findViewById(R.id.file_size);\r
 +                    TextView fileSizeSeparatorV = (TextView) view.findViewById(R.id.file_separator);\r
                      TextView lastModV = (TextView) view.findViewById(R.id.last_mod);\r
 -                    ImageView checkBoxV = (ImageView) view.findViewById(R.id.custom_checkbox);\r
 +\r
  \r
                      lastModV.setVisibility(View.VISIBLE);\r
                      lastModV.setText(showRelativeTimestamp(file));\r
  \r
 -                    checkBoxV.setVisibility(View.GONE);\r
  \r
 +                    fileSizeSeparatorV.setVisibility(View.VISIBLE);\r
                      fileSizeV.setVisibility(View.VISIBLE);\r
                      fileSizeV.setText(DisplayUtils.bytesToHumanReadable(file.getFileLength()));\r
  \r
 -                    if (!file.isFolder()) {\r
 -                        AbsListView parentList = (AbsListView)parent;\r
 -                        if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\r
 -                            if (parentList.getChoiceMode() == AbsListView.CHOICE_MODE_NONE) {\r
 -                                checkBoxV.setVisibility(View.GONE);\r
 -                            } else {\r
 -                                if (parentList.isItemChecked(position)) {\r
 -                                    checkBoxV.setImageResource(\r
 -                                            android.R.drawable.checkbox_on_background);\r
 -                                } else {\r
 -                                    checkBoxV.setImageResource(\r
 -                                            android.R.drawable.checkbox_off_background);\r
 -                                }\r
 -                                checkBoxV.setVisibility(View.VISIBLE);\r
 -                            }\r
 -                        }\r
 -\r
 -                    } else { //Folder\r
 +//                    if (!file.isFolder()) {\r
 +//                        AbsListView parentList = (AbsListView)parent;\r
 +//                        if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\r
 +//                            if (parentList.getChoiceMode() == AbsListView.CHOICE_MODE_NONE) {\r
 +//                                checkBoxV.setVisibility(View.GONE);\r
 +//                            } else {\r
 +//                                if (parentList.isItemChecked(position)) {\r
 +//                                    checkBoxV.setImageResource(\r
 +//                                            R.drawable.ic_checkbox_marked);\r
 +//                                } else {\r
 +//                                    checkBoxV.setImageResource(\r
 +//                                            R.drawable.ic_checkbox_blank_outline);\r
 +//                                }\r
 +//                                checkBoxV.setVisibility(View.VISIBLE);\r
 +//                            }\r
 +//                        }\r
 +\r
 +                    if (file.isFolder()) {\r
 +                        fileSizeSeparatorV.setVisibility(View.INVISIBLE);\r
                          fileSizeV.setVisibility(View.INVISIBLE);\r
                      }\r
  \r
                              mTransferServiceGetter.getFileDownloaderBinder();\r
                      FileUploaderBinder uploaderBinder =\r
                              mTransferServiceGetter.getFileUploaderBinder();\r
-                     boolean downloading = (downloaderBinder != null &&\r
-                             downloaderBinder.isDownloading(mAccount, file));\r
                      OperationsServiceBinder opsBinder =\r
                              mTransferServiceGetter.getOperationsServiceBinder();\r
-                     downloading |= (opsBinder != null &&\r
-                             opsBinder.isSynchronizing(mAccount, file.getRemotePath()));\r
-                     if (downloading) {\r
-                         localStateView.setImageResource(R.drawable.downloading_file_indicator);\r
\r
+                     localStateView.setVisibility(View.INVISIBLE);   // default first\r
\r
+                     if ( //synchronizing\r
+                                 opsBinder != null &&\r
+                                 opsBinder.isSynchronizing(mAccount, file.getRemotePath())\r
+                             ) {\r
+                         localStateView.setImageResource(R.drawable.synchronizing_file_indicator);\r
+                         localStateView.setVisibility(View.VISIBLE);\r
\r
+                     } else if ( // downloading\r
+                                 downloaderBinder != null &&\r
+                                 downloaderBinder.isDownloading(mAccount, file)\r
+                             ) {\r
+                         localStateView.setImageResource(\r
+                                 file.isFolder() ?\r
+                                         R.drawable.synchronizing_file_indicator :\r
+                                         R.drawable.downloading_file_indicator\r
+                         );\r
                          localStateView.setVisibility(View.VISIBLE);\r
-                     } else if (uploaderBinder != null &&\r
-                             uploaderBinder.isUploading(mAccount, file)) {\r
-                         localStateView.setImageResource(R.drawable.uploading_file_indicator);\r
\r
+                     } else if ( //uploading\r
+                                 uploaderBinder != null &&\r
+                                 uploaderBinder.isUploading(mAccount, file)\r
+                             ) {\r
+                         localStateView.setImageResource(\r
+                                 file.isFolder() ?\r
+                                         R.drawable.synchronizing_file_indicator :\r
+                                         R.drawable.uploading_file_indicator\r
+                         );\r
                          localStateView.setVisibility(View.VISIBLE);\r
\r
+                     } else if (file.getEtagInConflict() != null) {   // conflict\r
+                         localStateView.setImageResource(R.drawable.conflict_file_indicator);\r
+                         localStateView.setVisibility(View.VISIBLE);\r
\r
                      } else if (file.isDown()) {\r
                          localStateView.setImageResource(R.drawable.local_file_indicator);\r
                          localStateView.setVisibility(View.VISIBLE);\r
-                     } else {\r
-                         localStateView.setVisibility(View.INVISIBLE);\r
                      }\r
  \r
                      // share with me icon\r
  \r
                      break;\r
              }\r
 +\r
 +            ImageView checkBoxV = (ImageView) view.findViewById(R.id.custom_checkbox);\r
 +            checkBoxV.setVisibility(View.GONE);\r
 +\r
 +            AbsListView parentList = (AbsListView)parent;\r
 +            if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\r
 +                if (parentList.getChoiceMode() == AbsListView.CHOICE_MODE_NONE) {\r
 +                    checkBoxV.setVisibility(View.GONE);\r
 +                } else if (parentList.getCheckedItemCount() > 0){\r
 +                    if (parentList.isItemChecked(position)) {\r
 +                        checkBoxV.setImageResource(\r
 +                                android.R.drawable.checkbox_on_background);\r
 +                    } else {\r
 +                        checkBoxV.setImageResource(\r
 +                                android.R.drawable.checkbox_off_background);\r
 +                    }\r
 +                    checkBoxV.setVisibility(View.VISIBLE);\r
 +                }\r
 +            }\r
              \r
              // For all Views\r
              \r
                  if (file.isImage() && file.getRemoteId() != null){\r
                      // Thumbnail in Cache?\r
                      Bitmap thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(\r
 -                            String.valueOf(file.getRemoteId())\r
 -                            );\r
 +                            "t" + String.valueOf(file.getRemoteId()));\r
                      if (thumbnail != null && !file.needsUpdateThumbnail()){\r
                          fileIcon.setImageBitmap(thumbnail);\r
                      } else {\r
                                      task\r
                                      );\r
                              fileIcon.setImageDrawable(asyncDrawable);\r
 -                            task.execute(file);\r
 +                            task.execute(file, true);\r
                          }\r
                      }\r
  \r
              }\r
          }\r
  \r
 +        if (mSelection.get(position) != null) {\r
 +            view.setBackgroundColor(Color.rgb(248, 248, 248));\r
 +        } else {\r
 +            view.setBackgroundColor(Color.WHITE);\r
 +        }\r
 +\r
          return view;\r
      }\r
  \r
-     /**\r
-      * Local Folder size in human readable format\r
-      * \r
-      * @param path\r
-      *            String\r
-      * @return Size in human readable format\r
-      */\r
-     private String getFolderSizeHuman(String path) {\r
\r
-         File dir = new File(path);\r
\r
-         if (dir.exists()) {\r
-             long bytes = FileStorageUtils.getFolderSize(dir);\r
-             return DisplayUtils.bytesToHumanReadable(bytes);\r
-         }\r
\r
-         return "0 B";\r
-     }\r
\r
-     /**\r
-      * Local Folder size\r
-      * @param dir File\r
-      * @return Size in bytes\r
-      */\r
-     private long getFolderSize(File dir) {\r
-         if (dir.exists()) {\r
-             long result = 0;\r
-             File[] fileList = dir.listFiles();\r
-             for(int i = 0; i < fileList.length; i++) {\r
-                 if(fileList[i].isDirectory()) {\r
-                     result += getFolderSize(fileList[i]);\r
-                 } else {\r
-                     result += fileList[i].length();\r
-                 }\r
-             }\r
-             return result;\r
-         }\r
-         return 0;\r
-     } \r
\r
      @Override\r
      public int getViewTypeCount() {\r
          return 1;\r
       *                                  mStorageManager if is different (and not NULL)\r
       */\r
      public void swapDirectory(OCFile directory, FileDataStorageManager updatedStorageManager\r
 -            /*, boolean onlyOnDevice*/) {\r
 +            , boolean onlyOnDevice) {\r
          mFile = directory;\r
          if (updatedStorageManager != null && updatedStorageManager != mStorageManager) {\r
              mStorageManager = updatedStorageManager;\r
              mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);\r
          }\r
          if (mStorageManager != null) {\r
 -            // TODO Enable when "On Device" is recovered ?\r
 -            mFiles = mStorageManager.getFolderContent(mFile/*, onlyOnDevice*/);\r
 +            mFiles = mStorageManager.getFolderContent(mFile, onlyOnDevice);\r
              mFilesOrig.clear();\r
              mFilesOrig.addAll(mFiles);\r
              \r
              mFiles = null;\r
          }\r
  \r
 -        mFiles = FileStorageUtils.sortFolder(mFiles);\r
 +        mFiles = FileStorageUtils.sortOcFolder(mFiles);\r
          notifyDataSetChanged();\r
      }\r
      \r
          FileStorageUtils.mSortAscending = ascending;\r
          \r
  \r
 -        mFiles = FileStorageUtils.sortFolder(mFiles);\r
 +        mFiles = FileStorageUtils.sortOcFolder(mFiles);\r
          notifyDataSetChanged();\r
  \r
      }\r
      public void setGridMode(boolean gridMode) {\r
          mGridMode = gridMode;\r
      }\r
 +\r
 +    public boolean isGridMode() {\r
 +        return mGridMode;\r
 +    }\r
 +\r
 +    public void setNewSelection(int position, boolean checked) {\r
 +        mSelection.put(position, checked);\r
 +        notifyDataSetChanged();\r
 +    }\r
 +\r
 +    public void removeSelection(int position) {\r
 +        mSelection.remove(position);\r
 +        notifyDataSetChanged();\r
 +    }\r
 +\r
 +    public void removeSelection(){\r
 +         mSelection.clear();\r
 +        notifyDataSetChanged();\r
 +    }\r
 +\r
 +    public ArrayList<Integer> getCheckedItemPositions() {\r
 +        ArrayList<Integer> ids = new ArrayList<Integer>();\r
 +\r
 +        for (Map.Entry<Integer, Boolean> entry : mSelection.entrySet()){\r
 +            if (entry.getValue()){\r
 +                ids.add(entry.getKey());\r
 +            }\r
 +        }\r
 +        return ids;\r
 +    }\r
 +\r
 +    public ArrayList<OCFile> getCheckedItems() {\r
 +        ArrayList<OCFile> files = new ArrayList<OCFile>();\r
 +\r
 +        for (Map.Entry<Integer, Boolean> entry : mSelection.entrySet()){\r
 +            if (entry.getValue()){\r
 +                files.add((OCFile) getItem(entry.getKey()));\r
 +            }\r
 +        }\r
 +        return files;\r
 +    }\r
  }\r
@@@ -25,7 -25,6 +25,6 @@@ package com.owncloud.android.ui.dialog
   * 
   *  Triggers the removal according to the user response.
   */
- import java.util.Vector;
  
  import android.app.Dialog;
  import android.os.Bundle;
@@@ -53,9 -52,9 +52,9 @@@ implements ConfirmationDialogFragmentLi
          RemoveFileDialogFragment frag = new RemoveFileDialogFragment();
          Bundle args = new Bundle();
          
 -        int messageStringId = R.string.confirmation_remove_alert;
 +        int messageStringId = R.string.confirmation_remove_file_alert;
          
 -        int posBtn = R.string.confirmation_remove_remote;
 +        int posBtn = R.string.confirmation_remove_file_remote;
          int negBtn = -1;
          if (file.isFolder()) {
              messageStringId = R.string.confirmation_remove_folder_alert;
      public void onCancel(String callerTag) {
          ComponentsGetter cg = (ComponentsGetter)getActivity();
          cg.getFileOperationsHelper().removeFile(mTargetFile, true);
-         
-         FileDataStorageManager storageManager = cg.getStorageManager();
-         
-         boolean containsFavorite = false;
-         if (mTargetFile.isFolder()) {
-             Vector<OCFile> files = storageManager.getFolderContent(mTargetFile, false);
-             for(OCFile file: files) {
-                 containsFavorite = file.isFavorite() || containsFavorite;
-                 if (containsFavorite)
-                     break;
-             }
-         }
-         // Remove etag for parent, if file is a favorite
-         // or is a folder and contains favorite
-         if (mTargetFile.isFavorite() || containsFavorite) {
-             OCFile folder = null;
-             if (mTargetFile.isFolder()) {
-                 folder = mTargetFile;
-             } else {
-                 folder = storageManager.getFileById(mTargetFile.getParentId());
-             }
-             
-            folder.setEtag("");
-            storageManager.saveFile(folder);
-         }
      }
  
      @Override
@@@ -24,24 -24,17 +24,24 @@@ package com.owncloud.android.ui.fragmen
  
  import android.app.Activity;
  import android.content.Intent;
 +import android.content.SharedPreferences;
 +import android.os.Build;
  import android.os.Bundle;
 +import android.preference.PreferenceManager;
  import android.support.v4.widget.SwipeRefreshLayout;
 -import android.view.ContextMenu;
 +import android.view.ActionMode;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.View;
 +import android.widget.AbsListView;
  import android.widget.AdapterView;
  import android.widget.AdapterView.AdapterContextMenuInfo;
  import android.widget.PopupMenu;
 +import android.widget.TextView;
 +import android.widget.Toast;
  
 +import com.owncloud.android.MainApp;
  import com.owncloud.android.R;
  import com.owncloud.android.authentication.AccountUtils;
  import com.owncloud.android.datamodel.FileDataStorageManager;
@@@ -53,30 -46,24 +53,30 @@@ import com.owncloud.android.ui.activity
  import com.owncloud.android.ui.activity.FileDisplayActivity;
  import com.owncloud.android.ui.activity.FolderPickerActivity;
  import com.owncloud.android.ui.activity.OnEnforceableRefreshListener;
 +import com.owncloud.android.ui.activity.UploadFilesActivity;
  import com.owncloud.android.ui.adapter.FileListListAdapter;
  import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
 +import com.owncloud.android.ui.dialog.CreateFolderDialogFragment;
  import com.owncloud.android.ui.dialog.FileActionsDialogFragment;
  import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
 +import com.owncloud.android.ui.dialog.RemoveFilesDialogFragment;
  import com.owncloud.android.ui.dialog.RenameFileDialogFragment;
 +import com.owncloud.android.ui.dialog.UploadSourceDialogFragment;
  import com.owncloud.android.ui.preview.PreviewImageFragment;
  import com.owncloud.android.ui.preview.PreviewMediaFragment;
 +import com.owncloud.android.utils.DisplayUtils;
  import com.owncloud.android.utils.FileStorageUtils;
  import com.owncloud.android.ui.preview.PreviewTextFragment;
  
  import java.io.File;
 +import java.util.ArrayList;
  
  /**
   * A Fragment that lists all files and folders in a given path.
   *
   * TODO refactor to get rid of direct dependency on FileDisplayActivity
   */
 -public class OCFileListFragment extends ExtendedListFragment implements FileActionsDialogFragment.FileActionsDialogFragmentListener {
 +public class OCFileListFragment extends ExtendedListFragment {
      
      private static final String TAG = OCFileListFragment.class.getSimpleName();
  
  
      public final static String ARG_JUST_FOLDERS = MY_PACKAGE + ".JUST_FOLDERS";
      public final static String ARG_ALLOW_CONTEXTUAL_ACTIONS = MY_PACKAGE + ".ALLOW_CONTEXTUAL";
 +    public final static String ARG_HIDE_FAB = MY_PACKAGE + ".HIDE_FAB";
  
      private static final String KEY_FILE = MY_PACKAGE + ".extra.FILE";
 +    private static final String KEY_FAB_EVER_CLICKED = "FAB_EVER_CLICKED";
 +
 +    private static String DIALOG_CREATE_FOLDER = "DIALOG_CREATE_FOLDER";
  
      private FileFragment.ContainerActivity mContainerActivity;
  
@@@ -99,8 -82,8 +99,8 @@@
      private boolean mJustFolders;
      
      private OCFile mTargetFile;
 -    
 -   
 +
 +    private boolean miniFabClicked = false;
      
      /**
       * {@inheritDoc}
          setListAdapter(mAdapter);
  
          registerLongClickListener();
 +
 +        boolean hideFab = (args != null) && args.getBoolean(ARG_HIDE_FAB, false);
 +        if (hideFab) {
 +            setFabEnabled(false);
 +        } else {
 +            setFabEnabled(true);
 +            registerFabListeners();
 +
 +            // detect if a mini FAB has ever been clicked
 +            final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
 +            if(prefs.getLong(KEY_FAB_EVER_CLICKED, 0) > 0) {
 +                miniFabClicked = true;
 +            }
 +
 +            // add labels to the min FABs when none of them has ever been clicked on
 +            if(!miniFabClicked) {
 +                setFabLabels();
 +            } else {
 +                removeFabLabels();
 +            }
 +        }
    }
  
 +    /**
 +     * adds labels to all mini FABs.
 +     */
 +    private void setFabLabels() {
 +        getFabUpload().setTitle(getResources().getString(R.string.actionbar_upload));
 +        getFabMkdir().setTitle(getResources().getString(R.string.actionbar_mkdir));
 +        getFabUploadFromApp().setTitle(getResources().getString(R.string.actionbar_upload_from_apps));
 +    }
 +
 +    /**
 +     * registers all listeners on all mini FABs.
 +     */
 +    private void registerFabListeners() {
 +        registerFabUploadListeners();
 +        registerFabMkDirListeners();
 +        registerFabUploadFromAppListeners();
 +    }
 +
 +    /**
 +     * registers {@link android.view.View.OnClickListener} and {@link android.view.View.OnLongClickListener}
 +     * on the Upload mini FAB for the linked action and {@link Toast} showing the underlying action.
 +     */
 +    private void registerFabUploadListeners() {
 +        getFabUpload().setOnClickListener(new View.OnClickListener() {
 +            @Override
 +            public void onClick(View v) {
 +                Intent action = new Intent(getActivity(), UploadFilesActivity.class);
 +                action.putExtra(
 +                        UploadFilesActivity.EXTRA_ACCOUNT,
 +                        ((FileActivity) getActivity()).getAccount()
 +                );
 +                getActivity().startActivityForResult(action, UploadSourceDialogFragment.ACTION_SELECT_MULTIPLE_FILES);
 +                getFabMain().collapse();
 +                recordMiniFabClick();
 +            }
 +        });
 +
 +        getFabUpload().setOnLongClickListener(new View.OnLongClickListener() {
 +            @Override
 +            public boolean onLongClick(View v) {
 +                Toast.makeText(getActivity(), R.string.actionbar_upload, Toast.LENGTH_SHORT).show();
 +                return true;
 +            }
 +        });
 +    }
 +
 +    /**
 +     * registers {@link android.view.View.OnClickListener} and {@link android.view.View.OnLongClickListener}
 +     * on the 'Create Dir' mini FAB for the linked action and {@link Toast} showing the underlying action.
 +     */
 +    private void registerFabMkDirListeners() {
 +        getFabMkdir().setOnClickListener(new View.OnClickListener() {
 +            @Override
 +            public void onClick(View v) {
 +                CreateFolderDialogFragment dialog =
 +                        CreateFolderDialogFragment.newInstance(mFile);
 +                dialog.show(getActivity().getSupportFragmentManager(), FileDisplayActivity.DIALOG_CREATE_FOLDER);
 +                getFabMain().collapse();
 +                recordMiniFabClick();
 +            }
 +        });
 +
 +        getFabMkdir().setOnLongClickListener(new View.OnLongClickListener() {
 +            @Override
 +            public boolean onLongClick(View v) {
 +                Toast.makeText(getActivity(), R.string.actionbar_mkdir, Toast.LENGTH_SHORT).show();
 +                return true;
 +            }
 +        });
 +    }
 +
 +    /**
 +     * registers {@link android.view.View.OnClickListener} and {@link android.view.View.OnLongClickListener}
 +     * on the Upload from App mini FAB for the linked action and {@link Toast} showing the underlying action.
 +     */
 +    private void registerFabUploadFromAppListeners() {
 +        getFabUploadFromApp().setOnClickListener(new View.OnClickListener() {
 +            @Override
 +            public void onClick(View v) {
 +                Intent action = new Intent(Intent.ACTION_GET_CONTENT);
 +                action = action.setType("*/*").addCategory(Intent.CATEGORY_OPENABLE);
 +
 +                //Intent.EXTRA_ALLOW_MULTIPLE is only supported on api level 18+, Jelly Bean
 +                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
 +                    action.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
 +                }
 +
 +                getActivity().startActivityForResult(
 +                        Intent.createChooser(action, getString(R.string.upload_chooser_title)),
 +                        UploadSourceDialogFragment.ACTION_SELECT_CONTENT_FROM_APPS
 +                );
 +                getFabMain().collapse();
 +                recordMiniFabClick();
 +            }
 +        });
 +
 +        getFabUploadFromApp().setOnLongClickListener(new View.OnLongClickListener() {
 +            @Override
 +            public boolean onLongClick(View v) {
 +                Toast.makeText(getActivity(),
 +                        R.string.actionbar_upload_from_apps,
 +                        Toast.LENGTH_SHORT).show();
 +                return true;
 +            }
 +        });
 +    }
 +
 +    /**
 +     * records a click on a mini FAB and thus:
 +     * <ol>
 +     *     <li>persists the click fact</li>
 +     *     <li>removes the mini FAB labels</li>
 +     * </ol>
 +     */
 +    private void recordMiniFabClick() {
 +        // only record if it hasn't been done already at some other time
 +        if(!miniFabClicked) {
 +            final SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
 +            sp.edit().putLong(KEY_FAB_EVER_CLICKED, 1).commit();
 +            miniFabClicked = true;
 +        }
 +    }
 +
 +    /**
 +     * removes the labels on all known min FABs.
 +     */
 +    private void removeFabLabels() {
 +        getFabUpload().setTitle(null);
 +        getFabMkdir().setTitle(null);
 +        getFabUploadFromApp().setTitle(null);
 +        ((TextView) getFabUpload().getTag(com.getbase.floatingactionbutton.R.id.fab_label)).setVisibility(View.GONE);
 +        ((TextView) getFabMkdir().getTag(com.getbase.floatingactionbutton.R.id.fab_label)).setVisibility(View.GONE);
 +        ((TextView) getFabUploadFromApp().getTag(com.getbase.floatingactionbutton.R.id.fab_label)).setVisibility(View.GONE);
 +    }
 +
      private void registerLongClickListener() {
 -        getListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
 -            public boolean onItemLongClick(AdapterView<?> arg0, View v,
 -                                           int index, long arg3) {
 -                showFileAction(index);
 +        getListView().setMultiChoiceModeListener(new AbsListView.MultiChoiceModeListener() {
 +            private Menu menu;
 +
 +            @Override
 +            public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) {
 +                final int checkedCount = getListView().getCheckedItemCount();
 +                // TODO Tobi extract to values
 +                mode.setTitle(checkedCount + " selected");
 +
 +                if (checked) {
 +                    mAdapter.setNewSelection(position, checked);
 +                } else {
 +                    mAdapter.removeSelection(position);
 +                }
 +
 +                // TODO maybe change: only recreate menu if count changes
 +                menu.clear();
 +                if (checkedCount == 1) {
 +                    createContextMenu(menu);
 +                } else {
 +                    // download, move, copy, delete
 +                    getActivity().getMenuInflater().inflate(R.menu.multiple_file_actions_menu, menu);
 +                }
 +
 +            }
 +
 +            @Override
 +            public boolean onCreateActionMode(ActionMode mode, Menu menu) {
 +                this.menu = menu;
                  return true;
              }
 +
 +            @Override
 +            public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
 +                return false;
 +            }
 +
 +            @Override
 +            public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
 +                return onFileActionChosen(item.getItemId());
 +            }
 +
 +            @Override
 +            public void onDestroyActionMode(ActionMode mode) {
 +                mAdapter.removeSelection();
 +            }
          });
      }
  
  
      /**
       * Call this, when the user presses the up button.
 -     *
 -     * Tries to move up the current folder one level. If the parent folder was removed from the
 -     * database, it continues browsing up until finding an existing folders.
 -     * <p/>
 -     * return       Count of folder levels browsed up.
 +     * <p>
 +     *     Tries to move up the current folder one level. If the parent folder was removed from the
 +     *     database, it continues browsing up until finding an existing folders.
 +     * </p>
 +     * @return Count of folder levels browsed up.
       */
      public int onBrowseUp() {
          OCFile parentDir = null;
              }   // exit is granted because storageManager.getFileByPath("/") never returns null
              mFile = parentDir;
  
 -            // TODO Enable when "On Device" is recovered ?
 -            listDirectory(mFile /*, MainApp.getOnlyOnDevice()*/);
 +            listDirectory(mFile, MainApp.getOnlyOnDevice());
  
              onRefresh(false);
  
          if (file != null) {
              if (file.isFolder()) {
                  // update state and view of this fragment
 -                // TODO Enable when "On Device" is recovered ?
 -                listDirectory(file/*, MainApp.getOnlyOnDevice()*/);
 +                listDirectory(file, MainApp.getOnlyOnDevice());
                  // then, notify parent activity to let it update its state and view
                  mContainerActivity.onBrowsedDownTo(file);
                  // save index and top position
                      } else {
                          mContainerActivity.getFileOperationsHelper().openFile(file);
                      }
 -
                  } else {
                      // automatic download, preview on finish
                      ((FileDisplayActivity) mContainerActivity).startDownloadForPreview(file);
                  }
 -
              }
 -
          } else {
              Log_OC.d(TAG, "Null object in ListAdapter!!");
          }
      /**
       * {@inheritDoc}
       */
 -    @Override
 -    public void onCreateContextMenu(
 -            ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
 +    // TODO Tobi needed?
 +    public void createContextMenu(Menu menu) {
          Bundle args = getArguments();
          boolean allowContextualActions =
                  (args == null) ? true : args.getBoolean(ARG_ALLOW_CONTEXTUAL_ACTIONS, true);
          if (allowContextualActions) {
              MenuInflater inflater = getActivity().getMenuInflater();
              inflater.inflate(R.menu.file_actions_menu, menu);
 -            AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
 -            OCFile targetFile = (OCFile) mAdapter.getItem(info.position);
 +            OCFile targetFile = null;
 +            if (mAdapter.getCheckedItems().size() == 1){
 +                targetFile = mAdapter.getCheckedItems().get(0);
 +            }
  
              if (mContainerActivity.getStorageManager() != null) {
                  FileMenuFilter mf = new FileMenuFilter(
                      item.setEnabled(false);
                  }
              }
 +
 +//            String.format(mContext.getString(R.string.subject_token),
 +//                    getClient().getCredentials().getUsername(), file.getFileName()));
          }
      }
  
 -    /**
 -     * {@inheritDoc}
 -     */
 -    @Override
 -    public boolean onFileActionChosen(int menuId, int filePosition) {
 -        mTargetFile = (OCFile) mAdapter.getItem(filePosition);
 -        switch (menuId) {
 -            case R.id.action_share_file: {
 -                mContainerActivity.getFileOperationsHelper().shareFileWithLink(mTargetFile);
 -                return true;
 -            }
 -            case R.id.action_open_file_with: {
 -                mContainerActivity.getFileOperationsHelper().openFile(mTargetFile);
 -                return true;
 -            }
 -            case R.id.action_unshare_file: {
 -                mContainerActivity.getFileOperationsHelper().unshareFileWithLink(mTargetFile);
 -                return true;
 -            }
 -            case R.id.action_rename_file: {
 -                RenameFileDialogFragment dialog = RenameFileDialogFragment.newInstance(mTargetFile);
 -                dialog.show(getFragmentManager(), FileDetailFragment.FTAG_RENAME_FILE);
 -                return true;
 -            }
 -            case R.id.action_remove_file: {
 -                RemoveFileDialogFragment dialog = RemoveFileDialogFragment.newInstance(mTargetFile);
 -                dialog.show(getFragmentManager(), ConfirmationDialogFragment.FTAG_CONFIRMATION);
 -                return true;
 -            }
 -            case R.id.action_download_file:
 -            case R.id.action_sync_file: {
 -                mContainerActivity.getFileOperationsHelper().syncFile(mTargetFile);
 -                return true;
 -            }
 -            case R.id.action_cancel_sync: {
 -                ((FileDisplayActivity)mContainerActivity).cancelTransference(mTargetFile);
 -                return true;
 -            }
 -            case R.id.action_see_details: {
 -                mContainerActivity.showDetails(mTargetFile);
 -                return true;
 -            }
 -            case R.id.action_send_file: {
 -                // Obtain the file
 -                if (!mTargetFile.isDown()) {  // Download the file
 -                    Log_OC.d(TAG, mTargetFile.getRemotePath() + " : File must be downloaded");
 -                    ((FileDisplayActivity) mContainerActivity).startDownloadForSending(mTargetFile);
 +    public boolean onFileActionChosen(int menuId) {
 +        if (mAdapter.getCheckedItems().size() == 1){
 +            OCFile mTargetFile = mAdapter.getCheckedItems().get(0);
  
 -                } else {
 -                    mContainerActivity.getFileOperationsHelper().sendDownloadedFile(mTargetFile);
 +            switch (menuId) {
 +                case R.id.action_share_file: {
 +                    mContainerActivity.getFileOperationsHelper().shareFileWithLink(mTargetFile);
 +                    return true;
                  }
 -                return true;
 -            }
 -            case R.id.action_move: {
 -                Intent action = new Intent(getActivity(), FolderPickerActivity.class);
 +                case R.id.action_open_file_with: {
 +                    mContainerActivity.getFileOperationsHelper().openFile(mTargetFile);
 +                    return true;
 +                }
 +                case R.id.action_unshare_file: {
 +                    mContainerActivity.getFileOperationsHelper().unshareFileWithLink(mTargetFile);
 +                    return true;
 +                }
 +                case R.id.action_rename_file: {
 +                    RenameFileDialogFragment dialog = RenameFileDialogFragment.newInstance(mTargetFile);
 +                    dialog.show(getFragmentManager(), FileDetailFragment.FTAG_RENAME_FILE);
 +                    return true;
 +                }
 +                case R.id.action_remove_file: {
 +                    RemoveFileDialogFragment dialog = RemoveFileDialogFragment.newInstance(mTargetFile);
 +                    dialog.show(getFragmentManager(), ConfirmationDialogFragment.FTAG_CONFIRMATION);
 +                    return true;
 +                }
 +                case R.id.action_download_file:
 +                case R.id.action_sync_file: {
 +                    mContainerActivity.getFileOperationsHelper().syncFile(mTargetFile);
 +                    return true;
 +                }
-                 case R.id.action_cancel_download:
-                 case R.id.action_cancel_upload: {
++                case R.id.action_cancel_sync: {
 +                    ((FileDisplayActivity) mContainerActivity).cancelTransference(mTargetFile);
 +                    return true;
 +                }
 +                case R.id.action_see_details: {
 +                    mContainerActivity.showDetails(mTargetFile);
 +                    return true;
 +                }
 +                case R.id.action_send_file: {
 +                    // Obtain the file
 +                    if (!mTargetFile.isDown()) {  // Download the file
 +                        Log_OC.d(TAG, mTargetFile.getRemotePath() + " : File must be downloaded");
 +                        ((FileDisplayActivity) mContainerActivity).startDownloadForSending(mTargetFile);
  
 -                // Pass mTargetFile that contains info of selected file/folder
 -                action.putExtra(FolderPickerActivity.EXTRA_FILE, mTargetFile);
 -                getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_MOVE_FILES);
 -                return true;
 -            }
 -            case R.id.action_favorite_file: {
 -                mContainerActivity.getFileOperationsHelper().toggleFavorite(mTargetFile, true);
 -                return true;
 -            }
 -            case R.id.action_unfavorite_file: {
 -                mContainerActivity.getFileOperationsHelper().toggleFavorite(mTargetFile, false);
 -                return true;
 +                    } else {
 +                        mContainerActivity.getFileOperationsHelper().sendDownloadedFile(mTargetFile);
 +                    }
 +                    return true;
 +                }
 +                case R.id.action_move: {
 +                    Intent action = new Intent(getActivity(), FolderPickerActivity.class);
 +                    ArrayList files = new ArrayList();
 +                    files.add(mTargetFile);
 +                    action.putParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES, files);
 +                    getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_MOVE_FILES);
 +                    return true;
 +                }
 +                case R.id.action_favorite_file: {
 +                    mContainerActivity.getFileOperationsHelper().toggleFavorite(mTargetFile, true);
 +                    return true;
 +                }
 +                case R.id.action_unfavorite_file: {
 +                    mContainerActivity.getFileOperationsHelper().toggleFavorite(mTargetFile, false);
 +                    return true;
 +                }
 +                case R.id.action_copy:
 +                    Intent action = new Intent(getActivity(), FolderPickerActivity.class);
 +
 +                    // Pass mTargetFile that contains info of selected file/folder
 +                    action.putExtra(FolderPickerActivity.EXTRA_FILE, mTargetFile);
 +                    getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_COPY_FILES);
 +                    return true;
 +                default:
 +                    return false;
              }
 -            case R.id.action_copy:
 -                Intent action = new Intent(getActivity(), FolderPickerActivity.class);
 +        } else {
 +            ArrayList<OCFile> mTargetFiles = mAdapter.getCheckedItems();
  
 -                // Pass mTargetFile that contains info of selected file/folder
 -                action.putExtra(FolderPickerActivity.EXTRA_FILE, mTargetFile);
 -                getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_COPY_FILES);
 -                return true;
 -            default:
 -                return false;
 +            switch (menuId) {
 +                case R.id.action_remove_file: {
 +                    RemoveFilesDialogFragment dialog = RemoveFilesDialogFragment.newInstance(mTargetFiles);
 +                    dialog.show(getFragmentManager(), ConfirmationDialogFragment.FTAG_CONFIRMATION);
 +                    return true;
 +                }
 +                case R.id.action_download_file:
 +                case R.id.action_sync_file: {
 +                    mContainerActivity.getFileOperationsHelper().syncFiles(mTargetFiles);
 +                    return true;
 +                }
 +                case R.id.action_move: {
 +                    Intent action = new Intent(getActivity(), FolderPickerActivity.class);
 +                    action.putParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES, mTargetFiles);
 +                    getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_MOVE_FILES);
 +                    return true;
 +                }
 +                case R.id.action_favorite_file: {
 +                    mContainerActivity.getFileOperationsHelper().toggleFavorites(mTargetFiles, true);
 +                    return true;
 +                }
 +                case R.id.action_unfavorite_file: {
 +                    mContainerActivity.getFileOperationsHelper().toggleFavorites(mTargetFiles, false);
 +                    return true;
 +                }
 +                case R.id.action_copy:
 +                    Intent action = new Intent(getActivity(), FolderPickerActivity.class);
 +                    action.putParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES, mTargetFiles);
 +                    getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_COPY_FILES);
 +                    return true;
 +                default:
 +                    return false;
 +            }
          }
 +
      }
      
      /**
      @Override
      public boolean onContextItemSelected (MenuItem item) {
          AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
 -        boolean matched = onFileActionChosen(item.getItemId(), ((AdapterContextMenuInfo) item.getMenuInfo()).position);
 +        boolean matched = onFileActionChosen(item.getItemId());
          if(!matched) {
              return super.onContextItemSelected(item);
          } else {
      }
  
      /**
 -     * Calls {@link OCFileListFragment#listDirectory(OCFile)} with a null parameter
 +     * Calls {@link OCFileListFragment#listDirectory(OCFile, boolean)} with a null parameter
       */
 -    public void listDirectory(/*boolean onlyOnDevice*/){
 -        listDirectory(null);
 -        // TODO Enable when "On Device" is recovered ?
 -        // listDirectory(null, onlyOnDevice);
 +    public void listDirectory(boolean onlyOnDevice){
 +        listDirectory(null, onlyOnDevice);
      }
      
      public void refreshDirectory(){
 -        // TODO Enable when "On Device" is recovered ?
 -        listDirectory(getCurrentFile()/*, MainApp.getOnlyOnDevice()*/);
 +        listDirectory(getCurrentFile(), MainApp.getOnlyOnDevice());
      }
  
      /**
       *
       * @param directory File to be listed
       */
 -    public void listDirectory(OCFile directory/*, boolean onlyOnDevice*/) {
 +    public void listDirectory(OCFile directory, boolean onlyOnDevice) {
          FileDataStorageManager storageManager = mContainerActivity.getStorageManager();
          if (storageManager != null) {
  
                  directory = storageManager.getFileById(directory.getParentId());
              }
  
 -            // TODO Enable when "On Device" is recovered ?
 -            mAdapter.swapDirectory(directory, storageManager/*, onlyOnDevice*/);
 +            mAdapter.swapDirectory(directory, storageManager, onlyOnDevice);
              if (mFile == null || !mFile.equals(directory)) {
                  mCurrentListView.setSelection(0);
              }
              OwnCloudVersion version = AccountUtils.getServerVersion(
                      ((FileActivity)mContainerActivity).getAccount());
              if (version != null && version.supportsRemoteThumbnails() &&
 -                imagesCount > 0 && imagesCount == filesCount) {
 +                    DisplayUtils.isGridView(mFile, mContainerActivity.getStorageManager())) {
                  switchToGridView();
                  registerLongClickListener();
              } else {
  \r
  package com.owncloud.android.utils;\r
  \r
 +import java.io.File;\r
 +import java.net.IDN;\r
 +import java.text.DateFormat;\r
 +import java.util.Arrays;\r
 +import java.util.Calendar;\r
 +import java.util.Date;\r
 +import java.util.HashMap;\r
 +import java.util.HashSet;\r
 +import java.util.Set;\r
 +import java.util.Vector;\r
 +\r
  import android.annotation.TargetApi;\r
  import android.app.Activity;\r
  import android.content.Context;\r
 +import android.content.SharedPreferences;\r
  import android.graphics.Point;\r
  import android.graphics.PorterDuff;\r
  import android.os.Build;\r
@@@ -47,10 -35,8 +47,10 @@@ import android.widget.SeekBar
  \r
  import com.owncloud.android.MainApp;\r
  import com.owncloud.android.R;\r
 +import com.owncloud.android.datamodel.FileDataStorageManager;\r
  import com.owncloud.android.datamodel.OCFile;\r
  \r
 +import java.math.BigDecimal;\r
  import java.net.IDN;\r
  import java.text.DateFormat;\r
  import java.util.Calendar;\r
@@@ -66,7 -52,6 +66,7 @@@ public class DisplayUtils 
      private static final String OWNCLOUD_APP_NAME = "ownCloud";\r
      \r
      private static final String[] sizeSuffixes = { "B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };\r
 +    private static final int[] sizeScales = { 0, 0, 0, 1, 1, 2, 2, 2, 2 };\r
  \r
      private static Map<String, String> mimeType2HumanReadable;\r
  \r
  \r
      /**\r
       * Converts the file size in bytes to human readable output.\r
 -     * \r
 +     * <ul>\r
 +     *     <li>appends a size suffix, e.g. B, KB, MB etc.</li>\r
 +     *     <li>rounds the size based on the suffix to 0,1 or 2 decimals</li>\r
 +     * </ul>\r
 +     *\r
       * @param bytes Input file size\r
       * @return Like something readable like "12 MB"\r
       */\r
      public static String bytesToHumanReadable(long bytes) {\r
          double result = bytes;\r
 -        int attachedsuff = 0;\r
 -        while (result > 1024 && attachedsuff < sizeSuffixes.length) {\r
 +        int attachedSuff = 0;\r
 +        while (result > 1024 && attachedSuff < sizeSuffixes.length) {\r
              result /= 1024.;\r
 -            attachedsuff++;\r
 +            attachedSuff++;\r
          }\r
 -        result = ((int) (result * 100)) / 100.;\r
 -        return result + " " + sizeSuffixes[attachedsuff];\r
 +\r
 +        return new BigDecimal(result).setScale(\r
 +                sizeScales[attachedSuff], BigDecimal.ROUND_HALF_UP) + " " + sizeSuffixes[attachedSuff];\r
      }\r
  \r
      /**\r
          else if ((System.currentTimeMillis() - time) < 60 * 1000) {\r
              return c.getString(R.string.file_list_seconds_ago);\r
          } else {\r
-             // Workaround 2.x bug (see https://github.com/owncloud/android/issues/716)\r
-             if (    Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB && \r
-                     (System.currentTimeMillis() - time) > 24 * 60 * 60 * 1000   ) {\r
-                 Date date = new Date(time);\r
-                 date.setHours(0);\r
-                 date.setMinutes(0);\r
-                 date.setSeconds(0);\r
-                 dateString = DateUtils.getRelativeDateTimeString(\r
-                         c, date.getTime(), minResolution, transitionResolution, flags\r
-                 );\r
-             } else {\r
-                 dateString = DateUtils.getRelativeDateTimeString(c, time, minResolution, transitionResolution, flags);\r
-             }\r
+             dateString = DateUtils.getRelativeDateTimeString(c, time, minResolution, transitionResolution, flags);\r
          }\r
  \r
          String[] parts = dateString.toString().split(",");\r
                  return parts[1];\r
              }\r
          }\r
-         //dateString contains unexpected format. use localized, absolute date.\r
-         return DisplayUtils.unixTimeToHumanReadable(time);\r
+         //dateString contains unexpected format. fallback: use relative date time string from android api as is.\r
+         return dateString.toString();\r
      }\r
  \r
      /**\r
      }\r
  \r
      /**\r
 +     * Determines if user set folder to grid or list view. If folder is not set itself,\r
 +     * it finds a parent that is set (at least root is set).\r
 +     * @param file\r
 +     * @param storageManager\r
 +     * @return\r
 +     */\r
 +    public static boolean isGridView(OCFile file, FileDataStorageManager storageManager){\r
 +        if (file != null) {\r
 +            OCFile fileToTest = file;\r
 +            OCFile parentDir = null;\r
 +            String parentPath = null;\r
 +\r
 +            SharedPreferences setting = MainApp.getAppContext().getSharedPreferences(\r
 +                    "viewMode", Context.MODE_PRIVATE);\r
 +\r
 +            if (setting.contains(fileToTest.getRemoteId())) {\r
 +                return setting.getBoolean(fileToTest.getRemoteId(), false);\r
 +            } else {\r
 +                do {\r
 +                    if (fileToTest.getParentId() != FileDataStorageManager.ROOT_PARENT_ID) {\r
 +                        parentPath = new File(fileToTest.getRemotePath()).getParent();\r
 +                        parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath :\r
 +                                parentPath + OCFile.PATH_SEPARATOR;\r
 +                        parentDir = storageManager.getFileByPath(parentPath);\r
 +                    } else {\r
 +                        parentDir = storageManager.getFileByPath(OCFile.ROOT_PATH);\r
 +                    }\r
 +\r
 +                    while (parentDir == null) {\r
 +                        parentPath = new File(parentPath).getParent();\r
 +                        parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath :\r
 +                                parentPath + OCFile.PATH_SEPARATOR;\r
 +                        parentDir = storageManager.getFileByPath(parentPath);\r
 +                    }\r
 +                    fileToTest = parentDir;\r
 +                } while (endWhile(parentDir, setting));\r
 +                return setting.getBoolean(fileToTest.getRemoteId(), false);\r
 +            }\r
 +        } else {\r
 +            return false;\r
 +        }\r
 +    }\r
 +\r
 +    private static boolean endWhile(OCFile parentDir, SharedPreferences setting) {\r
 +        if (parentDir.getRemotePath().compareToIgnoreCase(OCFile.ROOT_PATH) == 0) {\r
 +            return false;\r
 +        } else {\r
 +            return !setting.contains(parentDir.getRemoteId());\r
 +        }\r
 +    }\r
 +\r
 +    public static void setViewMode(OCFile file, boolean setGrid){\r
 +        SharedPreferences setting = MainApp.getAppContext().getSharedPreferences(\r
 +                "viewMode", Context.MODE_PRIVATE);\r
 +\r
 +        SharedPreferences.Editor editor = setting.edit();\r
 +        editor.putBoolean(file.getRemoteId(), setGrid);\r
 +        editor.commit();\r
 +    }\r
 +\r
 +    /**\r
       * sets the coloring of the given progress bar to color_accent.\r
       *\r
       * @param progressBar the progress bar to be colored\r
  package com.owncloud.android.utils;
  
  import java.io.File;
 +import java.util.ArrayList;
 +import java.util.Arrays;
  import java.util.Collections;
  import java.util.Comparator;
 +import java.util.List;
  import java.util.Vector;
  
  import third_parties.daveKoeller.AlphanumComparator;
@@@ -35,6 -32,7 +35,7 @@@ import com.owncloud.android.R
  import com.owncloud.android.datamodel.OCFile;
  import com.owncloud.android.lib.resources.files.RemoteFile;
  
+ import android.accounts.Account;
  import android.annotation.SuppressLint;
  import android.content.Context;
  import android.content.SharedPreferences;
@@@ -56,8 -54,6 +57,6 @@@ public class FileStorageUtils 
      public static Boolean mSortAscending = true;
  
      
-     //private static final String LOG_TAG = "FileStorageUtils";
      public static final String getSavePath(String accountName) {
          File sdCard = Environment.getExternalStorageDirectory();
          return sdCard.getAbsolutePath() + "/" + MainApp.getDataFolder() + "/" + Uri.encode(accountName, "@");
       * Creates and populates a new {@link OCFile} object with the data read from the server.
       * 
       * @param remote    remote file read from the server (remote file or folder).
-      * @return          New OCFile instance representing the remote resource described by we.
+      * @return          New OCFile instance representing the remote resource described by remote.
       */
      public static OCFile fillOCFile(RemoteFile remote) {
          OCFile file = new OCFile(remote.getRemotePath());
      /**
       * Sorts all filenames, regarding last user decision 
       */
 -    public static Vector<OCFile> sortFolder(Vector<OCFile> files){
 +    public static Vector<OCFile> sortOcFolder(Vector<OCFile> files){
          switch (mSortOrder){
          case 0:
 -            files = FileStorageUtils.sortByName(files);
 +            files = FileStorageUtils.sortOCFilesByName(files);
              break;
          case 1:
 -            files = FileStorageUtils.sortByDate(files);
 +            files = FileStorageUtils.sortOCFilesByDate(files);
              break;
          case 2: 
             // mFiles = FileStorageUtils.sortBySize(mSortAscending);
         
          return files;
      }
 +
 +    /**
 +     * Sorts all filenames, regarding last user decision
 +     */
 +    public static File[] sortLocalFolder(File[] files){
 +        switch (mSortOrder){
 +            case 0:
 +                files = FileStorageUtils.sortLocalFilesByName(files);
 +                break;
 +            case 1:
 +                files = FileStorageUtils.sortLocalFilesByDate(files);
 +                break;
 +            case 2:
 +                // mFiles = FileStorageUtils.sortBySize(mSortAscending);
 +                break;
 +        }
 +
 +        return files;
 +    }
      
      /**
       * Sorts list by Date
       * @param files
       */
 -    public static Vector<OCFile> sortByDate(Vector<OCFile> files){
 +    public static Vector<OCFile> sortOCFilesByDate(Vector<OCFile> files){
          final Integer val;
          if (mSortAscending){
              val = 1;
          return files;
      }
  
 +    /**
 +     * Sorts list by Date
 +     * @param filesArray
 +     */
 +    public static File[] sortLocalFilesByDate(File[] filesArray){
 +        final Integer val;
 +        if (mSortAscending){
 +            val = 1;
 +        } else {
 +            val = -1;
 +        }
 +
 +        List<File> files = new ArrayList<File>(Arrays.asList(filesArray));
 +
 +        Collections.sort(files, new Comparator<File>() {
 +            public int compare(File o1, File o2) {
 +                if (o1.isDirectory() && o2.isDirectory()) {
 +                    Long obj1 = o1.lastModified();
 +                    return val * obj1.compareTo(o2.lastModified());
 +                }
 +                else if (o1.isDirectory()) {
 +                    return -1;
 +                } else if (o2.isDirectory()) {
 +                    return 1;
 +                } else if (o1.lastModified() == 0 || o2.lastModified() == 0){
 +                    return 0;
 +                } else {
 +                    Long obj1 = o1.lastModified();
 +                    return val * obj1.compareTo(o2.lastModified());
 +                }
 +            }
 +        });
 +
 +        File[] returnArray = new File[1];
 +        return files.toArray(returnArray);
 +    }
 +
  //    /**
  //     * Sorts list by Size
  //     * @param sortAscending true: ascending, false: descending
       * Sorts list by Name
       * @param files     files to sort
       */
 -    public static Vector<OCFile> sortByName(Vector<OCFile> files){
 +    public static Vector<OCFile> sortOCFilesByName(Vector<OCFile> files){
          final Integer val;
          if (mSortAscending){
              val = 1;
          
          return files;
      }
 +
 +    /**
 +     * Sorts list by Name
 +     * @param filesArray    files to sort
 +     */
 +    public static File[] sortLocalFilesByName(File[] filesArray){
 +        final Integer val;
 +        if (mSortAscending){
 +            val = 1;
 +        } else {
 +            val = -1;
 +        }
 +
 +        List<File> files = new ArrayList<File>(Arrays.asList(filesArray));
 +
 +        Collections.sort(files, new Comparator<File>() {
 +            public int compare(File o1, File o2) {
 +                if (o1.isDirectory() && o2.isDirectory()) {
 +                    return val * o1.getPath().toLowerCase().compareTo(o2.getPath().toLowerCase());
 +                } else if (o1.isDirectory()) {
 +                    return -1;
 +                } else if (o2.isDirectory()) {
 +                    return 1;
 +                }
 +                return val * new AlphanumComparator().compare(o1.getPath().toLowerCase(),
 +                                                              o2.getPath().toLowerCase());
 +            }
 +        });
 +
 +        File[] returnArray = new File[1];
 +        return files.toArray(returnArray);
 +    }
      
      /**
       * Local Folder size
          String result = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
          return (result != null) ? result : "";
      }
-   
+     /**
+      * Scans the default location for saving local copies of files searching for
+      * a 'lost' file with the same full name as the {@link OCFile} received as
+      * parameter.
+      *
+      * This method helps to keep linked local copies of the files when the app is uninstalled, and then
+      * reinstalled in the device. OR after the cache of the app was deleted in system settings.
+      *
+      * The method is assuming that all the local changes in the file where synchronized in the past. This is dangerous,
+      * but assuming the contrary could lead to massive unnecessary synchronizations of downloaded file after deleting
+      * the app cache.
+      *
+      * This should be changed in the near future to avoid any chance of data loss, but we need to add some options
+      * to limit hard automatic synchronizations to wifi, unless the user wants otherwise.
+      *
+      * @param file      File to associate a possible 'lost' local file.
+      * @param account   Account holding file.
+      */
+     public static void searchForLocalFileInDefaultPath(OCFile file, Account account) {
+         if (file.getStoragePath() == null && !file.isFolder()) {
+             File f = new File(FileStorageUtils.getDefaultSavePathFor(account.name, file));
+             if (f.exists()) {
+                 file.setStoragePath(f.getAbsolutePath());
+                 file.setLastSyncDateForData(f.lastModified());
+             }
+         }
+     }
  }