MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / copyNote

Method copyNote

gui/ntableview.cpp:861–892  ·  view source on GitHub ↗

Copy (duplicate) a note

Source from the content-addressed store, hash-verified

859
860// Copy (duplicate) a note
861void 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

Callers

nothing calls this directly

Calls 6

duplicateNoteMethod · 0.80
duplicateMethod · 0.80
setSelectedNotesMethod · 0.80
filterMethod · 0.80
setLidMethod · 0.45
openNoteMethod · 0.45

Tested by

no test coverage detected