diff --git a/ChangeLog b/ChangeLog index be928a968..62b5c4ad0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 1998-06-12 Stefan Taferner + * Folder loading: moved status message in index + creation to a more suitable place. Should be lots + faster now. + + * Composer: Now path of last filedialog for attachments + is stored. + * Fonts: improved font settings. The HTML widget unfortunately only honors the font family. Added new functions (kfontutils.h) for easy font to/from string diff --git a/kmcomposewin.cpp b/kmcomposewin.cpp index 4ec0ff55f..9900aa462 100644 --- a/kmcomposewin.cpp +++ b/kmcomposewin.cpp @@ -112,6 +112,7 @@ KMComposeWin::KMComposeWin(KMMessage *aMsg) : KMComposeWinInherited(), mAtmListBox = NULL; mAtmList.setAutoDelete(TRUE); mAutoDeleteMsg = FALSE; + mPathAttach = 0; setCaption(i18n("KMail Composer")); setMinimumSize(200,200); @@ -1152,17 +1153,21 @@ void KMComposeWin::slotAttachFile() // We will not care about any permissions, existence or whatsoever in // this function. QString fileName; - QString path = QDir::currentDirPath(); + + if (mPathAttach.isEmpty()) mPathAttach = QDir::currentDirPath(); - KFileDialog fdlg(path.data(),"*",this,NULL,TRUE); + KFileDialog fdlg(mPathAttach, "*", this, NULL, TRUE); fdlg.setCaption(i18n("Attach File")); if (!fdlg.exec()) return; - fileName = fdlg.selectedFile(); + mPathAttach = fdlg.dirPath().copy(); + + fileName = fdlg.selectedFile(); if(fileName.isEmpty()) return; addAttach(fileName); + mEditor->toggleModified(TRUE); } @@ -1171,12 +1176,15 @@ void KMComposeWin::slotInsertFile() { QString fileName, str; int col, line; - QString path = QDir::currentDirPath(); - KFileDialog fdlg(path.data(), "*", this, NULL, TRUE); + if (mPathAttach.isEmpty()) mPathAttach = QDir::currentDirPath(); + + KFileDialog fdlg(mPathAttach, "*", this, NULL, TRUE); fdlg.setCaption(i18n("Include File")); if (!fdlg.exec()) return; + mPathAttach = fdlg.dirPath().copy(); + fileName = fdlg.selectedFile(); if (fileName.isEmpty()) return; @@ -1257,7 +1265,6 @@ void KMComposeWin::slotAttachSave() { KMMessagePart* msgPart; QString fileName, pname; - QString path = QDir::currentDirPath(); int idx = mAtmListBox->currentItem(); if (idx < 0) return; @@ -1266,8 +1273,11 @@ void KMComposeWin::slotAttachSave() pname = msgPart->name(); if (pname.isEmpty()) pname="unnamed"; - fileName = KFileDialog::getSaveFileName(path.data(), "*", NULL, pname); + if (mPathAttach.isEmpty()) mPathAttach = QDir::currentDirPath(); + + fileName = KFileDialog::getSaveFileName(mPathAttach, "*", NULL, pname); if (fileName.isEmpty()) return; + kStringToFile(msgPart->bodyDecoded(), fileName, TRUE); } @@ -1276,7 +1286,11 @@ void KMComposeWin::slotAttachSave() void KMComposeWin::slotAttachRemove() { int idx = mAtmListBox->currentItem(); - if (idx >= 0) removeAttach(idx); + if (idx >= 0) + { + removeAttach(idx); + mEditor->toggleModified(TRUE); + } } diff --git a/kmcomposewin.h b/kmcomposewin.h index 1c35b6e95..db599ebea 100644 --- a/kmcomposewin.h +++ b/kmcomposewin.h @@ -297,6 +297,7 @@ protected: short mMnuIdUrgent, mMnuIdConfDeliver, mMnuIdConfRead; QString mForeColor, mBackColor, mBodyFont; QList mEdtList; + QString mPathAttach; #ifdef HAS_KSPELL KSpell* mKSpell; KSpellConfig* mKSpellConfig; @@ -309,7 +310,6 @@ protected: QString mComposeCharset; int mQuoteUnknownCharacters; QFont mSavedEditorFont; - QString mPathAttach; #endif private: diff --git a/kmfolder.cpp b/kmfolder.cpp index 3619b6c5a..7eda8c0d9 100644 --- a/kmfolder.cpp +++ b/kmfolder.cpp @@ -347,13 +347,6 @@ int KMFolder::createIndexFromContents(void) while (!atEof) { - if ((num & 127) == 0) - { - msgStr.sprintf(i18n("Creating index file: %d messages done"), - num); - emit statusMsg(msgStr); - } - pos = ftell(mStream); if (!fgets(line, MAX_LINE, mStream)) atEof = TRUE; @@ -366,6 +359,12 @@ int KMFolder::createIndexFromContents(void) if (num >= 0) { + if ((num & 127) == 0) + { + msgStr.sprintf(i18n("Creating index file: %d messages done"), num); + emit statusMsg(msgStr); + } + if (size > 0) { mi = new KMMsgInfo(this); @@ -833,7 +832,7 @@ int KMFolder::compact(void) tempName += ".compacted"; unlink(tempName); tempFolder = parent()->createFolder(tempName); - assert(tempFolder != ""); + assert(tempFolder!=NULL); quiet(TRUE); tempFolder->open();