summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mail2
authorleseb <leseb>2002-06-17 20:52:48 (UTC)
committer leseb <leseb>2002-06-17 20:52:48 (UTC)
commitb177eb4a659c674d1bc3ab82d6d980aade7c0959 (patch) (unidiff)
tree4ba2aee9db13423e37ae0a8051d80c010f815666 /noncore/unsupported/mail2
parent7ba6590093fb86fe4bf64839d3a517dd396853a3 (diff)
downloadopie-b177eb4a659c674d1bc3ab82d6d980aade7c0959.zip
opie-b177eb4a659c674d1bc3ab82d6d980aade7c0959.tar.gz
opie-b177eb4a659c674d1bc3ab82d6d980aade7c0959.tar.bz2
Fix some bugs when dealing with attachments
Diffstat (limited to 'noncore/unsupported/mail2') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/mail2/attachdiag.cpp23
-rw-r--r--noncore/unsupported/mail2/attachdiag.h9
-rw-r--r--noncore/unsupported/mail2/composer.cpp4
-rw-r--r--noncore/unsupported/mail2/libmail/mailfactory.cpp2
-rw-r--r--noncore/unsupported/mail2/libmail/mailfactory.h6
5 files changed, 20 insertions, 24 deletions
diff --git a/noncore/unsupported/mail2/attachdiag.cpp b/noncore/unsupported/mail2/attachdiag.cpp
index 36e1948..446cfe5 100644
--- a/noncore/unsupported/mail2/attachdiag.cpp
+++ b/noncore/unsupported/mail2/attachdiag.cpp
@@ -5,2 +5,3 @@
5 5
6#include <qpe/applnk.h>
6#include <qpe/fileselector.h> 7#include <qpe/fileselector.h>
@@ -21,7 +22,7 @@ AttachDiag::AttachDiag(QWidget* parent = 0, const char* name = 0, bool modal, WF
21 22
22 FileSelector *fileSelector = new FileSelector("*", this, "FileSelector"); 23 _fileSelector = new FileSelector("*", this, "FileSelector");
23 fileSelector->setCloseVisible(false); 24 _fileSelector->setCloseVisible(false);
24 fileSelector->setNewVisible(false); 25 _fileSelector->setNewVisible(false);
25 26
26 layout->addMultiCellWidget(fileSelector, 0, 0, 0, 1); 27 layout->addMultiCellWidget(_fileSelector, 0, 0, 0, 1);
27 28
@@ -39,3 +40,2 @@ AttachDiag::AttachDiag(QWidget* parent = 0, const char* name = 0, bool modal, WF
39 40
40 connect(fileSelector, SIGNAL(fileSelected(const DocLnk &)), SLOT(fileSelected(const DocLnk &)));
41 connect(attachButton, SIGNAL(clicked()), SLOT(accept())); 41 connect(attachButton, SIGNAL(clicked()), SLOT(accept()));
@@ -43,8 +43,5 @@ AttachDiag::AttachDiag(QWidget* parent = 0, const char* name = 0, bool modal, WF
43 43
44 if (fileSelector->selected() != NULL) 44 if (_fileSelector->fileCount() == 0) {
45 currentFile = *fileSelector->selected();
46
47 if (fileSelector->fileCount() == 0) {
48 attachButton->setEnabled(false); 45 attachButton->setEnabled(false);
49 fileSelector->setEnabled(false); 46 _fileSelector->setEnabled(false);
50 } 47 }
@@ -52,5 +49,5 @@ AttachDiag::AttachDiag(QWidget* parent = 0, const char* name = 0, bool modal, WF
52 49
53void AttachDiag::fileSelected(const DocLnk &file) 50DocLnk AttachDiag::selectedFile()
54{ 51{
55 currentFile = file; 52 return *_fileSelector->selected();
56} 53}
@@ -64,3 +61,3 @@ DocLnk AttachDiag::getFile(QWidget *parent)
64 if (QDialog::Accepted == attach.exec()) { 61 if (QDialog::Accepted == attach.exec()) {
65 return attach.currentFile; 62 return attach.selectedFile();
66 } 63 }
diff --git a/noncore/unsupported/mail2/attachdiag.h b/noncore/unsupported/mail2/attachdiag.h
index bce5b4b..88686bc 100644
--- a/noncore/unsupported/mail2/attachdiag.h
+++ b/noncore/unsupported/mail2/attachdiag.h
@@ -5,3 +5,4 @@
5 5
6#include <qpe/applnk.h> 6class DocLnk;
7class FileSelector;
7 8
@@ -12,2 +13,3 @@ class AttachDiag : public QDialog
12public: 13public:
14 DocLnk selectedFile();
13 static DocLnk getFile(QWidget *parent); 15 static DocLnk getFile(QWidget *parent);
@@ -17,7 +19,4 @@ protected:
17 19
18private slots:
19 void fileSelected(const DocLnk &);
20
21private: 20private:
22 DocLnk currentFile; 21 FileSelector *_fileSelector;
23 22
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp
index 7f65dba..c36d973 100644
--- a/noncore/unsupported/mail2/composer.cpp
+++ b/noncore/unsupported/mail2/composer.cpp
@@ -22,3 +22,3 @@ AttachViewItem::AttachViewItem(QListView *parent, Attachment &attachment)
22{ 22{
23 setPixmap(0, _attachment.docLnk()->pixmap().isNull() ? Resource::loadPixmap("UnknownDocument-14") : _attachment.docLnk()->pixmap()); 23 setPixmap(0, _attachment.docLnk().pixmap().isNull() ? Resource::loadPixmap("UnknownDocument-14") : _attachment.docLnk().pixmap());
24 setText(0, _attachment.newName().isEmpty() ? _attachment.fileName() : _attachment.newName()); 24 setText(0, _attachment.newName().isEmpty() ? _attachment.fileName() : _attachment.newName());
@@ -233,3 +233,3 @@ void Composer::slotAddAttach()
233 attachment.setNewName(lnk.name()); 233 attachment.setNewName(lnk.name());
234 attachment.setDocLnk(&lnk); 234 attachment.setDocLnk(lnk);
235 235
diff --git a/noncore/unsupported/mail2/libmail/mailfactory.cpp b/noncore/unsupported/mail2/libmail/mailfactory.cpp
index 6602919..e02f80f 100644
--- a/noncore/unsupported/mail2/libmail/mailfactory.cpp
+++ b/noncore/unsupported/mail2/libmail/mailfactory.cpp
@@ -88,3 +88,3 @@ MailFactory::MailFactory(SendMail &smail, QWidget *parent)
88 f.close(); 88 f.close();
89 QString mimetype = (new MimeType(*(*it).docLnk()))->id(); 89 QString mimetype = (new MimeType((*it).docLnk()))->id();
90 90
diff --git a/noncore/unsupported/mail2/libmail/mailfactory.h b/noncore/unsupported/mail2/libmail/mailfactory.h
index 8f67447..c938c27 100644
--- a/noncore/unsupported/mail2/libmail/mailfactory.h
+++ b/noncore/unsupported/mail2/libmail/mailfactory.h
@@ -15,3 +15,3 @@ public:
15 void setDescription(QString description) { _description = description; } 15 void setDescription(QString description) { _description = description; }
16 void setDocLnk(DocLnk *docLnk) { _docLnk = docLnk; } 16 void setDocLnk(DocLnk docLnk) { _docLnk = docLnk; }
17 17
@@ -20,3 +20,3 @@ public:
20 QString description() { return _description; } 20 QString description() { return _description; }
21 DocLnk *docLnk() { return _docLnk; } 21 DocLnk docLnk() { return _docLnk; }
22 22
@@ -24,3 +24,3 @@ protected:
24 QString _fileName, _newName, _description; 24 QString _fileName, _newName, _description;
25 DocLnk *_docLnk; 25 DocLnk _docLnk;
26 26