summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeemu Katajisto <teemu.katajisto@digia.com>2012-10-03 13:17:12 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-04 13:31:55 +0200
commit924aeb278730f3435400da21f52686dd2f93b0c6 (patch)
treef1b54da6a40c5ec96dc38bed72a92961ef8d6f57 /src
parent92c756677f264d76a385f3f21b6b96acd1ba599f (diff)
Cocoa: fix regressions in cocoa filedialog helper
mOpenPanel is set to 0 if save file dialog is used so call mSavePanel instead. Fixes regression introduced in 2e902799df6298ad4c75b4c565a0baf9cb7f7ab8 Change-Id: Idb93e44437731cad3c985d51b57b793a3ff2f292 Reviewed-by: Pasi Matilainen <pasi.matilainen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 48be019659..682ef48cda 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -246,9 +246,9 @@ static QString strippedText(QString s)
bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave)
|| [self panel:nil shouldShowFilename:filepath];
- [mOpenPanel setDirectoryURL:selectable ? [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath())]
+ [mSavePanel setDirectoryURL:selectable ? [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath())]
: [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.path())]];
- mReturnCode = [mOpenPanel runModal];
+ mReturnCode = [mSavePanel runModal];
QAbstractEventDispatcher::instance()->interrupt();
return (mReturnCode == NSOKButton);
@@ -266,7 +266,7 @@ static QString strippedText(QString s)
bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave)
|| [self panel:nil shouldShowFilename:filepath];
- [mOpenPanel setDirectoryURL:selectable ? [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath())]
+ [mSavePanel setDirectoryURL:selectable ? [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath())]
: [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.path())]];
NSWindow *nsparent = static_cast<NSWindow *>(qGuiApp->platformNativeInterface()->nativeResourceForWindow("nswindow", parent));
@@ -403,9 +403,9 @@ static QString strippedText(QString s)
ext.prepend(defaultSuffix);
[mSavePanel setAllowedFileTypes:ext.isEmpty() ? nil : QT_PREPEND_NAMESPACE(qt_mac_QStringListToNSMutableArray(ext))];
- if ([mOpenPanel respondsToSelector:@selector(isVisible)] && [mSavePanel isVisible]) {
- if ([mOpenPanel respondsToSelector:@selector(validateVisibleColumns)])
- [mOpenPanel validateVisibleColumns];
+ if ([mSavePanel respondsToSelector:@selector(isVisible)] && [mSavePanel isVisible]) {
+ if ([mSavePanel respondsToSelector:@selector(validateVisibleColumns)])
+ [mSavePanel validateVisibleColumns];
}
}