[glom] C++11: Remove more unnecessary typedefs.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] C++11: Remove more unnecessary typedefs.
- Date: Sun, 6 Nov 2016 19:19:43 +0000 (UTC)
commit acc0c326393e30803951f3f5d1a29a97eceffa2a
Author: Murray Cumming <murrayc murrayc com>
Date: Sun Nov 6 20:19:00 2016 +0100
C++11: Remove more unnecessary typedefs.
These were useful before we used auto with C++11.
glom/base_db_table_data.cc | 3 +--
glom/import_csv/dialog_import_csv.h | 3 +--
.../connectionpool_backends/mysql_central.h | 3 +--
.../connectionpool_backends/postgres_central.h | 3 +--
glom/libglom/data_structure/foundset.h | 3 +--
glom/libglom/data_structure/glomconversions.cc | 3 +--
glom/libglom/document/bakery/view/view_composite.h | 3 +--
glom/libglom/document/document.cc | 4 ++--
glom/libglom/document/document.h | 12 ++++--------
glom/libglom/string_utils.cc | 3 +--
.../datawidget/combochoiceswithtreemodel.h | 9 +++------
glom/mode_data/datawidget/treemodel_db.h | 3 +--
glom/mode_data/flowtablewithfields.h | 10 ++++------
.../print_layouts/window_print_layout_edit.h | 6 ++----
glom/utility_widgets/flowtable.h | 3 +--
glom/utility_widgets/test_flowtable.cc | 3 +--
glom/variablesmap.h | 3 +--
tests/test_selfhosting_new_empty_then_users.cc | 7 +++----
18 files changed, 30 insertions(+), 54 deletions(-)
---
diff --git a/glom/base_db_table_data.cc b/glom/base_db_table_data.cc
index ff54e36..a627783 100644
--- a/glom/base_db_table_data.cc
+++ b/glom/base_db_table_data.cc
@@ -90,8 +90,7 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
builder->set_table(m_table_name);
//Avoid specifying the same field twice:
- typedef std::unordered_set<Glib::ustring, std::hash<std::string>> type_map_added;
- type_map_added map_added;
+ std::unordered_set<Glib::ustring, std::hash<std::string>> map_added;
auto params = Gnome::Gda::Set::create();
for(const auto& layout_item : fieldsToAdd)
diff --git a/glom/import_csv/dialog_import_csv.h b/glom/import_csv/dialog_import_csv.h
index 65dd65f..6018554 100644
--- a/glom/import_csv/dialog_import_csv.h
+++ b/glom/import_csv/dialog_import_csv.h
@@ -161,8 +161,7 @@ private:
guint m_cols_count;
// The fields into which to import the data:
- typedef std::vector< std::shared_ptr<Field> > type_vec_fields;
- type_vec_fields m_fields;
+ std::vector< std::shared_ptr<Field> > m_fields;
type_signal_state_changed m_signal_state_changed;
};
diff --git a/glom/libglom/connectionpool_backends/mysql_central.h
b/glom/libglom/connectionpool_backends/mysql_central.h
index d2b0eea..c686528 100644
--- a/glom/libglom/connectionpool_backends/mysql_central.h
+++ b/glom/libglom/connectionpool_backends/mysql_central.h
@@ -53,8 +53,7 @@ private:
bool create_database(const SlotProgress& slot_progress, const Glib::ustring& database_name, const
Glib::ustring& username, const Glib::ustring& password) override;
private:
- typedef std::vector<Glib::ustring> type_list_ports;
- type_list_ports m_list_ports;
+ std::vector<Glib::ustring> m_list_ports;
bool m_try_other_ports;
};
diff --git a/glom/libglom/connectionpool_backends/postgres_central.h
b/glom/libglom/connectionpool_backends/postgres_central.h
index 8631cbd..1ab14df 100644
--- a/glom/libglom/connectionpool_backends/postgres_central.h
+++ b/glom/libglom/connectionpool_backends/postgres_central.h
@@ -53,8 +53,7 @@ private:
bool create_database(const SlotProgress& slot_progress, const Glib::ustring& database_name, const
Glib::ustring& username, const Glib::ustring& password) override;
private:
- typedef std::vector<Glib::ustring> type_list_ports;
- type_list_ports m_list_ports;
+ std::vector<Glib::ustring> m_list_ports;
bool m_try_other_ports;
};
diff --git a/glom/libglom/data_structure/foundset.h b/glom/libglom/data_structure/foundset.h
index 5fd5f35..e1d8432 100644
--- a/glom/libglom/data_structure/foundset.h
+++ b/glom/libglom/data_structure/foundset.h
@@ -56,8 +56,7 @@ public:
//TODO: Avoid duplication with types in Formatting.
///field, ascending
typedef std::pair< std::shared_ptr<const LayoutItem_Field>, bool> type_pair_sort_field;
- typedef std::vector<type_pair_sort_field> type_sort_clause;
- type_sort_clause m_sort_clause;
+ std::vector<type_pair_sort_field> m_sort_clause;
};
} //namespace Glom
diff --git a/glom/libglom/data_structure/glomconversions.cc b/glom/libglom/data_structure/glomconversions.cc
index 9621701..fdb1cf7 100644
--- a/glom/libglom/data_structure/glomconversions.cc
+++ b/glom/libglom/data_structure/glomconversions.cc
@@ -263,8 +263,7 @@ Glib::ustring Conversions::format_tm(const tm& tm_data, const std::locale& local
//http://www.roguewave.com/support/docs/sourcepro/stdlibref/time-put.html
//Format it into this stream:
- typedef std::stringstream type_stream;
- type_stream the_stream;
+ std::stringstream the_stream;
the_stream.imbue(locale); //Make it format things for this locale. (Actually, I don't know if this is
necessary, because we mention the locale in the time_put<> constructor.
// Get a time_put face:
diff --git a/glom/libglom/document/bakery/view/view_composite.h
b/glom/libglom/document/bakery/view/view_composite.h
index a3963cb..1b612c3 100644
--- a/glom/libglom/document/bakery/view/view_composite.h
+++ b/glom/libglom/document/bakery/view/view_composite.h
@@ -93,8 +93,7 @@ public:
}
protected:
- typedef std::vector<type_view*> type_vec_views;
- type_vec_views m_vecViews;
+ std::vector<type_view*> m_vecViews;
};
} //namespace
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index 83e766b..5a43c29 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -1517,7 +1517,7 @@ Document::type_list_layout_groups Document::get_data_layout_groups(const Glib::u
const auto info = get_table_info(parent_table_name);
if(info)
{
- const DocumentTableInfo::type_layouts layouts = info->m_layouts;
+ const auto layouts = info->m_layouts;
//Look for the layout with this name:
auto iter = find_if_layout(layouts, layout_name, layout_platform);
@@ -1559,7 +1559,7 @@ void Document::set_data_layout_groups(const Glib::ustring& layout_name, const Gl
layout_info.m_layout_name = layout_name;
layout_info.m_layout_groups = groups;
- DocumentTableInfo::type_layouts& layouts = info->m_layouts;
+ auto& layouts = info->m_layouts;
auto iter = find_if_layout(layouts, layout_name, layout_platform);
if(iter == layouts.end())
layouts.emplace_back(layout_info);
diff --git a/glom/libglom/document/document.h b/glom/libglom/document/document.h
index cc0e93e..0421ab3 100644
--- a/glom/libglom/document/document.h
+++ b/glom/libglom/document/document.h
@@ -599,8 +599,7 @@ private:
type_vec_fields m_fields;
type_vec_relationships m_relationships;
- typedef std::vector< LayoutInfo > type_layouts;
- type_layouts m_layouts;
+ std::vector< LayoutInfo > m_layouts;
// map of report names to reports
std::unordered_map<Glib::ustring, std::shared_ptr<Report>> m_reports;
@@ -625,20 +624,17 @@ private:
std::shared_ptr<DocumentTableInfo> get_table_info(const Glib::ustring& table_name);
std::shared_ptr<const DocumentTableInfo> get_table_info(const Glib::ustring& table_name) const;
- typedef std::map<Glib::ustring, std::shared_ptr<DocumentTableInfo> > type_tables;
- type_tables m_tables;
+ std::map<Glib::ustring, std::shared_ptr<DocumentTableInfo> > m_tables;
//User groups:
- typedef std::map<Glib::ustring, GroupInfo> type_map_groups;
- type_map_groups m_groups;
+ std::map<Glib::ustring, GroupInfo> m_groups;
std::shared_ptr<DatabaseTitle> m_database_title;
Glib::ustring m_translation_original_locale;
std::vector<Glib::ustring> m_translation_available_locales; //Just a cache, based on other data.
- typedef std::map<Glib::ustring, Glib::ustring> type_map_library_scripts;
- type_map_library_scripts m_map_library_scripts;
+ std::map<Glib::ustring, Glib::ustring> m_map_library_scripts;
Glib::ustring m_startup_script;
diff --git a/glom/libglom/string_utils.cc b/glom/libglom/string_utils.cc
index 493ffae..0ac43bf 100644
--- a/glom/libglom/string_utils.cc
+++ b/glom/libglom/string_utils.cc
@@ -266,8 +266,7 @@ type_vec_strings string_separate(const Glib::ustring& str, const Glib::ustring&
const Glib::ustring::size_type size_separator = separator.size();
//A stack of quotes, so that we can handle nested quotes, whether they are " or ':
- typedef std::stack<Glib::ustring> type_queue_quotes;
- type_queue_quotes m_current_quotes;
+ std::stack<Glib::ustring> m_current_quotes;
Glib::ustring::size_type unprocessed_start = 0;
Glib::ustring::size_type item_start = 0;
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.h
b/glom/mode_data/datawidget/combochoiceswithtreemodel.h
index e93dc7e..2d05810 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.h
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.h
@@ -59,12 +59,10 @@ protected:
typedef Gtk::TreeModelColumn<Glib::ustring> type_model_column_string_fixed;
- typedef std::vector<std::unique_ptr<type_model_column_string_fixed>> type_vec_model_columns_string_fixed;
- type_vec_model_columns_string_fixed m_vec_model_columns_string_fixed; //If set_choices_fixed() was used.
+ std::vector<std::unique_ptr<type_model_column_string_fixed>> m_vec_model_columns_string_fixed; //If
set_choices_fixed() was used.
typedef Gtk::TreeModelColumn<Gnome::Gda::Value> type_model_column_value_fixed;
- typedef std::vector<std::unique_ptr<type_model_column_value_fixed>> type_vec_model_columns_value_fixed;
- type_vec_model_columns_value_fixed m_vec_model_columns_value_fixed; //If set_choices_fixed() was used.
+ std::vector<std::unique_ptr<type_model_column_value_fixed>> m_vec_model_columns_value_fixed; //If
set_choices_fixed() was used.
/** Get the index of the extra column, at the end, that is just a
* text representation of the first column, for use by GtkCombo with has-entry=true,
@@ -73,8 +71,7 @@ protected:
int get_fixed_model_text_column() const;
- typedef std::vector< std::shared_ptr<const LayoutItem_Field> > type_vec_const_layout_items;
- type_vec_const_layout_items m_db_layout_items; //If set_choices_related() was used.
+ std::vector< std::shared_ptr<const LayoutItem_Field> > m_db_layout_items; //If set_choices_related() was
used.
//This avoids us making on_cell_data() public just so that derived classes can use it,
//though that shouldn't be necessary anyway.
diff --git a/glom/mode_data/datawidget/treemodel_db.h b/glom/mode_data/datawidget/treemodel_db.h
index 77b89ec..26537e9 100644
--- a/glom/mode_data/datawidget/treemodel_db.h
+++ b/glom/mode_data/datawidget/treemodel_db.h
@@ -204,8 +204,7 @@ private:
guint m_data_model_columns_count; //1 less than m_columns_count, which also has a model column for the
key.
//TODO: Performance:
- typedef std::unordered_map<type_datamodel_row_index, DbTreeModelRow> type_map_rows;
- mutable type_map_rows m_map_rows; //mutable because getting fills the internal cache.
+ mutable std::unordered_map<type_datamodel_row_index, DbTreeModelRow> m_map_rows; //mutable because
getting fills the internal cache.
int m_count_extra_rows; //Rows that are not from the database.
int m_count_removed_rows; //A cache, instead of searching through the map.
int get_internal_rows_count() const;
diff --git a/glom/mode_data/flowtablewithfields.h b/glom/mode_data/flowtablewithfields.h
index 688d3da..3aeb6b3 100644
--- a/glom/mode_data/flowtablewithfields.h
+++ b/glom/mode_data/flowtablewithfields.h
@@ -229,18 +229,16 @@ private:
Gtk::CheckButton* m_checkbutton; //Used instead of first and second if it's a bool.
};
- typedef std::list<Info> type_listFields; //Map of IDs to full info.
- type_listFields m_listFields;
+ //Map of IDs to full info.
+ std::list<Info> m_listFields;
//Remember the nested FlowTables, so that we can search them for fields too:
- typedef std::list< FlowTableWithFields* > type_sub_flow_tables;
- type_sub_flow_tables m_sub_flow_tables;
+ std::list< FlowTableWithFields* > m_sub_flow_tables;
type_portals m_portals;
//Remember the sequence of LayoutWidgetBase widgets, so we can iterate over them later:
- typedef std::list< LayoutWidgetBase* > type_list_layoutwidgets;
- type_list_layoutwidgets m_list_layoutwidgets;
+ std::list<LayoutWidgetBase*> m_list_layoutwidgets;
void add_button(const std::shared_ptr<LayoutItem_Button>& layoutitem_button, const Glib::ustring&
table_name);
void add_textobject(const std::shared_ptr<LayoutItem_Text>& layoutitem_text, const Glib::ustring&
table_name);
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.h
b/glom/mode_design/print_layouts/window_print_layout_edit.h
index b58a6b1..fe1487a 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.h
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.h
@@ -172,11 +172,9 @@ private:
//A cache of the selected item,
//to avoid repeatedly requesting it:
- typedef std::vector< Glib::RefPtr<CanvasLayoutItem> > type_vec_canvas_items;
- type_vec_canvas_items m_layout_items_selected;
+ std::vector<Glib::RefPtr<CanvasLayoutItem>> m_layout_items_selected;
- typedef std::vector<sigc::connection> type_vec_connections;
- type_vec_connections m_connections_items_selected_moved;
+ std::vector<sigc::connection> m_connections_items_selected_moved;
//A copied item to be pasted later:
typedef LayoutGroup::type_list_items type_list_items;
diff --git a/glom/utility_widgets/flowtable.h b/glom/utility_widgets/flowtable.h
index 92df989..15cb7d8 100644
--- a/glom/utility_widgets/flowtable.h
+++ b/glom/utility_widgets/flowtable.h
@@ -71,8 +71,7 @@ private:
Glib::RefPtr<Gdk::Window> m_gdk_window;
//We remember the Boxes so we can delete them when the are no longer used.
- typedef std::list<Gtk::Box*> type_list_hboxes;
- type_list_hboxes m_list_hboxes;
+ std::list<Gtk::Box*> m_list_hboxes;
type_const_list_widgets m_list_first_widgets;
};
diff --git a/glom/utility_widgets/test_flowtable.cc b/glom/utility_widgets/test_flowtable.cc
index 61b2686..d769b32 100644
--- a/glom/utility_widgets/test_flowtable.cc
+++ b/glom/utility_widgets/test_flowtable.cc
@@ -41,8 +41,7 @@ void on_drag_data_get_entry(const Glib::RefPtr<Gdk::DragContext>&, Gtk::Selectio
}
*/
-typedef std::list<Gtk::Widget*> type_vec_widgets;
-type_vec_widgets vec_child_widgets;
+std::list<Gtk::Widget*> vec_child_widgets;
static void fill_flowtable(Glom::FlowTable& flowtable)
{
diff --git a/glom/variablesmap.h b/glom/variablesmap.h
index bbf535a..fd38ad5 100644
--- a/glom/variablesmap.h
+++ b/glom/variablesmap.h
@@ -76,8 +76,7 @@ private:
void transfer_one_widget(Gtk::Widget* pWidget, bool to_variable);
- typedef std::unordered_map<Gtk::Widget*, void*> type_mapWidgetsToVariables;
- type_mapWidgetsToVariables m_mapWidgetsToVariables;
+ std::unordered_map<Gtk::Widget*, void*> m_mapWidgetsToVariables;
Glib::RefPtr<Gtk::Builder> m_builder;
};
diff --git a/tests/test_selfhosting_new_empty_then_users.cc b/tests/test_selfhosting_new_empty_then_users.cc
index 5f16974..c3f5620 100644
--- a/tests/test_selfhosting_new_empty_then_users.cc
+++ b/tests/test_selfhosting_new_empty_then_users.cc
@@ -130,8 +130,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
}
- typedef std::vector<Glib::ustring> type_vec_strings;
- type_vec_strings table_names( {
+ std::vector<Glib::ustring> table_names( {
"sometable",
"SomeTableWithUpperCase",
"sometable with space characters",
@@ -179,7 +178,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
//Add groups:
- type_vec_strings group_names( {
+ std::vector<Glib::ustring> group_names( {
"somegroup1",
"somegroup with space characters",
"somegroup with a \" doublequote character",
@@ -199,7 +198,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
//Add users:
//TODO: Test strange passwords.
- type_vec_strings user_names( {
+ std::vector<Glib::ustring> user_names( {
"someuser1",
"someuser with space characters",
"someuser with a \" doublequote character",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]