0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00
obs-studio/UI/source-label.cpp
PatTheMav 710d99ef4d UI: Improve incremental compile times via explicit file includes
When a source file contains an explicit include with a filename
following the "moc_<actual-filename>.cpp" pattern, then CMake's
AUTOMOC generation tool will recognize the matching pair and generate
the replacement header file and add the required include directory
entries.

For all files which do contain Q_OBJECT or similar declarations but do
not have an explicit include directive, the global mocs_compilation.cpp
file will still be generated (which groups all "missing" generated
headers).

The larger this global file is, the more expensive incremental
compilation will be as this file (and all its contained generated
headers) will be re-generated regardless of whether actual changes
occurred.
2024-08-22 16:45:12 -04:00

45 lines
1.5 KiB
C++

/******************************************************************************
Copyright (C) 2015 by Ruwen Hahn <palana@stunned.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#include "moc_source-label.cpp"
void OBSSourceLabel::SourceRenamed(void *data, calldata_t *params)
{
auto &label = *static_cast<OBSSourceLabel *>(data);
const char *name = calldata_string(params, "new_name");
label.setText(name);
emit label.Renamed(name);
}
void OBSSourceLabel::SourceRemoved(void *data, calldata_t *)
{
auto &label = *static_cast<OBSSourceLabel *>(data);
emit label.Removed();
}
void OBSSourceLabel::SourceDestroyed(void *data, calldata_t *)
{
auto &label = *static_cast<OBSSourceLabel *>(data);
emit label.Destroyed();
label.destroyedSignal.Disconnect();
label.removedSignal.Disconnect();
label.renamedSignal.Disconnect();
}