Skip to content

Commit

Permalink
Revert "Bug 745101 - No warning when quitting with unsaved file"
Browse files Browse the repository at this point in the history
This reverts commit 568bfa0.
  • Loading branch information
gjanssens committed Dec 10, 2015
1 parent 568bfa0 commit c559d28
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 31 deletions.
42 changes: 13 additions & 29 deletions src/libqof/qof/qofsession.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ unregister_all_providers (void)
}
}

#define DEFAULT_BACKEND "xml"

static void
qof_session_load_backend(QofSession * session, const char * access_method);


/* ====================================================================== */

void
Expand Down Expand Up @@ -264,7 +258,6 @@ qof_session_init (QofSession *session)
session->backend = NULL;
session->lock = 1;

qof_session_load_backend(session, DEFAULT_BACKEND);
qof_session_clear_error (session);
}

Expand Down Expand Up @@ -362,34 +355,25 @@ qof_session_load_backend(QofSession * session, const char * access_method)
/* Does this provider handle the desired access method? */
if (0 == g_ascii_strcasecmp (access_method, prov->access_method))
{
/* If this is a completely new session (that is, not associated with a file or db yet)
* go for the default backend and skip further type checking.
* This should prevent unintended data loss when a user starts a new book without
* going via the hierarchy assistant.
* See https://bugzilla.gnome.org/show_bug.cgi?id=745101
*/
if (session->book_id || (0 != g_ascii_strcasecmp (DEFAULT_BACKEND, prov->access_method)))
/* More than one backend could provide this
access method, check file type compatibility. */
type_check = (gboolean (*)(const char*)) prov->check_data_type;
if (type_check)
{
/* More than one backend could provide this
access method, check file type compatibility. */
type_check = (gboolean (*)(const char*)) prov->check_data_type;
if (type_check)
{
prov_type = (type_check)(session->book_id);
if (!prov_type)
{
PINFO(" %s not usable", prov->provider_name);
p = p->next;
continue;
}
}
PINFO (" selected %s", prov->provider_name);
if (NULL == prov->backend_new)
prov_type = (type_check)(session->book_id);
if (!prov_type)
{
PINFO(" %s not usable", prov->provider_name);
p = p->next;
continue;
}
}
PINFO (" selected %s", prov->provider_name);
if (NULL == prov->backend_new)
{
p = p->next;
continue;
}
/* Use the providers creation callback */
session->backend = (*(prov->backend_new))();
session->backend->provider = prov;
Expand Down
6 changes: 4 additions & 2 deletions src/python/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
print "test", sys.modules.keys()
print "test2", dir(_sw_app_utils)

root = _sw_app_utils.gnc_get_current_root_account()
root = _sw_app_utils.gnc_get_current_root_account()

if noisy:
print "test", dir(root), root.__class__
print "test2", dir(gnucash_core_c)

acct = Account(instance = root)
acct = Account(instance = root)

if noisy:
print "test3", dir(acct)
#print acct.GetName()
#print acct.GetBalance()
Expand Down

0 comments on commit c559d28

Please sign in to comment.