This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  1a594de74e9584e6f649c37912751c584f1a73a2 (commit)
      from  f8291de919fd3f1ac708680712aba13c7c1737ff (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/1a594de74e9584e6f649c37912751c584f1a73a2

commit 1a594de74e9584e6f649c37912751c584f1a73a2
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Jun 6 12:34:36 2012 +0200

    Remove code duplication by calling readGlobalDomain()
    
    The code in defaults.c to get the shared database is
    included in the same file (function readGlobalDomain).

diff --git a/src/defaults.c b/src/defaults.c
index 0c4daf1..50e8cbe 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -803,7 +803,6 @@ WDDomain *wDefaultsInitDomain(char *domain, Bool 
requireDictionary)
        WDDomain *db;
        struct stat stbuf;
        static int inited = 0;
-       char path[PATH_MAX];
        char *the_path;
        WMPropList *shared_dict = NULL;
 
@@ -832,32 +831,19 @@ WDDomain *wDefaultsInitDomain(char *domain, Bool 
requireDictionary)
        }
 
        /* global system dictionary */
-       snprintf(path, sizeof(path), "%s/%s/%s", SYSCONFDIR, 
GLOBAL_DEFAULTS_SUBDIR, domain);
-       if (stat(path, &stbuf) >= 0) {
-               shared_dict = WMReadPropListFromFile(path);
-               if (shared_dict) {
-                       if (requireDictionary && 
!WMIsPLDictionary(shared_dict)) {
-                               wwarning(_("Domain %s (%s) of global defaults 
database is corrupted!"),
-                                        domain, path);
-                               WMReleasePropList(shared_dict);
-                               shared_dict = NULL;
-                       } else {
-                               if (db->dictionary && 
WMIsPLDictionary(shared_dict) &&
-                                   WMIsPLDictionary(db->dictionary)) {
-                                       WMMergePLDictionaries(shared_dict, 
db->dictionary, True);
-                                       WMReleasePropList(db->dictionary);
-                                       db->dictionary = shared_dict;
-                                       if (stbuf.st_mtime > db->timestamp)
-                                               db->timestamp = stbuf.st_mtime;
-                               } else if (!db->dictionary) {
-                                       db->dictionary = shared_dict;
-                                       if (stbuf.st_mtime > db->timestamp)
-                                               db->timestamp = stbuf.st_mtime;
-                               }
-                       }
-               } else {
-                       wwarning(_("could not load domain %s from global 
defaults database (%s)"), domain, path);
-               }
+       shared_dict = readGlobalDomain(domain, requireDictionary);
+
+       if (shared_dict && db->dictionary && WMIsPLDictionary(shared_dict) &&
+           WMIsPLDictionary(db->dictionary)) {
+               WMMergePLDictionaries(shared_dict, db->dictionary, True);
+               WMReleasePropList(db->dictionary);
+               db->dictionary = shared_dict;
+               if (stbuf.st_mtime > db->timestamp)
+                       db->timestamp = stbuf.st_mtime;
+       } else if (!db->dictionary) {
+               db->dictionary = shared_dict;
+               if (stbuf.st_mtime > db->timestamp)
+                       db->timestamp = stbuf.st_mtime;
        }
 
        return db;

-----------------------------------------------------------------------

Summary of changes:
 src/defaults.c |   40 +++++++++++++---------------------------
 1 files changed, 13 insertions(+), 27 deletions(-)


repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to [email protected].

Reply via email to