hakaishi / nobleNote

Program to make and manage notes
Other
30 stars 4 forks source link

(sometimes) wrong data is shown, when deleting multiple notes #151

Closed hakaishi closed 12 years ago

hakaishi commented 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(); }

hakaishi commented 12 years ago

sometimes is good... it happens quite often to me

nebomuk commented 12 years ago

try to use selectionModel->selectedRows() instead of selectionModel->selectedIndexes(); everytime the selected indexes are needed