summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
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/kernel
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/kernel')
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp4
-rw-r--r--src/corelib/kernel/qeventdispatcher_glib.cpp2
-rw-r--r--src/corelib/kernel/qtimerinfo_unix.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index 9cd8420a32..601733b939 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -59,12 +59,12 @@ int appCmdShow = 0;
Q_CORE_EXPORT QString qAppFileName()
{
- return QFileInfo(QCoreApplication::arguments().first()).filePath();
+ return QFileInfo(QCoreApplication::arguments().constFirst()).filePath();
}
QString QCoreApplicationPrivate::appName() const
{
- return QFileInfo(QCoreApplication::arguments().first()).baseName();
+ return QFileInfo(QCoreApplication::arguments().constFirst()).baseName();
}
#else
diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp
index 8c2b47dccb..8ca2ac1c39 100644
--- a/src/corelib/kernel/qeventdispatcher_glib.cpp
+++ b/src/corelib/kernel/qeventdispatcher_glib.cpp
@@ -143,7 +143,7 @@ static gboolean timerSourceCheckHelper(GTimerSource *src)
|| (src->processEventsFlags & QEventLoop::X11ExcludeTimers))
return false;
- if (src->timerList.updateCurrentTime() < src->timerList.first()->timeout)
+ if (src->timerList.updateCurrentTime() < src->timerList.constFirst()->timeout)
return false;
return true;
diff --git a/src/corelib/kernel/qtimerinfo_unix.cpp b/src/corelib/kernel/qtimerinfo_unix.cpp
index 8f5e8c9523..56337bdb45 100644
--- a/src/corelib/kernel/qtimerinfo_unix.cpp
+++ b/src/corelib/kernel/qtimerinfo_unix.cpp
@@ -591,7 +591,7 @@ int QTimerInfoList::activateTimers()
if (isEmpty())
break;
- QTimerInfo *currentTimerInfo = first();
+ QTimerInfo *currentTimerInfo = constFirst();
if (currentTime < currentTimerInfo->timeout)
break; // no timer has expired