summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaprintdevice.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaprintdevice.mm12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaprintdevice.mm b/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
index 2101b68769..c26a2b22fd 100644
--- a/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
+++ b/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
@@ -466,17 +466,13 @@ bool QCocoaPrintDevice::openPpdFile()
ppdClose(m_ppd);
m_ppd = 0;
CFURLRef ppdURL = NULL;
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
- char ppdPath[PATH_MAX];
-#else
char ppdPath[MAXPATHLEN];
-#endif
if (PMPrinterCopyDescriptionURL(m_printer, kPMPPDDescriptionType, &ppdURL) == noErr
- && ppdURL != NULL
- && CFURLGetFileSystemRepresentation(ppdURL, true, (UInt8*)ppdPath, sizeof(ppdPath))) {
- m_ppd = ppdOpenFile(ppdPath);
+ && ppdURL != NULL) {
+ if (CFURLGetFileSystemRepresentation(ppdURL, true, (UInt8*)ppdPath, sizeof(ppdPath)))
+ m_ppd = ppdOpenFile(ppdPath);
+ CFRelease(ppdURL);
}
- CFRelease(ppdURL);
return m_ppd ? true : false;
}