From 9d95da801dcd80459c495b192ee09b35aa750c9f Mon Sep 17 00:00:00 2001 From: Stefan Taferner Date: Sat, 14 Feb 1998 10:44:31 +0000 Subject: [PATCH] Removed obsolete files, added ChangeLog, fixed problem in kfileio, composer, and startup code svn path=/trunk/kdenetwork/kmail/; revision=5275 --- BUGS | 17 ----------------- ChangeLog | 10 ++++++++++ INSTALL | 10 ---------- kfileio.cpp | 3 ++- kmcomposewin.cpp | 32 +++++++++----------------------- main.cpp | 2 +- 6 files changed, 22 insertions(+), 52 deletions(-) delete mode 100644 BUGS create mode 100644 ChangeLog delete mode 100644 INSTALL diff --git a/BUGS b/BUGS deleted file mode 100644 index e710e3ff3..000000000 --- a/BUGS +++ /dev/null @@ -1,17 +0,0 @@ -- KMComposer cannot set the subject. Seems to be a problem in kmmessage.cpp - cause KMMessage::setSubject(const char *aStr) gets the subject string - without any problem but does use it correctly. -- Pop does not append downloaded msgs to according folder -- Set your pop passwd manually in kmacctpop.cpp -- Config stuff missing. Copy this kmailrc to your ~/.kde/config/ -- Saving of octet-streams does not work ( something goes wrong decoding) -- mimemagic stuff does not look at the extension yet only scans file content. - Result is that some files are not recognized correctly -- Attaching bodyParts is not yet possible. Something must be wrong with - addBodyPart() or I am just too stupid. -- In first KMail start: - Configure (Settings) goes fine until I set the POP3 account. After - pressing OK I get a window with: - QGArray::at: Absolute index 0 out of range - And KMail crashes with seg. fault. -- Add selectable character encodings (ISO-8859-x, ... diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 000000000..d254ffd99 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,10 @@ +Sat Feb 14 10:03:09 1998 Stefan Taferner + + * Startup: when recovering dead letters the auto signature was + appended twice. Fixed now. + + * Composer: fixed broken inserting of files. + + * kFileToString(): fixed handling of files with zero length. + +Initial version: 0.5.7 diff --git a/INSTALL b/INSTALL deleted file mode 100644 index d0e2f5a2e..000000000 --- a/INSTALL +++ /dev/null @@ -1,10 +0,0 @@ -make -f Makefile.cvs -./configure -make - -copy the approriate pics to either $KDEDIR/lib/pics or -$KDEDIR/lib/pics/toolbar - -You need to have IconPath set correctly in your .kderc -[KDE Setup] -IconPath=/usr/local/kde/lib/pics:/usr/local/kde/lib/pics/toolbar diff --git a/kfileio.cpp b/kfileio.cpp index 1e81fc617..dd3b13d87 100644 --- a/kfileio.cpp +++ b/kfileio.cpp @@ -60,6 +60,7 @@ QString kFileToString(const char* aFileName, bool aEnsureNL, bool aVerbose) "to the file:\n%s"), aFileName); return 0; } + if (len <= 0) return 0; if (!file.open(IO_Raw|IO_ReadOnly)) { @@ -77,7 +78,7 @@ QString kFileToString(const char* aFileName, bool aEnsureNL, bool aVerbose) return 0; } - result.resize(len+1 + (int)aEnsureNL); + result.resize(len + (int)aEnsureNL); readLen = file.readBlock(result.data(), len); if (aEnsureNL && result[len-1]!='\n') { diff --git a/kmcomposewin.cpp b/kmcomposewin.cpp index 67a80f2c7..fe0af5c26 100644 --- a/kmcomposewin.cpp +++ b/kmcomposewin.cpp @@ -1040,35 +1040,21 @@ void KMComposeWin::slotAttachFile() //----------------------------------------------------------------------------- void KMComposeWin::slotInsertFile() { - // Create File Dialog and return selected file - - QString fileName; - QString strCopy; - char temp[256]; + QString fileName, str; int col, line; - QFileDialog fdlg(".","*",this,NULL,TRUE); - fdlg.setCaption(i18n("Attach File")); + QFileDialog fdlg(".", "*", this, NULL, TRUE); + fdlg.setCaption(i18n("Include File")); if (!fdlg.exec()) return; - fileName = fdlg.selectedFile(); - if(fileName.isEmpty()) return; - - cout << fileName << endl; - QFile *f = new QFile(fileName); - - if(!f->open(IO_ReadOnly)) - return; + fileName = fdlg.selectedFile(); + if (fileName.isEmpty()) return; - f->at(0); - while(!f->atEnd()) { - f->readLine(temp,255); - strCopy.append(temp); - } + str = kFileToString(fileName, TRUE, TRUE); + if (str.isEmpty()) return; - mEditor->getCursorPosition(&line,&col); - mEditor->insertAt(strCopy, line ,col); - f->close(); + mEditor->getCursorPosition(&line, &col); + mEditor->insertAt(str, line, col); } diff --git a/main.cpp b/main.cpp index de2973f37..63373f674 100644 --- a/main.cpp +++ b/main.cpp @@ -192,7 +192,7 @@ static void recoverDeadLetters(void) if (msg) { win = new KMComposeWin; - win->setMsg(msg); + win->setMsg(msg, FALSE); win->show(); } }