[gnote] Remove boost::format from syncdialog and more ustring
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Remove boost::format from syncdialog and more ustring
- Date: Sun, 8 Jan 2017 12:44:03 +0000 (UTC)
commit 4f3657b79951579434c2c3ce4ca801951170c1cd
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Jan 8 14:41:52 2017 +0200
Remove boost::format from syncdialog and more ustring
src/synchronization/syncdialog.cpp | 33 ++++++++++++++++-----------------
src/synchronization/syncdialog.hpp | 8 ++++----
2 files changed, 20 insertions(+), 21 deletions(-)
---
diff --git a/src/synchronization/syncdialog.cpp b/src/synchronization/syncdialog.cpp
index ad70fc1..1b93a07 100644
--- a/src/synchronization/syncdialog.cpp
+++ b/src/synchronization/syncdialog.cpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2012-2014,2016 Aurimas Cernius
+ * Copyright (C) 2012-2014,2016,2017 Aurimas Cernius
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,6 @@
#include "debug.hpp"
#include <boost/bind.hpp>
-#include <boost/format.hpp>
#include <glibmm/i18n.h>
#include <gtkmm/radiobutton.h>
#include <gtkmm/scrolledwindow.h>
@@ -136,18 +135,18 @@ public:
// Set initial dialog text
header_text(_("Note conflict detected"));
- message_text(boost::str(boost::format(
- _("The server version of \"%1%\" conflicts with your local note. What do you want to do with your
local note?"))
- % existingNote->get_title()));
+ message_text(Glib::ustring::compose(
+ _("The server version of \"%1\" conflicts with your local note. What do you want to do with your
local note?"),
+ existingNote->get_title()));
show_all();
}
- void header_text(const std::string & value)
+ void header_text(const Glib::ustring & value)
{
- m_header_label->set_markup(boost::str(boost::format(
- "<span size=\"large\" weight=\"bold\">%1%</span>") % value));
+ m_header_label->set_markup(Glib::ustring::compose(
+ "<span size=\"large\" weight=\"bold\">%1</span>", value));
}
- void message_text(const std::string & value)
+ void message_text(const Glib::ustring & value)
{
m_message_label->set_text(value);
}
@@ -435,13 +434,13 @@ void SyncDialog::present_ui()
}
-void SyncDialog::header_text(const std::string & value)
+void SyncDialog::header_text(const Glib::ustring & value)
{
- m_header_label->set_markup(str(boost::format("<span size=\"large\" weight=\"bold\">%1%</span>") % value));
+ m_header_label->set_markup(Glib::ustring::compose("<span size=\"large\" weight=\"bold\">%1</span>",
value));
}
-void SyncDialog::message_text(const std::string & value)
+void SyncDialog::message_text(const Glib::ustring & value)
{
m_message_label->set_text(value);
}
@@ -453,10 +452,10 @@ std::string SyncDialog::progress_text() const
}
-void SyncDialog::progress_text(const std::string & value)
+void SyncDialog::progress_text(const Glib::ustring & value)
{
- m_progress_label->set_markup(str(
- boost::format("<span style=\"italic\">%1%</span>") % value));
+ m_progress_label->set_markup(
+ Glib::ustring::compose("<span style=\"italic\">%1</span>", value));
}
@@ -538,8 +537,8 @@ void SyncDialog::sync_state_changed_(SyncState state)
int count = m_model->children().size();
set_title(_("Synchronization Complete"));
header_text(_("Synchronization is complete"));
- std::string numNotesUpdated = ngettext("%1% note updated.", "%1% notes updated.", count);
- message_text(str(boost::format(numNotesUpdated) % count) + " " + _("Your notes are now up to date."));
+ Glib::ustring numNotesUpdated = ngettext("%1 note updated.", "%1 notes updated.", count);
+ message_text(Glib::ustring::compose(numNotesUpdated, count) + " " + _("Your notes are now up to
date."));
progress_text("");
}
break;
diff --git a/src/synchronization/syncdialog.hpp b/src/synchronization/syncdialog.hpp
index 0c6f05e..c077bd9 100644
--- a/src/synchronization/syncdialog.hpp
+++ b/src/synchronization/syncdialog.hpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2012-2014 Aurimas Cernius
+ * Copyright (C) 2012-2014,2017 Aurimas Cernius
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -50,10 +50,10 @@ namespace sync {
NoteUpdate remoteNote,
const std::list<std::string> & noteUpdateTitles) override;
virtual void present_ui() override;
- void header_text(const std::string &);
- void message_text(const std::string &);
+ void header_text(const Glib::ustring &);
+ void message_text(const Glib::ustring &);
std::string progress_text() const;
- void progress_text(const std::string &);
+ void progress_text(const Glib::ustring &);
void add_update_item(const std::string & title, std::string & status);
protected:
virtual void on_realize() override;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]