summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2018-12-11 18:01:35 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2019-03-08 17:07:47 +0000
commitcdd3bd1d2cb3f5c23159a987c19b6919f08d68b7 (patch)
treeaaf97f2773ae01f363333dd0a0fe7707587f9bc2 /src
parenta769ab62cbcf957d049c8da74f898527dd27b328 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qcollator_macx.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/corelib/tools/qcollator_macx.cpp b/src/corelib/tools/qcollator_macx.cpp
index 9998ec4cda..ff127a041d 100644
--- a/src/corelib/tools/qcollator_macx.cpp
+++ b/src/corelib/tools/qcollator_macx.cpp
@@ -65,9 +65,10 @@ void QCollatorPrivate::init()
return;
LocaleRef localeRef;
- int rc = LocaleRefFromLocaleString(QLocalePrivate::get(locale)->bcp47Name().constData(), &localeRef);
- if (rc != 0)
- qWarning("couldn't initialize the locale");
+ OSStatus status =
+ LocaleRefFromLocaleString(QLocalePrivate::get(locale)->bcp47Name().constData(), &localeRef);
+ if (status != 0)
+ qWarning("Couldn't initialize the locale (%d)", int(status));
UInt32 options = 0;
@@ -78,14 +79,9 @@ void QCollatorPrivate::init()
if (!ignorePunctuation)
options |= kUCCollatePunctuationSignificantMask;
- OSStatus status = UCCreateCollator(
- localeRef,
- 0,
- options,
- &collator
- );
+ status = UCCreateCollator(localeRef, 0, options, &collator);
if (status != 0)
- qWarning("Couldn't initialize the collator");
+ qWarning("Couldn't initialize the collator (%d)", int(status));
dirty = false;
}