[Winpt-commits] r299 - trunk/Src
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Sun Mar 18 20:58:12 CET 2007
Author: twoaday
Date: 2007-03-18 20:58:12 +0100 (Sun, 18 Mar 2007)
New Revision: 299
Modified:
trunk/Src/wptImportList.cpp
trunk/Src/wptRegistryMobile.cpp
trunk/Src/wptSigList.cpp
Log:
Modified: trunk/Src/wptImportList.cpp
===================================================================
--- trunk/Src/wptImportList.cpp 2007-03-17 22:32:41 UTC (rev 298)
+++ trunk/Src/wptImportList.cpp 2007-03-18 19:58:12 UTC (rev 299)
@@ -1,5 +1,5 @@
/* wptImportList.cpp - Key import list
- * Copyright (C) 2001-2006 Timo Schulz
+ * Copyright (C) 2001-2007 Timo Schulz
* Copyright (C) 2005 g10 Code GmbH
*
* This file is part of WinPT.
@@ -201,7 +201,8 @@
/* Read the next key from data stream @out. The result is stored in @r_key.
Return value: 0 on success. */
gpgme_error_t
-gpg_import_next_key (gpgme_data_t out, char **pending_line, import_key_t *r_key)
+gpg_import_next_key (gpgme_data_t out, char **pending_line,
+ import_key_t *r_key)
{
import_key_t key;
int in_cert, got_block = 0;
@@ -213,7 +214,7 @@
key = (import_key_t) calloc (1, sizeof *key);
if (!key)
- return gpg_error (GPG_ERR_ENOMEM);
+ BUG (0);
if (*pending_line) {
parse_colon_key (*pending_line, key);
@@ -330,7 +331,7 @@
{3, 72, (char *)_("Creation")},
{4, 132, (char *)_("Type")},
{0, 0, NULL}
- };
+ };
int i;
listview_new (&c, ctrl);
@@ -344,6 +345,8 @@
}
+/* Check to verify that the file can be access and
+ set @r_revcert to '1' in case of an revocation cert. */
static int
check_import_data (const char *fname, int *r_revcert)
{
@@ -416,7 +419,7 @@
}
err = gpgme_data_new_from_mem (&list, out, strlen (out), 1);
- free (out);
+ safe_free (out);
if (err) {
msg_box (NULL, gpgme_strerror (err), _("Import"), MB_ERR);
if (is_tmp)
Modified: trunk/Src/wptRegistryMobile.cpp
===================================================================
--- trunk/Src/wptRegistryMobile.cpp 2007-03-17 22:32:41 UTC (rev 298)
+++ trunk/Src/wptRegistryMobile.cpp 2007-03-18 19:58:12 UTC (rev 299)
@@ -1,5 +1,5 @@
-/* wptRegistryMobile.cpp - Mobile config access
- * Copyright (C) 2006 Timo Schulz
+/* wptRegistryMobile.cpp - Registry emulation for the mobile mode
+ * Copyright (C) 2006, 2007 Timo Schulz
*
* This file is part of WinPT.
*
@@ -12,10 +12,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with WinPT; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -31,8 +27,9 @@
#include "wptW32API.h"
#include "wptErrors.h"
-static config_file_t pr = NULL;
+static config_file_t cfg_file = NULL;
+
struct winpt_prefs_s reg_prefs;
/* Because we do not use any existing software, we hardcode
@@ -49,18 +46,18 @@
void
free_reg_prefs (void)
{
- if (pr != NULL) {
- commit_config ("c:\\winpt_prefs.txt", &pr);
- release_config (pr);
+ if (cfg_file != NULL) {
+ commit_config ("c:\\winpt_prefs.txt", &cfg_file);
+ release_config (cfg_file);
}
- pr = NULL;
+ cfg_file = NULL;
}
static gpg_option_t
reg_find_option (const char *key)
{
- if (pr == NULL)
+ if (cfg_file == NULL)
parse_config ("c:\\winpt_prefs.txt", &pr);
return find_option (pr, key);
}
@@ -71,10 +68,9 @@
{
char buf[128];
size_t i;
- int rc = 0;
- if (pr == NULL)
- new_config (&pr);
+ if (cfg_file == NULL)
+ new_config (&cfg_file);
for (i=1; i < DIM (cfg); i++) {
switch (i) {
@@ -210,6 +206,7 @@
+/* Just a dummy needed for 1-to-1 mapping. */
int
regist_inst_gnupg (int create_mokey)
{
@@ -218,6 +215,7 @@
+/* Just a dummy for 1-to-1 mapping. */
int
regist_inst_winpt (int with_ext, int *created)
{
@@ -259,7 +257,6 @@
int
set_reg_entry_gpg (const char *key, const char *value)
{
-
return set_reg_entry (HKEY_CURRENT_USER, NULL, key, value);
}
@@ -330,7 +327,6 @@
}
-
int
set_reg_winpt_flag (const char *name, int val)
{
Modified: trunk/Src/wptSigList.cpp
===================================================================
--- trunk/Src/wptSigList.cpp 2007-03-17 22:32:41 UTC (rev 298)
+++ trunk/Src/wptSigList.cpp 2007-03-18 19:58:12 UTC (rev 299)
@@ -13,10 +13,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with WinPT; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_CONFIG_H
@@ -48,7 +44,7 @@
static void
siglist_build (listview_ctrl_t *lv, HWND ctrl)
{
- struct listview_ctrl_s *c;
+ listview_ctrl_t c;
struct listview_column_s implist[] = {
{0, 240, (char *)_("User ID")},
{1, 50, (char *)_("Valid")},
@@ -104,7 +100,7 @@
{
LV_ITEM lvi;
- memset (&lvi, 0, sizeof lvi);
+ memset (&lvi, 0, sizeof (lvi));
lvi.iItem = pos;
lvi.lParam = (LPARAM)ks;
lvi.mask = LVIF_PARAM;
@@ -126,7 +122,7 @@
const char *s;
char t[128];
int no_uid = 0;
- int rc = 0;
+ int rc;
if (ks && !IS_UID_CERT (ks->sig_class))
return 0;
@@ -158,14 +154,15 @@
if (uid)
return 0;
+ /* TRANSLATORS: these strings should be in capital letters. */
switch (gpgme_err_code (ks->status)) {
- case GPG_ERR_NO_ERROR: s = "YES"; break;
- case GPG_ERR_NO_PUBKEY: s = "NOKEY"; break;
- case GPG_ERR_BAD_SIGNATURE:s = "NO"; break;
- default: s = "ERROR"; break;
+ case GPG_ERR_NO_ERROR: s = _("YES"); break;
+ case GPG_ERR_NO_PUBKEY: s = _("NOKEY"); break;
+ case GPG_ERR_BAD_SIGNATURE:s = _("NO"); break;
+ default: s = _("ERROR"); break;
}
if (no_uid)
- s = "NOKEY";
+ s = _("NOKEY");
listview_add_sub_item (lv, pos, SL_COL_VALID, s);
switch (ks->sig_class) {
More information about the Winpt-commits
mailing list