Commit d6a78dfb authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use auto vs auto * where it's possible

parent 63a6b969
Pipeline #49684 failed with stage
in 12 minutes and 2 seconds
......@@ -256,7 +256,7 @@ void AkonadiIndexingAgent::collectionChanged(const Akonadi::Collection &collecti
if (changes.contains("ENTITYDISPLAY")) {
// If the name changed we have to reindex all subcollections
auto *job = new CollectionUpdateJob(m_index, collection, this);
auto job = new CollectionUpdateJob(m_index, collection, this);
job->start();
} else {
m_index.index(collection);
......@@ -285,7 +285,7 @@ void AkonadiIndexingAgent::collectionMoved(const Akonadi::Collection &collection
}
m_index.remove(collection);
auto *job = new CollectionUpdateJob(m_index, collection, this);
auto job = new CollectionUpdateJob(m_index, collection, this);
job->start();
}
......
......@@ -95,7 +95,7 @@ private Q_SLOTS:
Akonadi::Search::Query query(term);
query.setType(QStringLiteral("Email"));
auto *emailSearchStore = new Akonadi::Search::EmailSearchStore(this);
auto emailSearchStore = new Akonadi::Search::EmailSearchStore(this);
emailSearchStore->setDbPath(emailDir);
int res = emailSearchStore->exec(query);
qDebug() << res;
......
......@@ -36,7 +36,7 @@ void CollectionIndexingJob::start()
m_time.start();
// Fetch collection for statistics
auto *job = new Akonadi::CollectionFetchJob(m_collection, Akonadi::CollectionFetchJob::Base);
auto job = new Akonadi::CollectionFetchJob(m_collection, Akonadi::CollectionFetchJob::Base);
job->fetchScope().setIncludeStatistics(true);
job->fetchScope().setListFilter(Akonadi::CollectionFetchScope::NoFilter);
job->fetchScope().fetchAttribute<Akonadi::IndexPolicyAttribute>();
......@@ -89,7 +89,7 @@ void CollectionIndexingJob::indexItems(const QList<Akonadi::Item::Id> &itemIds)
items << Akonadi::Item(id);
}
auto *fetchJob = new Akonadi::ItemFetchJob(items);
auto fetchJob = new Akonadi::ItemFetchJob(items);
fetchJob->fetchScope().fetchFullPayload(true);
fetchJob->fetchScope().setCacheOnly(true);
fetchJob->fetchScope().setIgnoreRetrievalErrors(true);
......@@ -166,7 +166,7 @@ void CollectionIndexingJob::findUnindexed()
qCDebug(AKONADI_INDEXER_AGENT_LOG) << "Found " << m_indexedItems.size() << " indexed items. Took (ms): " << m_time.elapsed() - start
<< " collection id :" << m_collection.id();
auto *job = new Akonadi::ItemFetchJob(m_collection, this);
auto job = new Akonadi::ItemFetchJob(m_collection, this);
job->fetchScope().fetchFullPayload(false);
job->fetchScope().setCacheOnly(true);
job->fetchScope().setIgnoreRetrievalErrors(true);
......
......@@ -26,7 +26,7 @@ void CollectionUpdateJob::start()
}
// Fetch children to update the path accordingly
auto *fetchJob = new Akonadi::CollectionFetchJob(mCol, Akonadi::CollectionFetchJob::Recursive, this);
auto fetchJob = new Akonadi::CollectionFetchJob(mCol, Akonadi::CollectionFetchJob::Recursive, this);
fetchJob->fetchScope().setAncestorRetrieval(Akonadi::CollectionFetchScope::All);
fetchJob->fetchScope().ancestorFetchScope().fetchAttribute<Akonadi::EntityDisplayAttribute>();
fetchJob->fetchScope().setListFilter(Akonadi::CollectionFetchScope::NoFilter);
......
......@@ -25,7 +25,7 @@ JobFactory::~JobFactory()
CollectionIndexingJob *
JobFactory::createCollectionIndexingJob(Index &index, const Akonadi::Collection &col, const QList<Akonadi::Item::Id> &pending, bool fullSync, QObject *parent)
{
auto *job = new CollectionIndexingJob(index, col, pending, parent);
auto job = new CollectionIndexingJob(index, col, pending, parent);
job->setFullSync(fullSync);
return job;
}
......@@ -158,7 +158,7 @@ void Scheduler::scheduleCompleteSync()
void Scheduler::slotRootCollectionsFetched(KJob *kjob)
{
auto *cjob = static_cast<Akonadi::CollectionFetchJob *>(kjob);
auto cjob = static_cast<Akonadi::CollectionFetchJob *>(kjob);
const Akonadi::Collection::List lstCols = cjob->collections();
for (const Akonadi::Collection &c : lstCols) {
// For skipping search collections
......@@ -183,7 +183,7 @@ void Scheduler::slotRootCollectionsFetched(KJob *kjob)
void Scheduler::slotCollectionsToIndexFetched(KJob *kjob)
{
auto *cjob = static_cast<Akonadi::CollectionFetchJob *>(kjob);
auto cjob = static_cast<Akonadi::CollectionFetchJob *>(kjob);
const Akonadi::Collection::List lstCols = cjob->collections();
for (const Akonadi::Collection &c : lstCols) {
// For skipping search collections
......
......@@ -76,7 +76,7 @@ void App::main()
void App::slotRootCollectionsFetched(KJob *kjob)
{
auto *job = qobject_cast<Akonadi::CollectionFetchJob *>(kjob);
auto job = qobject_cast<Akonadi::CollectionFetchJob *>(kjob);
m_collections = job->collections();
QMutableVectorIterator<Akonadi::Collection> it(m_collections);
......
......@@ -107,7 +107,7 @@ private Q_SLOTS:
msg->subject()->from7BitString("subject2");
// Multipart message
auto *b = new KMime::Content;
auto b = new KMime::Content;
b->contentType()->setMimeType("text/plain");
b->setBody("body2");
msg->addContent(b, true);
......@@ -131,7 +131,7 @@ private Q_SLOTS:
msg->subject()->from7BitString("subject3");
// Multipart message
auto *b = new KMime::Content;
auto b = new KMime::Content;
b->contentType()->setMimeType("text/plain");
b->setBody("body3");
msg->addContent(b, true);
......@@ -155,7 +155,7 @@ private Q_SLOTS:
msg->subject()->from7BitString("subject4");
// Multipart message
auto *b = new KMime::Content;
auto b = new KMime::Content;
b->contentType()->setMimeType("text/plain");
b->setBody("body4");
msg->addContent(b, true);
......@@ -166,7 +166,7 @@ private Q_SLOTS:
msg->bcc()->addAddress("bcc@test.com", QStringLiteral("Jane Doe"));
msg->date()->setDateTime(QDateTime(QDate(2014, 11, 11), QTime(13, 0, 0)));
msg->replyTo()->from7BitString("test@kde.org");
auto *header = new KMime::Headers::Generic("Resent-From");
auto header = new KMime::Headers::Generic("Resent-From");
header->fromUnicodeString(QStringLiteral("resent@kde.org"), "utf-8");
msg->setHeader(header);
header = new KMime::Headers::Generic("List-Id");
......@@ -188,7 +188,7 @@ private Q_SLOTS:
msg->subject()->from7BitString("all tags");
// Multipart message
auto *b = new KMime::Content;
auto b = new KMime::Content;
b->contentType()->setMimeType("text/plain");
b->setBody("tags");
msg->addContent(b, true);
......@@ -222,7 +222,7 @@ private Q_SLOTS:
msg->subject()->from7BitString("Change in qt/qtx11extras[stable]: remove QtWidgets dependency");
// Multipart message
auto *b = new KMime::Content;
auto b = new KMime::Content;
b->contentType()->setMimeType("text/plain");
b->setBody("body5");
msg->addContent(b, true);
......@@ -335,7 +335,7 @@ private Q_SLOTS:
msg->subject()->from7BitString("note");
// Multipart message
auto *b = new KMime::Content;
auto b = new KMime::Content;
b->contentType()->setMimeType("text/plain");
b->setBody("body note");
msg->addContent(b, true);
......@@ -354,7 +354,7 @@ private Q_SLOTS:
msg->subject()->from7BitString("note2");
// Multipart message
auto *b = new KMime::Content;
auto b = new KMime::Content;
b->contentType()->setMimeType("text/plain");
b->setBody("note");
msg->addContent(b, true);
......@@ -373,7 +373,7 @@ private Q_SLOTS:
msg->subject()->from7BitString("note3");
// Multipart message
auto *b = new KMime::Content;
auto b = new KMime::Content;
b->contentType()->setMimeType("text/plain");
b->setBody("note3");
msg->addContent(b, true);
......@@ -414,13 +414,13 @@ private Q_SLOTS:
}
calendarIndexer.commit();
auto *emailSearchStore = new Akonadi::Search::EmailSearchStore();
auto emailSearchStore = new Akonadi::Search::EmailSearchStore();
emailSearchStore->setDbPath(emailDir);
auto *contactSearchStore = new Akonadi::Search::ContactSearchStore();
auto contactSearchStore = new Akonadi::Search::ContactSearchStore();
contactSearchStore->setDbPath(contactsDir);
auto *noteSearchStore = new Akonadi::Search::NoteSearchStore();
auto noteSearchStore = new Akonadi::Search::NoteSearchStore();
noteSearchStore->setDbPath(noteDir);
auto *calendarSearchStore = new Akonadi::Search::CalendarSearchStore();
auto calendarSearchStore = new Akonadi::Search::CalendarSearchStore();
calendarSearchStore->setDbPath(calendarDir);
Akonadi::Search::SearchStore::overrideSearchStores(QList<Akonadi::Search::SearchStore *>()
......
......@@ -34,9 +34,9 @@ AkonadiSearchDebugDialog::AkonadiSearchDebugDialog(QWidget *parent)
// Don't translate it's just a dialog to debug
setWindowTitle(QStringLiteral("Debug Akonadi Search"));
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
auto *user1Button = new QPushButton;
auto user1Button = new QPushButton;
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
// Don't translate it.
user1Button->setText(QStringLiteral("Save As..."));
......
......@@ -20,9 +20,9 @@ using namespace Akonadi::Search;
AkonadiSearchDebugWidget::AkonadiSearchDebugWidget(QWidget *parent)
: QWidget(parent)
{
auto *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
auto *hbox = new QHBoxLayout;
auto hbox = new QHBoxLayout;
mainLayout->addLayout(hbox);
QLabel *lab = new QLabel(QStringLiteral("Item identifier:"), this);
hbox->addWidget(lab);
......@@ -87,7 +87,7 @@ void AkonadiSearchDebugWidget::slotSearch()
if (searchId.isEmpty()) {
return;
}
auto *job = new Akonadi::Search::AkonadiSearchDebugSearchJob(this);
auto job = new Akonadi::Search::AkonadiSearchDebugSearchJob(this);
job->setAkonadiId(searchId);
job->setSearchPath(mSearchPathComboBox->searchPath());
connect(job, &Akonadi::Search::AkonadiSearchDebugSearchJob::result, this, &AkonadiSearchDebugWidget::slotResult);
......
......@@ -20,7 +20,7 @@ int main(int argc, char **argv)
parser.addHelpOption();
parser.process(app);
auto *dlg = new Akonadi::Search::AkonadiSearchDebugDialog();
auto dlg = new Akonadi::Search::AkonadiSearchDebugDialog();
dlg->resize(800, 600);
dlg->show();
app.exec();
......
......@@ -44,7 +44,7 @@ Query *Query::fromJSON(const QByteArray &json)
return nullptr;
}
auto *cq = new ContactQuery();
auto cq = new ContactQuery();
cq->matchName(result[QStringLiteral("name")].toString());
cq->matchNickname(result[QStringLiteral("nick")].toString());
cq->matchEmail(result[QStringLiteral("email")].toString());
......
......@@ -71,7 +71,7 @@ void App::main()
return;
}
auto *job = new Akonadi::ItemFetchJob(m_akonadiIds);
auto job = new Akonadi::ItemFetchJob(m_akonadiIds);
job->fetchScope().fetchFullPayload(true);
connect(job, &Akonadi::ItemFetchJob::itemsReceived, this, &App::itemsReceived);
......
......@@ -89,7 +89,7 @@ void PIMContactsRunner::queryContacts(Plasma::RunnerContext &context, const QStr
// a separate Session for each, otherwise things might explode
QScopedPointer<Akonadi::Session, QScopedPointerDeleteLater> session(
new Akonadi::Session("PIIMContactRunner-" + QByteArray::number((qlonglong)QThread::currentThread())));
auto *fetch = new Akonadi::ItemFetchJob(results, session.data());
auto fetch = new Akonadi::ItemFetchJob(results, session.data());
Akonadi::ItemFetchScope &scope = fetch->fetchScope();
scope.fetchFullPayload(true);
scope.setFetchRemoteIdentification(false);
......
......@@ -18,7 +18,7 @@ K_PLUGIN_FACTORY(PIMContactsRunnerConfigFactory, registerPlugin<PIMContactsRunne
PIMContactsRunnerConfig::PIMContactsRunnerConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
{
auto *vbox = new QVBoxLayout(this);
auto vbox = new QVBoxLayout(this);
mQueryCompletionCheckBox = new QCheckBox(i18n("Search in contacts indexed from sent and received emails too"), this);
connect(mQueryCompletionCheckBox, &QCheckBox::stateChanged, this, &PIMContactsRunnerConfig::configChanged);
......
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