forked from qt-creator/qt-creator
CompilerExplorer: Replace QSharedPointer with std::shared_ptr
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: I591de84b86f91adda73848729149e29004277df2 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -49,7 +49,7 @@ template<typename Result>
|
||||
QFuture<Result> request(
|
||||
QNetworkAccessManager *networkManager,
|
||||
QNetworkRequest &req,
|
||||
std::function<void(const QByteArray &, QSharedPointer<QPromise<Result>>)> callback,
|
||||
std::function<void(const QByteArray &, std::shared_ptr<QPromise<Result>>)> callback,
|
||||
QNetworkAccessManager::Operation op = QNetworkAccessManager::GetOperation,
|
||||
const QByteArray &payload = {})
|
||||
{
|
||||
@@ -60,7 +60,7 @@ QFuture<Result> request(
|
||||
.toUtf8();
|
||||
req.setRawHeader("User-Agent", userAgent);
|
||||
|
||||
QSharedPointer<QPromise<Result>> p(new QPromise<Result>);
|
||||
std::shared_ptr<QPromise<Result>> p(new QPromise<Result>);
|
||||
p->start();
|
||||
|
||||
// For logging purposes only
|
||||
|
@@ -547,7 +547,7 @@ void CompilerWidget::doCompile()
|
||||
m_compileWatcher->setFuture(f);
|
||||
}
|
||||
|
||||
EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document,
|
||||
EditorWidget::EditorWidget(const std::shared_ptr<JsonSettingsDocument> &document,
|
||||
QUndoStack *undoStack,
|
||||
TextEditorActionHandler &actionHandler,
|
||||
QWidget *parent)
|
||||
|
@@ -221,7 +221,7 @@ class EditorWidget : public Utils::FancyMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
EditorWidget(const QSharedPointer<JsonSettingsDocument> &document,
|
||||
EditorWidget(const std::shared_ptr<JsonSettingsDocument> &document,
|
||||
QUndoStack *undoStack,
|
||||
TextEditor::TextEditorActionHandler &actionHandler,
|
||||
QWidget *parent = nullptr);
|
||||
@@ -251,7 +251,7 @@ protected:
|
||||
QVariantMap windowStateCallback();
|
||||
|
||||
private:
|
||||
QSharedPointer<JsonSettingsDocument> m_document;
|
||||
std::shared_ptr<JsonSettingsDocument> m_document;
|
||||
QUndoStack *m_undoStack;
|
||||
TextEditor::TextEditorActionHandler &m_actionHandler;
|
||||
|
||||
@@ -265,10 +265,10 @@ public:
|
||||
Editor(TextEditor::TextEditorActionHandler &actionHandler);
|
||||
~Editor();
|
||||
|
||||
Core::IDocument *document() const override { return m_document.data(); }
|
||||
Core::IDocument *document() const override { return m_document.get(); }
|
||||
QWidget *toolBar() override;
|
||||
|
||||
QSharedPointer<JsonSettingsDocument> m_document;
|
||||
std::shared_ptr<JsonSettingsDocument> m_document;
|
||||
QUndoStack m_undoStack;
|
||||
std::unique_ptr<QToolBar> m_toolBar;
|
||||
};
|
||||
|
Reference in New Issue
Block a user