forked from qt-creator/qt-creator
ProjectExplorer: 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: I3d76cf04f8b501417687f8111c88f4a1af451608 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -68,8 +68,8 @@ Task Task::compilerMissingTask()
|
|||||||
void Task::setMark(TextEditor::TextMark *mark)
|
void Task::setMark(TextEditor::TextMark *mark)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(mark, return);
|
QTC_ASSERT(mark, return);
|
||||||
QTC_ASSERT(m_mark.isNull(), return);
|
QTC_ASSERT(!m_mark, return);
|
||||||
m_mark = QSharedPointer<TextEditor::TextMark>(mark);
|
m_mark = std::shared_ptr<TextEditor::TextMark>(mark);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Task::isNull() const
|
bool Task::isNull() const
|
||||||
@@ -90,7 +90,7 @@ void Task::clear()
|
|||||||
category = Utils::Id();
|
category = Utils::Id();
|
||||||
m_icon = QIcon();
|
m_icon = QIcon();
|
||||||
formats.clear();
|
formats.clear();
|
||||||
m_mark.clear();
|
m_mark.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Task::setFile(const Utils::FilePath &file_)
|
void Task::setFile(const Utils::FilePath &file_)
|
||||||
|
@@ -85,7 +85,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void setMark(TextEditor::TextMark *mark);
|
void setMark(TextEditor::TextMark *mark);
|
||||||
|
|
||||||
QSharedPointer<TextEditor::TextMark> m_mark;
|
std::shared_ptr<TextEditor::TextMark> m_mark;
|
||||||
mutable QIcon m_icon;
|
mutable QIcon m_icon;
|
||||||
static unsigned int s_nextId;
|
static unsigned int s_nextId;
|
||||||
|
|
||||||
|
@@ -126,7 +126,7 @@ void TaskHub::addTask(Task task)
|
|||||||
QTC_ASSERT(s_registeredCategories.contains(task.category), return);
|
QTC_ASSERT(s_registeredCategories.contains(task.category), return);
|
||||||
QTC_ASSERT(!task.description().isEmpty(), return);
|
QTC_ASSERT(!task.description().isEmpty(), return);
|
||||||
QTC_ASSERT(!task.isNull(), return);
|
QTC_ASSERT(!task.isNull(), return);
|
||||||
QTC_ASSERT(task.m_mark.isNull(), return);
|
QTC_ASSERT(!task.m_mark, return);
|
||||||
|
|
||||||
if (task.file.isEmpty() || task.line <= 0)
|
if (task.file.isEmpty() || task.line <= 0)
|
||||||
task.line = -1;
|
task.line = -1;
|
||||||
|
Reference in New Issue
Block a user