summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mail2/attachdiag.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/mail2/attachdiag.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/mail2/attachdiag.cpp23
1 files changed, 10 insertions, 13 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
@@ -4,4 +4,5 @@
#include <qlayout.h>
+#include <qpe/applnk.h>
#include <qpe/fileselector.h>
#include <qpe/resource.h>
@@ -20,9 +21,9 @@ AttachDiag::AttachDiag(QWidget* parent = 0, const char* name = 0, bool modal, WF
layout->setMargin(4);
- FileSelector *fileSelector = new FileSelector("*", this, "FileSelector");
- fileSelector->setCloseVisible(false);
- fileSelector->setNewVisible(false);
+ _fileSelector = new FileSelector("*", this, "FileSelector");
+ _fileSelector->setCloseVisible(false);
+ _fileSelector->setNewVisible(false);
- layout->addMultiCellWidget(fileSelector, 0, 0, 0, 1);
+ layout->addMultiCellWidget(_fileSelector, 0, 0, 0, 1);
QPushButton *attachButton = new QPushButton(this);
@@ -38,20 +39,16 @@ AttachDiag::AttachDiag(QWidget* parent = 0, const char* name = 0, bool modal, WF
layout->addWidget(cancelButton, 1, 1);
- connect(fileSelector, SIGNAL(fileSelected(const DocLnk &)), SLOT(fileSelected(const DocLnk &)));
connect(attachButton, SIGNAL(clicked()), SLOT(accept()));
connect(cancelButton, SIGNAL(clicked()), SLOT(close()));
- if (fileSelector->selected() != NULL)
- currentFile = *fileSelector->selected();
-
- if (fileSelector->fileCount() == 0) {
+ if (_fileSelector->fileCount() == 0) {
attachButton->setEnabled(false);
- fileSelector->setEnabled(false);
+ _fileSelector->setEnabled(false);
}
}
-void AttachDiag::fileSelected(const DocLnk &file)
+DocLnk AttachDiag::selectedFile()
{
- currentFile = file;
+ return *_fileSelector->selected();
}
@@ -63,5 +60,5 @@ DocLnk AttachDiag::getFile(QWidget *parent)
if (QDialog::Accepted == attach.exec()) {
- return attach.currentFile;
+ return attach.selectedFile();
}