本文整理汇总了C++中Note::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Note::getName方法的具体用法?C++ Note::getName怎么用?C++ Note::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Note
的用法示例。
在下文中一共展示了Note::getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getNoteName
string NoteController::getNoteName( unsigned int pos ) const
{
Note note = _model->getNote( pos );
if( note.getName() != "" && note.read() != "" )
return note.getName();
return "";
}
示例2: getNoteText
string NoteController::getNoteText( string name )
{
Note note = searchNote( name );
if( note.getName() != "" && note.read() != "" )
return note.read();
return "";
}
示例3: storeDirtyNotesToDisk
/**
* Stores all notes that were changed to disk
*
* @param currentNote will be set by this method if the filename of the current
* note has changed
* @param currentNoteChanged true if current note was changed
* @param noteWasRenamed true if a note was renamed
* @return amount of notes that were saved
*/
int Note::storeDirtyNotesToDisk(Note ¤tNote, bool *currentNoteChanged,
bool *noteWasRenamed) {
QSqlDatabase db = QSqlDatabase::database("memory");
QSqlQuery query(db);
ScriptingService* scriptingService = ScriptingService::instance();
Note note;
// qDebug() << "storeDirtyNotesToDisk";
query.prepare("SELECT * FROM note WHERE has_dirty_data = 1");
if (!query.exec()) {
qWarning() << __func__ << ": " << query.lastError();
return 0;
} else {
int count = 0;
for (int r = 0; query.next(); r++) {
note = noteFromQuery(query);
QString oldName = note.getName();
note.storeNoteTextFileToDisk();
QString newName = note.getName();
// check if the file name has changed
if (oldName != newName) {
// rename the note file names of note tag links
Tag::renameNoteFileNamesOfLinks(oldName, newName);
*noteWasRenamed = true;
// override the current note because the file name has changed
currentNote = note;
}
// emit the signal for the QML that the note was stored
emit scriptingService->noteStored(
QVariant::fromValue(
static_cast<QObject*>(NoteApi::fromNote(note))));
// reassign currentNote if filename of currentNote has changed
if (note.isSameFile(currentNote)) {
*currentNoteChanged = true;
}
qDebug() << "stored note: " << note;
count++;
}
return count;
}
}
示例4: setNote
void NoteDialog::setNote(Note note) {
setWindowTitle(note.getName());
// show the decrypted text if possible
QString text = note.hasEncryptedNoteText() && note.canDecryptNoteText() ?
note.getDecryptedNoteText() : note.getNoteText();
ui->textEdit->setPlainText(text);
}
示例5: fetchAllNotTaggedNames
/**
* Returns all notes names that are not tagged
*/
QStringList Note::fetchAllNotTaggedNames() {
QList<Note> noteList = Note::fetchAll();
QStringList untaggedNoteFileNameList;
QListIterator<Note> itr(noteList);
while (itr.hasNext()) {
Note note = itr.next();
int tagCount = Tag::countAllOfNote(note);
if (tagCount == 0) {
untaggedNoteFileNameList << note.getName();
}
}
return untaggedNoteFileNameList;
}