forked from qt-creator/qt-creator
Debugger: Don't fetch more data for console after engine shutdown
The engine might not exist anymore. Change-Id: I7a542de7fb8b160d71a1650d37263e4433f97003 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -249,6 +249,7 @@ void Console::writeSettings() const
|
||||
void Console::setScriptEvaluator(const ScriptEvaluator &evaluator)
|
||||
{
|
||||
m_scriptEvaluator = evaluator;
|
||||
m_consoleItemModel->setCanFetchMore(bool(m_scriptEvaluator));
|
||||
if (!m_scriptEvaluator)
|
||||
setContext(QString());
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Internal {
|
||||
|
||||
ConsoleItemModel::ConsoleItemModel(QObject *parent) :
|
||||
Utils::TreeModel<>(new ConsoleItem, parent),
|
||||
m_maxSizeOfFileName(0)
|
||||
m_maxSizeOfFileName(0), m_canFetchMore(false)
|
||||
{
|
||||
clear();
|
||||
}
|
||||
@@ -51,6 +51,16 @@ void ConsoleItemModel::clear()
|
||||
emit selectEditableRow(index(0, 0, QModelIndex()), QItemSelectionModel::ClearAndSelect);
|
||||
}
|
||||
|
||||
void ConsoleItemModel::setCanFetchMore(bool canFetchMore)
|
||||
{
|
||||
m_canFetchMore = canFetchMore;
|
||||
}
|
||||
|
||||
bool ConsoleItemModel::canFetchMore(const QModelIndex &parent) const
|
||||
{
|
||||
return m_canFetchMore && TreeModel::canFetchMore(parent);
|
||||
}
|
||||
|
||||
void ConsoleItemModel::appendItem(ConsoleItem *item, int position)
|
||||
{
|
||||
if (position < 0)
|
||||
|
||||
@@ -53,11 +53,15 @@ public:
|
||||
|
||||
void clear();
|
||||
|
||||
void setCanFetchMore(bool canFetchMore);
|
||||
bool canFetchMore(const QModelIndex &parent) const override;
|
||||
|
||||
signals:
|
||||
void selectEditableRow(const QModelIndex &index, QItemSelectionModel::SelectionFlags flags);
|
||||
|
||||
private:
|
||||
int m_maxSizeOfFileName;
|
||||
bool m_canFetchMore;
|
||||
};
|
||||
|
||||
} // Internal
|
||||
|
||||
Reference in New Issue
Block a user