Utils: Replace the last QSharedPointer usage with std::shared_ptr

Replace it in Pty::Data. Remove the usage of shared pointer
from PathListPlainTextEdit.

According to https://wiki.qt.io/Things_To_Look_Out_For_In_Reviews
QSharedPointer impl is poor and it's going to be removed from Qt 7.

Change-Id: I5f19edf438eed3dde17b0f9abf570d2b53df93d7
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2024-02-01 11:33:42 +01:00
parent f193aeed47
commit 14ff95b1bf
2 changed files with 3 additions and 4 deletions

View File

@@ -10,7 +10,6 @@
#include <QMimeData>
#include <QPlainTextEdit>
#include <QPushButton>
#include <QSharedPointer>
#include <QTextBlock>
#include <QVBoxLayout>
@@ -64,9 +63,9 @@ void PathListPlainTextEdit::insertFromMimeData(const QMimeData *source)
// replace separator
QString text = source->text().trimmed();
text.replace(HostOsInfo::pathListSeparator(), QLatin1Char('\n'));
QSharedPointer<QMimeData> fixed(new QMimeData);
QMimeData *fixed = new QMimeData;
fixed->setText(text);
QPlainTextEdit::insertFromMimeData(fixed.data());
QPlainTextEdit::insertFromMimeData(fixed);
} else {
QPlainTextEdit::insertFromMimeData(source);
}

View File

@@ -55,7 +55,7 @@ public:
private:
QSize m_size{80, 60};
QSharedPointer<SharedData> m_data;
std::shared_ptr<SharedData> m_data;
};
} // namespace Pty