[glom] cppcheck: Reduce scope of variables.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] cppcheck: Reduce scope of variables.
- Date: Sun, 1 Nov 2015 12:57:01 +0000 (UTC)
commit 067c3a7e13619993ffc859f661daf71ad471c884
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Oct 30 10:11:16 2015 +0100
cppcheck: Reduce scope of variables.
glom/appwindow.cc | 5 ++---
glom/dialog_existing_or_new.cc | 3 +--
glom/frame_glom.cc | 3 ++-
3 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/glom/appwindow.cc b/glom/appwindow.cc
index 043c2a9..5f3197f 100644
--- a/glom/appwindow.cc
+++ b/glom/appwindow.cc
@@ -2534,11 +2534,10 @@ void AppWindow::document_history_add(const Glib::ustring& file_uri)
if(file_uri.empty())
return;
- bool prevent = false;
if(!file_uri.empty())
{
- prevent = (file_uri == m_example_uri);
- if(prevent)
+ //Prevent saving of example file templates just because we opened them:
+ if(file_uri == m_example_uri);
return;
}
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index a9892cc..326206a 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -258,10 +258,9 @@ bool Dialog_ExistingOrNew::list_examples()
{
//std::cout << "debug: " << G_STRFUNC << ": path=" << path << std::endl;
- const char* examples_dir = "/org/gnome/glom/examples/";
-
try
{
+ const char* examples_dir = "/org/gnome/glom/examples/";
const auto examples = Gio::Resource::enumerate_children_global(examples_dir);
bool example_found = false;
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index bca56a2..519fe42 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -1130,9 +1130,10 @@ void Frame_Glom::on_dialog_add_related_table_response(int response)
m_dialog_addrelatedtable->hide();
- bool stop_trying = false;
if(response == Gtk::RESPONSE_OK)
{
+ bool stop_trying = false;
+
Glib::ustring table_name, relationship_name, from_key_name;
m_dialog_addrelatedtable->get_input(table_name, relationship_name, from_key_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]