summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-04-13 14:45:11 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-04-18 04:49:19 +0000
commitf083830b8de106ed51d39242008215e9ea2179b2 (patch)
treeee0be5ed145cacd93cdda159e31ea47ebbebede9 /src/corelib/io
parent777d46b40360c302a49fc5b789cee6d0d05f840a (diff)
CoreLib: use const (and const APIs) more
For CoW types const methods will be called. Mark store_persistent_indexes() as const, because this method does not modify the object. Change-Id: Ic867913b4fb5aaebfbaaffe1d3be45cf7b646403 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qsettings_mac.cpp4
-rw-r--r--src/corelib/io/qstandardpaths_mac.mm2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qsettings_mac.cpp b/src/corelib/io/qsettings_mac.cpp
index ceee165459..d73cc4d298 100644
--- a/src/corelib/io/qsettings_mac.cpp
+++ b/src/corelib/io/qsettings_mac.cpp
@@ -149,7 +149,7 @@ static QCFType<CFPropertyListRef> macValue(const QVariant &value)
bool singleton = (values.count() == 1);
if (singleton) {
- switch (values.first().type()) {
+ switch (values.constFirst().type()) {
// should be same as above (look for LIST)
case QVariant::List:
case QVariant::StringList:
@@ -161,7 +161,7 @@ static QCFType<CFPropertyListRef> macValue(const QVariant &value)
}
cfkeys[numUniqueKeys] = QCFString::toCFStringRef(key);
- cfvalues[numUniqueKeys] = singleton ? macValue(values.first()) : macList(values);
+ cfvalues[numUniqueKeys] = singleton ? macValue(values.constFirst()) : macList(values);
++numUniqueKeys;
}
diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm
index 33c34d41af..f08a6dac53 100644
--- a/src/corelib/io/qstandardpaths_mac.mm
+++ b/src/corelib/io/qstandardpaths_mac.mm
@@ -273,7 +273,7 @@ QString QStandardPaths::displayName(StandardLocation type)
return QCoreApplication::translate("QStandardPaths", "Applications");
if (QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
- standardLocations(type).first().toCFString(),
+ standardLocations(type).constFirst().toCFString(),
kCFURLPOSIXPathStyle, true)) {
QCFString name;
CFURLCopyResourcePropertyForKey(url, kCFURLLocalizedNameKey, &name, NULL);