2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 14:15:14 +00:00

Try to find 'camera pictures' in every storage dir, not only the main one

BUG: 340327
This commit is contained in:
Albert Vaca
2014-11-22 17:01:21 -08:00
parent 40d4561c9b
commit cf0456755b

View File

@@ -22,7 +22,6 @@ package org.kde.kdeconnect.Plugins.SftpPlugin;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.Context;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Environment; import android.os.Environment;
import android.widget.Button; import android.widget.Button;
@@ -114,18 +113,23 @@ public class SftpPlugin extends Plugin {
} else { } else {
res.append(context.getString(R.string.sftp_all_files)); res.append(context.getString(R.string.sftp_all_files));
} }
String pathName = res.toString();
if (storage.readonly) { if (storage.readonly) {
res.append(" "); res.append(" ");
res.append(context.getString(R.string.sftp_readonly)); res.append(context.getString(R.string.sftp_readonly));
} }
pathNames.add(res.toString()); pathNames.add(res.toString());
}
//Shortcut for users that only want to browse camera pictures //Shortcut for users that only want to browse camera pictures
String cameraDir = Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera"; String dcim = storage.path + "/DCIM/Camera";
if (new File(cameraDir).exists()) { if (new File(dcim).exists()) {
paths.add(cameraDir); paths.add(dcim);
pathNames.add(context.getString(R.string.sftp_camera)); if (storageList.size() > 1) {
pathNames.add(context.getString(R.string.sftp_camera) + "(" + pathName + ")");
} else {
pathNames.add(context.getString(R.string.sftp_camera));
}
}
} }
np2.set("multiPaths", paths); np2.set("multiPaths", paths);