Commit acc0c326 authored by Murray Cumming's avatar Murray Cumming
Browse files

C++11: Remove more unnecessary typedefs.

These were useful before we used auto with C++11.
parent 057767a2
......@@ -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)
......
......@@ -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;
};
......
......@@ -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;
};
......
......@@ -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;
};
......
......@@ -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
......
......@@ -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:
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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.
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
};
......
......@@ -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)
{
......
......@@ -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;
};
......
......@@ -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",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment