Commit 9031bba8 authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent 6ed9f6d8
......@@ -42,9 +42,7 @@ using namespace Akonadi::Server;
PreprocessorInstance::PreprocessorInstance(const QString &id)
: QObject()
, mBusy(false)
, mId(id)
, mInterface(nullptr)
{
Q_ASSERT(!id.isEmpty());
}
......
......@@ -83,7 +83,7 @@ private:
* This, in fact, *should* be equivalent to "mItemQueue.count() > 0"
* as the head item in the queue is the one being processed now.
*/
bool mBusy;
bool mBusy = false;
/**
* The date-time at that we have started processing the current
......@@ -102,7 +102,7 @@ private:
/**
* The preprocessor D-Bus interface. Owned.
*/
OrgFreedesktopAkonadiPreprocessorInterface *mInterface;
OrgFreedesktopAkonadiPreprocessorInterface *mInterface = nullptr;
protected:
......
......@@ -84,7 +84,7 @@ void StorageJanitor::quit()
// Make sure all childrens are deleted within context of this thread
qDeleteAll(children());
qDebug() << "chainup()";
qCDebug(AKONADISERVER_LOG) << "chainup()";
AkThread::quit();
}
......@@ -243,7 +243,7 @@ void StorageJanitor::findOrphanedResources()
for (const Resource &resource : orphanResources) {
resourceNames.append(resource.name());
}
inform(QStringLiteral("Found %1 orphan resources: %2").arg(orphanResources.size()). arg(resourceNames.join(QLatin1Char(','))));
inform(QStringLiteral("Found %1 orphan resources: %2").arg(orphanResourcesSize). arg(resourceNames.join(QLatin1Char(','))));
for (const QString &resourceName : qAsConst(resourceNames)) {
inform(QStringLiteral("Removing resource %1").arg(resourceName));
ResourceManager::self()->removeResourceInstance(resourceName);
......
......@@ -191,7 +191,7 @@ void akInit(const QString &appName)
{
KCrash::initialize();
QString name = QFileInfo(appName).fileName();
const QString name = QFileInfo(appName).fileName();
const auto errorLogFile = DebugPrivate::errorLogFileName(name);
QFileInfo infoOld(errorLogFile + QLatin1String(".old"));
if (infoOld.exists()) {
......
......@@ -39,7 +39,7 @@ namespace Internal
class AgentTypeWidgetDelegate : public QAbstractItemDelegate
{
public:
AgentTypeWidgetDelegate(QObject *parent = nullptr);
explicit AgentTypeWidgetDelegate(QObject *parent = nullptr);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
......
......@@ -43,8 +43,6 @@ class Q_DECL_HIDDEN CollectionComboBox::Private
public:
Private(QAbstractItemModel *customModel, CollectionComboBox *parent)
: mParent(parent)
, mMonitor(nullptr)
, mModel(nullptr)
{
if (customModel) {
mBaseModel = customModel;
......
......@@ -53,28 +53,26 @@ class Q_DECL_HIDDEN CollectionDialog::Private
public:
Private(QAbstractItemModel *customModel, CollectionDialog *parent, CollectionDialogOptions options)
: mParent(parent)
, mMonitor(nullptr)
, mNewSubfolderButton(nullptr)
{
// setup GUI
QVBoxLayout *layout = new QVBoxLayout(mParent);
mTextLabel = new QLabel;
mTextLabel = new QLabel(mParent);
layout->addWidget(mTextLabel);
mTextLabel->hide();
QLineEdit *filterCollectionLineEdit = new QLineEdit();
QLineEdit *filterCollectionLineEdit = new QLineEdit(mParent);
filterCollectionLineEdit->setClearButtonEnabled(true);
filterCollectionLineEdit->setPlaceholderText(i18nc("@info Displayed grayed-out inside the "
"textbox, verb to search", "Search"));
layout->addWidget(filterCollectionLineEdit);
mView = new EntityTreeView;
mView = new EntityTreeView(mParent);
mView->setDragDropMode(QAbstractItemView::NoDragDrop);
mView->header()->hide();
layout->addWidget(mView);
mUseByDefault = new QCheckBox(i18n("Use folder by default"));
mUseByDefault = new QCheckBox(i18n("Use folder by default"), mParent);
mUseByDefault->hide();
layout->addWidget(mUseByDefault);
......@@ -175,8 +173,8 @@ public:
EntityTreeView *mView = nullptr;
AsyncSelectionHandler *mSelectionHandler = nullptr;
QLabel *mTextLabel = nullptr;
bool mAllowToCreateNewChildCollection;
bool mKeepTreeExpanded;
bool mAllowToCreateNewChildCollection = false;
bool mKeepTreeExpanded = false;
KRecursiveFilterProxyModel *mFilterCollection = nullptr;
QCheckBox *mUseByDefault = nullptr;
QStringList mContentMimeTypes;
......
......@@ -120,8 +120,7 @@ void CollectionPropertiesDialog::Private::registerBuiltinPages()
void CollectionPropertiesDialog::Private::init()
{
QVBoxLayout *mainLayout = new QVBoxLayout;
q->setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(q);
q->setAttribute(Qt::WA_DeleteOnClose);
mTabWidget = new QTabWidget(q);
mainLayout->addWidget(mTabWidget);
......
......@@ -39,9 +39,6 @@ class Q_DECL_HIDDEN CollectionRequester::Private
public:
Private(CollectionRequester *parent)
: q(parent)
, edit(nullptr)
, button(nullptr)
, collectionDialog(nullptr)
{
}
......@@ -115,9 +112,8 @@ void CollectionRequester::Private::_k_collectionsNamesReceived(KJob *job)
void CollectionRequester::Private::init()
{
QHBoxLayout *hbox = new QHBoxLayout;
QHBoxLayout *hbox = new QHBoxLayout(q);
hbox->setMargin(0);
q->setLayout(hbox);
edit = new QLineEdit(q);
edit->setReadOnly(true);
......
......@@ -48,7 +48,6 @@ class Q_DECL_HIDDEN CollectionView::Private
public:
Private(CollectionView *parent)
: mParent(parent)
, xmlGuiClient(nullptr)
{
}
......
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