Skip to content

Commit fe71053

Browse files
authored
Merge pull request #94 from kaczmarkiewiczp/dev
Bug fixes
2 parents d75fbd7 + fb5e056 commit fe71053

File tree

9 files changed

+40
-28
lines changed

9 files changed

+40
-28
lines changed

.idea/caches/build_file_checksums.ser

0 Bytes
Binary file not shown.

.idea/misc.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "ca.pkay.rcloneexplorer"
88
minSdkVersion 21
99
targetSdkVersion 27
10-
versionCode 18
11-
versionName "1.3.2-DEV"
10+
versionCode 19
11+
versionName "1.3.3-DEV"
1212
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1313
}
1414
buildTypes {

app/src/main/assets/changelog.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### 1.3.3
2+
* **Fix:** Infinite loading for directories with large number of files
3+
* **Fix:** Open as not working
4+
* **Fix:** App launching behaviour
5+
* **Fix:** Theme of password dialog
6+
7+
***
8+
19
### 1.3.2
210
* **New:** File options for individual files
311
* **New:** Generate public link to file/folder (rclone link)

app/src/main/ic_launcher-web.png

-18.8 KB
Binary file not shown.
-12.8 KB
Binary file not shown.

app/src/main/java/ca/pkay/rcloneexplorer/Fragments/FileExplorerFragment.java

+3-9
Original file line numberDiff line numberDiff line change
@@ -478,21 +478,15 @@ private void showOpenAsDialog(final FileItem fileItem) {
478478
.setOnClickListener(new OpenAsDialog.OnClickListener() {
479479
@Override
480480
public void onClickText() {
481-
if (recyclerViewAdapter.getNumberOfSelectedItems() == 1) {
482-
new DownloadAndOpen(DownloadAndOpen.OPEN_AS_TEXT).execute(fileItem);
483-
}
481+
new DownloadAndOpen(DownloadAndOpen.OPEN_AS_TEXT).execute(fileItem);
484482
}
485483
@Override
486484
public void onClickAudio() {
487-
if (recyclerViewAdapter.getNumberOfSelectedItems() == 1) {
488-
new StreamTask(StreamTask.OPEN_AS_AUDIO).execute(fileItem);
489-
}
485+
new StreamTask(StreamTask.OPEN_AS_AUDIO).execute(fileItem);
490486
}
491487
@Override
492488
public void onClickVideo() {
493-
if (recyclerViewAdapter.getNumberOfSelectedItems() == 1) {
494-
new StreamTask(StreamTask.OPEN_AS_VIDEO).execute(fileItem);
495-
}
489+
new StreamTask(StreamTask.OPEN_AS_VIDEO).execute(fileItem);
496490
}
497491
@Override
498492
public void onClickImage() {

app/src/main/java/ca/pkay/rcloneexplorer/MainActivity.java

+1
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ private void askForConfigPassword() {
331331
.setMessage(R.string.please_enter_password)
332332
.setNegativeButton(R.string.cancel)
333333
.setPositiveButton(R.string.okay_confirmation)
334+
.setDarkTheme(isDarkTheme)
334335
.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD)
335336
.setOnPositiveListener(new InputDialog.OnPositive() {
336337
@Override

app/src/main/java/ca/pkay/rcloneexplorer/Rclone.java

+25-16
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,6 @@ public List<FileItem> getDirectoryContent(String remote, String path) {
111111
Process process;
112112
try {
113113
process = Runtime.getRuntime().exec(command);
114-
process.waitFor();
115-
if (process.exitValue() != 0) {
116-
logErrorOutput(process);
117-
return null;
118-
}
119114

120115
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
121116
String line;
@@ -124,6 +119,12 @@ public List<FileItem> getDirectoryContent(String remote, String path) {
124119
output.append(line);
125120
}
126121

122+
process.waitFor();
123+
if (process.exitValue() != 0) {
124+
logErrorOutput(process);
125+
return null;
126+
}
127+
127128
results = new JSONArray(output.toString());
128129

129130
} catch (IOException | InterruptedException | JSONException e) {
@@ -159,19 +160,20 @@ public List<RemoteItem> getRemotes() {
159160
JSONObject remotesJSON;
160161
try {
161162
process = Runtime.getRuntime().exec(command);
162-
process.waitFor();
163-
if (process.exitValue() != 0) {
164-
Toasty.error(context, context.getString(R.string.error_getting_remotes), Toast.LENGTH_SHORT, true).show();
165-
logErrorOutput(process);
166-
return new ArrayList<>();
167-
}
168163

169164
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
170165
String line;
171166
while ((line = reader.readLine()) != null) {
172167
output.append(line);
173168
}
174169

170+
process.waitFor();
171+
if (process.exitValue() != 0) {
172+
Toasty.error(context, context.getString(R.string.error_getting_remotes), Toast.LENGTH_SHORT, true).show();
173+
logErrorOutput(process);
174+
return new ArrayList<>();
175+
}
176+
175177
remotesJSON = new JSONObject(output.toString());
176178
} catch (IOException | InterruptedException | JSONException e) {
177179
Toasty.error(context, context.getString(R.string.error_getting_remotes), Toast.LENGTH_SHORT, true).show();
@@ -574,14 +576,10 @@ public Boolean decryptConfig(String password) {
574576

575577
try {
576578
process = Runtime.getRuntime().exec(command, environmentalVars);
577-
process.waitFor();
578-
} catch (IOException | InterruptedException e) {
579+
} catch (IOException e) {
579580
e.printStackTrace();
580581
return false;
581582
}
582-
if (process.exitValue() != 0) {
583-
return false;
584-
}
585583

586584
ArrayList<String> result = new ArrayList<>();
587585
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
@@ -595,6 +593,17 @@ public Boolean decryptConfig(String password) {
595593
return false;
596594
}
597595

596+
try {
597+
process.waitFor();
598+
} catch (InterruptedException e) {
599+
e.printStackTrace();
600+
return false;
601+
}
602+
603+
if (process.exitValue() != 0) {
604+
return false;
605+
}
606+
598607
String appsFileDir = context.getFilesDir().getPath();
599608
File file = new File(appsFileDir, "rclone.conf");
600609

0 commit comments

Comments
 (0)