Copy (duplicate) a note
| 859 | |
| 860 | // Copy (duplicate) a note |
| 861 | void NTableView::copyNote() { |
| 862 | // Make sure we save whatever we are currently viewing |
| 863 | emit saveAllNotes(); |
| 864 | |
| 865 | QList<qint32> lids; |
| 866 | getSelectedLids(lids); |
| 867 | if (lids.size() == 0) |
| 868 | return; |
| 869 | |
| 870 | NoteTable noteTable(global.db); |
| 871 | qint32 saveLid = 0; |
| 872 | QList<qint32> newLids; |
| 873 | for (int i=0; i<lids.size(); i++) { |
| 874 | saveLid = noteTable.duplicateNote(lids[i]); |
| 875 | newLids.append(saveLid); |
| 876 | } |
| 877 | |
| 878 | FilterCriteria *criteria = new FilterCriteria(); |
| 879 | global.filterCriteria[global.filterPosition]->duplicate(*criteria); |
| 880 | criteria->resetSelectedNotes = true; |
| 881 | criteria->setSelectedNotes(newLids); |
| 882 | criteria->setLid(saveLid); |
| 883 | global.filterCriteria.append(criteria); |
| 884 | global.filterPosition++; |
| 885 | |
| 886 | FilterEngine engine; |
| 887 | engine.filter(); |
| 888 | refreshData(); |
| 889 | |
| 890 | this->openNote(false); |
| 891 | |
| 892 | } |
| 893 | |
| 894 | |
| 895 |
nothing calls this directly
no test coverage detected