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

Minor fix

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