CcObjectStorage is a cache for GObjects. It is meant to store objects that are too expensive to be often created, such as NMClient, GoaClient or D-Bus proxies. CcObjectStorage has a very strict usage pattern. It is a programming error to add an object that is already stored, and so it is to retrieve an object that was not stored. Stored objects are meant to be kept alive during the whole lifetime of GNOME Settings, and CcObjectStorage takes a reference on every stored object to achieve that. If objects are destroyed while they are cached, it means we have a reference mismanagement somewhere. In this sense, CcObjectStorage will act Sam Sheepdog taking care of sneaky wolves trying to steal their sheep-references. Next patches will make various panels and objects around GNOME Settings adopt this new API, and make sure they always disconnect when destroyed.
138 lines
2.8 KiB
Meson
138 lines
2.8 KiB
Meson
subdir('appdata')
|
|
subdir('completions')
|
|
|
|
service_conf = configuration_data()
|
|
service_conf.set('bindir', control_center_bindir)
|
|
|
|
service = 'org.gnome.ControlCenter.service'
|
|
|
|
configure_file(
|
|
input: service + '.in',
|
|
output: service,
|
|
install: true,
|
|
install_dir: join_paths(control_center_datadir, 'dbus-1', 'services'),
|
|
configuration: service_conf
|
|
)
|
|
|
|
desktop = 'gnome-control-center.desktop'
|
|
|
|
desktop_in = configure_file(
|
|
input: desktop + '.in.in',
|
|
output: desktop + '.in',
|
|
configuration: desktop_conf
|
|
)
|
|
|
|
i18n.merge_file(
|
|
desktop,
|
|
type: 'desktop',
|
|
input: desktop_in,
|
|
output: desktop,
|
|
po_dir: po_dir,
|
|
install: true,
|
|
install_dir: control_center_desktopdir
|
|
)
|
|
|
|
cflags = ['-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir)]
|
|
|
|
libshell = static_library(
|
|
'shell',
|
|
sources: 'cc-shell-model.c',
|
|
include_directories: [top_inc, common_inc],
|
|
dependencies: common_deps,
|
|
c_args: cflags
|
|
)
|
|
|
|
common_sources = files(
|
|
'cc-application.c',
|
|
'cc-editable-entry.c',
|
|
'cc-hostname-entry.c',
|
|
'cc-object-storage.c',
|
|
'cc-panel-loader.c',
|
|
'cc-panel.c',
|
|
'cc-shell-category-view.c',
|
|
'cc-shell-item-view.c',
|
|
'cc-shell-log.c',
|
|
'cc-shell.c',
|
|
'hostname-helper.c',
|
|
'list-box-helper.c',
|
|
'main.c'
|
|
)
|
|
|
|
resource_data = files(
|
|
'help-overlay.ui',
|
|
'panel-list.ui',
|
|
'window.ui'
|
|
)
|
|
|
|
common_sources += gnome.compile_resources(
|
|
'resources',
|
|
meson.project_name() + '.gresource.xml',
|
|
dependencies: resource_data,
|
|
export: true
|
|
)
|
|
|
|
sources = common_sources + files(
|
|
'cc-panel-list.c',
|
|
'cc-window.c'
|
|
)
|
|
|
|
shell_deps = common_deps + [
|
|
libdevice_dep,
|
|
liblanguage_dep,
|
|
polkit_gobject_dep,
|
|
x11_dep
|
|
]
|
|
|
|
if enable_cheese
|
|
shell_deps += cheese_deps
|
|
endif
|
|
|
|
if host_is_linux_not_s390
|
|
shell_deps += wacom_deps
|
|
endif
|
|
|
|
executable(
|
|
meson.project_name(),
|
|
sources,
|
|
include_directories: top_inc,
|
|
dependencies: shell_deps,
|
|
c_args: cflags,
|
|
link_with: panels_libs + [libshell],
|
|
install: true
|
|
)
|
|
|
|
# Because it is confusing and somewhat problematic to directly add and compile
|
|
# cc-panel-loader.o by another directory (i.e. the shell search provider), we
|
|
# have to create a library and link it there, just like libshell.la.
|
|
libpanel_loader = static_library(
|
|
'panel_loader',
|
|
sources: 'cc-panel-loader.c',
|
|
include_directories: top_inc,
|
|
dependencies: common_deps,
|
|
c_args: cflags + ['-DCC_PANEL_LOADER_NO_GTYPES']
|
|
)
|
|
|
|
test_unit = 'test-hostname'
|
|
|
|
sources = files(
|
|
'hostname-helper.c',
|
|
test_unit + '.c'
|
|
)
|
|
|
|
cflags += [
|
|
'-DTEST_SRCDIR="@0@"'.format(meson.current_source_dir()),
|
|
'-DTEST_TOPSRCDIR="@0@"'.format(meson.source_root())
|
|
]
|
|
|
|
exe = executable(
|
|
test_unit,
|
|
sources,
|
|
include_directories: top_inc,
|
|
dependencies: common_deps,
|
|
c_args: cflags
|
|
)
|
|
|
|
test(test_unit, exe)
|
|
|
|
install_data ('org.gnome.ControlCenter.gschema.xml',
|
|
install_dir: control_center_schemadir)
|