Commit cbb35681 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Add some missing const qualifiers

parent 46c4b902
...@@ -1115,11 +1115,11 @@ void KStandardItemListWidget::updateTextsCache() ...@@ -1115,11 +1115,11 @@ void KStandardItemListWidget::updateTextsCache()
QString KStandardItemListWidget::elideRightKeepExtension(const QString &text, int elidingWidth) const QString KStandardItemListWidget::elideRightKeepExtension(const QString &text, int elidingWidth) const
{ {
auto extensionIndex = text.lastIndexOf('.'); const auto extensionIndex = text.lastIndexOf('.');
if (extensionIndex != -1) { if (extensionIndex != -1) {
// has file extension // has file extension
auto extensionLength = text.length() - extensionIndex; const auto extensionLength = text.length() - extensionIndex;
auto extensionWidth = m_customizedFontMetrics.width(text.right(extensionLength)); const auto extensionWidth = m_customizedFontMetrics.width(text.right(extensionLength));
if (elidingWidth > extensionWidth && extensionLength < 6 && (float(extensionWidth) / float(elidingWidth)) < 0.3) { if (elidingWidth > extensionWidth && extensionLength < 6 && (float(extensionWidth) / float(elidingWidth)) < 0.3) {
// if we have room to display the file extension and the extension is not too long // if we have room to display the file extension and the extension is not too long
QString ret = m_customizedFontMetrics.elidedText(text.chopped(extensionLength), QString ret = m_customizedFontMetrics.elidedText(text.chopped(extensionLength),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment