Check-in [671e7c34e9]
Not logged in
Overview

SHA1 Hash:671e7c34e9a78bd49212e149760c51625fbb9a82
Date: 2009-10-31 13:50:08
User: drh
Comment:Fix the "Behavior" setup page so that it has the correct default values for unspecified attributes. Ticket 0101a97fefd5ca91d
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/setup.c from [95f147ca17] to [41b6907a33].

@@ -634,18 +634,12 @@
   const char *zLabel,   /* The text label on the checkbox */
   const char *zVar,     /* The corresponding row in the VAR table */
   const char *zQParm,   /* The query parameter */
   int dfltVal           /* Default value if VAR table entry does not exist */
 ){
-  const char *zVal = db_get(zVar, 0);
   const char *zQ = P(zQParm);
-  int iVal;
-  if( zVal ){
-    iVal = atoi(zVal);
-  }else{
-    iVal = dfltVal;
-  }
+  int iVal = db_get_boolean(zVar, dfltVal);
   if( zQ==0 && P("submit") ){
     zQ = "off";
   }
   if( zQ ){
     int iQ = strcmp(zQ,"on")==0 || atoi(zQ);
@@ -806,18 +800,18 @@
   @ <form action="%s(g.zBaseURL)/setup_behavior" method="POST">
   login_insert_csrf_secret();
 
   @ <hr>
   onoff_attribute("Automatically synchronize with repository",
-                  "autosync", "autosync", 0);
+                  "autosync", "autosync", 1);
   @ <p>Automatically keeps your work in sync with a centralized server.</p>
 
   @ <hr>
-  onoff_attribute("Sign all commits with gpg",
-                  "clearsign", "clearsign", 0);
+  onoff_attribute("Sign all commits with GPG",
+                  "clearsign", "clearsign", 1);
   @ <p>When enabled (the default), fossil will attempt to
-  @     sign all commits with gpg.  When disabled, commits will
+  @     sign all commits with GPG.  When disabled, commits will
   @    be unsigned.</p>
 
   @ <hr>
   onoff_attribute("Require local authentication",
                   "localauth", "localauth", 0);