Disable change log; to remove in future
[pub/Android/ownCloud.git] / src / com / owncloud / android / Uploader.java
index 138f68e..6f9dc6d 100644 (file)
@@ -1,9 +1,10 @@
 /* ownCloud Android client application\r
  *   Copyright (C) 2012  Bartek Przybylski\r
+ *   Copyright (C) 2012-2013 ownCloud Inc.\r
  *\r
  *   This program is free software: you can redistribute it and/or modify\r
  *   it under the terms of the GNU General Public License as published by\r
- *   the Free Software Foundation, either version 3 of the License, or\r
+ *   the Free Software Foundation, either version 2 of the License, or\r
  *   (at your option) any later version.\r
  *\r
  *   This program is distributed in the hope that it will be useful,\r
@@ -325,58 +326,24 @@ public class Uploader extends ListActivity implements OnItemClickListener, andro
         mFile = mStorageManager.getFileByPath(full_path);\r
         if (mFile != null) {\r
             Vector<OCFile> files = mStorageManager.getDirectoryContent(mFile);\r
-            if (files.size() > 0) {\r
-                List<HashMap<String, Object>> data = new LinkedList<HashMap<String,Object>>();\r
-                for (OCFile f : files) {\r
-                    HashMap<String, Object> h = new HashMap<String, Object>();\r
-                    if (f.isDirectory()) {\r
-                        h.put("dirname", f.getFileName());\r
-                        data.add(h);\r
-                    }\r
+            List<HashMap<String, Object>> data = new LinkedList<HashMap<String,Object>>();\r
+            for (OCFile f : files) {\r
+                HashMap<String, Object> h = new HashMap<String, Object>();\r
+                if (f.isDirectory()) {\r
+                    h.put("dirname", f.getFileName());\r
+                    data.add(h);\r
                 }\r
-                SimpleAdapter sa = new SimpleAdapter(this,\r
-                                                     data,\r
-                                                     R.layout.uploader_list_item_layout,\r
-                                                     new String[] {"dirname"},\r
-                                                     new int[] {R.id.textView1});\r
-                setListAdapter(sa);\r
-                Button btn = (Button) findViewById(R.id.uploader_choose_folder);\r
-                btn.setOnClickListener(this);\r
-                getListView().setOnItemClickListener(this);\r
             }\r
-        }\r
-        /*\r
-        mCursor = managedQuery(ProviderMeta.ProviderTableMeta.CONTENT_URI, null, ProviderTableMeta.FILE_NAME\r
-                + "=? AND " + ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?", new String[] { "/", mAccount.name }, null);\r
-\r
-        if (mCursor.moveToFirst()) {\r
-            mCursor = managedQuery(\r
-                    ProviderMeta.ProviderTableMeta.CONTENT_URI,\r
-                    null,\r
-                    ProviderTableMeta.FILE_CONTENT_TYPE + "=? AND " + ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND "\r
-                            + ProviderTableMeta.FILE_PARENT + "=?",\r
-                    new String[] { "DIR", mAccount.name,\r
-                            mCursor.getString(mCursor.getColumnIndex(ProviderTableMeta._ID)) }, null);\r
-\r
-            ListView lv = getListView();\r
-            lv.setOnItemClickListener(this);\r
-            SimpleCursorAdapter sca = new SimpleCursorAdapter(this, R.layout.uploader_list_item_layout, mCursor,\r
-                    new String[] { ProviderTableMeta.FILE_NAME }, new int[] { R.id.textView1 });\r
-            setListAdapter(sca);\r
+            SimpleAdapter sa = new SimpleAdapter(this,\r
+                                                data,\r
+                                                R.layout.uploader_list_item_layout,\r
+                                                new String[] {"dirname"},\r
+                                                new int[] {R.id.textView1});\r
+            setListAdapter(sa);\r
             Button btn = (Button) findViewById(R.id.uploader_choose_folder);\r
             btn.setOnClickListener(this);\r
-            /*\r
-             * disable this until new server interaction service wont be created\r
-             * // insert create new directory for multiple items uploading if\r
-             * (getIntent().getAction().equals(Intent.ACTION_SEND_MULTIPLE)) {\r
-             * Button createDirBtn = new Button(this);\r
-             * createDirBtn.setId(android.R.id.button1);\r
-             * createDirBtn.setText(R.string.uploader_btn_create_dir_text);\r
-             * createDirBtn.setOnClickListener(this); ((LinearLayout)\r
-             * findViewById(R.id.linearLayout1)).addView( createDirBtn,\r
-             * LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); }\r
-             *\r
-        }*/\r
+            getListView().setOnItemClickListener(this);\r
+        }\r
     }\r
 \r
     private boolean prepareStreamsToUpload() {\r