Fwd: New Defects reported by Coverity Scan for Konsole

Kurt Hindenburg kurt.hindenburg at gmail.com
Fri Sep 2 19:11:47 BST 2022


FYI, from master today 9/02

Kurt

> Begin forwarded message:
> 
> 9 new defect(s) introduced to Konsole found with Coverity Scan.
> 6 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
> 
> New defect(s) Reported-by: Coverity Scan
> Showing 9 of 9 defect(s)
> 
> 
> ** CID 356516:  Uninitialized members  (UNINIT_CTOR)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/history/compact/CompactHistoryScroll.cpp: 19 in Konsole::CompactHistoryScroll::CompactHistoryScroll(unsigned int)()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 356516:  Uninitialized members  (UNINIT_CTOR)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/history/compact/CompactHistoryScroll.cpp: 19 in Konsole::CompactHistoryScroll::CompactHistoryScroll(unsigned int)()
> 13     
> 14     CompactHistoryScroll::CompactHistoryScroll(const unsigned int maxLineCount)
> 15         : HistoryScroll(new CompactHistoryType(maxLineCount))
> 16         , _maxLineCount(0)
> 17     {
> 18         setMaxNbLines(maxLineCount);
>>>>   CID 356516:  Uninitialized members  (UNINIT_CTOR)
>>>>   Non-static class member "_indexBias" is not initialized in this constructor nor in any functions that it calls.
> 19     }
> 20     
> 21     void CompactHistoryScroll::removeLinesFromTop(size_t lines)
> 22     {
> 23         if (_lineDatas.size() > 1) {
> 24             const unsigned int removing = _lineDatas.at(lines - 1).index;
> 
> ** CID 356515:  Performance inefficiencies  (AUTO_CAUSES_COPY)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/widgets/EditProfileDialog.cpp: 1515 in Konsole::EditProfileDialog::setupButtonGroup(const Konsole::EditProfileDialog::ButtonGroupOptions &, const QExplicitlySharedDataPointer<Konsole::Profile> &)()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 356515:  Performance inefficiencies  (AUTO_CAUSES_COPY)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/widgets/EditProfileDialog.cpp: 1515 in Konsole::EditProfileDialog::setupButtonGroup(const Konsole::EditProfileDialog::ButtonGroupOptions &, const QExplicitlySharedDataPointer<Konsole::Profile> &)()
> 1509     }
> 1510     
> 1511     void EditProfileDialog::setupButtonGroup(const ButtonGroupOptions &options, const Profile::Ptr &profile)
> 1512     {
> 1513         auto currentValue = profile->property<int>(options.profileProperty);
> 1514     
>>>>   CID 356515:  Performance inefficiencies  (AUTO_CAUSES_COPY)
>>>>   Using the "auto" keyword without an "&" causes the copy of an object of type ButtonGroupOption.
> 1515         for (auto option : options.buttons) {
> 1516             options.group->setId(option.button, option.value);
> 1517         }
> 1518     
> 1519         Q_ASSERT(options.buttons.count() > 0);
> 1520         auto *activeButton = options.group->button(currentValue);
> 
> ** CID 356514:  Performance inefficiencies  (AUTO_CAUSES_COPY)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/Vt102EmulationTest.cpp: 146 in QTest::toString<std::vector<std::variant<Konsole::TestEmulation::ProcessToken, Konsole::TestEmulation::ProcessSessionAttributeRequest, Konsole::TestEmulation::ProcessChecksumRequest, Konsole::TestEmulation::DecodingError>, std::allocator<std::variant<Konsole::TestEmulation::ProcessToken, Konsole::TestEmulation::ProcessSessionAttributeRequest, Konsole::TestEmulation::ProcessChecksumRequest, Konsole::TestEmulation::DecodingError>>>>(const T1 &)()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 356514:  Performance inefficiencies  (AUTO_CAUSES_COPY)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/Vt102EmulationTest.cpp: 146 in QTest::toString<std::vector<std::variant<Konsole::TestEmulation::ProcessToken, Konsole::TestEmulation::ProcessSessionAttributeRequest, Konsole::TestEmulation::ProcessChecksumRequest, Konsole::TestEmulation::DecodingError>, std::allocator<std::variant<Konsole::TestEmulation::ProcessToken, Konsole::TestEmulation::ProcessSessionAttributeRequest, Konsole::TestEmulation::ProcessChecksumRequest, Konsole::TestEmulation::DecodingError>>>>(const T1 &)()
> 140     namespace QTest
> 141     {
> 142     template<>
> 143     char *toString(const std::vector<TestEmulation::Item> &items)
> 144     {
> 145         QStringList res;
>>>>   CID 356514:  Performance inefficiencies  (AUTO_CAUSES_COPY)
>>>>   Using the "auto" keyword without an "&" causes the copy of an object of type variant.
> 146         for (auto item : items) {
> 147             res.append(std::visit(ItemToString{}, item));
> 148         }
> 149         return toString(res.join(QStringLiteral(",")));
> 150     }
> 151     }
> 
> ** CID 356513:  Performance inefficiencies  (AUTO_CAUSES_COPY)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/ViewManager.cpp: 1075 in <unnamed>::restoreSessionsSplitterRecurse(const QJsonObject &, Konsole::ViewManager *, bool)()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 356513:  Performance inefficiencies  (AUTO_CAUSES_COPY)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/ViewManager.cpp: 1075 in <unnamed>::restoreSessionsSplitterRecurse(const QJsonObject &, Konsole::ViewManager *, bool)()
> 1069         const QJsonArray splitterWidgets = jsonSplitter[QStringLiteral("Widgets")].toArray();
> 1070         auto orientation = (jsonSplitter[QStringLiteral("Orientation")].toString() == QStringLiteral("Horizontal")) ? Qt::Horizontal : Qt::Vertical;
> 1071     
> 1072         auto *currentSplitter = new ViewSplitter();
> 1073         currentSplitter->setOrientation(orientation);
> 1074     
>>>>   CID 356513:  Performance inefficiencies  (AUTO_CAUSES_COPY)
>>>>   Using the "auto" keyword without an "&" causes the copy of an object of type QJsonValue.
> 1075         for (const auto widgetJsonValue : splitterWidgets) {
> 1076             const auto widgetJsonObject = widgetJsonValue.toObject();
> 1077             const auto sessionIterator = widgetJsonObject.constFind(QStringLiteral("SessionRestoreId"));
> 1078     
> 1079             if (sessionIterator != widgetJsonObject.constEnd()) {
> 1080                 Session *session = useSessionId ? SessionManager::instance()->idToSession(sessionIterator->toInt()) : SessionManager::instance()->createSession();
> 
> ** CID 356512:    (RESOURCE_LEAK)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 50 in Konsole::ProfileTest::testProfile()()
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 51 in Konsole::ProfileTest::testProfile()()
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 55 in Konsole::ProfileTest::testProfile()()
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 53 in Konsole::ProfileTest::testProfile()()
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 49 in Konsole::ProfileTest::testProfile()()
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 54 in Konsole::ProfileTest::testProfile()()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 356512:    (RESOURCE_LEAK)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 50 in Konsole::ProfileTest::testProfile()()
> 44     
> 45         parent->setProperty(Profile::AntiAliasFonts, false);
> 46         parent->setProperty(Profile::StartInCurrentSessionDir, false);
> 47     
> 48         parent->setProperty(Profile::UseCustomCursorColor, true);
> 49         QVERIFY(parent->useCustomCursorColor());
>>>>   CID 356512:    (RESOURCE_LEAK)
>>>>   Variable "parent" going out of scope leaks the storage it points to.
> 50         QCOMPARE(parent->customCursorColor(), QColor());
> 51         QCOMPARE(parent->customCursorTextColor(), QColor());
> 52         parent->setProperty(Profile::UseCustomCursorColor, false);
> 53         QVERIFY(!parent->useCustomCursorColor());
> 54         QCOMPARE(parent->customCursorColor(), QColor());
> 55         QCOMPARE(parent->customCursorTextColor(), QColor());
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 51 in Konsole::ProfileTest::testProfile()()
> 45         parent->setProperty(Profile::AntiAliasFonts, false);
> 46         parent->setProperty(Profile::StartInCurrentSessionDir, false);
> 47     
> 48         parent->setProperty(Profile::UseCustomCursorColor, true);
> 49         QVERIFY(parent->useCustomCursorColor());
> 50         QCOMPARE(parent->customCursorColor(), QColor());
>>>>   CID 356512:    (RESOURCE_LEAK)
>>>>   Variable "parent" going out of scope leaks the storage it points to.
> 51         QCOMPARE(parent->customCursorTextColor(), QColor());
> 52         parent->setProperty(Profile::UseCustomCursorColor, false);
> 53         QVERIFY(!parent->useCustomCursorColor());
> 54         QCOMPARE(parent->customCursorColor(), QColor());
> 55         QCOMPARE(parent->customCursorTextColor(), QColor());
> 56     
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 55 in Konsole::ProfileTest::testProfile()()
> 49         QVERIFY(parent->useCustomCursorColor());
> 50         QCOMPARE(parent->customCursorColor(), QColor());
> 51         QCOMPARE(parent->customCursorTextColor(), QColor());
> 52         parent->setProperty(Profile::UseCustomCursorColor, false);
> 53         QVERIFY(!parent->useCustomCursorColor());
> 54         QCOMPARE(parent->customCursorColor(), QColor());
>>>>   CID 356512:    (RESOURCE_LEAK)
>>>>   Variable "parent" going out of scope leaks the storage it points to.
> 55         QCOMPARE(parent->customCursorTextColor(), QColor());
> 56     
> 57         // create a child profile
> 58         Profile *child = new Profile(Profile::Ptr(parent));
> 59         child->setProperty(Profile::StartInCurrentSessionDir, true);
> 60     
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 53 in Konsole::ProfileTest::testProfile()()
> 47     
> 48         parent->setProperty(Profile::UseCustomCursorColor, true);
> 49         QVERIFY(parent->useCustomCursorColor());
> 50         QCOMPARE(parent->customCursorColor(), QColor());
> 51         QCOMPARE(parent->customCursorTextColor(), QColor());
> 52         parent->setProperty(Profile::UseCustomCursorColor, false);
>>>>   CID 356512:    (RESOURCE_LEAK)
>>>>   Variable "parent" going out of scope leaks the storage it points to.
> 53         QVERIFY(!parent->useCustomCursorColor());
> 54         QCOMPARE(parent->customCursorColor(), QColor());
> 55         QCOMPARE(parent->customCursorTextColor(), QColor());
> 56     
> 57         // create a child profile
> 58         Profile *child = new Profile(Profile::Ptr(parent));
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 49 in Konsole::ProfileTest::testProfile()()
> 43         parent->setProperty(Profile::Path, QStringLiteral("FakePath"));
> 44     
> 45         parent->setProperty(Profile::AntiAliasFonts, false);
> 46         parent->setProperty(Profile::StartInCurrentSessionDir, false);
> 47     
> 48         parent->setProperty(Profile::UseCustomCursorColor, true);
>>>>   CID 356512:    (RESOURCE_LEAK)
>>>>   Variable "parent" going out of scope leaks the storage it points to.
> 49         QVERIFY(parent->useCustomCursorColor());
> 50         QCOMPARE(parent->customCursorColor(), QColor());
> 51         QCOMPARE(parent->customCursorTextColor(), QColor());
> 52         parent->setProperty(Profile::UseCustomCursorColor, false);
> 53         QVERIFY(!parent->useCustomCursorColor());
> 54         QCOMPARE(parent->customCursorColor(), QColor());
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 54 in Konsole::ProfileTest::testProfile()()
> 48         parent->setProperty(Profile::UseCustomCursorColor, true);
> 49         QVERIFY(parent->useCustomCursorColor());
> 50         QCOMPARE(parent->customCursorColor(), QColor());
> 51         QCOMPARE(parent->customCursorTextColor(), QColor());
> 52         parent->setProperty(Profile::UseCustomCursorColor, false);
> 53         QVERIFY(!parent->useCustomCursorColor());
>>>>   CID 356512:    (RESOURCE_LEAK)
>>>>   Variable "parent" going out of scope leaks the storage it points to.
> 54         QCOMPARE(parent->customCursorColor(), QColor());
> 55         QCOMPARE(parent->customCursorTextColor(), QColor());
> 56     
> 57         // create a child profile
> 58         Profile *child = new Profile(Profile::Ptr(parent));
> 59         child->setProperty(Profile::StartInCurrentSessionDir, true);
> 
> ** CID 356511:  Uninitialized variables  (UNINIT)
> 
> 
> ________________________________________________________________________________________________________
> *** CID 356511:  Uninitialized variables  (UNINIT)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/history/compact/CompactHistoryScroll.cpp: 18 in Konsole::CompactHistoryScroll::CompactHistoryScroll(unsigned int)()
> 12     using namespace Konsole;
> 13     
> 14     CompactHistoryScroll::CompactHistoryScroll(const unsigned int maxLineCount)
> 15         : HistoryScroll(new CompactHistoryType(maxLineCount))
> 16         , _maxLineCount(0)
> 17     {
>>>>   CID 356511:  Uninitialized variables  (UNINIT)
>>>>   Using uninitialized value "this->_indexBias" when calling "setMaxNbLines".
> 18         setMaxNbLines(maxLineCount);
> 19     }
> 20     
> 21     void CompactHistoryScroll::removeLinesFromTop(size_t lines)
> 22     {
> 23         if (_lineDatas.size() > 1) {
> 
> ** CID 356510:  Memory - illegal accesses  (RETURN_LOCAL)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/colorscheme/ColorSchemeManager.cpp: 169 in Konsole::ColorSchemeManager::findColorScheme(const QString &)()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 356510:  Memory - illegal accesses  (RETURN_LOCAL)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/colorscheme/ColorSchemeManager.cpp: 169 in Konsole::ColorSchemeManager::findColorScheme(const QString &)()
> 163             qCDebug(ColorSchemeDebug) << name << " has an invalid character / in the name ... skipping";
> 164             return defaultColorScheme();
> 165         }
> 166     
> 167         if (_colorSchemes.contains(name)) {
> 168             std::shared_ptr<const ColorScheme> colorScheme = _colorSchemes.value(name).lock();
>>>>   CID 356510:  Memory - illegal accesses  (RETURN_LOCAL)
>>>>   Using "colorScheme", which points to an out-of-scope temporary variable of type "std::weak_ptr<Konsole::ColorScheme const> const".
> 169             if (colorScheme) {
> 170                 return colorScheme;
> 171             } else {
> 172                 // Remove outdated weak pointer
> 173                 _colorSchemes.remove(name);
> 174             }
> 
> ** CID 356509:    (RESOURCE_LEAK)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 64 in Konsole::ProfileTest::testProfile()()
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 66 in Konsole::ProfileTest::testProfile()()
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 65 in Konsole::ProfileTest::testProfile()()
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 62 in Konsole::ProfileTest::testProfile()()
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 63 in Konsole::ProfileTest::testProfile()()
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 67 in Konsole::ProfileTest::testProfile()()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 356509:    (RESOURCE_LEAK)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 64 in Konsole::ProfileTest::testProfile()()
> 58         Profile *child = new Profile(Profile::Ptr(parent));
> 59         child->setProperty(Profile::StartInCurrentSessionDir, true);
> 60     
> 61         // check which properties are set
> 62         QVERIFY(parent->isPropertySet(Profile::Name));
> 63         QVERIFY(parent->isPropertySet(Profile::Path));
>>>>   CID 356509:    (RESOURCE_LEAK)
>>>>   Variable "child" going out of scope leaks the storage it points to.
> 64         QVERIFY(parent->isPropertySet(Profile::AntiAliasFonts));
> 65         QVERIFY(!parent->isPropertySet(Profile::Icon));
> 66         QVERIFY(!parent->isPropertySet(Profile::Command));
> 67         QVERIFY(!parent->isPropertySet(Profile::Arguments));
> 68     
> 69         QVERIFY(child->isPropertySet(Profile::StartInCurrentSessionDir));
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 66 in Konsole::ProfileTest::testProfile()()
> 60     
> 61         // check which properties are set
> 62         QVERIFY(parent->isPropertySet(Profile::Name));
> 63         QVERIFY(parent->isPropertySet(Profile::Path));
> 64         QVERIFY(parent->isPropertySet(Profile::AntiAliasFonts));
> 65         QVERIFY(!parent->isPropertySet(Profile::Icon));
>>>>   CID 356509:    (RESOURCE_LEAK)
>>>>   Variable "child" going out of scope leaks the storage it points to.
> 66         QVERIFY(!parent->isPropertySet(Profile::Command));
> 67         QVERIFY(!parent->isPropertySet(Profile::Arguments));
> 68     
> 69         QVERIFY(child->isPropertySet(Profile::StartInCurrentSessionDir));
> 70         QVERIFY(!child->isPropertySet(Profile::Name));
> 71         QVERIFY(!child->isPropertySet(Profile::AntiAliasFonts));
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 65 in Konsole::ProfileTest::testProfile()()
> 59         child->setProperty(Profile::StartInCurrentSessionDir, true);
> 60     
> 61         // check which properties are set
> 62         QVERIFY(parent->isPropertySet(Profile::Name));
> 63         QVERIFY(parent->isPropertySet(Profile::Path));
> 64         QVERIFY(parent->isPropertySet(Profile::AntiAliasFonts));
>>>>   CID 356509:    (RESOURCE_LEAK)
>>>>   Variable "child" going out of scope leaks the storage it points to.
> 65         QVERIFY(!parent->isPropertySet(Profile::Icon));
> 66         QVERIFY(!parent->isPropertySet(Profile::Command));
> 67         QVERIFY(!parent->isPropertySet(Profile::Arguments));
> 68     
> 69         QVERIFY(child->isPropertySet(Profile::StartInCurrentSessionDir));
> 70         QVERIFY(!child->isPropertySet(Profile::Name));
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 62 in Konsole::ProfileTest::testProfile()()
> 56     
> 57         // create a child profile
> 58         Profile *child = new Profile(Profile::Ptr(parent));
> 59         child->setProperty(Profile::StartInCurrentSessionDir, true);
> 60     
> 61         // check which properties are set
>>>>   CID 356509:    (RESOURCE_LEAK)
>>>>   Variable "child" going out of scope leaks the storage it points to.
> 62         QVERIFY(parent->isPropertySet(Profile::Name));
> 63         QVERIFY(parent->isPropertySet(Profile::Path));
> 64         QVERIFY(parent->isPropertySet(Profile::AntiAliasFonts));
> 65         QVERIFY(!parent->isPropertySet(Profile::Icon));
> 66         QVERIFY(!parent->isPropertySet(Profile::Command));
> 67         QVERIFY(!parent->isPropertySet(Profile::Arguments));
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 63 in Konsole::ProfileTest::testProfile()()
> 57         // create a child profile
> 58         Profile *child = new Profile(Profile::Ptr(parent));
> 59         child->setProperty(Profile::StartInCurrentSessionDir, true);
> 60     
> 61         // check which properties are set
> 62         QVERIFY(parent->isPropertySet(Profile::Name));
>>>>   CID 356509:    (RESOURCE_LEAK)
>>>>   Variable "child" going out of scope leaks the storage it points to.
> 63         QVERIFY(parent->isPropertySet(Profile::Path));
> 64         QVERIFY(parent->isPropertySet(Profile::AntiAliasFonts));
> 65         QVERIFY(!parent->isPropertySet(Profile::Icon));
> 66         QVERIFY(!parent->isPropertySet(Profile::Command));
> 67         QVERIFY(!parent->isPropertySet(Profile::Arguments));
> 68     
> /home/kurthindenburg/Devel/KDE/src/konsole/src/autotests/ProfileTest.cpp: 67 in Konsole::ProfileTest::testProfile()()
> 61         // check which properties are set
> 62         QVERIFY(parent->isPropertySet(Profile::Name));
> 63         QVERIFY(parent->isPropertySet(Profile::Path));
> 64         QVERIFY(parent->isPropertySet(Profile::AntiAliasFonts));
> 65         QVERIFY(!parent->isPropertySet(Profile::Icon));
> 66         QVERIFY(!parent->isPropertySet(Profile::Command));
>>>>   CID 356509:    (RESOURCE_LEAK)
>>>>   Variable "child" going out of scope leaks the storage it points to.
> 67         QVERIFY(!parent->isPropertySet(Profile::Arguments));
> 68     
> 69         QVERIFY(child->isPropertySet(Profile::StartInCurrentSessionDir));
> 70         QVERIFY(!child->isPropertySet(Profile::Name));
> 71         QVERIFY(!child->isPropertySet(Profile::AntiAliasFonts));
> 72         QVERIFY(!child->isPropertySet(Profile::ColorScheme));
> 
> ** CID 356508:  Performance inefficiencies  (AUTO_CAUSES_COPY)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/Part.cpp: 205 in Konsole::Part::setCurrentProfile(const QString &)()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 356508:  Performance inefficiencies  (AUTO_CAUSES_COPY)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/Part.cpp: 205 in Konsole::Part::setCurrentProfile(const QString &)()
> 199         return SessionManager::instance()->sessionProfile(activeSession())->name();
> 200     }
> 201     
> 202     bool Part::setCurrentProfile(const QString &profileName)
> 203     {
> 204         Profile::Ptr profile;
>>>>   CID 356508:  Performance inefficiencies  (AUTO_CAUSES_COPY)
>>>>   Using the "auto" keyword without an "&" causes the copy of an object of type QExplicitlySharedDataPointer.
> 205         for (auto p : ProfileManager::instance()->allProfiles()) {
> 206             if (p->name() == profileName) {
> 207                 profile = p;
> 208                 break;
> 209             }
> 210         }
> 
> 



More information about the konsole-devel mailing list