[glom/maemo5] on_document_load(): Add a ! to really check



commit ad392532da1ddaba1014cb7cc9581ff85f536c80
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Sep 5 16:11:23 2009 +0200

    on_document_load(): Add a ! to really check
    for unsupported backends.

 ChangeLog                      |    5 +++++
 glom/application.cc            |    8 +++++++-
 glom/dialog_existing_or_new.cc |    1 -
 3 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d825dae..93247d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-09-05  Murray Cumming  <murrayc murrayc com>
 
+	* glom/application.cc: on_document_load(): Add a ! to really check 
+	for unsupported backends.
+
+2009-09-05  Murray Cumming  <murrayc murrayc com>
+
 	* glom/application.cc: check_document_hosting_mode_is_supported():
 	Correct and ifdef to an ifndef.
 
diff --git a/glom/application.cc b/glom/application.cc
index 8e45730..31faeb6 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -939,7 +939,7 @@ bool App_Glom::on_document_load()
   if(!pDocument)
     return false;
 
-  if(!pDocument->get_is_new() && check_document_hosting_mode_is_supported(pDocument))
+  if(!pDocument->get_is_new() && !check_document_hosting_mode_is_supported(pDocument))
     return false;
  
 #ifndef GLOM_ENABLE_CLIENT_ONLY
@@ -1341,6 +1341,12 @@ bool App_Glom::offer_new_or_existing()
 
       //Check that a document was opened:
       Document* document = dynamic_cast<Document*>(get_document());
+      if(!document)
+      {
+        std::cerr << "App_Glom::offer_new_or_existing(): document was NULL." << std::endl;
+        return false;
+      }
+
       if(!document->get_file_uri().empty() || (document->get_opened_from_browse()))
         ask_again = false;
     }
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index 33a710b..37dd0f0 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -929,7 +929,6 @@ void Dialog_ExistingOrNew::on_select_clicked()
     if(response_id == Gtk::RESPONSE_OK)
     {
       m_chosen_uri = dialog.get_uri();
-      std::cout << "DEBUG: m_chosen_uri = " << m_chosen_uri << std::endl;
       response(Gtk::RESPONSE_ACCEPT);
     }
   }



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