]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Add some missing const qualifiers
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Thu, 28 May 2020 20:42:40 +0000 (22:42 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Thu, 28 May 2020 20:42:40 +0000 (22:42 +0200)
src/kitemviews/kstandarditemlistwidget.cpp

index 13f80996d4e66fa3f6576391a4b8c5d778ecd870..41e9287c1628c24cf963cec9af13479c623c6f13 100644 (file)
@@ -1115,11 +1115,11 @@ void KStandardItemListWidget::updateTextsCache()
 
 QString KStandardItemListWidget::elideRightKeepExtension(const QString &text, int elidingWidth) const
 {
-    auto extensionIndex = text.lastIndexOf('.');
+    const auto extensionIndex = text.lastIndexOf('.');
     if (extensionIndex != -1) {
         // has file extension
-        auto extensionLength = text.length() - extensionIndex;
-        auto extensionWidth = m_customizedFontMetrics.width(text.right(extensionLength));
+        const auto extensionLength = text.length() - extensionIndex;
+        const auto extensionWidth = m_customizedFontMetrics.width(text.right(extensionLength));
         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
             QString ret = m_customizedFontMetrics.elidedText(text.chopped(extensionLength),