[Winpt-commits] r291 - trunk/Src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Mar 12 21:33:52 CET 2007


Author: twoaday
Date: 2007-03-12 21:33:51 +0100 (Mon, 12 Mar 2007)
New Revision: 291

Modified:
   trunk/Src/ChangeLog
   trunk/Src/wptSecmem.cpp
   trunk/Src/wptTextInputDlg.cpp
   trunk/Src/wptVerifyList.cpp
Log:
cleanups.



Modified: trunk/Src/ChangeLog
===================================================================
--- trunk/Src/ChangeLog	2007-03-10 11:18:34 UTC (rev 290)
+++ trunk/Src/ChangeLog	2007-03-12 20:33:51 UTC (rev 291)
@@ -1,3 +1,7 @@
+2007-03-12  Timo Schulz  <twoaday at gmx.net>
+	
+	* wptVerifyList.cpp (extract_filename): Simplified.
+
 2007-03-10  Timo Schulz  <twoaday at gmx.net>
 
 	* wptKeyserver.cpp (kserver_recvkey): Use StringBuffer to

Modified: trunk/Src/wptSecmem.cpp
===================================================================
--- trunk/Src/wptSecmem.cpp	2007-03-10 11:18:34 UTC (rev 290)
+++ trunk/Src/wptSecmem.cpp	2007-03-12 20:33:51 UTC (rev 291)
@@ -13,10 +13,6 @@
  * 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 
- *
  * This is the notice from the original author:
  *
  * win32vmSafe - a 'no write to disk' volatile buffer

Modified: trunk/Src/wptTextInputDlg.cpp
===================================================================
--- trunk/Src/wptTextInputDlg.cpp	2007-03-10 11:18:34 UTC (rev 290)
+++ trunk/Src/wptTextInputDlg.cpp	2007-03-12 20:33:51 UTC (rev 291)
@@ -1,5 +1,5 @@
 /* wptTextInputDlg.cpp - Dialog for getting text
- *	Copyright (C) 2001-2006 Timo Schulz
+ *	Copyright (C) 2001-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>
@@ -91,7 +87,8 @@
     case WM_COMMAND:
         switch (LOWORD (wparam)) {
         case IDC_TEXT_FILE:
-            file = get_fileopen_dlg (dlg, _("Text Input from File"), NULL, NULL);
+            file = get_fileopen_dlg (dlg, _("Text Input from File"), 
+				     NULL, NULL);
             if (file)
                 load_file_contents (dlg, file);
             break;

Modified: trunk/Src/wptVerifyList.cpp
===================================================================
--- trunk/Src/wptVerifyList.cpp	2007-03-10 11:18:34 UTC (rev 290)
+++ trunk/Src/wptVerifyList.cpp	2007-03-12 20:33:51 UTC (rev 291)
@@ -49,20 +49,14 @@
 static char*
 extract_filename (const char *path)
 {
-    char * fname, *p;
-    int n, len = 0;
+    char *p;
+    size_t pos;
 
     p = strrchr (path, '\\');
-    if (!p)
+    if (p == NULL)
 	return m_strdup (path);
-    n = p - path;
-    len = strlen (path) - n;
-    fname = new char[len+1];
-    if (!fname)
-	BUG (NULL);
-    memcpy (fname, path+n+1, len);
-    fname[len] = '\0';
-    return fname;
+    pos = p-path;
+    return substr (path, pos+1, strlen (path)-pos);
 }
 
 
@@ -152,7 +146,7 @@
 	BUG (0);
     memset (v, 0, sizeof *v);
     listview_new (&v->lv, ctrl);
-    for(j=0; verlist[j].fieldname; j++)
+    for (j=0; verlist[j].fieldname; j++)
 	listview_add_column (v->lv, &verlist[j]);
     if (!fm_mode)
 	listview_set_column_width (v->lv, 0, 80);
@@ -278,7 +272,7 @@
     winpt_get_pubkey (sig->fpr, &key);
     
     name = extract_filename (log->file);
-    if (name)
+    if (name != NULL)
 	listview_add_sub_item (lv, 0, VER_COL_NAME, name);
     else
 	listview_add_sub_item (lv, 0, VER_COL_NAME, log->file);
@@ -288,14 +282,14 @@
 	attr = get_gpg_sigstat (GPGME_SIGSUM_GREEN);
     else
 	attr = get_gpg_sigstat (sig->summary);
-    if (attr)
-	listview_add_sub_item (lv, 0, VER_COL_STAT, attr);
+    listview_add_sub_item (lv, 0, VER_COL_STAT, attr);
 
     if (sig->timestamp > 0) {
 	attr = get_locale_timedate (sig->timestamp, timebuf, DIM (timebuf)-1);
 	if (!attr)
 	    attr = _("Unknown");
     }
+    else
 	attr = _("Unknown");
     listview_add_sub_item (lv, 0, VER_COL_SIGNED, attr);
         
@@ -305,7 +299,6 @@
 	attr = _("Unknown");
     listview_add_sub_item (lv, 0, VER_COL_TRUST, attr);
 
-
     attr = sig_get_real_keyid (sig, &key);
     _snprintf (t, DIM (t)-1, "0x%s", attr);
     listview_add_sub_item (lv, 0, VER_COL_KEYID, t);



More information about the Winpt-commits mailing list