Fix save log & repo (#1597)
This commit is contained in:
parent
c7d82fee37
commit
1be8257252
|
|
@ -96,6 +96,7 @@ public class LogsFragment extends BaseFragment {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
var text = context.getString(R.string.logs_save_failed2, e.getMessage());
|
var text = context.getString(R.string.logs_save_failed2, e.getMessage());
|
||||||
showHint(text, false);
|
showHint(text, false);
|
||||||
|
Log.w(App.TAG, "save log", e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -329,7 +329,7 @@ public class RepoFragment extends BaseFragment implements RepoLoader.RepoListene
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
private void setLoaded(List<OnlineModule> list, boolean isLoaded) {
|
private void setLoaded(List<OnlineModule> list, boolean isLoaded) {
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
showList = list;
|
if (list != null) showList = list;
|
||||||
this.isLoaded = isLoaded;
|
this.isLoaded = isLoaded;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -210,9 +210,11 @@ public class ConfigFileManager {
|
||||||
private static void putFds(Map<String, ParcelFileDescriptor> map, Path path) throws IOException {
|
private static void putFds(Map<String, ParcelFileDescriptor> map, Path path) throws IOException {
|
||||||
Files.walkFileTree(path, new SimpleFileVisitor<>() {
|
Files.walkFileTree(path, new SimpleFileVisitor<>() {
|
||||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
||||||
var name = path.getParent().relativize(file).toString();
|
if (Files.isRegularFile(file)) {
|
||||||
var fd = ParcelFileDescriptor.open(file.toFile(), ParcelFileDescriptor.MODE_READ_ONLY);
|
var name = path.getParent().relativize(file).toString();
|
||||||
map.put(name, fd);
|
var fd = ParcelFileDescriptor.open(file.toFile(), ParcelFileDescriptor.MODE_READ_ONLY);
|
||||||
|
map.put(name, fd);
|
||||||
|
}
|
||||||
return FileVisitResult.CONTINUE;
|
return FileVisitResult.CONTINUE;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue