Commit 41a13fcc authored by Nicolas Carion's avatar Nicolas Carion

fix rebase

parent 1eb7e839
......@@ -137,6 +137,17 @@ bool isIthParamARef(const rttr::method &method, size_t i)
QStringList args = sig.split(QStringLiteral(","));
return args[(int)i].contains("&") && !args[(int)i].contains("const &");
}
std::string quoted(const std::string &input)
{
#if __cpp_lib_quoted_string_io
std::stringstream ss;
ss << std::quoted(input);
return ss.str();
#else
// very incomplete implem
return "\"" + input + "\"";
#endif
}
} // namespace
void Logger::print_trace()
......@@ -164,9 +175,9 @@ void Logger::print_trace()
auto e = a.get_type().get_enumeration();
ss << e.get_name().to_string() << "::" << a.convert<std::string>();
} else if (a.can_convert<QString>()) {
ss << std::quoted(a.convert<QString>().toStdString());
ss << quoted(a.convert<QString>().toStdString());
} else if (a.can_convert<std::string>()) {
ss << std::quoted(a.convert<std::string>());
ss << quoted(a.convert<std::string>());
} else if (a.can_convert<std::unordered_set<int>>()) {
auto set = a.convert<std::unordered_set<int>>();
ss << "{";
......
......@@ -2039,14 +2039,16 @@ int TimelineModel::suggestSnapPoint(int pos, int snapDistance)
return (qAbs(snapped - pos) < snapDistance ? snapped : pos);
}
int TimelineModel::requestBestSnapPos(int pos, int length, const std::vector<int> &pts, int snapDistance)
int TimelineModel::requestBestSnapPos(int pos, int length, const std::vector<int> &pts, int cursorPosition, int snapDistance)
{
if (!pts.empty()) {
m_snaps->ignore(pts);
}
m_snaps->addPoint(cursorPosition);
int snapped_start = m_snaps->getClosestPoint(pos);
int snapped_end = m_snaps->getClosestPoint(pos + length);
m_snaps->unIgnore();
m_snaps->removePoint(cursorPosition);
int startDiff = qAbs(pos - snapped_start);
int endDiff = qAbs(pos + length - snapped_end);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment