summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Martins <[email protected]>2015-10-20 19:03:52 +0100
committerSergio Martins <[email protected]>2015-10-20 19:05:57 +0100
commitb7b6dbd13410708971708aa8015de101204b8ee9 (patch)
tree49a9694b608bbd9f2df7f4c51232812e1faa9125
parent88800e91e6a823f444bd9dc048b199d5544f28df (diff)
Don't use operator[] on temporaries.
Usually results in detachments.
-rw-r--r--accountwizard/setupispdb.cpp6
-rw-r--r--blogilo/src/dbman.cpp6
-rw-r--r--calendarsupport/src/printing/calprintdefaultplugins.cpp2
-rw-r--r--korganizer/kocorehelper.cpp2
-rw-r--r--libkdepim/src/job/addemaildisplayjob.cpp2
-rw-r--r--messageviewer/src/viewer/viewer_p.cpp4
-rw-r--r--pimcommon/src/widgets/configureimmutablewidgetutils.cpp2
7 files changed, 12 insertions, 12 deletions
diff --git a/accountwizard/setupispdb.cpp b/accountwizard/setupispdb.cpp
index 41d08cc..4b7de1f 100644
--- a/accountwizard/setupispdb.cpp
+++ b/accountwizard/setupispdb.cpp
@@ -61,7 +61,7 @@ int SetupIspdb::countIdentities() const
void SetupIspdb::fillIdentitiy(int i, QObject *o) const
{
- identity isp = mIspdb->identities()[i];
+ identity isp = mIspdb->identities().at(i);
Identity *id = qobject_cast<Identity *>(o);
@@ -77,7 +77,7 @@ void SetupIspdb::fillImapServer(int i, QObject *o) const
if (mIspdb->imapServers().isEmpty()) {
return;
}
- Server isp = mIspdb->imapServers()[i];
+ Server isp = mIspdb->imapServers().at(i);
Resource *imapRes = qobject_cast<Resource *>(o);
imapRes->setName(isp.hostname);
@@ -101,7 +101,7 @@ int SetupIspdb::countImapServers() const
void SetupIspdb::fillSmtpServer(int i, QObject *o) const
{
- Server isp = mIspdb->smtpServers()[i];
+ Server isp = mIspdb->smtpServers().at(i);
Transport *smtpRes = qobject_cast<Transport *>(o);
smtpRes->setName(isp.hostname);
diff --git a/blogilo/src/dbman.cpp b/blogilo/src/dbman.cpp
index acee9b4..f93ae8a 100644
--- a/blogilo/src/dbman.cpp
+++ b/blogilo/src/dbman.cpp
@@ -518,7 +518,7 @@ int DBMan::addPost(const BilboPost &post, int blog_id)
for (int i = 0; i < cat_count; ++i) {
q2.addBindValue(blog_id);
q2.addBindValue(post.postId());
- q2.addBindValue(post.categories()[i]);
+ q2.addBindValue(post.categories().at(i));
q2.addBindValue(blog_id);
if (!q2.exec()) {
qCDebug(BLOGILO_LOG) << "Cannot add one of categories to Post, SQL Error: " << q2.lastError().text();
@@ -589,7 +589,7 @@ bool DBMan::editPost(const BilboPost &post, int blog_id)
for (int i = 0; i < cat_count; ++i) {
q2.addBindValue(blog_id);
q2.addBindValue(post.postId());
- q2.addBindValue(post.categories()[i]);
+ q2.addBindValue(post.categories().at(i));
q2.addBindValue(blog_id);
if (!q2.exec()) {
d->mLastErrorText = q2.lastError().text();
@@ -888,7 +888,7 @@ int DBMan::saveTemp_LocalEntry(const BilboPost &basePost, int blog_id, LocalPost
VALUES(?, (SELECT categoryId FROM category WHERE name = ? AND blog_id= ?))"));
for (int i = 0; i < cat_count; ++i) {
q2.addBindValue(localId);
- q2.addBindValue(post.categories()[i]);
+ q2.addBindValue(post.categories().at(i));
q2.addBindValue(blog_id);
if (!q2.exec()) {
d->mLastErrorText = q.lastError().text();
diff --git a/calendarsupport/src/printing/calprintdefaultplugins.cpp b/calendarsupport/src/printing/calprintdefaultplugins.cpp
index fab2c80..5ba2e49 100644
--- a/calendarsupport/src/printing/calprintdefaultplugins.cpp
+++ b/calendarsupport/src/printing/calprintdefaultplugins.cpp
@@ -322,7 +322,7 @@ void CalPrintIncidence::print(QPainter &p, int width, int height)
exceptString = i18nc("except for listed dates", " except");
for (int i = 0; i < recurs->exDates().size(); ++i) {
exceptString.append(QStringLiteral(" "));
- exceptString.append(QLocale::system().toString(recurs->exDates()[i],
+ exceptString.append(QLocale::system().toString(recurs->exDates().at(i),
QLocale::ShortFormat));
}
}
diff --git a/korganizer/kocorehelper.cpp b/korganizer/kocorehelper.cpp
index ed7a00e..cc1b88c 100644
--- a/korganizer/kocorehelper.cpp
+++ b/korganizer/kocorehelper.cpp
@@ -44,6 +44,6 @@ QColor KOCoreHelper::categoryColor(const QStringList &categories)
QString KOCoreHelper::holidayString(const QDate &dt)
{
- QStringList lst(KOGlobals::self()->holiday(dt, dt)[dt]);
+ QStringList lst(KOGlobals::self()->holiday(dt, dt).value(dt));
return lst.join(i18nc("@item:intext delimiter for joining holiday names", ","));
}
diff --git a/libkdepim/src/job/addemaildisplayjob.cpp b/libkdepim/src/job/addemaildisplayjob.cpp
index bae4fa5..d4e7208 100644
--- a/libkdepim/src/job/addemaildisplayjob.cpp
+++ b/libkdepim/src/job/addemaildisplayjob.cpp
@@ -110,7 +110,7 @@ public:
createContact();
} else {
Akonadi::Item item = items.at(0);
- KContacts::Addressee contact = searchJob->contacts()[0];
+ KContacts::Addressee contact = searchJob->contacts().at(0);
contact.insertCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("MailPreferedFormatting"), mShowAsHTML ? QStringLiteral("HTML") : QStringLiteral("TEXT"));
contact.insertCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("MailAllowToRemoteContent"), mRemoteContent ? QStringLiteral("TRUE") : QStringLiteral("FALSE"));
item.setPayload<KContacts::Addressee>(contact);
diff --git a/messageviewer/src/viewer/viewer_p.cpp b/messageviewer/src/viewer/viewer_p.cpp
index 00472c7..41cae05 100644
--- a/messageviewer/src/viewer/viewer_p.cpp
+++ b/messageviewer/src/viewer/viewer_p.cpp
@@ -1428,8 +1428,8 @@ void ViewerPrivate::saveSplitterSizes() const
if (mMimePartTree->isHidden()) {
return; // don't rely on QSplitter maintaining sizes for hidden widgets.
}
- MessageViewer::MessageViewerSettings::self()->setMimePaneHeight(mSplitter->sizes()[1]);
- MessageViewer::MessageViewerSettings::self()->setMessagePaneHeight(mSplitter->sizes()[0]);
+ MessageViewer::MessageViewerSettings::self()->setMimePaneHeight(mSplitter->sizes().at(1));
+ MessageViewer::MessageViewerSettings::self()->setMessagePaneHeight(mSplitter->sizes().at(0));
#endif
}
diff --git a/pimcommon/src/widgets/configureimmutablewidgetutils.cpp b/pimcommon/src/widgets/configureimmutablewidgetutils.cpp
index c6a5c98..5385861 100644
--- a/pimcommon/src/widgets/configureimmutablewidgetutils.cpp
+++ b/pimcommon/src/widgets/configureimmutablewidgetutils.cpp
@@ -93,7 +93,7 @@ void ConfigureImmutableWidgetUtils::loadWidget(QGroupBox *box, QButtonGroup *gro
{
Q_ASSERT(group->buttons().size() == e->choices().size());
checkLockDown(box, e);
- group->buttons()[e->value()]->setChecked(true);
+ group->buttons().at(e->value())->setChecked(true);
}
void ConfigureImmutableWidgetUtils::loadWidget(QSpinBox *b, const KCoreConfigSkeleton::ItemInt *e)