diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-04-26 09:44:25 -0700 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-11-17 13:42:48 +0000 |
commit | fe22c1d2850cb35a1c3b624d50729e9b833331c0 (patch) | |
tree | fc8dfe4b5f0b736d2f3fe39c1cae1ed67c3daa5b | |
parent | b014f22bbeb6cb43aa22c9f4e451dcc828d5a858 (diff) |
Replace QScopedPointer with std::unique_ptr
As the warning asked.
qwaylandshellintegrationfactory.cpp:67:28: warning: ‘T* QScopedPointer<T, Cleanup>::take() [with T = QtWaylandClient::QWaylandShellIntegration; Cleanup = QScopedPointerDeleter<QtWaylandClient::QWaylandShellIntegration>]’ is deprecated: Use std::unique_ptr instead, and call release(). [-Wdeprecated-declarations]
As a drive-by, change *foo.get() to *foo.
Change-Id: I7fb65b80b7844c8d8f26fffd16e97fe161d6a67a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 07f092fd1f88aa5a2892c97d97619a4471b2c8ce)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 2 | ||||
-rw-r--r-- | src/client/qwaylanddisplay_p.h | 2 | ||||
-rw-r--r-- | src/client/shellintegration/qwaylandshellintegrationfactory.cpp | 4 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandtextinput.cpp | 4 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandtextinput_p.h | 4 | ||||
-rw-r--r-- | src/hardwareintegration/compositor/vulkan-server/vulkanwrapper.cpp | 10 |
6 files changed, 13 insertions, 13 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 4ea856cf0..e9ecf98e9 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -180,7 +180,7 @@ QWaylandDisplay::~QWaylandDisplay(void) qDeleteAll(mWaitingScreens); #if QT_CONFIG(wayland_datadevice) - delete mDndSelectionHandler.take(); + mDndSelectionHandler.reset(); #endif #if QT_CONFIG(cursor) mCursorThemes.clear(); diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index 479e00fbf..b3c5d4f8b 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -168,7 +168,7 @@ public: QWaylandInputDevice *defaultInputDevice() const; QWaylandInputDevice *currentInputDevice() const { return defaultInputDevice(); } #if QT_CONFIG(wayland_datadevice) - QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.data(); } + QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.get(); } #endif #if QT_CONFIG(wayland_client_primary_selection) QWaylandPrimarySelectionDeviceManagerV1 *primarySelectionManager() const { return mPrimarySelectionManager.data(); } diff --git a/src/client/shellintegration/qwaylandshellintegrationfactory.cpp b/src/client/shellintegration/qwaylandshellintegrationfactory.cpp index aa88fa5ae..ea1b84181 100644 --- a/src/client/shellintegration/qwaylandshellintegrationfactory.cpp +++ b/src/client/shellintegration/qwaylandshellintegrationfactory.cpp @@ -58,13 +58,13 @@ QStringList QWaylandShellIntegrationFactory::keys() QWaylandShellIntegration *QWaylandShellIntegrationFactory::create(const QString &name, QWaylandDisplay *display, const QStringList &args) { - QScopedPointer<QWaylandShellIntegration> integration; + std::unique_ptr<QWaylandShellIntegration> integration; integration.reset(qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(loader(), name, args)); if (integration && !integration->initialize(display)) return nullptr; - return integration.take(); + return integration.release(); } } diff --git a/src/compositor/extensions/qwaylandtextinput.cpp b/src/compositor/extensions/qwaylandtextinput.cpp index 259142325..614bb2055 100644 --- a/src/compositor/extensions/qwaylandtextinput.cpp +++ b/src/compositor/extensions/qwaylandtextinput.cpp @@ -407,9 +407,9 @@ void QWaylandTextInputPrivate::zwp_text_input_v2_update_state(Resource *resource Qt::InputMethodQueries queries; if (flags == update_state_change) { - queries = currentState->mergeChanged(*pendingState.data()); + queries = currentState->mergeChanged(*pendingState); } else { - queries = pendingState->updatedQueries(*currentState.data()); + queries = pendingState->updatedQueries(*currentState); currentState.swap(pendingState); } diff --git a/src/compositor/extensions/qwaylandtextinput_p.h b/src/compositor/extensions/qwaylandtextinput_p.h index d1ca58baf..d44fa9294 100644 --- a/src/compositor/extensions/qwaylandtextinput_p.h +++ b/src/compositor/extensions/qwaylandtextinput_p.h @@ -99,8 +99,8 @@ public: bool inputPanelVisible = false; - QScopedPointer<QWaylandTextInputClientState> currentState; - QScopedPointer<QWaylandTextInputClientState> pendingState; + std::unique_ptr<QWaylandTextInputClientState> currentState; + std::unique_ptr<QWaylandTextInputClientState> pendingState; uint32_t serial = 0; diff --git a/src/hardwareintegration/compositor/vulkan-server/vulkanwrapper.cpp b/src/hardwareintegration/compositor/vulkan-server/vulkanwrapper.cpp index dd9366ad2..8bf149df7 100644 --- a/src/hardwareintegration/compositor/vulkan-server/vulkanwrapper.cpp +++ b/src/hardwareintegration/compositor/vulkan-server/vulkanwrapper.cpp @@ -225,7 +225,7 @@ VulkanImageWrapper *VulkanWrapperPrivate::createImage(VkFormat format, VkImageTi return nullptr; } - QScopedPointer<VulkanImageWrapper> imageWrapper(new VulkanImageWrapper); + std::unique_ptr imageWrapper = std::make_unique<VulkanImageWrapper>(); imageWrapper->textureImage = image; imageWrapper->imgMemSize = memSize; imageWrapper->imgSize = size; @@ -263,7 +263,7 @@ VulkanImageWrapper *VulkanWrapperPrivate::createImage(VkFormat format, VkImageTi res = vkGetMemoryFdKHR(m_device, &memoryFdInfo, &imageWrapper->imgFd); if (extraDebug) qDebug() << "vkGetMemoryFdKHR res" << res << "fd" << imageWrapper->imgFd; - return imageWrapper.take(); + return imageWrapper.release(); } @@ -528,8 +528,8 @@ VulkanImageWrapper *VulkanWrapperPrivate::createTextureImageFromData(const uchar if (extraDebug) qDebug() << "creating image..."; - QScopedPointer<VulkanImageWrapper> imageWrapper(createImage(vkFormat, VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, size, bufferSize)); - if (imageWrapper.isNull()) + std::unique_ptr<VulkanImageWrapper> imageWrapper(createImage(vkFormat, VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, size, bufferSize)); + if (!imageWrapper) return nullptr; if (extraDebug) qDebug() << "transition..."; @@ -548,7 +548,7 @@ VulkanImageWrapper *VulkanWrapperPrivate::createTextureImageFromData(const uchar vkDestroyBuffer(m_device, stagingBuffer, nullptr); vkFreeMemory(m_device, stagingBufferMemory, nullptr); - return imageWrapper.take(); + return imageWrapper.release(); } void VulkanWrapperPrivate::freeTextureImage(VulkanImageWrapper *imageWrapper) |