From ce4a32fe52ef09d8f5ff1dd22c001110902b60a2 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kio/kfile/tests/kfdtest.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 kio/kfile/tests/kfdtest.cpp (limited to 'kio/kfile/tests/kfdtest.cpp') diff --git a/kio/kfile/tests/kfdtest.cpp b/kio/kfile/tests/kfdtest.cpp new file mode 100644 index 000000000..d9341a7ae --- /dev/null +++ b/kio/kfile/tests/kfdtest.cpp @@ -0,0 +1,34 @@ +#include "kfdtest.h" + +#include +#include +#include +#include +#include + +KFDTest::KFDTest( const QString& startDir, QObject *parent, const char *name ) + : QObject( parent, name ), + m_startDir( startDir ) +{ + QTimer::singleShot( 1000, this, SLOT( doit() )); +} + +void KFDTest::doit() +{ + KFileDialog *dlg = new KFileDialog( m_startDir, QString::null, 0L, + "file dialog", true ); + dlg->setMode( KFile::File); + dlg->setOperationMode( KFileDialog::Saving ); + QStringList filter; + filter << "all/allfiles" << "text/plain"; + dlg->setMimeFilter( filter, "all/allfiles" ); + + if ( dlg->exec() == KDialog::Accepted ) + { + KMessageBox::information(0, QString::fromLatin1("You selected the file: %1").arg( dlg->selectedURL().prettyURL() )); + } + +// qApp->quit(); +} + +#include "kfdtest.moc" -- cgit v1.2.3