Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HYDRA-720 : Fix scene browser crash when adding same prim multiple times #28

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/adskHydraSceneBrowser/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ foreach(SOURCE IN ITEMS ${SOURCES})
# "QVariant(someVariable.str().data())" -> "QVariant(QLatin1StringView(someVariable.str().data()))"
string(REGEX REPLACE "QVariant\\(\(${IDENTIFIER_REGEX}\)\.str\\(\\)\.\(c_str|data\)\\(\\)\\)" "QVariant(QLatin1StringView(\\1.str().\\2()))" FILE_CONTENTS "${FILE_CONTENTS}")

# Some setExpanded() calls are wrapped inside a QTimer::singleShot() call in order to defer their execution.
# This was done by Pixar in order to work around a crash in what appears to be some of their proprietary code
# (a method named PhdRequest::ExtractOptionalValue). However, this workaround now causes a crash on our end.
# Since the original intent was to directly call setExpanded(), we replace the QTimer::singleShot() workaround
# with a direct call to setExpanded(). This string regex does the following replacement :
# QTimer::singleShot(0, [this]() {
# this->setExpanded(true); -> setExpanded(true);
# });
set(SET_EXPANDED_REGEX "QTimer::singleShot\\(0, \\[this\\]\\(\\) {[\r\n\t ]+this->setExpanded\\(true\\);[\r\n\t ]+}\\);")
set(SET_EXPANDED_REPLACEMENT "setExpanded\(true\);")
string(REGEX REPLACE "${SET_EXPANDED_REGEX}" "${SET_EXPANDED_REPLACEMENT}" FILE_CONTENTS "${FILE_CONTENTS}")

# Patch in '#include <QString>' to make sure we can use QLatin1StringView
prepend_include(FILE_CONTENTS "#include <QString>")

Expand Down