forked from qt-creator/qt-creator
ProjectExplorer: Display message while fetching process list
Fetching process list from remote device can take a long time, which might cause impatient users think that something is wrong and cancel the listing. Change-Id: Ideee017340811bc5600dd2a66a0afee6d223844e Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -80,6 +80,10 @@ void DeviceProcessList::update()
|
||||
QTC_ASSERT(device(), return);
|
||||
|
||||
d->model.clear();
|
||||
d->model.rootItem()->appendChild(
|
||||
new DeviceProcessTreeItem(
|
||||
{0, tr("Fetching process list. This might take a while."), ""},
|
||||
Qt::NoItemFlags));
|
||||
d->state = Listing;
|
||||
doUpdate();
|
||||
}
|
||||
@@ -88,6 +92,7 @@ void DeviceProcessList::reportProcessListUpdated(const QList<DeviceProcessItem>
|
||||
{
|
||||
QTC_ASSERT(d->state == Listing, return);
|
||||
setFinished();
|
||||
d->model.clear();
|
||||
for (const DeviceProcessItem &process : processes) {
|
||||
Qt::ItemFlags fl;
|
||||
if (process.pid != d->ownPid)
|
||||
@@ -134,7 +139,7 @@ QVariant DeviceProcessTreeItem::data(int column, int role) const
|
||||
{
|
||||
if (role == Qt::DisplayRole || role == Qt::ToolTipRole) {
|
||||
if (column == 0)
|
||||
return process.pid;
|
||||
return process.pid ? process.pid : QVariant();
|
||||
else
|
||||
return process.cmdLine;
|
||||
}
|
||||
|
Reference in New Issue
Block a user