summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2012-12-08 01:55:11 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-14 19:52:06 +0100
commitd75d86190bca85841db2040d50184f4c6886ef89 (patch)
tree359500f32702af8ccfb77b9d0b99b56c3798f8f0 /src/plugins
parent0c3cfdba45f5e3db430b41649750dc767c93b888 (diff)
Ensure the native filedialog starts up with the right directory
On Mac it was not starting the dialog with the specified directory when one was present. If a filename was given as well then it would start up fine. Task-number: QTBUG-28161 Change-Id: I7cce0d065dd57e6433ce62380d4263d6e20b6e7c Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index f9122f56d1..5747cc01e9 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -223,7 +223,7 @@ static QString strippedText(QString s)
- (void)showModelessPanel
{
if (mOpenPanel){
- QFileInfo info(*mCurrentSelection);
+ QFileInfo info(!mCurrentSelection->isEmpty() ? *mCurrentSelection : QT_PREPEND_NAMESPACE(QCFString::toQString)(mCurrentDir));
NSString *filepath = QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath());
bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave)
|| [self panel:nil shouldShowFilename:filepath];
@@ -241,7 +241,7 @@ static QString strippedText(QString s)
- (BOOL)runApplicationModalPanel
{
- QFileInfo info(*mCurrentSelection);
+ QFileInfo info(!mCurrentSelection->isEmpty() ? *mCurrentSelection : QT_PREPEND_NAMESPACE(QCFString::toQString)(mCurrentDir));
NSString *filepath = QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath());
bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave)
|| [self panel:nil shouldShowFilename:filepath];
@@ -266,7 +266,7 @@ static QString strippedText(QString s)
- (void)showWindowModalSheet:(QWindow *)parent
{
- QFileInfo info(*mCurrentSelection);
+ QFileInfo info(!mCurrentSelection->isEmpty() ? *mCurrentSelection : QT_PREPEND_NAMESPACE(QCFString::toQString)(mCurrentDir));
NSString *filepath = QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath());
bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave)
|| [self panel:nil shouldShowFilename:filepath];