summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-04-26 09:44:25 -0700
committerMarc Mutz <marc.mutz@qt.io>2022-05-11 21:00:44 +0000
commit07f092fd1f88aa5a2892c97d97619a4471b2c8ce (patch)
tree8c793c2bb28207442cd1460b98bbf0d9e2a62885 /src
parent6a767a2e327efd8f1db8ed9c1aa6937aba8b6c38 (diff)
downloadqtwayland-07f092fd1f88aa5a2892c97d97619a4471b2c8ce.tar.gz
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. Pick-to: 6.3 6.2 Change-Id: I7fb65b80b7844c8d8f26fffd16e97fe161d6a67a Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylanddisplay.cpp2
-rw-r--r--src/client/qwaylanddisplay_p.h4
-rw-r--r--src/client/shellintegration/qwaylandshellintegrationfactory.cpp4
-rw-r--r--src/compositor/extensions/qwaylandtextinput.cpp4
-rw-r--r--src/compositor/extensions/qwaylandtextinput_p.h4
-rw-r--r--src/hardwareintegration/compositor/vulkan-server/vulkanwrapper.cpp10
6 files changed, 14 insertions, 14 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 2c275a92..80af2ca4 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -389,7 +389,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 daef31e5..c81b09ce 100644
--- a/src/client/qwaylanddisplay_p.h
+++ b/src/client/qwaylanddisplay_p.h
@@ -165,7 +165,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(); }
@@ -249,7 +249,7 @@ private:
};
struct wl_display *mDisplay = nullptr;
- QScopedPointer<EventThread> m_eventThread;
+ std::unique_ptr<EventThread> m_eventThread;
wl_event_queue *m_frameEventQueue = nullptr;
QScopedPointer<EventThread> m_frameEventQueueThread;
QtWayland::wl_compositor mCompositor;
diff --git a/src/client/shellintegration/qwaylandshellintegrationfactory.cpp b/src/client/shellintegration/qwaylandshellintegrationfactory.cpp
index e3a9aeb3..ade2b4e3 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 845ee6f7..9b2f7029 100644
--- a/src/compositor/extensions/qwaylandtextinput.cpp
+++ b/src/compositor/extensions/qwaylandtextinput.cpp
@@ -394,9 +394,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 3377ebc9..18ae1921 100644
--- a/src/compositor/extensions/qwaylandtextinput_p.h
+++ b/src/compositor/extensions/qwaylandtextinput_p.h
@@ -100,8 +100,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 e3ab9f2d..ba095c94 100644
--- a/src/hardwareintegration/compositor/vulkan-server/vulkanwrapper.cpp
+++ b/src/hardwareintegration/compositor/vulkan-server/vulkanwrapper.cpp
@@ -226,7 +226,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;
@@ -264,7 +264,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();
}
@@ -529,8 +529,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...";
@@ -549,7 +549,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)