* 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.

svn path=/trunk/kdenetwork/kmail/; revision=8178
wilder-work
Stefan Taferner 28 years ago
parent 8e232948cb
commit e123f8e67c
  1. 7
      ChangeLog
  2. 30
      kmcomposewin.cpp
  3. 2
      kmcomposewin.h
  4. 15
      kmfolder.cpp

@ -1,5 +1,12 @@
1998-06-12 Stefan Taferner <taferner@kde.org>
* 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

@ -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);
}
}

@ -297,6 +297,7 @@ protected:
short mMnuIdUrgent, mMnuIdConfDeliver, mMnuIdConfRead;
QString mForeColor, mBackColor, mBodyFont;
QList<QLineEdit> 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:

@ -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();

Loading…
Cancel
Save