summaryrefslogtreecommitdiff
path: root/libopie/ofileselector.cpp
Side-by-side diff
Diffstat (limited to 'libopie/ofileselector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/libopie/ofileselector.cpp b/libopie/ofileselector.cpp
index 9ac2981..1ba94ae 100644
--- a/libopie/ofileselector.cpp
+++ b/libopie/ofileselector.cpp
@@ -1,140 +1,135 @@
#include <qcombobox.h>
#include <qdir.h>
-#include <qhbox.h>
-#include <qheader.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
-#include <qlistview.h>
#include <qpopupmenu.h>
#include <qwidgetstack.h>
-#include <qregexp.h>
-#include <qobjectlist.h>
/* hacky but we need to get FileSelector::filter */
#define private public
#include <qpe/fileselector.h>
#undef private
#include <qpe/qpeapplication.h>
#include <qpe/mimetype.h>
#include <qpe/resource.h>
#include <qpe/storage.h>
#include "ofileselector_p.h"
#include "ofileselector.h"
OFileViewInterface::OFileViewInterface( OFileSelector* selector )
: m_selector( selector ) {
}
OFileViewInterface::~OFileViewInterface() {
}
QString OFileViewInterface::name()const{
return m_name;
}
void OFileViewInterface::setName( const QString& name ) {
m_name = name;
}
OFileSelector* OFileViewInterface::selector()const {
return m_selector;
}
DocLnk OFileViewInterface::selectedDocument()const {
return DocLnk( selectedName() );
}
bool OFileViewInterface::showNew()const {
return selector()->showNew();
}
bool OFileViewInterface::showClose()const {
return selector()->showClose();
}
MimeTypes OFileViewInterface::mimeTypes()const {
return selector()->mimeTypes();
}
QStringList OFileViewInterface::currentMimeType()const {
return selector()->currentMimeType();
}
void OFileViewInterface::activate( const QString& ) {
// not implemented here
}
void OFileViewInterface::ok() {
emit selector()->ok();
}
void OFileViewInterface::cancel() {
emit selector()->cancel();
}
void OFileViewInterface::closeMe() {
emit selector()->closeMe();
}
void OFileViewInterface::fileSelected( const QString& str) {
emit selector()->fileSelected( str);
}
void OFileViewInterface::fileSelected( const DocLnk& lnk) {
emit selector()->fileSelected( lnk );
}
void OFileViewInterface::setCurrentFileName( const QString& str ) {
selector()->m_lneEdit->setText( str );
}
QString OFileViewInterface::currentFileName()const{
return selector()->m_lneEdit->text();
}
QString OFileViewInterface::startDirectory()const{
return selector()->m_startDir;
}
ODocumentFileView::ODocumentFileView( OFileSelector* selector )
: OFileViewInterface( selector ) {
m_selector = 0;
setName( QObject::tr("Documents") );
}
ODocumentFileView::~ODocumentFileView() {
}
QString ODocumentFileView::selectedName()const {
if (!m_selector)
return QString::null;
return m_selector->selectedDocument().file();
}
QString ODocumentFileView::selectedPath()const {
return QPEApplication::documentDir();
}
QString ODocumentFileView::directory()const {
return selectedPath();
}
void ODocumentFileView::reread() {
if (!m_selector)
return;
m_selector->setNewVisible( showNew() );
m_selector->setCloseVisible( showClose() );
m_selector->filter = currentMimeType().join(";");
m_selector->reread();
}
int ODocumentFileView::fileCount()const {
if (!m_selector)
return -1;
return m_selector->fileCount();
}
DocLnk ODocumentFileView::selectedDocument()const {
if (!m_selector)
return DocLnk();
return m_selector->selectedDocument();
}
QWidget* ODocumentFileView::widget( QWidget* parent ) {
if (!m_selector ) {
m_selector = new FileSelector(currentMimeType().join(";"), parent, "fileselector", showNew(), showClose() );
QObject::connect(m_selector, SIGNAL(fileSelected( const DocLnk& ) ),
selector(), SLOT(slotDocLnkBridge(const DocLnk&) ) );
QObject::connect(m_selector, SIGNAL(closeMe() ),
selector(), SIGNAL(closeMe() ) );
QObject::connect(m_selector, SIGNAL(newSelected(const DocLnk& ) ),
selector(), SIGNAL(newSelected(const DocLnk& ) ) );
}
return m_selector;
}