summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/fileselector/ofiledialog.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/libopie2/opieui/fileselector/ofiledialog.cpp b/libopie2/opieui/fileselector/ofiledialog.cpp
index 4c6b800..e01fbe5 100644
--- a/libopie2/opieui/fileselector/ofiledialog.cpp
+++ b/libopie2/opieui/fileselector/ofiledialog.cpp
@@ -159,93 +159,91 @@ DocLnk OFileDialog::selectedDocument()const
*/
QString OFileDialog::getOpenFileName(int selector,
const QString &_startDir,
const QString &file,
const MimeTypes &mimes,
QWidget *wid,
const QString &caption )
{
QString ret;
QString startDir = _startDir;
if (startDir.isEmpty() )
startDir = lastUsedDir( "FileDialog-OPEN" );
OFileDialog dlg( caption.isEmpty() ? tr("Open") : caption,
wid, OFileSelector::Open, selector, startDir, file, mimes);
- dlg.showMaximized();
- if( dlg.exec() )
+ if( QPEApplication::execDialog(&dlg ) )
{
ret = dlg.fileName();
saveLastDir( "FileDialog-OPEN", ret );
}
return ret;
}
/**
* This opens up a file dialog in save mode
* @see getOpenFileName
*/
QString OFileDialog::getSaveFileName(int selector,
const QString &_startDir,
const QString &file,
const MimeTypes &mimes,
QWidget *wid,
const QString &caption )
{
QString ret;
QString startDir = _startDir;
if (startDir.isEmpty() )
startDir = lastUsedDir( "FileDialog-SAVE" );
OFileDialog dlg( caption.isEmpty() ? tr("Save") : caption,
wid, OFileSelector::Save, selector, startDir, file, mimes);
- dlg.showMaximized();
- if( dlg.exec() )
+ if( QPEApplication::execDialog(&dlg) )
{
ret = dlg.fileName();
saveLastDir( "FileDialog-SAVE", ret );
}
return ret;
}
/**
* This opens up a filedialog in select directory mode
*
* @param selector the Selector Mode
* @param startDir Where to start from
* @param wid the parent
* @param caption of the dialog if QString::null tr("Open") will be used
* @return the directoryName or QString::null
*/
QString OFileDialog::getDirectory(int selector,
const QString &_startDir,
QWidget *wid,
const QString &caption )
{
QString ret;
QString startDir = _startDir;
if ( startDir.isEmpty() )
startDir = lastUsedDir( "FileDialog-SELECTDIR" );
OFileDialog dlg( caption.isEmpty() ? tr( "Select Directory" ) : caption,
wid, OFileSelector::DirectorySelector, selector, startDir );
- dlg.showMaximized();
- if ( dlg.exec() )
+
+ if ( QPEApplication::execDialog(&dlg) )
{
ret = dlg.fileName();
saveLastDir( "FileDialog-SELECTDIR", ret );
}
return ret;
}
void OFileDialog::slotFileSelected(const QString & )
{
accept();
}
void OFileDialog::slotSelectorOk( )
{
accept();
}