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

Minor fix

parent 16dc55dd
......@@ -206,7 +206,7 @@ private:
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup group = config->group(mTreeStateConfig);
treeStateSaver.setView(mTreeView);
treeStateSaver.setSelectionModel(0); // we only save expand state
treeStateSaver.setSelectionModel(nullptr); // we only save expand state
treeStateSaver.saveState(group);
}
......
......@@ -174,7 +174,6 @@ CalendarView::CalendarView(QWidget *parent)
QWidget *rightBox = new QWidget(mPanner);
QVBoxLayout *rightBoxVBoxLayout = new QVBoxLayout(rightBox);
rightBoxVBoxLayout->setMargin(0);
rightBox->layout()->setMargin(0);
mNavigatorBar = new NavigatorBar(rightBox);
rightBoxVBoxLayout->addWidget(mNavigatorBar);
mRightFrame = new QStackedWidget(rightBox);
......
......@@ -83,7 +83,7 @@ void SearchCollectionHelper::updateSearchCollection(Akonadi::Collection col, KCa
Akonadi::SearchQuery query(Akonadi::SearchTerm::RelOr);
const QStringList lstEmails = mIdentityManager->allEmails();
for (const QString email : lstEmails) {
for (const QString &email : lstEmails) {
if (!email.isEmpty()) {
query.addTerm(Akonadi::IncidenceSearchTerm(Akonadi::IncidenceSearchTerm::PartStatus, QString(email + QString::number(status))));
}
......
......@@ -249,7 +249,8 @@ KOrg::Part::List KOCore::loadParts(KOrg::MainWindow *parent)
KService::List plugins = availableParts();
KService::List::ConstIterator it;
for (it = plugins.constBegin(); it != plugins.constEnd(); ++it) {
KService::List::ConstIterator end(plugins.constEnd());
for (it = plugins.constBegin(); it != end; ++it) {
if (selectedPlugins.contains((*it)->desktopEntryName())) {
KOrg::Part *part = loadPart(*it, parent);
if (part) {
......@@ -287,7 +288,7 @@ KOrg::Part::List KOCore::reloadParts(KOrg::MainWindow *parent, KOrg::Part::List
factory->removeClient(parent->mainGuiClient());
unloadParts(parent, parts);
KOrg::Part::List list = loadParts(parent);
const KOrg::Part::List list = loadParts(parent);
factory->addClient(parent->mainGuiClient());
......
......@@ -117,6 +117,8 @@ void KOrganizer::initializePluginActions()
}
}
}
#else
qCDebug(KORGANIZER_LOG) << " Plugins not implemented yet";
#endif
}
void KOrganizer::newMainWindow(const QUrl &url)
......@@ -231,9 +233,7 @@ KOrg::CalendarViewBase *KOrganizer::view() const
void KOrganizer::setTitle()
{
QString title;
if (!hasDocument()) {
title = i18n("Calendar");
} else {
if (hasDocument()) {
QUrl url = mActionManager->url();
if (!url.isEmpty()) {
......@@ -249,6 +249,8 @@ void KOrganizer::setTitle()
if (mCalendarView->isReadOnly()) {
title += QLatin1String(" [") + i18nc("the calendar is read-only", "read-only") + QLatin1Char(']');
}
} else {
title = i18n("Calendar");
}
if (mCalendarView->isFiltered()) {
title += QLatin1String(" - <") + mCalendarView->currentFilterName() + QLatin1String("> ");
......
......@@ -273,8 +273,8 @@ Controller::Controller(ReparentingModel *personModel, ReparentingModel *searchMo
: QObject(parent),
mPersonModel(personModel),
mSearchModel(searchModel),
mCollectionSearchJob(0),
mPersonSearchJob(0)
mCollectionSearchJob(nullptr),
mPersonSearchJob(nullptr)
{
Akonadi::AttributeFactory::registerAttribute<Akonadi::CollectionIdentificationAttribute>();
}
......@@ -284,12 +284,12 @@ void Controller::setSearchString(const QString &searchString)
if (mCollectionSearchJob) {
disconnect(mCollectionSearchJob, 0, this, 0);
mCollectionSearchJob->kill(KJob::Quietly);
mCollectionSearchJob = 0;
mCollectionSearchJob = nullptr;
}
if (mPersonSearchJob) {
disconnect(mPersonSearchJob, 0, this, 0);
mPersonSearchJob->kill(KJob::Quietly);
mPersonSearchJob = 0;
mPersonSearchJob = nullptr;
}
//TODO: Delay and abort when results are found
mSearchModel->clear();
......@@ -319,7 +319,7 @@ void Controller::setSearchString(const QString &searchString)
void Controller::onCollectionsFound(KJob *job)
{
mCollectionSearchJob = 0;
mCollectionSearchJob = nullptr;
if (!mPersonSearchJob) {
Q_EMIT searching(false);
}
......@@ -356,7 +356,7 @@ void Controller::onPersonUpdate(const KPIM::Person &person)
void Controller::onPersonsFound(KJob *job)
{
mPersonSearchJob = 0;
mPersonSearchJob = nullptr;
if (!mCollectionSearchJob) {
Q_EMIT searching(false);
}
......
......@@ -32,7 +32,7 @@
*/
ReparentingModel::Node::Node(ReparentingModel &model)
: parent(0),
: parent(nullptr),
personModel(model),
mIsSourceNode(false)
{
......@@ -98,7 +98,7 @@ void ReparentingModel::Node::addChild(const ReparentingModel::Node::Ptr &node)
void ReparentingModel::Node::clearHierarchy()
{
parent = 0;
parent = nullptr;
children.clear();
}
......@@ -139,7 +139,7 @@ int ReparentingModel::Node::row() const
{
Q_ASSERT(parent);
int row = 0;
Q_FOREACH (const Node::Ptr &node, parent->children) {
for (const Node::Ptr &node : qAsConst(parent->children)) {
if (node.data() == this) {
return row;
}
......@@ -200,7 +200,7 @@ bool ReparentingModel::validateNode(const Node *node) const
}
bool found = false;
Q_FOREACH (const Node::Ptr &child, n->parent->children) {
for (const Node::Ptr &child : qAsConst(n->parent->children)) {
if (child.data() == n) {
found = true;
}
......@@ -239,7 +239,7 @@ void ReparentingModel::addNode(const ReparentingModel::Node::Ptr &node)
//otherwise we run into the problem that while a node is being removed,
//the async request could be triggered (due to a changed signal),
//resulting in the node getting readded immediately after it had been removed.
Q_FOREACH (const ReparentingModel::Node::Ptr &existing, mProxyNodes) {
for (const ReparentingModel::Node::Ptr &existing : qAsConst(mProxyNodes)) {
if (*existing == *node) {
// qCDebug(KORGANIZER_LOG) << "node is already existing";
return;
......@@ -252,7 +252,7 @@ void ReparentingModel::addNode(const ReparentingModel::Node::Ptr &node)
void ReparentingModel::doAddNode(const Node::Ptr &node)
{
Q_FOREACH (const ReparentingModel::Node::Ptr &existing, mProxyNodes) {
for (const ReparentingModel::Node::Ptr &existing : qAsConst(mProxyNodes)) {
if (*existing == *node) {
// qCDebug(KORGANIZER_LOG) << "node is already existing";
return;
......@@ -287,7 +287,7 @@ void ReparentingModel::doAddNode(const Node::Ptr &node)
void ReparentingModel::updateNode(const ReparentingModel::Node::Ptr &node)
{
Q_FOREACH (const ReparentingModel::Node::Ptr &existing, mProxyNodes) {
for (const ReparentingModel::Node::Ptr &existing : qAsConst(mProxyNodes)) {
if (*existing == *node) {
existing->update(node);
const QModelIndex i = index(existing.data());
......@@ -380,7 +380,7 @@ void ReparentingModel::onSourceRowsAboutToBeInserted(const QModelIndex &parent,
ReparentingModel::Node *ReparentingModel::getReparentNode(const QModelIndex &sourceIndex)
{
Q_FOREACH (const Node::Ptr &proxyNode, mProxyNodes) {
for (const Node::Ptr &proxyNode : qAsConst(mProxyNodes)) {
//Reparent source nodes according to the provided rules
//The proxy can be ignored if it is a duplicate, so only reparent to proxies that are in the model
if (proxyNode->parent && proxyNode->adopts(sourceIndex)) {
......@@ -653,7 +653,7 @@ ReparentingModel::Node *ReparentingModel::getSourceNode(const QModelIndex &sourc
}
}
// qCDebug(KORGANIZER_LOG) << objectName() << "no node found for " << sourceIndex;
return 0;
return nullptr;
}
QModelIndex ReparentingModel::mapFromSource(const QModelIndex &sourceIndex) const
......@@ -734,7 +734,7 @@ void ReparentingModel::reparentSourceNodes(const Node::Ptr &proxyNode)
void ReparentingModel::rebuildAll()
{
mRootNode.children.clear();
Q_FOREACH (const Node::Ptr &proxyNode, mProxyNodes) {
for (const Node::Ptr &proxyNode : qAsConst(mProxyNodes)) {
proxyNode->clearHierarchy();
}
Q_ASSERT(mSourceNodes.isEmpty());
......@@ -799,7 +799,7 @@ int ReparentingModel::row(ReparentingModel::Node *node) const
}
Q_ASSERT(validateNode(node));
int row = 0;
Q_FOREACH (const Node::Ptr &c, node->parent->children) {
for (const Node::Ptr &c : qAsConst(node->parent->children)) {
if (c.data() == node) {
return row;
}
......
......@@ -295,7 +295,7 @@ void KDateNavigator::selectPreviousMonth()
void KDateNavigator::selectDates(const KCalCore::DateList &dateList)
{
if (dateList.count() > 0) {
if (!dateList.isEmpty()) {
mSelectedDates = dateList;
updateDates();
......
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