aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp2
-rw-r--r--src/ResourceLoader.cpp8
2 files changed, 4 insertions, 6 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 856ff82..e31b846 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -5527,7 +5527,7 @@ namespace QuickMedia {
if(room_info.avatar_url) {
room_avatar_sprite.set_texture(nullptr);
- room_avatar_thumbnail_data.reset();
+ room_avatar_thumbnail_data = std::make_shared<ThumbnailData>();
avatar_applied = false;
}
});
diff --git a/src/ResourceLoader.cpp b/src/ResourceLoader.cpp
index 401ca38..e5d16dd 100644
--- a/src/ResourceLoader.cpp
+++ b/src/ResourceLoader.cpp
@@ -43,12 +43,10 @@ namespace QuickMedia {
std::string output;
const char *args[] = { "fc-match", font_name.c_str(), "file", nullptr };
- if(exec_program(args, accumulate_string, &output) == 0 && output.size() > 6 && output.size() >= font_name.size()) {
+ if(exec_program(args, accumulate_string, &output) == 0 && output.size() > 6) {
output = strip(output);
- if(string_ends_with(output, "/" + font_name)) {
- font_filepath_result = output.substr(6);
- return true;
- }
+ font_filepath_result = output.substr(6);
+ return true;
}
fprintf(stderr, "Warning: failed to find font: %s\n", font_name.c_str());