forked from qt-creator/qt-creator
Git: Pass rows instead of files for diffSelectedFiles
Useful when the same file can appear more than once (e.g. staged + modified) Task-number: QTCREATORBUG-5347 Change-Id: I3ce716c22840c149490e00e6948612607ae57159 Reviewed-by: Petar Perisin <petar.perisin@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
39e9c5ef20
commit
76f6729892
@@ -403,20 +403,6 @@ SubmitFileModel *SubmitEditorWidget::fileModel() const
|
||||
return static_cast<SubmitFileModel *>(d->m_ui.fileView->model());
|
||||
}
|
||||
|
||||
QStringList SubmitEditorWidget::selectedFiles() const
|
||||
{
|
||||
const QList<int> selection = selectedRows(d->m_ui.fileView);
|
||||
if (selection.empty())
|
||||
return QStringList();
|
||||
|
||||
QStringList rc;
|
||||
const SubmitFileModel *model = fileModel();
|
||||
const int count = selection.size();
|
||||
for (int i = 0; i < count; i++)
|
||||
rc.push_back(model->file(selection.at(i)));
|
||||
return rc;
|
||||
}
|
||||
|
||||
QStringList SubmitEditorWidget::checkedFiles() const
|
||||
{
|
||||
QStringList rc;
|
||||
@@ -437,15 +423,14 @@ Utils::CompletingTextEdit *SubmitEditorWidget::descriptionEdit() const
|
||||
|
||||
void SubmitEditorWidget::triggerDiffSelected()
|
||||
{
|
||||
const QStringList sel = selectedFiles();
|
||||
const QList<int> sel = selectedRows(d->m_ui.fileView);
|
||||
if (!sel.empty())
|
||||
emit diffSelected(sel);
|
||||
}
|
||||
|
||||
void SubmitEditorWidget::diffActivatedDelayed()
|
||||
{
|
||||
const QStringList files = QStringList(fileModel()->file(d->m_activatedRow));
|
||||
emit diffSelected(files);
|
||||
emit diffSelected(QList<int>() << d->m_activatedRow);
|
||||
}
|
||||
|
||||
void SubmitEditorWidget::diffActivated(const QModelIndex &index)
|
||||
|
||||
Reference in New Issue
Block a user