MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / PathChanged

Method PathChanged

plugins/scripting/utils/properties-view.cpp:1939–1969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1937}
1938
1939bool WidgetInfo::PathChanged(const char *setting)
1940{
1941 const char *desc = obs_property_description(property);
1942 obs_path_type type = obs_property_path_type(property);
1943 const char *filter = obs_property_path_filter(property);
1944 const char *default_path = obs_property_path_default_path(property);
1945 QString path;
1946
1947 if (type == OBS_PATH_DIRECTORY)
1948 path = SelectDirectory(view, QT_UTF8(desc),
1949 QT_UTF8(default_path));
1950 else if (type == OBS_PATH_FILE)
1951 path = OpenFile(view, QT_UTF8(desc), QT_UTF8(default_path),
1952 QT_UTF8(filter));
1953 else if (type == OBS_PATH_FILE_SAVE)
1954 path = SaveFile(view, QT_UTF8(desc), QT_UTF8(default_path),
1955 QT_UTF8(filter));
1956
1957#ifdef __APPLE__
1958 // TODO: Revisit when QTBUG-42661 is fixed
1959 widget->window()->raise();
1960#endif
1961
1962 if (path.isEmpty())
1963 return false;
1964
1965 QLineEdit *edit = static_cast<QLineEdit *>(widget);
1966 edit->setText(path);
1967 obs_data_set_string(view->settings, setting, QT_TO_UTF8(path));
1968 return true;
1969}
1970
1971void WidgetInfo::ListChanged(const char *setting)
1972{

Callers

nothing calls this directly

Calls 4

SelectDirectoryFunction · 0.85
OpenFileFunction · 0.85
SaveFileFunction · 0.85
setTextMethod · 0.80

Tested by

no test coverage detected