fixed path issue on mac

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent 593e21d37c
commit 972cc3e721
  1. 5
      src/frameworks/UBPlatformUtils_mac.mm

@ -185,6 +185,7 @@ void UBPlatformUtils::fadeDisplayIn()
QString UBPlatformUtils::preferredTranslation(QString pFilePrefix)
{
QString qmPath;
NSString* filePrefix = [[NSString alloc] initWithUTF8String:(const char*)(pFilePrefix.toUtf8())];
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@ -192,7 +193,7 @@ QString UBPlatformUtils::preferredTranslation(QString pFilePrefix)
if (lprojPath)
{
NSString *lang = [[lprojPath lastPathComponent] stringByDeletingPathExtension];
NSString *translationFilePath = [lprojPath stringByAppendingPathComponent:[[@"sankore_" stringByAppendingString:lang] stringByAppendingPathExtension:@"qm"]];
NSString *translationFilePath = [lprojPath stringByAppendingPathComponent:[[filePrefix stringByAppendingString:lang] stringByAppendingPathExtension:@"qm"]];
qmPath = QString::fromUtf8([translationFilePath UTF8String], strlen([translationFilePath UTF8String]));
}
@ -202,7 +203,7 @@ QString UBPlatformUtils::preferredTranslation(QString pFilePrefix)
QString UBPlatformUtils::preferredLanguage()
{
QFileInfo qmFileInfo = QFileInfo(applicationPreferredTranslation());
QFileInfo qmFileInfo = QFileInfo(preferredTranslation("sankore_"));
QDir lprojPath = qmFileInfo.dir();
QFileInfo lprojFileInfo = QFileInfo(lprojPath.absolutePath());
return lprojFileInfo.baseName();

Loading…
Cancel
Save