~ubuntu-branches/ubuntu/vivid/gnote/vivid-proposed

« back to all changes in this revision

Viewing changes to src/notemanagerbase.cpp

  • Committer: Package Import Robot
  • Author(s): Vincent Cheng
  • Date: 2014-10-04 23:29:38 UTC
  • mfrom: (1.3.22)
  • Revision ID: package-import@ubuntu.com-20141004232938-ctmgoabfgfoz27ft
Tags: 3.14.0-1
* New upstream release.
* Update Standards version to 3.9.6, no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
321
321
// Create a new note with the specified Xml content
322
322
NoteBase::Ptr NoteManagerBase::create_new_note(const Glib::ustring & title, const Glib::ustring & xml_content, 
323
323
                                               const std::string & guid)
324
 
 
324
{
325
325
  if(title.empty())
326
326
    throw sharp::Exception("Invalid title");
327
327
 
335
335
    filename = make_new_file_name();
336
336
 
337
337
  NoteBase::Ptr new_note = note_create_new(title, filename);
 
338
  if(new_note == 0) {
 
339
    throw sharp::Exception("Failed to create new note");
 
340
  }
338
341
  new_note->set_xml_content(xml_content);
339
342
  new_note->signal_renamed.connect(sigc::mem_fun(*this, &NoteManagerBase::on_note_rename));
340
343
  new_note->signal_saved.connect(sigc::mem_fun(*this, &NoteManagerBase::on_note_save));
365
368
      title = get_unique_name(title);
366
369
    }
367
370
    template_note = create(title, get_note_template_content(title));
 
371
    if(template_note == 0) {
 
372
      throw sharp::Exception("Failed to create template note");
 
373
    }
368
374
 
369
375
    // Flag this as a template note
370
376
    Tag::Ptr template_tag = ITagManager::obj().get_or_create_system_tag(ITagManager::TEMPLATE_NOTE_SYSTEM_TAG);