[Libreoffice-commits] core.git: 2 commits - fpicker/source
Tor Lillqvist
tml at iki.fi
Tue Jun 18 16:30:51 PDT 2013
fpicker/source/aqua/SalAquaFilePicker.mm | 9 +--------
fpicker/source/aqua/SalAquaPicker.mm | 28 +++++++++++-----------------
2 files changed, 12 insertions(+), 25 deletions(-)
New commits:
commit 55e74e06ffae30b9d01fa24fd1668d8816ee2500
Author: Tor Lillqvist <tml at iki.fi>
Date: Wed Jun 19 00:02:44 2013 +0300
Avoid deprecated API
Change-Id: I703e94b999382f52331a61050eaf3d31073f5a9c
diff --git a/fpicker/source/aqua/SalAquaPicker.mm b/fpicker/source/aqua/SalAquaPicker.mm
index b4a39d4..5b155fa 100644
--- a/fpicker/source/aqua/SalAquaPicker.mm
+++ b/fpicker/source/aqua/SalAquaPicker.mm
@@ -165,30 +165,27 @@ int SalAquaPicker::run()
int retVal = 0;
- NSString *startDirectory;
+ NSURL *startDirectory;
if (m_sDisplayDirectory.getLength() > 0) {
NSString *temp = [NSString stringWithOUString:m_sDisplayDirectory];
- NSURL *url = [NSURL URLWithString:temp];
- startDirectory = [url path];
+ startDirectory = [NSURL URLWithString:temp];
- OSL_TRACE("start dir: %s", [startDirectory UTF8String]);
- // NSLog(@"%@", startDirectory);
+ OSL_TRACE("start dir: %s", [startDirectory path]);
}
else {
- startDirectory = NSHomeDirectory();
+ startDirectory = [NSURL fileURLWithPath:NSHomeDirectory() isDirectory:YES];
}
-#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
-#pragma GCC diagnostic push
-#pragma GCC diagnostic warning "-Wdeprecated-declarations"
-#endif
switch(m_nDialogType) {
case NAVIGATIONSERVICES_DIRECTORY:
case NAVIGATIONSERVICES_OPEN:
- retVal = [(NSOpenPanel*)m_pDialog runModalForDirectory:startDirectory file:nil types:nil];
+ [m_pDialog setDirectoryURL:startDirectory];
+ retVal = [(NSOpenPanel*)m_pDialog runModal];
break;
case NAVIGATIONSERVICES_SAVE:
- retVal = [m_pDialog runModalForDirectory:startDirectory file:[NSString stringWithOUString:((SalAquaFilePicker*)this)->getSaveFileName()]/*[m_pDialog saveFilename]*/];
+ [m_pDialog setDirectoryURL:startDirectory];
+ [m_pDialog setNameFieldStringValue:[NSString stringWithOUString:((SalAquaFilePicker*)this)->getSaveFileName()]];
+ retVal = [m_pDialog runModal];
break;
// [m_pDialog beginSheetForDirectory:startDirectory file:[m_pDialog saveFilename] modalForWindow:[NSApp keyWindow] modalDelegate:((SalAquaFilePicker*)this)->getDelegate() didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:nil];
default:
@@ -196,14 +193,11 @@ int SalAquaPicker::run()
}
if (retVal == NSFileHandlingPanelOKButton) {
- NSString* pDir = [m_pDialog directory];
+ NSURL* pDir = [m_pDialog directoryURL];
if (pDir) {
- implsetDisplayDirectory([[NSURL fileURLWithPath:pDir] OUStringForInfo:FULLPATH]);
+ implsetDisplayDirectory([pDir OUStringForInfo:FULLPATH]);
}
}
-#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
-#pragma GCC diagnostic pop
-#endif
DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal);
[pool release];
commit 4286070ec53985a80d92cbba647c28133ce89158
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Jun 18 23:19:28 2013 +0300
Avoid deprecated API
Change-Id: I2537721bd6b0214c25590504751c39fb4661e2fe
diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm
index e64c422..b8241dc 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.mm
+++ b/fpicker/source/aqua/SalAquaFilePicker.mm
@@ -743,14 +743,7 @@ void SalAquaFilePicker::updateSaveFileNameExtension() {
rtl::OUString suffix = (*(aStringList.begin())).copy(1);
NSString *requiredFileType = [NSString stringWithOUString:suffix];
-#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
-#pragma GCC diagnostic push
-#pragma GCC diagnostic warning "-Wdeprecated-declarations"
-#endif
- [m_pDialog setRequiredFileType:requiredFileType];
-#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE
-#pragma GCC diagnostic pop
-#endif
+ [m_pDialog setAllowedFileTypes:[NSArray arrayWithObjects:requiredFileType, nil]];
OSL_TRACE("disallowing other file types");
[m_pDialog setAllowsOtherFileTypes:NO];
More information about the Libreoffice-commits
mailing list