[Winpt-commits] r66 - trunk/Src
scm-commit at wald.intevation.org
scm-commit at wald.intevation.org
Thu Nov 3 18:55:19 CET 2005
Author: twoaday
Date: 2005-11-03 18:55:18 +0100 (Thu, 03 Nov 2005)
New Revision: 66
Modified:
trunk/Src/ChangeLog
trunk/Src/WinPT.cpp
trunk/Src/wptGPG.cpp
trunk/Src/wptGPGPrefsDlg.cpp
trunk/Src/wptKeyManager.cpp
Log:
Fix crash in the GPG preference dialog.
Allow to have an empty secret keyring.
Modified: trunk/Src/ChangeLog
===================================================================
--- trunk/Src/ChangeLog 2005-11-03 16:55:25 UTC (rev 65)
+++ trunk/Src/ChangeLog 2005-11-03 17:55:18 UTC (rev 66)
@@ -1,6 +1,12 @@
2005-11-03 Timo Schulz <ts at g10code.com>
A lot of minor changes to avoid GCC warnings.
+
+ * wptGPG.cpp (get_gnupg_keyring): Only check size for
+ public keyring.
+ * wptKeyManager.cpp (km_update_default_key_str): Do
+ not issue a bug message when no secret key was found.
+ * wptGPGPrefsDlg.cpp: Replace "" with NULL in the name struct.
2005-11-02 Werner Koch <wk at g10code.com>
Modified: trunk/Src/WinPT.cpp
===================================================================
--- trunk/Src/WinPT.cpp 2005-11-03 16:55:25 UTC (rev 65)
+++ trunk/Src/WinPT.cpp 2005-11-03 17:55:18 UTC (rev 66)
@@ -127,6 +127,8 @@
defkey = get_gnupg_default_key ();
if (defkey)
err = gpg_keycache_find_key (kc, defkey, 0, &key);
+ else
+ msg_box (NULL, _("No useable secret key found."), _("WinPT Error"), MB_ERR);
free_if_alloc (defkey);
return err? -1 : 0;
}
Modified: trunk/Src/wptGPG.cpp
===================================================================
--- trunk/Src/wptGPG.cpp 2005-11-03 16:55:25 UTC (rev 65)
+++ trunk/Src/wptGPG.cpp 2005-11-03 17:55:18 UTC (rev 66)
@@ -156,7 +156,7 @@
free_if_alloc (path);
return keyring;
}
- if (file_exist_check (keyring) || get_file_size (keyring) == 0) {
+ if (file_exist_check (keyring) || pub && get_file_size (keyring) == 0) {
free_if_alloc (keyring);
optfile = make_filename (path, GPG_CONF, NULL);
keyring = get_gnupg_keyring_from_options (optfile, pub);
@@ -217,10 +217,8 @@
break;
}
}
- if (!keyid) {
+ if (!keyid)
*ret_no_useable = 1;
- msg_box (NULL, _("No useable secret key found."), _("GPG Error"), MB_ERR);
- }
return keyid;
}
Modified: trunk/Src/wptGPGPrefsDlg.cpp
===================================================================
--- trunk/Src/wptGPGPrefsDlg.cpp 2005-11-03 16:55:25 UTC (rev 65)
+++ trunk/Src/wptGPGPrefsDlg.cpp 2005-11-03 17:55:18 UTC (rev 66)
@@ -43,7 +43,7 @@
{"HomeDir", IDC_GPGPREFS_HOMEDIR},
{"gpgProgram", IDC_GPGPREFS_EXEDIR},
{"OptFile", IDC_GPGPREFS_OPTFILE},
- {"", 0}
+ {NULL, 0}
};
/* Dialog box procedure for the GPG preferences. */
Modified: trunk/Src/wptKeyManager.cpp
===================================================================
--- trunk/Src/wptKeyManager.cpp 2005-11-03 16:55:25 UTC (rev 65)
+++ trunk/Src/wptKeyManager.cpp 2005-11-03 17:55:18 UTC (rev 66)
@@ -832,7 +832,7 @@
/* XXX: also show the name? */
keyid = get_gnupg_default_key ();
if (!keyid)
- BUG (0);
+ return;
if( (keyid[0] >= 'A' && keyid[0] <= 'Z') || (keyid[0] >= 'a' && keyid[0] <= 'z')
|| (keyid[0] == '0' && keyid[1] == 'x') )
fmt = _("Default Key: %s");
More information about the Winpt-commits
mailing list