Skip to content

Commit

Permalink
Remove "Improve this map" where HTML links cannot be shown
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaulat committed Mar 6, 2024
1 parent 8af4801 commit 54e85e9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scwx-qt/source/scwx/qt/map/map_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

#include <backends/imgui_impl_opengl3.h>
#include <backends/imgui_impl_qt.hpp>
#include <boost/algorithm/string/erase.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/asio/post.hpp>
#include <boost/asio/thread_pool.hpp>
#include <boost/uuid/random_generator.hpp>
Expand Down Expand Up @@ -263,8 +265,14 @@ void MapWidgetImpl::ConnectMapSignals()
{
QTextDocument document {};
document.setHtml(copyrightsHtml);
context_->set_map_copyrights(
document.toPlainText().toStdString());

// HTML cannot currently be included in ImGui windows. Where links
// can't be included, remove "Improve this map".
std::string copyrights {document.toPlainText().toStdString()};
boost::erase_all(copyrights, "Improve this map");
boost::trim_right(copyrights);

context_->set_map_copyrights(copyrights);
});
}

Expand Down

0 comments on commit 54e85e9

Please sign in to comment.