aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRechi <Rechi@users.noreply.github.com>2020-10-30 18:53:28 +0000
committerRechi <Rechi@users.noreply.github.com>2020-10-30 18:53:28 +0000
commitba15b9fcc30f5921cd469a5cf2662fa5eb3b08bc (patch)
tree84389d3e6ef6138c90232fdca890f7253f292fea
parentd3036986ce5263a1ddf45df8a68a40396292d59d (diff)
[clang-tidy] performance-unnecessary-value-param
-rw-r--r--tools/depends/native/TexturePacker/src/TexturePacker.cpp6
-rw-r--r--xbmc/Application.cpp8
-rw-r--r--xbmc/Application.h8
-rw-r--r--xbmc/ApplicationStackHelper.cpp7
-rw-r--r--xbmc/ApplicationStackHelper.h2
-rw-r--r--xbmc/Autorun.cpp5
-rw-r--r--xbmc/Autorun.h5
-rw-r--r--xbmc/GUIPassword.cpp2
-rw-r--r--xbmc/GUIPassword.h2
-rw-r--r--xbmc/LangInfo.cpp63
-rw-r--r--xbmc/LangInfo.h65
-rw-r--r--xbmc/NfoFile.cpp3
-rw-r--r--xbmc/NfoFile.h5
-rw-r--r--xbmc/PlayListPlayer.cpp7
-rw-r--r--xbmc/PlayListPlayer.h7
-rw-r--r--xbmc/SeekHandler.cpp7
-rw-r--r--xbmc/SeekHandler.h7
-rw-r--r--xbmc/ServiceBroker.cpp8
-rw-r--r--xbmc/Util.cpp2
-rw-r--r--xbmc/Util.h3
-rw-r--r--xbmc/addons/AddonDatabase.h6
-rw-r--r--xbmc/addons/AddonStatusHandler.cpp4
-rw-r--r--xbmc/addons/AddonSystemSettings.cpp4
-rw-r--r--xbmc/addons/AddonSystemSettings.h4
-rw-r--r--xbmc/addons/RepositoryUpdater.cpp2
-rw-r--r--xbmc/addons/RepositoryUpdater.h2
-rw-r--r--xbmc/addons/Service.cpp2
-rw-r--r--xbmc/addons/Service.h2
-rw-r--r--xbmc/addons/Skin.cpp20
-rw-r--r--xbmc/addons/Skin.h20
-rw-r--r--xbmc/addons/VFSEntry.cpp9
-rw-r--r--xbmc/addons/VFSEntry.h7
-rw-r--r--xbmc/addons/addoninfo/AddonInfo.h14
-rw-r--r--xbmc/addons/addoninfo/AddonInfoBuilder.cpp4
-rw-r--r--xbmc/addons/addoninfo/AddonInfoBuilder.h15
-rw-r--r--xbmc/addons/binary-addons/AddonDll.cpp4
-rw-r--r--xbmc/addons/gui/GUIDialogAddonSettings.cpp4
-rw-r--r--xbmc/addons/gui/GUIDialogAddonSettings.h4
-rw-r--r--xbmc/addons/kodi-dev-kit/include/kodi/gui/Window.h6
-rw-r--r--xbmc/addons/settings/AddonSettings.cpp62
-rw-r--r--xbmc/addons/settings/AddonSettings.h25
-rw-r--r--xbmc/addons/test/TestAddonDatabase.cpp5
-rw-r--r--xbmc/cdrip/Encoder.cpp3
-rw-r--r--xbmc/cores/AudioEngine/AESinkFactory.cpp6
-rw-r--r--xbmc/cores/AudioEngine/AESinkFactory.h4
-rw-r--r--xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp2
-rw-r--r--xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h25
-rw-r--r--xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.cpp47
-rw-r--r--xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.h43
-rw-r--r--xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp2
-rw-r--r--xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h10
-rw-r--r--xbmc/cores/AudioEngine/Interfaces/AE.h2
-rw-r--r--xbmc/cores/DataCacheCore.cpp14
-rw-r--r--xbmc/cores/VideoPlayer/Buffers/VideoBuffer.cpp7
-rw-r--r--xbmc/cores/VideoPlayer/Buffers/VideoBuffer.h4
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp17
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h17
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp11
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h4
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h7
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h13
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.h2
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.h2
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h2
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.cpp3
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.h3
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMultiSource.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMultiSource.h6
-rw-r--r--xbmc/cores/VideoPlayer/DVDFileInfo.cpp10
-rw-r--r--xbmc/cores/VideoPlayer/DVDFileInfo.h10
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h2
-rw-r--r--xbmc/cores/VideoPlayer/DVDOverlayContainer.cpp3
-rw-r--r--xbmc/cores/VideoPlayer/DVDOverlayContainer.h5
-rw-r--r--xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/Process/ProcessInfo.h2
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayer.cpp8
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayer.h8
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.h2
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayerSubtitle.h5
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp6
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.h5
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.cpp9
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.h9
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp5
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/RenderFactory.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/RenderFactory.h4
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.cpp19
-rw-r--r--xbmc/cores/playercorefactory/PlayerCoreConfig.h21
-rw-r--r--xbmc/dialogs/GUIDialogBoxBase.cpp6
-rw-r--r--xbmc/dialogs/GUIDialogBoxBase.h6
-rw-r--r--xbmc/dialogs/GUIDialogMediaFilter.cpp7
-rw-r--r--xbmc/dialogs/GUIDialogMediaFilter.h7
-rw-r--r--xbmc/dialogs/GUIDialogOK.cpp7
-rw-r--r--xbmc/dialogs/GUIDialogOK.h7
-rw-r--r--xbmc/dialogs/GUIDialogPlayEject.cpp4
-rw-r--r--xbmc/dialogs/GUIDialogPlayEject.h4
-rw-r--r--xbmc/dialogs/GUIDialogSelect.cpp2
-rw-r--r--xbmc/dialogs/GUIDialogSelect.h2
-rw-r--r--xbmc/dialogs/GUIDialogYesNo.cpp38
-rw-r--r--xbmc/dialogs/GUIDialogYesNo.h38
-rw-r--r--xbmc/events/AddonEvent.cpp43
-rw-r--r--xbmc/events/AddonEvent.h22
-rw-r--r--xbmc/events/AddonManagementEvent.cpp27
-rw-r--r--xbmc/events/AddonManagementEvent.h26
-rw-r--r--xbmc/events/windows/GUIWindowEventLog.cpp10
-rw-r--r--xbmc/events/windows/GUIWindowEventLog.h10
-rw-r--r--xbmc/filesystem/AddonsDirectory.cpp2
-rw-r--r--xbmc/filesystem/AddonsDirectory.h5
-rw-r--r--xbmc/filesystem/CurlFile.h2
-rw-r--r--xbmc/filesystem/Directory.cpp13
-rw-r--r--xbmc/filesystem/Directory.h12
-rw-r--r--xbmc/filesystem/FTPParse.cpp4
-rw-r--r--xbmc/filesystem/FTPParse.h4
-rw-r--r--xbmc/filesystem/NFSFile.cpp4
-rw-r--r--xbmc/filesystem/NFSFile.h4
-rw-r--r--xbmc/filesystem/NptXbmcFile.cpp3
-rw-r--r--xbmc/filesystem/RSSDirectory.cpp2
-rw-r--r--xbmc/filesystem/UDFBlockInput.cpp2
-rw-r--r--xbmc/filesystem/UDFBlockInput.h2
-rw-r--r--xbmc/games/GameSettings.cpp2
-rw-r--r--xbmc/games/GameSettings.h2
-rw-r--r--xbmc/games/controllers/ControllerManager.cpp6
-rw-r--r--xbmc/games/controllers/ControllerManager.h2
-rw-r--r--xbmc/guilib/GUIAudioManager.cpp6
-rw-r--r--xbmc/guilib/GUIAudioManager.h6
-rw-r--r--xbmc/guilib/GUIBaseContainer.cpp4
-rw-r--r--xbmc/guilib/GUIBaseContainer.h2
-rw-r--r--xbmc/guilib/GUIComponent.cpp2
-rw-r--r--xbmc/guilib/GUIComponent.h2
-rw-r--r--xbmc/guilib/GUIEditControl.cpp2
-rw-r--r--xbmc/guilib/GUIEditControl.h2
-rw-r--r--xbmc/guilib/GUIFontManager.cpp5
-rw-r--r--xbmc/guilib/GUIFontManager.h5
-rw-r--r--xbmc/guilib/GUIKeyboardFactory.cpp16
-rw-r--r--xbmc/guilib/GUIKeyboardFactory.h16
-rw-r--r--xbmc/guilib/StereoscopicsManager.cpp2
-rw-r--r--xbmc/guilib/StereoscopicsManager.h2
-rw-r--r--xbmc/guilib/VisibleEffect.cpp4
-rw-r--r--xbmc/input/ButtonTranslator.cpp2
-rw-r--r--xbmc/input/ButtonTranslator.h2
-rw-r--r--xbmc/input/InputManager.cpp2
-rw-r--r--xbmc/input/InputManager.h2
-rw-r--r--xbmc/input/KeyboardLayoutManager.cpp2
-rw-r--r--xbmc/input/KeyboardLayoutManager.h2
-rw-r--r--xbmc/input/button/ButtonStat.cpp2
-rw-r--r--xbmc/input/button/ButtonStat.h2
-rw-r--r--xbmc/interfaces/AnnouncementManager.cpp2
-rw-r--r--xbmc/interfaces/AnnouncementManager.h2
-rw-r--r--xbmc/interfaces/generic/LanguageInvokerThread.cpp4
-rw-r--r--xbmc/interfaces/generic/ScriptInvocationManager.cpp4
-rw-r--r--xbmc/interfaces/generic/ScriptInvocationManager.h4
-rw-r--r--xbmc/interfaces/info/InfoExpression.cpp2
-rw-r--r--xbmc/interfaces/info/InfoExpression.h5
-rw-r--r--xbmc/interfaces/json-rpc/AddonsOperations.cpp6
-rw-r--r--xbmc/interfaces/json-rpc/AddonsOperations.h2
-rw-r--r--xbmc/interfaces/json-rpc/AudioLibrary.cpp2
-rw-r--r--xbmc/interfaces/json-rpc/AudioLibrary.h2
-rw-r--r--xbmc/interfaces/json-rpc/FileItemHandler.cpp20
-rw-r--r--xbmc/interfaces/json-rpc/FileItemHandler.h20
-rw-r--r--xbmc/interfaces/json-rpc/FileOperations.cpp6
-rw-r--r--xbmc/interfaces/json-rpc/FileOperations.h6
-rw-r--r--xbmc/interfaces/json-rpc/JSONRPCUtils.h2
-rw-r--r--xbmc/interfaces/json-rpc/JSONServiceDescription.cpp19
-rw-r--r--xbmc/interfaces/json-rpc/JSONServiceDescription.h16
-rw-r--r--xbmc/interfaces/json-rpc/JSONUtils.h41
-rw-r--r--xbmc/interfaces/json-rpc/SettingsOperations.cpp48
-rw-r--r--xbmc/interfaces/json-rpc/SettingsOperations.h46
-rw-r--r--xbmc/interfaces/legacy/Control.cpp3
-rw-r--r--xbmc/interfaces/legacy/Control.h2
-rw-r--r--xbmc/interfaces/legacy/DrmCryptoSession.cpp12
-rw-r--r--xbmc/interfaces/legacy/DrmCryptoSession.h5
-rw-r--r--xbmc/interfaces/legacy/ListItem.cpp17
-rw-r--r--xbmc/interfaces/legacy/ListItem.h16
-rw-r--r--xbmc/interfaces/legacy/Monitor.h40
-rw-r--r--xbmc/interfaces/python/PythonSwig.cpp.template1
-rw-r--r--xbmc/messaging/ApplicationMessenger.cpp15
-rw-r--r--xbmc/messaging/ThreadMessage.h22
-rw-r--r--xbmc/messaging/helpers/DialogHelper.cpp3
-rw-r--r--xbmc/music/Artist.h25
-rw-r--r--xbmc/music/ContextMenus.cpp5
-rw-r--r--xbmc/music/MusicDatabase.cpp11
-rw-r--r--xbmc/music/MusicDatabase.h6
-rw-r--r--xbmc/music/MusicUtils.cpp17
-rw-r--r--xbmc/music/MusicUtils.h6
-rw-r--r--xbmc/music/dialogs/GUIDialogInfoProviderSettings.cpp5
-rw-r--r--xbmc/music/dialogs/GUIDialogInfoProviderSettings.h9
-rw-r--r--xbmc/music/tags/MusicInfoTag.cpp2
-rw-r--r--xbmc/music/tags/MusicInfoTag.h2
-rw-r--r--xbmc/music/windows/GUIWindowMusicBase.cpp2
-rw-r--r--xbmc/music/windows/GUIWindowMusicBase.h2
-rw-r--r--xbmc/music/windows/GUIWindowMusicNav.cpp2
-rw-r--r--xbmc/music/windows/GUIWindowMusicNav.h2
-rw-r--r--xbmc/network/EventClient.h6
-rw-r--r--xbmc/network/GUIDialogNetworkSetup.cpp4
-rw-r--r--xbmc/network/GUIDialogNetworkSetup.h4
-rw-r--r--xbmc/network/NetworkServices.cpp8
-rw-r--r--xbmc/network/NetworkServices.h8
-rw-r--r--xbmc/network/WakeOnAccess.cpp2
-rw-r--r--xbmc/network/WakeOnAccess.h2
-rw-r--r--xbmc/network/WebServer.cpp2
-rw-r--r--xbmc/network/Zeroconf.cpp20
-rw-r--r--xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.cpp3
-rw-r--r--xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.h3
-rw-r--r--xbmc/network/upnp/UPnPServer.cpp17
-rw-r--r--xbmc/network/upnp/UPnPServer.h29
-rw-r--r--xbmc/peripherals/Peripherals.cpp4
-rw-r--r--xbmc/peripherals/Peripherals.h4
-rw-r--r--xbmc/peripherals/devices/Peripheral.cpp2
-rw-r--r--xbmc/peripherals/devices/Peripheral.h2
-rw-r--r--xbmc/peripherals/devices/PeripheralImon.cpp2
-rw-r--r--xbmc/peripherals/devices/PeripheralImon.h2
-rw-r--r--xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.cpp2
-rw-r--r--xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.h2
-rw-r--r--xbmc/pictures/GUIWindowSlideShow.cpp2
-rw-r--r--xbmc/pictures/GUIWindowSlideShow.h2
-rw-r--r--xbmc/platform/Filesystem.h2
-rw-r--r--xbmc/platform/android/activity/JNIXBMCMediaSession.cpp2
-rw-r--r--xbmc/platform/android/activity/JNIXBMCMediaSession.h2
-rw-r--r--xbmc/platform/android/network/NetworkAndroid.cpp8
-rw-r--r--xbmc/platform/android/network/NetworkAndroid.h4
-rw-r--r--xbmc/platform/darwin/ios-common/network/NetworkIOS.mm3
-rw-r--r--xbmc/platform/darwin/ios-common/peripherals/PeripheralBusDarwinEmbedded.h6
-rw-r--r--xbmc/platform/darwin/ios-common/peripherals/PeripheralBusDarwinEmbedded.mm6
-rw-r--r--xbmc/platform/darwin/ios/XBMCController.mm2
-rw-r--r--xbmc/platform/darwin/osx/XBMCHelper.cpp2
-rw-r--r--xbmc/platform/darwin/osx/XBMCHelper.h2
-rw-r--r--xbmc/platform/darwin/tvos/TVOSSettingsHandler.h2
-rw-r--r--xbmc/platform/darwin/tvos/TVOSSettingsHandler.mm2
-rw-r--r--xbmc/platform/darwin/tvos/TVOSTopShelf.mm13
-rw-r--r--xbmc/platform/linux/input/LibInputSettings.cpp8
-rw-r--r--xbmc/platform/linux/input/LibInputSettings.h7
-rw-r--r--xbmc/platform/linux/network/NetworkLinux.cpp3
-rw-r--r--xbmc/platform/linux/network/zeroconf/ZeroconfAvahi.cpp3
-rw-r--r--xbmc/platform/linux/network/zeroconf/ZeroconfAvahi.h2
-rw-r--r--xbmc/platform/linux/storage/UDisks2Provider.cpp6
-rw-r--r--xbmc/platform/posix/Filesystem.cpp2
-rw-r--r--xbmc/platform/posix/PosixTimezone.cpp15
-rw-r--r--xbmc/platform/posix/PosixTimezone.h14
-rw-r--r--xbmc/platform/posix/filesystem/PosixDirectory.cpp2
-rw-r--r--xbmc/platform/posix/filesystem/PosixDirectory.h2
-rw-r--r--xbmc/platform/posix/network/NetworkPosix.cpp4
-rw-r--r--xbmc/platform/win32/Filesystem.cpp2
-rw-r--r--xbmc/powermanagement/PowerManager.cpp5
-rw-r--r--xbmc/powermanagement/PowerManager.h5
-rw-r--r--xbmc/profiles/ProfileManager.cpp2
-rw-r--r--xbmc/profiles/ProfileManager.h2
-rw-r--r--xbmc/profiles/dialogs/GUIDialogLockSettings.cpp4
-rw-r--r--xbmc/profiles/dialogs/GUIDialogLockSettings.h4
-rw-r--r--xbmc/profiles/dialogs/GUIDialogProfileSettings.cpp4
-rw-r--r--xbmc/profiles/dialogs/GUIDialogProfileSettings.h4
-rw-r--r--xbmc/pvr/PVRManager.cpp6
-rw-r--r--xbmc/pvr/PVRManager.h6
-rw-r--r--xbmc/pvr/PVRPlaybackState.cpp6
-rw-r--r--xbmc/pvr/PVRPlaybackState.h6
-rw-r--r--xbmc/pvr/addons/PVRClient.cpp4
-rw-r--r--xbmc/pvr/addons/PVRClient.h2
-rw-r--r--xbmc/pvr/addons/PVRClientMenuHooks.cpp3
-rw-r--r--xbmc/pvr/addons/PVRClientMenuHooks.h3
-rw-r--r--xbmc/pvr/addons/PVRClients.cpp7
-rw-r--r--xbmc/pvr/addons/PVRClients.h7
-rw-r--r--xbmc/pvr/channels/PVRChannelGroup.cpp2
-rw-r--r--xbmc/pvr/channels/PVRChannelGroup.h20
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRClientPriorities.cpp5
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRClientPriorities.h4
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.cpp12
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.h9
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp108
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.h124
-rw-r--r--xbmc/pvr/guilib/PVRGUIActionListener.cpp4
-rw-r--r--xbmc/pvr/guilib/PVRGUIActionListener.h4
-rw-r--r--xbmc/pvr/guilib/PVRGUIChannelNavigator.cpp5
-rw-r--r--xbmc/pvr/guilib/PVRGUIChannelNavigator.h4
-rw-r--r--xbmc/pvr/settings/PVRSettings.cpp18
-rw-r--r--xbmc/pvr/settings/PVRSettings.h18
-rw-r--r--xbmc/rendering/gl/GLShader.cpp4
-rw-r--r--xbmc/rendering/gl/GLShader.h4
-rw-r--r--xbmc/rendering/gles/GLESShader.cpp4
-rw-r--r--xbmc/rendering/gles/GLESShader.h4
-rw-r--r--xbmc/settings/AdvancedSettings.cpp2
-rw-r--r--xbmc/settings/AdvancedSettings.h2
-rw-r--r--xbmc/settings/DiscSettings.cpp2
-rw-r--r--xbmc/settings/DiscSettings.h2
-rw-r--r--xbmc/settings/DisplaySettings.cpp75
-rw-r--r--xbmc/settings/DisplaySettings.h74
-rw-r--r--xbmc/settings/MediaSettings.cpp4
-rw-r--r--xbmc/settings/MediaSettings.h4
-rw-r--r--xbmc/settings/SettingConditions.cpp144
-rw-r--r--xbmc/settings/SettingConditions.h4
-rw-r--r--xbmc/settings/SettingControl.h10
-rw-r--r--xbmc/settings/SettingUtils.cpp16
-rw-r--r--xbmc/settings/SettingUtils.h14
-rw-r--r--xbmc/settings/SettingsValueFlatJsonSerializer.cpp10
-rw-r--r--xbmc/settings/SettingsValueFlatJsonSerializer.h10
-rw-r--r--xbmc/settings/SettingsValueXmlSerializer.cpp12
-rw-r--r--xbmc/settings/SettingsValueXmlSerializer.h9
-rw-r--r--xbmc/settings/dialogs/GUIDialogContentSettings.cpp4
-rw-r--r--xbmc/settings/dialogs/GUIDialogContentSettings.h7
-rw-r--r--xbmc/settings/dialogs/GUIDialogLibExportSettings.cpp6
-rw-r--r--xbmc/settings/dialogs/GUIDialogLibExportSettings.h6
-rw-r--r--xbmc/settings/dialogs/GUIDialogSettingsBase.cpp16
-rw-r--r--xbmc/settings/dialogs/GUIDialogSettingsBase.h19
-rw-r--r--xbmc/settings/dialogs/GUIDialogSettingsManualBase.cpp723
-rw-r--r--xbmc/settings/dialogs/GUIDialogSettingsManualBase.h649
-rw-r--r--xbmc/settings/lib/ISettingCallback.h18
-rw-r--r--xbmc/settings/lib/Setting.cpp18
-rw-r--r--xbmc/settings/lib/Setting.h18
-rw-r--r--xbmc/settings/lib/SettingConditions.cpp5
-rw-r--r--xbmc/settings/lib/SettingConditions.h10
-rw-r--r--xbmc/settings/lib/SettingDefinitions.h10
-rw-r--r--xbmc/settings/lib/SettingDependency.cpp6
-rw-r--r--xbmc/settings/lib/SettingDependency.h5
-rw-r--r--xbmc/settings/lib/SettingSection.cpp9
-rw-r--r--xbmc/settings/lib/SettingSection.h12
-rw-r--r--xbmc/settings/lib/SettingsManager.cpp37
-rw-r--r--xbmc/settings/lib/SettingsManager.h37
-rw-r--r--xbmc/settings/windows/GUIControlSettings.cpp36
-rw-r--r--xbmc/settings/windows/GUIControlSettings.h12
-rw-r--r--xbmc/storage/cdioSupport.h9
-rw-r--r--xbmc/utils/ActorProtocol.h10
-rw-r--r--xbmc/utils/BufferObjectFactory.cpp2
-rw-r--r--xbmc/utils/BufferObjectFactory.h2
-rw-r--r--xbmc/utils/CharsetConverter.cpp7
-rw-r--r--xbmc/utils/CharsetConverter.h8
-rw-r--r--xbmc/utils/CharsetDetection.cpp3
-rw-r--r--xbmc/utils/CharsetDetection.h2
-rw-r--r--xbmc/utils/JSONVariantParser.cpp4
-rw-r--r--xbmc/utils/RssManager.cpp2
-rw-r--r--xbmc/utils/RssManager.h2
-rw-r--r--xbmc/utils/ScraperUrl.cpp20
-rw-r--r--xbmc/utils/ScraperUrl.h16
-rw-r--r--xbmc/utils/Screenshot.cpp2
-rw-r--r--xbmc/utils/Screenshot.h2
-rw-r--r--xbmc/utils/StringUtils.cpp2
-rw-r--r--xbmc/utils/StringUtils.h2
-rw-r--r--xbmc/utils/TimeUtils.cpp2
-rw-r--r--xbmc/utils/TimeUtils.h3
-rw-r--r--xbmc/utils/log.cpp6
-rw-r--r--xbmc/utils/log.h4
-rw-r--r--xbmc/video/ContextMenus.cpp6
-rw-r--r--xbmc/video/VideoDatabase.cpp6
-rw-r--r--xbmc/video/VideoDatabase.h6
-rw-r--r--xbmc/video/VideoInfoTag.cpp4
-rw-r--r--xbmc/video/VideoInfoTag.h4
-rw-r--r--xbmc/video/VideoLibraryQueue.cpp7
-rw-r--r--xbmc/video/VideoLibraryQueue.h2
-rw-r--r--xbmc/video/VideoThumbLoader.cpp2
-rw-r--r--xbmc/video/ViewModeSettings.cpp5
-rw-r--r--xbmc/video/ViewModeSettings.h6
-rw-r--r--xbmc/video/dialogs/GUIDialogAudioSettings.cpp31
-rw-r--r--xbmc/video/dialogs/GUIDialogAudioSettings.h36
-rw-r--r--xbmc/video/dialogs/GUIDialogCMSSettings.cpp11
-rw-r--r--xbmc/video/dialogs/GUIDialogCMSSettings.h11
-rw-r--r--xbmc/video/dialogs/GUIDialogSubtitleSettings.cpp20
-rw-r--r--xbmc/video/dialogs/GUIDialogSubtitleSettings.h21
-rw-r--r--xbmc/video/dialogs/GUIDialogVideoSettings.cpp18
-rw-r--r--xbmc/video/dialogs/GUIDialogVideoSettings.h20
-rw-r--r--xbmc/video/jobs/VideoLibraryRefreshingJob.cpp10
-rw-r--r--xbmc/video/jobs/VideoLibraryResetResumePointJob.cpp2
-rw-r--r--xbmc/video/jobs/VideoLibraryResetResumePointJob.h2
-rw-r--r--xbmc/video/tags/IVideoInfoTagLoader.h8
-rw-r--r--xbmc/video/tags/VideoInfoTagLoaderFactory.cpp2
-rw-r--r--xbmc/video/tags/VideoInfoTagLoaderFactory.h2
-rw-r--r--xbmc/video/tags/VideoTagLoaderNFO.cpp4
-rw-r--r--xbmc/video/windows/GUIWindowVideoBase.cpp6
-rw-r--r--xbmc/video/windows/GUIWindowVideoBase.h6
-rw-r--r--xbmc/video/windows/GUIWindowVideoNav.cpp2
-rw-r--r--xbmc/video/windows/GUIWindowVideoNav.h2
-rw-r--r--xbmc/view/GUIViewState.cpp2
-rw-r--r--xbmc/view/GUIViewState.h2
-rw-r--r--xbmc/weather/WeatherManager.cpp4
-rw-r--r--xbmc/weather/WeatherManager.h4
-rw-r--r--xbmc/windowing/WindowSystemFactory.cpp2
-rw-r--r--xbmc/windowing/WindowSystemFactory.h5
-rw-r--r--xbmc/windowing/X11/WinSystemX11.cpp2
-rw-r--r--xbmc/windowing/X11/WinSystemX11.h2
-rw-r--r--xbmc/windowing/X11/XRandR.cpp2
-rw-r--r--xbmc/windowing/X11/XRandR.h2
-rw-r--r--xbmc/windowing/android/AndroidUtils.cpp2
-rw-r--r--xbmc/windowing/android/AndroidUtils.h2
-rw-r--r--xbmc/windowing/gbm/WinSystemGbm.h7
-rw-r--r--xbmc/windowing/gbm/drm/DRMObject.cpp2
-rw-r--r--xbmc/windowing/gbm/drm/DRMObject.h2
-rw-r--r--xbmc/windowing/osx/WinSystemOSX.mm2
-rw-r--r--xbmc/windowing/wayland/InputProcessorKeyboard.cpp9
-rw-r--r--xbmc/windowing/wayland/InputProcessorKeyboard.h9
-rw-r--r--xbmc/windowing/wayland/InputProcessorPointer.cpp10
-rw-r--r--xbmc/windowing/wayland/InputProcessorPointer.h10
-rw-r--r--xbmc/windowing/wayland/InputProcessorTouch.cpp8
-rw-r--r--xbmc/windowing/wayland/InputProcessorTouch.h8
-rw-r--r--xbmc/windowing/wayland/Output.cpp17
-rw-r--r--xbmc/windowing/wayland/Registry.cpp4
-rw-r--r--xbmc/windowing/wayland/Registry.h18
-rw-r--r--xbmc/windowing/wayland/Seat.cpp31
-rw-r--r--xbmc/windowing/wayland/Seat.h35
-rw-r--r--xbmc/windowing/wayland/SeatSelection.cpp6
-rw-r--r--xbmc/windowing/wayland/ShellSurfaceWlShell.cpp12
-rw-r--r--xbmc/windowing/wayland/ShellSurfaceWlShell.h6
-rw-r--r--xbmc/windowing/wayland/ShellSurfaceXdgShell.cpp4
-rw-r--r--xbmc/windowing/wayland/ShellSurfaceXdgShellUnstableV6.cpp19
-rw-r--r--xbmc/windowing/wayland/WinSystemWayland.cpp21
-rw-r--r--xbmc/windowing/wayland/WinSystemWayland.h2
-rw-r--r--xbmc/windowing/wayland/WindowDecorator.cpp22
-rw-r--r--xbmc/windowing/wayland/WindowDecorator.h18
-rw-r--r--xbmc/windows/GUIMediaWindow.cpp2
-rw-r--r--xbmc/windows/GUIMediaWindow.h2
410 files changed, 3694 insertions, 1521 deletions
diff --git a/tools/depends/native/TexturePacker/src/TexturePacker.cpp b/tools/depends/native/TexturePacker/src/TexturePacker.cpp
index 5e9a5bd932..94c421acb7 100644
--- a/tools/depends/native/TexturePacker/src/TexturePacker.cpp
+++ b/tools/depends/native/TexturePacker/src/TexturePacker.cpp
@@ -72,7 +72,9 @@ const char *GetFormatString(unsigned int format)
}
}
-void CreateSkeletonHeaderImpl(CXBTFWriter& xbtfWriter, std::string fullPath, std::string relativePath)
+void CreateSkeletonHeaderImpl(CXBTFWriter& xbtfWriter,
+ const std::string& fullPath,
+ const std::string& relativePath)
{
struct dirent* dp;
struct stat stat_p;
@@ -129,7 +131,7 @@ void CreateSkeletonHeaderImpl(CXBTFWriter& xbtfWriter, std::string fullPath, std
}
}
-void CreateSkeletonHeader(CXBTFWriter& xbtfWriter, std::string fullPath)
+void CreateSkeletonHeader(CXBTFWriter& xbtfWriter, const std::string& fullPath)
{
std::string temp;
CreateSkeletonHeaderImpl(xbtfWriter, fullPath, temp);
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index d6399014b1..f14d1c3627 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -955,7 +955,7 @@ void CApplication::StopServices()
#endif
}
-void CApplication::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CApplication::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -1053,7 +1053,7 @@ void CApplication::OnSettingChanged(std::shared_ptr<const CSetting> setting)
m_replayGainSettings.bAvoidClipping = std::static_pointer_cast<const CSettingBool>(setting)->GetValue();
}
-void CApplication::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CApplication::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -1091,7 +1091,9 @@ void CApplication::OnSettingAction(std::shared_ptr<const CSetting> setting)
CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(WINDOW_PICTURES);
}
-bool CApplication::OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *oldSettingId, const TiXmlNode *oldSettingNode)
+bool CApplication::OnSettingUpdate(const std::shared_ptr<CSetting>& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode)
{
if (setting == NULL)
return false;
diff --git a/xbmc/Application.h b/xbmc/Application.h
index 4c069cc588..050f11afc0 100644
--- a/xbmc/Application.h
+++ b/xbmc/Application.h
@@ -360,9 +360,11 @@ protected:
bool OnSettingsSaving() const override;
bool Load(const TiXmlNode *settings) override;
bool Save(TiXmlNode *settings) const override;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
- bool OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
+ bool OnSettingUpdate(const std::shared_ptr<CSetting>& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode) override;
bool LoadSkin(const std::string& skinID);
diff --git a/xbmc/ApplicationStackHelper.cpp b/xbmc/ApplicationStackHelper.cpp
index 5ac45e937e..cdb69648c4 100644
--- a/xbmc/ApplicationStackHelper.cpp
+++ b/xbmc/ApplicationStackHelper.cpp
@@ -17,6 +17,8 @@
#include "utils/log.h"
#include "video/VideoDatabase.h"
+#include <utility>
+
using namespace XFILE;
CApplicationStackHelper::CApplicationStackHelper(void)
@@ -237,7 +239,7 @@ bool CApplicationStackHelper::HasRegisteredStack(const CFileItem & item)
void CApplicationStackHelper::SetRegisteredStack(const CFileItem& item, CFileItemPtr stackItem)
{
- GetStackPartInformation(item.GetPath())->m_pStack = stackItem;
+ GetStackPartInformation(item.GetPath())->m_pStack = std::move(stackItem);
}
int CApplicationStackHelper::GetRegisteredStackPartNumber(const CFileItem& item)
@@ -270,7 +272,8 @@ void CApplicationStackHelper::SetRegisteredStackTotalTimeMs(const CFileItem& ite
GetStackPartInformation(item.GetPath())->m_lStackTotalTimeMs = totalTime;
}
-CApplicationStackHelper::StackPartInformationPtr CApplicationStackHelper::GetStackPartInformation(std::string key)
+CApplicationStackHelper::StackPartInformationPtr CApplicationStackHelper::GetStackPartInformation(
+ const std::string& key)
{
if (m_stackmap.count(key) == 0)
{
diff --git a/xbmc/ApplicationStackHelper.h b/xbmc/ApplicationStackHelper.h
index 6f17465b52..edc9f97f61 100644
--- a/xbmc/ApplicationStackHelper.h
+++ b/xbmc/ApplicationStackHelper.h
@@ -189,7 +189,7 @@ protected:
typedef std::shared_ptr<StackPartInformation> StackPartInformationPtr;
typedef std::map<std::string, StackPartInformationPtr> Stackmap;
Stackmap m_stackmap;
- StackPartInformationPtr GetStackPartInformation(std::string key);
+ StackPartInformationPtr GetStackPartInformation(const std::string& key);
std::unique_ptr<CFileItemList> m_currentStack;
int m_currentStackPosition = 0;
diff --git a/xbmc/Autorun.cpp b/xbmc/Autorun.cpp
index da081ac75d..b5745adde2 100644
--- a/xbmc/Autorun.cpp
+++ b/xbmc/Autorun.cpp
@@ -521,7 +521,10 @@ bool CAutorun::CanResumePlayDVD(const std::string& path)
return false;
}
-void CAutorun::SettingOptionAudioCdActionsFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CAutorun::SettingOptionAudioCdActionsFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
list.emplace_back(g_localizeStrings.Get(16018), AUTOCD_NONE);
list.emplace_back(g_localizeStrings.Get(14098), AUTOCD_PLAY);
diff --git a/xbmc/Autorun.h b/xbmc/Autorun.h
index a263f5c8a5..396410ab5e 100644
--- a/xbmc/Autorun.h
+++ b/xbmc/Autorun.h
@@ -55,7 +55,10 @@ public:
void HandleAutorun();
static void ExecuteAutorun(const std::string& path = "", bool bypassSettings = false, bool ignoreplaying = true, bool startFromBeginning = false);
- static void SettingOptionAudioCdActionsFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
+ static void SettingOptionAudioCdActionsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
protected:
static bool RunDisc(XFILE::IDirectory* pDir, const std::string& strDrive, int& nAddedToPlaylist, bool bRoot, bool bypassSettings, bool startFromBeginning);
diff --git a/xbmc/GUIPassword.cpp b/xbmc/GUIPassword.cpp
index 68919aed5a..5c0b0d273d 100644
--- a/xbmc/GUIPassword.cpp
+++ b/xbmc/GUIPassword.cpp
@@ -570,7 +570,7 @@ bool CGUIPassword::IsMediaPathUnlocked(const std::shared_ptr<CProfileManager>& p
return true;
}
-void CGUIPassword::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CGUIPassword::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
diff --git a/xbmc/GUIPassword.h b/xbmc/GUIPassword.h
index 36736482d7..1e315be4d8 100644
--- a/xbmc/GUIPassword.h
+++ b/xbmc/GUIPassword.h
@@ -71,7 +71,7 @@ public:
m_strMediaSourcePath = strMediaSourcePath;
}
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
bool bMasterUser;
int iMasterLockRetriesLeft;
diff --git a/xbmc/LangInfo.cpp b/xbmc/LangInfo.cpp
index 0fca05fe0c..b5e507fd78 100644
--- a/xbmc/LangInfo.cpp
+++ b/xbmc/LangInfo.cpp
@@ -314,7 +314,7 @@ CLangInfo::CLangInfo()
CLangInfo::~CLangInfo() = default;
-void CLangInfo::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CLangInfo::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -1122,7 +1122,10 @@ std::string CLangInfo::PrepareTimeFormat(const std::string& timeFormat, bool use
return preparedTimeFormat;
}
-void CLangInfo::SettingOptionsLanguageNamesFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLangInfo::SettingOptionsLanguageNamesFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
// find languages...
ADDON::VECADDONS addons;
@@ -1135,7 +1138,10 @@ void CLangInfo::SettingOptionsLanguageNamesFiller(SettingConstPtr setting, std::
sort(list.begin(), list.end(), SortLanguage());
}
-void CLangInfo::SettingOptionsISO6391LanguagesFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLangInfo::SettingOptionsISO6391LanguagesFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
// get a list of language names
std::vector<std::string> languages = g_LangCodeExpander.GetLanguageNames(CLangCodeExpander::ISO_639_1, true);
@@ -1144,7 +1150,10 @@ void CLangInfo::SettingOptionsISO6391LanguagesFiller(SettingConstPtr setting, st
list.emplace_back(language, language);
}
-void CLangInfo::SettingOptionsAudioStreamLanguagesFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLangInfo::SettingOptionsAudioStreamLanguagesFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
list.emplace_back(g_localizeStrings.Get(307), "mediadefault");
list.emplace_back(g_localizeStrings.Get(308), "original");
@@ -1153,7 +1162,10 @@ void CLangInfo::SettingOptionsAudioStreamLanguagesFiller(SettingConstPtr setting
AddLanguages(list);
}
-void CLangInfo::SettingOptionsSubtitleStreamLanguagesFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLangInfo::SettingOptionsSubtitleStreamLanguagesFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
list.emplace_back(g_localizeStrings.Get(231), "none");
list.emplace_back(g_localizeStrings.Get(13207), "forced_only");
@@ -1163,7 +1175,11 @@ void CLangInfo::SettingOptionsSubtitleStreamLanguagesFiller(SettingConstPtr sett
AddLanguages(list);
}
-void CLangInfo::SettingOptionsSubtitleDownloadlanguagesFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLangInfo::SettingOptionsSubtitleDownloadlanguagesFiller(
+ const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
list.emplace_back(g_localizeStrings.Get(308), "original");
list.emplace_back(g_localizeStrings.Get(309), "default");
@@ -1171,7 +1187,10 @@ void CLangInfo::SettingOptionsSubtitleDownloadlanguagesFiller(SettingConstPtr se
AddLanguages(list);
}
-void CLangInfo::SettingOptionsRegionsFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLangInfo::SettingOptionsRegionsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
std::vector<std::string> regions;
g_langInfo.GetRegionNames(regions);
@@ -1194,7 +1213,10 @@ void CLangInfo::SettingOptionsRegionsFiller(SettingConstPtr setting, std::vector
current = regions[0];
}
-void CLangInfo::SettingOptionsShortDateFormatsFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLangInfo::SettingOptionsShortDateFormatsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
bool match = false;
const std::string& shortDateFormatSetting = std::static_pointer_cast<const CSettingString>(setting)->GetValue();
@@ -1226,7 +1248,10 @@ void CLangInfo::SettingOptionsShortDateFormatsFiller(SettingConstPtr setting, st
current = list[0].value;
}
-void CLangInfo::SettingOptionsLongDateFormatsFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLangInfo::SettingOptionsLongDateFormatsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
bool match = false;
const std::string& longDateFormatSetting = std::static_pointer_cast<const CSettingString>(setting)->GetValue();
@@ -1258,7 +1283,10 @@ void CLangInfo::SettingOptionsLongDateFormatsFiller(SettingConstPtr setting, std
current = list[0].value;
}
-void CLangInfo::SettingOptionsTimeFormatsFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLangInfo::SettingOptionsTimeFormatsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
bool match = false;
const std::string& timeFormatSetting = std::static_pointer_cast<const CSettingString>(setting)->GetValue();
@@ -1329,7 +1357,10 @@ void CLangInfo::SettingOptionsTimeFormatsFiller(SettingConstPtr setting, std::ve
current = list[0].value;
}
-void CLangInfo::SettingOptions24HourClockFormatsFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLangInfo::SettingOptions24HourClockFormatsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
bool match = false;
const std::string& clock24HourFormatSetting = std::static_pointer_cast<const CSettingString>(setting)->GetValue();
@@ -1363,7 +1394,10 @@ void CLangInfo::SettingOptions24HourClockFormatsFiller(SettingConstPtr setting,
current = list[0].value;
}
-void CLangInfo::SettingOptionsTemperatureUnitsFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLangInfo::SettingOptionsTemperatureUnitsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
bool match = false;
const std::string& temperatureUnitSetting = std::static_pointer_cast<const CSettingString>(setting)->GetValue();
@@ -1392,7 +1426,10 @@ void CLangInfo::SettingOptionsTemperatureUnitsFiller(SettingConstPtr setting, st
current = list[0].value;
}
-void CLangInfo::SettingOptionsSpeedUnitsFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLangInfo::SettingOptionsSpeedUnitsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
bool match = false;
const std::string& speedUnitSetting = std::static_pointer_cast<const CSettingString>(setting)->GetValue();
diff --git a/xbmc/LangInfo.h b/xbmc/LangInfo.h
index be9cf93ac2..295adc5755 100644
--- a/xbmc/LangInfo.h
+++ b/xbmc/LangInfo.h
@@ -54,7 +54,7 @@ public:
~CLangInfo() override;
// implementation of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
// implementation of ISettingsHandler
void OnSettingsLoaded() override;
@@ -165,18 +165,57 @@ public:
static void LoadTokens(const TiXmlNode* pTokens, std::set<std::string>& vecTokens);
- static void SettingOptionsLanguageNamesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsAudioStreamLanguagesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsSubtitleStreamLanguagesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsSubtitleDownloadlanguagesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsISO6391LanguagesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsRegionsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsShortDateFormatsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsLongDateFormatsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsTimeFormatsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptions24HourClockFormatsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsTemperatureUnitsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsSpeedUnitsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
+ static void SettingOptionsLanguageNamesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsAudioStreamLanguagesFiller(
+ const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsSubtitleStreamLanguagesFiller(
+ const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsSubtitleDownloadlanguagesFiller(
+ const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsISO6391LanguagesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsRegionsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsShortDateFormatsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsLongDateFormatsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsTimeFormatsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptions24HourClockFormatsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsTemperatureUnitsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsSpeedUnitsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
protected:
void SetDefaults();
diff --git a/xbmc/NfoFile.cpp b/xbmc/NfoFile.cpp
index 78a692d07e..61c714527a 100644
--- a/xbmc/NfoFile.cpp
+++ b/xbmc/NfoFile.cpp
@@ -149,8 +149,7 @@ void CNfoFile::Close()
m_scurl.Clear();
}
-std::vector<ScraperPtr> CNfoFile::GetScrapers(TYPE type,
- ScraperPtr selectedScraper)
+std::vector<ScraperPtr> CNfoFile::GetScrapers(TYPE type, const ScraperPtr& selectedScraper)
{
AddonPtr addon;
ScraperPtr defaultScraper;
diff --git a/xbmc/NfoFile.h b/xbmc/NfoFile.h
index 4f6727f958..8db080f5d0 100644
--- a/xbmc/NfoFile.h
+++ b/xbmc/NfoFile.h
@@ -16,6 +16,7 @@
#include "addons/Scraper.h"
#include <string>
+#include <utility>
class CNfoFile
{
@@ -40,7 +41,7 @@ public:
}
void Close();
- void SetScraperInfo(ADDON::ScraperPtr info) { m_info = info; }
+ void SetScraperInfo(ADDON::ScraperPtr info) { m_info = std::move(info); }
ADDON::ScraperPtr GetScraperInfo() { return m_info; }
const CScraperUrl &ScraperUrl() const { return m_scurl; }
@@ -48,7 +49,7 @@ public:
const std::string& content);
static std::vector<ADDON::ScraperPtr> GetScrapers(ADDON::TYPE type,
- ADDON::ScraperPtr selectedScraper);
+ const ADDON::ScraperPtr& selectedScraper);
private:
std::string m_doc;
diff --git a/xbmc/PlayListPlayer.cpp b/xbmc/PlayListPlayer.cpp
index 4a0d640693..10d5083d5e 100644
--- a/xbmc/PlayListPlayer.cpp
+++ b/xbmc/PlayListPlayer.cpp
@@ -255,7 +255,7 @@ bool CPlayListPlayer::PlaySongId(int songId)
return Play();
}
-bool CPlayListPlayer::Play(const CFileItemPtr &pItem, std::string player)
+bool CPlayListPlayer::Play(const CFileItemPtr& pItem, const std::string& player)
{
int playlist;
if (pItem->IsAudio())
@@ -276,7 +276,10 @@ bool CPlayListPlayer::Play(const CFileItemPtr &pItem, std::string player)
return Play(0, player);
}
-bool CPlayListPlayer::Play(int iSong, std::string player, bool bAutoPlay /* = false */, bool bPlayPrevious /* = false */)
+bool CPlayListPlayer::Play(int iSong,
+ const std::string& player,
+ bool bAutoPlay /* = false */,
+ bool bPlayPrevious /* = false */)
{
if (m_iCurrentPlayList == PLAYLIST_NONE)
return false;
diff --git a/xbmc/PlayListPlayer.h b/xbmc/PlayListPlayer.h
index 654a51ee46..4ab2de7753 100644
--- a/xbmc/PlayListPlayer.h
+++ b/xbmc/PlayListPlayer.h
@@ -63,14 +63,17 @@ public:
/*! \brief Creates a new playlist for an item and starts playing it
\param pItem The item to play.
*/
- bool Play(const CFileItemPtr &pItem, std::string player);
+ bool Play(const CFileItemPtr& pItem, const std::string& player);
/*! \brief Start playing a particular entry in the current playlist
\param index the index of the item to play. This value is modified to ensure it lies within the current playlist.
\param replace whether this item should replace the currently playing item. See CApplication::PlayFile (defaults to false).
\param playPreviousOnFail whether to go back to the previous item if playback fails (default to false)
*/
- bool Play(int index, std::string player, bool replace = false, bool playPreviousOnFail = false);
+ bool Play(int index,
+ const std::string& player,
+ bool replace = false,
+ bool playPreviousOnFail = false);
/*! \brief Returns the index of the current item in active playlist.
\return Current item in the active playlist.
diff --git a/xbmc/SeekHandler.cpp b/xbmc/SeekHandler.cpp
index c34ac37f0b..e2f0e1028c 100644
--- a/xbmc/SeekHandler.cpp
+++ b/xbmc/SeekHandler.cpp
@@ -227,7 +227,10 @@ void CSeekHandler::FrameMove()
}
}
-void CSeekHandler::SettingOptionsSeekStepsFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CSeekHandler::SettingOptionsSeekStepsFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
std::string label;
for (int seconds : CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_seekSteps)
@@ -242,7 +245,7 @@ void CSeekHandler::SettingOptionsSeekStepsFiller(SettingConstPtr setting, std::v
}
}
-void CSeekHandler::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CSeekHandler::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
diff --git a/xbmc/SeekHandler.h b/xbmc/SeekHandler.h
index aea92450a0..048b625e77 100644
--- a/xbmc/SeekHandler.h
+++ b/xbmc/SeekHandler.h
@@ -32,9 +32,12 @@ public:
CSeekHandler() = default;
~CSeekHandler() override;
- static void SettingOptionsSeekStepsFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
+ static void SettingOptionsSeekStepsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
bool OnAction(const CAction &action) override;
void Seek(bool forward, float amount, float duration = 0, bool analogSeek = false, SeekType type = SEEK_TYPE_VIDEO);
diff --git a/xbmc/ServiceBroker.cpp b/xbmc/ServiceBroker.cpp
index 4a17340d68..582de0d34c 100644
--- a/xbmc/ServiceBroker.cpp
+++ b/xbmc/ServiceBroker.cpp
@@ -14,6 +14,8 @@
#include "utils/log.h"
#include "windowing/WinSystem.h"
+#include <utility>
+
using namespace KODI;
@@ -47,7 +49,7 @@ std::shared_ptr<ANNOUNCEMENT::CAnnouncementManager> CServiceBroker::GetAnnouncem
}
void CServiceBroker::RegisterAnnouncementManager(std::shared_ptr<ANNOUNCEMENT::CAnnouncementManager> port)
{
- g_serviceBroker.m_pAnnouncementManager = port;
+ g_serviceBroker.m_pAnnouncementManager = std::move(port);
}
void CServiceBroker::UnregisterAnnouncementManager()
@@ -268,7 +270,7 @@ std::shared_ptr<CAppInboundProtocol> CServiceBroker::GetAppPort()
}
void CServiceBroker::RegisterAppPort(std::shared_ptr<CAppInboundProtocol> port)
{
- g_serviceBroker.m_pAppPort = port;
+ g_serviceBroker.m_pAppPort = std::move(port);
}
void CServiceBroker::UnregisterAppPort()
{
@@ -292,7 +294,7 @@ std::shared_ptr<CCPUInfo> CServiceBroker::GetCPUInfo()
void CServiceBroker::RegisterCPUInfo(std::shared_ptr<CCPUInfo> cpuInfo)
{
- g_serviceBroker.m_cpuInfo = cpuInfo;
+ g_serviceBroker.m_cpuInfo = std::move(cpuInfo);
}
void CServiceBroker::UnregisterCPUInfo()
diff --git a/xbmc/Util.cpp b/xbmc/Util.cpp
index 33a349e78c..727dbb09a0 100644
--- a/xbmc/Util.cpp
+++ b/xbmc/Util.cpp
@@ -499,7 +499,7 @@ void CUtil::RunShortcut(const char* szShortcutPath)
{
}
-std::string CUtil::GetHomePath(std::string strTarget)
+std::string CUtil::GetHomePath(const std::string& strTarget)
{
auto strPath = CEnvironment::getenv(strTarget);
diff --git a/xbmc/Util.h b/xbmc/Util.h
index 0aeb534875..97986424ed 100644
--- a/xbmc/Util.h
+++ b/xbmc/Util.h
@@ -48,7 +48,8 @@ public:
static std::string GetTitleFromPath(const std::string& strFileNameAndPath, bool bIsFolder = false);
static void GetQualifiedFilename(const std::string &strBasePath, std::string &strFilename);
static void RunShortcut(const char* szPath);
- static std::string GetHomePath(std::string strTarget = "KODI_HOME"); // default target is "KODI_HOME"
+ static std::string GetHomePath(
+ const std::string& strTarget = "KODI_HOME"); // default target is "KODI_HOME"
static bool ExcludeFileOrFolder(const std::string& strFileOrFolder, const std::vector<std::string>& regexps);
static void GetFileAndProtocol(const std::string& strURL, std::string& strDir);
static int GetDVDIfoTitle(const std::string& strPathFile);
diff --git a/xbmc/addons/AddonDatabase.h b/xbmc/addons/AddonDatabase.h
index b30203e859..db06243f40 100644
--- a/xbmc/addons/AddonDatabase.h
+++ b/xbmc/addons/AddonDatabase.h
@@ -96,9 +96,9 @@ public:
RepoUpdateData() = default;
- RepoUpdateData(CDateTime lastCheckedAt,
- ADDON::AddonVersion lastCheckedVersion,
- CDateTime nextCheckAt)
+ RepoUpdateData(const CDateTime& lastCheckedAt,
+ const ADDON::AddonVersion& lastCheckedVersion,
+ const CDateTime& nextCheckAt)
: lastCheckedAt{lastCheckedAt},
lastCheckedVersion{lastCheckedVersion},
nextCheckAt{nextCheckAt}
diff --git a/xbmc/addons/AddonStatusHandler.cpp b/xbmc/addons/AddonStatusHandler.cpp
index bae06e89fb..1184690a8f 100644
--- a/xbmc/addons/AddonStatusHandler.cpp
+++ b/xbmc/addons/AddonStatusHandler.cpp
@@ -21,6 +21,8 @@
#include "utils/Variant.h"
#include "utils/log.h"
+#include <utility>
+
using namespace KODI::MESSAGING;
namespace ADDON
@@ -48,7 +50,7 @@ CAddonStatusHandler::CAddonStatusHandler(const std::string &addonID, ADDON_STATU
CLog::Log(LOGINFO, "Called Add-on status handler for '%u' of clientName:%s, clientID:%s (same Thread=%s)", status, m_addon->Name().c_str(), m_addon->ID().c_str(), sameThread ? "yes" : "no");
m_status = status;
- m_message = message;
+ m_message = std::move(message);
if (sameThread)
{
diff --git a/xbmc/addons/AddonSystemSettings.cpp b/xbmc/addons/AddonSystemSettings.cpp
index cd9f4b1654..ca15b941ff 100644
--- a/xbmc/addons/AddonSystemSettings.cpp
+++ b/xbmc/addons/AddonSystemSettings.cpp
@@ -45,7 +45,7 @@ CAddonSystemSettings& CAddonSystemSettings::GetInstance()
return inst;
}
-void CAddonSystemSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CAddonSystemSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting->GetId() == CSettings::SETTING_ADDONS_MANAGE_DEPENDENCIES)
{
@@ -59,7 +59,7 @@ void CAddonSystemSettings::OnSettingAction(std::shared_ptr<const CSetting> setti
}
}
-void CAddonSystemSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CAddonSystemSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
using namespace KODI::MESSAGING::HELPERS;
diff --git a/xbmc/addons/AddonSystemSettings.h b/xbmc/addons/AddonSystemSettings.h
index 6f7f6e4744..dfa619aa9e 100644
--- a/xbmc/addons/AddonSystemSettings.h
+++ b/xbmc/addons/AddonSystemSettings.h
@@ -31,8 +31,8 @@ class CAddonSystemSettings : public ISettingCallback
{
public:
static CAddonSystemSettings& GetInstance();
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
bool GetActive(const TYPE& type, AddonPtr& addon);
bool SetActive(const TYPE& type, const std::string& addonID);
diff --git a/xbmc/addons/RepositoryUpdater.cpp b/xbmc/addons/RepositoryUpdater.cpp
index a197562d35..9bac6bd6ad 100644
--- a/xbmc/addons/RepositoryUpdater.cpp
+++ b/xbmc/addons/RepositoryUpdater.cpp
@@ -173,7 +173,7 @@ void CRepositoryUpdater::OnTimeout()
CheckForUpdates();
}
-void CRepositoryUpdater::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CRepositoryUpdater::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting->GetId() == CSettings::SETTING_ADDONS_AUTOUPDATES)
ScheduleUpdate();
diff --git a/xbmc/addons/RepositoryUpdater.h b/xbmc/addons/RepositoryUpdater.h
index 92a57446fa..c99ad929b2 100644
--- a/xbmc/addons/RepositoryUpdater.h
+++ b/xbmc/addons/RepositoryUpdater.h
@@ -57,7 +57,7 @@ public:
CDateTime LastUpdated() const;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
struct RepositoryUpdated { };
diff --git a/xbmc/addons/Service.cpp b/xbmc/addons/Service.cpp
index 3f409c4ab3..144c059ece 100644
--- a/xbmc/addons/Service.cpp
+++ b/xbmc/addons/Service.cpp
@@ -110,7 +110,7 @@ void CServiceAddonManager::Stop(const std::string& addonId)
}
}
-void CServiceAddonManager::Stop(std::map<std::string, int>::value_type service)
+void CServiceAddonManager::Stop(const std::map<std::string, int>::value_type& service)
{
CLog::Log(LOGDEBUG, "CServiceAddonManager: stopping %s.", service.first.c_str());
if (!CScriptInvocationManager::GetInstance().Stop(service.second))
diff --git a/xbmc/addons/Service.h b/xbmc/addons/Service.h
index bd67ce34cd..c997ef01b3 100644
--- a/xbmc/addons/Service.h
+++ b/xbmc/addons/Service.h
@@ -50,7 +50,7 @@ namespace ADDON
private:
void OnEvent(const AddonEvent& event);
- void Stop(std::map<std::string, int>::value_type service);
+ void Stop(const std::map<std::string, int>::value_type& service);
CAddonMgr& m_addonMgr;
CCriticalSection m_criticalSection;
diff --git a/xbmc/addons/Skin.cpp b/xbmc/addons/Skin.cpp
index 3d7ba36c36..4de5e4638c 100644
--- a/xbmc/addons/Skin.cpp
+++ b/xbmc/addons/Skin.cpp
@@ -392,7 +392,10 @@ void CSkinInfo::OnPostInstall(bool update, bool modal)
}
}
-void CSkinInfo::SettingOptionsSkinColorsFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CSkinInfo::SettingOptionsSkinColorsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
if (!g_SkinInfo)
return;
@@ -436,7 +439,10 @@ void CSkinInfo::SettingOptionsSkinColorsFiller(SettingConstPtr setting, std::vec
}
}
-void CSkinInfo::SettingOptionsSkinFontsFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CSkinInfo::SettingOptionsSkinFontsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
if (!g_SkinInfo)
return;
@@ -488,7 +494,10 @@ void CSkinInfo::SettingOptionsSkinFontsFiller(SettingConstPtr setting, std::vect
current = list[0].value;
}
-void CSkinInfo::SettingOptionsSkinThemesFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CSkinInfo::SettingOptionsSkinThemesFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
// get the chosen theme and remove the extension from the current theme (backward compat)
std::string settingValue = std::static_pointer_cast<const CSettingString>(setting)->GetValue();
@@ -517,7 +526,10 @@ void CSkinInfo::SettingOptionsSkinThemesFiller(SettingConstPtr setting, std::vec
}
}
-void CSkinInfo::SettingOptionsStartupWindowsFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CSkinInfo::SettingOptionsStartupWindowsFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
if (!g_SkinInfo)
return;
diff --git a/xbmc/addons/Skin.h b/xbmc/addons/Skin.h
index 9a44decb23..399c83b91b 100644
--- a/xbmc/addons/Skin.h
+++ b/xbmc/addons/Skin.h
@@ -169,10 +169,22 @@ public:
void ToggleDebug();
const INFO::CSkinVariableString* CreateSkinVariable(const std::string& name, int context);
- static void SettingOptionsSkinColorsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsSkinFontsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsSkinThemesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsStartupWindowsFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
+ static void SettingOptionsSkinColorsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsSkinFontsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsSkinThemesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsStartupWindowsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
/*! \brief Don't handle skin settings like normal addon settings
*/
diff --git a/xbmc/addons/VFSEntry.cpp b/xbmc/addons/VFSEntry.cpp
index 8ed59f8015..ae6764fc8b 100644
--- a/xbmc/addons/VFSEntry.cpp
+++ b/xbmc/addons/VFSEntry.cpp
@@ -14,6 +14,8 @@
#include "utils/StringUtils.h"
#include "utils/log.h"
+#include <utility>
+
#if defined(TARGET_WINDOWS)
#ifndef S_IFLNK
#define S_IFLNK 0120000
@@ -563,8 +565,8 @@ bool CVFSEntry::ContainsFiles(const CURL& url, CFileItemList& items)
return true;
}
-CVFSEntryIFileWrapper::CVFSEntryIFileWrapper(VFSEntryPtr ptr) :
- m_context(nullptr), m_addon(ptr)
+CVFSEntryIFileWrapper::CVFSEntryIFileWrapper(VFSEntryPtr ptr)
+ : m_context(nullptr), m_addon(std::move(ptr))
{
}
@@ -675,8 +677,7 @@ bool CVFSEntryIFileWrapper::Rename(const CURL& url, const CURL& url2)
return m_addon->Rename(url, url2);
}
-CVFSEntryIDirectoryWrapper::CVFSEntryIDirectoryWrapper(VFSEntryPtr ptr) :
- m_addon(ptr)
+CVFSEntryIDirectoryWrapper::CVFSEntryIDirectoryWrapper(VFSEntryPtr ptr) : m_addon(std::move(ptr))
{
}
diff --git a/xbmc/addons/VFSEntry.h b/xbmc/addons/VFSEntry.h
index 7fbe30fa38..a16bfc9fb2 100644
--- a/xbmc/addons/VFSEntry.h
+++ b/xbmc/addons/VFSEntry.h
@@ -13,6 +13,8 @@
#include "filesystem/IFile.h"
#include "filesystem/IFileDirectory.h"
+#include <utility>
+
namespace ADDON
{
@@ -256,7 +258,10 @@ namespace ADDON
public:
//! \brief The constructor initializes the reference to the wrapped CVFSEntry.
//! \param ptr The CVFSEntry to wrap.
- explicit CVFSEntryIFileDirectoryWrapper(VFSEntryPtr ptr) : CVFSEntryIDirectoryWrapper(ptr) {}
+ explicit CVFSEntryIFileDirectoryWrapper(VFSEntryPtr ptr)
+ : CVFSEntryIDirectoryWrapper(std::move(ptr))
+ {
+ }
//! \brief Empty destructor.
~CVFSEntryIFileDirectoryWrapper() override = default;
diff --git a/xbmc/addons/addoninfo/AddonInfo.h b/xbmc/addons/addoninfo/AddonInfo.h
index d2aa892074..31dc2adcd5 100644
--- a/xbmc/addons/addoninfo/AddonInfo.h
+++ b/xbmc/addons/addoninfo/AddonInfo.h
@@ -16,6 +16,7 @@
#include <memory>
#include <string>
#include <unordered_map>
+#include <utility>
#include <vector>
namespace ADDON
@@ -78,11 +79,14 @@ struct DependencyInfo
std::string id;
AddonVersion versionMin, version;
bool optional;
- DependencyInfo(std::string id, AddonVersion versionMin, AddonVersion version, bool optional)
- : id(id)
- , versionMin(versionMin.empty() ? version : versionMin)
- , version(version)
- , optional(optional)
+ DependencyInfo(std::string id,
+ const AddonVersion& versionMin,
+ const AddonVersion& version,
+ bool optional)
+ : id(std::move(id)),
+ versionMin(versionMin.empty() ? version : versionMin),
+ version(version),
+ optional(optional)
{
}
diff --git a/xbmc/addons/addoninfo/AddonInfoBuilder.cpp b/xbmc/addons/addoninfo/AddonInfoBuilder.cpp
index b9013b6fbf..1b6a9b5533 100644
--- a/xbmc/addons/addoninfo/AddonInfoBuilder.cpp
+++ b/xbmc/addons/addoninfo/AddonInfoBuilder.cpp
@@ -418,7 +418,9 @@ bool CAddonInfoBuilder::ParseXML(const AddonInfoPtr& addon, const TiXmlElement*
return true;
}
-bool CAddonInfoBuilder::ParseXMLTypes(CAddonType& addonType, AddonInfoPtr info, const TiXmlElement* child)
+bool CAddonInfoBuilder::ParseXMLTypes(CAddonType& addonType,
+ const AddonInfoPtr& info,
+ const TiXmlElement* child)
{
if (child)
{
diff --git a/xbmc/addons/addoninfo/AddonInfoBuilder.h b/xbmc/addons/addoninfo/AddonInfoBuilder.h
index 34e52c647e..e29471ac5f 100644
--- a/xbmc/addons/addoninfo/AddonInfoBuilder.h
+++ b/xbmc/addons/addoninfo/AddonInfoBuilder.h
@@ -11,6 +11,8 @@
#include "addons/Repository.h"
#include "addons/addoninfo/AddonInfo.h"
+#include <utility>
+
class TiXmlElement;
namespace ADDON
@@ -40,7 +42,10 @@ public:
void SetForum(std::string forum) { m_addonInfo->m_forum = std::move(forum); }
void SetEMail(std::string email) { m_addonInfo->m_email = std::move(email); }
void SetIcon(std::string icon) { m_addonInfo->m_icon = std::move(icon); }
- void SetArt(std::string type, std::string value) { m_addonInfo->m_art[type] = value; }
+ void SetArt(const std::string& type, std::string value)
+ {
+ m_addonInfo->m_art[type] = std::move(value);
+ }
void SetArt(std::map<std::string, std::string> art) { m_addonInfo->m_art = std::move(art); }
void SetScreenshots(std::vector<std::string> screenshots) { m_addonInfo->m_screenshots = std::move(screenshots); }
void SetChangelog(std::string changelog) { m_addonInfo->m_changelog.insert(std::pair<std::string, std::string>("unk", std::move(changelog))); }
@@ -51,8 +56,8 @@ public:
}
void SetPath(std::string path) { m_addonInfo->m_path = std::move(path); }
void SetLibName(std::string libname) { m_addonInfo->m_libname = std::move(libname); }
- void SetVersion(AddonVersion version) { m_addonInfo->m_version = version; }
- void SetMinVersion(AddonVersion minversion) { m_addonInfo->m_minversion = minversion; }
+ void SetVersion(const AddonVersion& version) { m_addonInfo->m_version = version; }
+ void SetMinVersion(const AddonVersion& minversion) { m_addonInfo->m_minversion = minversion; }
void SetDependencies(std::vector<DependencyInfo> dependencies) { m_addonInfo->m_dependencies = std::move(dependencies); }
void SetExtrainfo(InfoMap extrainfo)
{
@@ -87,7 +92,9 @@ public:
private:
static bool ParseXML(const AddonInfoPtr& addon, const TiXmlElement* element, const std::string& addonPath, const CRepository::DirInfo& repo = {});
- static bool ParseXMLTypes(CAddonType& addonType, AddonInfoPtr info, const TiXmlElement* child);
+ static bool ParseXMLTypes(CAddonType& addonType,
+ const AddonInfoPtr& info,
+ const TiXmlElement* child);
static bool ParseXMLExtension(CAddonExtensions& addonExt, const TiXmlElement* element);
static bool GetTextList(const TiXmlElement* element, const std::string& tag, std::unordered_map<std::string, std::string>& translatedValues);
static const char* GetPlatformLibraryName(const TiXmlElement* element);
diff --git a/xbmc/addons/binary-addons/AddonDll.cpp b/xbmc/addons/binary-addons/AddonDll.cpp
index a6169a1f10..d61a60d8a2 100644
--- a/xbmc/addons/binary-addons/AddonDll.cpp
+++ b/xbmc/addons/binary-addons/AddonDll.cpp
@@ -22,13 +22,15 @@
#include "utils/Variant.h"
#include "utils/log.h"
+#include <utility>
+
using namespace KODI::MESSAGING;
namespace ADDON
{
CAddonDll::CAddonDll(const AddonInfoPtr& addonInfo, BinaryAddonBasePtr addonBase)
- : CAddon(addonInfo, addonInfo->MainType()), m_binaryAddonBase(addonBase)
+ : CAddon(addonInfo, addonInfo->MainType()), m_binaryAddonBase(std::move(addonBase))
{
}
diff --git a/xbmc/addons/gui/GUIDialogAddonSettings.cpp b/xbmc/addons/gui/GUIDialogAddonSettings.cpp
index 496766d29a..7ff32b45a7 100644
--- a/xbmc/addons/gui/GUIDialogAddonSettings.cpp
+++ b/xbmc/addons/gui/GUIDialogAddonSettings.cpp
@@ -218,7 +218,7 @@ std::string CGUIDialogAddonSettings::GetLocalizedString(uint32_t labelId) const
return CGUIDialogSettingsManagerBase::GetLocalizedString(labelId);
}
-std::string CGUIDialogAddonSettings::GetSettingsLabel(std::shared_ptr<ISetting> setting)
+std::string CGUIDialogAddonSettings::GetSettingsLabel(const std::shared_ptr<ISetting>& setting)
{
if (setting == nullptr)
return "";
@@ -261,7 +261,7 @@ CSettingsManager* CGUIDialogAddonSettings::GetSettingsManager() const
return m_addon->GetSettings()->GetSettingsManager();
}
-void CGUIDialogAddonSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CGUIDialogAddonSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (m_addon == nullptr || m_addon->GetSettings() == nullptr)
return;
diff --git a/xbmc/addons/gui/GUIDialogAddonSettings.h b/xbmc/addons/gui/GUIDialogAddonSettings.h
index c28fa46ae3..42c8c5ca67 100644
--- a/xbmc/addons/gui/GUIDialogAddonSettings.h
+++ b/xbmc/addons/gui/GUIDialogAddonSettings.h
@@ -30,7 +30,7 @@ protected:
// implementation of CGUIDialogSettingsBase
void SetupView() override;
std::string GetLocalizedString(uint32_t labelId) const override;
- std::string GetSettingsLabel(std::shared_ptr<ISetting> setting) override;
+ std::string GetSettingsLabel(const std::shared_ptr<ISetting>& setting) override;
int GetSettingLevel() const override;
std::shared_ptr<CSettingSection> GetSection() override;
@@ -40,7 +40,7 @@ protected:
CSettingsManager* GetSettingsManager() const override;
// implementation of ISettingCallback
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
private:
ADDON::AddonPtr m_addon;
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/gui/Window.h b/xbmc/addons/kodi-dev-kit/include/kodi/gui/Window.h
index 3066b3c2e9..10fa6efa21 100644
--- a/xbmc/addons/kodi-dev-kit/include/kodi/gui/Window.h
+++ b/xbmc/addons/kodi-dev-kit/include/kodi/gui/Window.h
@@ -451,7 +451,7 @@ public:
/// @param[in] item List item to add
/// @param[in] itemPosition [opt] The position for item, default is on end
///
- void AddListItem(std::shared_ptr<CListItem> item, int itemPosition = -1)
+ void AddListItem(const std::shared_ptr<CListItem>& item, int itemPosition = -1)
{
m_interface->kodi_gui->window->add_list_item(m_interface->kodiBase, m_controlHandle,
item->m_controlHandle, itemPosition);
@@ -465,7 +465,7 @@ public:
/// @param[in] item List item to add
/// @param[in] itemPosition [opt] The position for item, default is on end
///
- void AddListItem(const std::string item, int itemPosition = -1)
+ void AddListItem(const std::string& item, int itemPosition = -1)
{
m_interface->kodi_gui->window->add_list_item(
m_interface->kodiBase, m_controlHandle,
@@ -492,7 +492,7 @@ public:
///
/// @param[in] item List item control class to remove
///
- void RemoveListItem(std::shared_ptr<CListItem> item)
+ void RemoveListItem(const std::shared_ptr<CListItem>& item)
{
m_interface->kodi_gui->window->remove_list_item(m_interface->kodiBase, m_controlHandle,
item->m_controlHandle);
diff --git a/xbmc/addons/settings/AddonSettings.cpp b/xbmc/addons/settings/AddonSettings.cpp
index b58ce18af6..85464fe2df 100644
--- a/xbmc/addons/settings/AddonSettings.cpp
+++ b/xbmc/addons/settings/AddonSettings.cpp
@@ -43,13 +43,18 @@ static const std::string OldSettingValuesSeparator = "|";
static const int UnknownSettingLabelIdStart = 100000;
-bool InfoBool(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool InfoBool(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CServiceBroker::GetGUI()->GetInfoManager().EvaluateBool(value);
}
template<class TSetting>
-SettingPtr InitializeFromOldSettingWithoutDefinition(ADDON::CAddonSettings& settings, const std::string& settingId, typename TSetting::Value defaultValue)
+SettingPtr InitializeFromOldSettingWithoutDefinition(ADDON::CAddonSettings& settings,
+ const std::string& settingId,
+ const typename TSetting::Value& defaultValue)
{
std::shared_ptr<TSetting> setting = std::make_shared<TSetting>(settingId, settings.GetSettingsManager());
setting->SetLevel(SettingLevel::Internal);
@@ -60,7 +65,10 @@ SettingPtr InitializeFromOldSettingWithoutDefinition(ADDON::CAddonSettings& sett
}
template<>
-SettingPtr InitializeFromOldSettingWithoutDefinition<CSettingString>(ADDON::CAddonSettings& settings, const std::string& settingId, typename CSettingString::Value defaultValue)
+SettingPtr InitializeFromOldSettingWithoutDefinition<CSettingString>(
+ ADDON::CAddonSettings& settings,
+ const std::string& settingId,
+ const typename CSettingString::Value& defaultValue)
{
std::shared_ptr<CSettingString> setting = std::make_shared<CSettingString>(settingId, settings.GetSettingsManager());
setting->SetLevel(SettingLevel::Internal);
@@ -75,7 +83,7 @@ template<class TSetting>
SettingPtr AddSettingWithoutDefinition(ADDON::CAddonSettings& settings,
const std::string& settingId,
typename TSetting::Value defaultValue,
- Logger logger)
+ const Logger& logger)
{
if (settingId.empty())
return nullptr;
@@ -131,7 +139,7 @@ SettingPtr AddSettingWithoutDefinition(ADDON::CAddonSettings& settings,
namespace ADDON
{
-CAddonSettings::CAddonSettings(std::shared_ptr<const IAddon> addon)
+CAddonSettings::CAddonSettings(const std::shared_ptr<const IAddon>& addon)
: CSettingsBase(),
m_addon(addon),
m_addonId(addon->ID()),
@@ -151,7 +159,7 @@ std::shared_ptr<CSetting> CAddonSettings::CreateSetting(const std::string &setti
return CSettingCreator::CreateSetting(settingType, settingId, settingsManager);
}
-void CAddonSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CAddonSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
std::string actionData;
bool closeDialog = false;
@@ -435,7 +443,10 @@ bool CAddonSettings::ParseSettingVersion(const CXBMCTinyXML& doc, uint32_t& vers
return true;
}
-std::shared_ptr<CSettingGroup> CAddonSettings::ParseOldSettingElement(const TiXmlElement* categoryElement, std::shared_ptr<CSettingCategory> category, std::set<std::string>& settingIds)
+std::shared_ptr<CSettingGroup> CAddonSettings::ParseOldSettingElement(
+ const TiXmlElement* categoryElement,
+ const std::shared_ptr<CSettingCategory>& category,
+ std::set<std::string>& settingIds)
{
// build a vector of settings from the same category
std::vector<std::shared_ptr<const CSetting>> categorySettings;
@@ -548,11 +559,9 @@ std::shared_ptr<CSettingGroup> CAddonSettings::ParseOldSettingElement(const TiXm
{
// find the last non-subsetting in the current group and use that as the parent setting
const auto groupSettings = group->GetSettings();
- const auto parentSetting = std::find_if(groupSettings.crbegin(), groupSettings.crend(),
- [](SettingConstPtr setting)
- {
- return setting->GetParent().empty();
- });
+ const auto parentSetting = std::find_if(
+ groupSettings.crbegin(), groupSettings.crend(),
+ [](const SettingConstPtr& setting) { return setting->GetParent().empty(); });
if (parentSetting != groupSettings.crend())
{
@@ -708,7 +717,9 @@ bool CAddonSettings::InitializeFromOldSettingDefinitions(const CXBMCTinyXML& doc
return true;
}
-SettingPtr CAddonSettings::InitializeFromOldSettingAction(std::string settingId, const TiXmlElement *settingElement, const std::string& defaultValue)
+SettingPtr CAddonSettings::InitializeFromOldSettingAction(const std::string& settingId,
+ const TiXmlElement* settingElement,
+ const std::string& defaultValue)
{
// parse the action attribute
std::string action = XMLUtils::GetAttribute(settingElement, "action");
@@ -1326,7 +1337,9 @@ bool CAddonSettings::LoadOldSettingValues(const CXBMCTinyXML& doc, std::map<std:
return !settings.empty();
}
-bool CAddonSettings::ParseOldLabel(const TiXmlElement* element, const std::string settingId, int& labelId)
+bool CAddonSettings::ParseOldLabel(const TiXmlElement* element,
+ const std::string& settingId,
+ int& labelId)
{
labelId = -1;
if (element == nullptr)
@@ -1357,7 +1370,10 @@ bool CAddonSettings::ParseOldLabel(const TiXmlElement* element, const std::strin
return parsed;
}
-bool CAddonSettings::ParseOldCondition(std::shared_ptr<const CSetting> setting, const std::vector<std::shared_ptr<const CSetting>> settings, const std::string& condition, CSettingDependency& dependeny) const
+bool CAddonSettings::ParseOldCondition(const std::shared_ptr<const CSetting>& setting,
+ const std::vector<std::shared_ptr<const CSetting>>& settings,
+ const std::string& condition,
+ CSettingDependency& dependeny) const
{
if (setting == nullptr)
return false;
@@ -1366,12 +1382,13 @@ bool CAddonSettings::ParseOldCondition(std::shared_ptr<const CSetting> setting,
return true;
// find the index of the setting in the list of all settings of the category
- auto settingIt = std::find_if(settings.cbegin(), settings.cend(), [setting](SettingConstPtr otherSetting) {
- if (otherSetting == nullptr)
- return false;
+ auto settingIt = std::find_if(settings.cbegin(), settings.cend(),
+ [setting](const SettingConstPtr& otherSetting) {
+ if (otherSetting == nullptr)
+ return false;
- return setting->GetId() == otherSetting->GetId();
- });
+ return setting->GetId() == otherSetting->GetId();
+ });
if (settingIt == settings.cend()) {
m_logger->warn("failed to parse old setting conditions \"{}\" for \"{}\"", condition,
setting->GetId());
@@ -1500,7 +1517,10 @@ bool CAddonSettings::ParseOldConditionExpression(std::string str, ConditionExpre
return true;
}
-void CAddonSettings::FileEnumSettingOptionsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CAddonSettings::FileEnumSettingOptionsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
if (setting == nullptr)
return;
diff --git a/xbmc/addons/settings/AddonSettings.h b/xbmc/addons/settings/AddonSettings.h
index 9676afaede..d7d149d561 100644
--- a/xbmc/addons/settings/AddonSettings.h
+++ b/xbmc/addons/settings/AddonSettings.h
@@ -31,7 +31,7 @@ namespace ADDON
class CAddonSettings : public CSettingsBase, public CSettingCreator, public CSettingControlCreator, public ISettingCallback
{
public:
- explicit CAddonSettings(std::shared_ptr<const IAddon> addon);
+ explicit CAddonSettings(const std::shared_ptr<const IAddon>& addon);
~CAddonSettings() override = default;
// specialization of CSettingsBase
@@ -45,7 +45,7 @@ namespace ADDON
std::shared_ptr<CSetting> CreateSetting(const std::string &settingType, const std::string &settingId, CSettingsManager *settingsManager = NULL) const override;
// implementation of ISettingCallback
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
std::shared_ptr<const IAddon> GetAddon() { return m_addon.lock(); }
@@ -76,12 +76,17 @@ namespace ADDON
bool ParseSettingVersion(const CXBMCTinyXML& doc, uint32_t& version) const;
- std::shared_ptr<CSettingGroup> ParseOldSettingElement(const TiXmlElement *categoryElement, std::shared_ptr<CSettingCategory> category, std::set<std::string>& settingIds);
+ std::shared_ptr<CSettingGroup> ParseOldSettingElement(
+ const TiXmlElement* categoryElement,
+ const std::shared_ptr<CSettingCategory>& category,
+ std::set<std::string>& settingIds);
std::shared_ptr<CSettingCategory> ParseOldCategoryElement(uint32_t &categoryId, const TiXmlElement * categoryElement, std::set<std::string>& settingIds);
bool InitializeFromOldSettingDefinitions(const CXBMCTinyXML& doc);
- std::shared_ptr<CSetting> InitializeFromOldSettingAction(std::string settingId, const TiXmlElement *settingElement, const std::string& defaultValue);
+ std::shared_ptr<CSetting> InitializeFromOldSettingAction(const std::string& settingId,
+ const TiXmlElement* settingElement,
+ const std::string& defaultValue);
std::shared_ptr<CSetting> InitializeFromOldSettingLabel();
std::shared_ptr<CSetting> InitializeFromOldSettingBool(const std::string& settingId, const TiXmlElement *settingElement, const std::string& defaultValue);
std::shared_ptr<CSetting> InitializeFromOldSettingTextIpAddress(const std::string& settingId, const std::string& settingType, const TiXmlElement *settingElement, const std::string& defaultValue, const int settingLabel);
@@ -107,11 +112,17 @@ namespace ADDON
std::string m_value;
};
- bool ParseOldLabel(const TiXmlElement* element, const std::string settingId, int& labelId);
- bool ParseOldCondition(std::shared_ptr<const CSetting> setting, const std::vector<std::shared_ptr<const CSetting>> settings, const std::string& condition, CSettingDependency& dependeny) const;
+ bool ParseOldLabel(const TiXmlElement* element, const std::string& settingId, int& labelId);
+ bool ParseOldCondition(const std::shared_ptr<const CSetting>& setting,
+ const std::vector<std::shared_ptr<const CSetting>>& settings,
+ const std::string& condition,
+ CSettingDependency& dependeny) const;
static bool ParseOldConditionExpression(std::string str, ConditionExpression& expression);
- static void FileEnumSettingOptionsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
+ static void FileEnumSettingOptionsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
std::weak_ptr<const IAddon> m_addon;
// store these values so that we don't always have to access the weak pointer
diff --git a/xbmc/addons/test/TestAddonDatabase.cpp b/xbmc/addons/test/TestAddonDatabase.cpp
index 693549af22..289a6af959 100644
--- a/xbmc/addons/test/TestAddonDatabase.cpp
+++ b/xbmc/addons/test/TestAddonDatabase.cpp
@@ -12,6 +12,7 @@
#include "settings/AdvancedSettings.h"
#include <set>
+#include <utility>
#include <gtest/gtest.h>
@@ -46,10 +47,10 @@ protected:
database.UpdateRepositoryContent("repository.b", AddonVersion("1.0.0"), "test", addons);
}
- void CreateAddon(std::vector<AddonInfoPtr>& addons, std::string id, std::string version)
+ void CreateAddon(std::vector<AddonInfoPtr>& addons, std::string id, const std::string& version)
{
CAddonInfoBuilder::CFromDB builder;
- builder.SetId(id);
+ builder.SetId(std::move(id));
builder.SetVersion(AddonVersion(version));
addons.push_back(builder.get());
}
diff --git a/xbmc/cdrip/Encoder.cpp b/xbmc/cdrip/Encoder.cpp
index a02d486d88..6e8355906b 100644
--- a/xbmc/cdrip/Encoder.cpp
+++ b/xbmc/cdrip/Encoder.cpp
@@ -12,12 +12,13 @@
#include "utils/log.h"
#include <string.h>
+#include <utility>
CEncoder::CEncoder(std::shared_ptr<IEncoder> encoder)
{
m_file = NULL;
m_dwWriteBufferPointer = 0;
- m_impl = encoder;
+ m_impl = std::move(encoder);
}
CEncoder::~CEncoder()
diff --git a/xbmc/cores/AudioEngine/AESinkFactory.cpp b/xbmc/cores/AudioEngine/AESinkFactory.cpp
index af573328a3..d86a83eb84 100644
--- a/xbmc/cores/AudioEngine/AESinkFactory.cpp
+++ b/xbmc/cores/AudioEngine/AESinkFactory.cpp
@@ -19,7 +19,7 @@ using namespace AE;
std::map<std::string, AESinkRegEntry> CAESinkFactory::m_AESinkRegEntry;
-void CAESinkFactory::RegisterSink(AESinkRegEntry regEntry)
+void CAESinkFactory::RegisterSink(const AESinkRegEntry& regEntry)
{
m_AESinkRegEntry[regEntry.sinkName] = regEntry;
@@ -85,7 +85,9 @@ IAESink *CAESinkFactory::Create(std::string &device, AEAudioFormat &desiredForma
return nullptr;
}
-void CAESinkFactory::EnumerateEx(std::vector<AESinkInfo>& list, bool force, std::string driver)
+void CAESinkFactory::EnumerateEx(std::vector<AESinkInfo>& list,
+ bool force,
+ const std::string& driver)
{
AESinkInfo info;
diff --git a/xbmc/cores/AudioEngine/AESinkFactory.h b/xbmc/cores/AudioEngine/AESinkFactory.h
index 2c5d62177a..e8e069f3eb 100644
--- a/xbmc/cores/AudioEngine/AESinkFactory.h
+++ b/xbmc/cores/AudioEngine/AESinkFactory.h
@@ -42,13 +42,13 @@ struct AESinkRegEntry
class CAESinkFactory
{
public:
- static void RegisterSink(AESinkRegEntry regEntry);
+ static void RegisterSink(const AESinkRegEntry& regEntry);
static void ClearSinks();
static bool HasSinks();
static void ParseDevice(std::string &device, std::string &driver);
static IAESink *Create(std::string &device, AEAudioFormat &desiredFormat);
- static void EnumerateEx(std::vector<AESinkInfo>& list, bool force, std::string driver);
+ static void EnumerateEx(std::vector<AESinkInfo>& list, bool force, const std::string& driver);
static void Cleanup();
protected:
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
index d9def8434c..f839fc44bc 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
@@ -2891,7 +2891,7 @@ void CActiveAE::DeviceChange()
m_controlPort.SendOutMessage(CActiveAEControlProtocol::DEVICECHANGE);
}
-void CActiveAE::DeviceCountChange(std::string driver)
+void CActiveAE::DeviceCountChange(const std::string& driver)
{
const char* name = driver.c_str();
m_controlPort.SendOutMessage(CActiveAEControlProtocol::DEVICECOUNTCHANGE, name,
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h
index 252712c113..372db894a0 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h
@@ -8,19 +8,18 @@
#pragma once
-#include <list>
-#include <string>
-#include <vector>
-
-#include "threads/Thread.h"
-
#include "ActiveAESink.h"
-#include "cores/AudioEngine/Interfaces/AEStream.h"
-#include "cores/AudioEngine/Interfaces/AESound.h"
#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h"
-
+#include "cores/AudioEngine/Interfaces/AESound.h"
+#include "cores/AudioEngine/Interfaces/AEStream.h"
#include "guilib/DispResource.h"
+#include "threads/Thread.h"
+
+#include <list>
#include <queue>
+#include <string>
+#include <utility>
+#include <vector>
// ffmpeg
extern "C" {
@@ -66,7 +65,8 @@ struct AudioSettings
class CActiveAEControlProtocol : public Protocol
{
public:
- CActiveAEControlProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Protocol(name, inEvent, outEvent) {};
+ CActiveAEControlProtocol(std::string name, CEvent* inEvent, CEvent* outEvent)
+ : Protocol(std::move(name), inEvent, outEvent){};
enum OutSignal
{
INIT = 0,
@@ -105,7 +105,8 @@ public:
class CActiveAEDataProtocol : public Protocol
{
public:
- CActiveAEDataProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Protocol(name, inEvent, outEvent) {};
+ CActiveAEDataProtocol(std::string name, CEvent* inEvent, CEvent* outEvent)
+ : Protocol(std::move(name), inEvent, outEvent){};
enum OutSignal
{
NEWSOUND = 0,
@@ -255,7 +256,7 @@ public:
bool IsSettingVisible(const std::string &settingId) override;
void KeepConfiguration(unsigned int millis) override;
void DeviceChange() override;
- void DeviceCountChange(std::string driver) override;
+ void DeviceCountChange(const std::string& driver) override;
bool GetCurrentSinkFormat(AEAudioFormat &SinkFormat) override;
void RegisterAudioCallback(IAudioCallback* pCallback) override;
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.cpp
index b3e7c90940..f9c4880c62 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.cpp
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.cpp
@@ -73,29 +73,34 @@ CActiveAESettings::~CActiveAESettings()
m_instance = nullptr;
}
-void CActiveAESettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CActiveAESettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
CSingleLock lock(m_cs);
m_instance->m_audioEngine.OnSettingsChange();
}
-void CActiveAESettings::SettingOptionsAudioDevicesFiller(SettingConstPtr setting,
- std::vector<StringSettingOption> &list,
- std::string &current, void *data)
+void CActiveAESettings::SettingOptionsAudioDevicesFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
SettingOptionsAudioDevicesFillerGeneral(setting, list, current, false);
}
-void CActiveAESettings::SettingOptionsAudioDevicesPassthroughFiller(SettingConstPtr setting,
- std::vector<StringSettingOption> &list,
- std::string &current, void *data)
+void CActiveAESettings::SettingOptionsAudioDevicesPassthroughFiller(
+ const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
SettingOptionsAudioDevicesFillerGeneral(setting, list, current, true);
}
-void CActiveAESettings::SettingOptionsAudioQualityLevelsFiller(SettingConstPtr setting,
- std::vector<IntegerSettingOption> &list,
- int &current, void *data)
+void CActiveAESettings::SettingOptionsAudioQualityLevelsFiller(
+ const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CSingleLock lock(m_instance->m_cs);
@@ -111,9 +116,11 @@ void CActiveAESettings::SettingOptionsAudioQualityLevelsFiller(SettingConstPtr s
list.emplace_back(g_localizeStrings.Get(38010), AE_QUALITY_GPU);
}
-void CActiveAESettings::SettingOptionsAudioStreamsilenceFiller(SettingConstPtr setting,
- std::vector<IntegerSettingOption> &list,
- int &current, void *data)
+void CActiveAESettings::SettingOptionsAudioStreamsilenceFiller(
+ const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CSingleLock lock(m_instance->m_cs);
@@ -130,8 +137,10 @@ void CActiveAESettings::SettingOptionsAudioStreamsilenceFiller(SettingConstPtr s
}
}
-bool CActiveAESettings::IsSettingVisible(const std::string & condition, const std::string & value,
- SettingConstPtr setting, void * data)
+bool CActiveAESettings::IsSettingVisible(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
if (setting == NULL || value.empty())
return false;
@@ -143,9 +152,11 @@ bool CActiveAESettings::IsSettingVisible(const std::string & condition, const st
return m_instance->m_audioEngine.IsSettingVisible(value);
}
-void CActiveAESettings::SettingOptionsAudioDevicesFillerGeneral(SettingConstPtr setting,
- std::vector<StringSettingOption> &list,
- std::string &current, bool passthrough)
+void CActiveAESettings::SettingOptionsAudioDevicesFillerGeneral(
+ const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ bool passthrough)
{
current = std::static_pointer_cast<const CSettingString>(setting)->GetValue();
std::string firstDevice;
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.h
index 2243afeb4b..7f814d09c3 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.h
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESettings.h
@@ -31,23 +31,36 @@ public:
CActiveAESettings(CActiveAE &ae);
~CActiveAESettings() override;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
-
- static void SettingOptionsAudioDevicesFiller(std::shared_ptr<const CSetting> setting,
- std::vector<StringSettingOption> &list,
- std::string &current, void *data);
- static void SettingOptionsAudioDevicesPassthroughFiller(std::shared_ptr<const CSetting> setting,
- std::vector<StringSettingOption> &list,
- std::string &current, void *data);
- static void SettingOptionsAudioQualityLevelsFiller(std::shared_ptr<const CSetting> setting,
- std::vector<IntegerSettingOption> &list, int &current, void *data);
- static void SettingOptionsAudioStreamsilenceFiller(std::shared_ptr<const CSetting> setting,
- std::vector<IntegerSettingOption> &list, int &current, void *data);
- static bool IsSettingVisible(const std::string &condition, const std::string &value,
- std::shared_ptr<const CSetting> setting, void *data);
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+
+ static void SettingOptionsAudioDevicesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsAudioDevicesPassthroughFiller(
+ const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsAudioQualityLevelsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void SettingOptionsAudioStreamsilenceFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static bool IsSettingVisible(const std::string& condition,
+ const std::string& value,
+ const std::shared_ptr<const CSetting>& setting,
+ void* data);
protected:
- static void SettingOptionsAudioDevicesFillerGeneral(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, bool passthrough);
+ static void SettingOptionsAudioDevicesFillerGeneral(
+ const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ bool passthrough);
CActiveAE &m_audioEngine;
CCriticalSection m_cs;
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp
index 3148c375b4..c604dfc458 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp
@@ -205,7 +205,7 @@ bool CActiveAESink::NeedIECPacking()
return true;
}
-bool CActiveAESink::DeviceExist(std::string driver, std::string device)
+bool CActiveAESink::DeviceExist(std::string driver, const std::string& device)
{
if (driver.empty() && m_sink)
driver = m_sink->GetName();
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h
index da5433861d..2d0d905266 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h
@@ -16,6 +16,8 @@
#include "threads/Thread.h"
#include "utils/ActorProtocol.h"
+#include <utility>
+
class CAEBitstreamPacker;
namespace ActiveAE
@@ -42,7 +44,8 @@ struct SinkReply
class CSinkControlProtocol : public Protocol
{
public:
- CSinkControlProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Protocol(name, inEvent, outEvent) {};
+ CSinkControlProtocol(std::string name, CEvent* inEvent, CEvent* outEvent)
+ : Protocol(std::move(name), inEvent, outEvent){};
enum OutSignal
{
CONFIGURE,
@@ -66,7 +69,8 @@ public:
class CSinkDataProtocol : public Protocol
{
public:
- CSinkDataProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Protocol(name, inEvent, outEvent) {};
+ CSinkDataProtocol(std::string name, CEvent* inEvent, CEvent* outEvent)
+ : Protocol(std::move(name), inEvent, outEvent){};
enum OutSignal
{
SAMPLE = 0,
@@ -90,7 +94,7 @@ public:
AEDeviceType GetDeviceType(const std::string &device);
bool HasPassthroughDevice();
bool SupportsFormat(const std::string &device, AEAudioFormat &format);
- bool DeviceExist(std::string driver, std::string device);
+ bool DeviceExist(std::string driver, const std::string& device);
CSinkControlProtocol m_controlPort;
CSinkDataProtocol m_dataPort;
diff --git a/xbmc/cores/AudioEngine/Interfaces/AE.h b/xbmc/cores/AudioEngine/Interfaces/AE.h
index 63f0544181..f95143871a 100644
--- a/xbmc/cores/AudioEngine/Interfaces/AE.h
+++ b/xbmc/cores/AudioEngine/Interfaces/AE.h
@@ -225,7 +225,7 @@ public:
/**
* Instruct AE to re-initialize, e.g. after ELD change event
*/
- virtual void DeviceCountChange(std::string driver) {}
+ virtual void DeviceCountChange(const std::string& driver) {}
/**
* Get the current sink data format
diff --git a/xbmc/cores/DataCacheCore.cpp b/xbmc/cores/DataCacheCore.cpp
index f2029119a6..8d17e811f0 100644
--- a/xbmc/cores/DataCacheCore.cpp
+++ b/xbmc/cores/DataCacheCore.cpp
@@ -12,6 +12,8 @@
#include "cores/Cut.h"
#include "threads/SingleLock.h"
+#include <utility>
+
CDataCacheCore::CDataCacheCore() :
m_playerVideoInfo {},
m_playerAudioInfo {},
@@ -76,7 +78,7 @@ void CDataCacheCore::SetVideoDecoderName(std::string name, bool isHw)
{
CSingleLock lock(m_videoPlayerSection);
- m_playerVideoInfo.decoderName = name;
+ m_playerVideoInfo.decoderName = std::move(name);
m_playerVideoInfo.isHwDecoder = isHw;
}
@@ -99,7 +101,7 @@ void CDataCacheCore::SetVideoDeintMethod(std::string method)
{
CSingleLock lock(m_videoPlayerSection);
- m_playerVideoInfo.deintMethod = method;
+ m_playerVideoInfo.deintMethod = std::move(method);
}
std::string CDataCacheCore::GetVideoDeintMethod()
@@ -113,7 +115,7 @@ void CDataCacheCore::SetVideoPixelFormat(std::string pixFormat)
{
CSingleLock lock(m_videoPlayerSection);
- m_playerVideoInfo.pixFormat = pixFormat;
+ m_playerVideoInfo.pixFormat = std::move(pixFormat);
}
std::string CDataCacheCore::GetVideoPixelFormat()
@@ -127,7 +129,7 @@ void CDataCacheCore::SetVideoStereoMode(std::string mode)
{
CSingleLock lock(m_videoPlayerSection);
- m_playerVideoInfo.stereoMode = mode;
+ m_playerVideoInfo.stereoMode = std::move(mode);
}
std::string CDataCacheCore::GetVideoStereoMode()
@@ -192,7 +194,7 @@ void CDataCacheCore::SetAudioDecoderName(std::string name)
{
CSingleLock lock(m_audioPlayerSection);
- m_playerAudioInfo.decoderName = name;
+ m_playerAudioInfo.decoderName = std::move(name);
}
std::string CDataCacheCore::GetAudioDecoderName()
@@ -206,7 +208,7 @@ void CDataCacheCore::SetAudioChannels(std::string channels)
{
CSingleLock lock(m_audioPlayerSection);
- m_playerAudioInfo.channels = channels;
+ m_playerAudioInfo.channels = std::move(channels);
}
std::string CDataCacheCore::GetAudioChannels()
diff --git a/xbmc/cores/VideoPlayer/Buffers/VideoBuffer.cpp b/xbmc/cores/VideoPlayer/Buffers/VideoBuffer.cpp
index ce6a7f578f..2543445b33 100644
--- a/xbmc/cores/VideoPlayer/Buffers/VideoBuffer.cpp
+++ b/xbmc/cores/VideoPlayer/Buffers/VideoBuffer.cpp
@@ -11,6 +11,7 @@
#include "threads/SingleLock.h"
#include <string.h>
+#include <utility>
//-----------------------------------------------------------------------------
// CVideoBuffer
@@ -30,7 +31,7 @@ void CVideoBuffer::Acquire()
void CVideoBuffer::Acquire(std::shared_ptr<IVideoBufferPool> pool)
{
m_refCount++;
- m_pool = pool;
+ m_pool = std::move(pool);
}
void CVideoBuffer::Release()
@@ -380,14 +381,14 @@ CVideoBufferManager::CVideoBufferManager()
RegisterPoolFactory("SysMem", &CVideoBufferPoolSysMem::CreatePool);
}
-void CVideoBufferManager::RegisterPool(std::shared_ptr<IVideoBufferPool> pool)
+void CVideoBufferManager::RegisterPool(const std::shared_ptr<IVideoBufferPool>& pool)
{
CSingleLock lock(m_critSection);
// preferred pools are to the front
m_pools.push_front(pool);
}
-void CVideoBufferManager::RegisterPoolFactory(std::string id, CreatePoolFunc createFunc)
+void CVideoBufferManager::RegisterPoolFactory(const std::string& id, CreatePoolFunc createFunc)
{
CSingleLock lock(m_critSection);
m_poolFactories[id] = createFunc;
diff --git a/xbmc/cores/VideoPlayer/Buffers/VideoBuffer.h b/xbmc/cores/VideoPlayer/Buffers/VideoBuffer.h
index 1c1ba21c48..73302a62d1 100644
--- a/xbmc/cores/VideoPlayer/Buffers/VideoBuffer.h
+++ b/xbmc/cores/VideoPlayer/Buffers/VideoBuffer.h
@@ -173,8 +173,8 @@ class CVideoBufferManager
{
public:
CVideoBufferManager();
- void RegisterPool(std::shared_ptr<IVideoBufferPool> pool);
- void RegisterPoolFactory(std::string id, CreatePoolFunc createFunc);
+ void RegisterPool(const std::shared_ptr<IVideoBufferPool>& pool);
+ void RegisterPoolFactory(const std::string& id, CreatePoolFunc createFunc);
void ReleasePools();
void ReleasePool(IVideoBufferPool *pool);
CVideoBuffer* Get(AVPixelFormat format, int size, IVideoBufferPool **pPool);
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp
index d883ecb6a5..605d8b308e 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp
@@ -87,7 +87,8 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, CProces
return nullptr;
}
-CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodecHW(std::string id, CProcessInfo &processInfo)
+CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodecHW(const std::string& id,
+ CProcessInfo& processInfo)
{
CSingleLock lock(videoCodecSection);
@@ -100,7 +101,10 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodecHW(std::string id, CProcessInf
return nullptr;
}
-IHardwareDecoder* CDVDFactoryCodec::CreateVideoCodecHWAccel(std::string id, CDVDStreamInfo &hint, CProcessInfo &processInfo, AVPixelFormat fmt)
+IHardwareDecoder* CDVDFactoryCodec::CreateVideoCodecHWAccel(const std::string& id,
+ CDVDStreamInfo& hint,
+ CProcessInfo& processInfo,
+ AVPixelFormat fmt)
{
CSingleLock lock(videoCodecSection);
@@ -114,7 +118,7 @@ IHardwareDecoder* CDVDFactoryCodec::CreateVideoCodecHWAccel(std::string id, CDVD
}
-void CDVDFactoryCodec::RegisterHWVideoCodec(std::string id, CreateHWVideoCodec createFunc)
+void CDVDFactoryCodec::RegisterHWVideoCodec(const std::string& id, CreateHWVideoCodec createFunc)
{
CSingleLock lock(videoCodecSection);
@@ -141,7 +145,7 @@ std::vector<std::string> CDVDFactoryCodec::GetHWAccels()
return ret;
}
-void CDVDFactoryCodec::RegisterHWAccel(std::string id, CreateHWAccel createFunc)
+void CDVDFactoryCodec::RegisterHWAccel(const std::string& id, CreateHWAccel createFunc)
{
CSingleLock lock(videoCodecSection);
@@ -201,7 +205,7 @@ CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodec(CDVDStreamInfo &hint, CProces
return nullptr;
}
-void CDVDFactoryCodec::RegisterHWAudioCodec(std::string id, CreateHWAudioCodec createFunc)
+void CDVDFactoryCodec::RegisterHWAudioCodec(const std::string& id, CreateHWAudioCodec createFunc)
{
CSingleLock lock(audioCodecSection);
@@ -215,7 +219,8 @@ void CDVDFactoryCodec::ClearHWAudioCodecs()
m_hwAudioCodecs.clear();
}
-CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodecHW(std::string id, CProcessInfo &processInfo)
+CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodecHW(const std::string& id,
+ CProcessInfo& processInfo)
{
CSingleLock lock(audioCodecSection);
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h
index 92f076b8a8..a24cc9e7b7 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h
@@ -39,8 +39,10 @@ public:
static CDVDVideoCodec* CreateVideoCodec(CDVDStreamInfo &hint,
CProcessInfo &processInfo);
- static IHardwareDecoder* CreateVideoCodecHWAccel(std::string id, CDVDStreamInfo &hint,
- CProcessInfo &processInfo, AVPixelFormat fmt);
+ static IHardwareDecoder* CreateVideoCodecHWAccel(const std::string& id,
+ CDVDStreamInfo& hint,
+ CProcessInfo& processInfo,
+ AVPixelFormat fmt);
static CDVDAudioCodec* CreateAudioCodec(CDVDStreamInfo &hint, CProcessInfo &processInfo,
bool allowpassthrough, bool allowdtshddecode,
@@ -48,21 +50,20 @@ public:
static CDVDOverlayCodec* CreateOverlayCodec(CDVDStreamInfo &hint);
- static void RegisterHWVideoCodec(std::string id, CreateHWVideoCodec createFunc);
+ static void RegisterHWVideoCodec(const std::string& id, CreateHWVideoCodec createFunc);
static void ClearHWVideoCodecs();
- static void RegisterHWAccel(std::string id, CreateHWAccel createFunc);
+ static void RegisterHWAccel(const std::string& id, CreateHWAccel createFunc);
static std::vector<std::string> GetHWAccels();
static void ClearHWAccels();
- static void RegisterHWAudioCodec(std::string id, CreateHWAudioCodec createFunc);
+ static void RegisterHWAudioCodec(const std::string& id, CreateHWAudioCodec createFunc);
static void ClearHWAudioCodecs();
protected:
-
- static CDVDVideoCodec* CreateVideoCodecHW(std::string id, CProcessInfo &processInfo);
- static CDVDAudioCodec* CreateAudioCodecHW(std::string id, CProcessInfo &processInfo);
+ static CDVDVideoCodec* CreateVideoCodecHW(const std::string& id, CProcessInfo& processInfo);
+ static CDVDAudioCodec* CreateAudioCodecHW(const std::string& id, CProcessInfo& processInfo);
static std::map<std::string, CreateHWVideoCodec> m_hwVideoCodecs;
static std::map<std::string, CreateHWAccel> m_hwAccels;
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp
index 487cfd9f3e..7c0f26339e 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp
@@ -38,6 +38,7 @@
#include <cassert>
#include <memory>
+#include <utility>
#include <vector>
#include <GLES2/gl2.h>
@@ -136,9 +137,9 @@ void CMediaCodecVideoBuffer::Set(int bufferId, int textureId,
{
m_bufferId = bufferId;
m_textureId = textureId;
- m_surfacetexture = surfacetexture;
- m_frameready = frameready;
- m_videoview = videoview;
+ m_surfacetexture = std::move(surfacetexture);
+ m_frameready = std::move(frameready);
+ m_videoview = std::move(videoview);
}
bool CMediaCodecVideoBuffer::WaitForFrame(int millis)
@@ -647,7 +648,9 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio
{
std::vector<CJNIMediaCodecInfoCodecProfileLevel> profileLevels = codec_caps.profileLevels();
if (std::find_if(profileLevels.cbegin(), profileLevels.cend(),
- [&](const CJNIMediaCodecInfoCodecProfileLevel profileLevel){ return profileLevel.profile() == profile; }) == profileLevels.cend())
+ [&](const CJNIMediaCodecInfoCodecProfileLevel& profileLevel) {
+ return profileLevel.profile() == profile;
+ }) == profileLevels.cend())
{
CLog::Log(LOGERROR, "CDVDVideoCodecAndroidMediaCodec::Open: profile not supported: %d", profile);
continue;
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h
index 1f2a90316f..092d45a9af 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h
@@ -20,6 +20,7 @@
#include <atomic>
#include <deque>
#include <memory>
+#include <utility>
#include <vector>
#include <android/native_window.h>
@@ -90,7 +91,8 @@ private:
class CMediaCodecVideoBufferPool : public IVideoBufferPool
{
public:
- CMediaCodecVideoBufferPool(std::shared_ptr<CJNIMediaCodec> mediaCodec) : m_codec(mediaCodec){};
+ CMediaCodecVideoBufferPool(std::shared_ptr<CJNIMediaCodec> mediaCodec)
+ : m_codec(std::move(mediaCodec)){};
~CMediaCodecVideoBufferPool() override;
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h
index 958e1382c7..b1c9de2605 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h
@@ -23,6 +23,7 @@
#include <list>
#include <map>
#include <memory>
+#include <utility>
#include <vector>
#include <va/va.h>
@@ -190,7 +191,8 @@ public:
class COutputControlProtocol : public Protocol
{
public:
- COutputControlProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Protocol(name, inEvent, outEvent) {};
+ COutputControlProtocol(std::string name, CEvent* inEvent, CEvent* outEvent)
+ : Protocol(std::move(name), inEvent, outEvent){};
enum OutSignal
{
INIT,
@@ -209,7 +211,8 @@ public:
class COutputDataProtocol : public Protocol
{
public:
- COutputDataProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Protocol(name, inEvent, outEvent) {};
+ COutputDataProtocol(std::string name, CEvent* inEvent, CEvent* outEvent)
+ : Protocol(std::move(name), inEvent, outEvent){};
enum OutSignal
{
NEWFRAME = 0,
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h
index 8cad33e4c6..af96cd2607 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h
@@ -40,6 +40,7 @@
#include <deque>
#include <list>
#include <map>
+#include <utility>
#include <vector>
#include <X11/Xlib.h>
@@ -241,7 +242,8 @@ public:
class CMixerControlProtocol : public Actor::Protocol
{
public:
- CMixerControlProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Protocol(name, inEvent, outEvent) {};
+ CMixerControlProtocol(std::string name, CEvent* inEvent, CEvent* outEvent)
+ : Protocol(std::move(name), inEvent, outEvent){};
enum OutSignal
{
INIT = 0,
@@ -258,7 +260,8 @@ public:
class CMixerDataProtocol : public Actor::Protocol
{
public:
- CMixerDataProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Protocol(name, inEvent, outEvent) {};
+ CMixerDataProtocol(std::string name, CEvent* inEvent, CEvent* outEvent)
+ : Protocol(std::move(name), inEvent, outEvent){};
enum OutSignal
{
FRAME,
@@ -348,7 +351,8 @@ protected:
class COutputControlProtocol : public Actor::Protocol
{
public:
- COutputControlProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Actor::Protocol(name, inEvent, outEvent) {};
+ COutputControlProtocol(std::string name, CEvent* inEvent, CEvent* outEvent)
+ : Actor::Protocol(std::move(name), inEvent, outEvent){};
enum OutSignal
{
INIT,
@@ -367,7 +371,8 @@ public:
class COutputDataProtocol : public Actor::Protocol
{
public:
- COutputDataProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Actor::Protocol(name, inEvent, outEvent) {};
+ COutputDataProtocol(std::string name, CEvent* inEvent, CEvent* outEvent)
+ : Actor::Protocol(std::move(name), inEvent, outEvent){};
enum OutSignal
{
NEWFRAME = 0,
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.cpp
index f758d0bed7..1951d39c70 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.cpp
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.cpp
@@ -39,7 +39,7 @@ CDVDDemuxBXA::~CDVDDemuxBXA()
Dispose();
}
-bool CDVDDemuxBXA::Open(std::shared_ptr<CDVDInputStream> pInput)
+bool CDVDDemuxBXA::Open(const std::shared_ptr<CDVDInputStream>& pInput)
{
Abort();
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.h
index 4f61128d9e..94fa8c9eb2 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.h
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.h
@@ -43,7 +43,7 @@ public:
CDVDDemuxBXA();
~CDVDDemuxBXA() override;
- bool Open(std::shared_ptr<CDVDInputStream> pInput);
+ bool Open(const std::shared_ptr<CDVDInputStream>& pInput);
void Dispose();
bool Reset() override;
void Abort() override;
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.cpp
index 4e0d754468..15d17f3207 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.cpp
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.cpp
@@ -31,7 +31,7 @@ CDVDDemuxCDDA::~CDVDDemuxCDDA()
Dispose();
}
-bool CDVDDemuxCDDA::Open(std::shared_ptr<CDVDInputStream> pInput)
+bool CDVDDemuxCDDA::Open(const std::shared_ptr<CDVDInputStream>& pInput)
{
Abort();
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.h
index fa65997aff..01b61f1056 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.h
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.h
@@ -25,7 +25,7 @@ public:
CDVDDemuxCDDA();
~CDVDDemuxCDDA() override;
- bool Open(std::shared_ptr<CDVDInputStream> pInput);
+ bool Open(const std::shared_ptr<CDVDInputStream>& pInput);
void Dispose();
bool Reset() override;
void Abort() override;
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp
index b7613b2864..795b9c11e1 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp
@@ -13,6 +13,8 @@
#include "cores/VideoPlayer/Interface/TimingConstants.h"
#include "utils/log.h"
+#include <utility>
+
#define FF_MAX_EXTRADATA_SIZE ((1 << 28) - AV_INPUT_BUFFER_PADDING_SIZE)
class CDemuxStreamClientInternal
@@ -63,7 +65,7 @@ bool CDVDDemuxClient::Open(std::shared_ptr<CDVDInputStream> pInput)
{
Abort();
- m_pInput = pInput;
+ m_pInput = std::move(pInput);
m_IDemux = std::dynamic_pointer_cast<CDVDInputStream::IDemux>(m_pInput);
if (!m_IDemux)
return false;
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
index fc9eae45a1..46e29ba4c3 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
@@ -200,7 +200,7 @@ bool CDVDDemuxFFmpeg::Aborted()
return false;
}
-bool CDVDDemuxFFmpeg::Open(std::shared_ptr<CDVDInputStream> pInput, bool fileinfo)
+bool CDVDDemuxFFmpeg::Open(const std::shared_ptr<CDVDInputStream>& pInput, bool fileinfo)
{
AVInputFormat* iformat = NULL;
std::string strFile;
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h
index a20d9432af..3fe4b507ea 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.h
@@ -83,7 +83,7 @@ public:
CDVDDemuxFFmpeg();
~CDVDDemuxFFmpeg() override;
- bool Open(std::shared_ptr<CDVDInputStream> pInput, bool fileinfo);
+ bool Open(const std::shared_ptr<CDVDInputStream>& pInput, bool fileinfo);
void Dispose();
bool Reset() override ;
void Flush() override;
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.cpp
index 8a02b2c3db..35ba376ad9 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.cpp
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.cpp
@@ -17,7 +17,8 @@
#include "utils/URIUtils.h"
#include "utils/log.h"
-CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(std::shared_ptr<CDVDInputStream> pInputStream, bool fileinfo)
+CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(const std::shared_ptr<CDVDInputStream>& pInputStream,
+ bool fileinfo)
{
if (!pInputStream)
return NULL;
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.h
index e01a972e6a..1d2bddf12b 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.h
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.h
@@ -16,5 +16,6 @@ class CDVDInputStream;
class CDVDFactoryDemuxer
{
public:
- static CDVDDemux* CreateDemuxer(std::shared_ptr<CDVDInputStream> pInputStream, bool fileinfo = false);
+ static CDVDDemux* CreateDemuxer(const std::shared_ptr<CDVDInputStream>& pInputStream,
+ bool fileinfo = false);
};
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMultiSource.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMultiSource.cpp
index 64e0263f51..5de1c4ca99 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMultiSource.cpp
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMultiSource.cpp
@@ -114,7 +114,7 @@ int CDemuxMultiSource::GetStreamLength()
return length;
}
-bool CDemuxMultiSource::Open(std::shared_ptr<CDVDInputStream> pInput)
+bool CDemuxMultiSource::Open(const std::shared_ptr<CDVDInputStream>& pInput)
{
if (!pInput)
return false;
@@ -216,7 +216,7 @@ bool CDemuxMultiSource::SeekTime(double time, bool backwards, double* startpts)
return ret;
}
-void CDemuxMultiSource::SetMissingStreamDetails(DemuxPtr demuxer)
+void CDemuxMultiSource::SetMissingStreamDetails(const DemuxPtr& demuxer)
{
std::string baseFileName = m_pInput->GetFileName();
std::string fileName = demuxer->GetFileName();
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMultiSource.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMultiSource.h
index 0d0c7e5bea..4406fd9607 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMultiSource.h
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxMultiSource.h
@@ -20,7 +20,7 @@
typedef std::shared_ptr<CDVDDemux> DemuxPtr;
struct comparator{
- bool operator() (std::pair<double, DemuxPtr> x, std::pair<double, DemuxPtr> y) const
+ bool operator()(const std::pair<double, DemuxPtr>& x, const std::pair<double, DemuxPtr>& y) const
{
return x.first > y.first;
}
@@ -35,7 +35,7 @@ public:
CDemuxMultiSource();
~CDemuxMultiSource() override;
- bool Open(std::shared_ptr<CDVDInputStream> pInput);
+ bool Open(const std::shared_ptr<CDVDInputStream>& pInput);
// implementation of CDVDDemux
void Abort() override;
@@ -55,7 +55,7 @@ protected:
private:
void Dispose();
- void SetMissingStreamDetails(DemuxPtr demuxer);
+ void SetMissingStreamDetails(const DemuxPtr& demuxer);
std::shared_ptr<InputStreamMultiStreams> m_pInput = NULL;
std::map<DemuxPtr, InputStreamPtr> m_DemuxerToInputStreamMap;
diff --git a/xbmc/cores/VideoPlayer/DVDFileInfo.cpp b/xbmc/cores/VideoPlayer/DVDFileInfo.cpp
index c9f8451a0b..bb0f3996ec 100644
--- a/xbmc/cores/VideoPlayer/DVDFileInfo.cpp
+++ b/xbmc/cores/VideoPlayer/DVDFileInfo.cpp
@@ -349,7 +349,10 @@ bool CDVDFileInfo::GetFileStreamDetails(CFileItem *pItem)
}
}
-bool CDVDFileInfo::DemuxerToStreamDetails(std::shared_ptr<CDVDInputStream> pInputStream, CDVDDemux *pDemuxer, const std::vector<CStreamDetailSubtitle> &subs, CStreamDetails &details)
+bool CDVDFileInfo::DemuxerToStreamDetails(const std::shared_ptr<CDVDInputStream>& pInputStream,
+ CDVDDemux* pDemuxer,
+ const std::vector<CStreamDetailSubtitle>& subs,
+ CStreamDetails& details)
{
bool result = DemuxerToStreamDetails(pInputStream, pDemuxer, details);
for (unsigned int i = 0; i < subs.size(); i++)
@@ -363,7 +366,10 @@ bool CDVDFileInfo::DemuxerToStreamDetails(std::shared_ptr<CDVDInputStream> pInpu
}
/* returns true if details have been added */
-bool CDVDFileInfo::DemuxerToStreamDetails(std::shared_ptr<CDVDInputStream> pInputStream, CDVDDemux *pDemux, CStreamDetails &details, const std::string &path)
+bool CDVDFileInfo::DemuxerToStreamDetails(const std::shared_ptr<CDVDInputStream>& pInputStream,
+ CDVDDemux* pDemux,
+ CStreamDetails& details,
+ const std::string& path)
{
bool retVal = false;
details.Reset();
diff --git a/xbmc/cores/VideoPlayer/DVDFileInfo.h b/xbmc/cores/VideoPlayer/DVDFileInfo.h
index 86e4d59a9f..bb0a7ab1f6 100644
--- a/xbmc/cores/VideoPlayer/DVDFileInfo.h
+++ b/xbmc/cores/VideoPlayer/DVDFileInfo.h
@@ -30,12 +30,18 @@ public:
// Probe the files streams and store the info in the VideoInfoTag
static bool GetFileStreamDetails(CFileItem *pItem);
- static bool DemuxerToStreamDetails(std::shared_ptr<CDVDInputStream> pInputStream, CDVDDemux *pDemux, CStreamDetails &details, const std::string &path = "");
+ static bool DemuxerToStreamDetails(const std::shared_ptr<CDVDInputStream>& pInputStream,
+ CDVDDemux* pDemux,
+ CStreamDetails& details,
+ const std::string& path = "");
/** \brief Probe the file's internal and external streams and store the info in the StreamDetails parameter.
* \param[out] details The file's StreamDetails consisting of internal streams and external subtitle streams.
*/
- static bool DemuxerToStreamDetails(std::shared_ptr<CDVDInputStream> pInputStream, CDVDDemux *pDemuxer, const std::vector<CStreamDetailSubtitle> &subs, CStreamDetails &details);
+ static bool DemuxerToStreamDetails(const std::shared_ptr<CDVDInputStream>& pInputStream,
+ CDVDDemux* pDemuxer,
+ const std::vector<CStreamDetailSubtitle>& subs,
+ CStreamDetails& details);
static bool GetFileDuration(const std::string &path, int &duration);
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h
index a732fc6ea2..270c9bdff3 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h
@@ -186,7 +186,7 @@ public:
virtual ITimes* GetITimes() { return nullptr; }
virtual IChapter* GetIChapter() { return nullptr; }
- const CVariant &GetProperty(const std::string key){ return m_item.GetProperty(key); }
+ const CVariant& GetProperty(const std::string& key) { return m_item.GetProperty(key); }
protected:
DVDStreamType m_streamType;
diff --git a/xbmc/cores/VideoPlayer/DVDOverlayContainer.cpp b/xbmc/cores/VideoPlayer/DVDOverlayContainer.cpp
index 8bfed844a3..756f72419b 100644
--- a/xbmc/cores/VideoPlayer/DVDOverlayContainer.cpp
+++ b/xbmc/cores/VideoPlayer/DVDOverlayContainer.cpp
@@ -157,7 +157,8 @@ bool CDVDOverlayContainer::ContainsOverlayType(DVDOverlayType type)
/*
* iAction should be LIBDVDNAV_BUTTON_NORMAL or LIBDVDNAV_BUTTON_CLICKED
*/
-void CDVDOverlayContainer::UpdateOverlayInfo(std::shared_ptr<CDVDInputStreamNavigator> pStream, CDVDDemuxSPU *pSpu, int iAction)
+void CDVDOverlayContainer::UpdateOverlayInfo(
+ const std::shared_ptr<CDVDInputStreamNavigator>& pStream, CDVDDemuxSPU* pSpu, int iAction)
{
CSingleLock lock(*this);
diff --git a/xbmc/cores/VideoPlayer/DVDOverlayContainer.h b/xbmc/cores/VideoPlayer/DVDOverlayContainer.h
index 6d2e89b5e2..97cc49eb9c 100644
--- a/xbmc/cores/VideoPlayer/DVDOverlayContainer.h
+++ b/xbmc/cores/VideoPlayer/DVDOverlayContainer.h
@@ -43,7 +43,10 @@ public:
void CleanUp(double pts); // validates all overlays against current pts
int GetSize();
- void UpdateOverlayInfo(std::shared_ptr<CDVDInputStreamNavigator> pStream, CDVDDemuxSPU *pSpu, int iAction);
+ void UpdateOverlayInfo(const std::shared_ptr<CDVDInputStreamNavigator>& pStream,
+ CDVDDemuxSPU* pSpu,
+ int iAction);
+
private:
VecOverlaysIter Remove(VecOverlaysIter itOverlay); // removes a specific overlay
diff --git a/xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp b/xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp
index 99d1de5b90..60e6b78bb9 100644
--- a/xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp
+++ b/xbmc/cores/VideoPlayer/Process/ProcessInfo.cpp
@@ -17,7 +17,7 @@
CCriticalSection createSection;
std::map<std::string, CreateProcessControl> CProcessInfo::m_processControls;
-void CProcessInfo::RegisterProcessControl(std::string id, CreateProcessControl createFunc)
+void CProcessInfo::RegisterProcessControl(const std::string& id, CreateProcessControl createFunc)
{
CSingleLock lock(createSection);
diff --git a/xbmc/cores/VideoPlayer/Process/ProcessInfo.h b/xbmc/cores/VideoPlayer/Process/ProcessInfo.h
index 4b71236e0a..0b351af311 100644
--- a/xbmc/cores/VideoPlayer/Process/ProcessInfo.h
+++ b/xbmc/cores/VideoPlayer/Process/ProcessInfo.h
@@ -27,7 +27,7 @@ class CProcessInfo
{
public:
static CProcessInfo* CreateInstance();
- static void RegisterProcessControl(std::string id, CreateProcessControl createFunc);
+ static void RegisterProcessControl(const std::string& id, CreateProcessControl createFunc);
virtual ~CProcessInfo() = default;
void SetDataCache(CDataCacheCore *cache);
diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
index 974dfe8ce7..f2203edb63 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
@@ -390,7 +390,7 @@ int CSelectionStreams::TypeIndexOf(StreamType type, int source, int64_t demuxerI
return -1;
}
-int CSelectionStreams::Source(StreamSource source, std::string filename)
+int CSelectionStreams::Source(StreamSource source, const std::string& filename)
{
int index = source - 1;
for (size_t i=0; i<m_Streams.size(); i++)
@@ -424,7 +424,9 @@ void CSelectionStreams::Update(SelectionStream& s)
}
}
-void CSelectionStreams::Update(std::shared_ptr<CDVDInputStream> input, CDVDDemux* demuxer, std::string filename2)
+void CSelectionStreams::Update(const std::shared_ptr<CDVDInputStream>& input,
+ CDVDDemux* demuxer,
+ const std::string& filename2)
{
if(input && input->IsStreamType(DVDSTREAM_TYPE_DVD))
{
@@ -546,7 +548,7 @@ void CSelectionStreams::Update(std::shared_ptr<CDVDInputStream> input, CDVDDemux
CServiceBroker::GetDataCacheCore().SignalSubtitleInfoChange();
}
-void CSelectionStreams::Update(std::shared_ptr<CDVDInputStream> input, CDVDDemux* demuxer)
+void CSelectionStreams::Update(const std::shared_ptr<CDVDInputStream>& input, CDVDDemux* demuxer)
{
Update(input, demuxer, "");
}
diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.h b/xbmc/cores/VideoPlayer/VideoPlayer.h
index 7afeacd846..75dc2a9050 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayer.h
+++ b/xbmc/cores/VideoPlayer/VideoPlayer.h
@@ -207,10 +207,12 @@ public:
SelectionStream& Get(StreamType type, int index);
bool Get(StreamType type, StreamFlags flag, SelectionStream& out);
void Clear(StreamType type, StreamSource source);
- int Source(StreamSource source, std::string filename);
+ int Source(StreamSource source, const std::string& filename);
void Update(SelectionStream& s);
- void Update(std::shared_ptr<CDVDInputStream> input, CDVDDemux* demuxer);
- void Update(std::shared_ptr<CDVDInputStream> input, CDVDDemux* demuxer, std::string filename2);
+ void Update(const std::shared_ptr<CDVDInputStream>& input, CDVDDemux* demuxer);
+ void Update(const std::shared_ptr<CDVDInputStream>& input,
+ CDVDDemux* demuxer,
+ const std::string& filename2);
std::vector<SelectionStream> Get(StreamType type);
template<typename Compare> std::vector<SelectionStream> Get(StreamType type, Compare compare)
diff --git a/xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.cpp b/xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.cpp
index 20b50e0a44..da1267e01c 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.cpp
@@ -723,7 +723,7 @@ std::string CDVDRadioRDSData::GetRadioText(unsigned int line)
return str;
}
-void CDVDRadioRDSData::SetRadioStyle(std::string genre)
+void CDVDRadioRDSData::SetRadioStyle(const std::string& genre)
{
g_application.CurrentFileItem().GetMusicInfoTag()->SetGenre(genre);
m_currentInfoTag->SetProgStyle(genre);
diff --git a/xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.h b/xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.h
index fc5a83cab4..f3dd30271d 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.h
+++ b/xbmc/cores/VideoPlayer/VideoPlayerRadioRDS.h
@@ -85,7 +85,7 @@ private:
inline unsigned int DecodeTDC(uint8_t *msgElement, unsigned int len);
void SendTMCSignal(unsigned int flags, uint8_t *data);
- void SetRadioStyle(std::string genre);
+ void SetRadioStyle(const std::string& genre);
std::shared_ptr<PVR::CPVRRadioRDSInfoTag> m_currentInfoTag;
std::shared_ptr<PVR::CPVRChannel> m_currentChannel;
diff --git a/xbmc/cores/VideoPlayer/VideoPlayerSubtitle.h b/xbmc/cores/VideoPlayer/VideoPlayerSubtitle.h
index cbf0a38a27..b4231cbbd5 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayerSubtitle.h
+++ b/xbmc/cores/VideoPlayer/VideoPlayerSubtitle.h
@@ -32,7 +32,10 @@ public:
void FindSubtitles(const char* strFilename);
int GetSubtitleCount();
- void UpdateOverlayInfo(std::shared_ptr<CDVDInputStreamNavigator> pStream, int iAction) { m_pOverlayContainer->UpdateOverlayInfo(pStream, &m_dvdspus, iAction); }
+ void UpdateOverlayInfo(const std::shared_ptr<CDVDInputStreamNavigator>& pStream, int iAction)
+ {
+ m_pOverlayContainer->UpdateOverlayInfo(pStream, &m_dvdspus, iAction);
+ }
bool AcceptsData() const override;
void SendMessage(CDVDMsg* pMsg, int priority = 0) override;
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp
index cbb09fe248..8c78f1beac 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp
@@ -483,7 +483,11 @@ void CBaseRenderer::SetVideoSettings(const CVideoSettings &settings)
m_videoSettings = settings;
}
-void CBaseRenderer::SettingOptionsRenderMethodsFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CBaseRenderer::SettingOptionsRenderMethodsFiller(
+ const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
list.emplace_back(g_localizeStrings.Get(13416), RENDER_METHOD_AUTO);
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.h
index 090e45c1e6..7f9864d268 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.h
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.h
@@ -85,7 +85,10 @@ public:
void GetVideoRect(CRect &source, CRect &dest, CRect &view);
float GetAspectRatio() const;
- static void SettingOptionsRenderMethodsFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
+ static void SettingOptionsRenderMethodsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
void SetVideoSettings(const CVideoSettings &settings);
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.cpp
index d33a1c65fe..a54bb76b0a 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.cpp
@@ -311,7 +311,7 @@ struct H3DLUT
// and by the array 'lutDataxx', of length 'lutCompressedSize'.
};
-bool CColorManager::Probe3dLut(const std::string filename, int *clutSize)
+bool CColorManager::Probe3dLut(const std::string& filename, int* clutSize)
{
struct H3DLUT header;
CFile lutFile;
@@ -362,7 +362,10 @@ bool CColorManager::Probe3dLut(const std::string filename, int *clutSize)
return true;
}
-bool CColorManager::Load3dLut(const std::string filename, CMS_DATA_FORMAT format, int CLUTsize, uint16_t *clutData)
+bool CColorManager::Load3dLut(const std::string& filename,
+ CMS_DATA_FORMAT format,
+ int CLUTsize,
+ uint16_t* clutData)
{
struct H3DLUT header;
CFile lutFile;
@@ -418,7 +421,7 @@ bool CColorManager::Load3dLut(const std::string filename, CMS_DATA_FORMAT format
#if defined(HAVE_LCMS2)
// ICC profile support
-cmsHPROFILE CColorManager::LoadIccDisplayProfile(const std::string filename)
+cmsHPROFILE CColorManager::LoadIccDisplayProfile(const std::string& filename)
{
cmsHPROFILE hProfile;
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.h b/xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.h
index a6c50ea3bb..3fae32c023 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.h
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/ColorManager.h
@@ -114,7 +114,7 @@ private:
\param clutSize pointer to CLUT resolution
\return true if the file can be loaded, false otherwise
*/
- static bool Probe3dLut(const std::string filename, int *clutSize);
+ static bool Probe3dLut(const std::string& filename, int* clutSize);
/*! \brief Load a .3dlut file
\param filename full path and filename
@@ -123,7 +123,10 @@ private:
\param clutData pointer to CLUT data
\return true on success, false otherwise
*/
- static bool Load3dLut(const std::string filename, CMS_DATA_FORMAT format, int clutSize, uint16_t *clutData);
+ static bool Load3dLut(const std::string& filename,
+ CMS_DATA_FORMAT format,
+ int clutSize,
+ uint16_t* clutData);
#if defined(HAVE_LCMS2)
@@ -136,7 +139,7 @@ private:
\param filename full path and filename
\return display profile (cmsHPROFILE)
*/
- cmsHPROFILE LoadIccDisplayProfile(const std::string filename);
+ cmsHPROFILE LoadIccDisplayProfile(const std::string& filename);
/* \brief Load an ICC device link
\param filename full path and filename
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
index 4f72f602d1..1f514c659a 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
@@ -12,10 +12,13 @@
#include "utils/log.h"
#include "windowing/gbm/drm/DRMAtomic.h"
+#include <utility>
+
using namespace KODI::WINDOWING::GBM;
using namespace DRMPRIME;
-CVideoLayerBridgeDRMPRIME::CVideoLayerBridgeDRMPRIME(std::shared_ptr<CDRMAtomic> drm) : m_DRM(drm)
+CVideoLayerBridgeDRMPRIME::CVideoLayerBridgeDRMPRIME(std::shared_ptr<CDRMAtomic> drm)
+ : m_DRM(std::move(drm))
{
}
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFactory.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFactory.cpp
index 8c3127b0d3..015b4dbf0e 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFactory.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFactory.cpp
@@ -15,7 +15,7 @@ using namespace VIDEOPLAYER;
CCriticalSection renderSection;
std::map<std::string, VIDEOPLAYER::CreateRenderer> CRendererFactory::m_renderers;
-CBaseRenderer* CRendererFactory::CreateRenderer(std::string id, CVideoBuffer *buffer)
+CBaseRenderer* CRendererFactory::CreateRenderer(const std::string& id, CVideoBuffer* buffer)
{
CSingleLock lock(renderSection);
@@ -41,7 +41,7 @@ std::vector<std::string> CRendererFactory::GetRenderers()
return ret;
}
-void CRendererFactory::RegisterRenderer(std::string id, ::CreateRenderer createFunc)
+void CRendererFactory::RegisterRenderer(const std::string& id, ::CreateRenderer createFunc)
{
CSingleLock lock(renderSection);
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFactory.h b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFactory.h
index f6b307f0d4..59b55610c1 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFactory.h
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFactory.h
@@ -22,9 +22,9 @@ typedef CBaseRenderer* (*CreateRenderer)(CVideoBuffer *buffer);
class CRendererFactory
{
public:
- static CBaseRenderer* CreateRenderer(std::string id, CVideoBuffer *buffer);
+ static CBaseRenderer* CreateRenderer(const std::string& id, CVideoBuffer* buffer);
- static void RegisterRenderer(std::string id, VIDEOPLAYER::CreateRenderer createFunc);
+ static void RegisterRenderer(const std::string& id, VIDEOPLAYER::CreateRenderer createFunc);
static std::vector<std::string> GetRenderers();
static void ClearRenderer();
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.cpp
index 54c0fb3189..cff71f037f 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.cpp
@@ -20,6 +20,7 @@
#include <sstream>
#include <string>
+#include <utility>
using namespace Shaders;
@@ -41,7 +42,7 @@ BaseYUV2RGBGLSLShader::BaseYUV2RGBGLSLShader(bool rect, EShaderFormat format, bo
m_stretch = 0.0f;
// get defines from the output stage if used
- m_glslOutput = output;
+ m_glslOutput = std::move(output);
if (m_glslOutput)
{
m_defines += m_glslOutput->GetDefines();
@@ -223,11 +224,15 @@ void BaseYUV2RGBGLSLShader::SetDisplayMetadata(bool hasDisplayMetadata, AVMaster
// Use for weave deinterlacing / progressive
//////////////////////////////////////////////////////////////////////
-YUV2RGBProgressiveShader::YUV2RGBProgressiveShader(bool rect, EShaderFormat format, bool stretch,
- AVColorPrimaries dstPrimaries, AVColorPrimaries srcPrimaries,
+YUV2RGBProgressiveShader::YUV2RGBProgressiveShader(bool rect,
+ EShaderFormat format,
+ bool stretch,
+ AVColorPrimaries dstPrimaries,
+ AVColorPrimaries srcPrimaries,
bool toneMap,
std::shared_ptr<GLSLOutput> output)
- : BaseYUV2RGBGLSLShader(rect, format, stretch, dstPrimaries, srcPrimaries, toneMap, output)
+ : BaseYUV2RGBGLSLShader(
+ rect, format, stretch, dstPrimaries, srcPrimaries, toneMap, std::move(output))
{
PixelShader()->LoadSource("gl_yuv2rgb_basic.glsl", m_defines);
PixelShader()->AppendSource("gl_output.glsl");
@@ -242,11 +247,13 @@ YUV2RGBProgressiveShader::YUV2RGBProgressiveShader(bool rect, EShaderFormat form
YUV2RGBFilterShader4::YUV2RGBFilterShader4(bool rect,
EShaderFormat format,
bool stretch,
- AVColorPrimaries dstPrimaries, AVColorPrimaries srcPrimaries,
+ AVColorPrimaries dstPrimaries,
+ AVColorPrimaries srcPrimaries,
bool toneMap,
ESCALINGMETHOD method,
std::shared_ptr<GLSLOutput> output)
-: BaseYUV2RGBGLSLShader(rect, format, stretch, dstPrimaries, srcPrimaries, toneMap, output)
+ : BaseYUV2RGBGLSLShader(
+ rect, format, stretch, dstPrimaries, srcPrimaries, toneMap, std::move(output))
{
m_scaling = method;
PixelShader()->LoadSource("gl_yuv2rgb_filter4.glsl", m_defines);
diff --git a/xbmc/cores/playercorefactory/PlayerCoreConfig.h b/xbmc/cores/playercorefactory/PlayerCoreConfig.h
index baeebafdb5..92742cdcd5 100644
--- a/xbmc/cores/playercorefactory/PlayerCoreConfig.h
+++ b/xbmc/cores/playercorefactory/PlayerCoreConfig.h
@@ -8,26 +8,29 @@
#pragma once
-#include "utils/XBMCTinyXML.h"
+#include "cores/ExternalPlayer/ExternalPlayer.h"
#include "cores/IPlayer.h"
+#include "cores/RetroPlayer/RetroPlayer.h"
#include "cores/VideoPlayer/VideoPlayer.h"
#include "cores/paplayer/PAPlayer.h"
-#include "cores/RetroPlayer/RetroPlayer.h"
-#include "cores/ExternalPlayer/ExternalPlayer.h"
#ifdef HAS_UPNP
#include "network/upnp/UPnPPlayer.h"
#endif
-#include "system.h"
+#include "utils/XBMCTinyXML.h"
#include "utils/log.h"
+#include <utility>
+
+#include "system.h"
+
class CPlayerCoreConfig
{
public:
-
- CPlayerCoreConfig(std::string name, std::string type, const TiXmlElement* pConfig, const std::string& id = ""):
- m_name(name),
- m_id(id),
- m_type(type)
+ CPlayerCoreConfig(std::string name,
+ std::string type,
+ const TiXmlElement* pConfig,
+ const std::string& id = "")
+ : m_name(std::move(name)), m_id(id), m_type(std::move(type))
{
m_bPlaysAudio = false;
m_bPlaysVideo = false;
diff --git a/xbmc/dialogs/GUIDialogBoxBase.cpp b/xbmc/dialogs/GUIDialogBoxBase.cpp
index b6daba3ccf..203c4331f6 100644
--- a/xbmc/dialogs/GUIDialogBoxBase.cpp
+++ b/xbmc/dialogs/GUIDialogBoxBase.cpp
@@ -48,7 +48,7 @@ bool CGUIDialogBoxBase::IsConfirmed() const
return m_bConfirmed;
}
-void CGUIDialogBoxBase::SetHeading(CVariant heading)
+void CGUIDialogBoxBase::SetHeading(const CVariant& heading)
{
std::string label = GetLocalized(heading);
CSingleLock lock(m_section);
@@ -59,7 +59,7 @@ void CGUIDialogBoxBase::SetHeading(CVariant heading)
}
}
-void CGUIDialogBoxBase::SetLine(unsigned int iLine, CVariant line)
+void CGUIDialogBoxBase::SetLine(unsigned int iLine, const CVariant& line)
{
std::string label = GetLocalized(line);
CSingleLock lock(m_section);
@@ -71,7 +71,7 @@ void CGUIDialogBoxBase::SetLine(unsigned int iLine, CVariant line)
SetText(text);
}
-void CGUIDialogBoxBase::SetText(CVariant text)
+void CGUIDialogBoxBase::SetText(const CVariant& text)
{
std::string label = GetLocalized(text);
CSingleLock lock(m_section);
diff --git a/xbmc/dialogs/GUIDialogBoxBase.h b/xbmc/dialogs/GUIDialogBoxBase.h
index 89ffea896a..41ab31b2aa 100644
--- a/xbmc/dialogs/GUIDialogBoxBase.h
+++ b/xbmc/dialogs/GUIDialogBoxBase.h
@@ -32,9 +32,9 @@ public:
~CGUIDialogBoxBase(void) override;
bool OnMessage(CGUIMessage& message) override;
bool IsConfirmed() const;
- void SetLine(unsigned int iLine, CVariant line);
- void SetText(CVariant text);
- void SetHeading(CVariant heading);
+ void SetLine(unsigned int iLine, const CVariant& line);
+ void SetText(const CVariant& text);
+ void SetHeading(const CVariant& heading);
void SetChoice(int iButton, const CVariant &choice);
protected:
std::string GetDefaultLabel(int controlId) const;
diff --git a/xbmc/dialogs/GUIDialogMediaFilter.cpp b/xbmc/dialogs/GUIDialogMediaFilter.cpp
index b862f14958..04d267b212 100644
--- a/xbmc/dialogs/GUIDialogMediaFilter.cpp
+++ b/xbmc/dialogs/GUIDialogMediaFilter.cpp
@@ -217,7 +217,7 @@ void CGUIDialogMediaFilter::OnInitWindow()
UpdateControls();
}
-void CGUIDialogMediaFilter::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogMediaFilter::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
CGUIDialogSettingsManualBase::OnSettingChanged(setting);
@@ -739,7 +739,10 @@ void CGUIDialogMediaFilter::DeleteRule(Field field)
}
}
-void CGUIDialogMediaFilter::GetStringListOptions(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CGUIDialogMediaFilter::GetStringListOptions(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
if (setting == NULL || data == NULL)
return;
diff --git a/xbmc/dialogs/GUIDialogMediaFilter.h b/xbmc/dialogs/GUIDialogMediaFilter.h
index 70aa8474d7..dd87b034e7 100644
--- a/xbmc/dialogs/GUIDialogMediaFilter.h
+++ b/xbmc/dialogs/GUIDialogMediaFilter.h
@@ -55,7 +55,7 @@ protected:
void OnInitWindow() override;
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
@@ -79,7 +79,10 @@ protected:
CSmartPlaylistRule* AddRule(Field field, CDatabaseQueryRule::SEARCH_OPERATOR ruleOperator = CDatabaseQueryRule::OPERATOR_CONTAINS);
void DeleteRule(Field field);
- static void GetStringListOptions(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
+ static void GetStringListOptions(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
CDbUrl* m_dbUrl;
std::string m_mediaType;
diff --git a/xbmc/dialogs/GUIDialogOK.cpp b/xbmc/dialogs/GUIDialogOK.cpp
index b004a8efab..af626dc292 100644
--- a/xbmc/dialogs/GUIDialogOK.cpp
+++ b/xbmc/dialogs/GUIDialogOK.cpp
@@ -37,7 +37,7 @@ bool CGUIDialogOK::OnMessage(CGUIMessage& message)
}
// \brief Show CGUIDialogOK dialog, then wait for user to dismiss it.
-bool CGUIDialogOK::ShowAndGetInput(CVariant heading, CVariant text)
+bool CGUIDialogOK::ShowAndGetInput(const CVariant& heading, const CVariant& text)
{
CGUIDialogOK *dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogOK>(WINDOW_DIALOG_OK);
if (!dialog)
@@ -49,7 +49,10 @@ bool CGUIDialogOK::ShowAndGetInput(CVariant heading, CVariant text)
}
// \brief Show CGUIDialogOK dialog, then wait for user to dismiss it.
-bool CGUIDialogOK::ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2)
+bool CGUIDialogOK::ShowAndGetInput(const CVariant& heading,
+ const CVariant& line0,
+ const CVariant& line1,
+ const CVariant& line2)
{
CGUIDialogOK *dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogOK>(WINDOW_DIALOG_OK);
if (!dialog)
diff --git a/xbmc/dialogs/GUIDialogOK.h b/xbmc/dialogs/GUIDialogOK.h
index 6bb940cc51..94678e3251 100644
--- a/xbmc/dialogs/GUIDialogOK.h
+++ b/xbmc/dialogs/GUIDialogOK.h
@@ -23,8 +23,11 @@ public:
CGUIDialogOK(void);
~CGUIDialogOK(void) override;
bool OnMessage(CGUIMessage& message) override;
- static bool ShowAndGetInput(CVariant heading, CVariant text);
- static bool ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2);
+ static bool ShowAndGetInput(const CVariant& heading, const CVariant& text);
+ static bool ShowAndGetInput(const CVariant& heading,
+ const CVariant& line0,
+ const CVariant& line1,
+ const CVariant& line2);
/*!
\brief Open a OK dialog and wait for input
diff --git a/xbmc/dialogs/GUIDialogPlayEject.cpp b/xbmc/dialogs/GUIDialogPlayEject.cpp
index 094c58386c..14ee2bc0d3 100644
--- a/xbmc/dialogs/GUIDialogPlayEject.cpp
+++ b/xbmc/dialogs/GUIDialogPlayEject.cpp
@@ -73,8 +73,8 @@ void CGUIDialogPlayEject::OnInitWindow()
CGUIDialogYesNo::OnInitWindow();
}
-bool CGUIDialogPlayEject::ShowAndGetInput(const std::string strLine1,
- const std::string strLine2,
+bool CGUIDialogPlayEject::ShowAndGetInput(const std::string& strLine1,
+ const std::string& strLine2,
unsigned int uiAutoCloseTime /* = 0 */)
{
diff --git a/xbmc/dialogs/GUIDialogPlayEject.h b/xbmc/dialogs/GUIDialogPlayEject.h
index bed73dc67c..c8ae319bd4 100644
--- a/xbmc/dialogs/GUIDialogPlayEject.h
+++ b/xbmc/dialogs/GUIDialogPlayEject.h
@@ -19,8 +19,8 @@ public:
bool OnMessage(CGUIMessage& message) override;
void FrameMove() override;
- static bool ShowAndGetInput(const std::string strLine1,
- const std::string strLine2,
+ static bool ShowAndGetInput(const std::string& strLine1,
+ const std::string& strLine2,
unsigned int uiAutoCloseTime = 0);
protected:
diff --git a/xbmc/dialogs/GUIDialogSelect.cpp b/xbmc/dialogs/GUIDialogSelect.cpp
index d8d3ff4aaa..c0d41f8a87 100644
--- a/xbmc/dialogs/GUIDialogSelect.cpp
+++ b/xbmc/dialogs/GUIDialogSelect.cpp
@@ -295,7 +295,7 @@ void CGUIDialogSelect::SetSelected(const std::string &strSelectedLabel)
}
}
-void CGUIDialogSelect::SetSelected(std::vector<int> selectedIndexes)
+void CGUIDialogSelect::SetSelected(const std::vector<int>& selectedIndexes)
{
for (auto i : selectedIndexes)
SetSelected(i);
diff --git a/xbmc/dialogs/GUIDialogSelect.h b/xbmc/dialogs/GUIDialogSelect.h
index 2fa3286c63..ab91163e44 100644
--- a/xbmc/dialogs/GUIDialogSelect.h
+++ b/xbmc/dialogs/GUIDialogSelect.h
@@ -41,7 +41,7 @@ public:
void Sort(bool bSortOrder = true);
void SetSelected(int iSelected);
void SetSelected(const std::string &strSelectedLabel);
- void SetSelected(std::vector<int> selectedIndexes);
+ void SetSelected(const std::vector<int>& selectedIndexes);
void SetSelected(const std::vector<std::string> &selectedLabels);
void SetUseDetails(bool useDetails);
void SetMultiSelection(bool multiSelection);
diff --git a/xbmc/dialogs/GUIDialogYesNo.cpp b/xbmc/dialogs/GUIDialogYesNo.cpp
index 9cca48e662..9b689b0254 100644
--- a/xbmc/dialogs/GUIDialogYesNo.cpp
+++ b/xbmc/dialogs/GUIDialogYesNo.cpp
@@ -78,18 +78,34 @@ void CGUIDialogYesNo::OnInitWindow()
CGUIDialogBoxBase::OnInitWindow();
}
-bool CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2, bool &bCanceled)
+bool CGUIDialogYesNo::ShowAndGetInput(const CVariant& heading,
+ const CVariant& line0,
+ const CVariant& line1,
+ const CVariant& line2,
+ bool& bCanceled)
{
return ShowAndGetInput(heading, line0, line1, line2, bCanceled, "", "", NO_TIMEOUT);
}
-bool CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2, CVariant noLabel /* = "" */, CVariant yesLabel /* = "" */)
+bool CGUIDialogYesNo::ShowAndGetInput(const CVariant& heading,
+ const CVariant& line0,
+ const CVariant& line1,
+ const CVariant& line2,
+ const CVariant& noLabel /* = "" */,
+ const CVariant& yesLabel /* = "" */)
{
bool bDummy(false);
return ShowAndGetInput(heading, line0, line1, line2, bDummy, noLabel, yesLabel, NO_TIMEOUT);
}
-bool CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2, bool &bCanceled, CVariant noLabel, CVariant yesLabel, unsigned int autoCloseTime)
+bool CGUIDialogYesNo::ShowAndGetInput(const CVariant& heading,
+ const CVariant& line0,
+ const CVariant& line1,
+ const CVariant& line2,
+ bool& bCanceled,
+ const CVariant& noLabel,
+ const CVariant& yesLabel,
+ unsigned int autoCloseTime)
{
CGUIDialogYesNo *dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogYesNo>(WINDOW_DIALOG_YES_NO);
if (!dialog)
@@ -111,13 +127,18 @@ bool CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant line0, CVariant
return (dialog->IsConfirmed()) ? true : false;
}
-bool CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant text)
+bool CGUIDialogYesNo::ShowAndGetInput(const CVariant& heading, const CVariant& text)
{
bool bDummy(false);
return ShowAndGetInput(heading, text, "", "", bDummy);
}
-bool CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant text, bool &bCanceled, CVariant noLabel /* = "" */, CVariant yesLabel /* = "" */, unsigned int autoCloseTime)
+bool CGUIDialogYesNo::ShowAndGetInput(const CVariant& heading,
+ const CVariant& text,
+ bool& bCanceled,
+ const CVariant& noLabel /* = "" */,
+ const CVariant& yesLabel /* = "" */,
+ unsigned int autoCloseTime)
{
int result = ShowAndGetInput(heading, text, noLabel, yesLabel, "", autoCloseTime);
@@ -145,7 +166,12 @@ int CGUIDialogYesNo::GetResult() const
return 0;
}
-int CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant text, CVariant noLabel, CVariant yesLabel, CVariant customLabel, unsigned int autoCloseTime)
+int CGUIDialogYesNo::ShowAndGetInput(const CVariant& heading,
+ const CVariant& text,
+ const CVariant& noLabel,
+ const CVariant& yesLabel,
+ const CVariant& customLabel,
+ unsigned int autoCloseTime)
{
CGUIDialogYesNo *dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogYesNo>(WINDOW_DIALOG_YES_NO);
if (!dialog)
diff --git a/xbmc/dialogs/GUIDialogYesNo.h b/xbmc/dialogs/GUIDialogYesNo.h
index be049c04c9..45c5c8aadc 100644
--- a/xbmc/dialogs/GUIDialogYesNo.h
+++ b/xbmc/dialogs/GUIDialogYesNo.h
@@ -47,7 +47,11 @@ public:
\param bCanceled Holds true if the dialog was canceled otherwise false
\return true if user selects Yes, otherwise false if user selects No.
*/
- static bool ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2, bool &bCanceled);
+ static bool ShowAndGetInput(const CVariant& heading,
+ const CVariant& line0,
+ const CVariant& line1,
+ const CVariant& line2,
+ bool& bCanceled);
/*! \brief Show a yes-no dialog, then wait for user to dismiss it.
\param heading Localized label id or string for the heading of the dialog
@@ -58,7 +62,12 @@ public:
\param iYesLabel Localized label id or string for the yes button
\return true if user selects Yes, otherwise false if user selects No.
*/
- static bool ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2, CVariant noLabel = "", CVariant yesLabel = "");
+ static bool ShowAndGetInput(const CVariant& heading,
+ const CVariant& line0,
+ const CVariant& line1,
+ const CVariant& line2,
+ const CVariant& noLabel = "",
+ const CVariant& yesLabel = "");
/*! \brief Show a yes-no dialog, then wait for user to dismiss it.
\param heading Localized label id or string for the heading of the dialog
@@ -71,14 +80,21 @@ public:
\param autoCloseTime Time in ms before the dialog becomes automatically closed
\return true if user selects Yes, otherwise false if user selects No.
*/
- static bool ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2, bool &bCanceled, CVariant noLabel, CVariant yesLabel, unsigned int autoCloseTime);
+ static bool ShowAndGetInput(const CVariant& heading,
+ const CVariant& line0,
+ const CVariant& line1,
+ const CVariant& line2,
+ bool& bCanceled,
+ const CVariant& noLabel,
+ const CVariant& yesLabel,
+ unsigned int autoCloseTime);
/*! \brief Show a yes-no dialog, then wait for user to dismiss it.
\param heading Localized label id or string for the heading of the dialog
\param text Localized label id or string for the dialog message
\return true if user selects Yes, otherwise false if user selects No.
*/
- static bool ShowAndGetInput(CVariant heading, CVariant text);
+ static bool ShowAndGetInput(const CVariant& heading, const CVariant& text);
/*! \brief Show a yes-no dialog, then wait for user to dismiss it.
\param heading Localized label id or string for the heading of the dialog
@@ -89,7 +105,12 @@ public:
\param autoCloseTime Time in ms before the dialog becomes automatically closed
\return true if user selects Yes, otherwise false if user selects No.
*/
- static bool ShowAndGetInput(CVariant heading, CVariant text, bool &bCanceled, CVariant noLabel, CVariant yesLabel, unsigned int autoCloseTime);
+ static bool ShowAndGetInput(const CVariant& heading,
+ const CVariant& text,
+ bool& bCanceled,
+ const CVariant& noLabel,
+ const CVariant& yesLabel,
+ unsigned int autoCloseTime);
/*! \brief Show a yes-no dialog with 3rd custom button, then wait for user to dismiss it.
\param heading Localized label id or string for the heading of the dialog
@@ -100,7 +121,12 @@ public:
\param autoCloseTime Time in ms before the dialog becomes automatically closed
\return -1 for cancelled, 0 for No, 1 for Yes and 2 for custom button
*/
- static int ShowAndGetInput(CVariant heading, CVariant text, CVariant noLabel, CVariant yesLabel, CVariant customLabel, unsigned int autoCloseTime);
+ static int ShowAndGetInput(const CVariant& heading,
+ const CVariant& text,
+ const CVariant& noLabel,
+ const CVariant& yesLabel,
+ const CVariant& customLabel,
+ unsigned int autoCloseTime);
/*!
\brief Open a Yes/No dialog and wait for input
diff --git a/xbmc/events/AddonEvent.cpp b/xbmc/events/AddonEvent.cpp
index 6b97e64e5c..459c37d7dc 100644
--- a/xbmc/events/AddonEvent.cpp
+++ b/xbmc/events/AddonEvent.cpp
@@ -8,32 +8,41 @@
#include "AddonEvent.h"
-CAddonEvent::CAddonEvent(ADDON::AddonPtr addon, const CVariant& description)
- : CUniqueEvent(addon->Name(), description, addon->Icon()),
- m_addon(addon)
+CAddonEvent::CAddonEvent(const ADDON::AddonPtr& addon, const CVariant& description)
+ : CUniqueEvent(addon->Name(), description, addon->Icon()), m_addon(addon)
{ }
-CAddonEvent::CAddonEvent(ADDON::AddonPtr addon, const CVariant& description, const CVariant& details)
- : CUniqueEvent(addon->Name(), description, addon->Icon(), details),
- m_addon(addon)
+CAddonEvent::CAddonEvent(const ADDON::AddonPtr& addon,
+ const CVariant& description,
+ const CVariant& details)
+ : CUniqueEvent(addon->Name(), description, addon->Icon(), details), m_addon(addon)
{ }
-CAddonEvent::CAddonEvent(ADDON::AddonPtr addon, const CVariant& description, const CVariant& details, const CVariant& executionLabel)
- : CUniqueEvent(addon->Name(), description, addon->Icon(), details, executionLabel),
- m_addon(addon)
+CAddonEvent::CAddonEvent(const ADDON::AddonPtr& addon,
+ const CVariant& description,
+ const CVariant& details,
+ const CVariant& executionLabel)
+ : CUniqueEvent(addon->Name(), description, addon->Icon(), details, executionLabel), m_addon(addon)
{ }
-CAddonEvent::CAddonEvent(ADDON::AddonPtr addon, EventLevel level, const CVariant& description)
- : CUniqueEvent(addon->Name(), description, addon->Icon(), level),
- m_addon(addon)
+CAddonEvent::CAddonEvent(const ADDON::AddonPtr& addon,
+ EventLevel level,
+ const CVariant& description)
+ : CUniqueEvent(addon->Name(), description, addon->Icon(), level), m_addon(addon)
{ }
-CAddonEvent::CAddonEvent(ADDON::AddonPtr addon, EventLevel level, const CVariant& description, const CVariant& details)
- : CUniqueEvent(addon->Name(), description, addon->Icon(), details, level),
- m_addon(addon)
+CAddonEvent::CAddonEvent(const ADDON::AddonPtr& addon,
+ EventLevel level,
+ const CVariant& description,
+ const CVariant& details)
+ : CUniqueEvent(addon->Name(), description, addon->Icon(), details, level), m_addon(addon)
{ }
-CAddonEvent::CAddonEvent(ADDON::AddonPtr addon, EventLevel level, const CVariant& description, const CVariant& details, const CVariant& executionLabel)
+CAddonEvent::CAddonEvent(const ADDON::AddonPtr& addon,
+ EventLevel level,
+ const CVariant& description,
+ const CVariant& details,
+ const CVariant& executionLabel)
: CUniqueEvent(addon->Name(), description, addon->Icon(), details, executionLabel, level),
- m_addon(addon)
+ m_addon(addon)
{ }
diff --git a/xbmc/events/AddonEvent.h b/xbmc/events/AddonEvent.h
index d449c2727c..84154f1c04 100644
--- a/xbmc/events/AddonEvent.h
+++ b/xbmc/events/AddonEvent.h
@@ -14,12 +14,22 @@
class CAddonEvent : public CUniqueEvent
{
public:
- CAddonEvent(ADDON::AddonPtr addon, const CVariant& description);
- CAddonEvent(ADDON::AddonPtr addon, const CVariant& description, const CVariant& details);
- CAddonEvent(ADDON::AddonPtr addon, const CVariant& description, const CVariant& details, const CVariant& executionLabel);
- CAddonEvent(ADDON::AddonPtr addon, EventLevel level, const CVariant& description);
- CAddonEvent(ADDON::AddonPtr addon, EventLevel level, const CVariant& description, const CVariant& details);
- CAddonEvent(ADDON::AddonPtr addon, EventLevel level, const CVariant& description, const CVariant& details, const CVariant& executionLabel);
+ CAddonEvent(const ADDON::AddonPtr& addon, const CVariant& description);
+ CAddonEvent(const ADDON::AddonPtr& addon, const CVariant& description, const CVariant& details);
+ CAddonEvent(const ADDON::AddonPtr& addon,
+ const CVariant& description,
+ const CVariant& details,
+ const CVariant& executionLabel);
+ CAddonEvent(const ADDON::AddonPtr& addon, EventLevel level, const CVariant& description);
+ CAddonEvent(const ADDON::AddonPtr& addon,
+ EventLevel level,
+ const CVariant& description,
+ const CVariant& details);
+ CAddonEvent(const ADDON::AddonPtr& addon,
+ EventLevel level,
+ const CVariant& description,
+ const CVariant& details,
+ const CVariant& executionLabel);
~CAddonEvent() override = default;
const char* GetType() const override { return "AddonEvent"; }
diff --git a/xbmc/events/AddonManagementEvent.cpp b/xbmc/events/AddonManagementEvent.cpp
index 429ded5c1c..6d97915a36 100644
--- a/xbmc/events/AddonManagementEvent.cpp
+++ b/xbmc/events/AddonManagementEvent.cpp
@@ -13,27 +13,42 @@
#include "guilib/LocalizeStrings.h"
#include "utils/URIUtils.h"
-CAddonManagementEvent::CAddonManagementEvent(ADDON::AddonPtr addon, const CVariant& description)
+CAddonManagementEvent::CAddonManagementEvent(const ADDON::AddonPtr& addon,
+ const CVariant& description)
: CAddonEvent(addon, description)
{ }
-CAddonManagementEvent::CAddonManagementEvent(ADDON::AddonPtr addon, const CVariant& description, const CVariant& details)
+CAddonManagementEvent::CAddonManagementEvent(const ADDON::AddonPtr& addon,
+ const CVariant& description,
+ const CVariant& details)
: CAddonEvent(addon, description, details)
{ }
-CAddonManagementEvent::CAddonManagementEvent(ADDON::AddonPtr addon, const CVariant& description, const CVariant& details, const CVariant& executionLabel)
+CAddonManagementEvent::CAddonManagementEvent(const ADDON::AddonPtr& addon,
+ const CVariant& description,
+ const CVariant& details,
+ const CVariant& executionLabel)
: CAddonEvent(addon, description, details, executionLabel)
{ }
-CAddonManagementEvent::CAddonManagementEvent(ADDON::AddonPtr addon, EventLevel level, const CVariant& description)
+CAddonManagementEvent::CAddonManagementEvent(const ADDON::AddonPtr& addon,
+ EventLevel level,
+ const CVariant& description)
: CAddonEvent(addon, level, description)
{ }
-CAddonManagementEvent::CAddonManagementEvent(ADDON::AddonPtr addon, EventLevel level, const CVariant& description, const CVariant& details)
+CAddonManagementEvent::CAddonManagementEvent(const ADDON::AddonPtr& addon,
+ EventLevel level,
+ const CVariant& description,
+ const CVariant& details)
: CAddonEvent(addon, level, description, details)
{ }
-CAddonManagementEvent::CAddonManagementEvent(ADDON::AddonPtr addon, EventLevel level, const CVariant& description, const CVariant& details, const CVariant& executionLabel)
+CAddonManagementEvent::CAddonManagementEvent(const ADDON::AddonPtr& addon,
+ EventLevel level,
+ const CVariant& description,
+ const CVariant& details,
+ const CVariant& executionLabel)
: CAddonEvent(addon, level, description, details, executionLabel)
{ }
diff --git a/xbmc/events/AddonManagementEvent.h b/xbmc/events/AddonManagementEvent.h
index 6d833b2752..f6f0744c72 100644
--- a/xbmc/events/AddonManagementEvent.h
+++ b/xbmc/events/AddonManagementEvent.h
@@ -13,12 +13,26 @@
class CAddonManagementEvent : public CAddonEvent
{
public:
- CAddonManagementEvent(ADDON::AddonPtr addon, const CVariant& description);
- CAddonManagementEvent(ADDON::AddonPtr addon, const CVariant& description, const CVariant& details);
- CAddonManagementEvent(ADDON::AddonPtr addon, const CVariant& description, const CVariant& details, const CVariant& executionLabel);
- CAddonManagementEvent(ADDON::AddonPtr addon, EventLevel level, const CVariant& description);
- CAddonManagementEvent(ADDON::AddonPtr addon, EventLevel level, const CVariant& description, const CVariant& details);
- CAddonManagementEvent(ADDON::AddonPtr addon, EventLevel level, const CVariant& description, const CVariant& details, const CVariant& executionLabel);
+ CAddonManagementEvent(const ADDON::AddonPtr& addon, const CVariant& description);
+ CAddonManagementEvent(const ADDON::AddonPtr& addon,
+ const CVariant& description,
+ const CVariant& details);
+ CAddonManagementEvent(const ADDON::AddonPtr& addon,
+ const CVariant& description,
+ const CVariant& details,
+ const CVariant& executionLabel);
+ CAddonManagementEvent(const ADDON::AddonPtr& addon,
+ EventLevel level,
+ const CVariant& description);
+ CAddonManagementEvent(const ADDON::AddonPtr& addon,
+ EventLevel level,
+ const CVariant& description,
+ const CVariant& details);
+ CAddonManagementEvent(const ADDON::AddonPtr& addon,
+ EventLevel level,
+ const CVariant& description,
+ const CVariant& details,
+ const CVariant& executionLabel);
~CAddonManagementEvent() override = default;
const char* GetType() const override { return "AddonManagementEvent"; }
diff --git a/xbmc/events/windows/GUIWindowEventLog.cpp b/xbmc/events/windows/GUIWindowEventLog.cpp
index 01f95a2fe8..51d4e81236 100644
--- a/xbmc/events/windows/GUIWindowEventLog.cpp
+++ b/xbmc/events/windows/GUIWindowEventLog.cpp
@@ -219,7 +219,7 @@ bool CGUIWindowEventLog::GetDirectory(const std::string &strDirectory, CFileItem
return result;
}
-bool CGUIWindowEventLog::OnSelect(CFileItemPtr item)
+bool CGUIWindowEventLog::OnSelect(const CFileItemPtr& item)
{
if (item == nullptr)
return false;
@@ -228,7 +228,7 @@ bool CGUIWindowEventLog::OnSelect(CFileItemPtr item)
return true;
}
-bool CGUIWindowEventLog::OnDelete(CFileItemPtr item)
+bool CGUIWindowEventLog::OnDelete(const CFileItemPtr& item)
{
if (item == nullptr)
return false;
@@ -241,7 +241,7 @@ bool CGUIWindowEventLog::OnDelete(CFileItemPtr item)
return true;
}
-bool CGUIWindowEventLog::OnExecute(CFileItemPtr item)
+bool CGUIWindowEventLog::OnExecute(const CFileItemPtr& item)
{
if (item == nullptr)
return false;
@@ -260,7 +260,7 @@ bool CGUIWindowEventLog::OnExecute(CFileItemPtr item)
return eventPtr->Execute();
}
-void CGUIWindowEventLog::OnEventAdded(CFileItemPtr item)
+void CGUIWindowEventLog::OnEventAdded(const CFileItemPtr& item)
{
if (!IsActive())
return;
@@ -268,7 +268,7 @@ void CGUIWindowEventLog::OnEventAdded(CFileItemPtr item)
Refresh(true);
}
-void CGUIWindowEventLog::OnEventRemoved(CFileItemPtr item)
+void CGUIWindowEventLog::OnEventRemoved(const CFileItemPtr& item)
{
if (!IsActive())
return;
diff --git a/xbmc/events/windows/GUIWindowEventLog.h b/xbmc/events/windows/GUIWindowEventLog.h
index c3596871bb..d3cb22a91c 100644
--- a/xbmc/events/windows/GUIWindowEventLog.h
+++ b/xbmc/events/windows/GUIWindowEventLog.h
@@ -28,10 +28,10 @@ protected:
bool GetDirectory(const std::string &strDirectory, CFileItemList &items) override;
std::string GetRootPath() const override { return "events://"; }
- bool OnSelect(CFileItemPtr item);
- bool OnDelete(CFileItemPtr item);
- bool OnExecute(CFileItemPtr item);
+ bool OnSelect(const CFileItemPtr& item);
+ bool OnDelete(const CFileItemPtr& item);
+ bool OnExecute(const CFileItemPtr& item);
- void OnEventAdded(CFileItemPtr item);
- void OnEventRemoved(CFileItemPtr item);
+ void OnEventAdded(const CFileItemPtr& item);
+ void OnEventRemoved(const CFileItemPtr& item);
};
diff --git a/xbmc/filesystem/AddonsDirectory.cpp b/xbmc/filesystem/AddonsDirectory.cpp
index 14637af4e3..31fb5aa0fa 100644
--- a/xbmc/filesystem/AddonsDirectory.cpp
+++ b/xbmc/filesystem/AddonsDirectory.cpp
@@ -791,7 +791,7 @@ bool CAddonsDirectory::IsRepoDirectory(const CURL& url)
void CAddonsDirectory::GenerateAddonListing(const CURL& path,
const VECADDONS& addons,
CFileItemList& items,
- const std::string label)
+ const std::string& label)
{
std::map<std::string, CAddonWithUpdate> addonsWithUpdate;
diff --git a/xbmc/filesystem/AddonsDirectory.h b/xbmc/filesystem/AddonsDirectory.h
index 06802cb3e5..0403b50e74 100644
--- a/xbmc/filesystem/AddonsDirectory.h
+++ b/xbmc/filesystem/AddonsDirectory.h
@@ -45,7 +45,10 @@ namespace XFILE
*/
static bool GetScriptsAndPlugins(const std::string &content, CFileItemList &items);
- static void GenerateAddonListing(const CURL &path, const ADDON::VECADDONS& addons, CFileItemList &items, const std::string label);
+ static void GenerateAddonListing(const CURL& path,
+ const ADDON::VECADDONS& addons,
+ CFileItemList& items,
+ const std::string& label);
static CFileItemPtr FileItemFromAddon(const ADDON::AddonPtr &addon, const std::string& path, bool folder = false);
/*! \brief Returns true if `path` is a path or subpath of the repository directory, otherwise false */
diff --git a/xbmc/filesystem/CurlFile.h b/xbmc/filesystem/CurlFile.h
index 2fb05f3040..8a5dbe688f 100644
--- a/xbmc/filesystem/CurlFile.h
+++ b/xbmc/filesystem/CurlFile.h
@@ -71,7 +71,7 @@ namespace XFILE
void SetPostData(const std::string& postdata) { m_postdata = postdata; }
void SetReferer(const std::string& referer) { m_referer = referer; }
void SetCookie(const std::string& cookie) { m_cookie = cookie; }
- void SetMimeType(std::string mimetype) { SetRequestHeader("Content-Type", mimetype); }
+ void SetMimeType(const std::string& mimetype) { SetRequestHeader("Content-Type", mimetype); }
void SetRequestHeader(const std::string& header, const std::string& value);
void SetRequestHeader(const std::string& header, long value);
diff --git a/xbmc/filesystem/Directory.cpp b/xbmc/filesystem/Directory.cpp
index 98b524c4d4..67ddf184ae 100644
--- a/xbmc/filesystem/Directory.cpp
+++ b/xbmc/filesystem/Directory.cpp
@@ -124,8 +124,11 @@ bool CDirectory::GetDirectory(const std::string& strPath, CFileItemList &items,
return GetDirectory(pathToUrl, items, hints);
}
-bool CDirectory::GetDirectory(const std::string& strPath, std::shared_ptr<IDirectory> pDirectory,
- CFileItemList &items, const std::string &strMask, int flags)
+bool CDirectory::GetDirectory(const std::string& strPath,
+ const std::shared_ptr<IDirectory>& pDirectory,
+ CFileItemList& items,
+ const std::string& strMask,
+ int flags)
{
CHints hints;
hints.flags = flags;
@@ -155,8 +158,10 @@ bool CDirectory::GetDirectory(const CURL& url, CFileItemList &items, const CHint
return CDirectory::GetDirectory(url, pDirectory, items, hints);
}
-bool CDirectory::GetDirectory(const CURL& url, std::shared_ptr<IDirectory> pDirectory,
- CFileItemList &items, const CHints &hints)
+bool CDirectory::GetDirectory(const CURL& url,
+ const std::shared_ptr<IDirectory>& pDirectory,
+ CFileItemList& items,
+ const CHints& hints)
{
try
{
diff --git a/xbmc/filesystem/Directory.h b/xbmc/filesystem/Directory.h
index dcaa961a3a..0af92f3f35 100644
--- a/xbmc/filesystem/Directory.h
+++ b/xbmc/filesystem/Directory.h
@@ -38,9 +38,9 @@ public:
, int flags);
static bool GetDirectory(const CURL& url,
- std::shared_ptr<IDirectory> pDirectory,
- CFileItemList &items,
- const CHints &hints);
+ const std::shared_ptr<IDirectory>& pDirectory,
+ CFileItemList& items,
+ const CHints& hints);
static bool GetDirectory(const CURL& url
, CFileItemList &items
@@ -57,9 +57,9 @@ public:
, int flags);
static bool GetDirectory(const std::string& strPath,
- std::shared_ptr<IDirectory> pDirectory,
- CFileItemList &items,
- const std::string &strMask,
+ const std::shared_ptr<IDirectory>& pDirectory,
+ CFileItemList& items,
+ const std::string& strMask,
int flags);
static bool GetDirectory(const std::string& strPath
diff --git a/xbmc/filesystem/FTPParse.cpp b/xbmc/filesystem/FTPParse.cpp
index ee5e49e75c..3916197e35 100644
--- a/xbmc/filesystem/FTPParse.cpp
+++ b/xbmc/filesystem/FTPParse.cpp
@@ -45,7 +45,7 @@ time_t CFTPParse::getTime()
return m_time;
}
-void CFTPParse::setTime(std::string str)
+void CFTPParse::setTime(const std::string& str)
{
/* Variables used to capture patterns via the regexes */
std::string month;
@@ -324,7 +324,7 @@ int CFTPParse::getDayOfWeek(int month, int date, int year)
return day_of_week;
}
-int CFTPParse::FTPParse(std::string str)
+int CFTPParse::FTPParse(const std::string& str)
{
/* Various variable to capture patterns via the regexes */
std::string permissions;
diff --git a/xbmc/filesystem/FTPParse.h b/xbmc/filesystem/FTPParse.h
index 7c57bec8ec..56d0202543 100644
--- a/xbmc/filesystem/FTPParse.h
+++ b/xbmc/filesystem/FTPParse.h
@@ -16,7 +16,7 @@ class CFTPParse
{
public:
CFTPParse();
- int FTPParse(std::string str);
+ int FTPParse(const std::string& str);
std::string getName();
int getFlagtrycwd();
int getFlagtryretr();
@@ -28,6 +28,6 @@ private:
int m_flagtryretr; // 0 if retr is definitely pointless, 1 otherwise
uint64_t m_size; // number of octets
time_t m_time; // modification time
- void setTime(std::string str); // Method used to set m_time from a string
+ void setTime(const std::string& str); // Method used to set m_time from a string
int getDayOfWeek(int month, int date, int year); // Method to get day of week
};
diff --git a/xbmc/filesystem/NFSFile.cpp b/xbmc/filesystem/NFSFile.cpp
index 177b71062f..86bfc69578 100644
--- a/xbmc/filesystem/NFSFile.cpp
+++ b/xbmc/filesystem/NFSFile.cpp
@@ -376,7 +376,7 @@ void CNfsConnection::removeFromKeepAliveList(struct nfsfh *_pFileHandle)
}
//reset timeouts on read
-void CNfsConnection::resetKeepAlive(std::string _exportPath, struct nfsfh *_pFileHandle)
+void CNfsConnection::resetKeepAlive(const std::string& _exportPath, struct nfsfh* _pFileHandle)
{
CSingleLock lock(keepAliveLock);
//refresh last access time of the context aswell
@@ -397,7 +397,7 @@ void CNfsConnection::resetKeepAlive(std::string _exportPath, struct nfsfh *_pFi
//keep alive the filehandles nfs connection
//by blindly doing a read 32bytes - seek back to where
//we were before
-void CNfsConnection::keepAlive(std::string _exportPath, struct nfsfh *_pFileHandle)
+void CNfsConnection::keepAlive(const std::string& _exportPath, struct nfsfh* _pFileHandle)
{
uint64_t offset = 0;
char buffer[32];
diff --git a/xbmc/filesystem/NFSFile.h b/xbmc/filesystem/NFSFile.h
index afc1958acf..ba8fbd6c21 100644
--- a/xbmc/filesystem/NFSFile.h
+++ b/xbmc/filesystem/NFSFile.h
@@ -64,7 +64,7 @@ public:
void Deinit();
//adds the filehandle to the keep alive list or resets
//the timeout for this filehandle if already in list
- void resetKeepAlive(std::string _exportPath, struct nfsfh *_pFileHandle);
+ void resetKeepAlive(const std::string& _exportPath, struct nfsfh* _pFileHandle);
//removes file handle from keep alive list
void removeFromKeepAliveList(struct nfsfh *_pFileHandle);
@@ -94,7 +94,7 @@ private:
void destroyOpenContexts();
void destroyContext(const std::string &exportName);
void resolveHost(const CURL &url);//resolve hostname by dnslookup
- void keepAlive(std::string _exportPath, struct nfsfh *_pFileHandle);
+ void keepAlive(const std::string& _exportPath, struct nfsfh* _pFileHandle);
static void setTimeout(struct nfs_context* context);
};
diff --git a/xbmc/filesystem/NptXbmcFile.cpp b/xbmc/filesystem/NptXbmcFile.cpp
index d1d6b3b3e6..4aad76f22f 100644
--- a/xbmc/filesystem/NptXbmcFile.cpp
+++ b/xbmc/filesystem/NptXbmcFile.cpp
@@ -40,8 +40,7 @@ class NPT_XbmcFileStream
{
public:
// constructors and destructor
- explicit NPT_XbmcFileStream(NPT_XbmcFileReference file) :
- m_FileReference(file) {}
+ explicit NPT_XbmcFileStream(const NPT_XbmcFileReference& file) : m_FileReference(file) {}
// NPT_FileInterface methods
NPT_Result Seek(NPT_Position offset);
diff --git a/xbmc/filesystem/RSSDirectory.cpp b/xbmc/filesystem/RSSDirectory.cpp
index f2d9912abb..430daffb43 100644
--- a/xbmc/filesystem/RSSDirectory.cpp
+++ b/xbmc/filesystem/RSSDirectory.cpp
@@ -420,7 +420,7 @@ static void ParseItem(CFileItem* item, SResources& resources, TiXmlElement* root
}
}
-static bool FindMime(SResources resources, std::string mime)
+static bool FindMime(const SResources& resources, const std::string& mime)
{
for (const auto& it : resources)
{
diff --git a/xbmc/filesystem/UDFBlockInput.cpp b/xbmc/filesystem/UDFBlockInput.cpp
index e25df6f4d4..623bbb9a5d 100644
--- a/xbmc/filesystem/UDFBlockInput.cpp
+++ b/xbmc/filesystem/UDFBlockInput.cpp
@@ -47,7 +47,7 @@ int CUDFBlockInput::Read(
return static_cast<int>(read);
}
-udfread_block_input* CUDFBlockInput::GetBlockInput(std::string file)
+udfread_block_input* CUDFBlockInput::GetBlockInput(const std::string& file)
{
auto fp = std::make_shared<XFILE::CFile>();
diff --git a/xbmc/filesystem/UDFBlockInput.h b/xbmc/filesystem/UDFBlockInput.h
index 0506077ecb..7f0248a5d6 100644
--- a/xbmc/filesystem/UDFBlockInput.h
+++ b/xbmc/filesystem/UDFBlockInput.h
@@ -21,7 +21,7 @@ public:
CUDFBlockInput() = default;
~CUDFBlockInput() = default;
- udfread_block_input* GetBlockInput(std::string file);
+ udfread_block_input* GetBlockInput(const std::string& file);
private:
static int Close(udfread_block_input* bi);
diff --git a/xbmc/games/GameSettings.cpp b/xbmc/games/GameSettings.cpp
index 2bbfbf2bf0..fb57b815a3 100644
--- a/xbmc/games/GameSettings.cpp
+++ b/xbmc/games/GameSettings.cpp
@@ -85,7 +85,7 @@ unsigned int CGameSettings::MaxRewindTimeSec()
return static_cast<unsigned int>(std::max(rewindTimeSec, 0));
}
-void CGameSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGameSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
diff --git a/xbmc/games/GameSettings.h b/xbmc/games/GameSettings.h
index 727ce01cf4..59acac1975 100644
--- a/xbmc/games/GameSettings.h
+++ b/xbmc/games/GameSettings.h
@@ -35,7 +35,7 @@ public:
unsigned int MaxRewindTimeSec();
// Inherited from ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
private:
// Construction parameters
diff --git a/xbmc/games/controllers/ControllerManager.cpp b/xbmc/games/controllers/ControllerManager.cpp
index 060136240f..428cd6bc99 100644
--- a/xbmc/games/controllers/ControllerManager.cpp
+++ b/xbmc/games/controllers/ControllerManager.cpp
@@ -26,7 +26,7 @@ ControllerPtr CControllerManager::GetController(const std::string& controllerId)
{
AddonPtr addon;
if (CServiceBroker::GetAddonMgr().GetAddon(controllerId, addon, ADDON_GAME_CONTROLLER, false))
- cachedController = LoadController(std::move(addon));
+ cachedController = LoadController(addon);
}
return cachedController;
@@ -60,7 +60,7 @@ ControllerVector CControllerManager::GetControllers()
{
ControllerPtr& cachedController = m_cache[addon->ID()];
if (!cachedController && m_failedControllers.find(addon->ID()) == m_failedControllers.end())
- cachedController = LoadController(std::move(addon));
+ cachedController = LoadController(addon);
if (cachedController)
controllers.emplace_back(cachedController);
@@ -70,7 +70,7 @@ ControllerVector CControllerManager::GetControllers()
return controllers;
}
-ControllerPtr CControllerManager::LoadController(ADDON::AddonPtr addon)
+ControllerPtr CControllerManager::LoadController(const ADDON::AddonPtr& addon)
{
ControllerPtr controller = std::static_pointer_cast<CController>(addon);
if (!controller->LoadLayout())
diff --git a/xbmc/games/controllers/ControllerManager.h b/xbmc/games/controllers/ControllerManager.h
index 6143d64c95..3e7047b0fc 100644
--- a/xbmc/games/controllers/ControllerManager.h
+++ b/xbmc/games/controllers/ControllerManager.h
@@ -67,7 +67,7 @@ public:
ControllerVector GetControllers();
private:
- ControllerPtr LoadController(ADDON::AddonPtr addon);
+ ControllerPtr LoadController(const ADDON::AddonPtr& addon);
std::map<std::string, ControllerPtr> m_cache;
std::set<std::string> m_failedControllers; // Controllers that failed to load
diff --git a/xbmc/guilib/GUIAudioManager.cpp b/xbmc/guilib/GUIAudioManager.cpp
index 0f1488f68e..e3fb16d024 100644
--- a/xbmc/guilib/GUIAudioManager.cpp
+++ b/xbmc/guilib/GUIAudioManager.cpp
@@ -41,7 +41,7 @@ CGUIAudioManager::~CGUIAudioManager()
m_settings->UnregisterCallback(this);
}
-void CGUIAudioManager::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIAudioManager::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -54,7 +54,9 @@ void CGUIAudioManager::OnSettingChanged(std::shared_ptr<const CSetting> setting)
}
}
-bool CGUIAudioManager::OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *oldSettingId, const TiXmlNode *oldSettingNode)
+bool CGUIAudioManager::OnSettingUpdate(const std::shared_ptr<CSetting>& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode)
{
if (setting == NULL)
return false;
diff --git a/xbmc/guilib/GUIAudioManager.h b/xbmc/guilib/GUIAudioManager.h
index 88fa21f64e..b081b2f597 100644
--- a/xbmc/guilib/GUIAudioManager.h
+++ b/xbmc/guilib/GUIAudioManager.h
@@ -44,8 +44,10 @@ public:
CGUIAudioManager();
~CGUIAudioManager() override;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- bool OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ bool OnSettingUpdate(const std::shared_ptr<CSetting>& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode) override;
void Initialize();
void DeInitialize();
diff --git a/xbmc/guilib/GUIBaseContainer.cpp b/xbmc/guilib/GUIBaseContainer.cpp
index cf1905640b..863241240f 100644
--- a/xbmc/guilib/GUIBaseContainer.cpp
+++ b/xbmc/guilib/GUIBaseContainer.cpp
@@ -298,7 +298,7 @@ bool CGUIBaseContainer::OnAction(const CAction &action)
{
std::string letter;
g_charsetConverter.wToUTF8({action.GetUnicode()}, letter);
- OnJumpLetter(std::move(letter));
+ OnJumpLetter(letter);
return true;
}
// stop the timer on any other action
@@ -562,7 +562,7 @@ void CGUIBaseContainer::OnPrevLetter()
}
}
-void CGUIBaseContainer::OnJumpLetter(std::string letter, bool skip /*=false*/)
+void CGUIBaseContainer::OnJumpLetter(const std::string& letter, bool skip /*=false*/)
{
if (m_matchTimer.GetElapsedMilliseconds() < letter_match_timeout)
m_match += letter;
diff --git a/xbmc/guilib/GUIBaseContainer.h b/xbmc/guilib/GUIBaseContainer.h
index 832958219d..b68f4edef7 100644
--- a/xbmc/guilib/GUIBaseContainer.h
+++ b/xbmc/guilib/GUIBaseContainer.h
@@ -172,7 +172,7 @@ protected:
bool ScrollingUp() const { return m_scroller.IsScrollingUp(); };
void OnNextLetter();
void OnPrevLetter();
- void OnJumpLetter(std::string letter, bool skip = false);
+ void OnJumpLetter(const std::string& letter, bool skip = false);
void OnJumpSMS(int letter);
std::vector< std::pair<int, std::string> > m_letterOffsets;
diff --git a/xbmc/guilib/GUIComponent.cpp b/xbmc/guilib/GUIComponent.cpp
index c2d5301f40..e143e7557e 100644
--- a/xbmc/guilib/GUIComponent.cpp
+++ b/xbmc/guilib/GUIComponent.cpp
@@ -86,7 +86,7 @@ CGUIAudioManager &CGUIComponent::GetAudioManager()
return *m_guiAudioManager;
}
-bool CGUIComponent::ConfirmDelete(std::string path)
+bool CGUIComponent::ConfirmDelete(const std::string& path)
{
CGUIDialogYesNo* pDialog = GetWindowManager().GetWindow<CGUIDialogYesNo>(WINDOW_DIALOG_YES_NO);
if (pDialog)
diff --git a/xbmc/guilib/GUIComponent.h b/xbmc/guilib/GUIComponent.h
index 5b564885b2..97ada489b5 100644
--- a/xbmc/guilib/GUIComponent.h
+++ b/xbmc/guilib/GUIComponent.h
@@ -35,7 +35,7 @@ public:
CGUIColorManager &GetColorManager();
CGUIAudioManager &GetAudioManager();
- bool ConfirmDelete(std::string path);
+ bool ConfirmDelete(const std::string& path);
protected:
// members are pointers in order to avoid includes
diff --git a/xbmc/guilib/GUIEditControl.cpp b/xbmc/guilib/GUIEditControl.cpp
index ded5f3ecdf..179512f953 100644
--- a/xbmc/guilib/GUIEditControl.cpp
+++ b/xbmc/guilib/GUIEditControl.cpp
@@ -367,7 +367,7 @@ void CGUIEditControl::UpdateText(bool sendUpdate)
SetInvalid();
}
-void CGUIEditControl::SetInputType(CGUIEditControl::INPUT_TYPE type, CVariant heading)
+void CGUIEditControl::SetInputType(CGUIEditControl::INPUT_TYPE type, const CVariant& heading)
{
m_inputType = type;
if (heading.isString())
diff --git a/xbmc/guilib/GUIEditControl.h b/xbmc/guilib/GUIEditControl.h
index 89e9ae266a..7e359eeaec 100644
--- a/xbmc/guilib/GUIEditControl.h
+++ b/xbmc/guilib/GUIEditControl.h
@@ -61,7 +61,7 @@ public:
unsigned int GetCursorPosition() const;
void SetCursorPosition(unsigned int iPosition);
- void SetInputType(INPUT_TYPE type, CVariant heading);
+ void SetInputType(INPUT_TYPE type, const CVariant& heading);
void SetTextChangeActions(const CGUIAction& textChangeActions) { m_textChangeActions = textChangeActions; };
diff --git a/xbmc/guilib/GUIFontManager.cpp b/xbmc/guilib/GUIFontManager.cpp
index e56652487f..0d06193abf 100644
--- a/xbmc/guilib/GUIFontManager.cpp
+++ b/xbmc/guilib/GUIFontManager.cpp
@@ -453,7 +453,10 @@ void GUIFontManager::GetStyle(const TiXmlNode *fontNode, int &iStyle)
}
}
-void GUIFontManager::SettingOptionsFontsFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void GUIFontManager::SettingOptionsFontsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
CFileItemList items;
CFileItemList items2;
diff --git a/xbmc/guilib/GUIFontManager.h b/xbmc/guilib/GUIFontManager.h
index 897cb8de17..0d1165f5d1 100644
--- a/xbmc/guilib/GUIFontManager.h
+++ b/xbmc/guilib/GUIFontManager.h
@@ -66,7 +66,10 @@ public:
void Clear();
void FreeFontFile(CGUIFontTTF* pFont);
- static void SettingOptionsFontsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
+ static void SettingOptionsFontsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
protected:
void ReloadTTFFonts();
diff --git a/xbmc/guilib/GUIKeyboardFactory.cpp b/xbmc/guilib/GUIKeyboardFactory.cpp
index b6a2c62dc0..9ee48cbade 100644
--- a/xbmc/guilib/GUIKeyboardFactory.cpp
+++ b/xbmc/guilib/GUIKeyboardFactory.cpp
@@ -74,7 +74,11 @@ bool CGUIKeyboardFactory::SendTextToActiveKeyboard(const std::string &aTextStrin
// Show keyboard with initial value (aTextString) and replace with result string.
// Returns: true - successful display and input (empty result may return true or false depending on parameter)
// false - unsuccessful display of the keyboard or cancelled editing
-bool CGUIKeyboardFactory::ShowAndGetInput(std::string& aTextString, CVariant heading, bool allowEmptyResult, bool hiddenInput /* = false */, unsigned int autoCloseMs /* = 0 */)
+bool CGUIKeyboardFactory::ShowAndGetInput(std::string& aTextString,
+ const CVariant& heading,
+ bool allowEmptyResult,
+ bool hiddenInput /* = false */,
+ unsigned int autoCloseMs /* = 0 */)
{
bool confirmed = false;
//heading can be a string or a localization id
@@ -127,7 +131,10 @@ bool CGUIKeyboardFactory::ShowAndGetInput(std::string& aTextString, bool allowEm
// Shows keyboard and prompts for a password.
// Differs from ShowAndVerifyNewPassword() in that no second verification is necessary.
-bool CGUIKeyboardFactory::ShowAndGetNewPassword(std::string& newPassword, CVariant heading, bool allowEmpty, unsigned int autoCloseMs /* = 0 */)
+bool CGUIKeyboardFactory::ShowAndGetNewPassword(std::string& newPassword,
+ const CVariant& heading,
+ bool allowEmpty,
+ unsigned int autoCloseMs /* = 0 */)
{
return ShowAndGetInput(newPassword, heading, allowEmpty, true, autoCloseMs);
}
@@ -153,7 +160,10 @@ bool CGUIKeyboardFactory::ShowAndGetFilter(std::string &filter, bool searching,
// \param heading Heading to display
// \param allowEmpty Whether a blank password is valid or not.
// \return true if successful display and user input entry/re-entry. false if unsuccessful display, no user input, or canceled editing.
-bool CGUIKeyboardFactory::ShowAndVerifyNewPassword(std::string& newPassword, CVariant heading, bool allowEmpty, unsigned int autoCloseMs /* = 0 */)
+bool CGUIKeyboardFactory::ShowAndVerifyNewPassword(std::string& newPassword,
+ const CVariant& heading,
+ bool allowEmpty,
+ unsigned int autoCloseMs /* = 0 */)
{
// Prompt user for password input
std::string userInput;
diff --git a/xbmc/guilib/GUIKeyboardFactory.h b/xbmc/guilib/GUIKeyboardFactory.h
index ab53354efc..04272af78a 100644
--- a/xbmc/guilib/GUIKeyboardFactory.h
+++ b/xbmc/guilib/GUIKeyboardFactory.h
@@ -22,11 +22,21 @@ class CGUIKeyboardFactory
virtual ~CGUIKeyboardFactory(void);
static bool ShowAndGetInput(std::string& aTextString, bool allowEmptyResult, unsigned int autoCloseMs = 0);
- static bool ShowAndGetInput(std::string& aTextString, CVariant heading, bool allowEmptyResult, bool hiddenInput = false, unsigned int autoCloseMs = 0);
+ static bool ShowAndGetInput(std::string& aTextString,
+ const CVariant& heading,
+ bool allowEmptyResult,
+ bool hiddenInput = false,
+ unsigned int autoCloseMs = 0);
static bool ShowAndGetNewPassword(std::string& strNewPassword, unsigned int autoCloseMs = 0);
- static bool ShowAndGetNewPassword(std::string& newPassword, CVariant heading, bool allowEmpty, unsigned int autoCloseMs = 0);
+ static bool ShowAndGetNewPassword(std::string& newPassword,
+ const CVariant& heading,
+ bool allowEmpty,
+ unsigned int autoCloseMs = 0);
static bool ShowAndVerifyNewPassword(std::string& strNewPassword, unsigned int autoCloseMs = 0);
- static bool ShowAndVerifyNewPassword(std::string& newPassword, CVariant heading, bool allowEmpty, unsigned int autoCloseMs = 0);
+ static bool ShowAndVerifyNewPassword(std::string& newPassword,
+ const CVariant& heading,
+ bool allowEmpty,
+ unsigned int autoCloseMs = 0);
static int ShowAndVerifyPassword(std::string& strPassword, const std::string& strHeading, int iRetries, unsigned int autoCloseMs = 0);
static bool ShowAndGetFilter(std::string& aTextString, bool searching, unsigned int autoCloseMs = 0);
diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp
index 4b79ab6fef..e6f6aeb11d 100644
--- a/xbmc/guilib/StereoscopicsManager.cpp
+++ b/xbmc/guilib/StereoscopicsManager.cpp
@@ -377,7 +377,7 @@ CAction CStereoscopicsManager::ConvertActionCommandToAction(const std::string &c
return CAction(ACTION_NONE);
}
-void CStereoscopicsManager::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CStereoscopicsManager::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
diff --git a/xbmc/guilib/StereoscopicsManager.h b/xbmc/guilib/StereoscopicsManager.h
index 0166d75cda..8de93dc189 100644
--- a/xbmc/guilib/StereoscopicsManager.h
+++ b/xbmc/guilib/StereoscopicsManager.h
@@ -59,7 +59,7 @@ public:
static CAction ConvertActionCommandToAction(const std::string &command, const std::string &parameter);
static std::string NormalizeStereoMode(const std::string &mode);
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
void OnStreamChange();
bool OnMessage(CGUIMessage &message) override;
/*!
diff --git a/xbmc/guilib/VisibleEffect.cpp b/xbmc/guilib/VisibleEffect.cpp
index 470cfd4539..88bcea5f80 100644
--- a/xbmc/guilib/VisibleEffect.cpp
+++ b/xbmc/guilib/VisibleEffect.cpp
@@ -18,6 +18,8 @@
#include "utils/XMLUtils.h"
#include "utils/log.h"
+#include <utility>
+
CAnimEffect::CAnimEffect(const TiXmlElement *node, EFFECT_TYPE effect)
{
m_effect = effect;
@@ -695,7 +697,7 @@ CScroller::CScroller(unsigned int duration /* = 200 */, std::shared_ptr<Tweener>
m_startPosition = 0;
m_hasResumePoint = false;
m_duration = duration > 0 ? duration : 1;
- m_pTweener = tweener;
+ m_pTweener = std::move(tweener);
}
CScroller::CScroller(const CScroller& right)
diff --git a/xbmc/input/ButtonTranslator.cpp b/xbmc/input/ButtonTranslator.cpp
index 00d0c3a894..baf82bb837 100644
--- a/xbmc/input/ButtonTranslator.cpp
+++ b/xbmc/input/ButtonTranslator.cpp
@@ -411,7 +411,7 @@ void CButtonTranslator::UnregisterMapper(IButtonMapper* mapper)
}
}
-uint32_t CButtonTranslator::TranslateString(std::string strMap, std::string strButton)
+uint32_t CButtonTranslator::TranslateString(const std::string& strMap, const std::string& strButton)
{
if (strMap == "KB") // standard keyboard map
{
diff --git a/xbmc/input/ButtonTranslator.h b/xbmc/input/ButtonTranslator.h
index a0ed23f8e1..e13743d58c 100644
--- a/xbmc/input/ButtonTranslator.h
+++ b/xbmc/input/ButtonTranslator.h
@@ -63,7 +63,7 @@ public:
void RegisterMapper(const std::string& device, IButtonMapper* mapper);
void UnregisterMapper(IButtonMapper* mapper);
- static uint32_t TranslateString(std::string strMap, std::string strButton);
+ static uint32_t TranslateString(const std::string& strMap, const std::string& strButton);
private:
struct CButtonAction
diff --git a/xbmc/input/InputManager.cpp b/xbmc/input/InputManager.cpp
index 772dc250f2..097245822e 100644
--- a/xbmc/input/InputManager.cpp
+++ b/xbmc/input/InputManager.cpp
@@ -765,7 +765,7 @@ bool CInputManager::IsControllerEnabled() const
return m_enableController;
}
-void CInputManager::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CInputManager::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
diff --git a/xbmc/input/InputManager.h b/xbmc/input/InputManager.h
index d878cc9666..503193fbbc 100644
--- a/xbmc/input/InputManager.h
+++ b/xbmc/input/InputManager.h
@@ -223,7 +223,7 @@ public:
void QueueAction(const CAction& action);
// implementation of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
// implementation of IActionListener
bool OnAction(const CAction& action) override;
diff --git a/xbmc/input/KeyboardLayoutManager.cpp b/xbmc/input/KeyboardLayoutManager.cpp
index afbec28159..47aea2d4a4 100644
--- a/xbmc/input/KeyboardLayoutManager.cpp
+++ b/xbmc/input/KeyboardLayoutManager.cpp
@@ -138,7 +138,7 @@ inline bool LayoutSort(const StringSettingOption& i, const StringSettingOption&
} // namespace
void CKeyboardLayoutManager::SettingOptionsKeyboardLayoutsFiller(
- SettingConstPtr setting,
+ const SettingConstPtr& setting,
std::vector<StringSettingOption>& list,
std::string& current,
void* data)
diff --git a/xbmc/input/KeyboardLayoutManager.h b/xbmc/input/KeyboardLayoutManager.h
index b493155e38..b435f279e7 100644
--- a/xbmc/input/KeyboardLayoutManager.h
+++ b/xbmc/input/KeyboardLayoutManager.h
@@ -33,7 +33,7 @@ public:
const KeyboardLayouts& GetLayouts() const { return m_layouts; }
bool GetLayout(const std::string& name, CKeyboardLayout& layout) const;
- static void SettingOptionsKeyboardLayoutsFiller(std::shared_ptr<const CSetting> setting,
+ static void SettingOptionsKeyboardLayoutsFiller(const std::shared_ptr<const CSetting>& setting,
std::vector<StringSettingOption>& list,
std::string& current,
void* data);
diff --git a/xbmc/input/button/ButtonStat.cpp b/xbmc/input/button/ButtonStat.cpp
index a8e52a7ef6..679947fc4b 100644
--- a/xbmc/input/button/ButtonStat.cpp
+++ b/xbmc/input/button/ButtonStat.cpp
@@ -14,7 +14,7 @@ using namespace INPUT;
CButtonStat::CButtonStat() = default;
-CKey CButtonStat::TranslateKey(CKey key) const
+CKey CButtonStat::TranslateKey(const CKey& key) const
{
uint32_t buttonCode = key.GetButtonCode();
if (key.GetHeld() > HOLD_TRESHOLD)
diff --git a/xbmc/input/button/ButtonStat.h b/xbmc/input/button/ButtonStat.h
index d73e5beb65..04ee51a134 100644
--- a/xbmc/input/button/ButtonStat.h
+++ b/xbmc/input/button/ButtonStat.h
@@ -24,7 +24,7 @@ public:
CButtonStat();
~CButtonStat() = default;
- CKey TranslateKey(CKey key) const;
+ CKey TranslateKey(const CKey& key) const;
};
} // namespace INPUT
} // namespace KODI
diff --git a/xbmc/interfaces/AnnouncementManager.cpp b/xbmc/interfaces/AnnouncementManager.cpp
index 879cbe55a1..54a20a4b38 100644
--- a/xbmc/interfaces/AnnouncementManager.cpp
+++ b/xbmc/interfaces/AnnouncementManager.cpp
@@ -162,7 +162,7 @@ void CAnnouncementManager::DoAnnounce(AnnouncementFlag flag,
void CAnnouncementManager::DoAnnounce(AnnouncementFlag flag,
const std::string& sender,
const std::string& message,
- CFileItemPtr item,
+ const CFileItemPtr& item,
const CVariant& data)
{
if (item == nullptr)
diff --git a/xbmc/interfaces/AnnouncementManager.h b/xbmc/interfaces/AnnouncementManager.h
index 87ce3dbad9..bdf5071655 100644
--- a/xbmc/interfaces/AnnouncementManager.h
+++ b/xbmc/interfaces/AnnouncementManager.h
@@ -65,7 +65,7 @@ namespace ANNOUNCEMENT
void DoAnnounce(AnnouncementFlag flag,
const std::string& sender,
const std::string& message,
- CFileItemPtr item,
+ const CFileItemPtr& item,
const CVariant& data);
void DoAnnounce(AnnouncementFlag flag,
const std::string& sender,
diff --git a/xbmc/interfaces/generic/LanguageInvokerThread.cpp b/xbmc/interfaces/generic/LanguageInvokerThread.cpp
index 252cd1d9b0..67f3d14875 100644
--- a/xbmc/interfaces/generic/LanguageInvokerThread.cpp
+++ b/xbmc/interfaces/generic/LanguageInvokerThread.cpp
@@ -10,12 +10,14 @@
#include "ScriptInvocationManager.h"
+#include <utility>
+
CLanguageInvokerThread::CLanguageInvokerThread(LanguageInvokerPtr invoker,
CScriptInvocationManager* invocationManager,
bool reuseable)
: ILanguageInvoker(NULL),
CThread("LanguageInvoker"),
- m_invoker(invoker),
+ m_invoker(std::move(invoker)),
m_invocationManager(invocationManager),
m_reusable(reuseable)
{ }
diff --git a/xbmc/interfaces/generic/ScriptInvocationManager.cpp b/xbmc/interfaces/generic/ScriptInvocationManager.cpp
index fe69686699..265ec39499 100644
--- a/xbmc/interfaces/generic/ScriptInvocationManager.cpp
+++ b/xbmc/interfaces/generic/ScriptInvocationManager.cpp
@@ -240,7 +240,7 @@ int CScriptInvocationManager::ExecuteAsync(
int CScriptInvocationManager::ExecuteAsync(
const std::string& script,
- LanguageInvokerPtr languageInvoker,
+ const LanguageInvokerPtr& languageInvoker,
const ADDON::AddonPtr& addon /* = ADDON::AddonPtr() */,
const std::vector<std::string>& arguments /* = std::vector<std::string>() */,
bool reuseable /* = false */,
@@ -314,7 +314,7 @@ int CScriptInvocationManager::ExecuteSync(
int CScriptInvocationManager::ExecuteSync(
const std::string& script,
- LanguageInvokerPtr languageInvoker,
+ const LanguageInvokerPtr& languageInvoker,
const ADDON::AddonPtr& addon /* = ADDON::AddonPtr() */,
const std::vector<std::string>& arguments /* = std::vector<std::string>() */,
uint32_t timeoutMs /* = 0 */,
diff --git a/xbmc/interfaces/generic/ScriptInvocationManager.h b/xbmc/interfaces/generic/ScriptInvocationManager.h
index 3ad4454c18..6e409b87e6 100644
--- a/xbmc/interfaces/generic/ScriptInvocationManager.h
+++ b/xbmc/interfaces/generic/ScriptInvocationManager.h
@@ -62,7 +62,7 @@ public:
* \return -1 if an error occurred, otherwise the ID of the script
*/
int ExecuteAsync(const std::string& script,
- LanguageInvokerPtr languageInvoker,
+ const LanguageInvokerPtr& languageInvoker,
const ADDON::AddonPtr& addon = ADDON::AddonPtr(),
const std::vector<std::string>& arguments = std::vector<std::string>(),
bool reuseable = false,
@@ -107,7 +107,7 @@ public:
* \return -1 if an error occurred, 0 if the script terminated or ETIMEDOUT if the given timeout expired
*/
int ExecuteSync(const std::string& script,
- LanguageInvokerPtr languageInvoker,
+ const LanguageInvokerPtr& languageInvoker,
const ADDON::AddonPtr& addon = ADDON::AddonPtr(),
const std::vector<std::string>& arguments = std::vector<std::string>(),
uint32_t timeoutMs = 0,
diff --git a/xbmc/interfaces/info/InfoExpression.cpp b/xbmc/interfaces/info/InfoExpression.cpp
index 8aeb5a3583..1bf45a3fc7 100644
--- a/xbmc/interfaces/info/InfoExpression.cpp
+++ b/xbmc/interfaces/info/InfoExpression.cpp
@@ -81,7 +81,7 @@ void InfoExpression::InfoAssociativeGroup::AddChild(const InfoSubexpressionPtr &
m_children.push_front(child); // largely undoes the effect of parsing right-associative
}
-void InfoExpression::InfoAssociativeGroup::Merge(std::shared_ptr<InfoAssociativeGroup> other)
+void InfoExpression::InfoAssociativeGroup::Merge(const std::shared_ptr<InfoAssociativeGroup>& other)
{
m_children.splice(m_children.end(), other->m_children);
}
diff --git a/xbmc/interfaces/info/InfoExpression.h b/xbmc/interfaces/info/InfoExpression.h
index 3f740d4375..f2c3df0b9a 100644
--- a/xbmc/interfaces/info/InfoExpression.h
+++ b/xbmc/interfaces/info/InfoExpression.h
@@ -12,6 +12,7 @@
#include <list>
#include <stack>
+#include <utility>
#include <vector>
class CGUIListItem;
@@ -77,7 +78,7 @@ private:
class InfoLeaf : public InfoSubexpression
{
public:
- InfoLeaf(InfoPtr info, bool invert) : m_info(info), m_invert(invert) {};
+ InfoLeaf(InfoPtr info, bool invert) : m_info(std::move(info)), m_invert(invert){};
bool Evaluate(const CGUIListItem *item) override;
node_type_t Type() const override { return NODE_LEAF; };
private:
@@ -91,7 +92,7 @@ private:
public:
InfoAssociativeGroup(node_type_t type, const InfoSubexpressionPtr &left, const InfoSubexpressionPtr &right);
void AddChild(const InfoSubexpressionPtr &child);
- void Merge(std::shared_ptr<InfoAssociativeGroup> other);
+ void Merge(const std::shared_ptr<InfoAssociativeGroup>& other);
bool Evaluate(const CGUIListItem *item) override;
node_type_t Type() const override { return m_type; };
private:
diff --git a/xbmc/interfaces/json-rpc/AddonsOperations.cpp b/xbmc/interfaces/json-rpc/AddonsOperations.cpp
index dff6317ef9..e9010032a9 100644
--- a/xbmc/interfaces/json-rpc/AddonsOperations.cpp
+++ b/xbmc/interfaces/json-rpc/AddonsOperations.cpp
@@ -267,7 +267,11 @@ static CVariant Serialize(const AddonPtr& addon)
return variant;
}
-void CAddonsOperations::FillDetails(AddonPtr addon, const CVariant& fields, CVariant &result, CAddonDatabase &addondb, bool append /* = false */)
+void CAddonsOperations::FillDetails(const AddonPtr& addon,
+ const CVariant& fields,
+ CVariant& result,
+ CAddonDatabase& addondb,
+ bool append /* = false */)
{
if (addon.get() == NULL)
return;
diff --git a/xbmc/interfaces/json-rpc/AddonsOperations.h b/xbmc/interfaces/json-rpc/AddonsOperations.h
index 488085a6d1..9911b56027 100644
--- a/xbmc/interfaces/json-rpc/AddonsOperations.h
+++ b/xbmc/interfaces/json-rpc/AddonsOperations.h
@@ -30,7 +30,7 @@ namespace JSONRPC
static JSONRPC_STATUS ExecuteAddon(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
private:
- static void FillDetails(ADDON::AddonPtr addon,
+ static void FillDetails(const ADDON::AddonPtr& addon,
const CVariant& fields,
CVariant& result,
ADDON::CAddonDatabase& addondb,
diff --git a/xbmc/interfaces/json-rpc/AudioLibrary.cpp b/xbmc/interfaces/json-rpc/AudioLibrary.cpp
index 8bf9509cf3..194838150e 100644
--- a/xbmc/interfaces/json-rpc/AudioLibrary.cpp
+++ b/xbmc/interfaces/json-rpc/AudioLibrary.cpp
@@ -1088,7 +1088,7 @@ bool CAudioLibrary::FillFileItemList(const CVariant &parameterObject, CFileItemL
return success;
}
-void CAudioLibrary::FillItemArtistIDs(const std::vector<int> artistids, CFileItemPtr &item)
+void CAudioLibrary::FillItemArtistIDs(const std::vector<int>& artistids, CFileItemPtr& item)
{
// Add artistIds as separate property as not part of CMusicInfoTag
CVariant artistidObj(CVariant::VariantTypeArray);
diff --git a/xbmc/interfaces/json-rpc/AudioLibrary.h b/xbmc/interfaces/json-rpc/AudioLibrary.h
index 8cd8b318b8..39a722f02f 100644
--- a/xbmc/interfaces/json-rpc/AudioLibrary.h
+++ b/xbmc/interfaces/json-rpc/AudioLibrary.h
@@ -57,7 +57,7 @@ namespace JSONRPC
private:
static void FillAlbumItem(const CAlbum &album, const std::string &path, CFileItemPtr &item);
- static void FillItemArtistIDs(const std::vector<int> artistids, CFileItemPtr &item);
+ static void FillItemArtistIDs(const std::vector<int>& artistids, CFileItemPtr& item);
static bool CheckForAdditionalProperties(const CVariant &properties, const std::set<std::string> &checkProperties, std::set<std::string> &foundProperties);
};
diff --git a/xbmc/interfaces/json-rpc/FileItemHandler.cpp b/xbmc/interfaces/json-rpc/FileItemHandler.cpp
index 1e680aab39..bafbe15aaa 100644
--- a/xbmc/interfaces/json-rpc/FileItemHandler.cpp
+++ b/xbmc/interfaces/json-rpc/FileItemHandler.cpp
@@ -269,7 +269,15 @@ void CFileItemHandler::HandleFileItemList(const char *ID, bool allowFile, const
delete thumbLoader;
}
-void CFileItemHandler::HandleFileItem(const char *ID, bool allowFile, const char *resultname, CFileItemPtr item, const CVariant &parameterObject, const CVariant &validFields, CVariant &result, bool append /* = true */, CThumbLoader *thumbLoader /* = NULL */)
+void CFileItemHandler::HandleFileItem(const char* ID,
+ bool allowFile,
+ const char* resultname,
+ const CFileItemPtr& item,
+ const CVariant& parameterObject,
+ const CVariant& validFields,
+ CVariant& result,
+ bool append /* = true */,
+ CThumbLoader* thumbLoader /* = NULL */)
{
std::set<std::string> fields;
if (parameterObject.isMember("properties") && parameterObject["properties"].isArray())
@@ -281,7 +289,15 @@ void CFileItemHandler::HandleFileItem(const char *ID, bool allowFile, const char
HandleFileItem(ID, allowFile, resultname, item, parameterObject, fields, result, append, thumbLoader);
}
-void CFileItemHandler::HandleFileItem(const char *ID, bool allowFile, const char *resultname, CFileItemPtr item, const CVariant &parameterObject, const std::set<std::string> &validFields, CVariant &result, bool append /* = true */, CThumbLoader *thumbLoader /* = NULL */)
+void CFileItemHandler::HandleFileItem(const char* ID,
+ bool allowFile,
+ const char* resultname,
+ const CFileItemPtr& item,
+ const CVariant& parameterObject,
+ const std::set<std::string>& validFields,
+ CVariant& result,
+ bool append /* = true */,
+ CThumbLoader* thumbLoader /* = NULL */)
{
CVariant object;
std::set<std::string> fields(validFields.begin(), validFields.end());
diff --git a/xbmc/interfaces/json-rpc/FileItemHandler.h b/xbmc/interfaces/json-rpc/FileItemHandler.h
index d481138ab5..ca53d2de0d 100644
--- a/xbmc/interfaces/json-rpc/FileItemHandler.h
+++ b/xbmc/interfaces/json-rpc/FileItemHandler.h
@@ -25,8 +25,24 @@ namespace JSONRPC
static void FillDetails(const ISerializable *info, const CFileItemPtr &item, std::set<std::string> &fields, CVariant &result, CThumbLoader *thumbLoader = NULL);
static void HandleFileItemList(const char *ID, bool allowFile, const char *resultname, CFileItemList &items, const CVariant &parameterObject, CVariant &result, bool sortLimit = true);
static void HandleFileItemList(const char *ID, bool allowFile, const char *resultname, CFileItemList &items, const CVariant &parameterObject, CVariant &result, int size, bool sortLimit = true);
- static void HandleFileItem(const char *ID, bool allowFile, const char *resultname, CFileItemPtr item, const CVariant &parameterObject, const CVariant &validFields, CVariant &result, bool append = true, CThumbLoader *thumbLoader = NULL);
- static void HandleFileItem(const char *ID, bool allowFile, const char *resultname, CFileItemPtr item, const CVariant &parameterObject, const std::set<std::string> &validFields, CVariant &result, bool append = true, CThumbLoader *thumbLoader = NULL);
+ static void HandleFileItem(const char* ID,
+ bool allowFile,
+ const char* resultname,
+ const CFileItemPtr& item,
+ const CVariant& parameterObject,
+ const CVariant& validFields,
+ CVariant& result,
+ bool append = true,
+ CThumbLoader* thumbLoader = NULL);
+ static void HandleFileItem(const char* ID,
+ bool allowFile,
+ const char* resultname,
+ const CFileItemPtr& item,
+ const CVariant& parameterObject,
+ const std::set<std::string>& validFields,
+ CVariant& result,
+ bool append = true,
+ CThumbLoader* thumbLoader = NULL);
static bool FillFileItemList(const CVariant &parameterObject, CFileItemList &list);
private:
diff --git a/xbmc/interfaces/json-rpc/FileOperations.cpp b/xbmc/interfaces/json-rpc/FileOperations.cpp
index 70c075682e..78a027dc50 100644
--- a/xbmc/interfaces/json-rpc/FileOperations.cpp
+++ b/xbmc/interfaces/json-rpc/FileOperations.cpp
@@ -280,7 +280,11 @@ JSONRPC_STATUS CFileOperations::Download(const std::string &method, ITransportLa
return transport->Download(parameterObject["path"].asString().c_str(), result) ? OK : InvalidParams;
}
-bool CFileOperations::FillFileItem(const CFileItemPtr &originalItem, CFileItemPtr &item, std::string media /* = "" */, const CVariant &parameterObject /* = CVariant(CVariant::VariantTypeArray) */)
+bool CFileOperations::FillFileItem(
+ const CFileItemPtr& originalItem,
+ CFileItemPtr& item,
+ const std::string& media /* = "" */,
+ const CVariant& parameterObject /* = CVariant(CVariant::VariantTypeArray) */)
{
if (originalItem.get() == NULL)
return false;
diff --git a/xbmc/interfaces/json-rpc/FileOperations.h b/xbmc/interfaces/json-rpc/FileOperations.h
index c3b13db554..d3707f7896 100644
--- a/xbmc/interfaces/json-rpc/FileOperations.h
+++ b/xbmc/interfaces/json-rpc/FileOperations.h
@@ -26,7 +26,11 @@ namespace JSONRPC
static JSONRPC_STATUS PrepareDownload(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
static JSONRPC_STATUS Download(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static bool FillFileItem(const CFileItemPtr &originalItem, CFileItemPtr &item, std::string media = "", const CVariant &parameterObject = CVariant(CVariant::VariantTypeArray));
+ static bool FillFileItem(
+ const CFileItemPtr& originalItem,
+ CFileItemPtr& item,
+ const std::string& media = "",
+ const CVariant& parameterObject = CVariant(CVariant::VariantTypeArray));
static bool FillFileItemList(const CVariant &parameterObject, CFileItemList &list);
};
}
diff --git a/xbmc/interfaces/json-rpc/JSONRPCUtils.h b/xbmc/interfaces/json-rpc/JSONRPCUtils.h
index f5104ce607..d1dfbe47de 100644
--- a/xbmc/interfaces/json-rpc/JSONRPCUtils.h
+++ b/xbmc/interfaces/json-rpc/JSONRPCUtils.h
@@ -124,7 +124,7 @@ namespace JSONRPC
\param permission String representation of the OperationPermission
\return OperationPermission value of the given string representation
*/
- inline OperationPermission StringToPermission(std::string permission)
+ inline OperationPermission StringToPermission(const std::string& permission)
{
if (permission.compare("ControlPlayback") == 0)
return ControlPlayback;
diff --git a/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp b/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp
index 1b21fa6f23..f052d53aa8 100644
--- a/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp
+++ b/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp
@@ -1200,7 +1200,8 @@ JSONSchemaTypeDefinition::CJsonSchemaPropertiesMap::CJsonSchemaPropertiesMap() :
{
}
-void JSONSchemaTypeDefinition::CJsonSchemaPropertiesMap::add(JSONSchemaTypeDefinitionPtr property)
+void JSONSchemaTypeDefinition::CJsonSchemaPropertiesMap::add(
+ const JSONSchemaTypeDefinitionPtr& property)
{
std::string name = property->name;
StringUtils::ToLower(name);
@@ -1348,7 +1349,8 @@ JSONRPC_STATUS JsonRpcMethod::Check(const CVariant &requestParameters, ITranspor
return MethodNotFound;
}
-bool JsonRpcMethod::parseParameter(const CVariant &value, JSONSchemaTypeDefinitionPtr parameter)
+bool JsonRpcMethod::parseParameter(const CVariant& value,
+ const JSONSchemaTypeDefinitionPtr& parameter)
{
parameter->name = GetString(value["name"], "");
@@ -1379,7 +1381,12 @@ bool JsonRpcMethod::parseReturn(const CVariant &value)
return true;
}
-JSONRPC_STATUS JsonRpcMethod::checkParameter(const CVariant &requestParameters, JSONSchemaTypeDefinitionPtr type, unsigned int position, CVariant &outputParameters, unsigned int &handled, CVariant &errorData)
+JSONRPC_STATUS JsonRpcMethod::checkParameter(const CVariant& requestParameters,
+ const JSONSchemaTypeDefinitionPtr& type,
+ unsigned int position,
+ CVariant& outputParameters,
+ unsigned int& handled,
+ CVariant& errorData)
{
// Let's check if the parameter has been provided
if (ParameterExists(requestParameters, type->name, position))
@@ -1969,7 +1976,8 @@ bool CJSONServiceDescription::parseJSONSchemaType(const CVariant &value, std::ve
return false;
}
-void CJSONServiceDescription::addReferenceTypeDefinition(JSONSchemaTypeDefinitionPtr typeDefinition)
+void CJSONServiceDescription::addReferenceTypeDefinition(
+ const JSONSchemaTypeDefinitionPtr& typeDefinition)
{
// If the given json value is no object or does not contain an "id" field
// of type string it is no valid type definition
@@ -2009,7 +2017,8 @@ void CJSONServiceDescription::removeReferenceTypeDefinition(const std::string &t
m_types.erase(type);
}
-void CJSONServiceDescription::getReferencedTypes(const JSONSchemaTypeDefinitionPtr type, std::vector<std::string> &referencedTypes)
+void CJSONServiceDescription::getReferencedTypes(const JSONSchemaTypeDefinitionPtr& type,
+ std::vector<std::string>& referencedTypes)
{
// If the current type is a referenceable object, we can add it to the list
if (type->ID.size() > 0)
diff --git a/xbmc/interfaces/json-rpc/JSONServiceDescription.h b/xbmc/interfaces/json-rpc/JSONServiceDescription.h
index 8997898c0d..ee489201e7 100644
--- a/xbmc/interfaces/json-rpc/JSONServiceDescription.h
+++ b/xbmc/interfaces/json-rpc/JSONServiceDescription.h
@@ -184,7 +184,7 @@ namespace JSONRPC
public:
CJsonSchemaPropertiesMap();
- void add(JSONSchemaTypeDefinitionPtr property);
+ void add(const JSONSchemaTypeDefinitionPtr& property);
typedef std::map<std::string, JSONSchemaTypeDefinitionPtr>::const_iterator JSONSchemaPropertiesIterator;
JSONSchemaPropertiesIterator begin() const;
@@ -265,9 +265,14 @@ namespace JSONRPC
JSONSchemaTypeDefinitionPtr returns;
private:
- bool parseParameter(const CVariant &value, JSONSchemaTypeDefinitionPtr parameter);
+ bool parseParameter(const CVariant& value, const JSONSchemaTypeDefinitionPtr& parameter);
bool parseReturn(const CVariant &value);
- static JSONRPC_STATUS checkParameter(const CVariant &requestParameters, JSONSchemaTypeDefinitionPtr type, unsigned int position, CVariant &outputParameters, unsigned int &handled, CVariant &errorData);
+ static JSONRPC_STATUS checkParameter(const CVariant& requestParameters,
+ const JSONSchemaTypeDefinitionPtr& type,
+ unsigned int position,
+ CVariant& outputParameters,
+ unsigned int& handled,
+ CVariant& errorData);
};
/*!
@@ -390,10 +395,11 @@ namespace JSONRPC
static bool addMethod(const std::string &jsonMethod, MethodCall method);
static void parseHeader(const CVariant &descriptionObject);
static bool parseJSONSchemaType(const CVariant &value, std::vector<JSONSchemaTypeDefinitionPtr>& typeDefinitions, JSONSchemaType &schemaType, std::string &missingReference);
- static void addReferenceTypeDefinition(JSONSchemaTypeDefinitionPtr typeDefinition);
+ static void addReferenceTypeDefinition(const JSONSchemaTypeDefinitionPtr& typeDefinition);
static void removeReferenceTypeDefinition(const std::string &typeID);
- static void getReferencedTypes(const JSONSchemaTypeDefinitionPtr type, std::vector<std::string> &referencedTypes);
+ static void getReferencedTypes(const JSONSchemaTypeDefinitionPtr& type,
+ std::vector<std::string>& referencedTypes);
class CJsonRpcMethodMap
{
diff --git a/xbmc/interfaces/json-rpc/JSONUtils.h b/xbmc/interfaces/json-rpc/JSONUtils.h
index 66e49a6714..6b4ebf57a3 100644
--- a/xbmc/interfaces/json-rpc/JSONUtils.h
+++ b/xbmc/interfaces/json-rpc/JSONUtils.h
@@ -120,7 +120,13 @@ namespace JSONRPC
the given object is not an array) or for a parameter at the
given position (if the given object is an array).
*/
- static inline bool ParameterExists(const CVariant &parameterObject, std::string key, unsigned int position) { return IsValueMember(parameterObject, key) || (parameterObject.isArray() && parameterObject.size() > position); }
+ static inline bool ParameterExists(const CVariant& parameterObject,
+ const std::string& key,
+ unsigned int position)
+ {
+ return IsValueMember(parameterObject, key) ||
+ (parameterObject.isArray() && parameterObject.size() > position);
+ }
/*!
\brief Checks if the given object contains a value
@@ -130,7 +136,10 @@ namespace JSONRPC
\return True if the given object contains a member with
the given key otherwise false
*/
- static inline bool IsValueMember(const CVariant &value, std::string key) { return value.isMember(key); }
+ static inline bool IsValueMember(const CVariant& value, const std::string& key)
+ {
+ return value.isMember(key);
+ }
/*!
\brief Returns the json value of a parameter
@@ -144,7 +153,12 @@ namespace JSONRPC
the given object is not an array) or of the parameter at the
given position (if the given object is an array).
*/
- static inline CVariant GetParameter(const CVariant &parameterObject, std::string key, unsigned int position) { return IsValueMember(parameterObject, key) ? parameterObject[key] : parameterObject[position]; }
+ static inline CVariant GetParameter(const CVariant& parameterObject,
+ const std::string& key,
+ unsigned int position)
+ {
+ return IsValueMember(parameterObject, key) ? parameterObject[key] : parameterObject[position];
+ }
/*!
\brief Returns the json value of a parameter or the given
@@ -161,7 +175,17 @@ namespace JSONRPC
given position (if the given object is an array). If the
parameter does not exist the given default value is returned.
*/
- static inline CVariant GetParameter(const CVariant &parameterObject, std::string key, unsigned int position, CVariant fallback) { return IsValueMember(parameterObject, key) ? parameterObject[key] : ((parameterObject.isArray() && parameterObject.size() > position) ? parameterObject[position] : fallback); }
+ static inline CVariant GetParameter(const CVariant& parameterObject,
+ const std::string& key,
+ unsigned int position,
+ const CVariant& fallback)
+ {
+ return IsValueMember(parameterObject, key)
+ ? parameterObject[key]
+ : ((parameterObject.isArray() && parameterObject.size() > position)
+ ? parameterObject[position]
+ : fallback);
+ }
/*!
\brief Returns the given json value as a string
@@ -187,7 +211,7 @@ namespace JSONRPC
\param transport String representation of the TransportLayerCapability
\return TransportLayerCapability value of the given string representation
*/
- static inline TransportLayerCapability StringToTransportLayer(std::string transport)
+ static inline TransportLayerCapability StringToTransportLayer(const std::string& transport)
{
if (transport.compare("Announcing") == 0)
return Announcing;
@@ -205,7 +229,7 @@ namespace JSONRPC
\param valueType String representation of the JSONSchemaType
\return JSONSchemaType value of the given string representation
*/
- static inline JSONSchemaType StringToSchemaValueType(std::string valueType)
+ static inline JSONSchemaType StringToSchemaValueType(const std::string& valueType)
{
if (valueType.compare("null") == 0)
return NullValue;
@@ -417,7 +441,10 @@ namespace JSONRPC
static inline bool HasType(JSONSchemaType typeObject, JSONSchemaType type) { return (typeObject & type) == type; }
- static inline bool ParameterNotNull(const CVariant &parameterObject, std::string key) { return parameterObject.isMember(key) && !parameterObject[key].isNull(); }
+ static inline bool ParameterNotNull(const CVariant& parameterObject, const std::string& key)
+ {
+ return parameterObject.isMember(key) && !parameterObject[key].isNull();
+ }
/*!
\brief Copies the values from the jsonStringArray to the stringArray.
diff --git a/xbmc/interfaces/json-rpc/SettingsOperations.cpp b/xbmc/interfaces/json-rpc/SettingsOperations.cpp
index 890e6ee7fd..e6bb10068e 100644
--- a/xbmc/interfaces/json-rpc/SettingsOperations.cpp
+++ b/xbmc/interfaces/json-rpc/SettingsOperations.cpp
@@ -341,7 +341,8 @@ SettingLevel CSettingsOperations::ParseSettingLevel(const std::string &strLevel)
return SettingLevel::Standard;
}
-bool CSettingsOperations::SerializeISetting(std::shared_ptr<const ISetting> setting, CVariant &obj)
+bool CSettingsOperations::SerializeISetting(const std::shared_ptr<const ISetting>& setting,
+ CVariant& obj)
{
if (setting == NULL)
return false;
@@ -351,7 +352,8 @@ bool CSettingsOperations::SerializeISetting(std::shared_ptr<const ISetting> sett
return true;
}
-bool CSettingsOperations::SerializeSettingSection(std::shared_ptr<const CSettingSection> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingSection(
+ const std::shared_ptr<const CSettingSection>& setting, CVariant& obj)
{
if (!SerializeISetting(setting, obj))
return false;
@@ -363,7 +365,8 @@ bool CSettingsOperations::SerializeSettingSection(std::shared_ptr<const CSetting
return true;
}
-bool CSettingsOperations::SerializeSettingCategory(std::shared_ptr<const CSettingCategory> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingCategory(
+ const std::shared_ptr<const CSettingCategory>& setting, CVariant& obj)
{
if (!SerializeISetting(setting, obj))
return false;
@@ -375,12 +378,14 @@ bool CSettingsOperations::SerializeSettingCategory(std::shared_ptr<const CSettin
return true;
}
-bool CSettingsOperations::SerializeSettingGroup(std::shared_ptr<const CSettingGroup> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingGroup(const std::shared_ptr<const CSettingGroup>& setting,
+ CVariant& obj)
{
return SerializeISetting(setting, obj);
}
-bool CSettingsOperations::SerializeSetting(std::shared_ptr<const CSetting> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSetting(const std::shared_ptr<const CSetting>& setting,
+ CVariant& obj)
{
if (!SerializeISetting(setting, obj))
return false;
@@ -463,7 +468,8 @@ bool CSettingsOperations::SerializeSetting(std::shared_ptr<const CSetting> setti
return true;
}
-bool CSettingsOperations::SerializeSettingBool(std::shared_ptr<const CSettingBool> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingBool(const std::shared_ptr<const CSettingBool>& setting,
+ CVariant& obj)
{
if (setting == NULL)
return false;
@@ -474,7 +480,8 @@ bool CSettingsOperations::SerializeSettingBool(std::shared_ptr<const CSettingBoo
return true;
}
-bool CSettingsOperations::SerializeSettingInt(std::shared_ptr<const CSettingInt> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingInt(const std::shared_ptr<const CSettingInt>& setting,
+ CVariant& obj)
{
if (setting == NULL)
return false;
@@ -540,7 +547,8 @@ bool CSettingsOperations::SerializeSettingInt(std::shared_ptr<const CSettingInt>
return true;
}
-bool CSettingsOperations::SerializeSettingNumber(std::shared_ptr<const CSettingNumber> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingNumber(
+ const std::shared_ptr<const CSettingNumber>& setting, CVariant& obj)
{
if (setting == NULL)
return false;
@@ -555,7 +563,8 @@ bool CSettingsOperations::SerializeSettingNumber(std::shared_ptr<const CSettingN
return true;
}
-bool CSettingsOperations::SerializeSettingString(std::shared_ptr<const CSettingString> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingString(
+ const std::shared_ptr<const CSettingString>& setting, CVariant& obj)
{
if (setting == NULL)
return false;
@@ -643,7 +652,8 @@ bool CSettingsOperations::SerializeSettingString(std::shared_ptr<const CSettingS
return true;
}
-bool CSettingsOperations::SerializeSettingAction(std::shared_ptr<const CSettingAction> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingAction(
+ const std::shared_ptr<const CSettingAction>& setting, CVariant& obj)
{
if (setting == NULL)
return false;
@@ -653,7 +663,8 @@ bool CSettingsOperations::SerializeSettingAction(std::shared_ptr<const CSettingA
return true;
}
-bool CSettingsOperations::SerializeSettingList(std::shared_ptr<const CSettingList> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingList(const std::shared_ptr<const CSettingList>& setting,
+ CVariant& obj)
{
if (setting == NULL ||
!SerializeSetting(setting->GetDefinition(), obj["definition"]))
@@ -670,7 +681,8 @@ bool CSettingsOperations::SerializeSettingList(std::shared_ptr<const CSettingLis
return true;
}
-bool CSettingsOperations::SerializeSettingPath(std::shared_ptr<const CSettingPath> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingPath(const std::shared_ptr<const CSettingPath>& setting,
+ CVariant& obj)
{
if (setting == NULL)
return false;
@@ -682,7 +694,8 @@ bool CSettingsOperations::SerializeSettingPath(std::shared_ptr<const CSettingPat
return true;
}
-bool CSettingsOperations::SerializeSettingAddon(std::shared_ptr<const CSettingAddon> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingAddon(const std::shared_ptr<const CSettingAddon>& setting,
+ CVariant& obj)
{
if (setting == NULL)
return false;
@@ -693,7 +706,8 @@ bool CSettingsOperations::SerializeSettingAddon(std::shared_ptr<const CSettingAd
return true;
}
-bool CSettingsOperations::SerializeSettingDate(std::shared_ptr<const CSettingDate> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingDate(const std::shared_ptr<const CSettingDate>& setting,
+ CVariant& obj)
{
if (setting == NULL)
return false;
@@ -703,7 +717,8 @@ bool CSettingsOperations::SerializeSettingDate(std::shared_ptr<const CSettingDat
return true;
}
-bool CSettingsOperations::SerializeSettingTime(std::shared_ptr<const CSettingTime> setting, CVariant &obj)
+bool CSettingsOperations::SerializeSettingTime(const std::shared_ptr<const CSettingTime>& setting,
+ CVariant& obj)
{
if (setting == NULL)
return false;
@@ -713,7 +728,8 @@ bool CSettingsOperations::SerializeSettingTime(std::shared_ptr<const CSettingTim
return true;
}
-bool CSettingsOperations::SerializeSettingControl(std::shared_ptr<const ISettingControl> control, CVariant &obj)
+bool CSettingsOperations::SerializeSettingControl(
+ const std::shared_ptr<const ISettingControl>& control, CVariant& obj)
{
if (control == NULL)
return false;
diff --git a/xbmc/interfaces/json-rpc/SettingsOperations.h b/xbmc/interfaces/json-rpc/SettingsOperations.h
index c1c9731740..fd08d250d7 100644
--- a/xbmc/interfaces/json-rpc/SettingsOperations.h
+++ b/xbmc/interfaces/json-rpc/SettingsOperations.h
@@ -47,22 +47,36 @@ namespace JSONRPC
private:
static SettingLevel ParseSettingLevel(const std::string &strLevel);
- static bool SerializeISetting(std::shared_ptr<const ISetting> setting, CVariant &obj);
- static bool SerializeSettingSection(std::shared_ptr<const CSettingSection> setting, CVariant &obj);
- static bool SerializeSettingCategory(std::shared_ptr<const CSettingCategory> setting, CVariant &obj);
- static bool SerializeSettingGroup(std::shared_ptr<const CSettingGroup> setting, CVariant &obj);
- static bool SerializeSetting(std::shared_ptr<const CSetting> setting, CVariant &obj);
- static bool SerializeSettingBool(std::shared_ptr<const CSettingBool> setting, CVariant &obj);
- static bool SerializeSettingInt(std::shared_ptr<const CSettingInt> setting, CVariant &obj);
- static bool SerializeSettingNumber(std::shared_ptr<const CSettingNumber> setting, CVariant &obj);
- static bool SerializeSettingString(std::shared_ptr<const CSettingString> setting, CVariant &obj);
- static bool SerializeSettingAction(std::shared_ptr<const CSettingAction> setting, CVariant &obj);
- static bool SerializeSettingList(std::shared_ptr<const CSettingList> setting, CVariant &obj);
- static bool SerializeSettingPath(std::shared_ptr<const CSettingPath> setting, CVariant &obj);
- static bool SerializeSettingAddon(std::shared_ptr<const CSettingAddon> setting, CVariant &obj);
- static bool SerializeSettingDate(std::shared_ptr<const CSettingDate> setting, CVariant &obj);
- static bool SerializeSettingTime(std::shared_ptr<const CSettingTime> setting, CVariant &obj);
- static bool SerializeSettingControl(std::shared_ptr<const ISettingControl> control, CVariant &obj);
+ static bool SerializeISetting(const std::shared_ptr<const ISetting>& setting, CVariant& obj);
+ static bool SerializeSettingSection(const std::shared_ptr<const CSettingSection>& setting,
+ CVariant& obj);
+ static bool SerializeSettingCategory(const std::shared_ptr<const CSettingCategory>& setting,
+ CVariant& obj);
+ static bool SerializeSettingGroup(const std::shared_ptr<const CSettingGroup>& setting,
+ CVariant& obj);
+ static bool SerializeSetting(const std::shared_ptr<const CSetting>& setting, CVariant& obj);
+ static bool SerializeSettingBool(const std::shared_ptr<const CSettingBool>& setting,
+ CVariant& obj);
+ static bool SerializeSettingInt(const std::shared_ptr<const CSettingInt>& setting,
+ CVariant& obj);
+ static bool SerializeSettingNumber(const std::shared_ptr<const CSettingNumber>& setting,
+ CVariant& obj);
+ static bool SerializeSettingString(const std::shared_ptr<const CSettingString>& setting,
+ CVariant& obj);
+ static bool SerializeSettingAction(const std::shared_ptr<const CSettingAction>& setting,
+ CVariant& obj);
+ static bool SerializeSettingList(const std::shared_ptr<const CSettingList>& setting,
+ CVariant& obj);
+ static bool SerializeSettingPath(const std::shared_ptr<const CSettingPath>& setting,
+ CVariant& obj);
+ static bool SerializeSettingAddon(const std::shared_ptr<const CSettingAddon>& setting,
+ CVariant& obj);
+ static bool SerializeSettingDate(const std::shared_ptr<const CSettingDate>& setting,
+ CVariant& obj);
+ static bool SerializeSettingTime(const std::shared_ptr<const CSettingTime>& setting,
+ CVariant& obj);
+ static bool SerializeSettingControl(const std::shared_ptr<const ISettingControl>& control,
+ CVariant& obj);
static void SerializeSettingListValues(const std::vector<CVariant> &values, CVariant &obj);
};
diff --git a/xbmc/interfaces/legacy/Control.cpp b/xbmc/interfaces/legacy/Control.cpp
index 0b84900732..f4398fec7d 100644
--- a/xbmc/interfaces/legacy/Control.cpp
+++ b/xbmc/interfaces/legacy/Control.cpp
@@ -1201,7 +1201,8 @@ namespace XBMCAddon
sendLabelBind(vecItems.size());
}
- void ControlList::internAddListItem(AddonClass::Ref<ListItem> pListItem, bool sendMessage)
+ void ControlList::internAddListItem(const AddonClass::Ref<ListItem>& pListItem,
+ bool sendMessage)
{
if (pListItem.isNull())
throw WindowException("NULL ListItem passed to ControlList::addListItem");
diff --git a/xbmc/interfaces/legacy/Control.h b/xbmc/interfaces/legacy/Control.h
index 4d884539e3..cc9a8f4ae7 100644
--- a/xbmc/interfaces/legacy/Control.h
+++ b/xbmc/interfaces/legacy/Control.h
@@ -1148,7 +1148,7 @@ namespace XBMCAddon
///
class ControlList : public Control
{
- void internAddListItem(AddonClass::Ref<ListItem> listitem, bool sendMessage);
+ void internAddListItem(const AddonClass::Ref<ListItem>& listitem, bool sendMessage);
public:
ControlList(long x, long y, long width, long height, const char* font = NULL,
diff --git a/xbmc/interfaces/legacy/DrmCryptoSession.cpp b/xbmc/interfaces/legacy/DrmCryptoSession.cpp
index 6409e5f094..26f69be5af 100644
--- a/xbmc/interfaces/legacy/DrmCryptoSession.cpp
+++ b/xbmc/interfaces/legacy/DrmCryptoSession.cpp
@@ -16,10 +16,12 @@ namespace XBMCAddon
{
namespace xbmcdrm
{
- CryptoSession::CryptoSession(String UUID, String cipherAlgorithm, String macAlgorithm)
- : m_cryptoSession(DRM::CCryptoSession::GetCryptoSession(UUID, cipherAlgorithm, macAlgorithm))
- {
- }
+ CryptoSession::CryptoSession(const String& UUID,
+ const String& cipherAlgorithm,
+ const String& macAlgorithm)
+ : m_cryptoSession(DRM::CCryptoSession::GetCryptoSession(UUID, cipherAlgorithm, macAlgorithm))
+ {
+ }
CryptoSession::~CryptoSession()
{
@@ -56,7 +58,7 @@ namespace XBMCAddon
m_cryptoSession->RemoveKeys();
}
- void CryptoSession::RestoreKeys(String keySetId)
+ void CryptoSession::RestoreKeys(const String& keySetId)
{
if (m_cryptoSession)
m_cryptoSession->RestoreKeys(keySetId);
diff --git a/xbmc/interfaces/legacy/DrmCryptoSession.h b/xbmc/interfaces/legacy/DrmCryptoSession.h
index 562fa8bebe..816bec8bc5 100644
--- a/xbmc/interfaces/legacy/DrmCryptoSession.h
+++ b/xbmc/interfaces/legacy/DrmCryptoSession.h
@@ -96,8 +96,7 @@ namespace XBMCAddon
{
DRM::CCryptoSession* m_cryptoSession;
public:
-
- CryptoSession(String UUID, String cipherAlgorithm, String macAlgorithm);
+ CryptoSession(const String& UUID, const String& cipherAlgorithm, const String& macAlgorithm);
~CryptoSession() override;
#ifdef DOXYGEN_SHOULD_USE_THIS
@@ -217,7 +216,7 @@ namespace XBMCAddon
///
RestoreKeys(...);
#else
- void RestoreKeys(String keySetId);
+ void RestoreKeys(const String& keySetId);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
diff --git a/xbmc/interfaces/legacy/ListItem.cpp b/xbmc/interfaces/legacy/ListItem.cpp
index 501e7b466f..b5089e23b8 100644
--- a/xbmc/interfaces/legacy/ListItem.cpp
+++ b/xbmc/interfaces/legacy/ListItem.cpp
@@ -24,6 +24,7 @@
#include <cstdlib>
#include <sstream>
+#include <utility>
namespace XBMCAddon
{
@@ -135,7 +136,10 @@ namespace XBMCAddon
vtag.SetUniqueID(it.second, it.first, it.first == defaultrating);
}
- void ListItem::setRating(std::string type, float rating, int votes /* = 0 */, bool defaultt /* = false */)
+ void ListItem::setRating(const std::string& type,
+ float rating,
+ int votes /* = 0 */,
+ bool defaultt /* = false */)
{
if (!item) return;
@@ -148,7 +152,7 @@ namespace XBMCAddon
if (!item) return;
XBMCAddonUtils::GuiLock lock(languageHook, m_offscreen);
- GetVideoInfoTag()->m_namedSeasons[number] = name;
+ GetVideoInfoTag()->m_namedSeasons[number] = std::move(name);
}
void ListItem::select(bool selected)
@@ -688,7 +692,14 @@ namespace XBMCAddon
GetVideoInfoTag()->m_fanart.Pack();
}
- void ListItem::addAvailableArtwork(std::string url, std::string art_type, std::string preview, std::string referrer, std::string cache, bool post, bool isgz, int season)
+ void ListItem::addAvailableArtwork(const std::string& url,
+ const std::string& art_type,
+ const std::string& preview,
+ const std::string& referrer,
+ const std::string& cache,
+ bool post,
+ bool isgz,
+ int season)
{
XBMCAddonUtils::GuiLock lock(languageHook, m_offscreen);
GetVideoInfoTag()->m_strPictureURL.AddParsedUrl(url, art_type, preview, referrer, cache, post,
diff --git a/xbmc/interfaces/legacy/ListItem.h b/xbmc/interfaces/legacy/ListItem.h
index 5169837242..e419bb6f3a 100644
--- a/xbmc/interfaces/legacy/ListItem.h
+++ b/xbmc/interfaces/legacy/ListItem.h
@@ -20,6 +20,7 @@
#include "commons/Exception.h"
#include <map>
+#include <utility>
#include <vector>
@@ -79,9 +80,7 @@ namespace XBMCAddon
bool offscreen = false);
#if !defined SWIG && !defined DOXYGEN_SHOULD_SKIP_THIS
- inline explicit ListItem(CFileItemPtr pitem) :
- item(pitem), m_offscreen(false)
- {}
+ inline explicit ListItem(CFileItemPtr pitem) : item(std::move(pitem)), m_offscreen(false) {}
static inline AddonClass::Ref<ListItem> fromString(const String& str)
{
@@ -319,7 +318,7 @@ namespace XBMCAddon
///
setRating(...);
#else
- void setRating(std::string type, float rating, int votes = 0, bool defaultt = false);
+ void setRating(const std::string& type, float rating, int votes = 0, bool defaultt = false);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
@@ -773,7 +772,14 @@ namespace XBMCAddon
///
addAvailableArtwork(...);
#else
- void addAvailableArtwork(std::string url, std::string art_type = "", std::string preview = "", std::string referrer = "", std::string cache = "", bool post = false, bool isgz = false, int season = -1);
+ void addAvailableArtwork(const std::string& url,
+ const std::string& art_type = "",
+ const std::string& preview = "",
+ const std::string& referrer = "",
+ const std::string& cache = "",
+ bool post = false,
+ bool isgz = false,
+ int season = -1);
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
diff --git a/xbmc/interfaces/legacy/Monitor.h b/xbmc/interfaces/legacy/Monitor.h
index 7d30aeee15..aae6168210 100644
--- a/xbmc/interfaces/legacy/Monitor.h
+++ b/xbmc/interfaces/legacy/Monitor.h
@@ -43,16 +43,33 @@ namespace XBMCAddon
inline void OnScanStarted(const String &library)
{
XBMC_TRACE;
- invokeCallback(new CallbackFunction<Monitor,const String>(this,&Monitor::onScanStarted,library));
+ invokeCallback(
+ new CallbackFunction<Monitor, const String&>(this, &Monitor::onScanStarted, library));
}
inline void OnScanFinished(const String &library)
{
XBMC_TRACE;
- invokeCallback(new CallbackFunction<Monitor,const String>(this,&Monitor::onScanFinished,library));
+ invokeCallback(
+ new CallbackFunction<Monitor, const String&>(this, &Monitor::onScanFinished, library));
+ }
+ inline void OnCleanStarted(const String& library)
+ {
+ XBMC_TRACE;
+ invokeCallback(
+ new CallbackFunction<Monitor, const String&>(this, &Monitor::onCleanStarted, library));
+ }
+ inline void OnCleanFinished(const String& library)
+ {
+ XBMC_TRACE;
+ invokeCallback(
+ new CallbackFunction<Monitor, const String&>(this, &Monitor::onCleanFinished, library));
+ }
+ inline void OnNotification(const String& sender, const String& method, const String& data)
+ {
+ XBMC_TRACE;
+ invokeCallback(new CallbackFunction<Monitor, const String&, const String&, const String&>(
+ this, &Monitor::onNotification, sender, method, data));
}
- inline void OnCleanStarted(const String &library) { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor,const String>(this,&Monitor::onCleanStarted,library)); }
- inline void OnCleanFinished(const String &library) { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor,const String>(this,&Monitor::onCleanFinished,library)); }
- inline void OnNotification(const String &sender, const String &method, const String &data) { XBMC_TRACE; invokeCallback(new CallbackFunction<Monitor,const String,const String,const String>(this,&Monitor::onNotification,sender,method,data)); }
inline const String& GetId() { return Id; }
inline long GetInvokerId() { return invokerId; }
@@ -146,7 +163,7 @@ namespace XBMCAddon
///
onScanStarted(...);
#else
- virtual void onScanStarted(const String library) { XBMC_TRACE; }
+ virtual void onScanStarted(const String& library) { XBMC_TRACE; }
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
@@ -167,7 +184,7 @@ namespace XBMCAddon
///
onScanFinished(...);
#else
- virtual void onScanFinished(const String library) { XBMC_TRACE; }
+ virtual void onScanFinished(const String& library) { XBMC_TRACE; }
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
@@ -188,7 +205,7 @@ namespace XBMCAddon
///
onCleanStarted(...);
#else
- virtual void onCleanStarted(const String library) { XBMC_TRACE; }
+ virtual void onCleanStarted(const String& library) { XBMC_TRACE; }
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
@@ -209,7 +226,7 @@ namespace XBMCAddon
///
onCleanFinished(...);
#else
- virtual void onCleanFinished(const String library) { XBMC_TRACE; }
+ virtual void onCleanFinished(const String& library) { XBMC_TRACE; }
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
@@ -230,7 +247,10 @@ namespace XBMCAddon
///
onNotification(...);
#else
- virtual void onNotification(const String sender, const String method, const String data) { XBMC_TRACE; }
+ virtual void onNotification(const String& sender, const String& method, const String& data)
+ {
+ XBMC_TRACE;
+ }
#endif
#ifdef DOXYGEN_SHOULD_USE_THIS
diff --git a/xbmc/interfaces/python/PythonSwig.cpp.template b/xbmc/interfaces/python/PythonSwig.cpp.template
index 1a46bad644..3a241d64d9 100644
--- a/xbmc/interfaces/python/PythonSwig.cpp.template
+++ b/xbmc/interfaces/python/PythonSwig.cpp.template
@@ -54,6 +54,7 @@ Helper.setup(this,classes,
'double': '${result} = PyFloat_FromDouble(${api});',
'float': '${result} = Py_BuildValue("f", ${api});',
'std::string' : new File('typemaps/python.string.outtm'),
+ 'r.q(const).XBMCAddon::String' : new File('typemaps/python.string.outtm'),
'p.q(const).char' : '${result} = PyUnicode_FromString(${api});',
(Pattern.compile('''(p.){0,1}XbmcCommons::Buffer''')) : new File('typemaps/python.buffer.outtm'),
(Pattern.compile('''std::shared_ptr<\\(.*\\)>''')) : new File('typemaps/python.smart_ptr.outtm'),
diff --git a/xbmc/messaging/ApplicationMessenger.cpp b/xbmc/messaging/ApplicationMessenger.cpp
index 15a1497c0f..f4202af2b1 100644
--- a/xbmc/messaging/ApplicationMessenger.cpp
+++ b/xbmc/messaging/ApplicationMessenger.cpp
@@ -163,12 +163,16 @@ int CApplicationMessenger::SendMsg(uint32_t messageId, int param1, int param2, v
int CApplicationMessenger::SendMsg(uint32_t messageId, int param1, int param2, void* payload, std::string strParam)
{
- return SendMsg(ThreadMessage{ messageId, param1, param2, payload, strParam, std::vector<std::string>{} }, true);
+ return SendMsg(ThreadMessage{messageId, param1, param2, payload, std::move(strParam),
+ std::vector<std::string>{}},
+ true);
}
int CApplicationMessenger::SendMsg(uint32_t messageId, int param1, int param2, void* payload, std::string strParam, std::vector<std::string> params)
{
- return SendMsg(ThreadMessage{ messageId, param1, param2, payload, strParam, params }, true);
+ return SendMsg(
+ ThreadMessage{messageId, param1, param2, payload, std::move(strParam), std::move(params)},
+ true);
}
void CApplicationMessenger::PostMsg(uint32_t messageId)
@@ -188,12 +192,15 @@ void CApplicationMessenger::PostMsg(uint32_t messageId, int param1, int param2,
void CApplicationMessenger::PostMsg(uint32_t messageId, int param1, int param2, void* payload, std::string strParam)
{
- SendMsg(ThreadMessage{ messageId, param1, param2, payload, strParam, std::vector<std::string>{} }, false);
+ SendMsg(ThreadMessage{messageId, param1, param2, payload, std::move(strParam),
+ std::vector<std::string>{}},
+ false);
}
void CApplicationMessenger::PostMsg(uint32_t messageId, int param1, int param2, void* payload, std::string strParam, std::vector<std::string> params)
{
- SendMsg(ThreadMessage{ messageId, param1, param2, payload, strParam, params }, false);
+ SendMsg(ThreadMessage{messageId, param1, param2, payload, std::move(strParam), std::move(params)},
+ false);
}
void CApplicationMessenger::ProcessMessages()
diff --git a/xbmc/messaging/ThreadMessage.h b/xbmc/messaging/ThreadMessage.h
index b60202ad25..1a277ffcd4 100644
--- a/xbmc/messaging/ThreadMessage.h
+++ b/xbmc/messaging/ThreadMessage.h
@@ -10,6 +10,7 @@
#include <memory>
#include <string>
+#include <utility>
#include <vector>
class CEvent;
@@ -49,14 +50,19 @@ public:
{
}
- ThreadMessage(uint32_t messageId, int p1, int p2, void* payload, std::string param, std::vector<std::string> vecParams)
- : dwMessage{ messageId }
- , param1{ p1 }
- , param2{ p2 }
- , param3{ 0 }
- , lpVoid{ payload }
- , strParam( param )
- , params( vecParams )
+ ThreadMessage(uint32_t messageId,
+ int p1,
+ int p2,
+ void* payload,
+ std::string param,
+ std::vector<std::string> vecParams)
+ : dwMessage{messageId},
+ param1{p1},
+ param2{p2},
+ param3{0},
+ lpVoid{payload},
+ strParam(std::move(param)),
+ params(std::move(vecParams))
{
}
diff --git a/xbmc/messaging/helpers/DialogHelper.cpp b/xbmc/messaging/helpers/DialogHelper.cpp
index f6c877d303..2c042f5acb 100644
--- a/xbmc/messaging/helpers/DialogHelper.cpp
+++ b/xbmc/messaging/helpers/DialogHelper.cpp
@@ -21,7 +21,8 @@ namespace HELPERS
{
DialogResponse ShowYesNoDialogText(CVariant heading, CVariant text, CVariant noLabel, CVariant yesLabel, uint32_t autoCloseTimeout)
{
- return ShowYesNoCustomDialog(heading, text, noLabel, yesLabel, "", autoCloseTimeout);
+ return ShowYesNoCustomDialog(std::move(heading), std::move(text), std::move(noLabel),
+ std::move(yesLabel), "", autoCloseTimeout);
}
DialogResponse ShowYesNoCustomDialog(CVariant heading, CVariant text, CVariant noLabel, CVariant yesLabel, CVariant customLabel, uint32_t autoCloseTimeout)
diff --git a/xbmc/music/Artist.h b/xbmc/music/Artist.h
index c729d75046..37864b61ea 100644
--- a/xbmc/music/Artist.h
+++ b/xbmc/music/Artist.h
@@ -126,11 +126,17 @@ class CArtistCredit
public:
CArtistCredit() = default;
- explicit CArtistCredit(std::string strArtist) : m_strArtist(strArtist) { }
+ explicit CArtistCredit(std::string strArtist) : m_strArtist(std::move(strArtist)) {}
CArtistCredit(std::string strArtist, std::string strMusicBrainzArtistID)
- : m_strArtist(strArtist), m_strMusicBrainzArtistID(strMusicBrainzArtistID) { }
+ : m_strArtist(std::move(strArtist)), m_strMusicBrainzArtistID(std::move(strMusicBrainzArtistID))
+ {
+ }
CArtistCredit(std::string strArtist, std::string strSortName, std::string strMusicBrainzArtistID)
- : m_strArtist(strArtist), m_strSortName(strSortName), m_strMusicBrainzArtistID(strMusicBrainzArtistID) { }
+ : m_strArtist(std::move(strArtist)),
+ m_strSortName(std::move(strSortName)),
+ m_strMusicBrainzArtistID(std::move(strMusicBrainzArtistID))
+ {
+ }
bool operator<(const CArtistCredit& a) const
{
@@ -179,8 +185,17 @@ class CMusicRole
{
public:
CMusicRole() = default;
- CMusicRole(std::string strRole, std::string strArtist) : idRole(-1), m_strRole(strRole), m_strArtist(strArtist), idArtist(-1) { }
- CMusicRole(int role, std::string strRole, std::string strArtist, long ArtistId) : idRole(role), m_strRole(strRole), m_strArtist(strArtist), idArtist(ArtistId) { }
+ CMusicRole(std::string strRole, std::string strArtist)
+ : idRole(-1), m_strRole(std::move(strRole)), m_strArtist(std::move(strArtist)), idArtist(-1)
+ {
+ }
+ CMusicRole(int role, std::string strRole, std::string strArtist, long ArtistId)
+ : idRole(role),
+ m_strRole(std::move(strRole)),
+ m_strArtist(std::move(strArtist)),
+ idArtist(ArtistId)
+ {
+ }
std::string GetArtist() const { return m_strArtist; }
std::string GetRoleDesc() const { return m_strRole; }
int GetRoleId() const { return idRole; }
diff --git a/xbmc/music/ContextMenus.cpp b/xbmc/music/ContextMenus.cpp
index b3bcffa610..8a432f775d 100644
--- a/xbmc/music/ContextMenus.cpp
+++ b/xbmc/music/ContextMenus.cpp
@@ -12,12 +12,15 @@
#include "music/dialogs/GUIDialogMusicInfo.h"
#include "tags/MusicInfoTag.h"
+#include <utility>
namespace CONTEXTMENU
{
CMusicInfo::CMusicInfo(MediaType mediaType)
- : CStaticContextMenuAction(19033), m_mediaType(mediaType) {}
+ : CStaticContextMenuAction(19033), m_mediaType(std::move(mediaType))
+{
+}
bool CMusicInfo::IsVisible(const CFileItem& item) const
{
diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp
index 16aecbf9d5..16b9cf4e7a 100644
--- a/xbmc/music/MusicDatabase.cpp
+++ b/xbmc/music/MusicDatabase.cpp
@@ -2316,7 +2316,10 @@ bool CMusicDatabase::DeleteSongArtistsBySong(int idSong)
return ExecuteQuery(PrepareSQL("DELETE FROM song_artist WHERE idSong = %i", idSong));
}
-bool CMusicDatabase::AddAlbumArtist(int idArtist, int idAlbum, std::string strArtist, int iOrder)
+bool CMusicDatabase::AddAlbumArtist(int idArtist,
+ int idAlbum,
+ const std::string& strArtist,
+ int iOrder)
{
std::string strSQL;
strSQL = PrepareSQL("replace into album_artist (idArtist, idAlbum, strArtist, iOrder) values(%i,%i,'%s',%i)",
@@ -10675,7 +10678,7 @@ bool CMusicDatabase::CommitTransaction()
return false;
}
-bool CMusicDatabase::SetScraperAll(const std::string & strBaseDir, const ADDON::ScraperPtr scraper)
+bool CMusicDatabase::SetScraperAll(const std::string& strBaseDir, const ADDON::ScraperPtr& scraper)
{
if (nullptr == m_pDB)
return false;
@@ -10752,7 +10755,9 @@ bool CMusicDatabase::SetScraperAll(const std::string & strBaseDir, const ADDON::
return false;
}
-bool CMusicDatabase::SetScraper(int id, const CONTENT_TYPE &content, const ADDON::ScraperPtr scraper)
+bool CMusicDatabase::SetScraper(int id,
+ const CONTENT_TYPE& content,
+ const ADDON::ScraperPtr& scraper)
{
if (nullptr == m_pDB)
return false;
diff --git a/xbmc/music/MusicDatabase.h b/xbmc/music/MusicDatabase.h
index 91d69d4ee5..c7ab3328ae 100644
--- a/xbmc/music/MusicDatabase.h
+++ b/xbmc/music/MusicDatabase.h
@@ -413,7 +413,7 @@ public:
/////////////////////////////////////////////////
// Link tables
/////////////////////////////////////////////////
- bool AddAlbumArtist(int idArtist, int idAlbum, std::string strArtist, int iOrder);
+ bool AddAlbumArtist(int idArtist, int idAlbum, const std::string& strArtist, int iOrder);
bool GetAlbumsByArtist(int idArtist, std::vector<int>& albums);
bool GetArtistsByAlbum(int idAlbum, CFileItem* item);
bool GetArtistsByAlbum(int idAlbum, std::vector<std::string>& artistIDs);
@@ -540,8 +540,8 @@ public:
/////////////////////////////////////////////////
// Scraper
/////////////////////////////////////////////////
- bool SetScraper(int id, const CONTENT_TYPE &content, const ADDON::ScraperPtr scraper);
- bool SetScraperAll(const std::string& strBaseDir, const ADDON::ScraperPtr scraper);
+ bool SetScraper(int id, const CONTENT_TYPE& content, const ADDON::ScraperPtr& scraper);
+ bool SetScraperAll(const std::string& strBaseDir, const ADDON::ScraperPtr& scraper);
bool GetScraper(int id, const CONTENT_TYPE &content, ADDON::ScraperPtr& scraper);
/*! \brief Check whether a given scraper is in use.
diff --git a/xbmc/music/MusicUtils.cpp b/xbmc/music/MusicUtils.cpp
index f7e68547d3..0a15b6f1b8 100644
--- a/xbmc/music/MusicUtils.cpp
+++ b/xbmc/music/MusicUtils.cpp
@@ -36,15 +36,16 @@ namespace MUSIC_UTILS
std::string m_artType;
std::string m_newArt;
public:
- CSetArtJob(const CFileItemPtr item, const std::string& type, const std::string& newArt) :
- pItem(item),
- m_artType(type),
- m_newArt(newArt)
+ CSetArtJob(const CFileItemPtr& item, const std::string& type, const std::string& newArt)
+ : pItem(item), m_artType(type), m_newArt(newArt)
{ }
~CSetArtJob(void) override = default;
- bool HasSongExtraArtChanged(const CFileItemPtr pSongItem, const std::string& type, const int itemID, CMusicDatabase& db)
+ bool HasSongExtraArtChanged(const CFileItemPtr& pSongItem,
+ const std::string& type,
+ const int itemID,
+ CMusicDatabase& db)
{
if (!pSongItem->HasMusicInfoTag())
return false;
@@ -174,7 +175,9 @@ namespace MUSIC_UTILS
}
};
- void UpdateArtJob(const CFileItemPtr pItem, const std::string& strType, const std::string& strArt)
+ void UpdateArtJob(const CFileItemPtr& pItem,
+ const std::string& strType,
+ const std::string& strArt)
{
// Asynchronously update that type of art in the database
CSetArtJob *job = new CSetArtJob(pItem, strType, strArt);
@@ -328,7 +331,7 @@ namespace MUSIC_UTILS
return -1;
}
- void UpdateSongRatingJob(const CFileItemPtr pItem, int userrating)
+ void UpdateSongRatingJob(const CFileItemPtr& pItem, int userrating)
{
// Asynchronously update the song user rating in music library
const CMusicInfoTag *tag = pItem->GetMusicInfoTag();
diff --git a/xbmc/music/MusicUtils.h b/xbmc/music/MusicUtils.h
index 0a4e332fcd..5c395bcc88 100644
--- a/xbmc/music/MusicUtils.h
+++ b/xbmc/music/MusicUtils.h
@@ -43,7 +43,9 @@ namespace MUSIC_UTILS
\param strType the type of art e.g. "fanart" or "thumb" etc.
\param strArt art URL, when empty the entry for that type of art is deleted.
*/
- void UpdateArtJob(const CFileItemPtr pItem, const std::string& strType, const std::string& strArt);
+ void UpdateArtJob(const CFileItemPtr& pItem,
+ const std::string& strType,
+ const std::string& strArt);
/*! \brief Show a dialog to allow the selection of user rating.
\param iSelected the rating to show initially
@@ -55,7 +57,7 @@ namespace MUSIC_UTILS
\param pItem pointer to song item being rated
\param userrating the userrating 0 = no rating, 1 to 10
*/
- void UpdateSongRatingJob(const CFileItemPtr pItem, int userrating);
+ void UpdateSongRatingJob(const CFileItemPtr& pItem, int userrating);
/*! \brief Get the types of art for an artist or album that are to be
automatically fetched from local files during scanning
diff --git a/xbmc/music/dialogs/GUIDialogInfoProviderSettings.cpp b/xbmc/music/dialogs/GUIDialogInfoProviderSettings.cpp
index e487a4aa33..b5964cc43d 100644
--- a/xbmc/music/dialogs/GUIDialogInfoProviderSettings.cpp
+++ b/xbmc/music/dialogs/GUIDialogInfoProviderSettings.cpp
@@ -133,7 +133,8 @@ void CGUIDialogInfoProviderSettings::OnInitWindow()
CGUIDialogSettingsManualBase::OnInitWindow();
}
-void CGUIDialogInfoProviderSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogInfoProviderSettings::OnSettingChanged(
+ const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
@@ -158,7 +159,7 @@ void CGUIDialogInfoProviderSettings::OnSettingChanged(std::shared_ptr<const CSet
}
}
-void CGUIDialogInfoProviderSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CGUIDialogInfoProviderSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
diff --git a/xbmc/music/dialogs/GUIDialogInfoProviderSettings.h b/xbmc/music/dialogs/GUIDialogInfoProviderSettings.h
index 44d6449283..7a9cb7d268 100644
--- a/xbmc/music/dialogs/GUIDialogInfoProviderSettings.h
+++ b/xbmc/music/dialogs/GUIDialogInfoProviderSettings.h
@@ -13,6 +13,7 @@
#include "settings/dialogs/GUIDialogSettingsManualBase.h"
#include <map>
+#include <utility>
class CFileItemList;
@@ -33,9 +34,9 @@ public:
bool HasListItems() const override { return true; };
const ADDON::ScraperPtr& GetAlbumScraper() const { return m_albumscraper; }
- void SetAlbumScraper(ADDON::ScraperPtr scraper) { m_albumscraper = scraper; }
+ void SetAlbumScraper(ADDON::ScraperPtr scraper) { m_albumscraper = std::move(scraper); }
const ADDON::ScraperPtr& GetArtistScraper() const { return m_artistscraper; }
- void SetArtistScraper(ADDON::ScraperPtr scraper) { m_artistscraper = scraper; }
+ void SetArtistScraper(ADDON::ScraperPtr scraper) { m_artistscraper = std::move(scraper); }
/*! \brief Show dialog to change information provider for either artists or albums (not both).
Has a list to select how settings are to be applied - as system default, to just current item or to all the filtered items on the node.
@@ -56,8 +57,8 @@ protected:
void OnInitWindow() override;
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
diff --git a/xbmc/music/tags/MusicInfoTag.cpp b/xbmc/music/tags/MusicInfoTag.cpp
index 77429c370d..9b2293c352 100644
--- a/xbmc/music/tags/MusicInfoTag.cpp
+++ b/xbmc/music/tags/MusicInfoTag.cpp
@@ -758,7 +758,7 @@ void CMusicInfoTag::SetAlbumReleaseType(CAlbum::ReleaseType releaseType)
m_albumReleaseType = releaseType;
}
-void CMusicInfoTag::SetType(const MediaType mediaType)
+void CMusicInfoTag::SetType(const MediaType& mediaType)
{
m_type = mediaType;
}
diff --git a/xbmc/music/tags/MusicInfoTag.h b/xbmc/music/tags/MusicInfoTag.h
index b0cf31eaaf..a0261a382c 100644
--- a/xbmc/music/tags/MusicInfoTag.h
+++ b/xbmc/music/tags/MusicInfoTag.h
@@ -147,7 +147,7 @@ public:
void SetCoverArtInfo(size_t size, const std::string &mimeType);
void SetReplayGain(const ReplayGain& aGain);
void SetAlbumReleaseType(CAlbum::ReleaseType releaseType);
- void SetType(const MediaType mediaType);
+ void SetType(const MediaType& mediaType);
void SetDiscSubtitle(const std::string& strDiscSubtitle);
void SetTotalDiscs(int iDiscTotal);
void SetBPM(int iBPM);
diff --git a/xbmc/music/windows/GUIWindowMusicBase.cpp b/xbmc/music/windows/GUIWindowMusicBase.cpp
index 70f9074c91..ef91ac9374 100644
--- a/xbmc/music/windows/GUIWindowMusicBase.cpp
+++ b/xbmc/music/windows/GUIWindowMusicBase.cpp
@@ -263,7 +263,7 @@ bool CGUIWindowMusicBase::OnAction(const CAction &action)
return CGUIMediaWindow::OnAction(action);
}
-void CGUIWindowMusicBase::OnItemInfoAll(const std::string strPath, bool refresh )
+void CGUIWindowMusicBase::OnItemInfoAll(const std::string& strPath, bool refresh)
{
if (StringUtils::EqualsNoCase(m_vecItems->GetContent(), "albums"))
g_application.StartMusicAlbumScan(strPath, refresh);
diff --git a/xbmc/music/windows/GUIWindowMusicBase.h b/xbmc/music/windows/GUIWindowMusicBase.h
index 9d47f52a83..e772026327 100644
--- a/xbmc/music/windows/GUIWindowMusicBase.h
+++ b/xbmc/music/windows/GUIWindowMusicBase.h
@@ -90,7 +90,7 @@ protected:
void RetrieveMusicInfo();
void OnItemInfo(int iItem);
- void OnItemInfoAll(const std::string strPath, bool refresh = false);
+ void OnItemInfoAll(const std::string& strPath, bool refresh = false);
virtual void OnQueueItem(int iItem, bool first = false);
enum ALLOW_SELECTION { SELECTION_ALLOWED = 0, SELECTION_AUTO, SELECTION_FORCED };
diff --git a/xbmc/music/windows/GUIWindowMusicNav.cpp b/xbmc/music/windows/GUIWindowMusicNav.cpp
index 82b9dd9666..a0b5533410 100644
--- a/xbmc/music/windows/GUIWindowMusicNav.cpp
+++ b/xbmc/music/windows/GUIWindowMusicNav.cpp
@@ -212,7 +212,7 @@ bool CGUIWindowMusicNav::OnAction(const CAction& action)
return CGUIWindowMusicBase::OnAction(action);
}
-bool CGUIWindowMusicNav::ManageInfoProvider(const CFileItemPtr item)
+bool CGUIWindowMusicNav::ManageInfoProvider(const CFileItemPtr& item)
{
CQueryParams params;
CDirectoryNode::GetDatabaseInfo(item->GetPath(), params);
diff --git a/xbmc/music/windows/GUIWindowMusicNav.h b/xbmc/music/windows/GUIWindowMusicNav.h
index bd8659bf0e..021eaad8e5 100644
--- a/xbmc/music/windows/GUIWindowMusicNav.h
+++ b/xbmc/music/windows/GUIWindowMusicNav.h
@@ -38,7 +38,7 @@ protected:
std::string GetStartFolder(const std::string &url) override;
bool GetSongsFromPlayList(const std::string& strPlayList, CFileItemList &items);
- bool ManageInfoProvider(const CFileItemPtr item);
+ bool ManageInfoProvider(const CFileItemPtr& item);
VECSOURCES m_shares;
diff --git a/xbmc/network/EventClient.h b/xbmc/network/EventClient.h
index e40cef0285..a8a78b9d71 100644
--- a/xbmc/network/EventClient.h
+++ b/xbmc/network/EventClient.h
@@ -19,6 +19,7 @@
#include <list>
#include <map>
#include <queue>
+#include <utility>
namespace EVENTCLIENT
{
@@ -63,9 +64,8 @@ namespace EVENTCLIENT
float fAmount,
bool isAxis,
bool bRepeat,
- bool bUseAmount):
- m_buttonName(buttonName),
- m_mapName(mapName)
+ bool bUseAmount)
+ : m_buttonName(std::move(buttonName)), m_mapName(std::move(mapName))
{
m_iKeyCode = iKeyCode;
m_fAmount = fAmount;
diff --git a/xbmc/network/GUIDialogNetworkSetup.cpp b/xbmc/network/GUIDialogNetworkSetup.cpp
index 768caf7de9..6c85c5c8b9 100644
--- a/xbmc/network/GUIDialogNetworkSetup.cpp
+++ b/xbmc/network/GUIDialogNetworkSetup.cpp
@@ -81,7 +81,7 @@ bool CGUIDialogNetworkSetup::OnMessage(CGUIMessage& message)
return CGUIDialogSettingsManualBase::OnMessage(message);
}
-void CGUIDialogNetworkSetup::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogNetworkSetup::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -110,7 +110,7 @@ void CGUIDialogNetworkSetup::OnSettingChanged(std::shared_ptr<const CSetting> se
m_password = std::static_pointer_cast<const CSettingString>(setting)->GetValue();
}
-void CGUIDialogNetworkSetup::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CGUIDialogNetworkSetup::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
diff --git a/xbmc/network/GUIDialogNetworkSetup.h b/xbmc/network/GUIDialogNetworkSetup.h
index 6ed9766367..1758766475 100644
--- a/xbmc/network/GUIDialogNetworkSetup.h
+++ b/xbmc/network/GUIDialogNetworkSetup.h
@@ -42,8 +42,8 @@ public:
protected:
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
diff --git a/xbmc/network/NetworkServices.cpp b/xbmc/network/NetworkServices.cpp
index 801c0d65ac..eb519eaac6 100644
--- a/xbmc/network/NetworkServices.cpp
+++ b/xbmc/network/NetworkServices.cpp
@@ -165,7 +165,7 @@ CNetworkServices::~CNetworkServices()
#endif // HAS_WEB_SERVER
}
-bool CNetworkServices::OnSettingChanging(std::shared_ptr<const CSetting> setting)
+bool CNetworkServices::OnSettingChanging(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return false;
@@ -470,7 +470,7 @@ bool CNetworkServices::OnSettingChanging(std::shared_ptr<const CSetting> setting
return true;
}
-void CNetworkServices::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CNetworkServices::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -492,7 +492,9 @@ void CNetworkServices::OnSettingChanged(std::shared_ptr<const CSetting> setting)
}
}
-bool CNetworkServices::OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *oldSettingId, const TiXmlNode *oldSettingNode)
+bool CNetworkServices::OnSettingUpdate(const std::shared_ptr<CSetting>& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode)
{
if (setting == NULL)
return false;
diff --git a/xbmc/network/NetworkServices.h b/xbmc/network/NetworkServices.h
index 860243107d..a511954f23 100644
--- a/xbmc/network/NetworkServices.h
+++ b/xbmc/network/NetworkServices.h
@@ -32,9 +32,11 @@ public:
CNetworkServices();
~CNetworkServices() override;
- bool OnSettingChanging(std::shared_ptr<const CSetting> setting) override;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- bool OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) override;
+ bool OnSettingChanging(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ bool OnSettingUpdate(const std::shared_ptr<CSetting>& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode) override;
void Start();
void Stop(bool bWait);
diff --git a/xbmc/network/WakeOnAccess.cpp b/xbmc/network/WakeOnAccess.cpp
index 5a37fe7f35..cc2d13d2aa 100644
--- a/xbmc/network/WakeOnAccess.cpp
+++ b/xbmc/network/WakeOnAccess.cpp
@@ -760,7 +760,7 @@ void CWakeOnAccess::OnJobComplete(unsigned int jobID, bool success, CJob *job)
}
}
-void CWakeOnAccess::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CWakeOnAccess::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
diff --git a/xbmc/network/WakeOnAccess.h b/xbmc/network/WakeOnAccess.h
index df34e93326..797f0c164d 100644
--- a/xbmc/network/WakeOnAccess.h
+++ b/xbmc/network/WakeOnAccess.h
@@ -29,7 +29,7 @@ public:
void QueueMACDiscoveryForAllRemotes();
void OnJobComplete(unsigned int jobID, bool success, CJob *job) override;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
void OnSettingsLoaded() override;
// struct to keep per host settings
diff --git a/xbmc/network/WebServer.cpp b/xbmc/network/WebServer.cpp
index 16cf5e158c..b920ac1f15 100644
--- a/xbmc/network/WebServer.cpp
+++ b/xbmc/network/WebServer.cpp
@@ -533,7 +533,7 @@ void CWebServer::SetupPostDataProcessing(const HTTPRequest& request,
std::shared_ptr<IHTTPRequestHandler> handler,
void** con_cls) const
{
- connectionHandler->requestHandler = handler;
+ connectionHandler->requestHandler = std::move(handler);
// we might need to handle the POST data ourselves which is done in the next call to
// AnswerToConnection
diff --git a/xbmc/network/Zeroconf.cpp b/xbmc/network/Zeroconf.cpp
index 775da859ed..5ef801c8ec 100644
--- a/xbmc/network/Zeroconf.cpp
+++ b/xbmc/network/Zeroconf.cpp
@@ -7,9 +7,10 @@
*/
#include "Zeroconf.h"
-#include <cassert>
-
#include "ServiceBroker.h"
+#if defined(HAS_MDNS)
+#include "mdns/ZeroconfMDNS.h"
+#endif
#include "settings/Settings.h"
#include "settings/SettingsComponent.h"
#include "threads/Atomics.h"
@@ -17,17 +18,18 @@
#include "threads/SingleLock.h"
#include "utils/JobManager.h"
-#if defined(HAS_AVAHI)
-#include "platform/linux/network/zeroconf/ZeroconfAvahi.h"
+#if defined(TARGET_ANDROID)
+#include "platform/android/network/ZeroconfAndroid.h"
#elif defined(TARGET_DARWIN)
//on osx use the native implementation
#include "platform/darwin/network/ZeroconfDarwin.h"
-#elif defined(TARGET_ANDROID)
-#include "platform/android/network/ZeroconfAndroid.h"
-#elif defined(HAS_MDNS)
-#include "mdns/ZeroconfMDNS.h"
+#elif defined(HAS_AVAHI)
+#include "platform/linux/network/zeroconf/ZeroconfAvahi.h"
#endif
+#include <cassert>
+#include <utility>
+
#ifndef HAS_ZEROCONF
//dummy implementation used if no zeroconf is present
//should be optimized away
@@ -63,7 +65,7 @@ bool CZeroconf::PublishService(const std::string& fcr_identifier,
std::vector<std::pair<std::string, std::string> > txt /* = std::vector<std::pair<std::string, std::string> >() */)
{
CSingleLock lock(*mp_crit_sec);
- CZeroconf::PublishInfo info = {fcr_type, fcr_name, f_port, txt};
+ CZeroconf::PublishInfo info = {fcr_type, fcr_name, f_port, std::move(txt)};
std::pair<tServiceMap::const_iterator, bool> ret = m_service_map.insert(std::make_pair(fcr_identifier, info));
if(!ret.second) //identifier exists
return false;
diff --git a/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.cpp b/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.cpp
index f2dabfc304..29349942b9 100644
--- a/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.cpp
+++ b/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.cpp
@@ -318,7 +318,8 @@ const char* CHTTPPythonWsgiInvoker::getInitializationScript() const
return RUNSCRIPT;
}
-std::map<std::string, std::string> CHTTPPythonWsgiInvoker::createCgiEnvironment(const HTTPPythonRequest* httpRequest, ADDON::AddonPtr addon)
+std::map<std::string, std::string> CHTTPPythonWsgiInvoker::createCgiEnvironment(
+ const HTTPPythonRequest* httpRequest, const ADDON::AddonPtr& addon)
{
std::map<std::string, std::string> environment;
diff --git a/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.h b/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.h
index 8e4b9349ba..3ec34c0eba 100644
--- a/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.h
+++ b/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.h
@@ -39,7 +39,8 @@ protected:
const char* getInitializationScript() const override;
private:
- static std::map<std::string, std::string> createCgiEnvironment(const HTTPPythonRequest* httpRequest, ADDON::AddonPtr addon);
+ static std::map<std::string, std::string> createCgiEnvironment(
+ const HTTPPythonRequest* httpRequest, const ADDON::AddonPtr& addon);
static void addWsgiEnvironment(HTTPPythonRequest* request, void* environment);
XBMCAddon::xbmcwsgi::WsgiResponse* m_wsgiResponse;
diff --git a/xbmc/network/upnp/UPnPServer.cpp b/xbmc/network/upnp/UPnPServer.cpp
index a593f54807..d8ed19ee94 100644
--- a/xbmc/network/upnp/UPnPServer.cpp
+++ b/xbmc/network/upnp/UPnPServer.cpp
@@ -255,12 +255,11 @@ NPT_String CUPnPServer::BuildSafeResourceUri(const NPT_HttpUrl &rooturi,
/*----------------------------------------------------------------------
| CUPnPServer::Build
+---------------------------------------------------------------------*/
-PLT_MediaObject*
-CUPnPServer::Build(CFileItemPtr item,
- bool with_count,
- const PLT_HttpRequestContext& context,
- NPT_Reference<CThumbLoader>& thumb_loader,
- const char* parent_id /* = NULL */)
+PLT_MediaObject* CUPnPServer::Build(const CFileItemPtr& item,
+ bool with_count,
+ const PLT_HttpRequestContext& context,
+ NPT_Reference<CThumbLoader>& thumb_loader,
+ const char* parent_id /* = NULL */)
{
PLT_MediaObject* object = NULL;
NPT_String path = item->GetPath().c_str();
@@ -491,7 +490,7 @@ void CUPnPServer::Announce(AnnouncementFlag flag,
/*----------------------------------------------------------------------
| TranslateWMPObjectId
+---------------------------------------------------------------------*/
-static NPT_String TranslateWMPObjectId(NPT_String id, Logger logger)
+static NPT_String TranslateWMPObjectId(NPT_String id, const Logger& logger)
{
if (id == "0") {
id = "virtualpath://upnproot/";
@@ -1244,8 +1243,8 @@ CUPnPServer::DefaultSortItems(CFileItemList& items)
}
}
-NPT_Result
-CUPnPServer::AddSubtitleUriForSecResponse(NPT_String movie_md5, NPT_String subtitle_uri)
+NPT_Result CUPnPServer::AddSubtitleUriForSecResponse(const NPT_String& movie_md5,
+ const NPT_String& subtitle_uri)
{
/* using existing m_FileMap to store subtitle uri for movie,
adding subtitle:// prefix, because there is already entry for movie md5 with movie path */
diff --git a/xbmc/network/upnp/UPnPServer.h b/xbmc/network/upnp/UPnPServer.h
index 89b3a454a4..e6eab41d66 100644
--- a/xbmc/network/upnp/UPnPServer.h
+++ b/xbmc/network/upnp/UPnPServer.h
@@ -84,7 +84,11 @@ public:
const char* host,
const char* file_path);
- void AddSafeResourceUri(PLT_MediaObject* object, const NPT_HttpUrl& rooturi, NPT_List<NPT_IpAddress> ips, const char* file_path, const NPT_String& info)
+ void AddSafeResourceUri(PLT_MediaObject* object,
+ const NPT_HttpUrl& rooturi,
+ const NPT_List<NPT_IpAddress>& ips,
+ const char* file_path,
+ const NPT_String& info)
{
PLT_MediaItemResource res;
for(NPT_List<NPT_IpAddress>::Iterator ip = ips.GetFirstItem(); ip; ++ip) {
@@ -96,19 +100,20 @@ public:
/* Samsung's devices get subtitles from header in response (for movie file), not from didl.
It's a way to store subtitle uri generated when building didl, to use later in http response*/
- NPT_Result AddSubtitleUriForSecResponse(NPT_String movie_md5, NPT_String subtitle_uri);
+ NPT_Result AddSubtitleUriForSecResponse(const NPT_String& movie_md5,
+ const NPT_String& subtitle_uri);
-private:
+ private:
void OnScanCompleted(int type);
void UpdateContainer(const std::string& id);
void PropagateUpdates();
- PLT_MediaObject* Build(CFileItemPtr item,
- bool with_count,
+ PLT_MediaObject* Build(const CFileItemPtr& item,
+ bool with_count,
const PLT_HttpRequestContext& context,
- NPT_Reference<CThumbLoader>& thumbLoader,
- const char* parent_id = NULL);
+ NPT_Reference<CThumbLoader>& thumbLoader,
+ const char* parent_id = NULL);
NPT_Result BuildResponse(PLT_ActionReference& action,
CFileItemList& items,
const char* filter,
@@ -120,11 +125,13 @@ private:
// class methods
static void DefaultSortItems(CFileItemList& items);
- static NPT_String GetParentFolder(NPT_String file_path) {
- int index = file_path.ReverseFind("\\");
- if (index == -1) return "";
+ static NPT_String GetParentFolder(const NPT_String& file_path)
+ {
+ int index = file_path.ReverseFind("\\");
+ if (index == -1)
+ return "";
- return file_path.Left(index);
+ return file_path.Left(index);
}
NPT_Mutex m_CacheMutex;
diff --git a/xbmc/peripherals/Peripherals.cpp b/xbmc/peripherals/Peripherals.cpp
index a37ea29ac3..7101798981 100644
--- a/xbmc/peripherals/Peripherals.cpp
+++ b/xbmc/peripherals/Peripherals.cpp
@@ -941,7 +941,7 @@ void CPeripherals::UnregisterJoystickButtonMapper(IButtonMapper* mapper)
peripheral->UnregisterJoystickButtonMapper(mapper);
}
-void CPeripherals::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CPeripherals::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
@@ -959,7 +959,7 @@ void CPeripherals::OnSettingChanged(std::shared_ptr<const CSetting> setting)
}
}
-void CPeripherals::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CPeripherals::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
diff --git a/xbmc/peripherals/Peripherals.h b/xbmc/peripherals/Peripherals.h
index 9d8ae885fc..9c07a8d1fa 100644
--- a/xbmc/peripherals/Peripherals.h
+++ b/xbmc/peripherals/Peripherals.h
@@ -318,8 +318,8 @@ public:
void UnregisterJoystickButtonMapper(KODI::JOYSTICK::IButtonMapper* mapper);
// implementation of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
// implementation of IMessageTarget
void OnApplicationMessage(KODI::MESSAGING::ThreadMessage* pMsg) override;
diff --git a/xbmc/peripherals/devices/Peripheral.cpp b/xbmc/peripherals/devices/Peripheral.cpp
index 6b07065038..e3295b8a30 100644
--- a/xbmc/peripherals/devices/Peripheral.cpp
+++ b/xbmc/peripherals/devices/Peripheral.cpp
@@ -214,7 +214,7 @@ std::vector<std::shared_ptr<CSetting>> CPeripheral::GetSettings(void) const
return settings;
}
-void CPeripheral::AddSetting(const std::string& strKey, SettingConstPtr setting, int order)
+void CPeripheral::AddSetting(const std::string& strKey, const SettingConstPtr& setting, int order)
{
if (!setting)
{
diff --git a/xbmc/peripherals/devices/Peripheral.h b/xbmc/peripherals/devices/Peripheral.h
index 5ba510a881..d8f9869e2e 100644
--- a/xbmc/peripherals/devices/Peripheral.h
+++ b/xbmc/peripherals/devices/Peripheral.h
@@ -159,7 +159,7 @@ public:
* @param setting The setting.
*/
virtual void AddSetting(const std::string& strKey,
- std::shared_ptr<const CSetting> setting,
+ const std::shared_ptr<const CSetting>& setting,
int order);
/*!
diff --git a/xbmc/peripherals/devices/PeripheralImon.cpp b/xbmc/peripherals/devices/PeripheralImon.cpp
index 1661321a3c..e37310fac4 100644
--- a/xbmc/peripherals/devices/PeripheralImon.cpp
+++ b/xbmc/peripherals/devices/PeripheralImon.cpp
@@ -58,7 +58,7 @@ bool CPeripheralImon::InitialiseFeature(const PeripheralFeature feature)
}
void CPeripheralImon::AddSetting(const std::string& strKey,
- std::shared_ptr<const CSetting> setting,
+ const std::shared_ptr<const CSetting>& setting,
int order)
{
#if !defined(TARGET_WINDOWS)
diff --git a/xbmc/peripherals/devices/PeripheralImon.h b/xbmc/peripherals/devices/PeripheralImon.h
index d6e8d2c5d1..612d059019 100644
--- a/xbmc/peripherals/devices/PeripheralImon.h
+++ b/xbmc/peripherals/devices/PeripheralImon.h
@@ -27,7 +27,7 @@ public:
void OnSettingChanged(const std::string& strChangedSetting) override;
void OnDeviceRemoved() override;
void AddSetting(const std::string& strKey,
- std::shared_ptr<const CSetting> setting,
+ const std::shared_ptr<const CSetting>& setting,
int order) override;
inline bool IsImonConflictsWithDInput() { return m_bImonConflictsWithDInput; }
static inline long GetCountOfImonsConflictWithDInput()
diff --git a/xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.cpp b/xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.cpp
index e70a67fe3d..56fcd28a92 100644
--- a/xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.cpp
+++ b/xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.cpp
@@ -60,7 +60,7 @@ void CGUIDialogPeripheralSettings::SetFileItem(const CFileItem* item)
m_item = new CFileItem(*item);
}
-void CGUIDialogPeripheralSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogPeripheralSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
diff --git a/xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.h b/xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.h
index bd49a87220..d94d53dada 100644
--- a/xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.h
+++ b/xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.h
@@ -27,7 +27,7 @@ public:
protected:
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
diff --git a/xbmc/pictures/GUIWindowSlideShow.cpp b/xbmc/pictures/GUIWindowSlideShow.cpp
index 0e86c74704..7ddcffa8f7 100644
--- a/xbmc/pictures/GUIWindowSlideShow.cpp
+++ b/xbmc/pictures/GUIWindowSlideShow.cpp
@@ -1322,7 +1322,7 @@ std::string CGUIWindowSlideShow::GetPicturePath(CFileItem *item)
}
-void CGUIWindowSlideShow::RunSlideShow(std::vector<std::string> paths, int start /* = 0*/)
+void CGUIWindowSlideShow::RunSlideShow(const std::vector<std::string>& paths, int start /* = 0*/)
{
auto dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
if (dialog)
diff --git a/xbmc/pictures/GUIWindowSlideShow.h b/xbmc/pictures/GUIWindowSlideShow.h
index 1d23234b58..f37420c7ea 100644
--- a/xbmc/pictures/GUIWindowSlideShow.h
+++ b/xbmc/pictures/GUIWindowSlideShow.h
@@ -94,7 +94,7 @@ public:
bool IsShuffled() const { return m_bShuffled; }
int GetDirection() const { return m_iDirection; }
- static void RunSlideShow(std::vector<std::string> paths, int start=0);
+ static void RunSlideShow(const std::vector<std::string>& paths, int start = 0);
private:
void ShowNext();
diff --git a/xbmc/platform/Filesystem.h b/xbmc/platform/Filesystem.h
index 085bb40531..3e6b7ec52b 100644
--- a/xbmc/platform/Filesystem.h
+++ b/xbmc/platform/Filesystem.h
@@ -26,7 +26,7 @@ space_info space(const std::string &path, std::error_code &ec);
std::string temp_directory_path(std::error_code &ec);
std::string create_temp_directory(std::error_code &ec);
-std::string temp_file_path(std::string suffix, std::error_code &ec);
+std::string temp_file_path(const std::string& suffix, std::error_code& ec);
}
}
}
diff --git a/xbmc/platform/android/activity/JNIXBMCMediaSession.cpp b/xbmc/platform/android/activity/JNIXBMCMediaSession.cpp
index 4d7fdf2dad..67bc63a3d8 100644
--- a/xbmc/platform/android/activity/JNIXBMCMediaSession.cpp
+++ b/xbmc/platform/android/activity/JNIXBMCMediaSession.cpp
@@ -156,7 +156,7 @@ void CJNIXBMCMediaSession::OnSeekRequested(int64_t pos)
g_application.SeekTime(pos / 1000.0);
}
-bool CJNIXBMCMediaSession::OnMediaButtonEvent(CJNIIntent intent)
+bool CJNIXBMCMediaSession::OnMediaButtonEvent(const CJNIIntent& intent)
{
if (CXBMCApp::HasFocus())
{
diff --git a/xbmc/platform/android/activity/JNIXBMCMediaSession.h b/xbmc/platform/android/activity/JNIXBMCMediaSession.h
index 80183c6d6b..020a792b88 100644
--- a/xbmc/platform/android/activity/JNIXBMCMediaSession.h
+++ b/xbmc/platform/android/activity/JNIXBMCMediaSession.h
@@ -39,7 +39,7 @@ public:
void OnRewindRequested();
void OnStopRequested();
void OnSeekRequested(int64_t pos);
- bool OnMediaButtonEvent(CJNIIntent intent);
+ bool OnMediaButtonEvent(const CJNIIntent& intent);
bool isActive() const;
protected:
diff --git a/xbmc/platform/android/network/NetworkAndroid.cpp b/xbmc/platform/android/network/NetworkAndroid.cpp
index 810731032c..9c0b06b0b6 100644
--- a/xbmc/platform/android/network/NetworkAndroid.cpp
+++ b/xbmc/platform/android/network/NetworkAndroid.cpp
@@ -25,10 +25,10 @@
#include <netinet/in.h>
#include <sys/wait.h>
-CNetworkInterfaceAndroid::CNetworkInterfaceAndroid(CJNINetwork network, CJNILinkProperties lp, CJNINetworkInterface intf)
- : m_network(network)
- , m_lp(lp)
- , m_intf(intf)
+CNetworkInterfaceAndroid::CNetworkInterfaceAndroid(const CJNINetwork& network,
+ const CJNILinkProperties& lp,
+ const CJNINetworkInterface& intf)
+ : m_network(network), m_lp(lp), m_intf(intf)
{
m_name = m_intf.getName();
}
diff --git a/xbmc/platform/android/network/NetworkAndroid.h b/xbmc/platform/android/network/NetworkAndroid.h
index 5a668490bf..9542b00225 100644
--- a/xbmc/platform/android/network/NetworkAndroid.h
+++ b/xbmc/platform/android/network/NetworkAndroid.h
@@ -22,7 +22,9 @@ class CNetworkAndroid;
class CNetworkInterfaceAndroid : public CNetworkInterface
{
public:
- CNetworkInterfaceAndroid(CJNINetwork network, CJNILinkProperties lp, CJNINetworkInterface intf);
+ CNetworkInterfaceAndroid(const CJNINetwork& network,
+ const CJNILinkProperties& lp,
+ const CJNINetworkInterface& intf);
std::vector<std::string> GetNameServers();
// CNetworkInterface interface
diff --git a/xbmc/platform/darwin/ios-common/network/NetworkIOS.mm b/xbmc/platform/darwin/ios-common/network/NetworkIOS.mm
index 11b53cf6c1..55fbfdb351 100644
--- a/xbmc/platform/darwin/ios-common/network/NetworkIOS.mm
+++ b/xbmc/platform/darwin/ios-common/network/NetworkIOS.mm
@@ -14,6 +14,7 @@
#import "platform/darwin/ios-common/network/route.h"
#import <array>
+#include <utility>
#import <arpa/inet.h>
#import <ifaddrs.h>
@@ -29,7 +30,7 @@
#import <sys/sysctl.h>
CNetworkInterfaceIOS::CNetworkInterfaceIOS(CNetworkIOS* network, std::string interfaceName)
- : m_interfaceName(interfaceName), m_network(network)
+ : m_interfaceName(std::move(interfaceName)), m_network(network)
{
}
diff --git a/xbmc/platform/darwin/ios-common/peripherals/PeripheralBusDarwinEmbedded.h b/xbmc/platform/darwin/ios-common/peripherals/PeripheralBusDarwinEmbedded.h
index b8f5bf2d5a..c0227f0bd7 100644
--- a/xbmc/platform/darwin/ios-common/peripherals/PeripheralBusDarwinEmbedded.h
+++ b/xbmc/platform/darwin/ios-common/peripherals/PeripheralBusDarwinEmbedded.h
@@ -36,10 +36,10 @@ public:
bool PerformDeviceScan(PeripheralScanResults& results) override;
PeripheralScanResults GetInputDevices();
- void callOnDeviceAdded(const std::string strLocation);
- void callOnDeviceRemoved(const std::string strLocation);
+ void callOnDeviceAdded(const std::string& strLocation);
+ void callOnDeviceRemoved(const std::string& strLocation);
- void SetScanResults(const PeripheralScanResults resScanResults);
+ void SetScanResults(const PeripheralScanResults& resScanResults);
const std::string& getDeviceLocationPrefix()
{
diff --git a/xbmc/platform/darwin/ios-common/peripherals/PeripheralBusDarwinEmbedded.mm b/xbmc/platform/darwin/ios-common/peripherals/PeripheralBusDarwinEmbedded.mm
index 94410fb85f..abdd4dac93 100644
--- a/xbmc/platform/darwin/ios-common/peripherals/PeripheralBusDarwinEmbedded.mm
+++ b/xbmc/platform/darwin/ios-common/peripherals/PeripheralBusDarwinEmbedded.mm
@@ -121,7 +121,7 @@ bool PERIPHERALS::CPeripheralBusDarwinEmbedded::PerformDeviceScan(PeripheralScan
}
void PERIPHERALS::CPeripheralBusDarwinEmbedded::SetScanResults(
- const PERIPHERALS::PeripheralScanResults resScanResults)
+ const PERIPHERALS::PeripheralScanResults& resScanResults)
{
CSingleLock lock(m_critSectionResults);
m_scanResults = resScanResults;
@@ -214,12 +214,12 @@ PERIPHERALS::PeripheralScanResults PERIPHERALS::CPeripheralBusDarwinEmbedded::Ge
return [m_peripheralDarwinEmbedded->callbackClass GetInputDevices];
}
-void PERIPHERALS::CPeripheralBusDarwinEmbedded::callOnDeviceAdded(const std::string strLocation)
+void PERIPHERALS::CPeripheralBusDarwinEmbedded::callOnDeviceAdded(const std::string& strLocation)
{
OnDeviceAdded(strLocation);
}
-void PERIPHERALS::CPeripheralBusDarwinEmbedded::callOnDeviceRemoved(const std::string strLocation)
+void PERIPHERALS::CPeripheralBusDarwinEmbedded::callOnDeviceRemoved(const std::string& strLocation)
{
OnDeviceRemoved(strLocation);
}
diff --git a/xbmc/platform/darwin/ios/XBMCController.mm b/xbmc/platform/darwin/ios/XBMCController.mm
index 27d9d8d54d..0501ab8639 100644
--- a/xbmc/platform/darwin/ios/XBMCController.mm
+++ b/xbmc/platform/darwin/ios/XBMCController.mm
@@ -73,7 +73,7 @@ public:
CServiceBroker::GetSettingsComponent()->GetSettings()->UnregisterCallback(this);
}
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override
{
if (!setting || setting->GetId() != CSettings::SETTING_DEBUG_SHARE_LOG)
return;
diff --git a/xbmc/platform/darwin/osx/XBMCHelper.cpp b/xbmc/platform/darwin/osx/XBMCHelper.cpp
index 8cfb0b6a13..96c395510d 100644
--- a/xbmc/platform/darwin/osx/XBMCHelper.cpp
+++ b/xbmc/platform/darwin/osx/XBMCHelper.cpp
@@ -80,7 +80,7 @@ XBMCHelper::XBMCHelper()
}
/////////////////////////////////////////////////////////////////////////////
-bool XBMCHelper::OnSettingChanging(std::shared_ptr<const CSetting> setting)
+bool XBMCHelper::OnSettingChanging(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return false;
diff --git a/xbmc/platform/darwin/osx/XBMCHelper.h b/xbmc/platform/darwin/osx/XBMCHelper.h
index 3444075ec3..502d5de772 100644
--- a/xbmc/platform/darwin/osx/XBMCHelper.h
+++ b/xbmc/platform/darwin/osx/XBMCHelper.h
@@ -25,7 +25,7 @@ class XBMCHelper : public ISettingCallback
public:
static XBMCHelper& GetInstance();
- bool OnSettingChanging(std::shared_ptr<const CSetting> setting) override;
+ bool OnSettingChanging(const std::shared_ptr<const CSetting>& setting) override;
void Start();
void Stop();
diff --git a/xbmc/platform/darwin/tvos/TVOSSettingsHandler.h b/xbmc/platform/darwin/tvos/TVOSSettingsHandler.h
index e066cf3e62..04d0f8cd6a 100644
--- a/xbmc/platform/darwin/tvos/TVOSSettingsHandler.h
+++ b/xbmc/platform/darwin/tvos/TVOSSettingsHandler.h
@@ -17,7 +17,7 @@ public:
void Initialize();
- virtual void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ virtual void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
private:
CTVOSInputSettings() = default;
diff --git a/xbmc/platform/darwin/tvos/TVOSSettingsHandler.mm b/xbmc/platform/darwin/tvos/TVOSSettingsHandler.mm
index 4e977a88dd..9c90b7cb38 100644
--- a/xbmc/platform/darwin/tvos/TVOSSettingsHandler.mm
+++ b/xbmc/platform/darwin/tvos/TVOSSettingsHandler.mm
@@ -45,7 +45,7 @@ void CTVOSInputSettings::Initialize()
[g_xbmcController.inputHandler.inputSettings setRemoteIdleTimeout:timeout];
}
-void CTVOSInputSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CTVOSInputSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
diff --git a/xbmc/platform/darwin/tvos/TVOSTopShelf.mm b/xbmc/platform/darwin/tvos/TVOSTopShelf.mm
index 71ac4518f5..0344eea9eb 100644
--- a/xbmc/platform/darwin/tvos/TVOSTopShelf.mm
+++ b/xbmc/platform/darwin/tvos/TVOSTopShelf.mm
@@ -85,9 +85,8 @@ void CTVOSTopShelf::SetTopShelfItems(CFileItemList& items, TVOSTopShelfItemsCate
CVideoThumbLoader thumbLoader;
auto fillSharedDicts =
[&](CFileItemList& items, NSString* categoryKey, NSString* categoryTitle,
- std::function<std::string(CFileItemPtr videoItem)> getThumbnailForItem,
- std::function<std::string(CFileItemPtr videoItem)> getTitleForItem) {
-
+ const std::function<std::string(CFileItemPtr videoItem)>& getThumbnailForItem,
+ const std::function<std::string(CFileItemPtr videoItem)>& getTitleForItem) {
// Store all old thumbs names of this category in array
const auto thumbsPath = [storeUrl URLByAppendingPathComponent:categoryKey isDirectory:YES];
auto thumbsToRemove = [NSMutableSet setWithArray:[fileManager contentsOfDirectoryAtPath:thumbsPath.path error:nil]];
@@ -161,25 +160,25 @@ void CTVOSTopShelf::SetTopShelfItems(CFileItemList& items, TVOSTopShelfItemsCate
case TVOSTopShelfItemsCategory::MOVIES:
fillSharedDicts(
items, @"movies", @(g_localizeStrings.Get(20386).c_str()),
- [](CFileItemPtr videoItem) {
+ [](const CFileItemPtr& videoItem) {
if (videoItem->HasArt("poster"))
return videoItem->GetArt("poster");
else
return videoItem->GetArt("thumb");
},
- [](CFileItemPtr videoItem) { return videoItem->GetLabel(); });
+ [](const CFileItemPtr& videoItem) { return videoItem->GetLabel(); });
break;
case TVOSTopShelfItemsCategory::TV_SHOWS:
CVideoDatabase videoDb;
videoDb.Open();
fillSharedDicts(
items, @"tvshows", @(g_localizeStrings.Get(20387).c_str()),
- [&videoDb](CFileItemPtr videoItem) {
+ [&videoDb](const CFileItemPtr& videoItem) {
int season = videoItem->GetVideoInfoTag()->m_iIdSeason;
return season > 0 ? videoDb.GetArtForItem(season, MediaTypeSeason, "poster")
: std::string{};
},
- [](CFileItemPtr videoItem) {
+ [](const CFileItemPtr& videoItem) {
return StringUtils::Format("%s s%02de%02d",
videoItem->GetVideoInfoTag()->m_strShowTitle.c_str(),
videoItem->GetVideoInfoTag()->m_iSeason,
diff --git a/xbmc/platform/linux/input/LibInputSettings.cpp b/xbmc/platform/linux/input/LibInputSettings.cpp
index 9e3bad9820..76facff5f9 100644
--- a/xbmc/platform/linux/input/LibInputSettings.cpp
+++ b/xbmc/platform/linux/input/LibInputSettings.cpp
@@ -121,12 +121,16 @@ CLibInputSettings::~CLibInputSettings()
settings->GetSettingsManager()->UnregisterCallback(this);
}
-void CLibInputSettings::SettingOptionsKeyboardLayoutsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CLibInputSettings::SettingOptionsKeyboardLayoutsFiller(
+ const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
list = layouts;
}
-void CLibInputSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CLibInputSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
diff --git a/xbmc/platform/linux/input/LibInputSettings.h b/xbmc/platform/linux/input/LibInputSettings.h
index 8509b390c7..83d5edff55 100644
--- a/xbmc/platform/linux/input/LibInputSettings.h
+++ b/xbmc/platform/linux/input/LibInputSettings.h
@@ -21,8 +21,11 @@ class CLibInputSettings : public ISettingCallback, public ISettingsHandler
public:
static const std::string SETTING_INPUT_LIBINPUTKEYBOARDLAYOUT;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- static void SettingOptionsKeyboardLayoutsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ static void SettingOptionsKeyboardLayoutsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
CLibInputSettings(CLibInputHandler *handler);
~CLibInputSettings() override;
diff --git a/xbmc/platform/linux/network/NetworkLinux.cpp b/xbmc/platform/linux/network/NetworkLinux.cpp
index 8da24ddcc8..d4f1a26962 100644
--- a/xbmc/platform/linux/network/NetworkLinux.cpp
+++ b/xbmc/platform/linux/network/NetworkLinux.cpp
@@ -12,6 +12,7 @@
#include "utils/log.h"
#include <errno.h>
+#include <utility>
#include <arpa/inet.h>
#include <net/if.h>
@@ -22,7 +23,7 @@
CNetworkInterfaceLinux::CNetworkInterfaceLinux(CNetworkPosix* network,
std::string interfaceName,
char interfaceMacAddrRaw[6])
- : CNetworkInterfacePosix(network, interfaceName, interfaceMacAddrRaw)
+ : CNetworkInterfacePosix(network, std::move(interfaceName), interfaceMacAddrRaw)
{
}
diff --git a/xbmc/platform/linux/network/zeroconf/ZeroconfAvahi.cpp b/xbmc/platform/linux/network/zeroconf/ZeroconfAvahi.cpp
index 9b8595fac7..c0e2ec70c7 100644
--- a/xbmc/platform/linux/network/zeroconf/ZeroconfAvahi.cpp
+++ b/xbmc/platform/linux/network/zeroconf/ZeroconfAvahi.cpp
@@ -377,7 +377,8 @@ void CZeroconfAvahi::updateServices(AvahiClient* fp_client)
}
}
-void CZeroconfAvahi::addService(tServiceMap::mapped_type fp_service_info, AvahiClient* fp_client)
+void CZeroconfAvahi::addService(const tServiceMap::mapped_type& fp_service_info,
+ AvahiClient* fp_client)
{
assert(fp_client);
CLog::Log(LOGDEBUG, "CZeroconfAvahi::addService() named: %s type: %s port:%i", fp_service_info->m_name.c_str(), fp_service_info->m_type.c_str(), fp_service_info->m_port);
diff --git a/xbmc/platform/linux/network/zeroconf/ZeroconfAvahi.h b/xbmc/platform/linux/network/zeroconf/ZeroconfAvahi.h
index b1d534d737..102df9b1e7 100644
--- a/xbmc/platform/linux/network/zeroconf/ZeroconfAvahi.h
+++ b/xbmc/platform/linux/network/zeroconf/ZeroconfAvahi.h
@@ -65,7 +65,7 @@ private:
// from the callbacks)
void updateServices(AvahiClient* fp_client);
//helper that actually does the work of publishing
- void addService(tServiceMap::mapped_type fp_service_info, AvahiClient* fp_client);
+ void addService(const tServiceMap::mapped_type& fp_service_info, AvahiClient* fp_client);
AvahiClient* mp_client = 0;
AvahiThreadedPoll* mp_poll = 0;
diff --git a/xbmc/platform/linux/storage/UDisks2Provider.cpp b/xbmc/platform/linux/storage/UDisks2Provider.cpp
index eefc8ad808..885b6f2867 100644
--- a/xbmc/platform/linux/storage/UDisks2Provider.cpp
+++ b/xbmc/platform/linux/storage/UDisks2Provider.cpp
@@ -42,10 +42,8 @@ CUDisks2Provider::Drive::Drive(const char *object) : m_object(object)
bool CUDisks2Provider::Drive::IsOptical()
{
- return std::any_of(m_mediaCompatibility.begin(), m_mediaCompatibility.end(), [](std::string kind)
- {
- return kind.compare(0, 7, "optical") == 0;
- });
+ return std::any_of(m_mediaCompatibility.begin(), m_mediaCompatibility.end(),
+ [](const std::string& kind) { return kind.compare(0, 7, "optical") == 0; });
}
std::string CUDisks2Provider::Drive::toString()
diff --git a/xbmc/platform/posix/Filesystem.cpp b/xbmc/platform/posix/Filesystem.cpp
index 71baf5b5aa..477e7b660f 100644
--- a/xbmc/platform/posix/Filesystem.cpp
+++ b/xbmc/platform/posix/Filesystem.cpp
@@ -90,7 +90,7 @@ std::string create_temp_directory(std::error_code &ec)
return std::string(tmp);
}
-std::string temp_file_path(std::string suffix, std::error_code &ec)
+std::string temp_file_path(const std::string& suffix, std::error_code& ec)
{
char tmp[PATH_MAX];
diff --git a/xbmc/platform/posix/PosixTimezone.cpp b/xbmc/platform/posix/PosixTimezone.cpp
index e9aaa84356..10450bfd34 100644
--- a/xbmc/platform/posix/PosixTimezone.cpp
+++ b/xbmc/platform/posix/PosixTimezone.cpp
@@ -135,7 +135,7 @@ CPosixTimezone::CPosixTimezone()
free(line);
}
-void CPosixTimezone::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CPosixTimezone::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -180,7 +180,7 @@ std::string CPosixTimezone::GetCountryByTimezone(const std::string& timezone)
#endif
}
-void CPosixTimezone::SetTimezone(std::string timezoneName)
+void CPosixTimezone::SetTimezone(const std::string& timezoneName)
{
#if !defined(TARGET_DARWIN)
bool use_timezone = true;
@@ -234,14 +234,21 @@ std::string CPosixTimezone::GetOSConfiguredTimezone()
return timezoneName;
}
-void CPosixTimezone::SettingOptionsTimezoneCountriesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CPosixTimezone::SettingOptionsTimezoneCountriesFiller(
+ const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
std::vector<std::string> countries = g_timezone.GetCounties();
for (unsigned int i = 0; i < countries.size(); i++)
list.emplace_back(countries[i], countries[i]);
}
-void CPosixTimezone::SettingOptionsTimezonesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CPosixTimezone::SettingOptionsTimezonesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
current = std::static_pointer_cast<const CSettingString>(setting)->GetValue();
bool found = false;
diff --git a/xbmc/platform/posix/PosixTimezone.h b/xbmc/platform/posix/PosixTimezone.h
index 8272c4082d..076e87fa51 100644
--- a/xbmc/platform/posix/PosixTimezone.h
+++ b/xbmc/platform/posix/PosixTimezone.h
@@ -23,7 +23,7 @@ class CPosixTimezone : public ISettingCallback, public ISettingsHandler
public:
CPosixTimezone();
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
void OnSettingsLoaded() override;
@@ -33,11 +33,17 @@ public:
std::vector<std::string> GetTimezonesByCountry(const std::string& country);
std::string GetCountryByTimezone(const std::string& timezone);
- void SetTimezone(std::string timezone);
+ void SetTimezone(const std::string& timezone);
int m_IsDST = 0;
- static void SettingOptionsTimezoneCountriesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsTimezonesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
+ static void SettingOptionsTimezoneCountriesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsTimezonesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
private:
std::vector<std::string> m_counties;
diff --git a/xbmc/platform/posix/filesystem/PosixDirectory.cpp b/xbmc/platform/posix/filesystem/PosixDirectory.cpp
index c5e350201c..6685c0e1db 100644
--- a/xbmc/platform/posix/filesystem/PosixDirectory.cpp
+++ b/xbmc/platform/posix/filesystem/PosixDirectory.cpp
@@ -102,7 +102,7 @@ bool CPosixDirectory::Create(const CURL& url)
return true;
}
-bool CPosixDirectory::Create(std::string path)
+bool CPosixDirectory::Create(const std::string& path)
{
if (mkdir(path.c_str(), 0755) != 0)
{
diff --git a/xbmc/platform/posix/filesystem/PosixDirectory.h b/xbmc/platform/posix/filesystem/PosixDirectory.h
index 146f0031e6..eb323b68e9 100644
--- a/xbmc/platform/posix/filesystem/PosixDirectory.h
+++ b/xbmc/platform/posix/filesystem/PosixDirectory.h
@@ -24,6 +24,6 @@ public:
bool Remove(const CURL& url) override;
bool RemoveRecursive(const CURL& url) override;
private:
- bool Create(std::string path);
+ bool Create(const std::string& path);
};
}
diff --git a/xbmc/platform/posix/network/NetworkPosix.cpp b/xbmc/platform/posix/network/NetworkPosix.cpp
index 403be71a82..f09302d728 100644
--- a/xbmc/platform/posix/network/NetworkPosix.cpp
+++ b/xbmc/platform/posix/network/NetworkPosix.cpp
@@ -11,6 +11,8 @@
#include "utils/StringUtils.h"
#include "utils/log.h"
+#include <utility>
+
#include <arpa/inet.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -20,7 +22,7 @@
CNetworkInterfacePosix::CNetworkInterfacePosix(CNetworkPosix* network,
std::string interfaceName,
char interfaceMacAddrRaw[6])
- : m_interfaceName(interfaceName),
+ : m_interfaceName(std::move(interfaceName)),
m_interfaceMacAdr(StringUtils::Format("%02X:%02X:%02X:%02X:%02X:%02X",
(uint8_t)interfaceMacAddrRaw[0],
(uint8_t)interfaceMacAddrRaw[1],
diff --git a/xbmc/platform/win32/Filesystem.cpp b/xbmc/platform/win32/Filesystem.cpp
index 5de937f850..df3f579f62 100644
--- a/xbmc/platform/win32/Filesystem.cpp
+++ b/xbmc/platform/win32/Filesystem.cpp
@@ -89,7 +89,7 @@ std::string create_temp_directory(std::error_code &ec)
return win::FromW(lpTempPathBuffer);
}
-std::string temp_file_path(std::string, std::error_code &ec)
+std::string temp_file_path(const std::string&, std::error_code& ec)
{
wchar_t lpTempPathBuffer[MAX_PATH + 1];
diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp
index ac19c48539..a2714feabb 100644
--- a/xbmc/powermanagement/PowerManager.cpp
+++ b/xbmc/powermanagement/PowerManager.cpp
@@ -262,7 +262,10 @@ void CPowerManager::RestorePlayerState()
g_application.PlayFile(*m_lastPlayedFileItem, m_lastUsedPlayer);
}
-void CPowerManager::SettingOptionsShutdownStatesFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CPowerManager::SettingOptionsShutdownStatesFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
if (CServiceBroker::GetPowerManager().CanPowerdown())
list.emplace_back(g_localizeStrings.Get(13005), POWERSTATE_SHUTDOWN);
diff --git a/xbmc/powermanagement/PowerManager.h b/xbmc/powermanagement/PowerManager.h
index 7d35abea35..5e9bc9c745 100644
--- a/xbmc/powermanagement/PowerManager.h
+++ b/xbmc/powermanagement/PowerManager.h
@@ -46,7 +46,10 @@ public:
void ProcessEvents();
- static void SettingOptionsShutdownStatesFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
+ static void SettingOptionsShutdownStatesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
IPowerSyscall* GetPowerSyscall() const { return m_instance.get(); };
diff --git a/xbmc/profiles/ProfileManager.cpp b/xbmc/profiles/ProfileManager.cpp
index c5079f6c98..26c5529eff 100644
--- a/xbmc/profiles/ProfileManager.cpp
+++ b/xbmc/profiles/ProfileManager.cpp
@@ -716,7 +716,7 @@ CEventLog& CProfileManager::GetEventLog()
return m_eventLogs->GetEventLog(GetCurrentProfileId());
}
-void CProfileManager::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CProfileManager::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
diff --git a/xbmc/profiles/ProfileManager.h b/xbmc/profiles/ProfileManager.h
index 14850d1091..e39451893f 100644
--- a/xbmc/profiles/ProfileManager.h
+++ b/xbmc/profiles/ProfileManager.h
@@ -191,7 +191,7 @@ public:
protected:
// implementation of ISettingCallback
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
private:
/*! \brief Set the current profile id and update the special://profile path
diff --git a/xbmc/profiles/dialogs/GUIDialogLockSettings.cpp b/xbmc/profiles/dialogs/GUIDialogLockSettings.cpp
index 8a8497fea0..31a7077890 100644
--- a/xbmc/profiles/dialogs/GUIDialogLockSettings.cpp
+++ b/xbmc/profiles/dialogs/GUIDialogLockSettings.cpp
@@ -99,7 +99,7 @@ bool CGUIDialogLockSettings::ShowAndGetUserAndPassword(std::string &user, std::s
return true;
}
-void CGUIDialogLockSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogLockSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -131,7 +131,7 @@ void CGUIDialogLockSettings::OnSettingChanged(std::shared_ptr<const CSetting> se
m_changed = true;
}
-void CGUIDialogLockSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CGUIDialogLockSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
diff --git a/xbmc/profiles/dialogs/GUIDialogLockSettings.h b/xbmc/profiles/dialogs/GUIDialogLockSettings.h
index 39c3a13198..4ad482a6bd 100644
--- a/xbmc/profiles/dialogs/GUIDialogLockSettings.h
+++ b/xbmc/profiles/dialogs/GUIDialogLockSettings.h
@@ -23,8 +23,8 @@ public:
protected:
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
diff --git a/xbmc/profiles/dialogs/GUIDialogProfileSettings.cpp b/xbmc/profiles/dialogs/GUIDialogProfileSettings.cpp
index d3d0eb5dc3..d7ce0dabdf 100644
--- a/xbmc/profiles/dialogs/GUIDialogProfileSettings.cpp
+++ b/xbmc/profiles/dialogs/GUIDialogProfileSettings.cpp
@@ -194,7 +194,7 @@ void CGUIDialogProfileSettings::OnWindowLoaded()
CGUIDialogSettingsManualBase::OnWindowLoaded();
}
-void CGUIDialogProfileSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogProfileSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -214,7 +214,7 @@ void CGUIDialogProfileSettings::OnSettingChanged(std::shared_ptr<const CSetting>
m_needsSaving = true;
}
-void CGUIDialogProfileSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CGUIDialogProfileSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
diff --git a/xbmc/profiles/dialogs/GUIDialogProfileSettings.h b/xbmc/profiles/dialogs/GUIDialogProfileSettings.h
index dff49cf438..a17ccaa844 100644
--- a/xbmc/profiles/dialogs/GUIDialogProfileSettings.h
+++ b/xbmc/profiles/dialogs/GUIDialogProfileSettings.h
@@ -26,8 +26,8 @@ protected:
void OnWindowLoaded() override;
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
diff --git a/xbmc/pvr/PVRManager.cpp b/xbmc/pvr/PVRManager.cpp
index a60049786a..0a684faf2b 100644
--- a/xbmc/pvr/PVRManager.cpp
+++ b/xbmc/pvr/PVRManager.cpp
@@ -716,14 +716,14 @@ bool CPVRManager::IsCurrentlyParentalLocked(const std::shared_ptr<CPVRChannel>&
return bReturn;
}
-void CPVRManager::OnPlaybackStarted(const CFileItemPtr item)
+void CPVRManager::OnPlaybackStarted(const CFileItemPtr& item)
{
m_playbackState->OnPlaybackStarted(item);
m_guiActions->OnPlaybackStarted(item);
m_epgContainer.OnPlaybackStarted();
}
-void CPVRManager::OnPlaybackStopped(const CFileItemPtr item)
+void CPVRManager::OnPlaybackStopped(const CFileItemPtr& item)
{
// Playback ended due to user interaction
if (m_playbackState->OnPlaybackStopped(item))
@@ -733,7 +733,7 @@ void CPVRManager::OnPlaybackStopped(const CFileItemPtr item)
m_epgContainer.OnPlaybackStopped();
}
-void CPVRManager::OnPlaybackEnded(const CFileItemPtr item)
+void CPVRManager::OnPlaybackEnded(const CFileItemPtr& item)
{
// Playback ended, but not due to user interaction
OnPlaybackStopped(item);
diff --git a/xbmc/pvr/PVRManager.h b/xbmc/pvr/PVRManager.h
index 7356c4cdf3..6fd6494acc 100644
--- a/xbmc/pvr/PVRManager.h
+++ b/xbmc/pvr/PVRManager.h
@@ -244,19 +244,19 @@ namespace PVR
* @brief Inform PVR manager that playback of an item just started.
* @param item The item that started to play.
*/
- void OnPlaybackStarted(const std::shared_ptr<CFileItem> item);
+ void OnPlaybackStarted(const std::shared_ptr<CFileItem>& item);
/*!
* @brief Inform PVR manager that playback of an item was stopped due to user interaction.
* @param item The item that stopped to play.
*/
- void OnPlaybackStopped(const std::shared_ptr<CFileItem> item);
+ void OnPlaybackStopped(const std::shared_ptr<CFileItem>& item);
/*!
* @brief Inform PVR manager that playback of an item has stopped without user interaction.
* @param item The item that ended to play.
*/
- void OnPlaybackEnded(const std::shared_ptr<CFileItem> item);
+ void OnPlaybackEnded(const std::shared_ptr<CFileItem>& item);
/*!
* @brief Let the background thread create epg tags for all channels.
diff --git a/xbmc/pvr/PVRPlaybackState.cpp b/xbmc/pvr/PVRPlaybackState.cpp
index 1acb09bd18..1ecd90e1e1 100644
--- a/xbmc/pvr/PVRPlaybackState.cpp
+++ b/xbmc/pvr/PVRPlaybackState.cpp
@@ -72,7 +72,7 @@ void CPVRPlaybackState::Clear()
m_lastWatchedUpdateTimer.reset();
}
-void CPVRPlaybackState::OnPlaybackStarted(const std::shared_ptr<CFileItem> item)
+void CPVRPlaybackState::OnPlaybackStarted(const std::shared_ptr<CFileItem>& item)
{
CSingleLock lock(m_critSection);
@@ -128,7 +128,7 @@ void CPVRPlaybackState::OnPlaybackStarted(const std::shared_ptr<CFileItem> item)
}
}
-bool CPVRPlaybackState::OnPlaybackStopped(const std::shared_ptr<CFileItem> item)
+bool CPVRPlaybackState::OnPlaybackStopped(const std::shared_ptr<CFileItem>& item)
{
// Playback ended due to user interaction
@@ -183,7 +183,7 @@ bool CPVRPlaybackState::OnPlaybackStopped(const std::shared_ptr<CFileItem> item)
return bChanged;
}
-void CPVRPlaybackState::OnPlaybackEnded(const std::shared_ptr<CFileItem> item)
+void CPVRPlaybackState::OnPlaybackEnded(const std::shared_ptr<CFileItem>& item)
{
// Playback ended, but not due to user interaction
OnPlaybackStopped(item);
diff --git a/xbmc/pvr/PVRPlaybackState.h b/xbmc/pvr/PVRPlaybackState.h
index eebc49db5f..b315b47c45 100644
--- a/xbmc/pvr/PVRPlaybackState.h
+++ b/xbmc/pvr/PVRPlaybackState.h
@@ -45,20 +45,20 @@ public:
* @brief Inform that playback of an item just started.
* @param item The item that started to play.
*/
- void OnPlaybackStarted(const std::shared_ptr<CFileItem> item);
+ void OnPlaybackStarted(const std::shared_ptr<CFileItem>& item);
/*!
* @brief Inform that playback of an item was stopped due to user interaction.
* @param item The item that stopped to play.
* @return True, if the state has changed, false otherwise
*/
- bool OnPlaybackStopped(const std::shared_ptr<CFileItem> item);
+ bool OnPlaybackStopped(const std::shared_ptr<CFileItem>& item);
/*!
* @brief Inform that playback of an item has stopped without user interaction.
* @param item The item that ended to play.
*/
- void OnPlaybackEnded(const std::shared_ptr<CFileItem> item);
+ void OnPlaybackEnded(const std::shared_ptr<CFileItem>& item);
/*!
* @brief Check if a TV channel, radio channel or recording is playing.
diff --git a/xbmc/pvr/addons/PVRClient.cpp b/xbmc/pvr/addons/PVRClient.cpp
index cf94e307fa..226df1955b 100644
--- a/xbmc/pvr/addons/PVRClient.cpp
+++ b/xbmc/pvr/addons/PVRClient.cpp
@@ -701,7 +701,7 @@ class CAddonEpgTag : public EPG_TAG
{
public:
CAddonEpgTag() = delete;
- explicit CAddonEpgTag(const std::shared_ptr<const CPVREpgInfoTag> kodiTag)
+ explicit CAddonEpgTag(const std::shared_ptr<const CPVREpgInfoTag>& kodiTag)
: m_strTitle(kodiTag->Title()),
m_strPlotOutline(kodiTag->PlotOutline()),
m_strPlot(kodiTag->Plot()),
@@ -1349,7 +1349,7 @@ const char* CPVRClient::ToString(const PVR_ERROR error)
}
PVR_ERROR CPVRClient::DoAddonCall(const char* strFunctionName,
- std::function<PVR_ERROR(const AddonInstance*)> function,
+ const std::function<PVR_ERROR(const AddonInstance*)>& function,
bool bIsImplemented /* = true */,
bool bCheckReadyToUse /* = true */) const
{
diff --git a/xbmc/pvr/addons/PVRClient.h b/xbmc/pvr/addons/PVRClient.h
index e873a919df..f85af4d0fc 100644
--- a/xbmc/pvr/addons/PVRClient.h
+++ b/xbmc/pvr/addons/PVRClient.h
@@ -1056,7 +1056,7 @@ private:
*/
typedef AddonInstance_PVR AddonInstance;
PVR_ERROR DoAddonCall(const char* strFunctionName,
- std::function<PVR_ERROR(const AddonInstance*)> function,
+ const std::function<PVR_ERROR(const AddonInstance*)>& function,
bool bIsImplemented = true,
bool bCheckReadyToUse = true) const;
diff --git a/xbmc/pvr/addons/PVRClientMenuHooks.cpp b/xbmc/pvr/addons/PVRClientMenuHooks.cpp
index 6c257cccff..b1297d5a19 100644
--- a/xbmc/pvr/addons/PVRClientMenuHooks.cpp
+++ b/xbmc/pvr/addons/PVRClientMenuHooks.cpp
@@ -113,7 +113,8 @@ void CPVRClientMenuHooks::Clear()
m_hooks.reset();
}
-std::vector<CPVRClientMenuHook> CPVRClientMenuHooks::GetHooks(std::function<bool(const CPVRClientMenuHook& hook)> function) const
+std::vector<CPVRClientMenuHook> CPVRClientMenuHooks::GetHooks(
+ const std::function<bool(const CPVRClientMenuHook& hook)>& function) const
{
std::vector<CPVRClientMenuHook> hooks;
diff --git a/xbmc/pvr/addons/PVRClientMenuHooks.h b/xbmc/pvr/addons/PVRClientMenuHooks.h
index a2b1c65913..1a0522d85a 100644
--- a/xbmc/pvr/addons/PVRClientMenuHooks.h
+++ b/xbmc/pvr/addons/PVRClientMenuHooks.h
@@ -63,7 +63,8 @@ namespace PVR
std::vector<CPVRClientMenuHook> GetSettingsHooks() const;
private:
- std::vector<CPVRClientMenuHook> GetHooks(std::function<bool(const CPVRClientMenuHook& hook)> function) const;
+ std::vector<CPVRClientMenuHook> GetHooks(
+ const std::function<bool(const CPVRClientMenuHook& hook)>& function) const;
std::string m_addonId;
std::unique_ptr<std::vector<CPVRClientMenuHook>> m_hooks;
diff --git a/xbmc/pvr/addons/PVRClients.cpp b/xbmc/pvr/addons/PVRClients.cpp
index fee115c720..ebebe76b03 100644
--- a/xbmc/pvr/addons/PVRClients.cpp
+++ b/xbmc/pvr/addons/PVRClients.cpp
@@ -716,13 +716,16 @@ void CPVRClients::ConnectionStateChange(CPVRClient* client,
}
}
-PVR_ERROR CPVRClients::ForCreatedClients(const char* strFunctionName, PVRClientFunction function) const
+PVR_ERROR CPVRClients::ForCreatedClients(const char* strFunctionName,
+ const PVRClientFunction& function) const
{
std::vector<int> failedClients;
return ForCreatedClients(strFunctionName, function, failedClients);
}
-PVR_ERROR CPVRClients::ForCreatedClients(const char* strFunctionName, PVRClientFunction function, std::vector<int>& failedClients) const
+PVR_ERROR CPVRClients::ForCreatedClients(const char* strFunctionName,
+ const PVRClientFunction& function,
+ std::vector<int>& failedClients) const
{
PVR_ERROR lastError = PVR_ERROR_NO_ERROR;
diff --git a/xbmc/pvr/addons/PVRClients.h b/xbmc/pvr/addons/PVRClients.h
index e43dee7c54..e7b7c0b338 100644
--- a/xbmc/pvr/addons/PVRClients.h
+++ b/xbmc/pvr/addons/PVRClients.h
@@ -360,7 +360,8 @@ namespace PVR
* @param function The function to wrap. It has to have return type PVR_ERROR and must take a const reference to a std::shared_ptr<CPVRClient> as parameter.
* @return PVR_ERROR_NO_ERROR on success, any other PVR_ERROR_* value otherwise.
*/
- PVR_ERROR ForCreatedClients(const char* strFunctionName, PVRClientFunction function) const;
+ PVR_ERROR ForCreatedClients(const char* strFunctionName,
+ const PVRClientFunction& function) const;
/*!
* @brief Wraps calls to all created clients in order to do common pre and post function invocation actions.
@@ -369,7 +370,9 @@ namespace PVR
* @param failedClients Contains a list of the ids of clients for that the call failed, if any.
* @return PVR_ERROR_NO_ERROR on success, any other PVR_ERROR_* value otherwise.
*/
- PVR_ERROR ForCreatedClients(const char* strFunctionName, PVRClientFunction function, std::vector<int>& failedClients) const;
+ PVR_ERROR ForCreatedClients(const char* strFunctionName,
+ const PVRClientFunction& function,
+ std::vector<int>& failedClients) const;
mutable CCriticalSection m_critSection;
CPVRClientMap m_clientMap;
diff --git a/xbmc/pvr/channels/PVRChannelGroup.cpp b/xbmc/pvr/channels/PVRChannelGroup.cpp
index adf5fa74c9..d6c1f24dfe 100644
--- a/xbmc/pvr/channels/PVRChannelGroup.cpp
+++ b/xbmc/pvr/channels/PVRChannelGroup.cpp
@@ -879,7 +879,7 @@ bool CPVRChannelGroup::HasChanges() const
return m_bChanged || HasNewChannels() || HasChangedChannels();
}
-void CPVRChannelGroup::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CPVRChannelGroup::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
diff --git a/xbmc/pvr/channels/PVRChannelGroup.h b/xbmc/pvr/channels/PVRChannelGroup.h
index 985391085b..2977a921f4 100644
--- a/xbmc/pvr/channels/PVRChannelGroup.h
+++ b/xbmc/pvr/channels/PVRChannelGroup.h
@@ -37,12 +37,18 @@ namespace PVR
{
PVRChannelGroupMember() = default;
- PVRChannelGroupMember(const std::shared_ptr<CPVRChannel> _channel, const CPVRChannelNumber& _channelNumber, int _iClientPriority, int _iOrder, const CPVRChannelNumber& _clientChannelNumber)
- : channel(_channel)
- , channelNumber(_channelNumber)
- , clientChannelNumber(_clientChannelNumber)
- , iClientPriority(_iClientPriority)
- , iOrder(_iOrder) {}
+ PVRChannelGroupMember(const std::shared_ptr<CPVRChannel>& _channel,
+ const CPVRChannelNumber& _channelNumber,
+ int _iClientPriority,
+ int _iOrder,
+ const CPVRChannelNumber& _clientChannelNumber)
+ : channel(_channel),
+ channelNumber(_channelNumber),
+ clientChannelNumber(_clientChannelNumber),
+ iClientPriority(_iClientPriority),
+ iOrder(_iOrder)
+ {
+ }
std::shared_ptr<CPVRChannel> channel;
CPVRChannelNumber channelNumber; // the channel number this channel has in the group
@@ -292,7 +298,7 @@ namespace PVR
//@}
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
/*!
* @brief Get a channel given it's EPG ID.
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRClientPriorities.cpp b/xbmc/pvr/dialogs/GUIDialogPVRClientPriorities.cpp
index 3a4ed11e33..5e9ac641d9 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRClientPriorities.cpp
+++ b/xbmc/pvr/dialogs/GUIDialogPVRClientPriorities.cpp
@@ -37,7 +37,8 @@ void CGUIDialogPVRClientPriorities::SetupView()
SET_CONTROL_LABEL(CONTROL_SETTINGS_CANCEL_BUTTON, 222); // Cancel
}
-std::string CGUIDialogPVRClientPriorities::GetSettingsLabel(std::shared_ptr<ISetting> pSetting)
+std::string CGUIDialogPVRClientPriorities::GetSettingsLabel(
+ const std::shared_ptr<ISetting>& pSetting)
{
int iClientId = std::atoi(pSetting->GetId().c_str());
auto clientEntry = m_clients.find(iClientId);
@@ -75,7 +76,7 @@ void CGUIDialogPVRClientPriorities::InitializeSettings()
}
}
-void CGUIDialogPVRClientPriorities::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogPVRClientPriorities::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
{
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRClientPriorities.h b/xbmc/pvr/dialogs/GUIDialogPVRClientPriorities.h
index 5218b00070..6cd9ce2c3d 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRClientPriorities.h
+++ b/xbmc/pvr/dialogs/GUIDialogPVRClientPriorities.h
@@ -23,10 +23,10 @@ namespace PVR
protected:
// implementation of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
- std::string GetSettingsLabel(std::shared_ptr<ISetting> pSetting) override;
+ std::string GetSettingsLabel(const std::shared_ptr<ISetting>& pSetting) override;
bool AllowResettingSettings() const override { return false; }
void Save() override;
void SetupView() override;
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.cpp b/xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.cpp
index 100e8392e1..d08999cce4 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.cpp
+++ b/xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.cpp
@@ -115,7 +115,8 @@ bool CGUIDialogPVRRecordingSettings::CanEditRecording(const CFileItem& item)
capabilities.SupportsRecordingsLifetimeChange();
}
-bool CGUIDialogPVRRecordingSettings::OnSettingChanging(std::shared_ptr<const CSetting> setting)
+bool CGUIDialogPVRRecordingSettings::OnSettingChanging(
+ const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
{
@@ -140,7 +141,8 @@ bool CGUIDialogPVRRecordingSettings::OnSettingChanging(std::shared_ptr<const CSe
return CGUIDialogSettingsManualBase::OnSettingChanging(setting);
}
-void CGUIDialogPVRRecordingSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogPVRRecordingSettings::OnSettingChanged(
+ const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
{
@@ -178,8 +180,10 @@ void CGUIDialogPVRRecordingSettings::Save()
m_recording->m_iLifetime = m_iLifetime;
}
-void CGUIDialogPVRRecordingSettings::LifetimesFiller(
- SettingConstPtr setting, std::vector<IntegerSettingOption>& list, int& current, void* data)
+void CGUIDialogPVRRecordingSettings::LifetimesFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CGUIDialogPVRRecordingSettings* pThis = static_cast<CGUIDialogPVRRecordingSettings*>(data);
if (pThis)
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.h b/xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.h
index 7508de7c02..f5dd9566ce 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.h
+++ b/xbmc/pvr/dialogs/GUIDialogPVRRecordingSettings.h
@@ -33,8 +33,8 @@ namespace PVR
protected:
// implementation of ISettingCallback
- bool OnSettingChanging(std::shared_ptr<const CSetting> setting) override;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ bool OnSettingChanging(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
@@ -45,9 +45,10 @@ namespace PVR
void InitializeSettings() override;
private:
- static void LifetimesFiller(std::shared_ptr<const CSetting> setting,
+ static void LifetimesFiller(const std::shared_ptr<const CSetting>& setting,
std::vector<IntegerSettingOption>& list,
- int& current, void* data);
+ int& current,
+ void* data);
std::shared_ptr<CPVRRecording> m_recording;
std::string m_strTitle;
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp b/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp
index b533160be0..0c9cbec447 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp
+++ b/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp
@@ -353,7 +353,7 @@ void CGUIDialogPVRTimerSettings::InitializeSettings()
AddTypeDependentEnableCondition(setting, SETTING_TMR_REC_GROUP);
}
-int CGUIDialogPVRTimerSettings::GetWeekdaysFromSetting(SettingConstPtr setting)
+int CGUIDialogPVRTimerSettings::GetWeekdaysFromSetting(const SettingConstPtr& setting)
{
std::shared_ptr<const CSettingList> settingList = std::static_pointer_cast<const CSettingList>(setting);
if (settingList->GetElementType() != SettingType::Integer)
@@ -376,7 +376,7 @@ int CGUIDialogPVRTimerSettings::GetWeekdaysFromSetting(SettingConstPtr setting)
return weekdays;
}
-void CGUIDialogPVRTimerSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogPVRTimerSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
{
@@ -491,7 +491,7 @@ void CGUIDialogPVRTimerSettings::OnSettingChanged(std::shared_ptr<const CSetting
}
}
-void CGUIDialogPVRTimerSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CGUIDialogPVRTimerSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
{
@@ -657,9 +657,11 @@ void CGUIDialogPVRTimerSettings::SetButtonLabels()
}
}
-void CGUIDialogPVRTimerSettings::AddCondition(
- std::shared_ptr<CSetting> setting, const std::string& identifier, SettingConditionCheck condition,
- SettingDependencyType depType, const std::string& settingId)
+void CGUIDialogPVRTimerSettings::AddCondition(const std::shared_ptr<CSetting>& setting,
+ const std::string& identifier,
+ SettingConditionCheck condition,
+ SettingDependencyType depType,
+ const std::string& settingId)
{
GetSettingsManager()->AddDynamicCondition(identifier, condition, this);
CSettingDependency dep(depType, GetSettingsManager());
@@ -795,8 +797,10 @@ void CGUIDialogPVRTimerSettings::InitializeChannelsList()
}
}
-void CGUIDialogPVRTimerSettings::TypesFiller(
- SettingConstPtr setting, std::vector<IntegerSettingOption>& list, int& current, void* data)
+void CGUIDialogPVRTimerSettings::TypesFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CGUIDialogPVRTimerSettings* pThis = static_cast<CGUIDialogPVRTimerSettings*>(data);
if (pThis)
@@ -824,8 +828,10 @@ void CGUIDialogPVRTimerSettings::TypesFiller(
CLog::LogF(LOGERROR, "No dialog");
}
-void CGUIDialogPVRTimerSettings::ChannelsFiller(
- SettingConstPtr setting, std::vector<IntegerSettingOption>& list, int& current, void* data)
+void CGUIDialogPVRTimerSettings::ChannelsFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CGUIDialogPVRTimerSettings* pThis = static_cast<CGUIDialogPVRTimerSettings*>(data);
if (pThis)
@@ -859,8 +865,10 @@ void CGUIDialogPVRTimerSettings::ChannelsFiller(
CLog::LogF(LOGERROR, "No dialog");
}
-void CGUIDialogPVRTimerSettings::DaysFiller(
- SettingConstPtr setting, std::vector<IntegerSettingOption>& list, int& current, void* data)
+void CGUIDialogPVRTimerSettings::DaysFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CGUIDialogPVRTimerSettings* pThis = static_cast<CGUIDialogPVRTimerSettings*>(data);
if (pThis)
@@ -903,8 +911,10 @@ void CGUIDialogPVRTimerSettings::DaysFiller(
CLog::LogF(LOGERROR, "No dialog");
}
-void CGUIDialogPVRTimerSettings::DupEpisodesFiller(
- SettingConstPtr setting, std::vector<IntegerSettingOption>& list, int& current, void* data)
+void CGUIDialogPVRTimerSettings::DupEpisodesFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CGUIDialogPVRTimerSettings* pThis = static_cast<CGUIDialogPVRTimerSettings*>(data);
if (pThis)
@@ -922,8 +932,10 @@ void CGUIDialogPVRTimerSettings::DupEpisodesFiller(
CLog::LogF(LOGERROR, "No dialog");
}
-void CGUIDialogPVRTimerSettings::WeekdaysFiller(
- SettingConstPtr setting, std::vector<IntegerSettingOption>& list, int& current, void* data)
+void CGUIDialogPVRTimerSettings::WeekdaysFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CGUIDialogPVRTimerSettings* pThis = static_cast<CGUIDialogPVRTimerSettings*>(data);
if (pThis)
@@ -943,8 +955,10 @@ void CGUIDialogPVRTimerSettings::WeekdaysFiller(
CLog::LogF(LOGERROR, "No dialog");
}
-void CGUIDialogPVRTimerSettings::PrioritiesFiller(
- SettingConstPtr setting, std::vector<IntegerSettingOption>& list, int& current, void* data)
+void CGUIDialogPVRTimerSettings::PrioritiesFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CGUIDialogPVRTimerSettings* pThis = static_cast<CGUIDialogPVRTimerSettings*>(data);
if (pThis)
@@ -977,8 +991,10 @@ void CGUIDialogPVRTimerSettings::PrioritiesFiller(
CLog::LogF(LOGERROR, "No dialog");
}
-void CGUIDialogPVRTimerSettings::LifetimesFiller(
- SettingConstPtr setting, std::vector<IntegerSettingOption>& list, int& current, void* data)
+void CGUIDialogPVRTimerSettings::LifetimesFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CGUIDialogPVRTimerSettings* pThis = static_cast<CGUIDialogPVRTimerSettings*>(data);
if (pThis)
@@ -1011,8 +1027,10 @@ void CGUIDialogPVRTimerSettings::LifetimesFiller(
CLog::LogF(LOGERROR, "No dialog");
}
-void CGUIDialogPVRTimerSettings::MaxRecordingsFiller(
- SettingConstPtr setting, std::vector<IntegerSettingOption>& list, int& current, void* data)
+void CGUIDialogPVRTimerSettings::MaxRecordingsFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CGUIDialogPVRTimerSettings* pThis = static_cast<CGUIDialogPVRTimerSettings*>(data);
if (pThis)
@@ -1045,8 +1063,10 @@ void CGUIDialogPVRTimerSettings::MaxRecordingsFiller(
CLog::LogF(LOGERROR, "No dialog");
}
-void CGUIDialogPVRTimerSettings::RecordingGroupFiller(
- SettingConstPtr setting, std::vector<IntegerSettingOption>& list, int& current, void* data)
+void CGUIDialogPVRTimerSettings::RecordingGroupFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CGUIDialogPVRTimerSettings* pThis = static_cast<CGUIDialogPVRTimerSettings*>(data);
if (pThis)
@@ -1064,8 +1084,10 @@ void CGUIDialogPVRTimerSettings::RecordingGroupFiller(
CLog::LogF(LOGERROR, "No dialog");
}
-void CGUIDialogPVRTimerSettings::MarginTimeFiller(
- SettingConstPtr setting, std::vector<IntegerSettingOption>& list, int& current, void* data)
+void CGUIDialogPVRTimerSettings::MarginTimeFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CGUIDialogPVRTimerSettings* pThis = static_cast<CGUIDialogPVRTimerSettings*>(data);
if (pThis)
@@ -1106,12 +1128,13 @@ void CGUIDialogPVRTimerSettings::MarginTimeFiller(
CLog::LogF(LOGERROR, "No dialog");
}
-std::string CGUIDialogPVRTimerSettings::WeekdaysValueFormatter(SettingConstPtr setting)
+std::string CGUIDialogPVRTimerSettings::WeekdaysValueFormatter(const SettingConstPtr& setting)
{
return CPVRTimerInfoTag::GetWeekdaysString(GetWeekdaysFromSetting(setting), true, true);
}
-void CGUIDialogPVRTimerSettings::AddTypeDependentEnableCondition(std::shared_ptr<CSetting> setting, const std::string& identifier)
+void CGUIDialogPVRTimerSettings::AddTypeDependentEnableCondition(
+ const std::shared_ptr<CSetting>& setting, const std::string& identifier)
{
// Enable setting depending on read-only attribute of the selected timer type
std::string id(identifier);
@@ -1119,7 +1142,10 @@ void CGUIDialogPVRTimerSettings::AddTypeDependentEnableCondition(std::shared_ptr
AddCondition(setting, id, TypeReadOnlyCondition, SettingDependencyType::Enable, SETTING_TMR_TYPE);
}
-bool CGUIDialogPVRTimerSettings::TypeReadOnlyCondition(const std::string& condition, const std::string& value, SettingConstPtr setting, void* data)
+bool CGUIDialogPVRTimerSettings::TypeReadOnlyCondition(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
if (setting == NULL)
return false;
@@ -1174,7 +1200,8 @@ bool CGUIDialogPVRTimerSettings::TypeReadOnlyCondition(const std::string& condit
return false;
}
-void CGUIDialogPVRTimerSettings::AddTypeDependentVisibilityCondition(std::shared_ptr<CSetting> setting, const std::string& identifier)
+void CGUIDialogPVRTimerSettings::AddTypeDependentVisibilityCondition(
+ const std::shared_ptr<CSetting>& setting, const std::string& identifier)
{
// Show or hide setting depending on attributes of the selected timer type
std::string id(identifier);
@@ -1182,7 +1209,10 @@ void CGUIDialogPVRTimerSettings::AddTypeDependentVisibilityCondition(std::shared
AddCondition(setting, id, TypeSupportsCondition, SettingDependencyType::Visible, SETTING_TMR_TYPE);
}
-bool CGUIDialogPVRTimerSettings::TypeSupportsCondition(const std::string& condition, const std::string& value, SettingConstPtr setting, void* data)
+bool CGUIDialogPVRTimerSettings::TypeSupportsCondition(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
if (setting == NULL)
return false;
@@ -1254,7 +1284,8 @@ bool CGUIDialogPVRTimerSettings::TypeSupportsCondition(const std::string& condit
return false;
}
-void CGUIDialogPVRTimerSettings::AddStartAnytimeDependentVisibilityCondition(std::shared_ptr<CSetting> setting, const std::string& identifier)
+void CGUIDialogPVRTimerSettings::AddStartAnytimeDependentVisibilityCondition(
+ const std::shared_ptr<CSetting>& setting, const std::string& identifier)
{
// Show or hide setting depending on value of setting "any time"
std::string id(identifier);
@@ -1262,7 +1293,10 @@ void CGUIDialogPVRTimerSettings::AddStartAnytimeDependentVisibilityCondition(std
AddCondition(setting, id, StartAnytimeSetCondition, SettingDependencyType::Visible, SETTING_TMR_START_ANYTIME);
}
-bool CGUIDialogPVRTimerSettings::StartAnytimeSetCondition(const std::string& condition, const std::string& value, SettingConstPtr setting, void* data)
+bool CGUIDialogPVRTimerSettings::StartAnytimeSetCondition(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
if (setting == NULL)
return false;
@@ -1297,7 +1331,8 @@ bool CGUIDialogPVRTimerSettings::StartAnytimeSetCondition(const std::string& con
return false;
}
-void CGUIDialogPVRTimerSettings::AddEndAnytimeDependentVisibilityCondition(std::shared_ptr<CSetting> setting, const std::string& identifier)
+void CGUIDialogPVRTimerSettings::AddEndAnytimeDependentVisibilityCondition(
+ const std::shared_ptr<CSetting>& setting, const std::string& identifier)
{
// Show or hide setting depending on value of setting "any time"
std::string id(identifier);
@@ -1305,7 +1340,10 @@ void CGUIDialogPVRTimerSettings::AddEndAnytimeDependentVisibilityCondition(std::
AddCondition(setting, id, EndAnytimeSetCondition, SettingDependencyType::Visible, SETTING_TMR_END_ANYTIME);
}
-bool CGUIDialogPVRTimerSettings::EndAnytimeSetCondition(const std::string& condition, const std::string& value, SettingConstPtr setting, void* data)
+bool CGUIDialogPVRTimerSettings::EndAnytimeSetCondition(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
if (setting == NULL)
return false;
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.h b/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.h
index 4c60294824..ec8da192a3 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.h
+++ b/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.h
@@ -40,8 +40,8 @@ namespace PVR
protected:
// implementation of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
@@ -60,49 +60,83 @@ namespace PVR
static void SetDateFromIndex(CDateTime& datetime, int date);
static void SetTimeFromSystemTime(CDateTime& datetime, const KODI::TIME::SystemTime& time);
- static int GetWeekdaysFromSetting(std::shared_ptr<const CSetting> setting);
-
- static void TypesFiller(
- std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption>& list, int& current, void* data);
- static void ChannelsFiller(
- std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption>& list, int& current, void* data);
- static void DaysFiller(
- std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption>& list, int& current, void* data);
- static void DupEpisodesFiller(
- std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption>& list, int& current, void* data);
- static void WeekdaysFiller(
- std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption>& list, int& current, void* data);
- static void PrioritiesFiller(
- std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption>& list, int& current, void* data);
- static void LifetimesFiller(
- std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption>& list, int& current, void* data);
- static void MaxRecordingsFiller(
- std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption>& list, int& current, void* data);
- static void RecordingGroupFiller(
- std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption>& list, int& current, void* data);
- static void MarginTimeFiller(
- std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption>& list, int& current, void* data);
-
- static std::string WeekdaysValueFormatter(std::shared_ptr<const CSetting> setting);
-
- void AddCondition(
- std::shared_ptr<CSetting> setting, const std::string& identifier, SettingConditionCheck condition,
- SettingDependencyType depType, const std::string& settingId);
-
- void AddTypeDependentEnableCondition(std::shared_ptr<CSetting> setting, const std::string& identifier);
- static bool TypeReadOnlyCondition(
- const std::string& condition, const std::string& value, std::shared_ptr<const CSetting> setting, void* data);
-
- void AddTypeDependentVisibilityCondition(std::shared_ptr<CSetting> setting, const std::string& identifier);
- static bool TypeSupportsCondition(
- const std::string& condition, const std::string& value, std::shared_ptr<const CSetting> setting, void* data);
-
- void AddStartAnytimeDependentVisibilityCondition(std::shared_ptr<CSetting> setting, const std::string& identifier);
- static bool StartAnytimeSetCondition(
- const std::string& condition, const std::string& value, std::shared_ptr<const CSetting> setting, void* data);
- void AddEndAnytimeDependentVisibilityCondition(std::shared_ptr<CSetting> setting, const std::string& identifier);
- static bool EndAnytimeSetCondition(
- const std::string& condition, const std::string& value, std::shared_ptr<const CSetting> setting, void* data);
+ static int GetWeekdaysFromSetting(const std::shared_ptr<const CSetting>& setting);
+
+ static void TypesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void ChannelsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void DaysFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void DupEpisodesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void WeekdaysFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void PrioritiesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void LifetimesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void MaxRecordingsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void RecordingGroupFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void MarginTimeFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+
+ static std::string WeekdaysValueFormatter(const std::shared_ptr<const CSetting>& setting);
+
+ void AddCondition(const std::shared_ptr<CSetting>& setting,
+ const std::string& identifier,
+ SettingConditionCheck condition,
+ SettingDependencyType depType,
+ const std::string& settingId);
+
+ void AddTypeDependentEnableCondition(const std::shared_ptr<CSetting>& setting,
+ const std::string& identifier);
+ static bool TypeReadOnlyCondition(const std::string& condition,
+ const std::string& value,
+ const std::shared_ptr<const CSetting>& setting,
+ void* data);
+
+ void AddTypeDependentVisibilityCondition(const std::shared_ptr<CSetting>& setting,
+ const std::string& identifier);
+ static bool TypeSupportsCondition(const std::string& condition,
+ const std::string& value,
+ const std::shared_ptr<const CSetting>& setting,
+ void* data);
+
+ void AddStartAnytimeDependentVisibilityCondition(const std::shared_ptr<CSetting>& setting,
+ const std::string& identifier);
+ static bool StartAnytimeSetCondition(const std::string& condition,
+ const std::string& value,
+ const std::shared_ptr<const CSetting>& setting,
+ void* data);
+ void AddEndAnytimeDependentVisibilityCondition(const std::shared_ptr<CSetting>& setting,
+ const std::string& identifier);
+ static bool EndAnytimeSetCondition(const std::string& condition,
+ const std::string& value,
+ const std::shared_ptr<const CSetting>& setting,
+ void* data);
typedef std::map<int, std::shared_ptr<CPVRTimerType>> TypeEntriesMap;
diff --git a/xbmc/pvr/guilib/PVRGUIActionListener.cpp b/xbmc/pvr/guilib/PVRGUIActionListener.cpp
index 93e8f37e3b..d4fb39b185 100644
--- a/xbmc/pvr/guilib/PVRGUIActionListener.cpp
+++ b/xbmc/pvr/guilib/PVRGUIActionListener.cpp
@@ -274,7 +274,7 @@ bool CPVRGUIActionListener::OnAction(const CAction& action)
return false;
}
-void CPVRGUIActionListener::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CPVRGUIActionListener::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
@@ -299,7 +299,7 @@ void CPVRGUIActionListener::OnSettingChanged(std::shared_ptr<const CSetting> set
}
}
-void CPVRGUIActionListener::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CPVRGUIActionListener::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
diff --git a/xbmc/pvr/guilib/PVRGUIActionListener.h b/xbmc/pvr/guilib/PVRGUIActionListener.h
index f84ee97d1b..d24818bff2 100644
--- a/xbmc/pvr/guilib/PVRGUIActionListener.h
+++ b/xbmc/pvr/guilib/PVRGUIActionListener.h
@@ -31,8 +31,8 @@ public:
bool OnAction(const CAction& action) override;
// ISettingCallback implementation
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
void OnPVRManagerEvent(const PVREvent& event);
diff --git a/xbmc/pvr/guilib/PVRGUIChannelNavigator.cpp b/xbmc/pvr/guilib/PVRGUIChannelNavigator.cpp
index db55e2dfa6..ba57aaa764 100644
--- a/xbmc/pvr/guilib/PVRGUIChannelNavigator.cpp
+++ b/xbmc/pvr/guilib/PVRGUIChannelNavigator.cpp
@@ -130,7 +130,8 @@ namespace PVR
return {};
}
- void CPVRGUIChannelNavigator::SelectChannel(const std::shared_ptr<CPVRChannel> channel, ChannelSwitchMode eSwitchMode)
+ void CPVRGUIChannelNavigator::SelectChannel(const std::shared_ptr<CPVRChannel>& channel,
+ ChannelSwitchMode eSwitchMode)
{
CServiceBroker::GetGUI()->GetInfoManager().SetCurrentItem(CFileItem(channel));
@@ -253,7 +254,7 @@ namespace PVR
ShowInfo();
}
- void CPVRGUIChannelNavigator::SetPlayingChannel(const std::shared_ptr<CPVRChannel> channel)
+ void CPVRGUIChannelNavigator::SetPlayingChannel(const std::shared_ptr<CPVRChannel>& channel)
{
CFileItemPtr item;
diff --git a/xbmc/pvr/guilib/PVRGUIChannelNavigator.h b/xbmc/pvr/guilib/PVRGUIChannelNavigator.h
index 3d1cb1b959..df52367203 100644
--- a/xbmc/pvr/guilib/PVRGUIChannelNavigator.h
+++ b/xbmc/pvr/guilib/PVRGUIChannelNavigator.h
@@ -75,7 +75,7 @@ namespace PVR
* @brief Set a new playing channel and show the channel info OSD for the new channel.
* @param channel The new playing channel
*/
- void SetPlayingChannel(const std::shared_ptr<CPVRChannel> channel);
+ void SetPlayingChannel(const std::shared_ptr<CPVRChannel>& channel);
/*!
* @brief Clear the currently playing channel and hide the channel info OSD.
@@ -95,7 +95,7 @@ namespace PVR
* @param item The channel to select.
* @param eSwitchMode The channel switch mode.
*/
- void SelectChannel(const std::shared_ptr<CPVRChannel> channel, ChannelSwitchMode eSwitchMode);
+ void SelectChannel(const std::shared_ptr<CPVRChannel>& channel, ChannelSwitchMode eSwitchMode);
/*!
* @brief Show the channel info OSD.
diff --git a/xbmc/pvr/settings/PVRSettings.cpp b/xbmc/pvr/settings/PVRSettings.cpp
index 7ef2e091dd..ceeb219a8c 100644
--- a/xbmc/pvr/settings/PVRSettings.cpp
+++ b/xbmc/pvr/settings/PVRSettings.cpp
@@ -93,7 +93,7 @@ void CPVRSettings::OnSettingsLoaded()
Init(settingNames);
}
-void CPVRSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CPVRSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
@@ -147,8 +147,10 @@ std::string CPVRSettings::GetStringValue(const std::string& settingName) const
return "";
}
-void CPVRSettings::MarginTimeFiller(
- SettingConstPtr /*setting*/, std::vector<IntegerSettingOption>& list, int& current, void* /*data*/)
+void CPVRSettings::MarginTimeFiller(const SettingConstPtr& /*setting*/,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* /*data*/)
{
list.clear();
@@ -163,7 +165,10 @@ void CPVRSettings::MarginTimeFiller(
}
}
-bool CPVRSettings::IsSettingVisible(const std::string& condition, const std::string& value, std::shared_ptr<const CSetting> setting, void* data)
+bool CPVRSettings::IsSettingVisible(const std::string& condition,
+ const std::string& value,
+ const std::shared_ptr<const CSetting>& setting,
+ void* data)
{
if (setting == nullptr)
return false;
@@ -198,7 +203,10 @@ bool CPVRSettings::IsSettingVisible(const std::string& condition, const std::str
}
}
-bool CPVRSettings::CheckParentalPin(const std::string& condition, const std::string& value, std::shared_ptr<const CSetting> setting, void* data)
+bool CPVRSettings::CheckParentalPin(const std::string& condition,
+ const std::string& value,
+ const std::shared_ptr<const CSetting>& setting,
+ void* data)
{
return CServiceBroker::GetPVRManager().GUIActions()->CheckParentalPIN() == ParentalCheckResult::SUCCESS;
}
diff --git a/xbmc/pvr/settings/PVRSettings.h b/xbmc/pvr/settings/PVRSettings.h
index 38770b54fc..57d5c9655c 100644
--- a/xbmc/pvr/settings/PVRSettings.h
+++ b/xbmc/pvr/settings/PVRSettings.h
@@ -34,21 +34,29 @@ namespace PVR
void OnSettingsLoaded() override;
// ISettingCallback implementation
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
bool GetBoolValue(const std::string& settingName) const;
int GetIntValue(const std::string& settingName) const;
std::string GetStringValue(const std::string& settingName) const;
// settings value filler for start/end recording margin time for PVR timers.
- static void MarginTimeFiller(
- std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption>& list, int& current, void* data);
+ static void MarginTimeFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
// Dynamically hide or show settings.
- static bool IsSettingVisible(const std::string& condition, const std::string& value, std::shared_ptr<const CSetting> setting, void* data);
+ static bool IsSettingVisible(const std::string& condition,
+ const std::string& value,
+ const std::shared_ptr<const CSetting>& setting,
+ void* data);
// Do parental PIN check.
- static bool CheckParentalPin(const std::string& condition, const std::string& value, std::shared_ptr<const CSetting> setting, void* data);
+ static bool CheckParentalPin(const std::string& condition,
+ const std::string& value,
+ const std::shared_ptr<const CSetting>& setting,
+ void* data);
private:
CPVRSettings(const CPVRSettings&) = delete;
diff --git a/xbmc/rendering/gl/GLShader.cpp b/xbmc/rendering/gl/GLShader.cpp
index 772fefb80b..e91af97b56 100644
--- a/xbmc/rendering/gl/GLShader.cpp
+++ b/xbmc/rendering/gl/GLShader.cpp
@@ -17,7 +17,7 @@
using namespace Shaders;
-CGLShader::CGLShader(const char *shader, std::string prefix)
+CGLShader::CGLShader(const char* shader, const std::string& prefix)
{
m_proj = nullptr;
m_model = nullptr;
@@ -27,7 +27,7 @@ CGLShader::CGLShader(const char *shader, std::string prefix)
PixelShader()->LoadSource(shader, prefix);
}
-CGLShader::CGLShader(const char *vshader, const char *fshader, std::string prefix)
+CGLShader::CGLShader(const char* vshader, const char* fshader, const std::string& prefix)
{
m_proj = nullptr;
m_model = nullptr;
diff --git a/xbmc/rendering/gl/GLShader.h b/xbmc/rendering/gl/GLShader.h
index c39fb29d7d..d5b82f3a07 100644
--- a/xbmc/rendering/gl/GLShader.h
+++ b/xbmc/rendering/gl/GLShader.h
@@ -15,8 +15,8 @@
class CGLShader : public Shaders::CGLSLShaderProgram
{
public:
- CGLShader(const char *shader, std::string prefix);
- CGLShader(const char *vshader, const char *fshader, std::string prefix);
+ CGLShader(const char* shader, const std::string& prefix);
+ CGLShader(const char* vshader, const char* fshader, const std::string& prefix);
void OnCompiledAndLinked() override;
bool OnEnabled() override;
void Free();
diff --git a/xbmc/rendering/gles/GLESShader.cpp b/xbmc/rendering/gles/GLESShader.cpp
index 3835cd687a..3964f4ba47 100644
--- a/xbmc/rendering/gles/GLESShader.cpp
+++ b/xbmc/rendering/gles/GLESShader.cpp
@@ -16,7 +16,7 @@
using namespace Shaders;
-CGLESShader::CGLESShader( const char *shader, std::string prefix)
+CGLESShader::CGLESShader(const char* shader, const std::string& prefix)
{
m_proj = nullptr;
m_model = nullptr;
@@ -26,7 +26,7 @@ CGLESShader::CGLESShader( const char *shader, std::string prefix)
PixelShader()->LoadSource(shader, prefix);
}
-CGLESShader::CGLESShader(const char *vshader, const char *fshader, std::string prefix)
+CGLESShader::CGLESShader(const char* vshader, const char* fshader, const std::string& prefix)
{
m_proj = nullptr;
m_model = nullptr;
diff --git a/xbmc/rendering/gles/GLESShader.h b/xbmc/rendering/gles/GLESShader.h
index 53c0772fbc..8ce31e5570 100644
--- a/xbmc/rendering/gles/GLESShader.h
+++ b/xbmc/rendering/gles/GLESShader.h
@@ -15,8 +15,8 @@
class CGLESShader : public Shaders::CGLSLShaderProgram
{
public:
- CGLESShader( const char *shader, std::string prefix);
- CGLESShader(const char *vshader, const char *fshader, std::string prefix);
+ CGLESShader(const char* shader, const std::string& prefix);
+ CGLESShader(const char* vshader, const char* fshader, const std::string& prefix);
void OnCompiledAndLinked() override;
bool OnEnabled() override;
void Free();
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp
index 03280ed6a5..bc1352b84c 100644
--- a/xbmc/settings/AdvancedSettings.cpp
+++ b/xbmc/settings/AdvancedSettings.cpp
@@ -75,7 +75,7 @@ void CAdvancedSettings::OnSettingsUnloaded()
m_initialized = false;
}
-void CAdvancedSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CAdvancedSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h
index 23f19261ed..0f9e1bbe69 100644
--- a/xbmc/settings/AdvancedSettings.h
+++ b/xbmc/settings/AdvancedSettings.h
@@ -112,7 +112,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler
void OnSettingsLoaded() override;
void OnSettingsUnloaded() override;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
void Initialize(const CAppParamParser &params, CSettingsManager& settingsMgr);
void Uninitialize(CSettingsManager& settingsMgr);
diff --git a/xbmc/settings/DiscSettings.cpp b/xbmc/settings/DiscSettings.cpp
index 76f2884c3c..de8bb33c80 100644
--- a/xbmc/settings/DiscSettings.cpp
+++ b/xbmc/settings/DiscSettings.cpp
@@ -28,7 +28,7 @@ CDiscSettings& CDiscSettings::GetInstance()
return sDiscSettings;
}
-void CDiscSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CDiscSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
#if (BLURAY_VERSION >= BLURAY_VERSION_CODE(1,0,1))
if (setting == NULL)
diff --git a/xbmc/settings/DiscSettings.h b/xbmc/settings/DiscSettings.h
index a4cbad56a0..9d62eea18f 100644
--- a/xbmc/settings/DiscSettings.h
+++ b/xbmc/settings/DiscSettings.h
@@ -26,7 +26,7 @@ public:
/* ISettingCallback*/
static CDiscSettings& GetInstance();
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
private:
CDiscSettings() = default;
diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp
index c0696548c9..d9b90eb1ad 100644
--- a/xbmc/settings/DisplaySettings.cpp
+++ b/xbmc/settings/DisplaySettings.cpp
@@ -236,7 +236,7 @@ void CDisplaySettings::Clear()
m_nonLinearStretched = false;
}
-void CDisplaySettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CDisplaySettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -264,7 +264,7 @@ void CDisplaySettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
}
}
-bool CDisplaySettings::OnSettingChanging(std::shared_ptr<const CSetting> setting)
+bool CDisplaySettings::OnSettingChanging(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return false;
@@ -356,7 +356,9 @@ bool CDisplaySettings::OnSettingChanging(std::shared_ptr<const CSetting> setting
return true;
}
-bool CDisplaySettings::OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *oldSettingId, const TiXmlNode *oldSettingNode)
+bool CDisplaySettings::OnSettingUpdate(const std::shared_ptr<CSetting>& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode)
{
if (setting == NULL)
return false;
@@ -398,7 +400,7 @@ bool CDisplaySettings::OnSettingUpdate(std::shared_ptr<CSetting> setting, const
return false;
}
-void CDisplaySettings::SetMonitor(std::string monitor)
+void CDisplaySettings::SetMonitor(const std::string& monitor)
{
const std::shared_ptr<CSettings> settings = CServiceBroker::GetSettingsComponent()->GetSettings();
const std::string curMonitor = settings->GetString(CSettings::SETTING_VIDEOSCREEN_MONITOR);
@@ -690,12 +692,15 @@ RESOLUTION CDisplaySettings::GetResolutionForScreen()
return RES_DESKTOP;
}
-static inline bool ModeSort(StringSettingOption i,StringSettingOption j)
+static inline bool ModeSort(const StringSettingOption& i, const StringSettingOption& j)
{
return (i.value > j.value);
}
-void CDisplaySettings::SettingOptionsModesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CDisplaySettings::SettingOptionsModesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
RESOLUTION res = CDisplaySettings::GetInstance().GetDisplayResolution();
RESOLUTION_INFO info = CDisplaySettings::GetInstance().GetResolutionInfo(res);
@@ -717,7 +722,11 @@ void CDisplaySettings::SettingOptionsModesFiller(std::shared_ptr<const CSetting>
std::sort(list.begin(), list.end(), ModeSort);
}
-void CDisplaySettings::SettingOptionsRefreshChangeDelaysFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CDisplaySettings::SettingOptionsRefreshChangeDelaysFiller(
+ const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
list.emplace_back(g_localizeStrings.Get(13551), 0);
@@ -725,7 +734,10 @@ void CDisplaySettings::SettingOptionsRefreshChangeDelaysFiller(SettingConstPtr s
list.emplace_back(StringUtils::Format(g_localizeStrings.Get(13553).c_str(), static_cast<double>(i) / 10.0), i);
}
-void CDisplaySettings::SettingOptionsRefreshRatesFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CDisplaySettings::SettingOptionsRefreshRatesFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
// get the proper resolution
RESOLUTION res = CDisplaySettings::GetInstance().GetDisplayResolution();
@@ -757,7 +769,10 @@ void CDisplaySettings::SettingOptionsRefreshRatesFiller(SettingConstPtr setting,
current = GetStringFromResolution(res, CServiceBroker::GetWinSystem()->DefaultRefreshRate(refreshrates).RefreshRate);
}
-void CDisplaySettings::SettingOptionsResolutionsFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CDisplaySettings::SettingOptionsResolutionsFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
RESOLUTION res = CDisplaySettings::GetInstance().GetDisplayResolution();
RESOLUTION_INFO info = CDisplaySettings::GetInstance().GetResolutionInfo(res);
@@ -785,7 +800,10 @@ void CDisplaySettings::SettingOptionsResolutionsFiller(SettingConstPtr setting,
}
}
-void CDisplaySettings::SettingOptionsDispModeFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CDisplaySettings::SettingOptionsDispModeFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
// The user should only be able to disable windowed modes with the canwindowed
// setting. When the user sets canwindowed to true but the windowing system
@@ -797,7 +815,11 @@ void CDisplaySettings::SettingOptionsDispModeFiller(SettingConstPtr setting, std
list.emplace_back(g_localizeStrings.Get(244), DM_FULLSCREEN);
}
-void CDisplaySettings::SettingOptionsStereoscopicModesFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CDisplaySettings::SettingOptionsStereoscopicModesFiller(
+ const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
CGUIComponent *gui = CServiceBroker::GetGUI();
if (gui != nullptr)
@@ -813,7 +835,11 @@ void CDisplaySettings::SettingOptionsStereoscopicModesFiller(SettingConstPtr set
}
}
-void CDisplaySettings::SettingOptionsPreferredStereoscopicViewModesFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CDisplaySettings::SettingOptionsPreferredStereoscopicViewModesFiller(
+ const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
const CStereoscopicsManager &stereoscopicsManager = CServiceBroker::GetGUI()->GetStereoscopicsManager();
@@ -829,7 +855,10 @@ void CDisplaySettings::SettingOptionsPreferredStereoscopicViewModesFiller(Settin
}
}
-void CDisplaySettings::SettingOptionsMonitorsFiller(SettingConstPtr setting, std::vector<StringSettingOption> &list, std::string &current, void *data)
+void CDisplaySettings::SettingOptionsMonitorsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
#if defined(HAVE_X11) || defined(TARGET_DARWIN) || defined(HAVE_WAYLAND) || \
defined(TARGET_WINDOWS_DESKTOP)
@@ -877,7 +906,10 @@ void CDisplaySettings::ClearCustomResolutions()
}
}
-void CDisplaySettings::SettingOptionsCmsModesFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CDisplaySettings::SettingOptionsCmsModesFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
list.emplace_back(g_localizeStrings.Get(36580), CMS_MODE_3DLUT);
#ifdef HAVE_LCMS2
@@ -885,13 +917,19 @@ void CDisplaySettings::SettingOptionsCmsModesFiller(SettingConstPtr setting, std
#endif
}
-void CDisplaySettings::SettingOptionsCmsWhitepointsFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CDisplaySettings::SettingOptionsCmsWhitepointsFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
list.emplace_back(g_localizeStrings.Get(36586), CMS_WHITEPOINT_D65);
list.emplace_back(g_localizeStrings.Get(36587), CMS_WHITEPOINT_D93);
}
-void CDisplaySettings::SettingOptionsCmsPrimariesFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CDisplaySettings::SettingOptionsCmsPrimariesFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
list.emplace_back(g_localizeStrings.Get(36588), CMS_PRIMARIES_AUTO);
list.emplace_back(g_localizeStrings.Get(36589), CMS_PRIMARIES_BT709);
@@ -902,7 +940,10 @@ void CDisplaySettings::SettingOptionsCmsPrimariesFiller(SettingConstPtr setting,
list.emplace_back(g_localizeStrings.Get(36593), CMS_PRIMARIES_240M);
}
-void CDisplaySettings::SettingOptionsCmsGammaModesFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CDisplaySettings::SettingOptionsCmsGammaModesFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
list.emplace_back(g_localizeStrings.Get(36582), CMS_TRC_BT1886);
list.emplace_back(g_localizeStrings.Get(36583), CMS_TRC_INPUT_OFFSET);
diff --git a/xbmc/settings/DisplaySettings.h b/xbmc/settings/DisplaySettings.h
index 6ed0e9ee3b..85b349059e 100644
--- a/xbmc/settings/DisplaySettings.h
+++ b/xbmc/settings/DisplaySettings.h
@@ -33,9 +33,11 @@ public:
bool Save(TiXmlNode *settings) const override;
void Clear() override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
- bool OnSettingChanging(std::shared_ptr<const CSetting> setting) override;
- bool OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
+ bool OnSettingChanging(const std::shared_ptr<const CSetting>& setting) override;
+ bool OnSettingUpdate(const std::shared_ptr<CSetting>& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode) override;
/*!
\brief Returns the currently active resolution
@@ -84,20 +86,58 @@ public:
void SetVerticalShift(float verticalShift) { m_verticalShift = verticalShift; }
bool IsNonLinearStretched() const { return m_nonLinearStretched; }
void SetNonLinearStretched(bool nonLinearStretch) { m_nonLinearStretched = nonLinearStretch; }
- void SetMonitor(std::string monitor);
-
- static void SettingOptionsModesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsRefreshChangeDelaysFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
- static void SettingOptionsRefreshRatesFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsResolutionsFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
- static void SettingOptionsDispModeFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
- static void SettingOptionsStereoscopicModesFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
- static void SettingOptionsPreferredStereoscopicViewModesFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
- static void SettingOptionsMonitorsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption> &list, std::string &current, void *data);
- static void SettingOptionsCmsModesFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
- static void SettingOptionsCmsWhitepointsFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
- static void SettingOptionsCmsPrimariesFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
- static void SettingOptionsCmsGammaModesFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
+ void SetMonitor(const std::string& monitor);
+
+ static void SettingOptionsModesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsRefreshChangeDelaysFiller(
+ const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void SettingOptionsRefreshRatesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsResolutionsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void SettingOptionsDispModeFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void SettingOptionsStereoscopicModesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void SettingOptionsPreferredStereoscopicViewModesFiller(
+ const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void SettingOptionsMonitorsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+ static void SettingOptionsCmsModesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void SettingOptionsCmsWhitepointsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void SettingOptionsCmsPrimariesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+ static void SettingOptionsCmsGammaModesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
protected:
diff --git a/xbmc/settings/MediaSettings.cpp b/xbmc/settings/MediaSettings.cpp
index d842376a8f..27c5ac7bea 100644
--- a/xbmc/settings/MediaSettings.cpp
+++ b/xbmc/settings/MediaSettings.cpp
@@ -284,7 +284,7 @@ bool CMediaSettings::Save(TiXmlNode *settings) const
return true;
}
-void CMediaSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CMediaSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -343,7 +343,7 @@ void CMediaSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
}
}
-void CMediaSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CMediaSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return;
diff --git a/xbmc/settings/MediaSettings.h b/xbmc/settings/MediaSettings.h
index 4f6dab4c3e..a00b2cf287 100644
--- a/xbmc/settings/MediaSettings.h
+++ b/xbmc/settings/MediaSettings.h
@@ -38,8 +38,8 @@ public:
bool Load(const TiXmlNode *settings) override;
bool Save(TiXmlNode *settings) const override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
void OnSettingsLoaded() override;
const CVideoSettings& GetDefaultVideoSettings() const { return m_defaultVideoSettings; }
diff --git a/xbmc/settings/SettingConditions.cpp b/xbmc/settings/SettingConditions.cpp
index ebf3318107..f4c8f7dbeb 100644
--- a/xbmc/settings/SettingConditions.cpp
+++ b/xbmc/settings/SettingConditions.cpp
@@ -28,7 +28,10 @@
#include "utils/StringUtils.h"
#include "windowing/WinSystem.h"
-bool AddonHasSettings(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool AddonHasSettings(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
if (setting == NULL)
return false;
@@ -47,107 +50,170 @@ bool AddonHasSettings(const std::string &condition, const std::string &value, Se
return addon->HasSettings();
}
-bool CheckMasterLock(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool CheckMasterLock(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return g_passwordManager.IsMasterLockUnlocked(StringUtils::EqualsNoCase(value, "true"));
}
-bool HasPeripherals(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool HasPeripherals(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CServiceBroker::GetPeripherals().GetNumberOfPeripherals() > 0;
}
-bool HasPeripheralLibraries(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool HasPeripheralLibraries(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CServiceBroker::GetAddonMgr().HasInstalledAddons(ADDON::ADDON_PERIPHERALDLL);
}
-bool HasRumbleFeature(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool HasRumbleFeature(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CServiceBroker::GetPeripherals().SupportsFeature(PERIPHERALS::FEATURE_RUMBLE);
}
-bool HasRumbleController(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool HasRumbleController(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CServiceBroker::GetPeripherals().HasPeripheralWithFeature(PERIPHERALS::FEATURE_RUMBLE);
}
-bool HasPowerOffFeature(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool HasPowerOffFeature(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CServiceBroker::GetPeripherals().SupportsFeature(PERIPHERALS::FEATURE_POWER_OFF);
}
-bool IsFullscreen(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool IsFullscreen(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CServiceBroker::GetWinSystem()->IsFullScreen();
}
-bool IsHDRDisplay(const std::string& condition, const std::string& value, SettingConstPtr setting, void* data)
+bool IsHDRDisplay(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CServiceBroker::GetWinSystem()->IsHDRDisplay();
}
-bool IsMasterUser(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool IsMasterUser(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return g_passwordManager.bMasterUser;
}
-bool IsUsingTTFSubtitles(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool IsUsingTTFSubtitles(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CUtil::IsUsingTTFSubtitles();
}
-bool ProfileCanWriteDatabase(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileCanWriteDatabase(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CSettingConditions::GetCurrentProfile().canWriteDatabases();
}
-bool ProfileCanWriteSources(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileCanWriteSources(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CSettingConditions::GetCurrentProfile().canWriteSources();
}
-bool ProfileHasAddons(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileHasAddons(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CSettingConditions::GetCurrentProfile().hasAddons();
}
-bool ProfileHasDatabase(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileHasDatabase(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CSettingConditions::GetCurrentProfile().hasDatabases();
}
-bool ProfileHasSources(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileHasSources(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CSettingConditions::GetCurrentProfile().hasSources();
}
-bool ProfileHasAddonManagerLocked(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileHasAddonManagerLocked(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CSettingConditions::GetCurrentProfile().addonmanagerLocked();
}
-bool ProfileHasFilesLocked(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileHasFilesLocked(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CSettingConditions::GetCurrentProfile().filesLocked();
}
-bool ProfileHasMusicLocked(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileHasMusicLocked(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CSettingConditions::GetCurrentProfile().musicLocked();
}
-bool ProfileHasPicturesLocked(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileHasPicturesLocked(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CSettingConditions::GetCurrentProfile().picturesLocked();
}
-bool ProfileHasProgramsLocked(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileHasProgramsLocked(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CSettingConditions::GetCurrentProfile().programsLocked();
}
-bool ProfileHasSettingsLocked(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileHasSettingsLocked(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
LOCK_LEVEL::SETTINGS_LOCK slValue=LOCK_LEVEL::ALL;
if (StringUtils::EqualsNoCase(value, "none"))
@@ -161,12 +227,18 @@ bool ProfileHasSettingsLocked(const std::string &condition, const std::string &v
return slValue <= CSettingConditions::GetCurrentProfile().settingsLockLevel();
}
-bool ProfileHasVideosLocked(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileHasVideosLocked(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return CSettingConditions::GetCurrentProfile().videoLocked();
}
-bool ProfileLockMode(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool ProfileLockMode(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
char *tmp = NULL;
LockType lock = (LockType)strtol(value.c_str(), &tmp, 0);
@@ -176,7 +248,10 @@ bool ProfileLockMode(const std::string &condition, const std::string &value, Set
return CSettingConditions::GetCurrentProfile().getLockMode() == lock;
}
-bool GreaterThan(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool GreaterThan(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
if (setting == NULL)
return false;
@@ -193,7 +268,10 @@ bool GreaterThan(const std::string &condition, const std::string &value, Setting
return lhs > rhs;
}
-bool GreaterThanOrEqual(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool GreaterThanOrEqual(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
if (setting == NULL)
return false;
@@ -210,7 +288,10 @@ bool GreaterThanOrEqual(const std::string &condition, const std::string &value,
return lhs >= rhs;
}
-bool LessThan(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool LessThan(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
if (setting == NULL)
return false;
@@ -227,7 +308,10 @@ bool LessThan(const std::string &condition, const std::string &value, SettingCon
return lhs < rhs;
}
-bool LessThanOrEqual(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool LessThanOrEqual(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
if (setting == NULL)
return false;
@@ -380,7 +464,9 @@ const CProfile& CSettingConditions::GetCurrentProfile()
return emptyProfile;
}
-bool CSettingConditions::Check(const std::string &condition, const std::string &value /* = "" */, SettingConstPtr setting /* = NULL */)
+bool CSettingConditions::Check(const std::string& condition,
+ const std::string& value /* = "" */,
+ const SettingConstPtr& setting /* = NULL */)
{
if (m_simpleConditions.find(condition) != m_simpleConditions.end())
return true;
diff --git a/xbmc/settings/SettingConditions.h b/xbmc/settings/SettingConditions.h
index 7eb3bc4fcc..f51d9e0eaf 100644
--- a/xbmc/settings/SettingConditions.h
+++ b/xbmc/settings/SettingConditions.h
@@ -27,7 +27,9 @@ public:
static const std::set<std::string>& GetSimpleConditions() { return m_simpleConditions; }
static const std::map<std::string, SettingConditionCheck>& GetComplexConditions() { return m_complexConditions; }
- static bool Check(const std::string &condition, const std::string &value = "", std::shared_ptr<const CSetting> setting = NULL);
+ static bool Check(const std::string& condition,
+ const std::string& value = "",
+ const std::shared_ptr<const CSetting>& setting = NULL);
private:
// Initialization parameters
diff --git a/xbmc/settings/SettingControl.h b/xbmc/settings/SettingControl.h
index 751bb49673..73dd98d494 100644
--- a/xbmc/settings/SettingControl.h
+++ b/xbmc/settings/SettingControl.h
@@ -168,7 +168,8 @@ protected:
};
class CSetting;
-using SettingControlListValueFormatter = std::string (*)(std::shared_ptr<const CSetting> setting);
+using SettingControlListValueFormatter =
+ std::string (*)(const std::shared_ptr<const CSetting>& setting);
class CSettingControlList : public CSettingControlFormattedRange
{
@@ -204,7 +205,12 @@ protected:
};
class CSettingControlSlider;
-using SettingControlSliderFormatter = std::string (*)(std::shared_ptr<const CSettingControlSlider> control, const CVariant &value, const CVariant &minimum, const CVariant &step, const CVariant &maximum);
+using SettingControlSliderFormatter =
+ std::string (*)(const std::shared_ptr<const CSettingControlSlider>& control,
+ const CVariant& value,
+ const CVariant& minimum,
+ const CVariant& step,
+ const CVariant& maximum);
class CSettingControlSlider : public ISettingControl
{
diff --git a/xbmc/settings/SettingUtils.cpp b/xbmc/settings/SettingUtils.cpp
index 2aebb1c385..a98005fa93 100644
--- a/xbmc/settings/SettingUtils.cpp
+++ b/xbmc/settings/SettingUtils.cpp
@@ -14,12 +14,13 @@
#include <algorithm>
-std::vector<CVariant> CSettingUtils::GetList(std::shared_ptr<const CSettingList> settingList)
+std::vector<CVariant> CSettingUtils::GetList(const std::shared_ptr<const CSettingList>& settingList)
{
return ListToValues(settingList, settingList->GetValue());
}
-bool CSettingUtils::SetList(std::shared_ptr<CSettingList> settingList, const std::vector<CVariant> &value)
+bool CSettingUtils::SetList(const std::shared_ptr<CSettingList>& settingList,
+ const std::vector<CVariant>& value)
{
SettingList newValues;
if (!ValuesToList(settingList, value, newValues))
@@ -28,7 +29,9 @@ bool CSettingUtils::SetList(std::shared_ptr<CSettingList> settingList, const std
return settingList->SetValue(newValues);
}
-std::vector<CVariant> CSettingUtils::ListToValues(std::shared_ptr<const CSettingList> setting, const std::vector< std::shared_ptr<CSetting> > &values)
+std::vector<CVariant> CSettingUtils::ListToValues(
+ const std::shared_ptr<const CSettingList>& setting,
+ const std::vector<std::shared_ptr<CSetting>>& values)
{
std::vector<CVariant> realValues;
@@ -63,8 +66,9 @@ std::vector<CVariant> CSettingUtils::ListToValues(std::shared_ptr<const CSetting
return realValues;
}
-bool CSettingUtils::ValuesToList(std::shared_ptr<const CSettingList> setting, const std::vector<CVariant> &values,
- std::vector< std::shared_ptr<CSetting> > &newValues)
+bool CSettingUtils::ValuesToList(const std::shared_ptr<const CSettingList>& setting,
+ const std::vector<CVariant>& values,
+ std::vector<std::shared_ptr<CSetting>>& newValues)
{
if (setting == NULL)
return false;
@@ -121,7 +125,7 @@ bool CSettingUtils::ValuesToList(std::shared_ptr<const CSettingList> setting, co
return true;
}
-bool CSettingUtils::FindIntInList(std::shared_ptr<const CSettingList> settingList, int value)
+bool CSettingUtils::FindIntInList(const std::shared_ptr<const CSettingList>& settingList, int value)
{
if (settingList == nullptr || settingList->GetElementType() != SettingType::Integer)
return false;
diff --git a/xbmc/settings/SettingUtils.h b/xbmc/settings/SettingUtils.h
index 2bc731349b..d7e456bb1f 100644
--- a/xbmc/settings/SettingUtils.h
+++ b/xbmc/settings/SettingUtils.h
@@ -24,7 +24,7 @@ public:
\param settingList List setting
\return List of values of the given list setting
*/
- static std::vector<CVariant> GetList(std::shared_ptr<const CSettingList> settingList);
+ static std::vector<CVariant> GetList(const std::shared_ptr<const CSettingList>& settingList);
/*!
\brief Sets the values of the given list setting.
@@ -32,10 +32,14 @@ public:
\param value Values to set
\return True if setting the values was successful, false otherwise
*/
- static bool SetList(std::shared_ptr<CSettingList> settingList, const std::vector<CVariant> &value);
+ static bool SetList(const std::shared_ptr<CSettingList>& settingList,
+ const std::vector<CVariant>& value);
- static std::vector<CVariant> ListToValues(std::shared_ptr<const CSettingList> setting, const std::vector< std::shared_ptr<CSetting> > &values);
- static bool ValuesToList(std::shared_ptr<const CSettingList> setting, const std::vector<CVariant> &values, std::vector< std::shared_ptr<CSetting> > &newValues);
+ static std::vector<CVariant> ListToValues(const std::shared_ptr<const CSettingList>& setting,
+ const std::vector<std::shared_ptr<CSetting>>& values);
+ static bool ValuesToList(const std::shared_ptr<const CSettingList>& setting,
+ const std::vector<CVariant>& values,
+ std::vector<std::shared_ptr<CSetting>>& newValues);
/*!
\brief Search in a list of Ints for a given value.
@@ -44,5 +48,5 @@ public:
\param value value to search for
\return True if value was found in list, false otherwise
*/
- static bool FindIntInList(std::shared_ptr<const CSettingList> settingList, int value);
+ static bool FindIntInList(const std::shared_ptr<const CSettingList>& settingList, int value);
};
diff --git a/xbmc/settings/SettingsValueFlatJsonSerializer.cpp b/xbmc/settings/SettingsValueFlatJsonSerializer.cpp
index 13c382fd0c..736c37d746 100644
--- a/xbmc/settings/SettingsValueFlatJsonSerializer.cpp
+++ b/xbmc/settings/SettingsValueFlatJsonSerializer.cpp
@@ -44,7 +44,7 @@ std::string CSettingsValueFlatJsonSerializer::SerializeValues(
}
void CSettingsValueFlatJsonSerializer::SerializeSection(
- CVariant& parent, std::shared_ptr<CSettingSection> section) const
+ CVariant& parent, const std::shared_ptr<CSettingSection>& section) const
{
if (section == nullptr)
return;
@@ -55,7 +55,7 @@ void CSettingsValueFlatJsonSerializer::SerializeSection(
}
void CSettingsValueFlatJsonSerializer::SerializeCategory(
- CVariant& parent, std::shared_ptr<CSettingCategory> category) const
+ CVariant& parent, const std::shared_ptr<CSettingCategory>& category) const
{
if (category == nullptr)
return;
@@ -66,7 +66,7 @@ void CSettingsValueFlatJsonSerializer::SerializeCategory(
}
void CSettingsValueFlatJsonSerializer::SerializeGroup(
- CVariant& parent, std::shared_ptr<CSettingGroup> group) const
+ CVariant& parent, const std::shared_ptr<CSettingGroup>& group) const
{
if (group == nullptr)
return;
@@ -77,7 +77,7 @@ void CSettingsValueFlatJsonSerializer::SerializeGroup(
}
void CSettingsValueFlatJsonSerializer::SerializeSetting(
- CVariant& parent, std::shared_ptr<CSetting> setting) const
+ CVariant& parent, const std::shared_ptr<CSetting>& setting) const
{
if (setting == nullptr)
return;
@@ -94,7 +94,7 @@ void CSettingsValueFlatJsonSerializer::SerializeSetting(
}
CVariant CSettingsValueFlatJsonSerializer::SerializeSettingValue(
- std::shared_ptr<CSetting> setting) const
+ const std::shared_ptr<CSetting>& setting) const
{
switch (setting->GetType())
{
diff --git a/xbmc/settings/SettingsValueFlatJsonSerializer.h b/xbmc/settings/SettingsValueFlatJsonSerializer.h
index 5708224b06..05214ab887 100644
--- a/xbmc/settings/SettingsValueFlatJsonSerializer.h
+++ b/xbmc/settings/SettingsValueFlatJsonSerializer.h
@@ -30,11 +30,11 @@ public:
std::string SerializeValues(const CSettingsManager* settingsManager) const override;
private:
- void SerializeSection(CVariant& parent, std::shared_ptr<CSettingSection> section) const;
- void SerializeCategory(CVariant& parent, std::shared_ptr<CSettingCategory> category) const;
- void SerializeGroup(CVariant& parent, std::shared_ptr<CSettingGroup> group) const;
- void SerializeSetting(CVariant& parent, std::shared_ptr<CSetting> setting) const;
- CVariant SerializeSettingValue(std::shared_ptr<CSetting> setting) const;
+ void SerializeSection(CVariant& parent, const std::shared_ptr<CSettingSection>& section) const;
+ void SerializeCategory(CVariant& parent, const std::shared_ptr<CSettingCategory>& category) const;
+ void SerializeGroup(CVariant& parent, const std::shared_ptr<CSettingGroup>& group) const;
+ void SerializeSetting(CVariant& parent, const std::shared_ptr<CSetting>& setting) const;
+ CVariant SerializeSettingValue(const std::shared_ptr<CSetting>& setting) const;
bool m_compact;
};
diff --git a/xbmc/settings/SettingsValueXmlSerializer.cpp b/xbmc/settings/SettingsValueXmlSerializer.cpp
index cd224bfe34..42f83e31b8 100644
--- a/xbmc/settings/SettingsValueXmlSerializer.cpp
+++ b/xbmc/settings/SettingsValueXmlSerializer.cpp
@@ -41,7 +41,7 @@ std::string CSettingsValueXmlSerializer::SerializeValues(
}
void CSettingsValueXmlSerializer::SerializeSection(
- TiXmlNode* parent, std::shared_ptr<CSettingSection> section) const
+ TiXmlNode* parent, const std::shared_ptr<CSettingSection>& section) const
{
if (section == nullptr)
return;
@@ -52,7 +52,7 @@ void CSettingsValueXmlSerializer::SerializeSection(
}
void CSettingsValueXmlSerializer::SerializeCategory(
- TiXmlNode* parent, std::shared_ptr<CSettingCategory> category) const
+ TiXmlNode* parent, const std::shared_ptr<CSettingCategory>& category) const
{
if (category == nullptr)
return;
@@ -62,8 +62,8 @@ void CSettingsValueXmlSerializer::SerializeCategory(
SerializeGroup(parent, group);
}
-void CSettingsValueXmlSerializer::SerializeGroup(
- TiXmlNode* parent, std::shared_ptr<CSettingGroup> group) const
+void CSettingsValueXmlSerializer::SerializeGroup(TiXmlNode* parent,
+ const std::shared_ptr<CSettingGroup>& group) const
{
if (group == nullptr)
return;
@@ -73,8 +73,8 @@ void CSettingsValueXmlSerializer::SerializeGroup(
SerializeSetting(parent, setting);
}
-void CSettingsValueXmlSerializer::SerializeSetting(
- TiXmlNode* parent, std::shared_ptr<CSetting> setting) const
+void CSettingsValueXmlSerializer::SerializeSetting(TiXmlNode* parent,
+ const std::shared_ptr<CSetting>& setting) const
{
if (setting == nullptr)
return;
diff --git a/xbmc/settings/SettingsValueXmlSerializer.h b/xbmc/settings/SettingsValueXmlSerializer.h
index 7ab8687c5f..010c036775 100644
--- a/xbmc/settings/SettingsValueXmlSerializer.h
+++ b/xbmc/settings/SettingsValueXmlSerializer.h
@@ -28,8 +28,9 @@ public:
std::string SerializeValues(const CSettingsManager* settingsManager) const override;
private:
- void SerializeSection(TiXmlNode* parent, std::shared_ptr<CSettingSection> section) const;
- void SerializeCategory(TiXmlNode* parent, std::shared_ptr<CSettingCategory> category) const;
- void SerializeGroup(TiXmlNode* parent, std::shared_ptr<CSettingGroup> group) const;
- void SerializeSetting(TiXmlNode* parent, std::shared_ptr<CSetting> setting) const;
+ void SerializeSection(TiXmlNode* parent, const std::shared_ptr<CSettingSection>& section) const;
+ void SerializeCategory(TiXmlNode* parent,
+ const std::shared_ptr<CSettingCategory>& category) const;
+ void SerializeGroup(TiXmlNode* parent, const std::shared_ptr<CSettingGroup>& group) const;
+ void SerializeSetting(TiXmlNode* parent, const std::shared_ptr<CSetting>& setting) const;
};
diff --git a/xbmc/settings/dialogs/GUIDialogContentSettings.cpp b/xbmc/settings/dialogs/GUIDialogContentSettings.cpp
index 3bb2846f02..7897754874 100644
--- a/xbmc/settings/dialogs/GUIDialogContentSettings.cpp
+++ b/xbmc/settings/dialogs/GUIDialogContentSettings.cpp
@@ -149,7 +149,7 @@ void CGUIDialogContentSettings::OnInitWindow()
CGUIDialogSettingsManualBase::OnInitWindow();
}
-void CGUIDialogContentSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogContentSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -174,7 +174,7 @@ void CGUIDialogContentSettings::OnSettingChanged(std::shared_ptr<const CSetting>
m_allExternalAudio = std::static_pointer_cast<const CSettingBool>(setting)->GetValue();
}
-void CGUIDialogContentSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CGUIDialogContentSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
diff --git a/xbmc/settings/dialogs/GUIDialogContentSettings.h b/xbmc/settings/dialogs/GUIDialogContentSettings.h
index 97f7dbe30b..1c4401c70f 100644
--- a/xbmc/settings/dialogs/GUIDialogContentSettings.h
+++ b/xbmc/settings/dialogs/GUIDialogContentSettings.h
@@ -12,6 +12,7 @@
#include "settings/dialogs/GUIDialogSettingsManualBase.h"
#include <map>
+#include <utility>
namespace VIDEO
{
@@ -32,7 +33,7 @@ public:
void ResetContent();
const ADDON::ScraperPtr& GetScraper() const { return m_scraper; }
- void SetScraper(ADDON::ScraperPtr scraper) { m_scraper = scraper; }
+ void SetScraper(ADDON::ScraperPtr scraper) { m_scraper = std::move(scraper); }
void SetScanSettings(const VIDEO::SScanSettings &scanSettings);
bool GetScanRecursive() const { return m_scanRecursive; }
@@ -50,8 +51,8 @@ protected:
void OnInitWindow() override;
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
diff --git a/xbmc/settings/dialogs/GUIDialogLibExportSettings.cpp b/xbmc/settings/dialogs/GUIDialogLibExportSettings.cpp
index cce70b1744..432413a077 100644
--- a/xbmc/settings/dialogs/GUIDialogLibExportSettings.cpp
+++ b/xbmc/settings/dialogs/GUIDialogLibExportSettings.cpp
@@ -79,7 +79,7 @@ void CGUIDialogLibExportSettings::OnInitWindow()
CGUIDialogSettingsManualBase::OnInitWindow();
}
-void CGUIDialogLibExportSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogLibExportSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (!setting)
return;
@@ -136,7 +136,7 @@ void CGUIDialogLibExportSettings::OnSettingChanged(std::shared_ptr<const CSettin
}
}
-void CGUIDialogLibExportSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CGUIDialogLibExportSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -427,7 +427,7 @@ void CGUIDialogLibExportSettings::SetFocus(const std::string &settingid)
SET_CONTROL_FOCUS(settingControl->GetID(), 0);
}
-int CGUIDialogLibExportSettings::GetExportItemsFromSetting(SettingConstPtr setting)
+int CGUIDialogLibExportSettings::GetExportItemsFromSetting(const SettingConstPtr& setting)
{
std::shared_ptr<const CSettingList> settingList = std::static_pointer_cast<const CSettingList>(setting);
if (settingList->GetElementType() != SettingType::Integer)
diff --git a/xbmc/settings/dialogs/GUIDialogLibExportSettings.h b/xbmc/settings/dialogs/GUIDialogLibExportSettings.h
index 666476311e..f948057af3 100644
--- a/xbmc/settings/dialogs/GUIDialogLibExportSettings.h
+++ b/xbmc/settings/dialogs/GUIDialogLibExportSettings.h
@@ -27,8 +27,8 @@ protected:
void OnInitWindow() override;
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool OnMessage(CGUIMessage& message) override;
@@ -49,7 +49,7 @@ private:
using CGUIDialogSettingsManualBase::SetFocus;
void SetFocus(const std::string &settingid);
- static int GetExportItemsFromSetting(SettingConstPtr setting);
+ static int GetExportItemsFromSetting(const SettingConstPtr& setting);
void UpdateToggles();
void UpdateDescription();
diff --git a/xbmc/settings/dialogs/GUIDialogSettingsBase.cpp b/xbmc/settings/dialogs/GUIDialogSettingsBase.cpp
index ecd060a859..a0a523c888 100644
--- a/xbmc/settings/dialogs/GUIDialogSettingsBase.cpp
+++ b/xbmc/settings/dialogs/GUIDialogSettingsBase.cpp
@@ -495,7 +495,7 @@ void CGUIDialogSettingsBase::OnTimeout()
UpdateSettingControl(m_delayedSetting, true);
}
-void CGUIDialogSettingsBase::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogSettingsBase::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL || setting->GetType() == SettingType::Unknown ||
setting->GetType() == SettingType::Action)
@@ -504,8 +504,8 @@ void CGUIDialogSettingsBase::OnSettingChanged(std::shared_ptr<const CSetting> se
UpdateSettingControl(setting->GetId(), true);
}
-void CGUIDialogSettingsBase::OnSettingPropertyChanged(std::shared_ptr<const CSetting> setting,
- const char* propertyName)
+void CGUIDialogSettingsBase::OnSettingPropertyChanged(
+ const std::shared_ptr<const CSetting>& setting, const char* propertyName)
{
if (setting == NULL || propertyName == NULL)
return;
@@ -606,7 +606,7 @@ std::set<std::string> CGUIDialogSettingsBase::CreateSettings()
return settingMap;
}
-std::string CGUIDialogSettingsBase::GetSettingsLabel(std::shared_ptr<ISetting> pSetting)
+std::string CGUIDialogSettingsBase::GetSettingsLabel(const std::shared_ptr<ISetting>& pSetting)
{
return GetLocalizedString(pSetting->GetLabel());
}
@@ -626,7 +626,7 @@ void CGUIDialogSettingsBase::UpdateSettings()
}
}
-CGUIControl* CGUIDialogSettingsBase::AddSetting(std::shared_ptr<CSetting> pSetting,
+CGUIControl* CGUIDialogSettingsBase::AddSetting(const std::shared_ptr<CSetting>& pSetting,
float width,
int& iControlID)
{
@@ -777,7 +777,7 @@ CGUIControl* CGUIDialogSettingsBase::AddSeparator(float width, int& iControlID)
width, iControlID);
}
-CGUIControl* CGUIDialogSettingsBase::AddGroupLabel(std::shared_ptr<CSettingGroup> group,
+CGUIControl* CGUIDialogSettingsBase::AddGroupLabel(const std::shared_ptr<CSettingGroup>& group,
float width,
int& iControlID)
{
@@ -846,7 +846,7 @@ void CGUIDialogSettingsBase::OnResetSettings()
}
}
-void CGUIDialogSettingsBase::OnClick(BaseSettingControlPtr pSettingControl)
+void CGUIDialogSettingsBase::OnClick(const BaseSettingControlPtr& pSettingControl)
{
if (AllowResettingSettings() &&
pSettingControl->GetSetting()->GetId() == SETTINGS_RESET_SETTING_ID)
@@ -892,7 +892,7 @@ void CGUIDialogSettingsBase::UpdateSettingControl(const std::string& settingId,
return UpdateSettingControl(GetSettingControl(settingId), updateDisplayOnly);
}
-void CGUIDialogSettingsBase::UpdateSettingControl(BaseSettingControlPtr pSettingControl,
+void CGUIDialogSettingsBase::UpdateSettingControl(const BaseSettingControlPtr& pSettingControl,
bool updateDisplayOnly /* = false */)
{
if (pSettingControl == NULL)
diff --git a/xbmc/settings/dialogs/GUIDialogSettingsBase.h b/xbmc/settings/dialogs/GUIDialogSettingsBase.h
index 56a92282d9..940091f10f 100644
--- a/xbmc/settings/dialogs/GUIDialogSettingsBase.h
+++ b/xbmc/settings/dialogs/GUIDialogSettingsBase.h
@@ -83,8 +83,8 @@ protected:
void OnTimeout() override;
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingPropertyChanged(std::shared_ptr<const CSetting> setting,
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingPropertyChanged(const std::shared_ptr<const CSetting>& setting,
const char* propertyName) override;
// new virtual methods
@@ -112,9 +112,11 @@ protected:
\param pSetting Base settings class which need the name
\return Name used on settings dialog
*/
- virtual std::string GetSettingsLabel(std::shared_ptr<ISetting> pSetting);
+ virtual std::string GetSettingsLabel(const std::shared_ptr<ISetting>& pSetting);
- virtual CGUIControl* AddSetting(std::shared_ptr<CSetting> pSetting, float width, int& iControlID);
+ virtual CGUIControl* AddSetting(const std::shared_ptr<CSetting>& pSetting,
+ float width,
+ int& iControlID);
virtual CGUIControl* AddSettingControl(CGUIControl* pControl,
BaseSettingControlPtr pSettingControl,
float width,
@@ -141,17 +143,20 @@ protected:
\param pSettingControl Setting control that has been interacted with
*/
- virtual void OnClick(BaseSettingControlPtr pSettingControl);
+ virtual void OnClick(const BaseSettingControlPtr& pSettingControl);
void UpdateSettingControl(const std::string& settingId, bool updateDisplayOnly = false);
- void UpdateSettingControl(BaseSettingControlPtr pSettingControl, bool updateDisplayOnly = false);
+ void UpdateSettingControl(const BaseSettingControlPtr& pSettingControl,
+ bool updateDisplayOnly = false);
void SetControlLabel(int controlId, const CVariant& label);
BaseSettingControlPtr GetSettingControl(const std::string& setting);
BaseSettingControlPtr GetSettingControl(int controlId);
CGUIControl* AddSeparator(float width, int& iControlID);
- CGUIControl* AddGroupLabel(std::shared_ptr<CSettingGroup> group, float width, int& iControlID);
+ CGUIControl* AddGroupLabel(const std::shared_ptr<CSettingGroup>& group,
+ float width,
+ int& iControlID);
std::vector<std::shared_ptr<CSettingCategory>> m_categories;
std::vector<BaseSettingControlPtr> m_settingControls;
diff --git a/xbmc/settings/dialogs/GUIDialogSettingsManualBase.cpp b/xbmc/settings/dialogs/GUIDialogSettingsManualBase.cpp
index 0ee7f4a362..35d6379e9d 100644
--- a/xbmc/settings/dialogs/GUIDialogSettingsManualBase.cpp
+++ b/xbmc/settings/dialogs/GUIDialogSettingsManualBase.cpp
@@ -88,7 +88,11 @@ SettingCategoryPtr CGUIDialogSettingsManualBase::AddCategory(const std::string &
return category;
}
-SettingGroupPtr CGUIDialogSettingsManualBase::AddGroup(SettingCategoryPtr category, int label /* = -1 */, int help /* = -1 */, bool separatorBelowLabel /* = true */, bool hideSeparator /* = false */)
+SettingGroupPtr CGUIDialogSettingsManualBase::AddGroup(const SettingCategoryPtr& category,
+ int label /* = -1 */,
+ int help /* = -1 */,
+ bool separatorBelowLabel /* = true */,
+ bool hideSeparator /* = false */)
{
if (category == NULL)
return NULL;
@@ -109,8 +113,14 @@ SettingGroupPtr CGUIDialogSettingsManualBase::AddGroup(SettingCategoryPtr catego
return group;
}
-std::shared_ptr<CSettingBool> CGUIDialogSettingsManualBase::AddToggle(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, bool value,
- bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingBool> CGUIDialogSettingsManualBase::AddToggle(const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ bool value,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -127,9 +137,20 @@ std::shared_ptr<CSettingBool> CGUIDialogSettingsManualBase::AddToggle(SettingGro
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddEdit(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value,
- int minimum /* = 0 */, int step /* = 1 */, int maximum /* = 0 */, bool verifyNewValue /* = false */,
- int heading /* = -1 */, bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddEdit(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ int minimum /* = 0 */,
+ int step /* = 1 */,
+ int maximum /* = 0 */,
+ bool verifyNewValue /* = false */,
+ int heading /* = -1 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -146,10 +167,20 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddEdit(SettingGroupP
return setting;
}
-std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddEdit(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, float value,
- float minimum /* = 0.0f */, float step /* = 1.0f */, float maximum /* = 0.0f */,
- bool verifyNewValue /* = false */, int heading /* = -1 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddEdit(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float value,
+ float minimum /* = 0.0f */,
+ float step /* = 1.0f */,
+ float maximum /* = 0.0f */,
+ bool verifyNewValue /* = false */,
+ int heading /* = -1 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -166,9 +197,17 @@ std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddEdit(SettingGro
return setting;
}
-std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddEdit(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::string value,
- bool allowEmpty /* = false */, bool hidden /* = false */,
- int heading /* = -1 */, bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddEdit(const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ bool allowEmpty /* = false */,
+ bool hidden /* = false */,
+ int heading /* = -1 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -186,9 +225,16 @@ std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddEdit(SettingGro
return setting;
}
-std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddIp(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::string value,
- bool allowEmpty /* = false */, int heading /* = -1 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddIp(const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ bool allowEmpty /* = false */,
+ int heading /* = -1 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -206,9 +252,17 @@ std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddIp(SettingGroup
return setting;
}
-std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddPasswordMd5(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::string value,
- bool allowEmpty /* = false */, int heading /* = -1 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddPasswordMd5(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ bool allowEmpty /* = false */,
+ int heading /* = -1 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -226,8 +280,15 @@ std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddPasswordMd5(Set
return setting;
}
-std::shared_ptr<CSettingAction> CGUIDialogSettingsManualBase::AddButton(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, const std::string& data /* = "" */,
- bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingAction> CGUIDialogSettingsManualBase::AddButton(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& data /* = "" */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -245,8 +306,14 @@ std::shared_ptr<CSettingAction> CGUIDialogSettingsManualBase::AddButton(SettingG
return setting;
}
-std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddInfoLabelButton(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::string info,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddInfoLabelButton(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& info,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -263,10 +330,22 @@ std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddInfoLabelButton
return setting;
}
-std::shared_ptr<CSettingAddon> CGUIDialogSettingsManualBase::AddAddon(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::string value, ADDON::TYPE addonType,
- bool allowEmpty /* = false */, int heading /* = -1 */, bool hideValue /* = false */, bool showInstalledAddons /* = true */,
- bool showInstallableAddons /* = false */, bool showMoreAddons /* = true */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingAddon> CGUIDialogSettingsManualBase::AddAddon(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ ADDON::TYPE addonType,
+ bool allowEmpty /* = false */,
+ int heading /* = -1 */,
+ bool hideValue /* = false */,
+ bool showInstalledAddons /* = true */,
+ bool showInstallableAddons /* = false */,
+ bool showMoreAddons /* = true */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -285,10 +364,20 @@ std::shared_ptr<CSettingAddon> CGUIDialogSettingsManualBase::AddAddon(SettingGro
return setting;
}
-std::shared_ptr<CSettingPath> CGUIDialogSettingsManualBase::AddPath(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::string value, bool writable /* = true */,
- const std::vector<std::string> &sources /* = std::vector<std::string>() */, bool allowEmpty /* = false */,
- int heading /* = -1 */, bool hideValue /* = false */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingPath> CGUIDialogSettingsManualBase::AddPath(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ bool writable /* = true */,
+ const std::vector<std::string>& sources /* = std::vector<std::string>() */,
+ bool allowEmpty /* = false */,
+ int heading /* = -1 */,
+ bool hideValue /* = false */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -308,9 +397,16 @@ std::shared_ptr<CSettingPath> CGUIDialogSettingsManualBase::AddPath(SettingGroup
return setting;
}
-std::shared_ptr<CSettingDate> CGUIDialogSettingsManualBase::AddDate(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::string value,
- bool allowEmpty /* = false */, int heading /* = -1 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingDate> CGUIDialogSettingsManualBase::AddDate(const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ bool allowEmpty /* = false */,
+ int heading /* = -1 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || GetSetting(id) != NULL)
return NULL;
@@ -327,9 +423,16 @@ std::shared_ptr<CSettingDate> CGUIDialogSettingsManualBase::AddDate(SettingGroup
return setting;
}
-std::shared_ptr<CSettingTime> CGUIDialogSettingsManualBase::AddTime(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::string value,
- bool allowEmpty /* = false */, int heading /* = -1 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingTime> CGUIDialogSettingsManualBase::AddTime(const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ bool allowEmpty /* = false */,
+ int heading /* = -1 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || GetSetting(id) != NULL)
return NULL;
@@ -346,8 +449,16 @@ std::shared_ptr<CSettingTime> CGUIDialogSettingsManualBase::AddTime(SettingGroup
return setting;
}
-std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddSpinner(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::string value,
- StringSettingOptionsFiller filler, bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddSpinner(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ StringSettingOptionsFiller filler,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || filler == NULL ||
GetSetting(id) != NULL)
@@ -365,9 +476,19 @@ std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddSpinner(Setting
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value, int minimum, int step, int maximum,
- int formatLabel /* = -1 */, int minimumLabel /* = -1 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ int minimum,
+ int step,
+ int maximum,
+ int formatLabel /* = -1 */,
+ int minimumLabel /* = -1 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -387,9 +508,20 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(SettingGro
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value, int minimum, int step, int maximum,
- const std::string &formatString, int minimumLabel /* = -1 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ int minimum,
+ int step,
+ int maximum,
+ const std::string& formatString,
+ int minimumLabel /* = -1 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -409,8 +541,16 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(SettingGro
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value, const TranslatableIntegerSettingOptions &entries,
- bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ const TranslatableIntegerSettingOptions& entries,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || entries.empty() ||
GetSetting(id) != NULL)
@@ -428,8 +568,16 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(SettingGro
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value, const IntegerSettingOptions &entries,
- bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ const IntegerSettingOptions& entries,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || entries.empty() ||
GetSetting(id) != NULL)
@@ -447,8 +595,16 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(SettingGro
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value, IntegerSettingOptionsFiller filler,
- bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ IntegerSettingOptionsFiller filler,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || filler == NULL ||
GetSetting(id) != NULL)
@@ -466,9 +622,20 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSpinner(SettingGro
return setting;
}
-std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddSpinner(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, float value, float minimum, float step, float maximum,
- int formatLabel /* = -1 */, int minimumLabel /* = -1 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddSpinner(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float value,
+ float minimum,
+ float step,
+ float maximum,
+ int formatLabel /* = -1 */,
+ int minimumLabel /* = -1 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -488,9 +655,20 @@ std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddSpinner(Setting
return setting;
}
-std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddSpinner(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, float value, float minimum, float step, float maximum,
- const std::string &formatString, int minimumLabel /* = -1 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddSpinner(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float value,
+ float minimum,
+ float step,
+ float maximum,
+ const std::string& formatString,
+ int minimumLabel /* = -1 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -510,8 +688,16 @@ std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddSpinner(Setting
return setting;
}
-std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddList(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::string value,
- StringSettingOptionsFiller filler, int heading, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddList(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ StringSettingOptionsFiller filler,
+ int heading,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || filler == NULL ||
GetSetting(id) != NULL)
@@ -529,8 +715,16 @@ std::shared_ptr<CSettingString> CGUIDialogSettingsManualBase::AddList(SettingGro
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddList(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value, const TranslatableIntegerSettingOptions &entries,
- int heading, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddList(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ const TranslatableIntegerSettingOptions& entries,
+ int heading,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || entries.empty() ||
GetSetting(id) != NULL)
@@ -548,8 +742,16 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddList(SettingGroupP
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddList(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value, const IntegerSettingOptions &entries,
- int heading, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddList(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ const IntegerSettingOptions& entries,
+ int heading,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || entries.empty() ||
GetSetting(id) != NULL)
@@ -567,8 +769,16 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddList(SettingGroupP
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddList(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value, IntegerSettingOptionsFiller filler,
- int heading, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddList(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ IntegerSettingOptionsFiller filler,
+ int heading,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || filler == NULL ||
GetSetting(id) != NULL)
@@ -586,9 +796,18 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddList(SettingGroupP
return setting;
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddList(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::vector<std::string> values,
- StringSettingOptionsFiller filler, int heading, int minimumItems /* = 0 */, int maximumItems /* = -1 */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddList(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ std::vector<std::string> values,
+ StringSettingOptionsFiller filler,
+ int heading,
+ int minimumItems /* = 0 */,
+ int maximumItems /* = -1 */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || filler == NULL ||
GetSetting(id) != NULL)
@@ -622,9 +841,18 @@ std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddList(SettingGroup
return setting;
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddList(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::vector<int> values,
- const TranslatableIntegerSettingOptions &entries, int heading, int minimumItems /* = 0 */, int maximumItems /* = -1 */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddList(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ std::vector<int> values,
+ const TranslatableIntegerSettingOptions& entries,
+ int heading,
+ int minimumItems /* = 0 */,
+ int maximumItems /* = -1 */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || entries.empty() ||
GetSetting(id) != NULL)
@@ -658,9 +886,18 @@ std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddList(SettingGroup
return setting;
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddList(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::vector<int> values,
- const IntegerSettingOptions &entries, int heading, int minimumItems /* = 0 */, int maximumItems /* = -1 */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddList(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ std::vector<int> values,
+ const IntegerSettingOptions& entries,
+ int heading,
+ int minimumItems /* = 0 */,
+ int maximumItems /* = -1 */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 || entries.empty() ||
GetSetting(id) != NULL)
@@ -694,9 +931,19 @@ std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddList(SettingGroup
return setting;
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddList(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, std::vector<int> values,
- IntegerSettingOptionsFiller filler, int heading, int minimumItems /* = 0 */, int maximumItems /* = -1 */,
- bool visible /* = true */, int help /* = -1 */, SettingControlListValueFormatter formatter /* = NULL */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddList(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ std::vector<int> values,
+ IntegerSettingOptionsFiller filler,
+ int heading,
+ int minimumItems /* = 0 */,
+ int maximumItems /* = -1 */,
+ bool visible /* = true */,
+ int help /* = -1 */,
+ SettingControlListValueFormatter formatter /* = NULL */)
{
if (group == NULL || id.empty() || label < 0 || filler == NULL ||
GetSetting(id) != NULL)
@@ -730,9 +977,19 @@ std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddList(SettingGroup
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddPercentageSlider(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value, int formatLabel,
- int step /* = 1 */, int heading /* = -1 */, bool usePopup /* = false */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddPercentageSlider(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ int formatLabel,
+ int step /* = 1 */,
+ int heading /* = -1 */,
+ bool usePopup /* = false */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -752,9 +1009,19 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddPercentageSlider(S
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddPercentageSlider(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value, const std::string &formatString,
- int step /* = 1 */, int heading /* = -1 */, bool usePopup /* = false */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddPercentageSlider(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ const std::string& formatString,
+ int step /* = 1 */,
+ int heading /* = -1 */,
+ bool usePopup /* = false */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -774,9 +1041,20 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddPercentageSlider(S
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSlider(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value, int formatLabel, int minimum, int step,
- int maximum, int heading /* = -1 */, bool usePopup /* = false */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSlider(const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ int formatLabel,
+ int minimum,
+ int step,
+ int maximum,
+ int heading /* = -1 */,
+ bool usePopup /* = false */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -796,9 +1074,21 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSlider(SettingGrou
return setting;
}
-std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSlider(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int value, const std::string &formatString,
- int minimum, int step, int maximum, int heading /* = -1 */, bool usePopup /* = false */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSlider(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ const std::string& formatString,
+ int minimum,
+ int step,
+ int maximum,
+ int heading /* = -1 */,
+ bool usePopup /* = false */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -818,9 +1108,21 @@ std::shared_ptr<CSettingInt> CGUIDialogSettingsManualBase::AddSlider(SettingGrou
return setting;
}
-std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddSlider(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, float value, int formatLabel, float minimum,
- float step, float maximum, int heading /* = -1 */, bool usePopup /* = false */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddSlider(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float value,
+ int formatLabel,
+ float minimum,
+ float step,
+ float maximum,
+ int heading /* = -1 */,
+ bool usePopup /* = false */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -840,9 +1142,21 @@ std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddSlider(SettingG
return setting;
}
-std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddSlider(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, float value, const std::string &formatString,
- float minimum, float step, float maximum, int heading /* = -1 */, bool usePopup /* = false */,
- bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddSlider(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float value,
+ const std::string& formatString,
+ float minimum,
+ float step,
+ float maximum,
+ int heading /* = -1 */,
+ bool usePopup /* = false */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -862,79 +1176,207 @@ std::shared_ptr<CSettingNumber> CGUIDialogSettingsManualBase::AddSlider(SettingG
return setting;
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddPercentageRange(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper,
- int valueFormatLabel, int step /* = 1 */, int formatLabel /* = 21469 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddPercentageRange(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int valueFormatLabel,
+ int step /* = 1 */,
+ int formatLabel /* = 21469 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
return AddRange(group, id, label, level, valueLower, valueUpper, 0, step, 100, "percentage", formatLabel, valueFormatLabel, "", delayed, visible, help);
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddPercentageRange(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper,
- const std::string &valueFormatString /* = "%i %%" */, int step /* = 1 */, int formatLabel /* = 21469 */,
- bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddPercentageRange(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ const std::string& valueFormatString /* = "%i %%" */,
+ int step /* = 1 */,
+ int formatLabel /* = 21469 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
return AddRange(group, id, label, level, valueLower, valueUpper, 0, step, 100, "percentage", formatLabel, -1, valueFormatString, delayed, visible, help);
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum,
- int step, int maximum, int valueFormatLabel, int formatLabel /* = 21469 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ int valueFormatLabel,
+ int formatLabel /* = 21469 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
return AddRange(group, id, label, level, valueLower, valueUpper, minimum, step, maximum, "integer", formatLabel, valueFormatLabel, "", delayed, visible, help);
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum,
- int step, int maximum, const std::string &valueFormatString /* = "%d" */, int formatLabel /* = 21469 */,
- bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ const std::string& valueFormatString /* = "%d" */,
+ int formatLabel /* = 21469 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
return AddRange(group, id, label, level, valueLower, valueUpper, minimum, step, maximum, "integer", formatLabel, -1, valueFormatString, delayed, visible, help);
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, float valueLower, float valueUpper, float minimum,
- float step, float maximum, int valueFormatLabel, int formatLabel /* = 21469 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float valueLower,
+ float valueUpper,
+ float minimum,
+ float step,
+ float maximum,
+ int valueFormatLabel,
+ int formatLabel /* = 21469 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
return AddRange(group, id, label, level, valueLower, valueUpper, minimum, step, maximum, "number", formatLabel, valueFormatLabel, "", delayed, visible, help);
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, float valueLower, float valueUpper, float minimum,
- float step, float maximum, const std::string &valueFormatString /* = "%.1f" */, int formatLabel /* = 21469 */,
- bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float valueLower,
+ float valueUpper,
+ float minimum,
+ float step,
+ float maximum,
+ const std::string& valueFormatString /* = "%.1f" */,
+ int formatLabel /* = 21469 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
return AddRange(group, id, label, level, valueLower, valueUpper, minimum, step, maximum, "number", formatLabel, -1, valueFormatString, delayed, visible, help);
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddDateRange(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum,
- int step, int maximum, int valueFormatLabel, int formatLabel /* = 21469 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddDateRange(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ int valueFormatLabel,
+ int formatLabel /* = 21469 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
return AddRange(group, id, label, level, valueLower, valueUpper, minimum, step, maximum, "date", formatLabel, valueFormatLabel, "", delayed, visible, help);
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddDateRange(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum,
- int step, int maximum, const std::string &valueFormatString /* = "" */, int formatLabel /* = 21469 */,
- bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddDateRange(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ const std::string& valueFormatString /* = "" */,
+ int formatLabel /* = 21469 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
return AddRange(group, id, label, level, valueLower, valueUpper, minimum, step, maximum, "date", formatLabel, -1, valueFormatString, delayed, visible, help);
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddTimeRange(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum,
- int step, int maximum, int valueFormatLabel, int formatLabel /* = 21469 */, bool delayed /* = false */,
- bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddTimeRange(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ int valueFormatLabel,
+ int formatLabel /* = 21469 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
return AddRange(group, id, label, level, valueLower, valueUpper, minimum, step, maximum, "time", formatLabel, valueFormatLabel, "", delayed, visible, help);
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddTimeRange(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum,
- int step, int maximum, const std::string &valueFormatString /* = "mm:ss" */, int formatLabel /* = 21469 */,
- bool delayed /* = false */, bool visible /* = true */, int help /* = -1 */)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddTimeRange(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ const std::string& valueFormatString /* = "mm:ss" */,
+ int formatLabel /* = 21469 */,
+ bool delayed /* = false */,
+ bool visible /* = true */,
+ int help /* = -1 */)
{
return AddRange(group, id, label, level, valueLower, valueUpper, minimum, step, maximum, "time", formatLabel, -1, valueFormatString, delayed, visible, help);
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum,
- int step, int maximum, const std::string &format, int formatLabel, int valueFormatLabel,
- const std::string &valueFormatString, bool delayed, bool visible, int help)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ const std::string& format,
+ int formatLabel,
+ int valueFormatLabel,
+ const std::string& valueFormatString,
+ bool delayed,
+ bool visible,
+ int help)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -971,9 +1413,23 @@ std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(SettingGrou
return setting;
}
-std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(SettingGroupPtr group, const std::string &id, int label, SettingLevel level, float valueLower, float valueUpper, float minimum,
- float step, float maximum, const std::string &format, int formatLabel, int valueFormatLabel,
- const std::string &valueFormatString, bool delayed, bool visible, int help)
+std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(
+ const SettingGroupPtr& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float valueLower,
+ float valueUpper,
+ float minimum,
+ float step,
+ float maximum,
+ const std::string& format,
+ int formatLabel,
+ int valueFormatLabel,
+ const std::string& valueFormatString,
+ bool delayed,
+ bool visible,
+ int help)
{
if (group == NULL || id.empty() || label < 0 ||
GetSetting(id) != NULL)
@@ -1010,7 +1466,10 @@ std::shared_ptr<CSettingList> CGUIDialogSettingsManualBase::AddRange(SettingGrou
return setting;
}
-void CGUIDialogSettingsManualBase::setSettingDetails(std::shared_ptr<CSetting> setting, SettingLevel level, bool visible, int help)
+void CGUIDialogSettingsManualBase::setSettingDetails(const std::shared_ptr<CSetting>& setting,
+ SettingLevel level,
+ bool visible,
+ int help)
{
if (setting == NULL)
return;
diff --git a/xbmc/settings/dialogs/GUIDialogSettingsManualBase.h b/xbmc/settings/dialogs/GUIDialogSettingsManualBase.h
index a6c0f821a2..6dc4742a62 100644
--- a/xbmc/settings/dialogs/GUIDialogSettingsManualBase.h
+++ b/xbmc/settings/dialogs/GUIDialogSettingsManualBase.h
@@ -51,106 +51,536 @@ protected:
virtual void InitializeSettings();
std::shared_ptr<CSettingCategory> AddCategory(const std::string &id, int label, int help = -1);
- std::shared_ptr<CSettingGroup> AddGroup(std::shared_ptr<CSettingCategory> category, int label = -1, int help = -1, bool separatorBelowLabel = true, bool hideSeparator = false);
+ std::shared_ptr<CSettingGroup> AddGroup(const std::shared_ptr<CSettingCategory>& category,
+ int label = -1,
+ int help = -1,
+ bool separatorBelowLabel = true,
+ bool hideSeparator = false);
// checkmark control
- std::shared_ptr<CSettingBool> AddToggle(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, bool value, bool delayed = false, bool visible = true, int help = -1);
+ std::shared_ptr<CSettingBool> AddToggle(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ bool value,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
// edit controls
- std::shared_ptr<CSettingInt> AddEdit(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, int minimum = 0, int step = 1, int maximum = 0,
- bool verifyNewValue = false, int heading = -1, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingNumber> AddEdit(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, float value, float minimum = 0.0f, float step = 1.0f, float maximum = 0.0f,
- bool verifyNewValue = false, int heading = -1, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingString> AddEdit(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::string value, bool allowEmpty = false,
- bool hidden = false, int heading = -1, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingString> AddIp(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::string value, bool allowEmpty = false,
- int heading = -1, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingString> AddPasswordMd5(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::string value, bool allowEmpty = false,
- int heading = -1, bool delayed = false, bool visible = true, int help = -1);
+ std::shared_ptr<CSettingInt> AddEdit(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ int minimum = 0,
+ int step = 1,
+ int maximum = 0,
+ bool verifyNewValue = false,
+ int heading = -1,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingNumber> AddEdit(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float value,
+ float minimum = 0.0f,
+ float step = 1.0f,
+ float maximum = 0.0f,
+ bool verifyNewValue = false,
+ int heading = -1,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingString> AddEdit(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ bool allowEmpty = false,
+ bool hidden = false,
+ int heading = -1,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingString> AddIp(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ bool allowEmpty = false,
+ int heading = -1,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingString> AddPasswordMd5(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ bool allowEmpty = false,
+ int heading = -1,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
// button controls
- std::shared_ptr<CSettingAction> AddButton(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, const std::string& data = "", bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingString> AddInfoLabelButton(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::string info, bool visible = true, int help = -1);
- std::shared_ptr<CSettingAddon> AddAddon(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::string value, ADDON::TYPE addonType,
- bool allowEmpty = false, int heading = -1, bool hideValue = false, bool showInstalledAddons = true, bool showInstallableAddons = false,
- bool showMoreAddons = true, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingPath> AddPath(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::string value, bool writable = true,
- const std::vector<std::string> &sources = std::vector<std::string>(), bool allowEmpty = false, int heading = -1, bool hideValue = false,
- bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingDate> AddDate(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::string value, bool allowEmpty = false, int heading = -1,
- bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingTime> AddTime(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::string value, bool allowEmpty = false, int heading = -1,
- bool delayed = false, bool visible = true, int help = -1);
+ std::shared_ptr<CSettingAction> AddButton(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& data = "",
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingString> AddInfoLabelButton(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& info,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingAddon> AddAddon(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ ADDON::TYPE addonType,
+ bool allowEmpty = false,
+ int heading = -1,
+ bool hideValue = false,
+ bool showInstalledAddons = true,
+ bool showInstallableAddons = false,
+ bool showMoreAddons = true,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingPath> AddPath(
+ const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ bool writable = true,
+ const std::vector<std::string>& sources = std::vector<std::string>(),
+ bool allowEmpty = false,
+ int heading = -1,
+ bool hideValue = false,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingDate> AddDate(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ bool allowEmpty = false,
+ int heading = -1,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingTime> AddTime(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ bool allowEmpty = false,
+ int heading = -1,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
// spinner controls
- std::shared_ptr<CSettingString> AddSpinner(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::string value, StringSettingOptionsFiller filler,
- bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingInt> AddSpinner(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, int minimum, int step, int maximum, int formatLabel = -1,
- int minimumLabel = -1, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingInt> AddSpinner(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, int minimum, int step, int maximum, const std::string &formatString,
- int minimumLabel = -1, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingInt> AddSpinner(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, const TranslatableIntegerSettingOptions &entries,
- bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingInt> AddSpinner(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, const IntegerSettingOptions &entries,
- bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingInt> AddSpinner(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, IntegerSettingOptionsFiller filler,
- bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingNumber> AddSpinner(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, float value, float minimum, float step, float maximum,
- int formatLabel = -1, int minimumLabel = -1, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingNumber> AddSpinner(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, float value, float minimum, float step, float maximum,
- const std::string &formatString, int minimumLabel = -1, bool delayed = false, bool visible = true, int help = -1);
+ std::shared_ptr<CSettingString> AddSpinner(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ StringSettingOptionsFiller filler,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingInt> AddSpinner(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ int minimum,
+ int step,
+ int maximum,
+ int formatLabel = -1,
+ int minimumLabel = -1,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingInt> AddSpinner(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ int minimum,
+ int step,
+ int maximum,
+ const std::string& formatString,
+ int minimumLabel = -1,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingInt> AddSpinner(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ const TranslatableIntegerSettingOptions& entries,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingInt> AddSpinner(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ const IntegerSettingOptions& entries,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingInt> AddSpinner(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ IntegerSettingOptionsFiller filler,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingNumber> AddSpinner(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float value,
+ float minimum,
+ float step,
+ float maximum,
+ int formatLabel = -1,
+ int minimumLabel = -1,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingNumber> AddSpinner(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float value,
+ float minimum,
+ float step,
+ float maximum,
+ const std::string& formatString,
+ int minimumLabel = -1,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
// list controls
- std::shared_ptr<CSettingString> AddList(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::string value, StringSettingOptionsFiller filler,
- int heading, bool visible = true, int help = -1);
- std::shared_ptr<CSettingInt> AddList(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, const TranslatableIntegerSettingOptions &entries,
- int heading, bool visible = true, int help = -1);
- std::shared_ptr<CSettingInt> AddList(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, const IntegerSettingOptions &entries,
- int heading, bool visible = true, int help = -1);
- std::shared_ptr<CSettingInt> AddList(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, IntegerSettingOptionsFiller filler,
- int heading, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddList(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::vector<std::string> values, StringSettingOptionsFiller filler,
- int heading, int minimumItems = 0, int maximumItems = -1, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddList(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::vector<int> values, const TranslatableIntegerSettingOptions &entries,
- int heading, int minimumItems = 0, int maximumItems = -1, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddList(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::vector<int> values, const IntegerSettingOptions &entries,
- int heading, int minimumItems = 0, int maximumItems = -1, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddList(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, std::vector<int> values, IntegerSettingOptionsFiller filler,
- int heading, int minimumItems = 0, int maximumItems = -1, bool visible = true, int help = -1, SettingControlListValueFormatter formatter = NULL);
+ std::shared_ptr<CSettingString> AddList(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ const std::string& value,
+ StringSettingOptionsFiller filler,
+ int heading,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingInt> AddList(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ const TranslatableIntegerSettingOptions& entries,
+ int heading,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingInt> AddList(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ const IntegerSettingOptions& entries,
+ int heading,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingInt> AddList(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ IntegerSettingOptionsFiller filler,
+ int heading,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddList(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ std::vector<std::string> values,
+ StringSettingOptionsFiller filler,
+ int heading,
+ int minimumItems = 0,
+ int maximumItems = -1,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddList(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ std::vector<int> values,
+ const TranslatableIntegerSettingOptions& entries,
+ int heading,
+ int minimumItems = 0,
+ int maximumItems = -1,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddList(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ std::vector<int> values,
+ const IntegerSettingOptions& entries,
+ int heading,
+ int minimumItems = 0,
+ int maximumItems = -1,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddList(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ std::vector<int> values,
+ IntegerSettingOptionsFiller filler,
+ int heading,
+ int minimumItems = 0,
+ int maximumItems = -1,
+ bool visible = true,
+ int help = -1,
+ SettingControlListValueFormatter formatter = NULL);
// slider controls
- std::shared_ptr<CSettingInt> AddPercentageSlider(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, int formatLabel, int step = 1, int heading = -1,
- bool usePopup = false, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingInt> AddPercentageSlider(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, const std::string &formatString, int step = 1,
- int heading = -1, bool usePopup = false, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingInt> AddSlider(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, int formatLabel, int minimum, int step, int maximum,
- int heading = -1, bool usePopup = false, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingInt> AddSlider(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int value, const std::string &formatString, int minimum, int step, int maximum,
- int heading = -1, bool usePopup = false, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingNumber> AddSlider(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, float value, int formatLabel, float minimum, float step, float maximum,
- int heading = -1, bool usePopup = false, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingNumber> AddSlider(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, float value, const std::string &formatString, float minimum, float step,
- float maximum, int heading = -1, bool usePopup = false, bool delayed = false, bool visible = true, int help = -1);
+ std::shared_ptr<CSettingInt> AddPercentageSlider(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ int formatLabel,
+ int step = 1,
+ int heading = -1,
+ bool usePopup = false,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingInt> AddPercentageSlider(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ const std::string& formatString,
+ int step = 1,
+ int heading = -1,
+ bool usePopup = false,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingInt> AddSlider(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ int formatLabel,
+ int minimum,
+ int step,
+ int maximum,
+ int heading = -1,
+ bool usePopup = false,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingInt> AddSlider(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int value,
+ const std::string& formatString,
+ int minimum,
+ int step,
+ int maximum,
+ int heading = -1,
+ bool usePopup = false,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingNumber> AddSlider(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float value,
+ int formatLabel,
+ float minimum,
+ float step,
+ float maximum,
+ int heading = -1,
+ bool usePopup = false,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingNumber> AddSlider(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float value,
+ const std::string& formatString,
+ float minimum,
+ float step,
+ float maximum,
+ int heading = -1,
+ bool usePopup = false,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
// range controls
- std::shared_ptr<CSettingList> AddPercentageRange(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int valueFormatLabel, int step = 1,
- int formatLabel = 21469, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddPercentageRange(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper,
- const std::string &valueFormatString = "%i %%", int step = 1, int formatLabel = 21469,
- bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddRange(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum, int step, int maximum,
- int valueFormatLabel, int formatLabel = 21469, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddRange(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum, int step, int maximum,
- const std::string &valueFormatString = "%d", int formatLabel = 21469, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddRange(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, float valueLower, float valueUpper, float minimum, float step, float maximum,
- int valueFormatLabel, int formatLabel = 21469, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddRange(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, float valueLower, float valueUpper, float minimum, float step, float maximum,
- const std::string &valueFormatString = "%.1f", int formatLabel = 21469, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddDateRange(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum, int step, int maximum,
- int valueFormatLabel, int formatLabel = 21469, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddDateRange(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum, int step, int maximum,
- const std::string &valueFormatString = "", int formatLabel = 21469, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddTimeRange(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum, int step, int maximum,
- int valueFormatLabel, int formatLabel = 21469, bool delayed = false, bool visible = true, int help = -1);
- std::shared_ptr<CSettingList> AddTimeRange(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum, int step, int maximum,
- const std::string &valueFormatString = "mm:ss", int formatLabel = 21469, bool delayed = false, bool visible = true, int help = -1);
+ std::shared_ptr<CSettingList> AddPercentageRange(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int valueFormatLabel,
+ int step = 1,
+ int formatLabel = 21469,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddPercentageRange(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ const std::string& valueFormatString = "%i %%",
+ int step = 1,
+ int formatLabel = 21469,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddRange(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ int valueFormatLabel,
+ int formatLabel = 21469,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddRange(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ const std::string& valueFormatString = "%d",
+ int formatLabel = 21469,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddRange(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float valueLower,
+ float valueUpper,
+ float minimum,
+ float step,
+ float maximum,
+ int valueFormatLabel,
+ int formatLabel = 21469,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddRange(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float valueLower,
+ float valueUpper,
+ float minimum,
+ float step,
+ float maximum,
+ const std::string& valueFormatString = "%.1f",
+ int formatLabel = 21469,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddDateRange(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ int valueFormatLabel,
+ int formatLabel = 21469,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddDateRange(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ const std::string& valueFormatString = "",
+ int formatLabel = 21469,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddTimeRange(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ int valueFormatLabel,
+ int formatLabel = 21469,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
+ std::shared_ptr<CSettingList> AddTimeRange(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ const std::string& valueFormatString = "mm:ss",
+ int formatLabel = 21469,
+ bool delayed = false,
+ bool visible = true,
+ int help = -1);
std::shared_ptr<ISettingControl> GetTitleControl(bool separatorBelowLabel = true, bool hideSeparator = false);
std::shared_ptr<ISettingControl> GetCheckmarkControl(bool delayed = false);
@@ -163,12 +593,43 @@ protected:
std::shared_ptr<ISettingControl> GetRangeControl(const std::string &format, bool delayed = false, int formatLabel = -1, int valueFormatLabel = -1, const std::string &valueFormatString = "");
private:
- std::shared_ptr<CSettingList> AddRange(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, int valueLower, int valueUpper, int minimum, int step, int maximum,
- const std::string &format, int formatLabel, int valueFormatLabel, const std::string &valueFormatString, bool delayed, bool visible, int help);
- std::shared_ptr<CSettingList> AddRange(std::shared_ptr<CSettingGroup> group, const std::string &id, int label, SettingLevel level, float valueLower, float valueUpper, float minimum, float step, float maximum,
- const std::string &format, int formatLabel, int valueFormatLabel, const std::string &valueFormatString, bool delayed, bool visible, int help);
+ std::shared_ptr<CSettingList> AddRange(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ int valueLower,
+ int valueUpper,
+ int minimum,
+ int step,
+ int maximum,
+ const std::string& format,
+ int formatLabel,
+ int valueFormatLabel,
+ const std::string& valueFormatString,
+ bool delayed,
+ bool visible,
+ int help);
+ std::shared_ptr<CSettingList> AddRange(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& id,
+ int label,
+ SettingLevel level,
+ float valueLower,
+ float valueUpper,
+ float minimum,
+ float step,
+ float maximum,
+ const std::string& format,
+ int formatLabel,
+ int valueFormatLabel,
+ const std::string& valueFormatString,
+ bool delayed,
+ bool visible,
+ int help);
- void setSettingDetails(std::shared_ptr<CSetting> setting, SettingLevel level, bool visible, int help);
+ void setSettingDetails(const std::shared_ptr<CSetting>& setting,
+ SettingLevel level,
+ bool visible,
+ int help);
mutable CSettingsManager *m_settingsManager;
std::shared_ptr<CSettingSection> m_section;
diff --git a/xbmc/settings/lib/ISettingCallback.h b/xbmc/settings/lib/ISettingCallback.h
index 7806c6564c..00fc428c8b 100644
--- a/xbmc/settings/lib/ISettingCallback.h
+++ b/xbmc/settings/lib/ISettingCallback.h
@@ -30,7 +30,7 @@ public:
\param setting The setting whose value is being changed (already containing the changed value)
\return True if the new value is acceptable otherwise false
*/
- virtual bool OnSettingChanging(std::shared_ptr<const CSetting> setting) { return true; }
+ virtual bool OnSettingChanging(const std::shared_ptr<const CSetting>& setting) { return true; }
/*!
\brief The value of the given setting has changed.
@@ -41,7 +41,7 @@ public:
\param setting The setting whose value has been changed
*/
- virtual void OnSettingChanged(std::shared_ptr<const CSetting> setting) { }
+ virtual void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) {}
/*!
\brief The given setting has been activated.
@@ -51,7 +51,7 @@ public:
\param setting The setting which has been activated.
*/
- virtual void OnSettingAction(std::shared_ptr<const CSetting> setting) { }
+ virtual void OnSettingAction(const std::shared_ptr<const CSetting>& setting) {}
/*!
\brief The given setting needs to be updated.
@@ -65,7 +65,12 @@ public:
\param oldSettingNode The old setting node
\return True if the setting has been successfully updated otherwise false
*/
- virtual bool OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) { return false; }
+ virtual bool OnSettingUpdate(const std::shared_ptr<CSetting>& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode)
+ {
+ return false;
+ }
/*!
\brief The given property of the given setting has changed
@@ -76,5 +81,8 @@ public:
\param setting The setting which has a changed property
\param propertyName The string representation of the changed property
*/
- virtual void OnSettingPropertyChanged(std::shared_ptr<const CSetting> setting, const char *propertyName) { }
+ virtual void OnSettingPropertyChanged(const std::shared_ptr<const CSetting>& setting,
+ const char* propertyName)
+ {
+ }
};
diff --git a/xbmc/settings/lib/Setting.cpp b/xbmc/settings/lib/Setting.cpp
index 271f800df2..526944c92f 100644
--- a/xbmc/settings/lib/Setting.cpp
+++ b/xbmc/settings/lib/Setting.cpp
@@ -17,6 +17,7 @@
#include "utils/log.h"
#include <sstream>
+#include <utility>
template<typename TKey, typename TValue>
bool CheckSettingOptionsValidity(const TValue& value, const std::vector<std::pair<TKey, TValue>>& options)
@@ -254,7 +255,7 @@ bool CSetting::IsVisible() const
return visible;
}
-bool CSetting::OnSettingChanging(std::shared_ptr<const CSetting> setting)
+bool CSetting::OnSettingChanging(const std::shared_ptr<const CSetting>& setting)
{
if (m_callback == nullptr)
return true;
@@ -262,7 +263,7 @@ bool CSetting::OnSettingChanging(std::shared_ptr<const CSetting> setting)
return m_callback->OnSettingChanging(setting);
}
-void CSetting::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CSetting::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (m_callback == nullptr)
return;
@@ -270,7 +271,7 @@ void CSetting::OnSettingChanged(std::shared_ptr<const CSetting> setting)
m_callback->OnSettingChanged(setting);
}
-void CSetting::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CSetting::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (m_callback == nullptr)
return;
@@ -278,7 +279,9 @@ void CSetting::OnSettingAction(std::shared_ptr<const CSetting> setting)
m_callback->OnSettingAction(setting);
}
-bool CSetting::OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *oldSettingId, const TiXmlNode *oldSettingNode)
+bool CSetting::OnSettingUpdate(const std::shared_ptr<CSetting>& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode)
{
if (m_callback == nullptr)
return false;
@@ -286,7 +289,8 @@ bool CSetting::OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *ol
return m_callback->OnSettingUpdate(setting, oldSettingId, oldSettingNode);
}
-void CSetting::OnSettingPropertyChanged(std::shared_ptr<const CSetting> setting, const char *propertyName)
+void CSetting::OnSettingPropertyChanged(const std::shared_ptr<const CSetting>& setting,
+ const char* propertyName)
{
if (m_callback == nullptr)
return;
@@ -319,14 +323,14 @@ void CSetting::Copy(const CSetting &setting)
CSettingList::CSettingList(const std::string& id,
std::shared_ptr<CSetting> settingDefinition,
CSettingsManager* settingsManager /* = nullptr */)
- : CSetting(id, settingsManager, "CSettingList"), m_definition(settingDefinition)
+ : CSetting(id, settingsManager, "CSettingList"), m_definition(std::move(settingDefinition))
{ }
CSettingList::CSettingList(const std::string& id,
std::shared_ptr<CSetting> settingDefinition,
int label,
CSettingsManager* settingsManager /* = nullptr */)
- : CSetting(id, settingsManager, "CSettingList"), m_definition(settingDefinition)
+ : CSetting(id, settingsManager, "CSettingList"), m_definition(std::move(settingDefinition))
{
SetLabel(label);
}
diff --git a/xbmc/settings/lib/Setting.h b/xbmc/settings/lib/Setting.h
index e01338cff2..3b4c8b997e 100644
--- a/xbmc/settings/lib/Setting.h
+++ b/xbmc/settings/lib/Setting.h
@@ -22,6 +22,7 @@
#include <memory>
#include <set>
#include <string>
+#include <utility>
#include <vector>
enum class SettingOptionsType {
@@ -76,7 +77,7 @@ public:
void SetLevel(SettingLevel level) { m_level = level; }
std::shared_ptr<const ISettingControl> GetControl() const { return m_control; }
std::shared_ptr<ISettingControl> GetControl() { return m_control; }
- void SetControl(std::shared_ptr<ISettingControl> control) { m_control = control; }
+ void SetControl(std::shared_ptr<ISettingControl> control) { m_control = std::move(control); }
const SettingDependencies& GetDependencies() const { return m_dependencies; }
void SetDependencies(const SettingDependencies &dependencies) { m_dependencies = dependencies; }
const std::set<CSettingUpdate>& GetUpdates() const { return m_updates; }
@@ -93,14 +94,17 @@ public:
bool IsVisible() const override;
// implementation of ISettingCallback
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
protected:
// implementation of ISettingCallback
- bool OnSettingChanging(std::shared_ptr<const CSetting> setting) override;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- bool OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) override;
- void OnSettingPropertyChanged(std::shared_ptr<const CSetting> setting, const char *propertyName) override;
+ bool OnSettingChanging(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ bool OnSettingUpdate(const std::shared_ptr<CSetting>& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode) override;
+ void OnSettingPropertyChanged(const std::shared_ptr<const CSetting>& setting,
+ const char* propertyName) override;
void Copy(const CSetting &setting);
@@ -176,7 +180,7 @@ public:
SettingType GetElementType() const;
std::shared_ptr<CSetting> GetDefinition() { return m_definition; }
std::shared_ptr<const CSetting> GetDefinition() const { return m_definition; }
- void SetDefinition(std::shared_ptr<CSetting> definition) { m_definition = definition; }
+ void SetDefinition(std::shared_ptr<CSetting> definition) { m_definition = std::move(definition); }
const std::string& GetDelimiter() const { return m_delimiter; }
void SetDelimiter(const std::string &delimiter) { m_delimiter = delimiter; }
diff --git a/xbmc/settings/lib/SettingConditions.cpp b/xbmc/settings/lib/SettingConditions.cpp
index 5c2bdf3aed..7146834f74 100644
--- a/xbmc/settings/lib/SettingConditions.cpp
+++ b/xbmc/settings/lib/SettingConditions.cpp
@@ -126,7 +126,10 @@ void CSettingConditionsManager::RemoveDynamicCondition(std::string identifier)
m_conditions.erase(it);
}
-bool CSettingConditionsManager::Check(std::string condition, const std::string &value /* = "" */, std::shared_ptr<const CSetting> setting /* = nullptr */) const
+bool CSettingConditionsManager::Check(
+ std::string condition,
+ const std::string& value /* = "" */,
+ const std::shared_ptr<const CSetting>& setting /* = nullptr */) const
{
if (condition.empty())
return false;
diff --git a/xbmc/settings/lib/SettingConditions.h b/xbmc/settings/lib/SettingConditions.h
index 50c05f04c1..aee2c0614c 100644
--- a/xbmc/settings/lib/SettingConditions.h
+++ b/xbmc/settings/lib/SettingConditions.h
@@ -19,7 +19,10 @@
class CSettingsManager;
class CSetting;
-using SettingConditionCheck = bool (*)(const std::string &condition, const std::string &value, std::shared_ptr<const CSetting> setting, void *data);
+using SettingConditionCheck = bool (*)(const std::string& condition,
+ const std::string& value,
+ const std::shared_ptr<const CSetting>& setting,
+ void* data);
class ISettingCondition
{
@@ -88,7 +91,10 @@ public:
void AddDynamicCondition(std::string identifier, SettingConditionCheck condition, void *data = nullptr);
void RemoveDynamicCondition(std::string identifier);
- bool Check(std::string condition, const std::string &value = "", std::shared_ptr<const CSetting> setting = std::shared_ptr<const CSetting>()) const;
+ bool Check(
+ std::string condition,
+ const std::string& value = "",
+ const std::shared_ptr<const CSetting>& setting = std::shared_ptr<const CSetting>()) const;
private:
using SettingConditionPair = std::pair<std::string, std::pair<SettingConditionCheck, void*>>;
diff --git a/xbmc/settings/lib/SettingDefinitions.h b/xbmc/settings/lib/SettingDefinitions.h
index a82cb5a01b..545e41e58c 100644
--- a/xbmc/settings/lib/SettingDefinitions.h
+++ b/xbmc/settings/lib/SettingDefinitions.h
@@ -110,8 +110,14 @@ using TranslatableStringSettingOptions = std::vector<TranslatableStringSettingOp
using StringSettingOptions = std::vector<StringSettingOption>;
class CSetting;
-using IntegerSettingOptionsFiller = void (*)(std::shared_ptr<const CSetting> setting, IntegerSettingOptions &list, int &current, void *data);
-using StringSettingOptionsFiller = void (*)(std::shared_ptr<const CSetting> setting, StringSettingOptions &list, std::string &current, void *data);
+using IntegerSettingOptionsFiller = void (*)(const std::shared_ptr<const CSetting>& setting,
+ IntegerSettingOptions& list,
+ int& current,
+ void* data);
+using StringSettingOptionsFiller = void (*)(const std::shared_ptr<const CSetting>& setting,
+ StringSettingOptions& list,
+ std::string& current,
+ void* data);
enum class SettingOptionsSort
{
diff --git a/xbmc/settings/lib/SettingDependency.cpp b/xbmc/settings/lib/SettingDependency.cpp
index 2458cc6095..e5b49fb81f 100644
--- a/xbmc/settings/lib/SettingDependency.cpp
+++ b/xbmc/settings/lib/SettingDependency.cpp
@@ -292,7 +292,8 @@ bool CSettingDependencyConditionCombination::Deserialize(const TiXmlNode *node)
return true;
}
-CSettingDependencyConditionCombination* CSettingDependencyConditionCombination::Add(CSettingDependencyConditionPtr condition)
+CSettingDependencyConditionCombination* CSettingDependencyConditionCombination::Add(
+ const CSettingDependencyConditionPtr& condition)
{
if (condition != nullptr)
{
@@ -306,7 +307,8 @@ CSettingDependencyConditionCombination* CSettingDependencyConditionCombination::
return this;
}
-CSettingDependencyConditionCombination* CSettingDependencyConditionCombination::Add(CSettingDependencyConditionCombinationPtr operation)
+CSettingDependencyConditionCombination* CSettingDependencyConditionCombination::Add(
+ const CSettingDependencyConditionCombinationPtr& operation)
{
if (operation != nullptr)
{
diff --git a/xbmc/settings/lib/SettingDependency.h b/xbmc/settings/lib/SettingDependency.h
index fd599040a0..1ba83f90a1 100644
--- a/xbmc/settings/lib/SettingDependency.h
+++ b/xbmc/settings/lib/SettingDependency.h
@@ -87,8 +87,9 @@ public:
const std::set<std::string>& GetSettings() const { return m_settings; }
- CSettingDependencyConditionCombination* Add(CSettingDependencyConditionPtr condition);
- CSettingDependencyConditionCombination* Add(CSettingDependencyConditionCombinationPtr operation);
+ CSettingDependencyConditionCombination* Add(const CSettingDependencyConditionPtr& condition);
+ CSettingDependencyConditionCombination* Add(
+ const CSettingDependencyConditionCombinationPtr& operation);
private:
CBooleanLogicOperation* newOperation() override { return new CSettingDependencyConditionCombination(m_settingsManager); }
diff --git a/xbmc/settings/lib/SettingSection.cpp b/xbmc/settings/lib/SettingSection.cpp
index db3de8906c..bb199fc0e6 100644
--- a/xbmc/settings/lib/SettingSection.cpp
+++ b/xbmc/settings/lib/SettingSection.cpp
@@ -145,7 +145,7 @@ SettingList CSettingGroup::GetSettings(SettingLevel level) const
return settings;
}
-void CSettingGroup::AddSetting(SettingPtr setting)
+void CSettingGroup::AddSetting(const SettingPtr& setting)
{
addISetting(nullptr, setting, m_settings);
}
@@ -156,7 +156,8 @@ void CSettingGroup::AddSettings(const SettingList &settings)
addISetting(nullptr, setting, m_settings);
}
-bool CSettingGroup::ReplaceSetting(std::shared_ptr<const CSetting> currentSetting, std::shared_ptr<CSetting> newSetting)
+bool CSettingGroup::ReplaceSetting(const std::shared_ptr<const CSetting>& currentSetting,
+ const std::shared_ptr<CSetting>& newSetting)
{
for (auto itSetting = m_settings.begin(); itSetting != m_settings.end(); ++itSetting)
{
@@ -243,7 +244,7 @@ bool CSettingCategory::CanAccess() const
return m_accessCondition.Check();
}
-void CSettingCategory::AddGroup(SettingGroupPtr group)
+void CSettingCategory::AddGroup(const SettingGroupPtr& group)
{
addISetting(nullptr, group, m_groups);
}
@@ -312,7 +313,7 @@ SettingCategoryList CSettingSection::GetCategories(SettingLevel level) const
return categories;
}
-void CSettingSection::AddCategory(SettingCategoryPtr category)
+void CSettingSection::AddCategory(const SettingCategoryPtr& category)
{
addISetting(nullptr, category, m_categories);
}
diff --git a/xbmc/settings/lib/SettingSection.h b/xbmc/settings/lib/SettingSection.h
index f29fc8d392..f02d026af4 100644
--- a/xbmc/settings/lib/SettingSection.h
+++ b/xbmc/settings/lib/SettingSection.h
@@ -14,6 +14,7 @@
#include "utils/StaticLoggerBase.h"
#include <string>
+#include <utility>
#include <vector>
class CSettingsManager;
@@ -55,14 +56,15 @@ public:
*/
SettingList GetSettings(SettingLevel level) const;
- void AddSetting(std::shared_ptr<CSetting> setting);
+ void AddSetting(const std::shared_ptr<CSetting>& setting);
void AddSettings(const SettingList &settings);
- bool ReplaceSetting(std::shared_ptr<const CSetting> currentSetting, std::shared_ptr<CSetting> newSetting);
+ bool ReplaceSetting(const std::shared_ptr<const CSetting>& currentSetting,
+ const std::shared_ptr<CSetting>& newSetting);
std::shared_ptr<const ISettingControl> GetControl() const { return m_control; }
std::shared_ptr<ISettingControl> GetControl() { return m_control; }
- void SetControl(std::shared_ptr<ISettingControl> control) { m_control = control; }
+ void SetControl(std::shared_ptr<ISettingControl> control) { m_control = std::move(control); }
private:
SettingList m_settings;
@@ -117,7 +119,7 @@ public:
*/
bool CanAccess() const;
- void AddGroup(SettingGroupPtr group);
+ void AddGroup(const SettingGroupPtr& group);
void AddGroups(const SettingGroupList &groups);
private:
@@ -166,7 +168,7 @@ public:
*/
SettingCategoryList GetCategories(SettingLevel level) const;
- void AddCategory(SettingCategoryPtr category);
+ void AddCategory(const SettingCategoryPtr& category);
void AddCategories(const SettingCategoryList &categories);
private:
diff --git a/xbmc/settings/lib/SettingsManager.cpp b/xbmc/settings/lib/SettingsManager.cpp
index 8f5b165024..1a3f37c9a5 100644
--- a/xbmc/settings/lib/SettingsManager.cpp
+++ b/xbmc/settings/lib/SettingsManager.cpp
@@ -262,7 +262,7 @@ void CSettingsManager::SetInitialized()
ResolveSettingDependencies(setting.second);
}
-void CSettingsManager::AddSection(SettingSectionPtr section)
+void CSettingsManager::AddSection(const SettingSectionPtr& section)
{
if (section == nullptr)
return;
@@ -304,8 +304,10 @@ void CSettingsManager::AddSection(SettingSectionPtr section)
}
}
-bool CSettingsManager::AddSetting(std::shared_ptr<CSetting> setting, std::shared_ptr<CSettingSection> section,
- std::shared_ptr<CSettingCategory> category, std::shared_ptr<CSettingGroup> group)
+bool CSettingsManager::AddSetting(const std::shared_ptr<CSetting>& setting,
+ const std::shared_ptr<CSettingSection>& section,
+ const std::shared_ptr<CSettingCategory>& category,
+ const std::shared_ptr<CSettingGroup>& group)
{
if (setting == nullptr || section == nullptr || category == nullptr || group == nullptr)
return false;
@@ -458,7 +460,7 @@ void CSettingsManager::UnregisterSettingOptionsFiller(const std::string &identif
m_optionsFillers.erase(identifier);
}
-void* CSettingsManager::GetSettingOptionsFiller(SettingConstPtr setting)
+void* CSettingsManager::GetSettingOptionsFiller(const SettingConstPtr& setting)
{
CSharedLock lock(m_critical);
if (setting == nullptr)
@@ -567,7 +569,7 @@ SettingDependencyMap CSettingsManager::GetDependencies(const std::string &id) co
return setting->second.dependencies;
}
-SettingDependencyMap CSettingsManager::GetDependencies(SettingConstPtr setting) const
+SettingDependencyMap CSettingsManager::GetDependencies(const SettingConstPtr& setting) const
{
if (setting == nullptr)
return SettingDependencyMap();
@@ -790,7 +792,7 @@ bool CSettingsManager::Deserialize(const TiXmlNode *node, bool &updated, std::ma
return true;
}
-bool CSettingsManager::OnSettingChanging(std::shared_ptr<const CSetting> setting)
+bool CSettingsManager::OnSettingChanging(const std::shared_ptr<const CSetting>& setting)
{
if (setting == nullptr)
return false;
@@ -848,7 +850,7 @@ bool CSettingsManager::OnSettingChanging(std::shared_ptr<const CSetting> setting
return true;
}
-void CSettingsManager::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CSettingsManager::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
CSharedLock lock(m_settingsCritical);
if (!m_loaded || setting == nullptr)
@@ -874,7 +876,7 @@ void CSettingsManager::OnSettingChanged(std::shared_ptr<const CSetting> setting)
}
}
-void CSettingsManager::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CSettingsManager::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
CSharedLock lock(m_settingsCritical);
if (!m_loaded || setting == nullptr)
@@ -892,7 +894,9 @@ void CSettingsManager::OnSettingAction(std::shared_ptr<const CSetting> setting)
callback->OnSettingAction(setting);
}
-bool CSettingsManager::OnSettingUpdate(SettingPtr setting, const char *oldSettingId, const TiXmlNode *oldSettingNode)
+bool CSettingsManager::OnSettingUpdate(const SettingPtr& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode)
{
CSharedLock lock(m_settingsCritical);
if (setting == nullptr)
@@ -913,7 +917,8 @@ bool CSettingsManager::OnSettingUpdate(SettingPtr setting, const char *oldSettin
return ret;
}
-void CSettingsManager::OnSettingPropertyChanged(std::shared_ptr<const CSetting> setting, const char *propertyName)
+void CSettingsManager::OnSettingPropertyChanged(const std::shared_ptr<const CSetting>& setting,
+ const char* propertyName)
{
CSharedLock lock(m_settingsCritical);
if (!m_loaded || setting == nullptr)
@@ -1040,7 +1045,7 @@ void CSettingsManager::OnSettingsCleared()
settingsHandler->OnSettingsCleared();
}
-bool CSettingsManager::LoadSetting(const TiXmlNode *node, SettingPtr setting, bool &updated)
+bool CSettingsManager::LoadSetting(const TiXmlNode* node, const SettingPtr& setting, bool& updated)
{
updated = false;
@@ -1107,7 +1112,9 @@ bool CSettingsManager::LoadSetting(const TiXmlNode *node, SettingPtr setting, bo
return true;
}
-bool CSettingsManager::UpdateSetting(const TiXmlNode *node, SettingPtr setting, const CSettingUpdate& update)
+bool CSettingsManager::UpdateSetting(const TiXmlNode* node,
+ const SettingPtr& setting,
+ const CSettingUpdate& update)
{
if (node == nullptr || setting == nullptr || update.GetType() == SettingUpdateType::Unknown)
return false;
@@ -1202,7 +1209,7 @@ void CSettingsManager::UpdateSettingByDependency(const std::string &settingId, S
}
}
-void CSettingsManager::AddSetting(std::shared_ptr<CSetting> setting)
+void CSettingsManager::AddSetting(const std::shared_ptr<CSetting>& setting)
{
setting->CheckRequirements();
@@ -1221,7 +1228,7 @@ void CSettingsManager::AddSetting(std::shared_ptr<CSetting> setting)
}
}
-void CSettingsManager::ResolveReferenceSettings(std::shared_ptr<CSettingSection> section)
+void CSettingsManager::ResolveReferenceSettings(const std::shared_ptr<CSettingSection>& section)
{
struct GroupedReferenceSettings
{
@@ -1345,7 +1352,7 @@ void CSettingsManager::RegisterSettingOptionsFiller(const std::string &identifie
m_optionsFillers.insert(make_pair(identifier, optionsFiller));
}
-void CSettingsManager::ResolveSettingDependencies(std::shared_ptr<CSetting> setting)
+void CSettingsManager::ResolveSettingDependencies(const std::shared_ptr<CSetting>& setting)
{
if (setting == nullptr)
return;
diff --git a/xbmc/settings/lib/SettingsManager.h b/xbmc/settings/lib/SettingsManager.h
index 31ed7006ed..a52fc0d9c4 100644
--- a/xbmc/settings/lib/SettingsManager.h
+++ b/xbmc/settings/lib/SettingsManager.h
@@ -162,7 +162,7 @@ public:
This is possible before and after the setting definitions have been
initialized.
*/
- void AddSection(std::shared_ptr<CSettingSection> section);
+ void AddSection(const std::shared_ptr<CSettingSection>& section);
/*!
\brief Adds the given setting to the given group in the given category in
@@ -182,8 +182,10 @@ public:
\param group Group the new setting should be added to
\return True if the setting has been added, false otherwise
*/
- bool AddSetting(std::shared_ptr<CSetting> setting, std::shared_ptr<CSettingSection> section,
- std::shared_ptr<CSettingCategory> category, std::shared_ptr<CSettingGroup> group);
+ bool AddSetting(const std::shared_ptr<CSetting>& setting,
+ const std::shared_ptr<CSettingSection>& section,
+ const std::shared_ptr<CSettingCategory>& category,
+ const std::shared_ptr<CSettingGroup>& group);
/*!
\brief Registers the given ISettingCallback implementation to be triggered
@@ -267,7 +269,7 @@ public:
\param setting Setting object
\return Implementation of the setting options filler (either IntegerSettingOptionsFiller or StringSettingOptionsFiller)
*/
- void* GetSettingOptionsFiller(std::shared_ptr<const CSetting> setting);
+ void* GetSettingOptionsFiller(const std::shared_ptr<const CSetting>& setting);
/*!
\brief Checks whether any settings have been initialized.
@@ -319,7 +321,7 @@ public:
\param setting Setting object
\return Map of settings (and their dependencies) which depend on the given setting
*/
- SettingDependencyMap GetDependencies(std::shared_ptr<const CSetting> setting) const;
+ SettingDependencyMap GetDependencies(const std::shared_ptr<const CSetting>& setting) const;
/*!
\brief Gets the boolean value of the setting with the given identifier.
@@ -453,11 +455,14 @@ public:
private:
// implementation of ISettingCallback
- bool OnSettingChanging(std::shared_ptr<const CSetting> setting) override;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
- bool OnSettingUpdate(std::shared_ptr<CSetting> setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) override;
- void OnSettingPropertyChanged(std::shared_ptr<const CSetting> setting, const char *propertyName) override;
+ bool OnSettingChanging(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
+ bool OnSettingUpdate(const std::shared_ptr<CSetting>& setting,
+ const char* oldSettingId,
+ const TiXmlNode* oldSettingNode) override;
+ void OnSettingPropertyChanged(const std::shared_ptr<const CSetting>& setting,
+ const char* propertyName) override;
// implementation of ISettingsHandler
bool OnSettingsLoading() override;
@@ -470,14 +475,16 @@ private:
bool Serialize(TiXmlNode *parent) const;
bool Deserialize(const TiXmlNode *node, bool &updated, std::map<std::string, std::shared_ptr<CSetting>> *loadedSettings = nullptr);
- bool LoadSetting(const TiXmlNode *node, std::shared_ptr<CSetting> setting, bool &updated);
- bool UpdateSetting(const TiXmlNode *node, std::shared_ptr<CSetting> setting, const CSettingUpdate& update);
+ bool LoadSetting(const TiXmlNode* node, const std::shared_ptr<CSetting>& setting, bool& updated);
+ bool UpdateSetting(const TiXmlNode* node,
+ const std::shared_ptr<CSetting>& setting,
+ const CSettingUpdate& update);
void UpdateSettingByDependency(const std::string &settingId, const CSettingDependency &dependency);
void UpdateSettingByDependency(const std::string &settingId, SettingDependencyType dependencyType);
- void AddSetting(std::shared_ptr<CSetting> setting);
+ void AddSetting(const std::shared_ptr<CSetting>& setting);
- void ResolveReferenceSettings(std::shared_ptr<CSettingSection> section);
+ void ResolveReferenceSettings(const std::shared_ptr<CSettingSection>& section);
void CleanupIncompleteSettings();
enum class SettingOptionsFillerType {
@@ -499,7 +506,7 @@ private:
using SettingMap = std::map<std::string, Setting>;
- void ResolveSettingDependencies(std::shared_ptr<CSetting> setting);
+ void ResolveSettingDependencies(const std::shared_ptr<CSetting>& setting);
void ResolveSettingDependencies(const Setting& setting);
SettingMap::const_iterator FindSetting(std::string settingId) const;
diff --git a/xbmc/settings/windows/GUIControlSettings.cpp b/xbmc/settings/windows/GUIControlSettings.cpp
index 75c06fbaca..dc807bb338 100644
--- a/xbmc/settings/windows/GUIControlSettings.cpp
+++ b/xbmc/settings/windows/GUIControlSettings.cpp
@@ -94,7 +94,7 @@ static bool CompareSettingOptionDeseconding(const SettingOption& lhs, const Sett
return StringUtils::CompareNoCase(lhs.label, rhs.label) > 0;
}
-static bool GetIntegerOptions(SettingConstPtr setting,
+static bool GetIntegerOptions(const SettingConstPtr& setting,
IntegerSettingOptions& options,
std::set<int>& selectedOptions,
ILocalizer* localizer,
@@ -200,7 +200,7 @@ static bool GetIntegerOptions(SettingConstPtr setting,
return true;
}
-static bool GetStringOptions(SettingConstPtr setting,
+static bool GetStringOptions(const SettingConstPtr& setting,
StringSettingOptions& options,
std::set<std::string>& selectedOptions,
ILocalizer* localizer,
@@ -291,7 +291,11 @@ static bool GetStringOptions(SettingConstPtr setting,
CGUIControlBaseSetting::CGUIControlBaseSetting(int id,
std::shared_ptr<CSetting> pSetting,
ILocalizer* localizer)
- : m_id(id), m_pSetting(pSetting), m_localizer(localizer), m_delayed(false), m_valid(true)
+ : m_id(id),
+ m_pSetting(std::move(pSetting)),
+ m_localizer(localizer),
+ m_delayed(false),
+ m_valid(true)
{
}
@@ -334,7 +338,7 @@ CGUIControlRadioButtonSetting::CGUIControlRadioButtonSetting(CGUIRadioButtonCont
int id,
std::shared_ptr<CSetting> pSetting,
ILocalizer* localizer)
- : CGUIControlBaseSetting(id, pSetting, localizer)
+ : CGUIControlBaseSetting(id, std::move(pSetting), localizer)
{
m_pRadioButton = pRadioButton;
if (m_pRadioButton == NULL)
@@ -366,7 +370,7 @@ CGUIControlSpinExSetting::CGUIControlSpinExSetting(CGUISpinControlEx* pSpin,
int id,
std::shared_ptr<CSetting> pSetting,
ILocalizer* localizer)
- : CGUIControlBaseSetting(id, pSetting, localizer)
+ : CGUIControlBaseSetting(id, std::move(pSetting), localizer)
{
m_pSpin = pSpin;
if (m_pSpin == NULL)
@@ -564,7 +568,7 @@ CGUIControlListSetting::CGUIControlListSetting(CGUIButtonControl* pButton,
int id,
std::shared_ptr<CSetting> pSetting,
ILocalizer* localizer)
- : CGUIControlBaseSetting(id, pSetting, localizer)
+ : CGUIControlBaseSetting(id, std::move(pSetting), localizer)
{
m_pButton = pButton;
if (m_pButton == NULL)
@@ -795,7 +799,7 @@ void CGUIControlListSetting::Update(bool fromControl, bool updateDisplayOnly)
}
}
-bool CGUIControlListSetting::GetItems(SettingConstPtr setting,
+bool CGUIControlListSetting::GetItems(const SettingConstPtr& setting,
CFileItemList& items,
bool updateItems) const
{
@@ -824,7 +828,7 @@ bool CGUIControlListSetting::GetItems(SettingConstPtr setting,
return true;
}
-bool CGUIControlListSetting::GetIntegerItems(SettingConstPtr setting,
+bool CGUIControlListSetting::GetIntegerItems(const SettingConstPtr& setting,
CFileItemList& items,
bool updateItems) const
{
@@ -841,7 +845,7 @@ bool CGUIControlListSetting::GetIntegerItems(SettingConstPtr setting,
return true;
}
-bool CGUIControlListSetting::GetStringItems(SettingConstPtr setting,
+bool CGUIControlListSetting::GetStringItems(const SettingConstPtr& setting,
CFileItemList& items,
bool updateItems) const
{
@@ -862,7 +866,7 @@ CGUIControlButtonSetting::CGUIControlButtonSetting(CGUIButtonControl* pButton,
int id,
std::shared_ptr<CSetting> pSetting,
ILocalizer* localizer)
- : CGUIControlBaseSetting(id, pSetting, localizer)
+ : CGUIControlBaseSetting(id, std::move(pSetting), localizer)
{
m_pButton = pButton;
if (m_pButton == NULL)
@@ -1102,7 +1106,7 @@ void CGUIControlButtonSetting::Update(bool fromControl, bool updateDisplayOnly)
m_pButton->SetLabel2(strText);
}
-bool CGUIControlButtonSetting::GetPath(std::shared_ptr<CSettingPath> pathSetting,
+bool CGUIControlButtonSetting::GetPath(const std::shared_ptr<CSettingPath>& pathSetting,
ILocalizer* localizer)
{
if (pathSetting == NULL)
@@ -1201,7 +1205,7 @@ void CGUIControlButtonSetting::OnSliderChange(void* data, CGUISliderControl* sli
CGUIControlEditSetting::CGUIControlEditSetting(CGUIEditControl* pEdit,
int id,
- std::shared_ptr<CSetting> pSetting,
+ const std::shared_ptr<CSetting>& pSetting,
ILocalizer* localizer)
: CGUIControlBaseSetting(id, pSetting, localizer)
{
@@ -1301,7 +1305,7 @@ CGUIControlSliderSetting::CGUIControlSliderSetting(CGUISettingsSliderControl* pS
int id,
std::shared_ptr<CSetting> pSetting,
ILocalizer* localizer)
- : CGUIControlBaseSetting(id, pSetting, localizer)
+ : CGUIControlBaseSetting(id, std::move(pSetting), localizer)
{
m_pSlider = pSlider;
if (m_pSlider == NULL)
@@ -1423,7 +1427,7 @@ void CGUIControlSliderSetting::Update(bool fromControl, bool updateDisplayOnly)
m_pSlider->SetTextValue(strText);
}
-std::string CGUIControlSliderSetting::GetText(std::shared_ptr<CSetting> setting,
+std::string CGUIControlSliderSetting::GetText(const std::shared_ptr<CSetting>& setting,
const CVariant& value,
const CVariant& minimum,
const CVariant& step,
@@ -1484,7 +1488,7 @@ CGUIControlRangeSetting::CGUIControlRangeSetting(CGUISettingsSliderControl* pSli
int id,
std::shared_ptr<CSetting> pSetting,
ILocalizer* localizer)
- : CGUIControlBaseSetting(id, pSetting, localizer)
+ : CGUIControlBaseSetting(id, std::move(pSetting), localizer)
{
m_pSlider = pSlider;
if (m_pSlider == NULL)
@@ -1723,7 +1727,7 @@ CGUIControlLabelSetting::CGUIControlLabelSetting(CGUIButtonControl* pButton,
int id,
std::shared_ptr<CSetting> pSetting,
ILocalizer* localizer)
- : CGUIControlBaseSetting(id, pSetting, localizer)
+ : CGUIControlBaseSetting(id, std::move(pSetting), localizer)
{
m_pButton = pButton;
if (m_pButton == NULL)
diff --git a/xbmc/settings/windows/GUIControlSettings.h b/xbmc/settings/windows/GUIControlSettings.h
index 734b668a53..f0dfae8180 100644
--- a/xbmc/settings/windows/GUIControlSettings.h
+++ b/xbmc/settings/windows/GUIControlSettings.h
@@ -160,13 +160,13 @@ protected:
void Update(bool fromControl, bool updateDisplayOnly) override;
private:
- bool GetItems(std::shared_ptr<const CSetting> setting,
+ bool GetItems(const std::shared_ptr<const CSetting>& setting,
CFileItemList& items,
bool updateItems) const;
- bool GetIntegerItems(std::shared_ptr<const CSetting> setting,
+ bool GetIntegerItems(const std::shared_ptr<const CSetting>& setting,
CFileItemList& items,
bool updateItems) const;
- bool GetStringItems(std::shared_ptr<const CSetting> setting,
+ bool GetStringItems(const std::shared_ptr<const CSetting>& setting,
CFileItemList& items,
bool updateItems) const;
@@ -186,7 +186,7 @@ public:
bool OnClick() override;
void Clear() override { m_pButton = NULL; }
- static bool GetPath(std::shared_ptr<CSettingPath> pathSetting, ILocalizer* localizer);
+ static bool GetPath(const std::shared_ptr<CSettingPath>& pathSetting, ILocalizer* localizer);
protected:
// specialization of CGUIControlBaseSetting
@@ -204,7 +204,7 @@ class CGUIControlEditSetting : public CGUIControlBaseSetting
public:
CGUIControlEditSetting(CGUIEditControl* pButton,
int id,
- std::shared_ptr<CSetting> pSetting,
+ const std::shared_ptr<CSetting>& pSetting,
ILocalizer* localizer);
~CGUIControlEditSetting() override;
@@ -235,7 +235,7 @@ public:
bool OnClick() override;
void Clear() override { m_pSlider = NULL; }
- static std::string GetText(std::shared_ptr<CSetting> setting,
+ static std::string GetText(const std::shared_ptr<CSetting>& setting,
const CVariant& value,
const CVariant& minimum,
const CVariant& step,
diff --git a/xbmc/storage/cdioSupport.h b/xbmc/storage/cdioSupport.h
index da06d2c275..6fca99711e 100644
--- a/xbmc/storage/cdioSupport.h
+++ b/xbmc/storage/cdioSupport.h
@@ -20,6 +20,7 @@
#include <map>
#include <memory>
#include <string>
+#include <utility>
#include "PlatformDefs.h" // for ssize_t typedef, used by cdio
@@ -206,8 +207,12 @@ public:
void SetFirstDataTrack( int nTrack ) { m_nFirstData = nTrack; }
void SetDataTrackCount( int nCount ) { m_nNumData = nCount; }
void SetAudioTrackCount( int nCount ) { m_nNumAudio = nCount; }
- void SetTrackInformation( int nTrack, trackinfo nInfo ) { if ( nTrack > 0 && nTrack <= 99 ) m_ti[nTrack - 1] = nInfo; }
- void SetDiscCDTextInformation( xbmc_cdtext_t cdtext ) { m_cdtext = cdtext; }
+ void SetTrackInformation(int nTrack, trackinfo nInfo)
+ {
+ if (nTrack > 0 && nTrack <= 99)
+ m_ti[nTrack - 1] = std::move(nInfo);
+ }
+ void SetDiscCDTextInformation(xbmc_cdtext_t cdtext) { m_cdtext = std::move(cdtext); }
void SetCddbDiscId( uint32_t ulCddbDiscId ) { m_ulCddbDiscId = ulCddbDiscId; }
void SetDiscLength( int nLength ) { m_nLength = nLength; }
diff --git a/xbmc/utils/ActorProtocol.h b/xbmc/utils/ActorProtocol.h
index 97297a6dde..7c6d41ebe5 100644
--- a/xbmc/utils/ActorProtocol.h
+++ b/xbmc/utils/ActorProtocol.h
@@ -14,6 +14,7 @@
#include <memory>
#include <queue>
#include <string>
+#include <utility>
class CEvent;
@@ -71,10 +72,11 @@ private:
class Protocol
{
public:
- Protocol(std::string name, CEvent* inEvent, CEvent *outEvent)
- :portName(name), containerInEvent(inEvent), containerOutEvent(outEvent) {}
- Protocol(std::string name)
- : Protocol(name, nullptr, nullptr) {}
+ Protocol(std::string name, CEvent* inEvent, CEvent* outEvent)
+ : portName(std::move(name)), containerInEvent(inEvent), containerOutEvent(outEvent)
+ {
+ }
+ Protocol(std::string name) : Protocol(std::move(name), nullptr, nullptr) {}
~Protocol();
Message *GetMessage();
void ReturnMessage(Message *msg);
diff --git a/xbmc/utils/BufferObjectFactory.cpp b/xbmc/utils/BufferObjectFactory.cpp
index 429b69dc3b..13ada4bac6 100644
--- a/xbmc/utils/BufferObjectFactory.cpp
+++ b/xbmc/utils/BufferObjectFactory.cpp
@@ -31,7 +31,7 @@ std::unique_ptr<CBufferObject> CBufferObjectFactory::CreateBufferObject(bool nee
}
void CBufferObjectFactory::RegisterBufferObject(
- std::function<std::unique_ptr<CBufferObject>()> createFunc)
+ const std::function<std::unique_ptr<CBufferObject>()>& createFunc)
{
m_bufferObjects.emplace_front(createFunc);
}
diff --git a/xbmc/utils/BufferObjectFactory.h b/xbmc/utils/BufferObjectFactory.h
index a466e840cd..1420129b66 100644
--- a/xbmc/utils/BufferObjectFactory.h
+++ b/xbmc/utils/BufferObjectFactory.h
@@ -35,7 +35,7 @@ public:
* @brief Registers a CBufferObject class to class to the factory.
*
*/
- static void RegisterBufferObject(std::function<std::unique_ptr<CBufferObject>()>);
+ static void RegisterBufferObject(const std::function<std::unique_ptr<CBufferObject>()>&);
/**
* @brief Clears the list of registered CBufferObject types
diff --git a/xbmc/utils/CharsetConverter.cpp b/xbmc/utils/CharsetConverter.cpp
index 8dffd65e1b..7613fa6c91 100644
--- a/xbmc/utils/CharsetConverter.cpp
+++ b/xbmc/utils/CharsetConverter.cpp
@@ -565,7 +565,7 @@ static struct SCharsetMapping
CCharsetConverter::CCharsetConverter() = default;
-void CCharsetConverter::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CCharsetConverter::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -860,7 +860,10 @@ bool CCharsetConverter::utf8logicalToVisualBiDi(const std::string& utf8StringSrc
return CInnerConverter::stdConvert(Utf32ToUtf8, utf32flipped, utf8StringDst, failOnBadString);
}
-void CCharsetConverter::SettingOptionsCharsetsFiller(SettingConstPtr setting, std::vector<StringSettingOption>& list, std::string& current, void *data)
+void CCharsetConverter::SettingOptionsCharsetsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
std::vector<std::string> vecCharsets = g_charsetConverter.getCharsetLabels();
sort(vecCharsets.begin(), vecCharsets.end(), sortstringbyname());
diff --git a/xbmc/utils/CharsetConverter.h b/xbmc/utils/CharsetConverter.h
index 1c7e0142c1..70a1e42479 100644
--- a/xbmc/utils/CharsetConverter.h
+++ b/xbmc/utils/CharsetConverter.h
@@ -23,7 +23,7 @@ class CCharsetConverter : public ISettingCallback
public:
CCharsetConverter();
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
static void reset();
static void resetSystemCharset();
@@ -156,7 +156,11 @@ public:
static bool toW(const std::string& stringSrc, std::wstring& wStringDst, const std::string& enc);
static bool fromW(const std::wstring& wStringSrc, std::string& stringDst, const std::string& enc);
- static void SettingOptionsCharsetsFiller(std::shared_ptr<const CSetting> setting, std::vector<StringSettingOption>& list, std::string& current, void *data);
+ static void SettingOptionsCharsetsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
+
private:
static void resetUserCharset(void);
static void resetSubtitleCharset(void);
diff --git a/xbmc/utils/CharsetDetection.cpp b/xbmc/utils/CharsetDetection.cpp
index 06a04168d2..ac8b3df3c8 100644
--- a/xbmc/utils/CharsetDetection.cpp
+++ b/xbmc/utils/CharsetDetection.cpp
@@ -584,7 +584,8 @@ size_t CCharsetDetection::GetHtmlAttribute(const std::string& htmlContent, size_
return std::string::npos; // rest of htmlContent was attribute value
}
-std::string CCharsetDetection::ExtractEncodingFromHtmlMeta(std::string metaContent, size_t pos /*= 0*/)
+std::string CCharsetDetection::ExtractEncodingFromHtmlMeta(const std::string& metaContent,
+ size_t pos /*= 0*/)
{
size_t len = metaContent.length();
if (pos >= len)
diff --git a/xbmc/utils/CharsetDetection.h b/xbmc/utils/CharsetDetection.h
index 1ff3905e5c..d1b9ba9d90 100644
--- a/xbmc/utils/CharsetDetection.h
+++ b/xbmc/utils/CharsetDetection.h
@@ -82,7 +82,7 @@ private:
static std::string GetHtmlEncodingFromHead(const std::string& htmlContent);
static size_t GetHtmlAttribute(const std::string& htmlContent, size_t pos, std::string& atrName, std::string& strValue);
- static std::string ExtractEncodingFromHtmlMeta(std::string metaContent, size_t pos = 0);
+ static std::string ExtractEncodingFromHtmlMeta(const std::string& metaContent, size_t pos = 0);
static bool checkConversion(const std::string& srcCharset, const std::string& src, std::string& dst);
static void appendCharAsAsciiUpperCase(std::string& str, const char chr);
diff --git a/xbmc/utils/JSONVariantParser.cpp b/xbmc/utils/JSONVariantParser.cpp
index f003cdfb10..48431d19e1 100644
--- a/xbmc/utils/JSONVariantParser.cpp
+++ b/xbmc/utils/JSONVariantParser.cpp
@@ -40,7 +40,7 @@ private:
return true;
}
- void PushObject(CVariant variant);
+ void PushObject(const CVariant& variant);
void PopObject();
CVariant& m_parsedObject;
@@ -146,7 +146,7 @@ bool CJSONVariantParserHandler::EndArray(rapidjson::SizeType elementCount)
return true;
}
-void CJSONVariantParserHandler::PushObject(CVariant variant)
+void CJSONVariantParserHandler::PushObject(const CVariant& variant)
{
if (m_status == PARSE_STATUS::Object)
{
diff --git a/xbmc/utils/RssManager.cpp b/xbmc/utils/RssManager.cpp
index 69cae01416..67b8f78ba9 100644
--- a/xbmc/utils/RssManager.cpp
+++ b/xbmc/utils/RssManager.cpp
@@ -56,7 +56,7 @@ void CRssManager::OnSettingsUnloaded()
Clear();
}
-void CRssManager::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CRssManager::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
diff --git a/xbmc/utils/RssManager.h b/xbmc/utils/RssManager.h
index 399cfa48a5..2b807d739f 100644
--- a/xbmc/utils/RssManager.h
+++ b/xbmc/utils/RssManager.h
@@ -35,7 +35,7 @@ public:
void OnSettingsLoaded() override;
void OnSettingsUnloaded() override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
void Start();
void Stop();
diff --git a/xbmc/utils/ScraperUrl.cpp b/xbmc/utils/ScraperUrl.cpp
index f242a40f57..43df6dd6eb 100644
--- a/xbmc/utils/ScraperUrl.cpp
+++ b/xbmc/utils/ScraperUrl.cpp
@@ -31,9 +31,9 @@ CScraperUrl::CScraperUrl() : m_relevance(0.0), m_parsed(false)
{
}
-CScraperUrl::CScraperUrl(std::string strUrl) : CScraperUrl()
+CScraperUrl::CScraperUrl(const std::string& strUrl) : CScraperUrl()
{
- ParseFromData(std::move(strUrl));
+ ParseFromData(strUrl);
}
CScraperUrl::CScraperUrl(const TiXmlElement* element) : CScraperUrl()
@@ -127,10 +127,10 @@ bool CScraperUrl::Parse()
auto dataToParse = m_data;
m_data.clear();
- return ParseFromData(std::move(dataToParse));
+ return ParseFromData(dataToParse);
}
-bool CScraperUrl::ParseFromData(std::string data)
+bool CScraperUrl::ParseFromData(const std::string& data)
{
if (data.empty())
return false;
@@ -209,7 +209,7 @@ bool CScraperUrl::ParseAndAppendUrl(const TiXmlElement* element)
// XML format is of strUrls is:
// <TAG><url>...</url>...</TAG> (parsed by ParseElement) or <url>...</url> (ditto)
-bool CScraperUrl::ParseAndAppendUrlsFromEpisodeGuide(std::string episodeGuide)
+bool CScraperUrl::ParseAndAppendUrlsFromEpisodeGuide(const std::string& episodeGuide)
{
if (episodeGuide.empty())
return false;
@@ -239,11 +239,11 @@ bool CScraperUrl::ParseAndAppendUrlsFromEpisodeGuide(std::string episodeGuide)
return true;
}
-void CScraperUrl::AddParsedUrl(std::string url,
- std::string aspect,
- std::string preview,
- std::string referrer,
- std::string cache,
+void CScraperUrl::AddParsedUrl(const std::string& url,
+ const std::string& aspect,
+ const std::string& preview,
+ const std::string& referrer,
+ const std::string& cache,
bool post,
bool isgz,
int season)
diff --git a/xbmc/utils/ScraperUrl.h b/xbmc/utils/ScraperUrl.h
index f6c13bacf7..c68aa3b076 100644
--- a/xbmc/utils/ScraperUrl.h
+++ b/xbmc/utils/ScraperUrl.h
@@ -45,7 +45,7 @@ public:
};
CScraperUrl();
- explicit CScraperUrl(std::string strUrl);
+ explicit CScraperUrl(const std::string& strUrl);
explicit CScraperUrl(const TiXmlElement* element);
~CScraperUrl();
@@ -87,14 +87,14 @@ public:
bool unique = false) const;
bool Parse();
- bool ParseFromData(std::string data); // copies by intention
+ bool ParseFromData(const std::string& data); // copies by intention
bool ParseAndAppendUrl(const TiXmlElement* element);
- bool ParseAndAppendUrlsFromEpisodeGuide(std::string episodeGuide); // copies by intention
- void AddParsedUrl(std::string url,
- std::string aspect = "",
- std::string preview = "",
- std::string referrer = "",
- std::string cache = "",
+ bool ParseAndAppendUrlsFromEpisodeGuide(const std::string& episodeGuide); // copies by intention
+ void AddParsedUrl(const std::string& url,
+ const std::string& aspect = "",
+ const std::string& preview = "",
+ const std::string& referrer = "",
+ const std::string& cache = "",
bool post = false,
bool isgz = false,
int season = -1);
diff --git a/xbmc/utils/Screenshot.cpp b/xbmc/utils/Screenshot.cpp
index 8e37bc12ed..94b04859f1 100644
--- a/xbmc/utils/Screenshot.cpp
+++ b/xbmc/utils/Screenshot.cpp
@@ -26,7 +26,7 @@ using namespace XFILE;
std::vector<std::function<std::unique_ptr<IScreenshotSurface>()>> CScreenShot::m_screenShotSurfaces;
-void CScreenShot::Register(std::function<std::unique_ptr<IScreenshotSurface>()> createFunc)
+void CScreenShot::Register(const std::function<std::unique_ptr<IScreenshotSurface>()>& createFunc)
{
m_screenShotSurfaces.emplace_back(createFunc);
}
diff --git a/xbmc/utils/Screenshot.h b/xbmc/utils/Screenshot.h
index 8642ca3191..6c44558005 100644
--- a/xbmc/utils/Screenshot.h
+++ b/xbmc/utils/Screenshot.h
@@ -18,7 +18,7 @@
class CScreenShot
{
public:
- static void Register(std::function<std::unique_ptr<IScreenshotSurface>()> createFunc);
+ static void Register(const std::function<std::unique_ptr<IScreenshotSurface>()>& createFunc);
static void TakeScreenshot();
static void TakeScreenshot(const std::string &filename, bool sync);
diff --git a/xbmc/utils/StringUtils.cpp b/xbmc/utils/StringUtils.cpp
index 0d83181ab5..5a93035012 100644
--- a/xbmc/utils/StringUtils.cpp
+++ b/xbmc/utils/StringUtils.cpp
@@ -1778,7 +1778,7 @@ void StringUtils::Tokenize(const std::string& input, std::vector<std::string>& t
}
}
-uint64_t StringUtils::ToUint64(std::string str, uint64_t fallback) noexcept
+uint64_t StringUtils::ToUint64(const std::string& str, uint64_t fallback) noexcept
{
std::istringstream iss(str);
uint64_t result(fallback);
diff --git a/xbmc/utils/StringUtils.h b/xbmc/utils/StringUtils.h
index 6aab4cd1e6..dd0b107f82 100644
--- a/xbmc/utils/StringUtils.h
+++ b/xbmc/utils/StringUtils.h
@@ -374,7 +374,7 @@ public:
static void Tokenize(const std::string& input, std::vector<std::string>& tokens, const std::string& delimiters);
static std::vector<std::string> Tokenize(const std::string& input, const char delimiter);
static void Tokenize(const std::string& input, std::vector<std::string>& tokens, const char delimiter);
- static uint64_t ToUint64(std::string str, uint64_t fallback) noexcept;
+ static uint64_t ToUint64(const std::string& str, uint64_t fallback) noexcept;
/*!
* Returns bytes in a human readable format using the smallest unit that will fit `bytes` in at
diff --git a/xbmc/utils/TimeUtils.cpp b/xbmc/utils/TimeUtils.cpp
index 16d75b9fe6..369d5aadbf 100644
--- a/xbmc/utils/TimeUtils.cpp
+++ b/xbmc/utils/TimeUtils.cpp
@@ -95,7 +95,7 @@ CDateTime CTimeUtils::GetLocalTime(time_t time)
return result;
}
-std::string CTimeUtils::WithoutSeconds(const std::string hhmmss)
+std::string CTimeUtils::WithoutSeconds(const std::string& hhmmss)
{
return hhmmss.substr(0, 5);
}
diff --git a/xbmc/utils/TimeUtils.h b/xbmc/utils/TimeUtils.h
index 078753e7ff..d7740d7c57 100644
--- a/xbmc/utils/TimeUtils.h
+++ b/xbmc/utils/TimeUtils.h
@@ -38,7 +38,8 @@ public:
* @brief Returns a time string without seconds, i.e: HH:MM
* @param hhmmss Time string in the format HH:MM:SS
*/
- static std::string WithoutSeconds(const std::string hhmmss);
+ static std::string WithoutSeconds(const std::string& hhmmss);
+
private:
static unsigned int frameTime;
};
diff --git a/xbmc/utils/log.cpp b/xbmc/utils/log.cpp
index b1f221380d..2fb00fa0ee 100644
--- a/xbmc/utils/log.cpp
+++ b/xbmc/utils/log.cpp
@@ -69,7 +69,7 @@ void CLog::OnSettingsLoaded()
SetComponentLogLevel(settings->GetList(CSettings::SETTING_DEBUG_SETEXTRALOGLEVEL));
}
-void CLog::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CLog::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -141,7 +141,7 @@ void CLog::Uninitialize()
settingsManager->UnregisterCallback(this);
// flush all loggers
- spdlog::apply_all([](std::shared_ptr<spdlog::logger> logger) { logger->flush(); });
+ spdlog::apply_all([](const std::shared_ptr<spdlog::logger>& logger) { logger->flush(); });
// flush the file sink
m_fileSink->flush();
@@ -190,7 +190,7 @@ bool CLog::CanLogComponent(uint32_t component) const
return ((m_componentLogLevels & component) == component);
}
-void CLog::SettingOptionsLoggingComponentsFiller(SettingConstPtr setting,
+void CLog::SettingOptionsLoggingComponentsFiller(const SettingConstPtr& setting,
std::vector<IntegerSettingOption>& list,
int& current,
void* data)
diff --git a/xbmc/utils/log.h b/xbmc/utils/log.h
index 7287918453..9809f85acf 100644
--- a/xbmc/utils/log.h
+++ b/xbmc/utils/log.h
@@ -46,7 +46,7 @@ public:
void OnSettingsLoaded() override;
// implementation of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
void Initialize(const std::string& path);
void Uninitialize();
@@ -56,7 +56,7 @@ public:
bool IsLogLevelLogged(int loglevel);
bool CanLogComponent(uint32_t component) const;
- static void SettingOptionsLoggingComponentsFiller(std::shared_ptr<const CSetting> setting,
+ static void SettingOptionsLoggingComponentsFiller(const std::shared_ptr<const CSetting>& setting,
std::vector<IntegerSettingOption>& list,
int& current,
void* data);
diff --git a/xbmc/video/ContextMenus.cpp b/xbmc/video/ContextMenus.cpp
index c0de0360bc..f9684d1b96 100644
--- a/xbmc/video/ContextMenus.cpp
+++ b/xbmc/video/ContextMenus.cpp
@@ -21,11 +21,15 @@
#include "video/windows/GUIWindowVideoBase.h"
#include "view/GUIViewState.h"
+#include <utility>
+
namespace CONTEXTMENU
{
CVideoInfo::CVideoInfo(MediaType mediaType)
- : CStaticContextMenuAction(19033), m_mediaType(mediaType) {}
+ : CStaticContextMenuAction(19033), m_mediaType(std::move(mediaType))
+{
+}
bool CVideoInfo::IsVisible(const CFileItem& item) const
{
diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp
index b04a803fe8..4331f0fd3b 100644
--- a/xbmc/video/VideoDatabase.cpp
+++ b/xbmc/video/VideoDatabase.cpp
@@ -6060,7 +6060,7 @@ void CVideoDatabase::EraseAllVideoSettings()
}
}
-void CVideoDatabase::EraseAllVideoSettings(std::string path)
+void CVideoDatabase::EraseAllVideoSettings(const std::string& path)
{
std::string itemsToDelete;
@@ -10546,7 +10546,7 @@ std::string CVideoDatabase::GetSafeFile(const std::string &dir, const std::strin
return URIUtils::AddFileToFolder(dir, CUtil::MakeLegalFileName(safeThumb));
}
-void CVideoDatabase::AnnounceRemove(std::string content, int id, bool scanning /* = false */)
+void CVideoDatabase::AnnounceRemove(const std::string& content, int id, bool scanning /* = false */)
{
CVariant data;
data["type"] = content;
@@ -10556,7 +10556,7 @@ void CVideoDatabase::AnnounceRemove(std::string content, int id, bool scanning /
CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::VideoLibrary, "OnRemove", data);
}
-void CVideoDatabase::AnnounceUpdate(std::string content, int id)
+void CVideoDatabase::AnnounceUpdate(const std::string& content, int id)
{
CVariant data;
data["type"] = content;
diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h
index ade34df2d8..f22155d922 100644
--- a/xbmc/video/VideoDatabase.h
+++ b/xbmc/video/VideoDatabase.h
@@ -605,7 +605,7 @@ public:
* Erases video settings for files starting with path
* @param path pattern
*/
- void EraseAllVideoSettings(std::string path);
+ void EraseAllVideoSettings(const std::string& path);
bool GetStackTimes(const std::string &filePath, std::vector<uint64_t> &times);
void SetStackTimes(const std::string &filePath, const std::vector<uint64_t> &times);
@@ -1014,6 +1014,6 @@ private:
std::vector<int> CleanMediaType(const std::string &mediaType, const std::string &cleanableFileIDs,
std::map<int, bool> &pathsDeleteDecisions, std::string &deletedFileIDs, bool silent);
- static void AnnounceRemove(std::string content, int id, bool scanning = false);
- static void AnnounceUpdate(std::string content, int id);
+ static void AnnounceRemove(const std::string& content, int id, bool scanning = false);
+ static void AnnounceUpdate(const std::string& content, int id);
};
diff --git a/xbmc/video/VideoInfoTag.cpp b/xbmc/video/VideoInfoTag.cpp
index 5537bc7639..bab6ce7c46 100644
--- a/xbmc/video/VideoInfoTag.cpp
+++ b/xbmc/video/VideoInfoTag.cpp
@@ -1390,13 +1390,13 @@ void CVideoInfoTag::SetVotes(int votes, const std::string& type /* = "" */)
m_ratings[type].votes = votes;
}
-void CVideoInfoTag::SetPremiered(CDateTime premiered)
+void CVideoInfoTag::SetPremiered(const CDateTime& premiered)
{
m_premiered = premiered;
m_bHasPremiered = premiered.IsValid();
}
-void CVideoInfoTag::SetPremieredFromDBDate(std::string premieredString)
+void CVideoInfoTag::SetPremieredFromDBDate(const std::string& premieredString)
{
CDateTime premiered;
premiered.SetFromDBDate(premieredString);
diff --git a/xbmc/video/VideoInfoTag.h b/xbmc/video/VideoInfoTag.h
index 1415577dc7..97b6b2b3bb 100644
--- a/xbmc/video/VideoInfoTag.h
+++ b/xbmc/video/VideoInfoTag.h
@@ -137,8 +137,8 @@ public:
void SetRatings(RatingMap ratings);
void SetVotes(int votes, const std::string& type = "");
void SetUniqueIDs(std::map<std::string, std::string> uniqueIDs);
- void SetPremiered(CDateTime premiered);
- void SetPremieredFromDBDate(std::string premieredString);
+ void SetPremiered(const CDateTime& premiered);
+ void SetPremieredFromDBDate(const std::string& premieredString);
void SetYear(int year);
void SetArtist(std::vector<std::string> artist);
void SetSet(std::string set);
diff --git a/xbmc/video/VideoLibraryQueue.cpp b/xbmc/video/VideoLibraryQueue.cpp
index e2a488b658..00230f262c 100644
--- a/xbmc/video/VideoLibraryQueue.cpp
+++ b/xbmc/video/VideoLibraryQueue.cpp
@@ -116,7 +116,8 @@ void CVideoLibraryQueue::CleanLibraryModal(const std::set<int>& paths /* = std::
void CVideoLibraryQueue::RefreshItem(CFileItemPtr item, bool ignoreNfo /* = false */, bool forceRefresh /* = true */, bool refreshAll /* = false */, const std::string& searchTitle /* = "" */)
{
- AddJob(new CVideoLibraryRefreshingJob(item, forceRefresh, refreshAll, ignoreNfo, searchTitle));
+ AddJob(new CVideoLibraryRefreshingJob(std::move(item), forceRefresh, refreshAll, ignoreNfo,
+ searchTitle));
}
bool CVideoLibraryQueue::RefreshItemModal(CFileItemPtr item, bool forceRefresh /* = true */, bool refreshAll /* = false */)
@@ -126,7 +127,7 @@ bool CVideoLibraryQueue::RefreshItemModal(CFileItemPtr item, bool forceRefresh /
return false;
m_modal = true;
- CVideoLibraryRefreshingJob refreshingJob(item, forceRefresh, refreshAll);
+ CVideoLibraryRefreshingJob refreshingJob(std::move(item), forceRefresh, refreshAll);
bool result = refreshingJob.DoModal();
m_modal = false;
@@ -142,7 +143,7 @@ void CVideoLibraryQueue::MarkAsWatched(const CFileItemPtr &item, bool watched)
AddJob(new CVideoLibraryMarkWatchedJob(item, watched));
}
-void CVideoLibraryQueue::ResetResumePoint(const CFileItemPtr item)
+void CVideoLibraryQueue::ResetResumePoint(const CFileItemPtr& item)
{
if (item == nullptr)
return;
diff --git a/xbmc/video/VideoLibraryQueue.h b/xbmc/video/VideoLibraryQueue.h
index 328c132da6..57b17ec392 100644
--- a/xbmc/video/VideoLibraryQueue.h
+++ b/xbmc/video/VideoLibraryQueue.h
@@ -105,7 +105,7 @@ public:
\param[in] item Item to reset the resume point for
*/
- void ResetResumePoint(const CFileItemPtr item);
+ void ResetResumePoint(const CFileItemPtr& item);
/*!
\brief Adds the given job to the queue.
diff --git a/xbmc/video/VideoThumbLoader.cpp b/xbmc/video/VideoThumbLoader.cpp
index ac3edf950a..cef753f4ff 100644
--- a/xbmc/video/VideoThumbLoader.cpp
+++ b/xbmc/video/VideoThumbLoader.cpp
@@ -232,7 +232,7 @@ std::vector<std::string> GetSettingListAsString(const std::string& settingID)
CServiceBroker::GetSettingsComponent()->GetSettings()->GetList(settingID);
std::vector<std::string> result;
std::transform(values.begin(), values.end(), std::back_inserter(result),
- [](CVariant s) { return s.asString(); });
+ [](const CVariant& s) { return s.asString(); });
return result;
}
diff --git a/xbmc/video/ViewModeSettings.cpp b/xbmc/video/ViewModeSettings.cpp
index 860752261b..387bdd9f2b 100644
--- a/xbmc/video/ViewModeSettings.cpp
+++ b/xbmc/video/ViewModeSettings.cpp
@@ -88,7 +88,10 @@ int CViewModeSettings::GetViewModeStringIndex(int viewMode)
/** Fills the list with all visible view modes
*/
-void CViewModeSettings::ViewModesFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CViewModeSettings::ViewModesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
// Add all appropriate view modes to the list control
for (const auto &item : viewModes)
diff --git a/xbmc/video/ViewModeSettings.h b/xbmc/video/ViewModeSettings.h
index 1a08988b1e..b43ed85dc1 100644
--- a/xbmc/video/ViewModeSettings.h
+++ b/xbmc/video/ViewModeSettings.h
@@ -39,6 +39,8 @@ public:
/** Fills the list with all visible view modes
*/
- static void ViewModesFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
-
+ static void ViewModesFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
};
diff --git a/xbmc/video/dialogs/GUIDialogAudioSettings.cpp b/xbmc/video/dialogs/GUIDialogAudioSettings.cpp
index 2fa630b073..1e36c6de35 100644
--- a/xbmc/video/dialogs/GUIDialogAudioSettings.cpp
+++ b/xbmc/video/dialogs/GUIDialogAudioSettings.cpp
@@ -89,7 +89,7 @@ std::string CGUIDialogAudioSettings::FormatPercentAsDecibel(float value)
return StringUtils::Format(g_localizeStrings.Get(14054).c_str(), CAEUtil::PercentToGain(value));
}
-void CGUIDialogAudioSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogAudioSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -134,7 +134,7 @@ void CGUIDialogAudioSettings::OnSettingChanged(std::shared_ptr<const CSetting> s
}
}
-void CGUIDialogAudioSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CGUIDialogAudioSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -285,7 +285,8 @@ bool CGUIDialogAudioSettings::SupportsAudioFeature(int feature)
return false;
}
-void CGUIDialogAudioSettings::AddAudioStreams(std::shared_ptr<CSettingGroup> group, const std::string &settingId)
+void CGUIDialogAudioSettings::AddAudioStreams(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& settingId)
{
if (group == NULL || settingId.empty())
return;
@@ -297,12 +298,18 @@ void CGUIDialogAudioSettings::AddAudioStreams(std::shared_ptr<CSettingGroup> gro
AddList(group, settingId, 460, SettingLevel::Basic, m_audioStream, AudioStreamsOptionFiller, 460);
}
-bool CGUIDialogAudioSettings::IsPlayingPassthrough(const std::string &condition, const std::string &value, SettingConstPtr setting, void *data)
+bool CGUIDialogAudioSettings::IsPlayingPassthrough(const std::string& condition,
+ const std::string& value,
+ const SettingConstPtr& setting,
+ void* data)
{
return g_application.GetAppPlayer().IsPassthrough();
}
-void CGUIDialogAudioSettings::AudioStreamsOptionFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CGUIDialogAudioSettings::AudioStreamsOptionFiller(const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
int audioStreamCount = g_application.GetAppPlayer().GetAudioStreamCount();
@@ -338,7 +345,12 @@ void CGUIDialogAudioSettings::AudioStreamsOptionFiller(SettingConstPtr setting,
}
}
-std::string CGUIDialogAudioSettings::SettingFormatterDelay(std::shared_ptr<const CSettingControlSlider> control, const CVariant &value, const CVariant &minimum, const CVariant &step, const CVariant &maximum)
+std::string CGUIDialogAudioSettings::SettingFormatterDelay(
+ const std::shared_ptr<const CSettingControlSlider>& control,
+ const CVariant& value,
+ const CVariant& minimum,
+ const CVariant& step,
+ const CVariant& maximum)
{
if (!value.isDouble())
return "";
@@ -354,7 +366,12 @@ std::string CGUIDialogAudioSettings::SettingFormatterDelay(std::shared_ptr<const
return StringUtils::Format(g_localizeStrings.Get(22005).c_str(), fValue);
}
-std::string CGUIDialogAudioSettings::SettingFormatterPercentAsDecibel(std::shared_ptr<const CSettingControlSlider> control, const CVariant &value, const CVariant &minimum, const CVariant &step, const CVariant &maximum)
+std::string CGUIDialogAudioSettings::SettingFormatterPercentAsDecibel(
+ const std::shared_ptr<const CSettingControlSlider>& control,
+ const CVariant& value,
+ const CVariant& minimum,
+ const CVariant& step,
+ const CVariant& maximum)
{
if (control == NULL || !value.isDouble())
return "";
diff --git a/xbmc/video/dialogs/GUIDialogAudioSettings.h b/xbmc/video/dialogs/GUIDialogAudioSettings.h
index ea0fb12446..3a66d8e7e4 100644
--- a/xbmc/video/dialogs/GUIDialogAudioSettings.h
+++ b/xbmc/video/dialogs/GUIDialogAudioSettings.h
@@ -33,8 +33,8 @@ public:
protected:
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
@@ -46,14 +46,30 @@ protected:
bool SupportsAudioFeature(int feature);
- void AddAudioStreams(std::shared_ptr<CSettingGroup> group, const std::string &settingId);
-
- static bool IsPlayingPassthrough(const std::string &condition, const std::string &value, std::shared_ptr<const CSetting> setting, void *data);
-
- static void AudioStreamsOptionFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
-
- static std::string SettingFormatterDelay(std::shared_ptr<const CSettingControlSlider> control, const CVariant &value, const CVariant &minimum, const CVariant &step, const CVariant &maximum);
- static std::string SettingFormatterPercentAsDecibel(std::shared_ptr<const CSettingControlSlider> control, const CVariant &value, const CVariant &minimum, const CVariant &step, const CVariant &maximum);
+ void AddAudioStreams(const std::shared_ptr<CSettingGroup>& group, const std::string& settingId);
+
+ static bool IsPlayingPassthrough(const std::string& condition,
+ const std::string& value,
+ const std::shared_ptr<const CSetting>& setting,
+ void* data);
+
+ static void AudioStreamsOptionFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+
+ static std::string SettingFormatterDelay(
+ const std::shared_ptr<const CSettingControlSlider>& control,
+ const CVariant& value,
+ const CVariant& minimum,
+ const CVariant& step,
+ const CVariant& maximum);
+ static std::string SettingFormatterPercentAsDecibel(
+ const std::shared_ptr<const CSettingControlSlider>& control,
+ const CVariant& value,
+ const CVariant& minimum,
+ const CVariant& step,
+ const CVariant& maximum);
float m_volume;
int m_audioStream;
diff --git a/xbmc/video/dialogs/GUIDialogCMSSettings.cpp b/xbmc/video/dialogs/GUIDialogCMSSettings.cpp
index d3fa1c183c..e2e298d80c 100644
--- a/xbmc/video/dialogs/GUIDialogCMSSettings.cpp
+++ b/xbmc/video/dialogs/GUIDialogCMSSettings.cpp
@@ -171,7 +171,7 @@ void CGUIDialogCMSSettings::InitializeSettings()
settingCmsLutSize->SetDependencies(depsCmsIcc);
}
-void CGUIDialogCMSSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogCMSSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -209,11 +209,10 @@ void CGUIDialogCMSSettings::Save()
CServiceBroker::GetSettingsComponent()->GetSettings()->Save();
}
-void CGUIDialogCMSSettings::Cms3dLutsFiller(
- SettingConstPtr setting,
- std::vector<StringSettingOption> &list,
- std::string &current,
- void *data)
+void CGUIDialogCMSSettings::Cms3dLutsFiller(const SettingConstPtr& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data)
{
// get 3dLut directory from settings
CFileItemList items;
diff --git a/xbmc/video/dialogs/GUIDialogCMSSettings.h b/xbmc/video/dialogs/GUIDialogCMSSettings.h
index 71c7ba4046..67614f54de 100644
--- a/xbmc/video/dialogs/GUIDialogCMSSettings.h
+++ b/xbmc/video/dialogs/GUIDialogCMSSettings.h
@@ -20,7 +20,7 @@ public:
protected:
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
@@ -32,9 +32,8 @@ protected:
void InitializeSettings() override;
private:
- static void Cms3dLutsFiller(
- std::shared_ptr<const CSetting> setting,
- std::vector<StringSettingOption> &list,
- std::string &current,
- void *data);
+ static void Cms3dLutsFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<StringSettingOption>& list,
+ std::string& current,
+ void* data);
};
diff --git a/xbmc/video/dialogs/GUIDialogSubtitleSettings.cpp b/xbmc/video/dialogs/GUIDialogSubtitleSettings.cpp
index ad2770715b..ab5a27b39e 100644
--- a/xbmc/video/dialogs/GUIDialogSubtitleSettings.cpp
+++ b/xbmc/video/dialogs/GUIDialogSubtitleSettings.cpp
@@ -80,7 +80,7 @@ bool CGUIDialogSubtitleSettings::OnMessage(CGUIMessage& message)
return CGUIDialogSettingsManualBase::OnMessage(message);
}
-void CGUIDialogSubtitleSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogSubtitleSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -154,7 +154,7 @@ std::string CGUIDialogSubtitleSettings::BrowseForSubtitle()
return "";
}
-void CGUIDialogSubtitleSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CGUIDialogSubtitleSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -296,7 +296,8 @@ bool CGUIDialogSubtitleSettings::SupportsSubtitleFeature(int feature)
return false;
}
-void CGUIDialogSubtitleSettings::AddSubtitleStreams(std::shared_ptr<CSettingGroup> group, const std::string &settingId)
+void CGUIDialogSubtitleSettings::AddSubtitleStreams(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& settingId)
{
if (group == NULL || settingId.empty())
return;
@@ -308,7 +309,11 @@ void CGUIDialogSubtitleSettings::AddSubtitleStreams(std::shared_ptr<CSettingGrou
m_subtitleStreamSetting = AddList(group, settingId, 462, SettingLevel::Basic, m_subtitleStream, SubtitleStreamsOptionFiller, 462);
}
-void CGUIDialogSubtitleSettings::SubtitleStreamsOptionFiller(SettingConstPtr setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CGUIDialogSubtitleSettings::SubtitleStreamsOptionFiller(
+ const SettingConstPtr& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
int subtitleStreamCount = g_application.GetAppPlayer().GetSubtitleCount();
@@ -343,7 +348,12 @@ void CGUIDialogSubtitleSettings::SubtitleStreamsOptionFiller(SettingConstPtr set
}
}
-std::string CGUIDialogSubtitleSettings::SettingFormatterDelay(std::shared_ptr<const CSettingControlSlider> control, const CVariant &value, const CVariant &minimum, const CVariant &step, const CVariant &maximum)
+std::string CGUIDialogSubtitleSettings::SettingFormatterDelay(
+ const std::shared_ptr<const CSettingControlSlider>& control,
+ const CVariant& value,
+ const CVariant& minimum,
+ const CVariant& step,
+ const CVariant& maximum)
{
if (!value.isDouble())
return "";
diff --git a/xbmc/video/dialogs/GUIDialogSubtitleSettings.h b/xbmc/video/dialogs/GUIDialogSubtitleSettings.h
index ac7436fa6e..1c14938368 100644
--- a/xbmc/video/dialogs/GUIDialogSubtitleSettings.h
+++ b/xbmc/video/dialogs/GUIDialogSubtitleSettings.h
@@ -32,8 +32,8 @@ public:
protected:
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
@@ -46,7 +46,8 @@ protected:
private:
bool SupportsSubtitleFeature(int feature);
- void AddSubtitleStreams(std::shared_ptr<CSettingGroup> group, const std::string &settingId);
+ void AddSubtitleStreams(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& settingId);
int m_subtitleStream;
bool m_subtitleVisible;
@@ -55,7 +56,15 @@ private:
std::vector<int> m_subtitleCapabilities;
static std::string FormatFlags(StreamFlags flags);
- static void SubtitleStreamsOptionFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
-
- static std::string SettingFormatterDelay(std::shared_ptr<const CSettingControlSlider> control, const CVariant &value, const CVariant &minimum, const CVariant &step, const CVariant &maximum);
+ static void SubtitleStreamsOptionFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+
+ static std::string SettingFormatterDelay(
+ const std::shared_ptr<const CSettingControlSlider>& control,
+ const CVariant& value,
+ const CVariant& minimum,
+ const CVariant& step,
+ const CVariant& maximum);
};
diff --git a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp
index d1423a5d0f..759358b420 100644
--- a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp
@@ -64,7 +64,7 @@ CGUIDialogVideoSettings::CGUIDialogVideoSettings()
CGUIDialogVideoSettings::~CGUIDialogVideoSettings() = default;
-void CGUIDialogVideoSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CGUIDialogVideoSettings::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -201,7 +201,7 @@ void CGUIDialogVideoSettings::OnSettingChanged(std::shared_ptr<const CSetting> s
}
}
-void CGUIDialogVideoSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CGUIDialogVideoSettings::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -426,7 +426,8 @@ void CGUIDialogVideoSettings::InitializeSettings()
AddButton(groupSaveAsDefault, SETTING_VIDEO_CALIBRATION, 214, SettingLevel::Basic);
}
-void CGUIDialogVideoSettings::AddVideoStreams(std::shared_ptr<CSettingGroup> group, const std::string &settingId)
+void CGUIDialogVideoSettings::AddVideoStreams(const std::shared_ptr<CSettingGroup>& group,
+ const std::string& settingId)
{
if (group == NULL || settingId.empty())
return;
@@ -438,7 +439,11 @@ void CGUIDialogVideoSettings::AddVideoStreams(std::shared_ptr<CSettingGroup> gro
AddList(group, settingId, 38031, SettingLevel::Basic, m_videoStream, VideoStreamsOptionFiller, 38031);
}
-void CGUIDialogVideoSettings::VideoStreamsOptionFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CGUIDialogVideoSettings::VideoStreamsOptionFiller(
+ const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
int videoStreamCount = g_application.GetAppPlayer().GetVideoStreamCount();
@@ -487,7 +492,10 @@ void CGUIDialogVideoSettings::VideoStreamsOptionFiller(std::shared_ptr<const CSe
}
}
-void CGUIDialogVideoSettings::VideoOrientationFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data)
+void CGUIDialogVideoSettings::VideoOrientationFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data)
{
list.emplace_back(g_localizeStrings.Get(687), 0);
list.emplace_back(g_localizeStrings.Get(35229), 90);
diff --git a/xbmc/video/dialogs/GUIDialogVideoSettings.h b/xbmc/video/dialogs/GUIDialogVideoSettings.h
index 2cf5af8ef9..dd1e1f5fa2 100644
--- a/xbmc/video/dialogs/GUIDialogVideoSettings.h
+++ b/xbmc/video/dialogs/GUIDialogVideoSettings.h
@@ -25,13 +25,19 @@ public:
protected:
// implementations of ISettingCallback
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
-
- void AddVideoStreams(std::shared_ptr<CSettingGroup> group, const std::string & settingId);
- static void VideoStreamsOptionFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
-
- static void VideoOrientationFiller(std::shared_ptr<const CSetting> setting, std::vector<IntegerSettingOption> &list, int &current, void *data);
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
+
+ void AddVideoStreams(const std::shared_ptr<CSettingGroup>& group, const std::string& settingId);
+ static void VideoStreamsOptionFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
+
+ static void VideoOrientationFiller(const std::shared_ptr<const CSetting>& setting,
+ std::vector<IntegerSettingOption>& list,
+ int& current,
+ void* data);
static std::string FormatFlags(StreamFlags flags);
diff --git a/xbmc/video/jobs/VideoLibraryRefreshingJob.cpp b/xbmc/video/jobs/VideoLibraryRefreshingJob.cpp
index cc42552317..9737e1a797 100644
--- a/xbmc/video/jobs/VideoLibraryRefreshingJob.cpp
+++ b/xbmc/video/jobs/VideoLibraryRefreshingJob.cpp
@@ -30,12 +30,18 @@
#include "video/tags/VideoInfoTagLoaderFactory.h"
#include "video/tags/VideoTagLoaderPlugin.h"
+#include <utility>
+
using namespace KODI::MESSAGING;
using namespace VIDEO;
-CVideoLibraryRefreshingJob::CVideoLibraryRefreshingJob(CFileItemPtr item, bool forceRefresh, bool refreshAll, bool ignoreNfo /* = false */, const std::string& searchTitle /* = "" */)
+CVideoLibraryRefreshingJob::CVideoLibraryRefreshingJob(CFileItemPtr item,
+ bool forceRefresh,
+ bool refreshAll,
+ bool ignoreNfo /* = false */,
+ const std::string& searchTitle /* = "" */)
: CVideoLibraryProgressJob(nullptr),
- m_item(item),
+ m_item(std::move(item)),
m_forceRefresh(forceRefresh),
m_refreshAll(refreshAll),
m_ignoreNfo(ignoreNfo),
diff --git a/xbmc/video/jobs/VideoLibraryResetResumePointJob.cpp b/xbmc/video/jobs/VideoLibraryResetResumePointJob.cpp
index d3dec07546..52fdbf8e44 100644
--- a/xbmc/video/jobs/VideoLibraryResetResumePointJob.cpp
+++ b/xbmc/video/jobs/VideoLibraryResetResumePointJob.cpp
@@ -24,7 +24,7 @@
#include "utils/URIUtils.h"
#include "video/VideoDatabase.h"
-CVideoLibraryResetResumePointJob::CVideoLibraryResetResumePointJob(const CFileItemPtr item)
+CVideoLibraryResetResumePointJob::CVideoLibraryResetResumePointJob(const CFileItemPtr& item)
: m_item(item)
{
}
diff --git a/xbmc/video/jobs/VideoLibraryResetResumePointJob.h b/xbmc/video/jobs/VideoLibraryResetResumePointJob.h
index d9403b4575..367f37c61f 100644
--- a/xbmc/video/jobs/VideoLibraryResetResumePointJob.h
+++ b/xbmc/video/jobs/VideoLibraryResetResumePointJob.h
@@ -22,7 +22,7 @@ public:
\param[in] item Item for that the resume point shall be reset.
*/
- CVideoLibraryResetResumePointJob(const CFileItemPtr item);
+ CVideoLibraryResetResumePointJob(const CFileItemPtr& item);
~CVideoLibraryResetResumePointJob() override = default;
const char *GetType() const override { return "CVideoLibraryResetResumePointJob"; }
diff --git a/xbmc/video/tags/IVideoInfoTagLoader.h b/xbmc/video/tags/IVideoInfoTagLoader.h
index b6180721f4..8afc31ec85 100644
--- a/xbmc/video/tags/IVideoInfoTagLoader.h
+++ b/xbmc/video/tags/IVideoInfoTagLoader.h
@@ -12,6 +12,7 @@
#include "addons/Scraper.h"
#include <string>
+#include <utility>
class CFileItem;
class CVideoInfoTag;
@@ -28,9 +29,10 @@ public:
//! \param item The item to load info for
//! \param info Scraper info
//! \param llokInFolder True to look in folder holding file
- IVideoInfoTagLoader(const CFileItem& item,
- ADDON::ScraperPtr info,
- bool lookInFolder) : m_item(item), m_info(info) {}
+ IVideoInfoTagLoader(const CFileItem& item, ADDON::ScraperPtr info, bool lookInFolder)
+ : m_item(item), m_info(std::move(info))
+ {
+ }
virtual ~IVideoInfoTagLoader() = default;
//! \brief Returns true if we have info to provide.
diff --git a/xbmc/video/tags/VideoInfoTagLoaderFactory.cpp b/xbmc/video/tags/VideoInfoTagLoaderFactory.cpp
index 4760724332..00ed67a528 100644
--- a/xbmc/video/tags/VideoInfoTagLoaderFactory.cpp
+++ b/xbmc/video/tags/VideoInfoTagLoaderFactory.cpp
@@ -19,7 +19,7 @@
using namespace VIDEO;
IVideoInfoTagLoader* CVideoInfoTagLoaderFactory::CreateLoader(const CFileItem& item,
- ADDON::ScraperPtr info,
+ const ADDON::ScraperPtr& info,
bool lookInFolder,
bool forceRefresh)
{
diff --git a/xbmc/video/tags/VideoInfoTagLoaderFactory.h b/xbmc/video/tags/VideoInfoTagLoaderFactory.h
index 0e000ef9d7..9b8861f575 100644
--- a/xbmc/video/tags/VideoInfoTagLoaderFactory.h
+++ b/xbmc/video/tags/VideoInfoTagLoaderFactory.h
@@ -22,7 +22,7 @@ namespace VIDEO
//! \param item The item to find tag loader for
//! \param type Type of tag loader. In particular used for tvshows
static IVideoInfoTagLoader* CreateLoader(const CFileItem& item,
- ADDON::ScraperPtr info,
+ const ADDON::ScraperPtr& info,
bool lookInFolder,
bool forceRefresh = false);
diff --git a/xbmc/video/tags/VideoTagLoaderNFO.cpp b/xbmc/video/tags/VideoTagLoaderNFO.cpp
index e85e62d4f4..d80f41630b 100644
--- a/xbmc/video/tags/VideoTagLoaderNFO.cpp
+++ b/xbmc/video/tags/VideoTagLoaderNFO.cpp
@@ -18,12 +18,14 @@
#include "utils/log.h"
#include "video/VideoInfoTag.h"
+#include <utility>
+
using namespace XFILE;
CVideoTagLoaderNFO::CVideoTagLoaderNFO(const CFileItem& item,
ADDON::ScraperPtr info,
bool lookInFolder)
- : IVideoInfoTagLoader(item, info, lookInFolder)
+ : IVideoInfoTagLoader(item, std::move(info), lookInFolder)
{
if (m_info && m_info->Content() == CONTENT_TVSHOWS && m_item.m_bIsFolder)
m_path = URIUtils::AddFileToFolder(m_item.GetPath(), "tvshow.nfo");
diff --git a/xbmc/video/windows/GUIWindowVideoBase.cpp b/xbmc/video/windows/GUIWindowVideoBase.cpp
index 5c9e785551..e10db027fd 100644
--- a/xbmc/video/windows/GUIWindowVideoBase.cpp
+++ b/xbmc/video/windows/GUIWindowVideoBase.cpp
@@ -659,7 +659,7 @@ bool CGUIWindowVideoBase::OnSelect(int iItem)
return CGUIMediaWindow::OnSelect(iItem);
}
-bool CGUIWindowVideoBase::OnFileAction(int iItem, int action, std::string player)
+bool CGUIWindowVideoBase::OnFileAction(int iItem, int action, const std::string& player)
{
CFileItemPtr item = m_vecItems->Get(iItem);
@@ -1181,7 +1181,7 @@ bool CGUIWindowVideoBase::OnPlayMedia(int iItem, const std::string &player)
return true;
}
-bool CGUIWindowVideoBase::OnPlayAndQueueMedia(const CFileItemPtr &item, std::string player)
+bool CGUIWindowVideoBase::OnPlayAndQueueMedia(const CFileItemPtr& item, const std::string& player)
{
// Get the current playlist and make sure it is not shuffled
int iPlaylist = m_guiState->GetPlaylist();
@@ -1217,7 +1217,7 @@ void CGUIWindowVideoBase::OnDeleteItem(int iItem)
m_viewControl.SetSelectedItem(iItem);
}
-void CGUIWindowVideoBase::OnDeleteItem(CFileItemPtr item)
+void CGUIWindowVideoBase::OnDeleteItem(const CFileItemPtr& item)
{
// HACK: stacked files need to be treated as folders in order to be deleted
if (item->IsStack())
diff --git a/xbmc/video/windows/GUIWindowVideoBase.h b/xbmc/video/windows/GUIWindowVideoBase.h
index ba5e3f0843..9e4a90b1c5 100644
--- a/xbmc/video/windows/GUIWindowVideoBase.h
+++ b/xbmc/video/windows/GUIWindowVideoBase.h
@@ -86,7 +86,7 @@ protected:
void GetContextButtons(int itemNumber, CContextButtons &buttons) override;
bool OnContextButton(int itemNumber, CONTEXT_BUTTON button) override;
virtual void OnQueueItem(int iItem, bool first = false);
- virtual void OnDeleteItem(CFileItemPtr pItem);
+ virtual void OnDeleteItem(const CFileItemPtr& pItem);
void OnDeleteItem(int iItem) override;
virtual void DoSearch(const std::string& strSearch, CFileItemList& items) {};
std::string GetStartFolder(const std::string &dir) override;
@@ -103,13 +103,13 @@ protected:
\param action the action to perform
\return true if the action is performed, false otherwise
*/
- bool OnFileAction(int item, int action, std::string player);
+ bool OnFileAction(int item, int action, const std::string& player);
void OnRestartItem(int iItem, const std::string &player = "");
bool OnResumeItem(int iItem, const std::string &player = "");
void PlayItem(int iItem, const std::string &player = "");
bool OnPlayMedia(int iItem, const std::string &player = "") override;
- bool OnPlayAndQueueMedia(const CFileItemPtr &item, std::string player = "") override;
+ bool OnPlayAndQueueMedia(const CFileItemPtr& item, const std::string& player = "") override;
using CGUIMediaWindow::LoadPlayList;
void LoadPlayList(const std::string& strPlayList, int iPlayList = PLAYLIST_VIDEO);
diff --git a/xbmc/video/windows/GUIWindowVideoNav.cpp b/xbmc/video/windows/GUIWindowVideoNav.cpp
index fcbe0a81e1..8ee21cc75c 100644
--- a/xbmc/video/windows/GUIWindowVideoNav.cpp
+++ b/xbmc/video/windows/GUIWindowVideoNav.cpp
@@ -807,7 +807,7 @@ void CGUIWindowVideoNav::OnItemInfo(const CFileItem& fileItem, ADDON::ScraperPtr
CGUIWindowVideoBase::OnItemInfo(fileItem, scraper);
}
-void CGUIWindowVideoNav::OnDeleteItem(CFileItemPtr pItem)
+void CGUIWindowVideoNav::OnDeleteItem(const CFileItemPtr& pItem)
{
if (m_vecItems->IsParentFolder())
return;
diff --git a/xbmc/video/windows/GUIWindowVideoNav.h b/xbmc/video/windows/GUIWindowVideoNav.h
index cd3b6375c0..1e3288eea4 100644
--- a/xbmc/video/windows/GUIWindowVideoNav.h
+++ b/xbmc/video/windows/GUIWindowVideoNav.h
@@ -65,7 +65,7 @@ protected:
void UpdateButtons() override;
void DoSearch(const std::string& strSearch, CFileItemList& items) override;
virtual void PlayItem(int iItem);
- void OnDeleteItem(CFileItemPtr pItem) override;
+ void OnDeleteItem(const CFileItemPtr& pItem) override;
void GetContextButtons(int itemNumber, CContextButtons &buttons) override;
bool OnContextButton(int itemNumber, CONTEXT_BUTTON button) override;
bool OnAddMediaSource() override;
diff --git a/xbmc/view/GUIViewState.cpp b/xbmc/view/GUIViewState.cpp
index ecd39c9c27..9267cd85cb 100644
--- a/xbmc/view/GUIViewState.cpp
+++ b/xbmc/view/GUIViewState.cpp
@@ -553,7 +553,7 @@ void CGUIViewState::SaveViewToDb(const std::string &path, int windowID, CViewSta
settings->Save();
}
-void CGUIViewState::AddPlaylistOrder(const CFileItemList &items, LABEL_MASKS label_masks)
+void CGUIViewState::AddPlaylistOrder(const CFileItemList& items, const LABEL_MASKS& label_masks)
{
SortBy sortBy = SortByPlaylistOrder;
int sortLabel = 559;
diff --git a/xbmc/view/GUIViewState.h b/xbmc/view/GUIViewState.h
index 5d2b34dc25..84adf54017 100644
--- a/xbmc/view/GUIViewState.h
+++ b/xbmc/view/GUIViewState.h
@@ -73,7 +73,7 @@ protected:
\param items the list of items for the view state.
\param label_mask the label masks for formatting items.
*/
- void AddPlaylistOrder(const CFileItemList &items, LABEL_MASKS label_masks);
+ void AddPlaylistOrder(const CFileItemList& items, const LABEL_MASKS& label_masks);
void AddSortMethod(SortBy sortBy, int buttonLabel, const LABEL_MASKS &labelMasks, SortAttribute sortAttributes = SortAttributeNone, SortOrder sortOrder = SortOrderNone);
void AddSortMethod(SortBy sortBy, SortAttribute sortAttributes, int buttonLabel, const LABEL_MASKS &labelMasks, SortOrder sortOrder = SortOrderNone);
diff --git a/xbmc/weather/WeatherManager.cpp b/xbmc/weather/WeatherManager.cpp
index f9e2ba122f..18248116a6 100644
--- a/xbmc/weather/WeatherManager.cpp
+++ b/xbmc/weather/WeatherManager.cpp
@@ -149,7 +149,7 @@ void CWeatherManager::OnJobComplete(unsigned int jobID, bool success, CJob *job)
CInfoLoader::OnJobComplete(jobID, success, job);
}
-void CWeatherManager::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CWeatherManager::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
@@ -165,7 +165,7 @@ void CWeatherManager::OnSettingChanged(std::shared_ptr<const CSetting> setting)
}
}
-void CWeatherManager::OnSettingAction(std::shared_ptr<const CSetting> setting)
+void CWeatherManager::OnSettingAction(const std::shared_ptr<const CSetting>& setting)
{
if (setting == NULL)
return;
diff --git a/xbmc/weather/WeatherManager.h b/xbmc/weather/WeatherManager.h
index 13457a9827..730725bf62 100644
--- a/xbmc/weather/WeatherManager.h
+++ b/xbmc/weather/WeatherManager.h
@@ -99,8 +99,8 @@ protected:
std::string BusyInfo(int info) const override;
void OnJobComplete(unsigned int jobID, bool success, CJob *job) override;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
- void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
+ void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
private:
diff --git a/xbmc/windowing/WindowSystemFactory.cpp b/xbmc/windowing/WindowSystemFactory.cpp
index 89c859bfe9..edb6098e99 100644
--- a/xbmc/windowing/WindowSystemFactory.cpp
+++ b/xbmc/windowing/WindowSystemFactory.cpp
@@ -36,7 +36,7 @@ std::unique_ptr<CWinSystemBase> CWindowSystemFactory::CreateWindowSystem(const s
}
void CWindowSystemFactory::RegisterWindowSystem(
- std::function<std::unique_ptr<CWinSystemBase>()> createFunction, const std::string& name)
+ const std::function<std::unique_ptr<CWinSystemBase>()>& createFunction, const std::string& name)
{
m_windowSystems.emplace_back(std::make_pair(name, createFunction));
}
diff --git a/xbmc/windowing/WindowSystemFactory.h b/xbmc/windowing/WindowSystemFactory.h
index 1883c0ab91..20e051dc84 100644
--- a/xbmc/windowing/WindowSystemFactory.h
+++ b/xbmc/windowing/WindowSystemFactory.h
@@ -25,8 +25,9 @@ class CWindowSystemFactory
public:
static std::unique_ptr<CWinSystemBase> CreateWindowSystem(const std::string& name);
static std::list<std::string> GetWindowSystems();
- static void RegisterWindowSystem(std::function<std::unique_ptr<CWinSystemBase>()> createFunction,
- const std::string& name = "default");
+ static void RegisterWindowSystem(
+ const std::function<std::unique_ptr<CWinSystemBase>()>& createFunction,
+ const std::string& name = "default");
private:
static std::list<std::pair<std::string, std::function<std::unique_ptr<CWinSystemBase>()>>>
diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp
index f5ecb75adb..7150bc0b86 100644
--- a/xbmc/windowing/X11/WinSystemX11.cpp
+++ b/xbmc/windowing/X11/WinSystemX11.cpp
@@ -477,7 +477,7 @@ void CWinSystemX11::GetConnectedOutputs(std::vector<std::string> *outputs)
}
}
-bool CWinSystemX11::IsCurrentOutput(std::string output)
+bool CWinSystemX11::IsCurrentOutput(const std::string& output)
{
return (StringUtils::EqualsNoCase(output, "Default")) || (m_currentOutput.compare(output.c_str()) == 0);
}
diff --git a/xbmc/windowing/X11/WinSystemX11.h b/xbmc/windowing/X11/WinSystemX11.h
index 632f35b6f9..d44953600b 100644
--- a/xbmc/windowing/X11/WinSystemX11.h
+++ b/xbmc/windowing/X11/WinSystemX11.h
@@ -65,7 +65,7 @@ public:
int GetScreen() { return m_screen; }
void NotifyXRREvent();
void GetConnectedOutputs(std::vector<std::string> *outputs);
- bool IsCurrentOutput(std::string output);
+ bool IsCurrentOutput(const std::string& output);
void RecreateWindow();
int GetCrtc() { return m_crtc; }
diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp
index e58ef41a9f..99572fb0ab 100644
--- a/xbmc/windowing/X11/XRandR.cpp
+++ b/xbmc/windowing/X11/XRandR.cpp
@@ -228,7 +228,7 @@ void CXRandR::SaveState()
Query(true);
}
-bool CXRandR::SetMode(XOutput output, XMode mode)
+bool CXRandR::SetMode(const XOutput& output, const XMode& mode)
{
if ((output.name == "" && mode.id == ""))
return true;
diff --git a/xbmc/windowing/X11/XRandR.h b/xbmc/windowing/X11/XRandR.h
index 09495ba437..918c3c28b0 100644
--- a/xbmc/windowing/X11/XRandR.h
+++ b/xbmc/windowing/X11/XRandR.h
@@ -88,7 +88,7 @@ public:
XMode GetCurrentMode(const std::string& outputName);
XMode GetPreferredMode(const std::string& outputName);
XOutput *GetOutput(const std::string& outputName);
- bool SetMode(XOutput output, XMode mode);
+ bool SetMode(const XOutput& output, const XMode& mode);
void LoadCustomModeLinesToAllOutputs(void);
void SaveState();
void SetNumScreens(unsigned int num);
diff --git a/xbmc/windowing/android/AndroidUtils.cpp b/xbmc/windowing/android/AndroidUtils.cpp
index 4c6f46c112..ff3a11c924 100644
--- a/xbmc/windowing/android/AndroidUtils.cpp
+++ b/xbmc/windowing/android/AndroidUtils.cpp
@@ -334,7 +334,7 @@ bool CAndroidUtils::IsHDRDisplay()
return ret;
}
-void CAndroidUtils::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+void CAndroidUtils::OnSettingChanged(const std::shared_ptr<const CSetting>& setting)
{
const std::string &settingId = setting->GetId();
/* Calibration (overscan / subtitles) are based on GUI size -> reset required */
diff --git a/xbmc/windowing/android/AndroidUtils.h b/xbmc/windowing/android/AndroidUtils.h
index 28e32152cb..2c531c8673 100644
--- a/xbmc/windowing/android/AndroidUtils.h
+++ b/xbmc/windowing/android/AndroidUtils.h
@@ -29,7 +29,7 @@ public:
// Implementation of ISettingCallback
static const std::string SETTING_LIMITGUI;
- void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
protected:
mutable int m_width;
diff --git a/xbmc/windowing/gbm/WinSystemGbm.h b/xbmc/windowing/gbm/WinSystemGbm.h
index 4bb19b734f..bffe3d10b7 100644
--- a/xbmc/windowing/gbm/WinSystemGbm.h
+++ b/xbmc/windowing/gbm/WinSystemGbm.h
@@ -17,6 +17,8 @@
#include "platform/linux/OptionalsReg.h"
#include "platform/linux/input/LibInputHandler.h"
+#include <utility>
+
#include <gbm.h>
class IDispResource;
@@ -55,7 +57,10 @@ public:
void Unregister(IDispResource* resource) override;
std::shared_ptr<CVideoLayerBridge> GetVideoLayerBridge() const { return m_videoLayerBridge; };
- void RegisterVideoLayerBridge(std::shared_ptr<CVideoLayerBridge> bridge) { m_videoLayerBridge = bridge; };
+ void RegisterVideoLayerBridge(std::shared_ptr<CVideoLayerBridge> bridge)
+ {
+ m_videoLayerBridge = std::move(bridge);
+ };
CGBMUtils::CGBMDevice* GetGBMDevice() const { return m_GBM->GetDevice(); }
std::shared_ptr<CDRMUtils> GetDrm() const { return m_DRM; }
diff --git a/xbmc/windowing/gbm/drm/DRMObject.cpp b/xbmc/windowing/gbm/drm/DRMObject.cpp
index 9041bb1fea..104ec2fca2 100644
--- a/xbmc/windowing/gbm/drm/DRMObject.cpp
+++ b/xbmc/windowing/gbm/drm/DRMObject.cpp
@@ -47,7 +47,7 @@ bool CDRMObject::GetProperties(uint32_t id, uint32_t type)
return true;
}
-bool CDRMObject::GetPropertyValue(std::string name, std::string type, uint64_t& value)const
+bool CDRMObject::GetPropertyValue(std::string name, const std::string& type, uint64_t& value) const
{
auto property = std::find_if(m_propsInfo.begin(), m_propsInfo.end(), [&name](auto& prop) {
return StringUtils::EqualsNoCase(prop->name, name);
diff --git a/xbmc/windowing/gbm/drm/DRMObject.h b/xbmc/windowing/gbm/drm/DRMObject.h
index 1cda0a93df..e51f9aa908 100644
--- a/xbmc/windowing/gbm/drm/DRMObject.h
+++ b/xbmc/windowing/gbm/drm/DRMObject.h
@@ -31,7 +31,7 @@ public:
uint32_t GetId() const { return m_id; }
uint32_t GetPropertyId(const char* name) const;
- bool GetPropertyValue(std::string name, std::string type, uint64_t& value) const;
+ bool GetPropertyValue(std::string name, const std::string& type, uint64_t& value) const;
bool SetProperty(const char* name, uint64_t value);
bool SupportsProperty(const char* name);
diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/WinSystemOSX.mm
index 37781218a4..0e4839867a 100644
--- a/xbmc/windowing/osx/WinSystemOSX.mm
+++ b/xbmc/windowing/osx/WinSystemOSX.mm
@@ -445,7 +445,7 @@ NSString* screenNameForDisplay(CGDirectDisplayID displayID)
return screenName;
}
-int GetDisplayIndex(std::string dispName)
+int GetDisplayIndex(const std::string& dispName)
{
int ret = 0;
diff --git a/xbmc/windowing/wayland/InputProcessorKeyboard.cpp b/xbmc/windowing/wayland/InputProcessorKeyboard.cpp
index 58607be124..0f4241c4e3 100644
--- a/xbmc/windowing/wayland/InputProcessorKeyboard.cpp
+++ b/xbmc/windowing/wayland/InputProcessorKeyboard.cpp
@@ -52,12 +52,17 @@ void CInputProcessorKeyboard::OnKeyboardKeymap(CSeat* seat, wayland::keyboard_ke
}
}
-void CInputProcessorKeyboard::OnKeyboardEnter(CSeat* seat, std::uint32_t serial, wayland::surface_t surface, wayland::array_t keys)
+void CInputProcessorKeyboard::OnKeyboardEnter(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface,
+ const wayland::array_t& keys)
{
m_handler.OnKeyboardEnter();
}
-void CInputProcessorKeyboard::OnKeyboardLeave(CSeat* seat, std::uint32_t serial, wayland::surface_t surface)
+void CInputProcessorKeyboard::OnKeyboardLeave(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface)
{
m_keyRepeatTimer.Stop();
m_handler.OnKeyboardLeave();
diff --git a/xbmc/windowing/wayland/InputProcessorKeyboard.h b/xbmc/windowing/wayland/InputProcessorKeyboard.h
index f5efb8c27f..73a37cee7f 100644
--- a/xbmc/windowing/wayland/InputProcessorKeyboard.h
+++ b/xbmc/windowing/wayland/InputProcessorKeyboard.h
@@ -40,8 +40,13 @@ public:
CInputProcessorKeyboard(IInputHandlerKeyboard& handler);
void OnKeyboardKeymap(CSeat* seat, wayland::keyboard_keymap_format format, std::string const& keymap) override;
- void OnKeyboardEnter(CSeat* seat, std::uint32_t serial, wayland::surface_t surface, wayland::array_t keys) override;
- void OnKeyboardLeave(CSeat* seat, std::uint32_t serial, wayland::surface_t surface) override;
+ void OnKeyboardEnter(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface,
+ const wayland::array_t& keys) override;
+ void OnKeyboardLeave(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface) override;
void OnKeyboardKey(CSeat* seat, std::uint32_t serial, std::uint32_t time, std::uint32_t key, wayland::keyboard_key_state state) override;
void OnKeyboardModifiers(CSeat* seat, std::uint32_t serial, std::uint32_t modsDepressed, std::uint32_t modsLatched, std::uint32_t modsLocked, std::uint32_t group) override;
void OnKeyboardRepeatInfo(CSeat* seat, std::int32_t rate, std::int32_t delay) override;
diff --git a/xbmc/windowing/wayland/InputProcessorPointer.cpp b/xbmc/windowing/wayland/InputProcessorPointer.cpp
index 851a7b0f69..7cb9805709 100644
--- a/xbmc/windowing/wayland/InputProcessorPointer.cpp
+++ b/xbmc/windowing/wayland/InputProcessorPointer.cpp
@@ -42,7 +42,11 @@ CInputProcessorPointer::CInputProcessorPointer(wayland::surface_t const& surface
{
}
-void CInputProcessorPointer::OnPointerEnter(CSeat* seat, std::uint32_t serial, wayland::surface_t surface, double surfaceX, double surfaceY)
+void CInputProcessorPointer::OnPointerEnter(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface,
+ double surfaceX,
+ double surfaceY)
{
if (surface == m_surface)
{
@@ -53,7 +57,9 @@ void CInputProcessorPointer::OnPointerEnter(CSeat* seat, std::uint32_t serial, w
}
}
-void CInputProcessorPointer::OnPointerLeave(CSeat* seat, std::uint32_t serial, wayland::surface_t surface)
+void CInputProcessorPointer::OnPointerLeave(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface)
{
if (m_pointerOnSurface)
{
diff --git a/xbmc/windowing/wayland/InputProcessorPointer.h b/xbmc/windowing/wayland/InputProcessorPointer.h
index f510215ce9..ce44601a7d 100644
--- a/xbmc/windowing/wayland/InputProcessorPointer.h
+++ b/xbmc/windowing/wayland/InputProcessorPointer.h
@@ -40,8 +40,14 @@ public:
CInputProcessorPointer(wayland::surface_t const& surface, IInputHandlerPointer& handler);
void SetCoordinateScale(std::int32_t scale) { m_coordinateScale = scale; }
- void OnPointerEnter(CSeat* seat, std::uint32_t serial, wayland::surface_t surface, double surfaceX, double surfaceY) override;
- void OnPointerLeave(CSeat* seat, std::uint32_t serial, wayland::surface_t surface) override;
+ void OnPointerEnter(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface,
+ double surfaceX,
+ double surfaceY) override;
+ void OnPointerLeave(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface) override;
void OnPointerMotion(CSeat* seat, std::uint32_t time, double surfaceX, double surfaceY) override;
void OnPointerButton(CSeat* seat, std::uint32_t serial, std::uint32_t time, std::uint32_t button, wayland::pointer_button_state state) override;
void OnPointerAxis(CSeat* seat, std::uint32_t time, wayland::pointer_axis axis, double value) override;
diff --git a/xbmc/windowing/wayland/InputProcessorTouch.cpp b/xbmc/windowing/wayland/InputProcessorTouch.cpp
index 8f1208b9d9..a664e32ef6 100644
--- a/xbmc/windowing/wayland/InputProcessorTouch.cpp
+++ b/xbmc/windowing/wayland/InputProcessorTouch.cpp
@@ -17,7 +17,13 @@ CInputProcessorTouch::CInputProcessorTouch(wayland::surface_t const& surface)
{
}
-void CInputProcessorTouch::OnTouchDown(CSeat* seat, std::uint32_t serial, std::uint32_t time, wayland::surface_t surface, std::int32_t id, double x, double y)
+void CInputProcessorTouch::OnTouchDown(CSeat* seat,
+ std::uint32_t serial,
+ std::uint32_t time,
+ const wayland::surface_t& surface,
+ std::int32_t id,
+ double x,
+ double y)
{
if (surface != m_surface)
{
diff --git a/xbmc/windowing/wayland/InputProcessorTouch.h b/xbmc/windowing/wayland/InputProcessorTouch.h
index 782749c5be..fa6f606976 100644
--- a/xbmc/windowing/wayland/InputProcessorTouch.h
+++ b/xbmc/windowing/wayland/InputProcessorTouch.h
@@ -35,7 +35,13 @@ public:
~CInputProcessorTouch() noexcept;
void SetCoordinateScale(std::int32_t scale) { m_coordinateScale = scale; }
- void OnTouchDown(CSeat* seat, std::uint32_t serial, std::uint32_t time, wayland::surface_t surface, std::int32_t id, double x, double y) override;
+ void OnTouchDown(CSeat* seat,
+ std::uint32_t serial,
+ std::uint32_t time,
+ const wayland::surface_t& surface,
+ std::int32_t id,
+ double x,
+ double y) override;
void OnTouchUp(CSeat* seat, std::uint32_t serial, std::uint32_t time, std::int32_t id) override;
void OnTouchMotion(CSeat* seat, std::uint32_t time, std::int32_t id, double x, double y) override;
void OnTouchCancel(CSeat* seat) override;
diff --git a/xbmc/windowing/wayland/Output.cpp b/xbmc/windowing/wayland/Output.cpp
index 2aaae07539..09beef7f07 100644
--- a/xbmc/windowing/wayland/Output.cpp
+++ b/xbmc/windowing/wayland/Output.cpp
@@ -12,16 +12,21 @@
#include <cmath>
#include <set>
#include <stdexcept>
+#include <utility>
using namespace KODI::WINDOWING::WAYLAND;
-COutput::COutput(std::uint32_t globalName, wayland::output_t const & output, std::function<void()> doneHandler)
-: m_globalName{globalName}, m_output{output}, m_doneHandler{doneHandler}
+COutput::COutput(std::uint32_t globalName,
+ wayland::output_t const& output,
+ std::function<void()> doneHandler)
+ : m_globalName{globalName}, m_output{output}, m_doneHandler{std::move(doneHandler)}
{
assert(m_output);
- m_output.on_geometry() = [this](std::int32_t x, std::int32_t y, std::int32_t physWidth, std::int32_t physHeight, wayland::output_subpixel, std::string const& make, std::string const& model, wayland::output_transform)
- {
+ m_output.on_geometry() = [this](std::int32_t x, std::int32_t y, std::int32_t physWidth,
+ std::int32_t physHeight, wayland::output_subpixel,
+ std::string const& make, std::string const& model,
+ const wayland::output_transform&) {
CSingleLock lock(m_geometryCriticalSection);
m_position = {x, y};
// Some monitors report invalid (negative) values that would cause an exception
@@ -33,8 +38,8 @@ COutput::COutput(std::uint32_t globalName, wayland::output_t const & output, std
m_make = make;
m_model = model;
};
- m_output.on_mode() = [this](wayland::output_mode flags, std::int32_t width, std::int32_t height, std::int32_t refresh)
- {
+ m_output.on_mode() = [this](const wayland::output_mode& flags, std::int32_t width,
+ std::int32_t height, std::int32_t refresh) {
// std::set.emplace returns pair of iterator to the (possibly) inserted
// element and boolean information whether the element was actually added
// which we do not need
diff --git a/xbmc/windowing/wayland/Registry.cpp b/xbmc/windowing/wayland/Registry.cpp
index d1fb860ab2..e7885636de 100644
--- a/xbmc/windowing/wayland/Registry.cpp
+++ b/xbmc/windowing/wayland/Registry.cpp
@@ -81,8 +81,8 @@ void CRegistry::Bind()
m_registry = displayProxy.get_registry();
- m_registry.on_global() = [this] (std::uint32_t name, std::string interface, std::uint32_t version)
- {
+ m_registry.on_global() = [this](std::uint32_t name, const std::string& interface,
+ std::uint32_t version) {
{
auto it = m_singletonBinds.find(interface);
if (it != m_singletonBinds.end())
diff --git a/xbmc/windowing/wayland/Registry.h b/xbmc/windowing/wayland/Registry.h
index 628092bb01..f440782266 100644
--- a/xbmc/windowing/wayland/Registry.h
+++ b/xbmc/windowing/wayland/Registry.h
@@ -13,6 +13,7 @@
#include <cstdint>
#include <functional>
#include <map>
+#include <utility>
#include <wayland-client-protocol.hpp>
@@ -79,7 +80,10 @@ public:
* type is removed
*/
template<typename T>
- void Request(std::uint32_t minVersion, std::uint32_t maxVersion, AddHandler addHandler, RemoveHandler removeHandler)
+ void Request(std::uint32_t minVersion,
+ std::uint32_t maxVersion,
+ const AddHandler& addHandler,
+ const RemoveHandler& removeHandler)
{
RequestInternal([]{ return T(); }, T::interface_name, minVersion, maxVersion, addHandler, removeHandler);
}
@@ -136,8 +140,16 @@ private:
std::uint32_t maxVersion;
AddHandler addHandler;
RemoveHandler removeHandler;
- BindInfo(std::function<wayland::proxy_t()> constructor, std::uint32_t minVersion, std::uint32_t maxVersion, AddHandler addHandler, RemoveHandler removeHandler)
- : constructor{constructor}, minVersion{minVersion}, maxVersion{maxVersion}, addHandler{addHandler}, removeHandler{removeHandler}
+ BindInfo(std::function<wayland::proxy_t()> constructor,
+ std::uint32_t minVersion,
+ std::uint32_t maxVersion,
+ AddHandler addHandler,
+ RemoveHandler removeHandler)
+ : constructor{std::move(constructor)},
+ minVersion{minVersion},
+ maxVersion{maxVersion},
+ addHandler{std::move(addHandler)},
+ removeHandler{std::move(removeHandler)}
{}
};
std::map<std::string, BindInfo> m_binds;
diff --git a/xbmc/windowing/wayland/Seat.cpp b/xbmc/windowing/wayland/Seat.cpp
index 34ea171474..d3c07cc902 100644
--- a/xbmc/windowing/wayland/Seat.cpp
+++ b/xbmc/windowing/wayland/Seat.cpp
@@ -14,6 +14,7 @@
#include "platform/posix/utils/Mmap.h"
#include <cassert>
+#include <utility>
#include <unistd.h>
@@ -40,8 +41,8 @@ namespace
* protocol instance if the capability has been added
*/
template<typename T, typename InstanceProviderT>
-bool HandleCapabilityChange(wayland::seat_capability caps,
- wayland::seat_capability cap,
+bool HandleCapabilityChange(const wayland::seat_capability& caps,
+ const wayland::seat_capability& cap,
std::string const& seatName,
std::string const& capName,
T& proxy,
@@ -76,10 +77,7 @@ bool HandleCapabilityChange(wayland::seat_capability caps,
CSeat::CSeat(std::uint32_t globalName, wayland::seat_t const& seat, CConnection& connection)
: m_globalName{globalName}, m_seat{seat}, m_selection{connection, seat}
{
- m_seat.on_name() = [this](std::string name)
- {
- m_name = name;
- };
+ m_seat.on_name() = [this](std::string name) { m_name = std::move(name); };
m_seat.on_capabilities() = std::bind(&CSeat::HandleOnCapabilities, this, std::placeholders::_1);
}
@@ -118,7 +116,7 @@ void CSeat::RemoveRawInputHandlerTouch(KODI::WINDOWING::WAYLAND::IRawInputHandle
m_rawTouchHandlers.erase(rawTouchHandler);
}
-void CSeat::HandleOnCapabilities(wayland::seat_capability caps)
+void CSeat::HandleOnCapabilities(const wayland::seat_capability& caps)
{
if (HandleCapabilityChange(caps, wayland::seat_capability::keyboard, GetName(), "keyboard", m_keyboard, std::bind(&wayland::seat_t::get_keyboard, m_seat)))
{
@@ -154,15 +152,14 @@ void CSeat::HandleKeyboardCapability()
handler->OnKeyboardKeymap(this, format, keymap);
}
};
- m_keyboard.on_enter() = [this](std::uint32_t serial, wayland::surface_t surface, wayland::array_t keys)
- {
+ m_keyboard.on_enter() = [this](std::uint32_t serial, const wayland::surface_t& surface,
+ const wayland::array_t& keys) {
for (auto handler : m_rawKeyboardHandlers)
{
handler->OnKeyboardEnter(this, serial, surface, keys);
}
};
- m_keyboard.on_leave() = [this](std::uint32_t serial, wayland::surface_t surface)
- {
+ m_keyboard.on_leave() = [this](std::uint32_t serial, const wayland::surface_t& surface) {
for (auto handler : m_rawKeyboardHandlers)
{
handler->OnKeyboardLeave(this, serial, surface);
@@ -194,15 +191,14 @@ void CSeat::HandleKeyboardCapability()
void CSeat::HandlePointerCapability()
{
- m_pointer.on_enter() = [this](std::uint32_t serial, wayland::surface_t surface, double surfaceX, double surfaceY)
- {
+ m_pointer.on_enter() = [this](std::uint32_t serial, const wayland::surface_t& surface,
+ double surfaceX, double surfaceY) {
for (auto handler : m_rawPointerHandlers)
{
handler->OnPointerEnter(this, serial, surface, surfaceX, surfaceY);
}
};
- m_pointer.on_leave() = [this](std::uint32_t serial, wayland::surface_t surface)
- {
+ m_pointer.on_leave() = [this](std::uint32_t serial, const wayland::surface_t& surface) {
for (auto handler : m_rawPointerHandlers)
{
handler->OnPointerLeave(this, serial, surface);
@@ -240,8 +236,9 @@ void CSeat::HandlePointerCapability()
void CSeat::HandleTouchCapability()
{
- m_touch.on_down() = [this](std::uint32_t serial, std::uint32_t time, wayland::surface_t surface, std::int32_t id, double x, double y)
- {
+ m_touch.on_down() = [this](std::uint32_t serial, std::uint32_t time,
+ const wayland::surface_t& surface, std::int32_t id, double x,
+ double y) {
for (auto handler : m_rawTouchHandlers)
{
handler->OnTouchDown(this, serial, time, surface, id, x, y);
diff --git a/xbmc/windowing/wayland/Seat.h b/xbmc/windowing/wayland/Seat.h
index 93cfcfd071..095f18dd89 100644
--- a/xbmc/windowing/wayland/Seat.h
+++ b/xbmc/windowing/wayland/Seat.h
@@ -34,8 +34,15 @@ class IRawInputHandlerKeyboard
{
public:
virtual void OnKeyboardKeymap(CSeat* seat, wayland::keyboard_keymap_format format, std::string const& keymap) {}
- virtual void OnKeyboardEnter(CSeat* seat, std::uint32_t serial, wayland::surface_t surface, wayland::array_t keys) {}
- virtual void OnKeyboardLeave(CSeat* seat, std::uint32_t serial, wayland::surface_t surface) {}
+ virtual void OnKeyboardEnter(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface,
+ const wayland::array_t& keys)
+ {
+ }
+ virtual void OnKeyboardLeave(CSeat* seat, std::uint32_t serial, const wayland::surface_t& surface)
+ {
+ }
virtual void OnKeyboardKey(CSeat* seat, std::uint32_t serial, std::uint32_t time, std::uint32_t key, wayland::keyboard_key_state state) {}
virtual void OnKeyboardModifiers(CSeat* seat, std::uint32_t serial, std::uint32_t modsDepressed, std::uint32_t modsLatched, std::uint32_t modsLocked, std::uint32_t group) {}
virtual void OnKeyboardRepeatInfo(CSeat* seat, std::int32_t rate, std::int32_t delay) {}
@@ -51,8 +58,16 @@ protected:
class IRawInputHandlerPointer
{
public:
- virtual void OnPointerEnter(CSeat* seat, std::uint32_t serial, wayland::surface_t surface, double surfaceX, double surfaceY) {}
- virtual void OnPointerLeave(CSeat* seat, std::uint32_t serial, wayland::surface_t surface) {}
+ virtual void OnPointerEnter(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface,
+ double surfaceX,
+ double surfaceY)
+ {
+ }
+ virtual void OnPointerLeave(CSeat* seat, std::uint32_t serial, const wayland::surface_t& surface)
+ {
+ }
virtual void OnPointerMotion(CSeat* seat, std::uint32_t time, double surfaceX, double surfaceY) {}
virtual void OnPointerButton(CSeat* seat, std::uint32_t serial, std::uint32_t time, std::uint32_t button, wayland::pointer_button_state state) {}
virtual void OnPointerAxis(CSeat* seat, std::uint32_t time, wayland::pointer_axis axis, double value) {}
@@ -68,7 +83,15 @@ protected:
class IRawInputHandlerTouch
{
public:
- virtual void OnTouchDown(CSeat* seat, std::uint32_t serial, std::uint32_t time, wayland::surface_t surface, std::int32_t id, double x, double y) {}
+ virtual void OnTouchDown(CSeat* seat,
+ std::uint32_t serial,
+ std::uint32_t time,
+ const wayland::surface_t& surface,
+ std::int32_t id,
+ double x,
+ double y)
+ {
+ }
virtual void OnTouchUp(CSeat* seat, std::uint32_t serial, std::uint32_t time, std::int32_t id) {}
virtual void OnTouchMotion(CSeat* seat, std::uint32_t time, std::int32_t id, double x, double y) {}
virtual void OnTouchCancel(CSeat* seat) {}
@@ -155,7 +178,7 @@ private:
CSeat(CSeat const& other) = delete;
CSeat& operator=(CSeat const& other) = delete;
- void HandleOnCapabilities(wayland::seat_capability caps);
+ void HandleOnCapabilities(const wayland::seat_capability& caps);
void HandlePointerCapability();
void HandleKeyboardCapability();
void HandleTouchCapability();
diff --git a/xbmc/windowing/wayland/SeatSelection.cpp b/xbmc/windowing/wayland/SeatSelection.cpp
index 1f2f473ac8..c0a6948dc7 100644
--- a/xbmc/windowing/wayland/SeatSelection.cpp
+++ b/xbmc/windowing/wayland/SeatSelection.cpp
@@ -21,6 +21,7 @@
#include <chrono>
#include <cstring>
#include <system_error>
+#include <utility>
#include <poll.h>
#include <unistd.h>
@@ -63,15 +64,14 @@ CSeatSelection::CSeatSelection(CConnection& connection, wayland::seat_t const& s
{
// We don't know yet whether this is drag-and-drop or selection, so collect
// MIME types in either case
- m_currentOffer = offer;
+ m_currentOffer = std::move(offer);
m_mimeTypeOffers.clear();
m_currentOffer.on_offer() = [this](std::string mime)
{
m_mimeTypeOffers.push_back(std::move(mime));
};
};
- m_dataDevice.on_selection() = [this](wayland::data_offer_t offer)
- {
+ m_dataDevice.on_selection() = [this](const wayland::data_offer_t& offer) {
CSingleLock lock(m_currentSelectionMutex);
m_matchedMimeType.clear();
diff --git a/xbmc/windowing/wayland/ShellSurfaceWlShell.cpp b/xbmc/windowing/wayland/ShellSurfaceWlShell.cpp
index 600e5320ef..2c91858c8b 100644
--- a/xbmc/windowing/wayland/ShellSurfaceWlShell.cpp
+++ b/xbmc/windowing/wayland/ShellSurfaceWlShell.cpp
@@ -15,8 +15,12 @@
using namespace KODI::WINDOWING::WAYLAND;
using namespace std::placeholders;
-CShellSurfaceWlShell::CShellSurfaceWlShell(IShellSurfaceHandler& handler, CConnection& connection, const wayland::surface_t& surface, std::string title, std::string class_)
-: m_handler{handler}
+CShellSurfaceWlShell::CShellSurfaceWlShell(IShellSurfaceHandler& handler,
+ CConnection& connection,
+ const wayland::surface_t& surface,
+ const std::string& title,
+ const std::string& class_)
+ : m_handler{handler}
{
{
CRegistry registry{connection};
@@ -33,8 +37,8 @@ CShellSurfaceWlShell::CShellSurfaceWlShell(IShellSurfaceHandler& handler, CConne
{
m_shellSurface.pong(serial);
};
- m_shellSurface.on_configure() = [this](wayland::shell_surface_resize, std::int32_t width, std::int32_t height)
- {
+ m_shellSurface.on_configure() = [this](const wayland::shell_surface_resize&, std::int32_t width,
+ std::int32_t height) {
// wl_shell does not have serials
m_handler.OnConfigure(0, {width, height}, m_surfaceState);
};
diff --git a/xbmc/windowing/wayland/ShellSurfaceWlShell.h b/xbmc/windowing/wayland/ShellSurfaceWlShell.h
index 22fdd60c2f..8b60d60a9d 100644
--- a/xbmc/windowing/wayland/ShellSurfaceWlShell.h
+++ b/xbmc/windowing/wayland/ShellSurfaceWlShell.h
@@ -31,7 +31,11 @@ public:
* \param class_ class of the surface, which should match the name of the
* .desktop file of the application
*/
- CShellSurfaceWlShell(IShellSurfaceHandler& handler, CConnection& connection, wayland::surface_t const& surface, std::string title, std::string class_);
+ CShellSurfaceWlShell(IShellSurfaceHandler& handler,
+ CConnection& connection,
+ wayland::surface_t const& surface,
+ const std::string& title,
+ const std::string& class_);
void Initialize() override;
diff --git a/xbmc/windowing/wayland/ShellSurfaceXdgShell.cpp b/xbmc/windowing/wayland/ShellSurfaceXdgShell.cpp
index b2c2aeedbb..e92d33c3fa 100644
--- a/xbmc/windowing/wayland/ShellSurfaceXdgShell.cpp
+++ b/xbmc/windowing/wayland/ShellSurfaceXdgShell.cpp
@@ -67,8 +67,8 @@ CShellSurfaceXdgShell::CShellSurfaceXdgShell(IShellSurfaceHandler& handler, wayl
{
m_handler.OnClose();
};
- m_xdgToplevel.on_configure() = [this](std::int32_t width, std::int32_t height, std::vector<wayland::xdg_toplevel_state> states)
- {
+ m_xdgToplevel.on_configure() = [this](std::int32_t width, std::int32_t height,
+ const std::vector<wayland::xdg_toplevel_state>& states) {
m_configuredSize.Set(width, height);
m_configuredState.reset();
for (auto state : states)
diff --git a/xbmc/windowing/wayland/ShellSurfaceXdgShellUnstableV6.cpp b/xbmc/windowing/wayland/ShellSurfaceXdgShellUnstableV6.cpp
index 3814eb1d10..ca68b98090 100644
--- a/xbmc/windowing/wayland/ShellSurfaceXdgShellUnstableV6.cpp
+++ b/xbmc/windowing/wayland/ShellSurfaceXdgShellUnstableV6.cpp
@@ -67,15 +67,16 @@ CShellSurfaceXdgShellUnstableV6::CShellSurfaceXdgShellUnstableV6(IShellSurfaceHa
{
m_handler.OnClose();
};
- m_xdgToplevel.on_configure() = [this](std::int32_t width, std::int32_t height, std::vector<wayland::zxdg_toplevel_v6_state> states)
- {
- m_configuredSize.Set(width, height);
- m_configuredState.reset();
- for (auto state : states)
- {
- m_configuredState.set(ConvertStateFlag(state));
- }
- };
+ m_xdgToplevel.on_configure() =
+ [this](std::int32_t width, std::int32_t height,
+ const std::vector<wayland::zxdg_toplevel_v6_state>& states) {
+ m_configuredSize.Set(width, height);
+ m_configuredState.reset();
+ for (auto state : states)
+ {
+ m_configuredState.set(ConvertStateFlag(state));
+ }
+ };
m_xdgToplevel.set_app_id(app_id);
m_xdgToplevel.set_title(title);
// Set sensible minimum size
diff --git a/xbmc/windowing/wayland/WinSystemWayland.cpp b/xbmc/windowing/wayland/WinSystemWayland.cpp
index 8ac84415e6..ad80871fb5 100644
--- a/xbmc/windowing/wayland/WinSystemWayland.cpp
+++ b/xbmc/windowing/wayland/WinSystemWayland.cpp
@@ -196,8 +196,7 @@ bool CWinSystemWayland::InitWindowSystem()
return false;
}
- wayland::set_log_handler([](std::string message)
- {
+ wayland::set_log_handler([](const std::string& message) {
CLog::Log(LOGWARNING, "wayland-client log message: %s", message.c_str());
});
@@ -284,8 +283,7 @@ bool CWinSystemWayland::CreateNewWindow(const std::string& name,
CLog::LogF(LOGINFO, "Starting %s size %dx%d", fullScreen ? "full screen" : "windowed", res.iWidth, res.iHeight);
m_surface = m_compositor.create_surface();
- m_surface.on_enter() = [this](wayland::output_t wloutput)
- {
+ m_surface.on_enter() = [this](const wayland::output_t& wloutput) {
if (auto output = FindOutputByWaylandOutput(wloutput))
{
CLog::Log(LOGDEBUG, "Entering output \"%s\" with scale %d and %.3f dpi", UserFriendlyOutputName(output).c_str(), output->GetScale(), output->GetCurrentDpi());
@@ -300,8 +298,7 @@ bool CWinSystemWayland::CreateNewWindow(const std::string& name,
CLog::Log(LOGWARNING, "Entering output that was not configured yet, ignoring");
}
};
- m_surface.on_leave() = [this](wayland::output_t wloutput)
- {
+ m_surface.on_leave() = [this](const wayland::output_t& wloutput) {
if (auto output = FindOutputByWaylandOutput(wloutput))
{
CLog::Log(LOGDEBUG, "Leaving output \"%s\" with scale %d", UserFriendlyOutputName(output).c_str(), output->GetScale());
@@ -1340,8 +1337,7 @@ void CWinSystemWayland::PrepareFramePresentation()
iter = m_surfaceSubmissions.emplace(m_surfaceSubmissions.end(), tStart, feedback);
}
- feedback.on_sync_output() = [this](wayland::output_t wloutput)
- {
+ feedback.on_sync_output() = [this](const wayland::output_t& wloutput) {
m_syncOutputID = wloutput.get_id();
auto output = FindOutputByWaylandOutput(wloutput);
if (output)
@@ -1353,8 +1349,10 @@ void CWinSystemWayland::PrepareFramePresentation()
CLog::Log(LOGWARNING, "Could not find Wayland output that is supposedly the sync output");
}
};
- feedback.on_presented() = [this,iter](std::uint32_t tvSecHi, std::uint32_t tvSecLo, std::uint32_t tvNsec, std::uint32_t refresh, std::uint32_t seqHi, std::uint32_t seqLo, wayland::presentation_feedback_kind flags)
- {
+ feedback.on_presented() = [this, iter](std::uint32_t tvSecHi, std::uint32_t tvSecLo,
+ std::uint32_t tvNsec, std::uint32_t refresh,
+ std::uint32_t seqHi, std::uint32_t seqLo,
+ const wayland::presentation_feedback_kind& flags) {
timespec tv = { .tv_sec = static_cast<std::time_t> ((static_cast<std::uint64_t>(tvSecHi) << 32) + tvSecLo), .tv_nsec = static_cast<long>(tvNsec) };
std::int64_t latency{KODI::LINUX::TimespecDifference(iter->submissionTime, tv)};
std::uint64_t msc{(static_cast<std::uint64_t>(seqHi) << 32) + seqLo};
@@ -1458,7 +1456,8 @@ float CWinSystemWayland::GetSyncOutputRefreshRate()
return m_syncOutputRefreshRate;
}
-KODI::CSignalRegistration CWinSystemWayland::RegisterOnPresentationFeedback(PresentationFeedbackHandler handler)
+KODI::CSignalRegistration CWinSystemWayland::RegisterOnPresentationFeedback(
+ const PresentationFeedbackHandler& handler)
{
return m_presentationFeedbackHandlers.Register(handler);
}
diff --git a/xbmc/windowing/wayland/WinSystemWayland.h b/xbmc/windowing/wayland/WinSystemWayland.h
index db695e4b08..5c68fa17f9 100644
--- a/xbmc/windowing/wayland/WinSystemWayland.h
+++ b/xbmc/windowing/wayland/WinSystemWayland.h
@@ -87,7 +87,7 @@ public:
void Unregister(IDispResource* resource) override;
using PresentationFeedbackHandler = std::function<void(timespec /* tv */, std::uint32_t /* refresh */, std::uint32_t /* sync output id */, float /* sync output fps */, std::uint64_t /* msc */)>;
- CSignalRegistration RegisterOnPresentationFeedback(PresentationFeedbackHandler handler);
+ CSignalRegistration RegisterOnPresentationFeedback(const PresentationFeedbackHandler& handler);
// Like CWinSystemX11
void GetConnectedOutputs(std::vector<std::string>* outputs);
diff --git a/xbmc/windowing/wayland/WindowDecorator.cpp b/xbmc/windowing/wayland/WindowDecorator.cpp
index 9f7888e67d..1f7f59dc36 100644
--- a/xbmc/windowing/wayland/WindowDecorator.cpp
+++ b/xbmc/windowing/wayland/WindowDecorator.cpp
@@ -383,8 +383,8 @@ std::string CursorForResizeEdge(wayland::shell_surface_resize edge)
}
template<typename T, typename InstanceProviderT>
-bool HandleCapabilityChange(wayland::seat_capability caps,
- wayland::seat_capability cap,
+bool HandleCapabilityChange(const wayland::seat_capability& caps,
+ const wayland::seat_capability& cap,
T& proxy,
InstanceProviderT instanceProvider)
{
@@ -439,7 +439,11 @@ void CWindowDecorator::RemoveSeat(CSeat* seat)
UpdateButtonHoverState();
}
-void CWindowDecorator::OnPointerEnter(CSeat* seat, std::uint32_t serial, wayland::surface_t surface, double surfaceX, double surfaceY)
+void CWindowDecorator::OnPointerEnter(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface,
+ double surfaceX,
+ double surfaceY)
{
auto seatStateI = m_seats.find(seat->GetGlobalName());
if (seatStateI == m_seats.end())
@@ -464,7 +468,9 @@ void CWindowDecorator::OnPointerEnter(CSeat* seat, std::uint32_t serial, wayland
}
}
-void CWindowDecorator::OnPointerLeave(CSeat* seat, std::uint32_t serial, wayland::surface_t surface)
+void CWindowDecorator::OnPointerLeave(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface)
{
auto seatStateI = m_seats.find(seat->GetGlobalName());
if (seatStateI == m_seats.end())
@@ -509,7 +515,13 @@ void CWindowDecorator::OnPointerButton(CSeat* seat, std::uint32_t serial, std::u
}
}
-void CWindowDecorator::OnTouchDown(CSeat* seat, std::uint32_t serial, std::uint32_t time, wayland::surface_t surface, std::int32_t id, double x, double y)
+void CWindowDecorator::OnTouchDown(CSeat* seat,
+ std::uint32_t serial,
+ std::uint32_t time,
+ const wayland::surface_t& surface,
+ std::int32_t id,
+ double x,
+ double y)
{
auto seatStateI = m_seats.find(seat->GetGlobalName());
if (seatStateI == m_seats.end())
diff --git a/xbmc/windowing/wayland/WindowDecorator.h b/xbmc/windowing/wayland/WindowDecorator.h
index 481c401a46..23db2370df 100644
--- a/xbmc/windowing/wayland/WindowDecorator.h
+++ b/xbmc/windowing/wayland/WindowDecorator.h
@@ -144,10 +144,22 @@ private:
CWindowDecorator& operator=(CWindowDecorator const& other) = delete;
// IRawInputHandlerTouch
- void OnTouchDown(CSeat* seat, std::uint32_t serial, std::uint32_t time, wayland::surface_t surface, std::int32_t id, double x, double y) override;
+ void OnTouchDown(CSeat* seat,
+ std::uint32_t serial,
+ std::uint32_t time,
+ const wayland::surface_t& surface,
+ std::int32_t id,
+ double x,
+ double y) override;
// IRawInputHandlerPointer
- void OnPointerEnter(CSeat* seat, std::uint32_t serial, wayland::surface_t surface, double surfaceX, double surfaceY) override;
- void OnPointerLeave(CSeat* seat, std::uint32_t serial, wayland::surface_t surface) override;
+ void OnPointerEnter(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface,
+ double surfaceX,
+ double surfaceY) override;
+ void OnPointerLeave(CSeat* seat,
+ std::uint32_t serial,
+ const wayland::surface_t& surface) override;
void OnPointerMotion(CSeat* seat, std::uint32_t time, double surfaceX, double surfaceY) override;
void OnPointerButton(CSeat* seat, std::uint32_t serial, std::uint32_t time, std::uint32_t button, wayland::pointer_button_state state) override;
diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp
index b089be9bfc..b4cf681a37 100644
--- a/xbmc/windows/GUIMediaWindow.cpp
+++ b/xbmc/windows/GUIMediaWindow.cpp
@@ -1508,7 +1508,7 @@ bool CGUIMediaWindow::OnPlayMedia(int iItem, const std::string &player)
*
* This function is called by OnClick()
*/
-bool CGUIMediaWindow::OnPlayAndQueueMedia(const CFileItemPtr &item, std::string player)
+bool CGUIMediaWindow::OnPlayAndQueueMedia(const CFileItemPtr& item, const std::string& player)
{
//play and add current directory to temporary playlist
int iPlaylist = m_guiState->GetPlaylist();
diff --git a/xbmc/windows/GUIMediaWindow.h b/xbmc/windows/GUIMediaWindow.h
index 7730a9221e..548739573a 100644
--- a/xbmc/windows/GUIMediaWindow.h
+++ b/xbmc/windows/GUIMediaWindow.h
@@ -154,7 +154,7 @@ protected:
void SetHistoryForPath(const std::string& strDirectory);
virtual void LoadPlayList(const std::string& strFileName) {}
virtual bool OnPlayMedia(int iItem, const std::string &player = "");
- virtual bool OnPlayAndQueueMedia(const CFileItemPtr &item, std::string player = "");
+ virtual bool OnPlayAndQueueMedia(const CFileItemPtr& item, const std::string& player = "");
void UpdateFileList();
virtual void OnDeleteItem(int iItem);
void OnRenameItem(int iItem);