libobs: Fix source type versioning system
(This also modifies image-source, obs-text, text-freetype2, and UI) This improves source definition versioning. To do this, it now stores two identifier names. One "unversioned" which is the original name, and one "versioned" with the version number appended. This fixes both backward compatibility with older OBS versions, and fixes the inability to use "add existing" in OBS itself on sources created from older version definitions.
This commit is contained in:
parent
ef0f21b273
commit
b2302902a3
13 changed files with 122 additions and 20 deletions
|
|
@ -4719,6 +4719,7 @@ void OBSBasic::AddSource(const char *id)
|
|||
|
||||
QMenu *OBSBasic::CreateAddSourcePopupMenu()
|
||||
{
|
||||
const char *unversioned_type;
|
||||
const char *type;
|
||||
bool foundValues = false;
|
||||
bool foundDeprecated = false;
|
||||
|
|
@ -4759,7 +4760,7 @@ QMenu *OBSBasic::CreateAddSourcePopupMenu()
|
|||
popup->insertAction(after, popupItem);
|
||||
};
|
||||
|
||||
while (obs_enum_input_types(idx++, &type)) {
|
||||
while (obs_enum_input_types2(idx++, &type, &unversioned_type)) {
|
||||
const char *name = obs_source_get_display_name(type);
|
||||
uint32_t caps = obs_get_source_output_flags(type);
|
||||
|
||||
|
|
@ -4767,9 +4768,9 @@ QMenu *OBSBasic::CreateAddSourcePopupMenu()
|
|||
continue;
|
||||
|
||||
if ((caps & OBS_SOURCE_DEPRECATED) == 0) {
|
||||
addSource(popup, type, name);
|
||||
addSource(popup, unversioned_type, name);
|
||||
} else {
|
||||
addSource(deprecated, type, name);
|
||||
addSource(deprecated, unversioned_type, name);
|
||||
foundDeprecated = true;
|
||||
}
|
||||
foundValues = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue