Fix save log & repo (#1597)

This commit is contained in:
LoveSy 2022-02-01 12:33:18 +08:00 committed by GitHub
parent c7d82fee37
commit 1be8257252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -96,6 +96,7 @@ public class LogsFragment extends BaseFragment {
} catch (IOException e) {
var text = context.getString(R.string.logs_save_failed2, e.getMessage());
showHint(text, false);
Log.w(App.TAG, "save log", e);
}
});
});

View File

@ -329,7 +329,7 @@ public class RepoFragment extends BaseFragment implements RepoLoader.RepoListene
@SuppressLint("NotifyDataSetChanged")
private void setLoaded(List<OnlineModule> list, boolean isLoaded) {
runOnUiThread(() -> {
showList = list;
if (list != null) showList = list;
this.isLoaded = isLoaded;
notifyDataSetChanged();
});

View File

@ -210,9 +210,11 @@ public class ConfigFileManager {
private static void putFds(Map<String, ParcelFileDescriptor> map, Path path) throws IOException {
Files.walkFileTree(path, new SimpleFileVisitor<>() {
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
if (Files.isRegularFile(file)) {
var name = path.getParent().relativize(file).toString();
var fd = ParcelFileDescriptor.open(file.toFile(), ParcelFileDescriptor.MODE_READ_ONLY);
map.put(name, fd);
}
return FileVisitResult.CONTINUE;
}
});