Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
glom
Commits
601fd228
Commit
601fd228
authored
Jul 02, 2015
by
Murray Cumming
Browse files
C++11: More use of auto.
parent
e5519f1c
Changes
55
Hide whitespace changes
Inline
Side-by-side
glom/base_db.cc
View file @
601fd228
...
...
@@ -821,7 +821,7 @@ void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
//std::cerr << G_STRFUNC << ": field_name=" << field_name << std::endl;
//Do we already have this in our list?
type_field_calcs
::
iter
ato
r
iterFind
=
m_FieldsCalculationInProgress
.
find
(
field_name
);
a
u
to
iterFind
=
m_FieldsCalculationInProgress
.
find
(
field_name
);
if
(
iterFind
==
m_FieldsCalculationInProgress
.
end
())
//If it was not found.
{
//Add it:
...
...
glom/base_db_table_data.cc
View file @
601fd228
...
...
@@ -199,7 +199,7 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
std
::
cerr
<<
G_STRFUNC
<<
": INSERT failed."
<<
std
::
endl
;
else
{
Gtk
::
TreeModel
::
iter
ato
r
row
=
get_row_selected
();
//Null and ignored for details views.
a
u
to
row
=
get_row_selected
();
//Null and ignored for details views.
set_primary_key_value
(
row
,
primary_key_value
);
//Needed by Box_Data_List::on_adddel_user_changed().
//Update any lookups, related fields, or calculations:
...
...
glom/box_reports.cc
View file @
601fd228
...
...
@@ -109,7 +109,7 @@ bool Box_Reports::fill_from_database()
std
::
shared_ptr
<
Report
>
report
=
document
->
get_report
(
m_table_name
,
item
);
if
(
report
)
{
Gtk
::
TreeModel
::
iter
ato
r
row
=
m_AddDel
.
add_item
(
report
->
get_name
());
a
u
to
row
=
m_AddDel
.
add_item
(
report
->
get_name
());
fill_row
(
row
,
report
);
}
}
...
...
glom/dialog_existing_or_new.cc
View file @
601fd228
...
...
@@ -174,7 +174,7 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
{
if
(
info
->
get_mime_type
()
==
"application/x-glom"
)
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_existing_model
->
append
(
m_iter_existing_recent
->
children
());
a
u
to
iter
=
m_existing_model
->
append
(
m_iter_existing_recent
->
children
());
(
*
iter
)[
m_existing_columns
.
m_col_title
]
=
info
->
get_display_name
();
(
*
iter
)[
m_existing_columns
.
m_col_time
]
=
info
->
get_modified
();
(
*
iter
)[
m_existing_columns
.
m_col_recent_info
]
=
info
;
...
...
@@ -310,7 +310,7 @@ Dialog_ExistingOrNew::~Dialog_ExistingOrNew()
bool
Dialog_ExistingOrNew
::
on_existing_select_func
(
const
Glib
::
RefPtr
<
Gtk
::
TreeModel
>&
model
,
const
Gtk
::
TreeModel
::
Path
&
path
,
bool
/* path_currently_selected */
)
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
model
->
get_iter
(
path
);
a
u
to
iter
=
model
->
get_iter
(
path
);
#ifndef G_OS_WIN32
if
(
iter
==
m_iter_existing_network
)
return
false
;
/* Do not allow parent nodes to be selected. */
...
...
@@ -324,7 +324,7 @@ bool Dialog_ExistingOrNew::on_existing_select_func(const Glib::RefPtr<Gtk::TreeM
#ifndef GLOM_ENABLE_CLIENT_ONLY
bool
Dialog_ExistingOrNew
::
on_new_select_func
(
const
Glib
::
RefPtr
<
Gtk
::
TreeModel
>&
model
,
const
Gtk
::
TreeModel
::
Path
&
path
,
bool
/* path_currently_selected */
)
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
model
->
get_iter
(
path
);
a
u
to
iter
=
model
->
get_iter
(
path
);
if
(
iter
==
m_iter_new_template
)
return
false
;
/* Do not allow parent nodes to be selected. */
else
...
...
@@ -434,7 +434,7 @@ Glib::ustring Dialog_ExistingOrNew::get_service_name() const
std
::
shared_ptr
<
Gtk
::
TreeModel
::
iterator
>
Dialog_ExistingOrNew
::
create_dummy_item_existing
(
const
Gtk
::
TreeModel
::
iterator
&
parent
,
const
Glib
::
ustring
&
text
)
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_existing_model
->
append
(
parent
->
children
());
a
u
to
iter
=
m_existing_model
->
append
(
parent
->
children
());
(
*
iter
)[
m_existing_columns
.
m_col_title
]
=
text
;
return
std
::
shared_ptr
<
Gtk
::
TreeModel
::
iterator
>
(
new
Gtk
::
TreeModel
::
iterator
(
iter
));
}
...
...
@@ -442,7 +442,7 @@ std::shared_ptr<Gtk::TreeModel::iterator> Dialog_ExistingOrNew::create_dummy_ite
#ifndef GLOM_ENABLE_CLIENT_ONLY
std
::
shared_ptr
<
Gtk
::
TreeModel
::
iterator
>
Dialog_ExistingOrNew
::
create_dummy_item_new
(
const
Gtk
::
TreeModel
::
iterator
&
parent
,
const
Glib
::
ustring
&
text
)
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_new_model
->
append
(
parent
->
children
());
a
u
to
iter
=
m_new_model
->
append
(
parent
->
children
());
(
*
iter
)[
m_new_columns
.
m_col_title
]
=
text
;
return
std
::
shared_ptr
<
Gtk
::
TreeModel
::
iterator
>
(
new
Gtk
::
TreeModel
::
iterator
(
iter
));
}
...
...
@@ -603,7 +603,7 @@ void Dialog_ExistingOrNew::update_ui_sensitivity()
}
else
{
Gtk
::
TreeModel
::
iter
ato
r
sel
=
m_existing_view
->
get_selection
()
->
get_selected
();
a
u
to
sel
=
m_existing_view
->
get_selection
()
->
get_selected
();
sensitivity
=
(
sel
!=
m_iter_existing_recent
);
#ifndef G_OS_WIN32
sensitivity
=
sensitivity
&&
(
sel
!=
m_iter_existing_network
);
...
...
@@ -626,7 +626,7 @@ void Dialog_ExistingOrNew::update_ui_sensitivity()
}
else
{
Gtk
::
TreeModel
::
iter
ato
r
sel
=
m_new_view
->
get_selection
()
->
get_selected
();
a
u
to
sel
=
m_new_view
->
get_selection
()
->
get_selected
();
sensitivity
=
(
sel
!=
m_iter_new_template
&&
(
!
m_iter_new_template_dummy
.
get
()
||
sel
!=
*
m_iter_new_template_dummy
));
}
...
...
@@ -683,7 +683,7 @@ void Dialog_ExistingOrNew::append_example(const Glib::ustring& title, const std:
const
auto
is_first_item
=
m_iter_new_template_dummy
.
get
();
// Add to list.
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_new_model
->
append
(
m_iter_new_template
->
children
());
a
u
to
iter
=
m_new_model
->
append
(
m_iter_new_template
->
children
());
(
*
iter
)[
m_new_columns
.
m_col_title
]
=
title
;
(
*
iter
)[
m_new_columns
.
m_col_template_uri
]
=
"resource://"
+
resource_name
;
//GFile understands this for actual files, though not directories.
...
...
@@ -718,7 +718,7 @@ void Dialog_ExistingOrNew::on_service_found(const Glib::ustring& name, EpcServic
{
//Translator hint: This is <Service Name> on <Host> (via Network Interface such as eth0).
gchar
*
title
=
g_strdup_printf
(
_
(
"%s on %s (via %s)"
),
name
.
c_str
(),
epc_service_info_get_host
(
info
),
epc_service_info_get_interface
(
info
));
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_existing_model
->
prepend
(
m_iter_existing_network
->
children
());
a
u
to
iter
=
m_existing_model
->
prepend
(
m_iter_existing_network
->
children
());
(
*
iter
)[
m_existing_columns
.
m_col_title
]
=
title
;
(
*
iter
)[
m_existing_columns
.
m_col_time
]
=
std
::
time
(
0
);
/* sort more recently discovered items above */
(
*
iter
)[
m_existing_columns
.
m_col_service_name
]
=
name
;
...
...
glom/frame_glom.cc
View file @
601fd228
...
...
@@ -1447,7 +1447,7 @@ void Frame_Glom::update_table_in_document_from_database()
if
(
field_database
)
{
//Is the field already in the document?
type_vec_fields
::
iter
ato
r
iterFindDoc
=
std
::
find_if
(
fieldsDocument
.
begin
(),
fieldsDocument
.
end
(),
predicate_FieldHasName
<
Field
>
(
field_database
->
get_name
()
)
);
a
u
to
iterFindDoc
=
std
::
find_if
(
fieldsDocument
.
begin
(),
fieldsDocument
.
end
(),
predicate_FieldHasName
<
Field
>
(
field_database
->
get_name
()
)
);
if
(
iterFindDoc
==
fieldsDocument
.
end
())
//If it was not found:
{
//Add it
...
...
@@ -1492,7 +1492,7 @@ void Frame_Glom::update_table_in_document_from_database()
for
(
const
auto
&
field
:
fieldsDocument
)
{
//Check whether it's in the database:
type_vec_fields
::
iter
ato
r
iterFindDatabase
=
std
::
find_if
(
fieldsDatabase
.
begin
(),
fieldsDatabase
.
end
(),
predicate_FieldHasName
<
Field
>
(
field
->
get_name
()
)
);
a
u
to
iterFindDatabase
=
std
::
find_if
(
fieldsDatabase
.
begin
(),
fieldsDatabase
.
end
(),
predicate_FieldHasName
<
Field
>
(
field
->
get_name
()
)
);
if
(
iterFindDatabase
!=
fieldsDatabase
.
end
())
//If it was found
{
fieldsActual
.
push_back
(
field
);
...
...
glom/import_csv/dialog_import_csv.cc
View file @
601fd228
...
...
@@ -97,7 +97,7 @@ Dialog_Import_CSV::Dialog_Import_CSV(BaseObjectType* cobject, const Glib::RefPtr
//Fill the list of encodings:
m_encoding_model
=
Gtk
::
ListStore
::
create
(
m_encoding_columns
);
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_encoding_model
->
append
();
a
u
to
iter
=
m_encoding_model
->
append
();
(
*
iter
)[
m_encoding_columns
.
m_col_name
]
=
_
(
"Auto Detect"
);
// Separator:
...
...
@@ -196,7 +196,7 @@ void Dialog_Import_CSV::import(const Glib::ustring& uri, const Glib::ustring& in
m_target_table
->
set_markup
(
"<b>"
+
Glib
::
Markup
::
escape_text
(
into_table
)
+
"</b>"
);
m_field_model
=
Gtk
::
ListStore
::
create
(
m_field_columns
);
Gtk
::
TreeModel
::
iter
ato
r
tree_iter
=
m_field_model
->
append
();
a
u
to
tree_iter
=
m_field_model
->
append
();
(
*
tree_iter
)[
m_field_columns
.
m_col_field_name
]
=
_
(
"<None>"
);
const
Document
::
type_vec_fields
fields
(
document
->
get_table_fields
(
into_table
));
...
...
@@ -210,7 +210,7 @@ void Dialog_Import_CSV::import(const Glib::ustring& uri, const Glib::ustring& in
// automatically anyway.
if
(
!
field
->
get_primary_key
()
||
!
field
->
get_auto_increment
())
{
Gtk
::
TreeModel
::
iter
ato
r
tree_iter
=
m_field_model
->
append
();
a
u
to
tree_iter
=
m_field_model
->
append
();
(
*
tree_iter
)[
m_field_columns
.
m_col_field
]
=
field
;
(
*
tree_iter
)[
m_field_columns
.
m_col_field_name
]
=
field
->
get_name
();
}
...
...
@@ -323,7 +323,7 @@ void Dialog_Import_CSV::on_first_line_as_title_toggled()
{
m_sample_view
->
set_headers_visible
(
true
);
Gtk
::
TreeModel
::
Path
path
(
"1"
);
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_sample_model
->
get_iter
(
path
);
a
u
to
iter
=
m_sample_model
->
get_iter
(
path
);
// Remove the first row from the view
if
(
iter
&&
(
*
iter
)[
m_sample_columns
.
m_col_row
]
==
0
)
...
...
@@ -342,7 +342,7 @@ void Dialog_Import_CSV::on_first_line_as_title_toggled()
// Check whether row 0 is displayed
Gtk
::
TreeModel
::
Path
path
(
"1"
);
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_sample_model
->
get_iter
(
path
);
a
u
to
iter
=
m_sample_model
->
get_iter
(
path
);
//if((!iter || (*iter)[m_sample_columns.m_col_row] != 0) && !m_parser->get_rows_empty() && m_sample_rows->get_value_as_int() > 0)
if
((
!
iter
||
(
*
iter
)[
m_sample_columns
.
m_col_row
]
!=
0
)
&&
...
...
@@ -384,7 +384,7 @@ void Dialog_Import_CSV::on_sample_rows_changed()
// +1 for the "target field" row
Gtk
::
TreeModel
::
Path
path
(
1
);
path
[
0
]
=
new_sample_rows
+
1
;
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_sample_model
->
get_iter
(
path
);
a
u
to
iter
=
m_sample_model
->
get_iter
(
path
);
while
(
iter
!=
m_sample_model
->
children
().
end
())
iter
=
m_sample_model
->
erase
(
iter
);
...
...
@@ -398,7 +398,7 @@ void Dialog_Import_CSV::on_sample_rows_changed()
for
(
guint
i
=
current_sample_rows
;
i
<
new_sample_rows
;
++
i
,
++
row_index
)
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_sample_model
->
append
();
a
u
to
iter
=
m_sample_model
->
append
();
(
*
iter
)[
m_sample_columns
.
m_col_row
]
=
row_index
;
}
}
...
...
@@ -406,7 +406,7 @@ void Dialog_Import_CSV::on_sample_rows_changed()
Glib
::
ustring
Dialog_Import_CSV
::
get_current_encoding
()
const
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_encoding_combo
->
get_active
();
a
u
to
iter
=
m_encoding_combo
->
get_active
();
const
Glib
::
ustring
encoding
=
(
*
iter
)[
m_encoding_columns
.
m_col_charset
];
if
(
encoding
.
empty
())
...
...
@@ -478,7 +478,7 @@ void Dialog_Import_CSV::on_parser_line_scanned(CsvParser::type_row_strings row,
if
(
!
m_sample_model
)
{
setup_sample_model
(
row
);
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_sample_model
->
append
();
a
u
to
iter
=
m_sample_model
->
append
();
// -1 means the row to select target fields (see special handling in cell data funcs)
(
*
iter
)[
m_sample_columns
.
m_col_row
]
=
-
1
;
}
...
...
@@ -493,7 +493,7 @@ void Dialog_Import_CSV::on_parser_line_scanned(CsvParser::type_row_strings row,
{
if
(
sample_rows
<
static_cast
<
guint
>
(
m_sample_rows
->
get_value_as_int
()))
{
Gtk
::
TreeModel
::
iter
ato
r
tree_iter
=
m_sample_model
->
append
();
a
u
to
tree_iter
=
m_sample_model
->
append
();
(
*
tree_iter
)[
m_sample_columns
.
m_col_row
]
=
row_number
;
}
}
...
...
@@ -639,7 +639,7 @@ void Dialog_Import_CSV::field_data_func(Gtk::CellRenderer* renderer, const Gtk::
void
Dialog_Import_CSV
::
on_field_edited
(
const
Glib
::
ustring
&
path
,
const
Glib
::
ustring
&
new_text
,
guint
column_number
)
{
Gtk
::
TreeModel
::
Path
treepath
(
path
);
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_sample_model
->
get_iter
(
treepath
);
a
u
to
iter
=
m_sample_model
->
get_iter
(
treepath
);
// Lookup field indicated by new_text
const
Gtk
::
TreeNodeChildren
&
children
=
m_field_model
->
children
();
...
...
@@ -649,7 +649,7 @@ void Dialog_Import_CSV::on_field_edited(const Glib::ustring& path, const Glib::u
{
std
::
shared_ptr
<
Field
>
field
=
(
*
field_iter
)[
m_field_columns
.
m_col_field
];
// Check whether another column is already using that field
type_vec_fields
::
iter
ato
r
vec_field_iter
=
std
::
find
(
m_fields
.
begin
(),
m_fields
.
end
(),
field
);
a
u
to
vec_field_iter
=
std
::
find
(
m_fields
.
begin
(),
m_fields
.
end
(),
field
);
// Reset the old column since two different columns cannot be imported into the same field
if
(
vec_field_iter
!=
m_fields
.
end
())
*
vec_field_iter
=
std
::
shared_ptr
<
Field
>
();
...
...
glom/libglom/db_utils.cc
View file @
601fd228
...
...
@@ -952,7 +952,7 @@ type_vec_fields get_fields_for_table_from_database(const Glib::ustring& table_na
}
//Hide system fields.
type_vec_fields
::
iter
ato
r
iterFind
=
std
::
find_if
(
result
.
begin
(),
result
.
end
(),
predicate_FieldHasName
<
Field
>
(
GLOM_STANDARD_FIELD_LOCK
));
a
u
to
iterFind
=
std
::
find_if
(
result
.
begin
(),
result
.
end
(),
predicate_FieldHasName
<
Field
>
(
GLOM_STANDARD_FIELD_LOCK
));
if
(
iterFind
!=
result
.
end
())
result
.
erase
(
iterFind
);
...
...
@@ -1035,7 +1035,7 @@ std::shared_ptr<Field> get_fields_for_table_one_field(const Document* document,
return
result
;
type_vec_fields
fields
=
get_fields_for_table
(
document
,
table_name
);
//TODO_Performance
type_vec_fields
::
iter
ato
r
iter
=
std
::
find_if
(
fields
.
begin
(),
fields
.
end
(),
predicate_FieldHasName
<
Field
>
(
field_name
));
a
u
to
iter
=
std
::
find_if
(
fields
.
begin
(),
fields
.
end
(),
predicate_FieldHasName
<
Field
>
(
field_name
));
if
(
iter
!=
fields
.
end
())
//TODO: Handle error?
{
return
*
iter
;
...
...
glom/libglom/document/bakery/view/view_composite.h
View file @
601fd228
...
...
@@ -58,7 +58,7 @@ public:
virtual
void
remove_view
(
type_view
*
pView
)
{
typename
type_vec_views
::
iter
ato
r
iter
=
std
::
find
(
m_vecViews
.
begin
(),
m_vecViews
.
end
(),
pView
);
a
u
to
iter
=
std
::
find
(
m_vecViews
.
begin
(),
m_vecViews
.
end
(),
pView
);
if
(
iter
!=
m_vecViews
.
end
())
m_vecViews
.
erase
(
iter
);
}
...
...
glom/libglom/document/document.cc
View file @
601fd228
...
...
@@ -735,7 +735,7 @@ void Document::remove_field(const Glib::ustring& table_name, const Glib::ustring
if
(
info
)
{
auto
vecFields
=
info
->
m_fields
;
type_vec_fields
::
iter
ato
r
iterFind
=
std
::
find_if
(
vecFields
.
begin
(),
vecFields
.
end
(),
predicate_FieldHasName
<
Field
>
(
field_name
)
);
a
u
to
iterFind
=
std
::
find_if
(
vecFields
.
begin
(),
vecFields
.
end
(),
predicate_FieldHasName
<
Field
>
(
field_name
)
);
if
(
iterFind
!=
vecFields
.
end
())
//If it was found:
{
//Remove it:
...
...
@@ -4023,7 +4023,7 @@ Document::type_list_groups Document::get_groups() const
void
Document
::
set_group
(
GroupInfo
&
group
)
{
const
auto
name
=
group
.
get_name
();
type_map_groups
::
iter
ato
r
iter
=
m_groups
.
find
(
name
);
a
u
to
iter
=
m_groups
.
find
(
name
);
if
(
iter
==
m_groups
.
end
())
{
//Add it if necesary:
...
...
@@ -4043,7 +4043,7 @@ void Document::set_group(GroupInfo& group)
void
Document
::
remove_group
(
const
Glib
::
ustring
&
group_name
)
{
type_map_groups
::
iter
ato
r
iter
=
m_groups
.
find
(
group_name
);
a
u
to
iter
=
m_groups
.
find
(
group_name
);
if
(
iter
!=
m_groups
.
end
())
{
m_groups
.
erase
(
iter
);
...
...
@@ -4098,7 +4098,7 @@ void Document::remove_report(const Glib::ustring& table_name, const Glib::ustrin
const
auto
info
=
get_table_info
(
table_name
);
if
(
info
)
{
DocumentTableInfo
::
type_reports
::
iterator
iterFindReport
=
info
->
m_reports
.
find
(
report_name
);
auto
iterFindReport
=
info
->
m_reports
.
find
(
report_name
);
if
(
iterFindReport
!=
info
->
m_reports
.
end
())
{
info
->
m_reports
.
erase
(
iterFindReport
);
...
...
@@ -4157,7 +4157,7 @@ void Document::remove_print_layout(const Glib::ustring& table_name, const Glib::
const
auto
info
=
get_table_info
(
table_name
);
if
(
info
)
{
DocumentTableInfo
::
type_print_layouts
::
iterator
iterFindPrintLayout
=
info
->
m_print_layouts
.
find
(
print_layout_name
);
auto
iterFindPrintLayout
=
info
->
m_print_layouts
.
find
(
print_layout_name
);
if
(
iterFindPrintLayout
!=
info
->
m_print_layouts
.
end
())
{
info
->
m_print_layouts
.
erase
(
iterFindPrintLayout
);
...
...
@@ -4708,7 +4708,7 @@ void Document::set_library_module(const Glib::ustring& name, const Glib::ustring
if
(
name
.
empty
())
return
;
type_map_library_scripts
::
iter
ato
r
iter
=
m_map_library_scripts
.
find
(
name
);
a
u
to
iter
=
m_map_library_scripts
.
find
(
name
);
if
(
iter
!=
m_map_library_scripts
.
end
())
{
//Change the existing script, if necessary:
...
...
@@ -4739,7 +4739,7 @@ Glib::ustring Document::get_library_module(const Glib::ustring& name) const
void
Document
::
remove_library_module
(
const
Glib
::
ustring
&
name
)
{
type_map_library_scripts
::
iter
ato
r
iter
=
m_map_library_scripts
.
find
(
name
);
a
u
to
iter
=
m_map_library_scripts
.
find
(
name
);
if
(
iter
!=
m_map_library_scripts
.
end
())
{
m_map_library_scripts
.
erase
(
iter
);
...
...
glom/libglom/privs.cc
View file @
601fd228
...
...
@@ -424,7 +424,7 @@ bool Privs::on_privs_privileges_cache_timeout(const Glib::ustring& table_name)
//std::cout << "debug: " << G_STRFUNC << ": table=" << table_name << std::endl;
//Forget the cached privileges after a few seconds:
type_map_privileges
::
iter
ato
r
iter
=
m_privileges_cache
.
find
(
table_name
);
a
u
to
iter
=
m_privileges_cache
.
find
(
table_name
);
if
(
iter
!=
m_privileges_cache
.
end
())
{
//std::cout << "debug: " << G_STRFUNC << ": Cleared cache for table=" << table_name << std::endl;
...
...
@@ -514,7 +514,7 @@ Privileges Privs::get_current_privs(const Glib::ustring& table_name)
//TODO: Make sure we handle the failure well in that unlikely case.
//Stop the existing timeout if it has not run yet.
type_map_cache_timeouts
::
iterator
iter_connection
=
m_map_cache_timeouts
.
find
(
table_name
);
auto
iter_connection
=
m_map_cache_timeouts
.
find
(
table_name
);
if
(
iter_connection
!=
m_map_cache_timeouts
.
end
())
iter_connection
->
second
.
disconnect
();
...
...
glom/libglom/python_embed/py_glom_related.cc
View file @
601fd228
...
...
@@ -53,7 +53,7 @@ boost::python::object PyGlomRelated::getitem(const boost::python::object& cppite
if
(
!
key
.
empty
())
{
//Return a cached item if possible:
PyGlomRelated
::
type_map_relatedrecords
::
iterator
iterCacheFind
=
m_map_relatedrecords
.
find
(
key
);
auto
iterCacheFind
=
m_map_relatedrecords
.
find
(
key
);
if
(
iterCacheFind
!=
m_map_relatedrecords
.
end
())
{
//Return a reference to the cached item:
...
...
glom/mode_data/box_data_list.cc
View file @
601fd228
...
...
@@ -254,7 +254,7 @@ void Box_Data_List::on_details_nav_first()
void
Box_Data_List
::
on_details_nav_previous
()
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_AddDel
.
get_item_selected
();
a
u
to
iter
=
m_AddDel
.
get_item_selected
();
if
(
iter
)
{
//Don't try to select a negative record number.
...
...
@@ -270,7 +270,7 @@ void Box_Data_List::on_details_nav_previous()
void
Box_Data_List
::
on_details_nav_next
()
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_AddDel
.
get_item_selected
();
a
u
to
iter
=
m_AddDel
.
get_item_selected
();
if
(
iter
)
{
//Don't go past the last record:
...
...
@@ -290,7 +290,7 @@ void Box_Data_List::on_details_nav_next()
void
Box_Data_List
::
on_details_nav_last
()
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_AddDel
.
get_last_row
();
a
u
to
iter
=
m_AddDel
.
get_last_row
();
if
(
iter
)
{
m_AddDel
.
select_item
(
iter
);
...
...
@@ -304,11 +304,11 @@ void Box_Data_List::on_details_nav_last()
void
Box_Data_List
::
on_details_record_deleted
(
const
Gnome
::
Gda
::
Value
&
primary_key_value
)
{
//Find out which row is affected:
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_AddDel
.
get_row
(
primary_key_value
);
a
u
to
iter
=
m_AddDel
.
get_row
(
primary_key_value
);
if
(
iter
)
{
//Remove the row:
Gtk
::
TreeModel
::
iter
ato
r
iterNext
=
iter
;
a
u
to
iterNext
=
iter
;
iterNext
++
;
m_AddDel
.
remove_item
(
iter
);
...
...
@@ -351,7 +351,7 @@ Gnome::Gda::Value Box_Data_List::get_primary_key_value_first() const
Glib
::
RefPtr
<
Gtk
::
TreeModel
>
model
=
m_AddDel
.
get_model
();
if
(
model
)
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
model
->
children
().
begin
();
a
u
to
iter
=
model
->
children
().
begin
();
while
(
iter
!=
model
->
children
().
end
())
{
Gnome
::
Gda
::
Value
value
=
get_primary_key_value
(
iter
);
...
...
@@ -506,7 +506,7 @@ void Box_Data_List::set_open_button_title(const Glib::ustring& title)
void
Box_Data_List
::
set_primary_key_value_selected
(
const
Gnome
::
Gda
::
Value
&
primary_key_value
)
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_AddDel
.
get_row
(
primary_key_value
);
a
u
to
iter
=
m_AddDel
.
get_row
(
primary_key_value
);
if
(
iter
)
{
m_AddDel
.
select_item
(
iter
);
...
...
glom/mode_data/datawidget/combo.cc
View file @
601fd228
...
...
@@ -297,7 +297,7 @@ void ComboGlom::set_value(const Gnome::Gda::Value& value)
Gnome
::
Gda
::
Value
ComboGlom
::
get_value
()
const
{
//Get the active row:
Gtk
::
TreeModel
::
iter
ato
r
iter
=
get_active
();
a
u
to
iter
=
get_active
();
if
(
iter
)
{
...
...
@@ -366,7 +366,7 @@ void ComboGlom::on_changed()
//This signal is emitted for every key press, but sometimes it's just to say that the active item has changed to "no active item",
//if the text is not in the dropdown list:
Gtk
::
TreeModel
::
iter
ato
r
iter
=
get_active
();
a
u
to
iter
=
get_active
();
if
(
iter
)
{
...
...
glom/mode_data/datawidget/combo_as_radio_buttons.cc
View file @
601fd228
...
...
@@ -220,7 +220,7 @@ void ComboAsRadioButtons::set_text(const Glib::ustring& text)
{
m_old_text
=
text
;
type_map_buttons
::
iterator
iter
=
m_map_buttons
.
find
(
text
);
auto
iter
=
m_map_buttons
.
find
(
text
);
if
(
iter
!=
m_map_buttons
.
end
())
{
Gtk
::
RadioButton
*
button
=
iter
->
second
;
...
...
glom/mode_data/datawidget/combochoiceswithtreemodel.cc
View file @
601fd228
...
...
@@ -160,7 +160,7 @@ void ComboChoicesWithTreeModel::set_choices_with_second(const type_list_values_w
for(const auto& the_pair : list_values)
{
Gtk::TreeModel::iter
ato
r
iterTree = list_store->append();
a
u
to iterTree = list_store->append();
Gtk::TreeModel::Row row = *iterTree;
if(layout_choice_first)
...
...
@@ -215,7 +215,7 @@ void ComboChoicesWithTreeModel::set_choices_fixed(const Formatting::type_list_va
for
(
const
auto
&
choicevalue
:
list_values
)
{
Gtk
::
TreeModel
::
iter
ato
r
iterTree
=
list_store
->
append
();
a
u
to
iterTree
=
list_store
->
append
();
Gtk
::
TreeModel
::
Row
row
=
*
iterTree
;
std
::
shared_ptr
<
const
LayoutItem_Field
>
layout_item
=
std
::
dynamic_pointer_cast
<
LayoutItem_Field
>
(
get_layout_item
());
...
...
glom/mode_data/datawidget/treemodel_db.cc
View file @
601fd228
...
...
@@ -846,7 +846,7 @@ DbTreeModel::DbValue DbTreeModel::get_key_value(const TreeModel::iterator& iter)
if
(
check_treeiter_validity
(
iter
))
{
type_datamodel_row_index
datamodel_row
=
get_datamodel_row_index_from_tree_row_iter
(
iter
);
type_map_rows
::
iter
ato
r
iterFind
=
m_map_rows
.
find
(
datamodel_row
);
a
u
to
iterFind
=
m_map_rows
.
find
(
datamodel_row
);
if
(
iterFind
!=
m_map_rows
.
end
())
return
iterFind
->
second
.
m_key
;
else
...
...
glom/mode_data/db_adddel/db_adddel.cc
View file @
601fd228
...
...
@@ -152,7 +152,7 @@ void DbAddDel::set_height_rows_actual(gulong rows_count)
void
DbAddDel
::
do_user_requested_edit
()
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
get_item_selected
();
a
u
to
iter
=
get_item_selected
();
if
(
iter
)
{
signal_user_requested_edit
()(
iter
);
...
...
@@ -171,7 +171,7 @@ void DbAddDel::on_cell_button_clicked(const Gtk::TreeModel::Path& path)
if
(
!
m_refListStore
)
return
;
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_refListStore
->
get_iter
(
path
);
a
u
to
iter
=
m_refListStore
->
get_iter
(
path
);
if
(
iter
)
{
select_item
(
iter
,
false
/* start_editing */
);
...
...
@@ -204,7 +204,7 @@ void DbAddDel::on_MenuPopup_activate_Delete()
Glib
::
RefPtr
<
Gtk
::
TreeView
::
Selection
>
refSelection
=
m_TreeView
.
get_selection
();
if
(
refSelection
)
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
refSelection
->
get_selected
();
a
u
to
iter
=
refSelection
->
get_selected
();
if
(
iter
&&
!
get_is_placeholder_row
(
iter
))
{
//TODO: We can't handle multiple-selections yet.
...
...
@@ -355,7 +355,7 @@ Gnome::Gda::Value DbAddDel::get_value(const Gtk::TreeModel::iterator& iter, cons
Gnome
::
Gda
::
Value
DbAddDel
::
get_value_key_selected
()
const
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
get_item_selected
();
a
u
to
iter
=
get_item_selected
();
if
(
iter
)
{
return
get_value_key
(
iter
);
...
...
@@ -404,7 +404,7 @@ Gtk::TreeModel::iterator DbAddDel::get_row(const Gnome::Gda::Value& key)
if
(
!
m_refListStore
)
return
Gtk
::
TreeModel
::
iterator
();
for
(
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_refListStore
->
children
().
begin
();
iter
!=
m_refListStore
->
children
().
end
();
++
iter
)
for
(
a
u
to
iter
=
m_refListStore
->
children
().
begin
();
iter
!=
m_refListStore
->
children
().
end
();
++
iter
)
{
//Gtk::TreeModel::Row row = *iter;
const
auto
valTemp
=
get_value_key
(
iter
);
...
...
@@ -519,7 +519,7 @@ guint DbAddDel::get_fixed_cell_height()
m_fixed_cell_height
=
height
;
//Look at each column:
for
(
type_column_items
::
iter
ato
r
iter
=
m_column_items
.
begin
();
iter
!=
m_column_items
.
end
();
++
iter
)
for
(
a
u
to
iter
=
m_column_items
.
begin
();
iter
!=
m_column_items
.
end
();
++
iter
)
{
Glib
::
ustring
font_name
;
...
...
@@ -694,7 +694,7 @@ void DbAddDel::construct_specified_columns()
const
auto
has_expandable_column
=
get_column_to_expand
(
column_to_expand
);
//std::cout << "DEBUG: column_to_expand=" << column_to_expand << ", has=" << has_expandable_column << std::endl;
for
(
type_column_items
::
iter
ato
r
iter
=
m_column_items
.
begin
();
iter
!=
m_column_items
.
end
();
++
iter
)
for
(
a
u
to
iter
=
m_column_items
.
begin
();
iter
!=
m_column_items
.
end
();
++
iter
)
{
const
std
::
shared_ptr
<
LayoutItem
>
layout_item
=
m_column_items
[
model_column_index
];
//TODO: Inefficient.
if
(
layout_item
)
//column_info.m_visible)
...
...
@@ -1254,7 +1254,7 @@ void DbAddDel::on_cell_layout_button_clicked(const Gtk::TreeModel::Path& path, i
if
(
!
m_refListStore
)
return
;
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_refListStore
->
get_iter
(
path
);
a
u
to
iter
=
m_refListStore
->
get_iter
(
path
);
if
(
iter
)
{
std
::
shared_ptr
<
const
LayoutItem
>
layout_item
=
m_column_items
[
model_column_index
];
...
...
@@ -1279,7 +1279,7 @@ void DbAddDel::on_treeview_cell_edited_bool(const Glib::ustring& path_string, in
const
Gtk
::
TreeModel
::
Path
path
(
path_string
);
//Get the row from the path:
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_refListStore
->
get_iter
(
path
);
a
u
to
iter
=
m_refListStore
->
get_iter
(
path
);
if
(
iter
)
{
Gtk
::
TreeModel
::
Row
row
=
*
iter
;
...
...
@@ -1398,7 +1398,7 @@ void DbAddDel::on_treeview_cell_edited(const Glib::ustring& path_string, const G
}
//Get the row from the path:
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_refListStore
->
get_iter
(
path
);
a
u
to
iter
=
m_refListStore
->
get_iter
(
path
);
if
(
iter
!=
get_model
()
->
children
().
end
())
{
Gtk
::
TreeModel
::
Row
row
=
*
iter
;
...
...
@@ -1626,9 +1626,9 @@ void DbAddDel::on_treeview_columns_changed()
typedef
std
::
vector
<
Gtk
::
TreeViewColumn
*>
type_vecViewColumns
;
type_vecViewColumns
vecViewColumns
=
m_TreeView
.
get_columns
();
for
(
type_vecViewColumns
::
iter
ato
r
iter
=
vecViewColumns
.
begin
();
iter
!=
vecViewColumns
.
end
();
++
iter
)
for
(
a
u
to
iter
=
vecViewColumns
.
begin
();
iter
!=
vecViewColumns
.
end
();
++
iter
)
{
DbTreeViewColumnGlom
*
pViewColumn
=
dynamic_cast
<
DbTreeViewColumnGlom
*>
(
*
iter
);
auto
pViewColumn
=
dynamic_cast
<
DbTreeViewColumnGlom
*>
(
*
iter
);
if
(
pViewColumn
)
{
const
auto
column_id
=
pViewColumn
->
get_column_id
();
...
...
@@ -2055,7 +2055,7 @@ void DbAddDel::show_hint_model()
m_treeviewcolumn_button
=
0
;
//When we removed the view columns, this was deleted because it's manage()ed.
m_model_hint
=
Gtk
::
ListStore
::
create
(
m_columns_hint
);
Gtk
::
TreeModel
::
iter
ato
r
iter
=
m_model_hint
->
append
();
a
u
to
iter
=
m_model_hint
->
append
();
(
*
iter
)[
m_columns_hint
.
m_col_hint
]
=
_
(
"Right-click to layout, to specify the related fields."
);
m_TreeView
.
set_model
(
m_model_hint
);
...
...
@@ -2065,7 +2065,7 @@ void DbAddDel::show_hint_model()
bool
DbAddDel
::
start_new_record
()
{
Gtk
::
TreeModel
::
iter
ato
r
iter
=
get_item_placeholder
();
a
u
to
iter
=
get_item_placeholder
();
if
(
!
iter
)
return
false
;
...
...
@@ -2081,7 +2081,7 @@ bool DbAddDel::start_new_record()
if
(
fieldPrimaryKey
&&
fieldPrimaryKey
->
get_auto_increment
())
{
//Start editing in the first cell that is not auto_increment:
for
(
type_column_items
::
iter
ato
r
iter
=
m_column_items
.
begin
();
iter
!=
m_column_items
.
end
();
++
iter
)
for
(
a
u
to
iter
=
m_column_items
.
begin
();
iter
!=
m_column_items
.
end
();
++
iter
)
{
std
::
shared_ptr
<
LayoutItem
>
layout_item
=
*
iter
;
std
::
shared_ptr
<
LayoutItem_Field
>
layout_item_field
=
std
::
dynamic_pointer_cast
<
LayoutItem_Field
>
(
layout_item
);
...
...
glom/mode_data/flowtablewithfields.cc
View file @
601fd228
...
...
@@ -62,15 +62,15 @@ FlowTableWithFields::FlowTableWithFields(const Glib::ustring& table_name)
FlowTableWithFields
::~
FlowTableWithFields
()
{
//Remove views. The widgets are deleted automatically because they are managed.
for
(
type_listFields
::
iterator
iter
=
m_listFields
.<