Closed hakaishi closed 12 years ago
The displayed list in the dialog for deleting notes conatins wrong data like the size of the file and its creation date. When deleting multiple files with MainWindow::removeNote() the following part should list only the note names:
QString names; foreach(QString name, noteModel->fileNames(noteView->selectionModel()->selectedIndexes())) names += "\"" + name + "\"\n";
noteModel is a variable for FindFileSystemModel.
In FindFileSystemModel the following function should get the Names:
QStringList FindFileSystemModel::fileNames(const QList &index) const { QHash<QModelIndex,QString> names; foreach(QModelIndex idx, index) { if(QFileSystemModel* fsm= qobject_cast<QFileSystemModel>(sourceModel())) names.insert(idx,fsm->fileName(mapToSource(idx))); else if(FindFileModel* ffm= qobject_cast<FindFileModel>(sourceModel())) names.insert(idx,ffm->fileName(mapToSource(idx))); } return names.values(); }
sometimes is good... it happens quite often to me
try to use selectionModel->selectedRows() instead of selectionModel->selectedIndexes(); everytime the selected indexes are needed
The displayed list in the dialog for deleting notes conatins wrong data like the size of the file and its creation date. When deleting multiple files with MainWindow::removeNote() the following part should list only the note names:
noteModel is a variable for FindFileSystemModel.
In FindFileSystemModel the following function should get the Names:
QStringList FindFileSystemModel::fileNames(const QList &index) const
{
QHash<QModelIndex,QString> names;
foreach(QModelIndex idx, index)
{
if(QFileSystemModel* fsm= qobject_cast<QFileSystemModel>(sourceModel()))
names.insert(idx,fsm->fileName(mapToSource(idx)));
else if(FindFileModel* ffm= qobject_cast<FindFileModel>(sourceModel()))
names.insert(idx,ffm->fileName(mapToSource(idx)));
}
return names.values();
}