Commit 903e42b7 authored by Murray Cumming's avatar Murray Cumming
Browse files

Minor whitespace consistency changes

parent 2da48fd1
......@@ -151,7 +151,7 @@ bool AppWindow_WithDoc::open_document(const Glib::ustring& file_uri)
if(bOpenFailed)
{
if (bShowError)
if(bShowError)
ui_warning_load_failed(failure_code);
//Make sure that non-existant files are removed from the history list:
......
......@@ -313,7 +313,7 @@ Glib::RefPtr<Gnome::Gda::Connection> Base_DB::get_connection()
{
sharedconnection = connect_to_server();
}
catch (const Glib::Error& error)
catch(const Glib::Error& error)
{
std::cerr << G_STRFUNC << ": " << error.what() << std::endl;
}
......
......@@ -500,7 +500,7 @@ Glib::ustring Conversions::get_text_for_gda_value(Field::glom_field_type glom_ty
{
return value.get_string();
}
else if (glom_type == Field::TYPE_BOOLEAN)
else if(glom_type == Field::TYPE_BOOLEAN)
{
//This is used only by Field::to_file_format(),
//and should never be shown in the UI.
......@@ -509,7 +509,7 @@ Glib::ustring Conversions::get_text_for_gda_value(Field::glom_field_type glom_ty
else
return "FALSE";
}
else if (glom_type == Field::TYPE_IMAGE)
else if(glom_type == Field::TYPE_IMAGE)
{
//This function is only used for :
//- UI-visible strings, but images should never be shown as text in the UI.
......
......@@ -47,7 +47,7 @@ static Glib::RefPtr<Gnome::Gda::Connection> get_connection()
{
sharedconnection = ConnectionPool::get_and_connect();
}
catch (const Glib::Error& error)
catch(const Glib::Error& error)
{
std::cerr << G_STRFUNC << ": " << error.what() << std::endl;
}
......
......@@ -49,7 +49,7 @@ void libglom_init()
//Threading is always enabled starting from GLib 2.31.0:
//TODO: Just remove this when we can increase the glibmm version needed:
#if !GLIB_CHECK_VERSION (2, 31, 0)
if (!Glib::thread_supported())
if(!Glib::thread_supported())
Glib::thread_init(0); //So we can use GMutex.
#endif
......
......@@ -279,7 +279,7 @@ static Glib::RefPtr<Gnome::Gda::Connection> get_connection()
{
sharedconnection = ConnectionPool::get_and_connect();
}
catch (const Glib::Error& error)
catch(const Glib::Error& error)
{
std::cerr << G_STRFUNC << ": " << error.what() << std::endl;
}
......
......@@ -40,7 +40,7 @@ glom_pygda_value_from_pyobject(GValue* boxed, const boost::python::object& input
we must still have the get_*() functions in the python API.
*/
if (G_IS_VALUE (boxed))
if(G_IS_VALUE (boxed))
g_value_unset(boxed);
PyObject* input_c = input.ptr();
......@@ -182,15 +182,15 @@ boost::python::object glom_pygda_value_as_boost_pyobject(const Glib::ValueBase&
}
#endif
if (value_type == G_TYPE_INT64) {
if(value_type == G_TYPE_INT64) {
ret = boost::python::object(g_value_get_int64(boxed));
} else if (value_type == G_TYPE_UINT64) {
} else if(value_type == G_TYPE_UINT64) {
ret = boost::python::object(g_value_get_uint64(boxed));
} else if (value_type == GDA_TYPE_BINARY) {
} else if(value_type == GDA_TYPE_BINARY) {
const GdaBinary* gdabinary = gda_value_get_binary(boxed);
if(gdabinary)
ret = boost::python::object((const char*)gdabinary->data); /* TODO: Use the size. TODO: Check for null GdaBinary. */
} else if (value_type == GDA_TYPE_BLOB) {
} else if(value_type == GDA_TYPE_BLOB) {
const GdaBlob* gdablob = gda_value_get_blob (boxed);
if(gdablob && gdablob->op)
{
......@@ -199,10 +199,10 @@ boost::python::object glom_pygda_value_as_boost_pyobject(const Glib::ValueBase&
ret = boost::python::object((const char*)gdablob->data.data); /* TODO: Use the size. TODO: Check for null GdaBinary. */
}
}
} else if (value_type == G_TYPE_BOOLEAN) {
} else if(value_type == G_TYPE_BOOLEAN) {
ret = boost::python::object((bool)g_value_get_boolean(boxed));
#if PY_VERSION_HEX >= 0x02040000
} else if (value_type == G_TYPE_DATE) {
} else if(value_type == G_TYPE_DATE) {
const GDate* val = (const GDate*)g_value_get_boxed(boxed);
if(val)
......@@ -220,28 +220,28 @@ boost::python::object glom_pygda_value_as_boost_pyobject(const Glib::ValueBase&
ret = boost::python::object( (boost::python::handle<>(cobject)) );
}
#endif
} else if (value_type == G_TYPE_DOUBLE) {
} else if(value_type == G_TYPE_DOUBLE) {
ret = boost::python::object(g_value_get_double(boxed));
} else if (value_type == GDA_TYPE_GEOMETRIC_POINT) {
} else if(value_type == GDA_TYPE_GEOMETRIC_POINT) {
const GdaGeometricPoint* val = gda_value_get_geometric_point(boxed);
if(val)
{
PyObject* cobject = Py_BuildValue ("(ii)", val->x, val->y);
ret = boost::python::object( (boost::python::handle<>(cobject)) );
}
} else if (value_type == G_TYPE_INT) {
} else if(value_type == G_TYPE_INT) {
ret = boost::python::object(g_value_get_int(boxed));
} else if (value_type == GDA_TYPE_NUMERIC) {
} else if(value_type == GDA_TYPE_NUMERIC) {
const GdaNumeric* val = gda_value_get_numeric(boxed);
ret = boost::python::object(gda_numeric_get_double((GdaNumeric*)val));
} else if (value_type == G_TYPE_FLOAT) {
} else if(value_type == G_TYPE_FLOAT) {
ret = boost::python::object(g_value_get_float(boxed));
} else if (value_type == GDA_TYPE_SHORT) {
} else if(value_type == GDA_TYPE_SHORT) {
ret = boost::python::object(gda_value_get_short(boxed));
} else if (value_type == G_TYPE_STRING) {
} else if(value_type == G_TYPE_STRING) {
const gchar* val = g_value_get_string(boxed);
ret = boost::python::object(val);
} else if (value_type == GDA_TYPE_TIME) {
} else if(value_type == GDA_TYPE_TIME) {
#if PY_VERSION_HEX >= 0x02040000
const GdaTime* val = gda_value_get_time(boxed);
if(val)
......@@ -249,7 +249,7 @@ boost::python::object glom_pygda_value_as_boost_pyobject(const Glib::ValueBase&
PyObject* cobject = PyTime_FromTime(val->hour, val->minute, val->second, 0); /* TODO: Should we ignore GDate::timezone ? */
ret = boost::python::object( (boost::python::handle<>(cobject)) );
}
} else if (value_type == GDA_TYPE_TIMESTAMP) {
} else if(value_type == GDA_TYPE_TIMESTAMP) {
const GdaTimestamp* val = gda_value_get_timestamp(boxed);
if(val)
{
......@@ -257,11 +257,11 @@ boost::python::object glom_pygda_value_as_boost_pyobject(const Glib::ValueBase&
ret = boost::python::object( (boost::python::handle<>(cobject)) );
}
#endif
} else if (value_type == GDA_TYPE_SHORT) {
} else if(value_type == GDA_TYPE_SHORT) {
ret = boost::python::object(gda_value_get_short(boxed));
} else if (value_type == GDA_TYPE_USHORT) {
} else if(value_type == GDA_TYPE_USHORT) {
ret = boost::python::object(gda_value_get_ushort(boxed));
} else if (value_type == G_TYPE_UINT) {
} else if(value_type == G_TYPE_UINT) {
ret = boost::python::object(g_value_get_uint(boxed));
} else {
std::cerr << "Glom: G_VALUE_TYPE() returned unknown type: " << value_type << std::endl;
......
......@@ -1034,7 +1034,7 @@ static Glib::RefPtr<Gnome::Gda::Connection> get_connection()
{
sharedconnection = ConnectionPool::get_and_connect();
}
catch (const Glib::Error& error)
catch(const Glib::Error& error)
{
std::cerr << G_STRFUNC << ": " << error.what() << std::endl;
}
......
......@@ -1431,7 +1431,7 @@ void DbAddDel::on_treeview_cell_edited(const Glib::ustring& path_string, const G
set_prevent_user_signals(true); //Stops extra signal_user_changed.
//Don't add a new row if nothing was entered into the placeholder.
if (new_text.empty())
if(new_text.empty())
return;
//Mark this row as no longer a placeholder, because it has data now. The client code must set an actual key for this in the signal_user_added() or m_signal_user_changed signal handlers.
......
......@@ -302,7 +302,7 @@ void Dialog_Layout_Calendar_Related::save_to_document()
uses_rel->set_relationship(rel);
uses_rel->set_related_relationship(rel_related);
if (rel || rel_related)
if(rel || rel_related)
m_portal->set_navigation_relationship_specific(uses_rel);
//std::cout << "debug99 main=specify_main" << ", relationship=" << (rel ? rel->get_name() : "none") << std::endl;
}
......
......@@ -372,7 +372,7 @@ void Dialog_Layout_List_Related::save_to_document()
m_portal->set_navigation_relationship_specific(none);
}
if (m_radio_navigation_automatic->get_active())
if(m_radio_navigation_automatic->get_active())
m_portal->set_navigation_type(LayoutItem_Portal::NAVIGATION_AUTOMATIC);
if(m_radio_navigation_none->get_active())
......
......@@ -388,7 +388,7 @@ void Dialog_RelationshipsOverview::print_or_preview(Gtk::PrintOperationAction pr
{
print->run(print_action /* print or preview */, *this);
}
catch (const Gtk::PrintError& ex)
catch(const Gtk::PrintError& ex)
{
//See documentation for exact Gtk::PrintError error codes.
std::cerr << "An error occurred while trying to run a print operation:"
......
......@@ -434,7 +434,7 @@ void do_print_layout(const sharedptr<const PrintLayout>& print_layout, const Fou
(preview ? Gtk::PRINT_OPERATION_ACTION_PREVIEW : Gtk::PRINT_OPERATION_ACTION_PRINT_DIALOG),
*transient_for);
}
catch (const Gtk::PrintError& ex)
catch(const Gtk::PrintError& ex)
{
//See documentation for exact Gtk::PrintError error codes.
std::cerr << "An error occurred while trying to run a print operation:"
......
......@@ -65,7 +65,7 @@ void FileChooserDialog_SaveExtras::set_extra_message(const Glib::ustring& messag
{
m_label_extra_message.set_text(message);
if (!message.empty()) {
if(!message.empty()) {
m_label_extra_message.show();
} else {
m_label_extra_message.hide();
......
......@@ -222,7 +222,7 @@ static void image_glom_ev_job_finished(EvJob* job, void* user_data)
void ImageGlom::on_ev_job_finished(EvJob* job)
{
if (ev_job_is_failed (job)) {
if(ev_job_is_failed (job)) {
g_warning ("%s", job->error->message);
g_object_unref (job);
......
......@@ -92,7 +92,7 @@ bool run_parser_from_buffer(const FuncConnectParserSignals& connect_parser_signa
const Glib::ustring file_uri = create_file_from_buffer(input, input_size);
parser.set_file_and_start_parsing(file_uri);
if (Glom::CsvParser::STATE_PARSING != parser.get_state())
if(Glom::CsvParser::STATE_PARSING != parser.get_state())
return false;
mainloop->run();
......@@ -127,7 +127,7 @@ bool run_parser_on_file(const FuncConnectParserSignals& connect_parser_signals,
connect_parser_signals(parser);
parser.set_file_and_start_parsing(uri);
if (Glom::CsvParser::STATE_PARSING != parser.get_state())
if(Glom::CsvParser::STATE_PARSING != parser.get_state())
return false;
mainloop->run();
......
......@@ -48,9 +48,9 @@ int main ()
#endif
Glom::libglom_init(); // Calls PyInitialize()
if (!Glom::gda_python_module_is_available())
if(!Glom::gda_python_module_is_available())
return EXIT_FAILURE;
if (!Glom::glom_python_module_is_available())
if(!Glom::glom_python_module_is_available())
return EXIT_FAILURE;
Glom::libglom_deinit(); // Calls Py_Finalize();
......
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