Report status codes in warnings about API failures
Also reuse the status variable, since the value saved in the one previously declared int was an OSStatus, too. Change-Id: I8e8fe308ae71df51e8057d89bc76cab0c6bbedb2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
a769ab62cb
commit
cdd3bd1d2c
@ -65,9 +65,10 @@ void QCollatorPrivate::init()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
LocaleRef localeRef;
|
LocaleRef localeRef;
|
||||||
int rc = LocaleRefFromLocaleString(QLocalePrivate::get(locale)->bcp47Name().constData(), &localeRef);
|
OSStatus status =
|
||||||
if (rc != 0)
|
LocaleRefFromLocaleString(QLocalePrivate::get(locale)->bcp47Name().constData(), &localeRef);
|
||||||
qWarning("couldn't initialize the locale");
|
if (status != 0)
|
||||||
|
qWarning("Couldn't initialize the locale (%d)", int(status));
|
||||||
|
|
||||||
UInt32 options = 0;
|
UInt32 options = 0;
|
||||||
|
|
||||||
@ -78,14 +79,9 @@ void QCollatorPrivate::init()
|
|||||||
if (!ignorePunctuation)
|
if (!ignorePunctuation)
|
||||||
options |= kUCCollatePunctuationSignificantMask;
|
options |= kUCCollatePunctuationSignificantMask;
|
||||||
|
|
||||||
OSStatus status = UCCreateCollator(
|
status = UCCreateCollator(localeRef, 0, options, &collator);
|
||||||
localeRef,
|
|
||||||
0,
|
|
||||||
options,
|
|
||||||
&collator
|
|
||||||
);
|
|
||||||
if (status != 0)
|
if (status != 0)
|
||||||
qWarning("Couldn't initialize the collator");
|
qWarning("Couldn't initialize the collator (%d)", int(status));
|
||||||
|
|
||||||
dirty = false;
|
dirty = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user