static asan and reorder forward/open

This commit is contained in:
Green Sky 2024-08-10 10:53:57 +02:00
parent b48d7e3cfd
commit b133c5f79f
No known key found for this signature in database
3 changed files with 26 additions and 26 deletions

View File

@ -30,6 +30,7 @@ if (TOMATO_ASAN)
#link_libraries(-fsanitize=address) #link_libraries(-fsanitize=address)
link_libraries(-fsanitize=address,undefined) link_libraries(-fsanitize=address,undefined)
#link_libraries(-fsanitize=undefined) #link_libraries(-fsanitize=undefined)
link_libraries(-static-libasan) # make it "work" on nix
message("II enabled ASAN") message("II enabled ASAN")
else() else()
message("!! can not enable ASAN on this platform (gcc/clang + win)") message("!! can not enable ASAN on this platform (gcc/clang + win)")

View File

@ -139,7 +139,10 @@
pkg-config pkg-config
]; ];
shellHook = "echo hello to tomato dev shell!"; shellHook = ''
echo hello to tomato dev shell!
export LD_LIBRARY_PATH=/run/opengl-driver/lib
'';
}; };
apps.default = { apps.default = {

View File

@ -1176,8 +1176,15 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
if (o.all_of<ObjComp::F::SingleInfoLocal>()) { if (o.all_of<ObjComp::F::SingleInfoLocal>()) {
const auto& local_info = o.get<ObjComp::F::SingleInfoLocal>(); const auto& local_info = o.get<ObjComp::F::SingleInfoLocal>();
if (!local_info.file_path.empty() && ImGui::BeginPopupContextItem("##file_c")) { if (!local_info.file_path.empty() && ImGui::BeginPopupContextItem("##file_c")) {
if (o.all_of<ObjComp::F::TagLocalHaveAll>()) { if (ImGui::MenuItem("open")) {
if (ImGui::BeginMenu("forward")) { const std::string url {file_path_to_file_url(local_info.file_path)};
std::cout << "opening file '" << url << "'\n";
SDL_OpenURL(url.c_str());
}
ImGui::Separator();
if (ImGui::BeginMenu("forward", o.all_of<ObjComp::F::TagLocalHaveAll>())) {
for (const auto& c : _cr.view<Contact::Components::TagBig>()) { for (const auto& c : _cr.view<Contact::Components::TagBig>()) {
// filter // filter
if (_cr.any_of<Contact::Components::RequestIncoming, Contact::Components::TagRequestOutgoing>(c)) { if (_cr.any_of<Contact::Components::RequestIncoming, Contact::Components::TagRequestOutgoing>(c)) {
@ -1195,17 +1202,6 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
} }
ImGui::EndMenu(); ImGui::EndMenu();
} }
} else {
ImGui::TextDisabled("forward");
}
ImGui::Separator();
if (ImGui::MenuItem("open")) {
const std::string url {file_path_to_file_url(local_info.file_path)};
std::cout << "opening file '" << url << "'\n";
SDL_OpenURL(url.c_str());
}
ImGui::Separator(); ImGui::Separator();