[glom] libglom: Replace more std::lists with std::vector.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] libglom: Replace more std::lists with std::vector.
- Date: Mon, 23 Jan 2012 14:07:12 +0000 (UTC)
commit 850d2d6c9b6de3ef83b4d15b0881a6fc246db5d9
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Jan 23 15:06:02 2012 +0100
libglom: Replace more std::lists with std::vector.
* glom/libglom/connectionpool_backends/postgres_central.h:
* glom/libglom/data_structure/field.h:
* glom/libglom/data_structure/foundset.h:
* glom/libglom/data_structure/layout/fieldformatting.h:
* glom/libglom/data_structure/layout/layoutgroup.h:
* glom/libglom/document/document.h:
* glom/libglom/utils.h:
* glom/libglom/xsl_utils.h:
* glom/mode_data/datawidget/combo_as_radio_buttons.h:
This is more consistent.
ChangeLog | 15 +++++++++++++++
.../connectionpool_backends/postgres_central.h | 2 +-
glom/libglom/data_structure/field.h | 4 ++--
glom/libglom/data_structure/foundset.h | 4 ++--
.../data_structure/layout/fieldformatting.h | 6 +++---
glom/libglom/data_structure/layout/layoutgroup.h | 2 +-
glom/libglom/document/document.h | 8 ++++----
glom/libglom/utils.h | 6 +++---
glom/libglom/xsl_utils.h | 2 +-
glom/mode_data/datawidget/combo_as_radio_buttons.h | 4 ++--
10 files changed, 34 insertions(+), 19 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1a10b57..605e894 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
2012-01-23 Murray Cumming <murrayc murrayc com>
+ libglom: Replace more std::lists with std::vector.
+
+ * glom/libglom/connectionpool_backends/postgres_central.h:
+ * glom/libglom/data_structure/field.h:
+ * glom/libglom/data_structure/foundset.h:
+ * glom/libglom/data_structure/layout/fieldformatting.h:
+ * glom/libglom/data_structure/layout/layoutgroup.h:
+ * glom/libglom/document/document.h:
+ * glom/libglom/utils.h:
+ * glom/libglom/xsl_utils.h:
+ * glom/mode_data/datawidget/combo_as_radio_buttons.h:
+ This is more consistent.
+
+2012-01-23 Murray Cumming <murrayc murrayc com>
+
Document: Allow the database title to be translated.
* glom/libglom/filelist.am:
diff --git a/glom/libglom/connectionpool_backends/postgres_central.h b/glom/libglom/connectionpool_backends/postgres_central.h
index ef45c62..ae61024 100644
--- a/glom/libglom/connectionpool_backends/postgres_central.h
+++ b/glom/libglom/connectionpool_backends/postgres_central.h
@@ -53,7 +53,7 @@ private:
virtual bool create_database(const Glib::ustring& database_name, const Glib::ustring& username, const Glib::ustring& password);
private:
- typedef std::list<Glib::ustring> type_list_ports;
+ typedef std::vector<Glib::ustring> type_list_ports;
type_list_ports m_list_ports;
bool m_try_other_ports;
diff --git a/glom/libglom/data_structure/field.h b/glom/libglom/data_structure/field.h
index c616f7e..a7a421e 100644
--- a/glom/libglom/data_structure/field.h
+++ b/glom/libglom/data_structure/field.h
@@ -208,7 +208,7 @@ public:
/* Discover what fields are used in the calculation,
* so the value can be recalculated when their values change.
*/
- typedef std::list<Glib::ustring> type_list_strings;
+ typedef std::vector<Glib::ustring> type_list_strings;
type_list_strings get_calculation_relationships() const;
void set_visible(bool val = true);
@@ -250,7 +250,7 @@ private:
typedef std::map<glom_field_type, GType> type_map_glom_type_to_gda_type;
static type_map_glom_type_to_gda_type m_map_glom_type_to_gda_type;
- typedef std::list<glom_field_type> type_list_conversion_targets;
+ typedef std::vector<glom_field_type> type_list_conversion_targets;
typedef std::map<glom_field_type, type_list_conversion_targets> type_map_conversions;
static type_map_type_names m_map_type_names; //These are canonical, for internal use.
diff --git a/glom/libglom/data_structure/foundset.h b/glom/libglom/data_structure/foundset.h
index 0ffab3c..9e08f18 100644
--- a/glom/libglom/data_structure/foundset.h
+++ b/glom/libglom/data_structure/foundset.h
@@ -22,7 +22,7 @@
#define GLOM_DATASTRUCTURE_FOUNDSET_H
#include <glibmm/ustring.h>
-#include <list>
+#include <vector>
#include <utility> //For std::pair
#include <libglom/data_structure/layout/layoutitem_field.h>
#include <libglom/sharedptr.h>
@@ -50,7 +50,7 @@ public:
//TODO: Avoid duplication with types in FieldFormatting.
///field, ascending
typedef std::pair< sharedptr<const LayoutItem_Field>, bool> type_pair_sort_field;
- typedef std::list<type_pair_sort_field> type_sort_clause;
+ typedef std::vector<type_pair_sort_field> type_sort_clause;
type_sort_clause m_sort_clause;
};
diff --git a/glom/libglom/data_structure/layout/fieldformatting.h b/glom/libglom/data_structure/layout/fieldformatting.h
index 3d97023..1826568 100644
--- a/glom/libglom/data_structure/layout/fieldformatting.h
+++ b/glom/libglom/data_structure/layout/fieldformatting.h
@@ -26,7 +26,7 @@
#include <libglom/data_structure/relationship.h>
#include <libglom/data_structure/choicevalue.h>
#include <libgdamm/value.h>
-#include <list>
+#include <vector>
namespace Glom
{
@@ -55,7 +55,7 @@ public:
bool get_has_custom_choices() const;
void set_has_custom_choices(bool val = true);
- typedef std::list< sharedptr<ChoiceValue> > type_list_values;
+ typedef std::vector< sharedptr<ChoiceValue> > type_list_values;
virtual type_list_values get_choices_custom() const;
virtual void set_choices_custom(const type_list_values& choices);
@@ -70,7 +70,7 @@ public:
Glib::ustring get_custom_choice_translated(const Glib::ustring& original_text, const Glib::ustring& locale = Glib::ustring()) const;
typedef std::pair< sharedptr<const LayoutItem_Field>, bool /* is_ascending */> type_pair_sort_field;
- typedef std::list<type_pair_sort_field> type_list_sort_fields;
+ typedef std::vector<type_pair_sort_field> type_list_sort_fields;
/** Discover whether the entered data should only be one of the available
* choices.
diff --git a/glom/libglom/data_structure/layout/layoutgroup.h b/glom/libglom/data_structure/layout/layoutgroup.h
index 1e46097..10f3f61 100644
--- a/glom/libglom/data_structure/layout/layoutgroup.h
+++ b/glom/libglom/data_structure/layout/layoutgroup.h
@@ -22,7 +22,7 @@
#define GLOM_DATASTRUCTURE_LAYOUTGROUP_H
#include <libglom/data_structure/layout/layoutitem_field.h>
-#include <list>
+#include <vector>
namespace Glom
{
diff --git a/glom/libglom/document/document.h b/glom/libglom/document/document.h
index 284521f..12089e0 100644
--- a/glom/libglom/document/document.h
+++ b/glom/libglom/document/document.h
@@ -214,7 +214,7 @@ public:
typedef std::pair< sharedptr<LayoutItem_Field>, sharedptr<Relationship> > type_pairFieldTrigger;
- typedef std::list<type_pairFieldTrigger> type_list_lookups;
+ typedef std::vector<type_pairFieldTrigger> type_list_lookups;
/** Get the fields whose values should be looked up when @a field_name changes, with
* the relationship used to lookup the value.
@@ -279,7 +279,7 @@ public:
///When a relationship name is changed, change it in layouts and reports:
void change_relationship_name(const Glib::ustring& table_name, const Glib::ustring& name, const Glib::ustring& name_new);
- typedef std::list< sharedptr<TableInfo> > type_listTableInfo;
+ typedef std::vector< sharedptr<TableInfo> > type_listTableInfo;
type_listTableInfo get_tables(bool plus_system_prefs = false) const;
std::vector<Glib::ustring> get_table_names(bool plus_system_prefs = false) const;
@@ -339,7 +339,7 @@ public:
void set_startup_script(const Glib::ustring& script);
/// These are only used when recreating a database from an example file. The actualy access-control is on the server, of course.
- typedef std::list<GroupInfo> type_list_groups;
+ typedef std::vector<GroupInfo> type_list_groups;
type_list_groups get_groups() const;
/// This adds the group if necessary.
@@ -621,7 +621,7 @@ private:
type_vec_fields m_fields;
type_vec_relationships m_relationships;
- typedef std::list< LayoutInfo > type_layouts;
+ typedef std::vector< LayoutInfo > type_layouts;
type_layouts m_layouts;
typedef std::map< Glib::ustring, sharedptr<Report> > type_reports; //map of report names to reports
diff --git a/glom/libglom/utils.h b/glom/libglom/utils.h
index 3f456c9..afd11f5 100644
--- a/glom/libglom/utils.h
+++ b/glom/libglom/utils.h
@@ -35,7 +35,7 @@ namespace Glom
///field, ascending
typedef std::pair< sharedptr<const LayoutItem_Field>, bool> type_pair_sort_field;
-typedef std::list<type_pair_sort_field> type_sort_clause;
+typedef std::vector<type_pair_sort_field> type_sort_clause;
namespace Utils
{
@@ -133,8 +133,8 @@ Glib::RefPtr<Gnome::Gda::SqlBuilder> build_sql_update_with_where_clause(
const sharedptr<const Field>& field, const Gnome::Gda::Value& value,
const Gnome::Gda::SqlExpr& where_clause);
-typedef std::list<Gnome::Gda::Value> type_list_values;
-typedef std::list< std::pair<Gnome::Gda::Value, type_list_values> > type_list_values_with_second; //TODO: Rename this now that we have more than just 1 extra field.
+typedef std::vector<Gnome::Gda::Value> type_list_values;
+typedef std::vector< std::pair<Gnome::Gda::Value, type_list_values> > type_list_values_with_second; //TODO: Rename this now that we have more than just 1 extra field.
type_list_values_with_second get_choice_values_all(const Document* document, const sharedptr<const LayoutItem_Field>& field);
type_list_values_with_second get_choice_values(const Document* document, const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& foreign_key_value);
diff --git a/glom/libglom/xsl_utils.h b/glom/libglom/xsl_utils.h
index 2107e9e..223e8f8 100644
--- a/glom/libglom/xsl_utils.h
+++ b/glom/libglom/xsl_utils.h
@@ -33,7 +33,7 @@ namespace Glom
///field, ascending
typedef std::pair< sharedptr<const LayoutItem_Field>, bool> type_pair_sort_field;
-typedef std::list<type_pair_sort_field> type_sort_clause;
+typedef std::vector<type_pair_sort_field> type_sort_clause;
namespace GlomXslUtils
{
diff --git a/glom/mode_data/datawidget/combo_as_radio_buttons.h b/glom/mode_data/datawidget/combo_as_radio_buttons.h
index 5aa277c..f90e8dc 100644
--- a/glom/mode_data/datawidget/combo_as_radio_buttons.h
+++ b/glom/mode_data/datawidget/combo_as_radio_buttons.h
@@ -71,8 +71,8 @@ public:
private:
void init();
- typedef std::list<Gnome::Gda::Value> type_list_values;
- typedef std::list< std::pair<Gnome::Gda::Value, type_list_values> > type_list_values_with_second;
+ typedef std::vector<Gnome::Gda::Value> type_list_values;
+ typedef std::vector< std::pair<Gnome::Gda::Value, type_list_values> > type_list_values_with_second;
//A utility function that's needed because we don't use a real db model:
void set_choices_with_second(const type_list_values_with_second& list_values);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]