[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    some patches
From:       Daniel Naber <dnaber () mini ! gt ! owl ! de>
Date:       2000-04-19 22:07:52
[Download RAW message or body]

Hi,

here are some simple patches. I sent them some time ago, but they didn't get 
included cause I just asked "someone" to apply them. So this time I ask:
Don, can you check and apply them please? :-)

The patches are so simple I won't describe them - juts look at them
and complain if they aren't okay.

Regards
 Daniel

["remove-folder-dialog.diff" (text/english)]

--- kmmainwin.cpp.org	Wed Apr 19 23:46:11 2000
+++ kmmainwin.cpp	Wed Apr 19 23:48:45 2000
@@ -590,7 +590,7 @@
   }
 
   str = i18n("Are you sure you want to remove the folder\n"
-			     "\"%1\", discarding it's contents ?")
+			     "\"%1\" and all subfolders, discarding their contents?")
 			     .arg(mFolder->label());
 
   if (KMessageBox::warningContinueCancel(this, str,

["strip-newlines-in-mailto.diff" (text/plain)]

--- kmmessage.cpp.org	Sun Jan 23 15:32:16 2000
+++ kmmessage.cpp	Sun Jan 23 15:33:13 2000
@@ -1658,6 +1658,7 @@
     {
       tmp = addr.copy();
       result += tmp.replace(QRegExp("\""),"");
+      result = result.replace(QRegExp("\n"),"");
       result += "\">";
       if (stripped) result += KMMessage::stripEmailAddr(aEmail);
       else result += addr;

["pgp-passphrase-label.diff" (text/english)]

--- kpgp.cpp.org	Wed Apr 19 23:54:09 2000
+++ kpgp.cpp	Wed Apr 19 23:54:24 2000
@@ -899,7 +899,7 @@
   QVBoxLayout *vlay = new QVBoxLayout( group, KDialog::spacingHint() );
   vlay->addSpacing( fontMetrics().lineSpacing() );  
 
-  storePass = new QCheckBox( i18n("Store passphrase"), group );
+  storePass = new QCheckBox( i18n("Keep passphrase in memory"), group );
   encToSelf = new QCheckBox( i18n("Always encrypt to self"), group );
   vlay->addWidget( storePass );
   vlay->addWidget( encToSelf );

["dead-letter-permissions.diff" (text/x-c)]

--- kmcomposewin.cpp.bak	Sun Feb 27 16:26:58 2000
+++ kmcomposewin.cpp	Tue Feb 29 00:11:27 2000
@@ -60,6 +60,7 @@
 #include <errno.h>
 #include <klocale.h>
 #include <ktempfile.h>
+#include <fcntl.h>
 
 #if defined CHARSETS
 #include <kcharsets.h>
@@ -349,28 +350,29 @@
 //-----------------------------------------------------------------------------
 void KMComposeWin::deadLetter(void)
 {
-  FILE* fh;
-  char fname[128];
-  const char* msgStr;
-
   if (!mMsg) return;
-
   // This method is called when KMail crashed, so we better use as
   // basic functions as possible here.
   applyChanges();
-  msgStr = mMsg->asString();
-
-  sprintf(fname,"%s/dead.letter",getenv("HOME"));
-  fh = fopen(fname,"a");
-  if (fh)
+  QString msgStr = mMsg->asString();
+  QString fname = getenv("HOME");
+  fname += "/dead.letter";
+  // Security: the file is created in the user's home directory, which
+  // might be readable by other users. So the file only gets read/write
+  // permissions for the user himself. Note that we create the file with
+  // correct permissions, we do not set them after creating the file!
+  // (dnaber, 2000-02-27):
+  int fd = open(fname, O_CREAT|O_APPEND|O_WRONLY, S_IWRITE|S_IREAD);
+  if (fd != -1)
   {
-    fwrite("From ???@??? Mon Jan 01 00:00:00 1997\n", 19, 1, fh);
-    fwrite(msgStr, strlen(msgStr), 1, fh);
-    fwrite("\n", 1, 1, fh);
-    fclose(fh);
+    const char* startStr = "From ???@??? Mon Jan 01 00:00:00 1997\n";
+    write(fd, startStr, strlen(startStr));
+    write(fd, msgStr.latin1(), msgStr.length());		// TODO?: not unicode aware :-(
+    write(fd, "\n", 1);
+    close(fd);
     fprintf(stderr,"appending message to ~/dead.letter\n");
   }
-  else perror("cannot open ~/dead.letter");
+  else perror("cannot open ~/dead.letter for saving the current message");
 }
 
 

["auto-return-receipt-off.diff" (text/plain)]

--- kmsettings.cpp.org	Sun Feb 13 23:26:24 2000
+++ kmsettings.cpp	Sun Feb 13 23:26:28 2000
@@ -812,7 +812,7 @@
   emptyTrashOnExit->setChecked(config->readBoolEntry("empty-trash-on-exit",false));
   compactOnExit->setChecked(config->readNumEntry("compact-all-on-exit", 0));
   sendOnCheck->setChecked(config->readBoolEntry("sendOnCheck",false));
-  sendReceipts->setChecked(config->readBoolEntry("send-receipts", true));
+  sendReceipts->setChecked(config->readBoolEntry("send-receipts", false));
   useExternalEditor->setChecked(config->readBoolEntry("use-external-editor", false));  
   extEditorEdit->setText(config->readEntry("external-editor", ""));
   beepNotify->setChecked(config->readBoolEntry("beep-on-mail", false));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic