Merge pull request #1088 from owncloud/updated_docs_about_target_of_PRs
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / FileActivity.java
index c37477c..9a952e4 100644 (file)
@@ -405,16 +405,14 @@ public class FileActivity extends ActionBarActivity
 
         /// choose the appropiate title
         if (chosenFile == null) {
 
         /// choose the appropiate title
         if (chosenFile == null) {
-            // mFile determines the title
-            inRoot = (mFile == null || mFile.getParentId() == 0);
-            if (!inRoot) {
-                title = mFile.getFileName();
-            }
-
-        } else {
-            // chosenFile determines the title, instead of mFile
+            chosenFile = mFile;     // if no file is passed, current file decides
+        }
+        inRoot = (
+                chosenFile == null ||
+                (chosenFile.isFolder() && chosenFile.getParentId() == FileDataStorageManager.ROOT_PARENT_ID)
+        );
+        if (!inRoot) {
             title = chosenFile.getFileName();
             title = chosenFile.getFileName();
-            inRoot = false;
         }
 
         /// set the chosen title
         }
 
         /// set the chosen title