[glom/glom-1-16] Fix the build.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/glom-1-16] Fix the build.
- Date: Mon, 18 Oct 2010 12:55:50 +0000 (UTC)
commit 9aa69757c6f96ca78445d03cd735bb3148cfb575
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Oct 18 14:55:36 2010 +0200
Fix the build.
* glom/mode_data/flowtablewithfields.cc: Use Gtk::AlignmentEnum instead of
Gtk::Align because this is for gtkmm 2.22, not gtkmm 3.
ChangeLog | 9 +++++++-
glom/libglom/example_document_load.cc | 9 ++-----
glom/libglom/test_connectionpool.cc | 12 +++-------
glom/libglom/test_sharedptr_layoutitem.cc | 17 +++++---------
glom/mode_data/flowtablewithfields.cc | 2 +-
tests/test_document_autosave.cc | 1 +
tests/test_document_load.cc | 23 ++++++++-----------
tests/test_parsing_time.cc | 9 ++++---
tests/test_python_execute_func.cc | 4 +-
tests/test_python_execute_func_bad_syntax.cc | 8 +++---
.../test_python_execute_func_change_result_type.cc | 4 +-
tests/test_python_execute_script.cc | 7 +++--
tests/test_selfhosting_new_empty.cc | 1 +
tests/test_selfhosting_new_from_example.cc | 8 +-----
14 files changed, 53 insertions(+), 61 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a23011e..72794b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,16 @@
+2010-10-18 Murray Cumming <murrayc murrayc com>
+
+ Fix the build.
+
+ * glom/mode_data/flowtablewithfields.cc: Use Gtk::AlignmentEnum instead of
+ Gtk::Align because this is for gtkmm 2.22, not gtkmm 3.
+
2010-09-15 Murray Cumming <murrayc murrayc com>
Replace use of ALIGN_LEFT/RIGHT/TOP/BOTTOM with START/END.
* glom/mode_data/flowtablewithfields.cc:
- * glom/print_layout/canvas_layout_item.cc: Use only the non-deprecated
+ * glom/print_layout/canvas_layout_item.cc: Use only the non-deprecated
enum values.
2010-10-14 Murray Cumming <murrayc murrayc com>
diff --git a/glom/libglom/example_document_load.cc b/glom/libglom/example_document_load.cc
index 06cc263..37171c7 100644
--- a/glom/libglom/example_document_load.cc
+++ b/glom/libglom/example_document_load.cc
@@ -24,6 +24,8 @@
#include <libglom/document/document.h>
#include <libglom/init.h>
+#include <iostream>
+
void print_layout_group(const Glom::sharedptr<Glom::LayoutGroup>& layout_group, const Glib::ustring& indent)
{
if(!layout_group)
@@ -76,20 +78,15 @@ int main()
// Get a URI for a test file:
Glib::ustring uri;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
uri = Glib::filename_to_uri("/usr/share/glom/doc/examples/example_music_collection.glom");
}
catch(const Glib::ConvertError& ex)
{
- std::cerr << "Exception from Glib::filename_to_uri(): " << ex.what();
+ std::cerr << G_STRFUNC << ": " << ex.what();
return 1;
}
- #else
- std::auto_ptr<Glib::Error> ex;
- uri = Glib::filename_to_uri("/usr/share/glom/doc/examples/example_music_collection.glom", ex);
- #endif
std::cout << "URI=" << uri << std::endl;
diff --git a/glom/libglom/test_connectionpool.cc b/glom/libglom/test_connectionpool.cc
index 9e1ff0e..dbea932 100644
--- a/glom/libglom/test_connectionpool.cc
+++ b/glom/libglom/test_connectionpool.cc
@@ -17,7 +17,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-
+
#include <libgdamm/init.h>
#include <libglom/connectionpool.h>
@@ -29,9 +29,9 @@
#include <libglom/connectionpool_backends/sqlite.h>
#endif //#GLOM_ENABLE_POSTGRESQL
+#include <iostream>
-int
-main()
+int main()
{
Gnome::Gda::init();
@@ -71,6 +71,7 @@ main()
connection = Glom::ConnectionPool::get_and_connect(error);
#endif
+
if(connection)
std::cout << "Connected" << std::endl;
else
@@ -86,8 +87,3 @@ main()
return 0;
}
-
-
-
-
-
diff --git a/glom/libglom/test_sharedptr_layoutitem.cc b/glom/libglom/test_sharedptr_layoutitem.cc
index c4afd5b..155e7e2 100644
--- a/glom/libglom/test_sharedptr_layoutitem.cc
+++ b/glom/libglom/test_sharedptr_layoutitem.cc
@@ -17,18 +17,18 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-
+
#include <libglom/data_structure/layout/layoutgroup.h>
#include <libglom/data_structure/layout/layoutitem_field.h>
+#include <iostream>
-int
-main()
+int main()
{
Glom::sharedptr<Glom::LayoutItem_Field> field_copy;
{
Glom::sharedptr<Glom::LayoutGroup> group;
-
+
{
Glom::sharedptr<Glom::LayoutGroup> group_inscope = Glom::sharedptr<Glom::LayoutGroup>::create();
std::cout << "group_inscope refcount = " << *(group_inscope._get_refcount()) << std::endl; //Should be 1.
@@ -38,7 +38,7 @@ main()
Glom::sharedptr<Glom::LayoutItem> itemgroup = group_inscope;
std::cout << "itemgroup refcount = " << *(itemgroup._get_refcount()) << std::endl; //Should be 2.
- Glom::sharedptr<Glom::LayoutGroup> group_casted = Glom::sharedptr<Glom::LayoutGroup>::cast_dynamic(itemgroup);
+ Glom::sharedptr<Glom::LayoutGroup> group_casted = Glom::sharedptr<Glom::LayoutGroup>::cast_dynamic(itemgroup);
std::cout << "itemgroup refcount = " << *(itemgroup._get_refcount()) << std::endl; //Should be 3.
std::cout << "group_casted refcount = " << *(group_casted._get_refcount()) << std::endl; //Should be 3
@@ -67,7 +67,7 @@ main()
Glom::sharedptr<Glom::LayoutItem_Field> item_casted = Glom::sharedptr<Glom::LayoutItem_Field>::cast_dynamic(item);
std::cout << "group item_casted refcount = " << *(item_casted._get_refcount()) << std::endl; //Should be 4.
-
+
std::cout << "group item_casted name = " << item_casted->get_name() << std::endl;
field_copy = item_casted;
@@ -79,8 +79,3 @@ main()
return 0;
}
-
-
-
-
-
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index aa94c77..f9a3130 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -635,7 +635,7 @@ void FlowTableWithFields::add_textobject_at_position(const sharedptr<LayoutItem_
const FieldFormatting::HorizontalAlignment alignment =
layoutitem_text->get_formatting_used_horizontal_alignment();
- const Gtk::Align x_align = (alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT ? Gtk::ALIGN_START : Gtk::ALIGN_END);
+ const Gtk::AlignmentEnum x_align = (alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT ? Gtk::ALIGN_START : Gtk::ALIGN_END);
Gtk::Alignment* alignment_label = Gtk::manage(new Gtk::Alignment());
alignment_label->set(x_align, Gtk::ALIGN_CENTER);
alignment_label->show();
diff --git a/tests/test_document_autosave.cc b/tests/test_document_autosave.cc
index 9ef3496..a7bbfd9 100644
--- a/tests/test_document_autosave.cc
+++ b/tests/test_document_autosave.cc
@@ -21,6 +21,7 @@
#include <libglom/document/document.h>
#include <libglom/init.h>
#include <giomm/file.h>
+#include <iostream>
Glib::ustring file_uri;
diff --git a/tests/test_document_load.cc b/tests/test_document_load.cc
index 9510ad8..b2fcf4b 100644
--- a/tests/test_document_load.cc
+++ b/tests/test_document_load.cc
@@ -22,10 +22,12 @@
#include <libglom/init.h>
#include <giomm/file.h>
+#include <iostream>
+
template<typename T_Container>
bool contains(const T_Container& container, const Glib::ustring& name)
{
- typename T_Container::const_iterator iter =
+ typename T_Container::const_iterator iter =
std::find(container.begin(), container.end(), name);
return iter != container.end();
}
@@ -34,8 +36,8 @@ template<typename T_Container>
bool contains_named(const T_Container& container, const Glib::ustring& name)
{
typedef typename T_Container::value_type::object_type type_item;
- typename T_Container::const_iterator iter =
- std::find_if(container.begin(), container.end(),
+ typename T_Container::const_iterator iter =
+ std::find_if(container.begin(), container.end(),
Glom::predicate_FieldHasName<type_item>(name));
return iter != container.end();
}
@@ -47,23 +49,18 @@ int main()
// Get a URI for a test file:
Glib::ustring uri;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- const std::string path =
- Glib::build_filename(GLOM_DOCDIR_EXAMPLES_NOTINSTALLED,
+ const std::string path =
+ Glib::build_filename(GLOM_DOCDIR_EXAMPLES_NOTINSTALLED,
"example_music_collection.glom");
uri = Glib::filename_to_uri(path);
}
catch(const Glib::ConvertError& ex)
{
- std::cerr << "Exception from Glib::filename_to_uri(): " << ex.what();
+ std::cerr << G_STRFUNC << ": " << ex.what();
return EXIT_FAILURE;
}
- #else
- std::auto_ptr<Glib::Error> ex;
- uri = Glib::filename_to_uri("/usr/share/glom/doc/examples/example_music_collection.glom", ex);
- #endif
//std::cout << "URI=" << uri << std::endl;
@@ -115,14 +112,14 @@ int main()
g_assert(field->get_glom_type() == Glom::Field::TYPE_NUMERIC);
g_assert(!field->get_auto_increment());
g_assert(!field->get_unique_key());
-
+
//Check a relationship:
const Glom::sharedptr<const Glom::Relationship> relationship = document.get_relationship("albums", "artist");
g_assert(relationship);
g_assert(relationship->get_from_field() == "artist_id");
g_assert(relationship->get_to_table() == "artists");
g_assert(relationship->get_to_field() == "artist_id");
-
+
Glom::libglom_deinit();
return EXIT_SUCCESS;
diff --git a/tests/test_parsing_time.cc b/tests/test_parsing_time.cc
index 13a3933..74187f1 100644
--- a/tests/test_parsing_time.cc
+++ b/tests/test_parsing_time.cc
@@ -1,4 +1,5 @@
#include <libglom/data_structure/glomconversions.h>
+#include <iostream>
int main()
{
@@ -9,9 +10,9 @@ int main()
bool success = false;
- //We try parse_time() though parse_value() calls it anyway,
+ //We try parse_time() though parse_value() calls it anyway,
//to give us a clue if parse_value would fail.
- struct tm value_as_tm =
+ struct tm value_as_tm =
Glom::Conversions::parse_time(time_text_input, success);
if(!success)
{
@@ -20,7 +21,7 @@ int main()
}
success = false;
- const Gnome::Gda::Value value =
+ const Gnome::Gda::Value value =
Glom::Conversions::parse_value(Glom::Field::TYPE_TIME, time_text_input, success);
if(!success)
@@ -44,7 +45,7 @@ int main()
return EXIT_FAILURE;
}
- const Glib::ustring time_text_parsed =
+ const Glib::ustring time_text_parsed =
Glom::Conversions::get_text_for_gda_value(Glom::Field::TYPE_TIME, value);
diff --git a/tests/test_python_execute_func.cc b/tests/test_python_execute_func.cc
index d6b4b46..8c6f5b5 100644
--- a/tests/test_python_execute_func.cc
+++ b/tests/test_python_execute_func.cc
@@ -1,8 +1,8 @@
#include <glom/libglom/init.h>
#include <glom/python_embed/glom_python.h>
#include <libglom/data_structure/glomconversions.h>
-
#include <boost/python.hpp>
+#include <iostream>
int main()
{
@@ -40,7 +40,7 @@ int main()
//Check that there was no python error:
g_assert(error_message.empty());
-
+
//Check that the return value is of the expected type:
g_assert(value.get_value_type() == GDA_TYPE_NUMERIC);
diff --git a/tests/test_python_execute_func_bad_syntax.cc b/tests/test_python_execute_func_bad_syntax.cc
index 500067e..152b2dc 100644
--- a/tests/test_python_execute_func_bad_syntax.cc
+++ b/tests/test_python_execute_func_bad_syntax.cc
@@ -1,14 +1,14 @@
#include <glom/libglom/init.h>
#include <glom/python_embed/glom_python.h>
#include <libglom/data_structure/glomconversions.h>
-
#include <boost/python.hpp>
+#include <iostream>
int main()
{
Glom::libglom_init(); //Also initializes python.
- const char* calculation =
+ const char* calculation =
"count = 0\n"
"return cownt";
Glom::type_map_fields field_values;
@@ -40,10 +40,10 @@ int main()
//std::cout << "type=" << g_type_name(value.get_value_type()) << std::endl;
//std::cout << "value=" << value.to_string() << std::endl;
-
+
//Check that we received a traceback error:
g_assert(!error_message.empty());
-
+
//Check that the return value is of the expected type:
g_assert(value.get_value_type() == GDA_TYPE_NUMERIC);
diff --git a/tests/test_python_execute_func_change_result_type.cc b/tests/test_python_execute_func_change_result_type.cc
index 720cd14..e09edba 100644
--- a/tests/test_python_execute_func_change_result_type.cc
+++ b/tests/test_python_execute_func_change_result_type.cc
@@ -1,8 +1,8 @@
#include <glom/libglom/init.h>
#include <glom/python_embed/glom_python.h>
#include <libglom/data_structure/glomconversions.h>
-
#include <boost/python.hpp>
+#include <iostream>
int main()
{
@@ -41,7 +41,7 @@ int main()
//Check that there was no python error:
g_assert(error_message.empty());
-
+
//Check that the return value is of the expected type:
g_assert(Glom::Field::get_glom_type_for_gda_type(value.get_value_type()) == result_type);
diff --git a/tests/test_python_execute_script.cc b/tests/test_python_execute_script.cc
index 8b0720a..a51554d 100644
--- a/tests/test_python_execute_script.cc
+++ b/tests/test_python_execute_script.cc
@@ -1,5 +1,6 @@
#include <glom/libglom/init.h>
#include <glom/python_embed/glom_python.h>
+#include <iostream>
//Store results from the callbacks and check them later:
Glib::ustring result_table_name_list;
@@ -11,13 +12,13 @@ bool result_started_new_record = false;
static void on_script_ui_show_table_list(const Glib::ustring& table_name)
{
- //std::cout << "debug: on_script_ui_show_table_list(): table_name=" << table_name << std::endl;
+ //std::cout << "debug: " << G_STRFUNC << ": table_name=" << table_name << std::endl;
result_table_name_list = table_name;
}
static void on_script_ui_show_table_details(const Glib::ustring& table_name, const Gnome::Gda::Value& primary_key_value)
{
- //std::cout << "debug: on_script_ui_show_table_details(): table_name=" << table_name
+ //std::cout << "debug: " << G_STRFUNC << ": table_name=" << table_name
// << ", primary_key_value=" << primary_key_value.to_string() << std::endl;
result_table_name_details = table_name;
result_primary_key_value_details = primary_key_value;
@@ -94,7 +95,7 @@ int main()
}
g_assert(error_message.empty());
-
+
//Check that the callbacks received the expected values:
g_assert(result_table_name_list == table_name_input);
g_assert(result_table_name_details == table_name_details_input);
diff --git a/tests/test_selfhosting_new_empty.cc b/tests/test_selfhosting_new_empty.cc
index ed6905e..8568c10 100644
--- a/tests/test_selfhosting_new_empty.cc
+++ b/tests/test_selfhosting_new_empty.cc
@@ -25,6 +25,7 @@
#include <libglom/privs.h>
#include <libglom/utils.h>
#include <giomm/file.h>
+#include <iostream>
static void on_initialize_progress()
{
diff --git a/tests/test_selfhosting_new_from_example.cc b/tests/test_selfhosting_new_from_example.cc
index d085587..a36bac6 100644
--- a/tests/test_selfhosting_new_from_example.cc
+++ b/tests/test_selfhosting_new_from_example.cc
@@ -25,6 +25,7 @@
#include <libglom/privs.h>
#include <libglom/db_utils.h>
#include <giomm/file.h>
+#include <iostream>
static void on_initialize_progress()
{
@@ -113,7 +114,6 @@ int main()
// Get a URI for a test file:
Glib::ustring uri;
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
const std::string path =
@@ -123,13 +123,9 @@ int main()
}
catch(const Glib::ConvertError& ex)
{
- std::cerr << "Exception from Glib::filename_to_uri(): " << ex.what();
+ std::cerr << G_STRFUNC << ": " << ex.what();
return EXIT_FAILURE;
}
- #else
- std::auto_ptr<Glib::Error> ex;
- uri = Glib::filename_to_uri("/usr/share/glom/doc/examples/example_music_collection.glom", ex);
- #endif
//std::cout << "URI=" << uri << std::endl;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]