[gnote] Remove boost::format from sticky note import
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Remove boost::format from sticky note import
- Date: Fri, 13 Jan 2017 20:54:57 +0000 (UTC)
commit 244757bf94de5d347220b2d78758d11a26d599a6
Author: Aurimas Černius <aurisc4 gmail com>
Date: Fri Jan 13 22:47:38 2017 +0200
Remove boost::format from sticky note import
.../stickynoteimport.desktop.in.in | 2 +-
.../stickynoteimport/stickynoteimportnoteaddin.cpp | 34 +++++++++----------
2 files changed, 17 insertions(+), 19 deletions(-)
---
diff --git a/src/addins/stickynoteimport/stickynoteimport.desktop.in.in
b/src/addins/stickynoteimport/stickynoteimport.desktop.in.in
index eaac290..580ae83 100644
--- a/src/addins/stickynoteimport/stickynoteimport.desktop.in.in
+++ b/src/addins/stickynoteimport/stickynoteimport.desktop.in.in
@@ -4,7 +4,7 @@ _Name=Sticky Notes Importer
_Description=Import your notes from the Sticky Notes applet.
_Authors=Hubert Figuiere and the Tomboy Project
Category=Tools
-Version=0.2
+Version=0.3
DefaultEnabled=true
Module=libstickynoteimport
LibgnoteRelease=@LIBGNOTE_RELEASE@
diff --git a/src/addins/stickynoteimport/stickynoteimportnoteaddin.cpp
b/src/addins/stickynoteimport/stickynoteimportnoteaddin.cpp
index 2e9d055..22652fa 100644
--- a/src/addins/stickynoteimport/stickynoteimportnoteaddin.cpp
+++ b/src/addins/stickynoteimport/stickynoteimportnoteaddin.cpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2010-2011,2013-2014 Aurimas Cernius
+ * Copyright (C) 2010-2011,2013-2014,2017 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
@@ -21,8 +21,6 @@
#include <fstream>
#include <string.h>
-#include <boost/format.hpp>
-
#include <glibmm/i18n.h>
#include <glibmm/keyfile.h>
#include <gtkmm/image.h>
@@ -212,20 +210,20 @@ void StickyNoteImportNoteAddin::show_no_sticky_xml_dialog(const std::string & xm
{
show_message_dialog (
_("No Sticky Notes found"),
- // %1% is a the file name
- str(boost::format(_("No suitable Sticky Notes file was found at \"%1%\"."))
- % xml_path), Gtk::MESSAGE_ERROR);
+ // %1 is a the file name
+ Glib::ustring::compose(_("No suitable Sticky Notes file was found at \"%1\"."),
+ xml_path), Gtk::MESSAGE_ERROR);
}
void StickyNoteImportNoteAddin::show_results_dialog(int numNotesImported, int numNotesTotal)
{
- show_message_dialog (
+ show_message_dialog (
_("Sticky Notes import completed"),
- // here %1% is the number of notes imported, %2% the total number of notes.
- str(boost::format(_("<b>%1%</b> of <b>%2%</b> Sticky Notes "
- "were successfully imported."))
- % numNotesImported % numNotesTotal), Gtk::MESSAGE_INFO);
+ // here %1 is the number of notes imported, %2 the total number of notes.
+ Glib::ustring::compose(_("<b>%1</b> of <b>%2</b> Sticky Notes "
+ "were successfully imported."),
+ numNotesImported, numNotesTotal), Gtk::MESSAGE_INFO);
}
@@ -280,20 +278,20 @@ bool StickyNoteImportNoteAddin::create_note_from_sticky(const char * stickyTitle
const char* content,
gnote::NoteManager & manager)
{
- std::string preferredTitle = _("Sticky Note: ");
+ Glib::ustring preferredTitle = _("Sticky Note: ");
preferredTitle += stickyTitle;
- std::string title = preferredTitle;
+ Glib::ustring title = preferredTitle;
int i = 2; // Append numbers to create unique title, starting with 2
while (manager.find(title)){
- title = str(boost::format("%1% (#%2%)") % preferredTitle % i);
+ title = Glib::ustring::compose("%1 (#%2)", preferredTitle, i);
i++;
}
- std::string noteXml = str(boost::format("<note-content><note-title>%1%</note-title>\n\n"
- "%2%</note-content>")
- % gnote::utils::XmlEncoder::encode(title)
- % gnote::utils::XmlEncoder::encode(content));
+ Glib::ustring noteXml = Glib::ustring::compose("<note-content><note-title>%1</note-title>\n\n"
+ "%2</note-content>",
+ gnote::utils::XmlEncoder::encode(title),
+ gnote::utils::XmlEncoder::encode(content));
try {
gnote::NoteBase::Ptr newNote = manager.create(title, noteXml);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]