Commit ed2d826a authored by Laurent Montel's avatar Laurent Montel 😁

Astyle kdelibs

parent 652aa0a3
......@@ -76,7 +76,7 @@ void CheckIndexingJob::slotCollectionPropertiesFinished(KJob *job)
mCollection = fetch->collections().first();
const qlonglong result = mIndexedItems->indexedItems(mCollection.id());
bool needToReindex = false;
qCDebug(KMAIL_LOG) << "name :"<< mCollection.name() << " mCollection.statistics().count() "<< mCollection.statistics().count() << "stats.value(mCollection.id())" << result;
qCDebug(KMAIL_LOG) << "name :" << mCollection.name() << " mCollection.statistics().count() " << mCollection.statistics().count() << "stats.value(mCollection.id())" << result;
if (mCollection.statistics().count() != result) {
needToReindex = true;
qCDebug(KMAIL_LOG) << "Reindex collection :" << "name :" << mCollection.name();
......
......@@ -17,7 +17,6 @@
Boston, MA 02110-1301, USA.
*/
#include "checkindexingmanager.h"
#include "kmail_debug.h"
#include "checkindexingjob.h"
......@@ -54,7 +53,7 @@ CheckIndexingManager::~CheckIndexingManager()
void CheckIndexingManager::start(QAbstractItemModel *collectionModel)
{
if(mIsReady) {
if (mIsReady) {
const KSharedConfig::Ptr cfg = KSharedConfig::openConfig(QStringLiteral("kmailsearchindexingrc"));
KConfigGroup grp = cfg->group(QStringLiteral("General"));
const QDateTime lastDateTime = grp.readEntry(QStringLiteral("lastCheck"), QDateTime());
......
......@@ -100,7 +100,6 @@ private:
QHash<qint64, bool> mFilterCollections;
};
IncompleteIndexDialog::IncompleteIndexDialog(const QVector<qint64> &unindexedCollections, QWidget *parent)
: KDialog(parent)
, mUi(new Ui::IncompleteIndexDialog)
......@@ -141,9 +140,9 @@ IncompleteIndexDialog::~IncompleteIndexDialog()
void IncompleteIndexDialog::slotButtonClicked(int btn)
{
if (btn == Ok) {
waitForIndexer();
waitForIndexer();
} else {
KDialog::slotButtonClicked(btn);
KDialog::slotButtonClicked(btn);
}
}
......@@ -187,11 +186,10 @@ void IncompleteIndexDialog::waitForIndexer()
QLatin1String("org.freedesktop.Akonadi.BalooIndexer"),
QDBusConnection::sessionBus(), this);
if (!mIndexer->isValid()) {
accept();
return;
accept();
return;
}
mProgressDialog = new KProgressDialog(this);
mProgressDialog->progressBar()->setMaximum(mIndexingQueue.size());
mProgressDialog->progressBar()->setValue(0);
......@@ -207,8 +205,8 @@ void IncompleteIndexDialog::waitForIndexer()
}
if (mIndexingQueue.isEmpty()) {
accept();
return;
accept();
return;
}
mProgressDialog->show();
......@@ -224,12 +222,12 @@ void IncompleteIndexDialog::slotCurrentlyIndexingCollectionChanged(qlonglong col
{
const int idx = mIndexingQueue.indexOf(colId);
if (idx > -1) {
mIndexingQueue.remove(idx);
mIndexingQueue.remove(idx);
}
mProgressDialog->progressBar()->setValue(mProgressDialog->progressBar()->maximum() - mIndexingQueue.size());
if (mIndexingQueue.isEmpty()) {
QTimer::singleShot(1000, this, SLOT(accept()));
QTimer::singleShot(1000, this, SLOT(accept()));
}
}
......@@ -56,5 +56,4 @@ private:
QVector<qint64> mIndexingQueue;
};
#endif
......@@ -144,7 +144,6 @@ SearchWindow::SearchWindow(KMMainWidget *widget, const Akonadi::Collection &coll
connect(KMKernel::self()->folderCollectionMonitor(), &Akonadi::Monitor::collectionStatisticsChanged, this, &SearchWindow::updateCollectionStatistic);
connect(mUi.mSearchFolderEdt, &KLineEdit::textChanged, this, &SearchWindow::scheduleRename);
connect(&mRenameTimer, &QTimer::timeout, this, &SearchWindow::renameSearchFolder);
connect(mUi.mSearchFolderOpenBtn, &QPushButton::clicked, this, &SearchWindow::openSearchFolder);
......@@ -367,16 +366,16 @@ void SearchWindow::activateFolder(const Akonadi::Collection &collection)
}
mUi.mPatternEdit->setSearchPattern(&mSearchPattern);
if ( currentFolderIsSearchFolder ) {
if (currentFolderIsSearchFolder) {
mFolder = collection;
mUi.mSearchFolderEdt->setText( collection.name() );
mUi.mSearchFolderEdt->setText(collection.name());
createSearchModel();
} else if ( mUi.mSearchFolderEdt->text().isEmpty() ) {
mUi.mSearchFolderEdt->setText( i18n( "Last Search" ) );
} else if (mUi.mSearchFolderEdt->text().isEmpty()) {
mUi.mSearchFolderEdt->setText(i18n("Last Search"));
// find last search and reuse it if possible
mFolder = CommonKernel->collectionFromId( KMailSettings::lastSearchCollectionId() );
mFolder = CommonKernel->collectionFromId(KMailSettings::lastSearchCollectionId());
// when the last folder got renamed, create a new one
if ( mFolder.isValid() && mFolder.name() != mUi.mSearchFolderEdt->text() ) {
if (mFolder.isValid() && mFolder.name() != mUi.mSearchFolderEdt->text()) {
mFolder = Akonadi::Collection();
}
}
......@@ -596,7 +595,7 @@ void SearchWindow::searchDone(KJob *job)
void SearchWindow::slotCollectionStatisticsRetrieved(KJob *job)
{
Akonadi::CollectionFetchJob *fetch = qobject_cast<Akonadi::CollectionFetchJob*>(job);
Akonadi::CollectionFetchJob *fetch = qobject_cast<Akonadi::CollectionFetchJob *>(job);
if (!fetch || fetch->error()) {
return;
}
......
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