[gnote] Use std::dynamic_pointer_cast with namespace
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Use std::dynamic_pointer_cast with namespace
- Date: Tue, 9 Apr 2019 18:13:29 +0000 (UTC)
commit 2730ef43f252cc4a6e43f353f2b27f2592fb96d3
Author: Aurimas Černius <aurisc4 gmail com>
Date: Tue Apr 9 21:01:47 2019 +0300
Use std::dynamic_pointer_cast with namespace
src/notebooks/notebookmanager.cpp | 6 +++---
src/notebooks/notebookstreeview.cpp | 4 ++--
src/searchnoteswidget.cpp | 16 ++++++++--------
3 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/src/notebooks/notebookmanager.cpp b/src/notebooks/notebookmanager.cpp
index 0c8ff166..b6dd2209 100644
--- a/src/notebooks/notebookmanager.cpp
+++ b/src/notebooks/notebookmanager.cpp
@@ -440,8 +440,8 @@ namespace gnote {
if (!notebook_a || !notebook_b)
return 0;
- SpecialNotebook::Ptr spec_a = dynamic_pointer_cast<SpecialNotebook>(notebook_a);
- SpecialNotebook::Ptr spec_b = dynamic_pointer_cast<SpecialNotebook>(notebook_b);
+ SpecialNotebook::Ptr spec_a = std::dynamic_pointer_cast<SpecialNotebook>(notebook_a);
+ SpecialNotebook::Ptr spec_b = std::dynamic_pointer_cast<SpecialNotebook>(notebook_b);
if(spec_a != 0 && spec_b != 0) {
return strcmp(spec_a->get_normalized_name().c_str(), spec_b->get_normalized_name().c_str());
}
@@ -492,7 +492,7 @@ namespace gnote {
{
Notebook::Ptr notebook;
iter->get_value(0, notebook);
- if (!notebook || dynamic_pointer_cast<SpecialNotebook>(notebook)) {
+ if (!notebook || std::dynamic_pointer_cast<SpecialNotebook>(notebook)) {
return false;
}
return true;
diff --git a/src/notebooks/notebookstreeview.cpp b/src/notebooks/notebookstreeview.cpp
index 83a5bb91..92227d97 100644
--- a/src/notebooks/notebookstreeview.cpp
+++ b/src/notebooks/notebookstreeview.cpp
@@ -74,7 +74,7 @@ namespace gnote {
Notebook::Ptr destNotebook;
iter->get_value(0, destNotebook);
- if(dynamic_pointer_cast<AllNotesNotebook>(destNotebook)) {
+ if(std::dynamic_pointer_cast<AllNotesNotebook>(destNotebook)) {
context->drag_finish (false, false, time_);
return;
}
@@ -112,7 +112,7 @@ namespace gnote {
Notebook::Ptr destNotebook;
iter->get_value(0, destNotebook);
- if(dynamic_pointer_cast<AllNotesNotebook>(destNotebook)) {
+ if(std::dynamic_pointer_cast<AllNotesNotebook>(destNotebook)) {
gtk_tree_view_set_drag_dest_row (gobj(), NULL, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
return true;
}
diff --git a/src/searchnoteswidget.cpp b/src/searchnoteswidget.cpp
index 5f078fe8..802006a4 100644
--- a/src/searchnoteswidget.cpp
+++ b/src/searchnoteswidget.cpp
@@ -124,7 +124,7 @@ Glib::ustring SearchNotesWidget::get_name() const
{
notebooks::Notebook::Ptr selected_notebook = get_selected_notebook();
if(!selected_notebook
- || dynamic_pointer_cast<notebooks::AllNotesNotebook>(selected_notebook)) {
+ || std::dynamic_pointer_cast<notebooks::AllNotesNotebook>(selected_notebook)) {
return "";
}
return selected_notebook->get_name();
@@ -178,7 +178,7 @@ void SearchNotesWidget::perform_search()
// Search using the currently selected notebook
notebooks::Notebook::Ptr selected_notebook = get_selected_notebook();
- if(dynamic_pointer_cast<notebooks::SpecialNotebook>(selected_notebook)) {
+ if(std::dynamic_pointer_cast<notebooks::SpecialNotebook>(selected_notebook)) {
selected_notebook = notebooks::Notebook::Ptr();
}
@@ -296,7 +296,7 @@ void SearchNotesWidget::notebook_pixbuf_cell_data_func(Gtk::CellRenderer * rende
}
Gtk::CellRendererPixbuf *crp = dynamic_cast<Gtk::CellRendererPixbuf*>(renderer);
- notebooks::SpecialNotebook::Ptr special_nb = dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook);
+ notebooks::SpecialNotebook::Ptr special_nb =
std::dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook);
if(special_nb) {
crp->property_pixbuf() = special_nb->get_icon();
}
@@ -319,7 +319,7 @@ void SearchNotesWidget::notebook_text_cell_data_func(Gtk::CellRenderer * rendere
crt->property_text() = notebook->get_name();
- if(dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
+ if(std::dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
// Bold the "Special" Notebooks
crt->property_markup() = Glib::ustring::compose("<span weight=\"bold\">%1</span>",
notebook->get_name());
@@ -336,7 +336,7 @@ void SearchNotesWidget::on_notebook_row_edited(const Glib::ustring& /*tree_path*
return;
}
notebooks::Notebook::Ptr old_notebook = this->get_selected_notebook();
- if(dynamic_pointer_cast<notebooks::SpecialNotebook>(old_notebook)) {
+ if(std::dynamic_pointer_cast<notebooks::SpecialNotebook>(old_notebook)) {
return;
}
notebooks::Notebook::Ptr new_notebook = notebooks::NotebookManager::obj()
@@ -387,7 +387,7 @@ void SearchNotesWidget::on_notebook_selection_changed()
m_selected_tags.insert(notebook->get_tag());
}
bool allow_edit = false;
- if(dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
+ if(std::dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
m_delete_notebook_action->set_sensitive(false);
m_rename_notebook_action->set_sensitive(false);
}
@@ -479,7 +479,7 @@ void SearchNotesWidget::select_all_notes_notebook()
for(Gtk::TreeIter iter = model->children().begin(); iter; ++iter) {
notebooks::Notebook::Ptr notebook;
iter->get_value(0, notebook);
- if(dynamic_pointer_cast<notebooks::AllNotesNotebook>(notebook) != NULL) {
+ if(std::dynamic_pointer_cast<notebooks::AllNotesNotebook>(notebook) != NULL) {
m_notebooksTree->get_selection()->select(iter);
break;
}
@@ -1319,7 +1319,7 @@ void SearchNotesWidget::new_note()
{
Note::Ptr note;
notebooks::Notebook::Ptr notebook = get_selected_notebook();
- if(!notebook || dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
+ if(!notebook || std::dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
// Just create a standard note (not in a notebook)
note = std::static_pointer_cast<Note>(m_manager.create());
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]