Fossil SCM
Fix the "Behavior" setup page so that it has the correct default values for unspecified attributes. Ticket [0101a97fefd5ca91d]
Commit
671e7c34e9a78bd49212e149760c51625fbb9a82
Parent
4165033b4030ce9…
1 file changed
+5
-11
+5
-11
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -634,18 +634,12 @@ | ||
| 634 | 634 | const char *zLabel, /* The text label on the checkbox */ |
| 635 | 635 | const char *zVar, /* The corresponding row in the VAR table */ |
| 636 | 636 | const char *zQParm, /* The query parameter */ |
| 637 | 637 | int dfltVal /* Default value if VAR table entry does not exist */ |
| 638 | 638 | ){ |
| 639 | - const char *zVal = db_get(zVar, 0); | |
| 640 | 639 | const char *zQ = P(zQParm); |
| 641 | - int iVal; | |
| 642 | - if( zVal ){ | |
| 643 | - iVal = atoi(zVal); | |
| 644 | - }else{ | |
| 645 | - iVal = dfltVal; | |
| 646 | - } | |
| 640 | + int iVal = db_get_boolean(zVar, dfltVal); | |
| 647 | 641 | if( zQ==0 && P("submit") ){ |
| 648 | 642 | zQ = "off"; |
| 649 | 643 | } |
| 650 | 644 | if( zQ ){ |
| 651 | 645 | int iQ = strcmp(zQ,"on")==0 || atoi(zQ); |
| @@ -806,18 +800,18 @@ | ||
| 806 | 800 | @ <form action="%s(g.zBaseURL)/setup_behavior" method="POST"> |
| 807 | 801 | login_insert_csrf_secret(); |
| 808 | 802 | |
| 809 | 803 | @ <hr> |
| 810 | 804 | onoff_attribute("Automatically synchronize with repository", |
| 811 | - "autosync", "autosync", 0); | |
| 805 | + "autosync", "autosync", 1); | |
| 812 | 806 | @ <p>Automatically keeps your work in sync with a centralized server.</p> |
| 813 | 807 | |
| 814 | 808 | @ <hr> |
| 815 | - onoff_attribute("Sign all commits with gpg", | |
| 816 | - "clearsign", "clearsign", 0); | |
| 809 | + onoff_attribute("Sign all commits with GPG", | |
| 810 | + "clearsign", "clearsign", 1); | |
| 817 | 811 | @ <p>When enabled (the default), fossil will attempt to |
| 818 | - @ sign all commits with gpg. When disabled, commits will | |
| 812 | + @ sign all commits with GPG. When disabled, commits will | |
| 819 | 813 | @ be unsigned.</p> |
| 820 | 814 | |
| 821 | 815 | @ <hr> |
| 822 | 816 | onoff_attribute("Require local authentication", |
| 823 | 817 | "localauth", "localauth", 0); |
| 824 | 818 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -634,18 +634,12 @@ | |
| 634 | const char *zLabel, /* The text label on the checkbox */ |
| 635 | const char *zVar, /* The corresponding row in the VAR table */ |
| 636 | const char *zQParm, /* The query parameter */ |
| 637 | int dfltVal /* Default value if VAR table entry does not exist */ |
| 638 | ){ |
| 639 | const char *zVal = db_get(zVar, 0); |
| 640 | const char *zQ = P(zQParm); |
| 641 | int iVal; |
| 642 | if( zVal ){ |
| 643 | iVal = atoi(zVal); |
| 644 | }else{ |
| 645 | iVal = dfltVal; |
| 646 | } |
| 647 | if( zQ==0 && P("submit") ){ |
| 648 | zQ = "off"; |
| 649 | } |
| 650 | if( zQ ){ |
| 651 | int iQ = strcmp(zQ,"on")==0 || atoi(zQ); |
| @@ -806,18 +800,18 @@ | |
| 806 | @ <form action="%s(g.zBaseURL)/setup_behavior" method="POST"> |
| 807 | login_insert_csrf_secret(); |
| 808 | |
| 809 | @ <hr> |
| 810 | onoff_attribute("Automatically synchronize with repository", |
| 811 | "autosync", "autosync", 0); |
| 812 | @ <p>Automatically keeps your work in sync with a centralized server.</p> |
| 813 | |
| 814 | @ <hr> |
| 815 | onoff_attribute("Sign all commits with gpg", |
| 816 | "clearsign", "clearsign", 0); |
| 817 | @ <p>When enabled (the default), fossil will attempt to |
| 818 | @ sign all commits with gpg. When disabled, commits will |
| 819 | @ be unsigned.</p> |
| 820 | |
| 821 | @ <hr> |
| 822 | onoff_attribute("Require local authentication", |
| 823 | "localauth", "localauth", 0); |
| 824 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -634,18 +634,12 @@ | |
| 634 | const char *zLabel, /* The text label on the checkbox */ |
| 635 | const char *zVar, /* The corresponding row in the VAR table */ |
| 636 | const char *zQParm, /* The query parameter */ |
| 637 | int dfltVal /* Default value if VAR table entry does not exist */ |
| 638 | ){ |
| 639 | const char *zQ = P(zQParm); |
| 640 | int iVal = db_get_boolean(zVar, dfltVal); |
| 641 | if( zQ==0 && P("submit") ){ |
| 642 | zQ = "off"; |
| 643 | } |
| 644 | if( zQ ){ |
| 645 | int iQ = strcmp(zQ,"on")==0 || atoi(zQ); |
| @@ -806,18 +800,18 @@ | |
| 800 | @ <form action="%s(g.zBaseURL)/setup_behavior" method="POST"> |
| 801 | login_insert_csrf_secret(); |
| 802 | |
| 803 | @ <hr> |
| 804 | onoff_attribute("Automatically synchronize with repository", |
| 805 | "autosync", "autosync", 1); |
| 806 | @ <p>Automatically keeps your work in sync with a centralized server.</p> |
| 807 | |
| 808 | @ <hr> |
| 809 | onoff_attribute("Sign all commits with GPG", |
| 810 | "clearsign", "clearsign", 1); |
| 811 | @ <p>When enabled (the default), fossil will attempt to |
| 812 | @ sign all commits with GPG. When disabled, commits will |
| 813 | @ be unsigned.</p> |
| 814 | |
| 815 | @ <hr> |
| 816 | onoff_attribute("Require local authentication", |
| 817 | "localauth", "localauth", 0); |
| 818 |