mirror of https://gitee.com/openkylin/peony.git
[FIX] 【文件管理器】重命名文件时右键空白处,文件名处显示为空 [LINK]181741
This commit is contained in:
parent
72f3488f4b
commit
077faf68e3
|
@ -547,6 +547,7 @@ void IconViewDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
|
|||
//set focus to fix bug#54061
|
||||
getView()->setFocus();
|
||||
});
|
||||
infoJob->queryAsync();
|
||||
});
|
||||
}, Qt::BlockingQueuedConnection);
|
||||
|
||||
|
@ -558,10 +559,15 @@ void IconViewDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
|
|||
auto info = renameOp->getOperationInfo().get();
|
||||
auto uri = info->target();
|
||||
QTimer::singleShot(100, getView(), [=](){
|
||||
getView()->setSelections(QStringList()<<uri);
|
||||
getView()->scrollToSelection(uri);
|
||||
//set focus to fix bug#54061
|
||||
getView()->setFocus();
|
||||
auto infoJob = new Peony::FileInfoJob(Peony::FileInfo::fromUri(uri));
|
||||
infoJob->setAutoDelete();
|
||||
connect(infoJob, &Peony::FileInfoJob::queryAsyncFinished, this, [=]() {
|
||||
getView()->setSelections(QStringList()<<uri);
|
||||
getView()->scrollToSelection(uri);
|
||||
//set focus to fix bug#54061
|
||||
getView()->setFocus();
|
||||
});
|
||||
infoJob->queryAsync();
|
||||
});
|
||||
}, Qt::BlockingQueuedConnection);
|
||||
|
||||
|
|
Loading…
Reference in New Issue