[glom] Import tests: Slight code-style change.



commit 331edc2e9220a3ec1c7a841829caaab5fa4b3a2d
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Nov 12 16:29:31 2010 +0100

    Import tests: Slight code-style change.
    
    	* tests/import/utils.[h|cc]: Remove the MainLoop typedef because it just
    	obscures things.

 ChangeLog             |   19 +++++++++++++------
 tests/import/utils.cc |   16 ++++++++--------
 tests/import/utils.h  |    2 --
 3 files changed, 21 insertions(+), 16 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 12481ab..e77cdd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,22 +1,29 @@
 2010-11-12  Murray Cumming  <murrayc murrayc com>
 
+	Import tests: Slight code-style change.
+
+	* tests/import/utils.[h|cc]: Remove the MainLoop typedef because it just
+	obscures things.
+
+2010-11-12  Murray Cumming  <murrayc murrayc com>
+
 	CSV Import: Actually preview and import the field values.
 
-	* glom/import_csv/csv_parser.cc: advance_field(): Remove an excess continue, 
-	so that we actually add the character to the field's text. This error 
+	* glom/import_csv/csv_parser.cc: advance_field(): Remove an excess continue,
+	so that we actually add the character to the field's text. This error
 	was probably introduced while removing the non-exceptions ifdefs.
 	This fixed bug #625693 (maximiliano).
-	
+
 	We really must fix those import unit tests so that something like this does
 	not happen again.
 
 2010-11-11  Murray Cumming  <murrayc murrayc com>
 
 	List view: Make the retry option actually work afer entering invalid data.
-	
+
 	* glom/mode_data/db_adddel/db_adddel.[h|cc]: on_treeview_cell_edited():
-	If the user chooses to retry the edit, remember what he entered, and restart 
-	the editing (in an idle handler, to avoid confusing the treeview), with 
+	If the user chooses to retry the edit, remember what he entered, and restart
+	the editing (in an idle handler, to avoid confusing the treeview), with
 	that text.
 	This fixes bug #167818
 
diff --git a/tests/import/utils.cc b/tests/import/utils.cc
index a19994e..f639f41 100644
--- a/tests/import/utils.cc
+++ b/tests/import/utils.cc
@@ -26,9 +26,9 @@ static std::string create_file_from_buffer(const char* input, guint input_size)
   std::string file_uri;
   //TODO: Catch exception.
   file_uri = Glib::filename_to_uri(tmp_filename);
-  
+
   Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(file_uri);
-  
+
   gssize result = 0;
   //TODO: Catch exception.
   result = file->append_to()->write(input, input_size);
@@ -37,28 +37,28 @@ static std::string create_file_from_buffer(const char* input, guint input_size)
   return file_uri;
 }
 
-static void on_mainloop_killed_by_watchdog(MainLoopRp mainloop)
+static void on_mainloop_killed_by_watchdog(const Glib::RefPtr<Glib::MainLoop>& mainloop)
 {
   finished_parsing = false;
   //Quit the mainloop that we ran because the parser uses an idle handler.
   mainloop->quit();
 }
 
-static void on_parser_encoding_error(MainLoopRp mainloop)
+static void on_parser_encoding_error(const Glib::RefPtr<Glib::MainLoop>& mainloop)
 {
   finished_parsing = true;
   //Quit the mainloop that we ran because the parser uses an idle handler.
   mainloop->quit();
 }
 
-static void on_parser_finished(MainLoopRp mainloop)
+static void on_parser_finished(const Glib::RefPtr<Glib::MainLoop>& mainloop)
 {
   finished_parsing = true;
   //Quit the mainloop that we ran because the parser uses an idle handler.
   mainloop->quit();
 }
 
-static void on_file_read_error(const std::string& /*unused*/, MainLoopRp mainloop)
+static void on_file_read_error(const std::string& /*unused*/, const Glib::RefPtr<Glib::MainLoop>& mainloop)
 {
   finished_parsing = true;
   //Quit the mainloop that we ran because the parser uses an idle handler.
@@ -76,7 +76,7 @@ bool run_parser_from_buffer(const FuncConnectParserSignals& connect_parser_signa
 
   //Start a mainloop because the parser uses an idle handler.
   //TODO: Stop the parser from doing that.
-  MainLoopRp mainloop = Glib::MainLoop::create();
+  Glib::RefPtr<Glib::MainLoop> mainloop = Glib::MainLoop::create();
   Glom::CsvParser parser("UTF-8");
 
   parser.signal_encoding_error().connect(sigc::bind(&on_parser_encoding_error, mainloop));
@@ -111,7 +111,7 @@ bool run_parser_on_file(const FuncConnectParserSignals& connect_parser_signals,
 
   //Start a mainloop because the parser uses an idle handler.
   //TODO: Stop the parser from doing that.
-  MainLoopRp mainloop = Glib::MainLoop::create();
+  Glib::RefPtr<Glib::MainLoop> mainloop = Glib::MainLoop::create();
   Glom::CsvParser parser("UTF-8");
 
   parser.signal_encoding_error().connect(sigc::bind(&on_parser_encoding_error, mainloop));
diff --git a/tests/import/utils.h b/tests/import/utils.h
index ae0c811..5eacd82 100644
--- a/tests/import/utils.h
+++ b/tests/import/utils.h
@@ -10,7 +10,6 @@ namespace ImportTests
 bool check(const std::string& name, bool test, std::stringstream& report);
 
 typedef sigc::slot<void, Glom::CsvParser&> FuncConnectParserSignals;
-typedef Glib::RefPtr<Glib::MainLoop> MainLoopRp;
 
 /**
  * @result Whether the parser finished without being killed by a timeout.
@@ -30,4 +29,3 @@ bool run_parser_on_file(const FuncConnectParserSignals& connect_parser_signals,
 } // namespace ImportTests
 
 #endif //TEST_IMPORT_UTILS_H
-



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]