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

Clean up

parent 46b96bc9
......@@ -142,7 +142,7 @@ void ActionManager::toggleMenubar(bool dontShowWarning)
mMenuBar->show();
} else {
if (!dontShowWarning) {
QString accel = mHideMenuBarAction->shortcut().toString();
const QString accel = mHideMenuBarAction->shortcut().toString();
KMessageBox::information(mCalendarView,
i18n("<qt>This will hide the menu bar completely."
" You can show it again by typing %1.</qt>", accel),
......
......@@ -987,10 +987,10 @@ Akonadi::Collection::List AkonadiCollectionView::checkedCollections() const
if (!selectionModel) {
return collections;
}
QModelIndexList indexes = selectionModel->selectedIndexes();
foreach (const QModelIndex &index, indexes) {
const QModelIndexList indexes = selectionModel->selectedIndexes();
for (const QModelIndex &index : indexes) {
if (index.isValid()) {
Akonadi::Collection collection = index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
const Akonadi::Collection collection = index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
if (collection.isValid()) {
collections << collection;
}
......@@ -1008,10 +1008,10 @@ bool AkonadiCollectionView::isChecked(const Akonadi::Collection &collection) con
if (!selectionModel) {
return false;
}
QModelIndexList indexes = selectionModel->selectedIndexes();
foreach (const QModelIndex &index, indexes) {
const QModelIndexList indexes = selectionModel->selectedIndexes();
for (const QModelIndex &index : indexes) {
if (index.isValid()) {
Akonadi::Collection c = index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
const Akonadi::Collection c = index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
if (c.id() == collection.id()) {
return true;
}
......
......@@ -111,7 +111,8 @@ CalendarSupport::Plugin *KOCore::loadPlugin(const QString &name)
{
KService::List list = availablePlugins();
KService::List::ConstIterator it;
for (it = list.constBegin(); it != list.constEnd(); ++it) {
KService::List::ConstIterator end(list.constEnd());
for (it = list.constBegin(); it != end; ++it) {
if ((*it)->desktopEntryName() == name) {
return loadPlugin(*it);
}
......@@ -143,7 +144,8 @@ EventViews::CalendarDecoration::Decoration *KOCore::loadCalendarDecoration(const
{
KService::List list = availableCalendarDecorations();
KService::List::ConstIterator it;
for (it = list.constBegin(); it != list.constEnd(); ++it) {
KService::List::ConstIterator end(list.constEnd());
for (it = list.constBegin(); it != end; ++it) {
if ((*it)->desktopEntryName() == name) {
return loadCalendarDecoration(*it);
}
......@@ -207,7 +209,8 @@ KOrg::Part *KOCore::loadPart(const QString &name, KOrg::MainWindow *parent)
{
KService::List list = availableParts();
KService::List::ConstIterator it;
for (it = list.constBegin(); it != list.constEnd(); ++it) {
KService::List::ConstIterator end(list.constEnd());
for (it = list.constBegin(); it != end; ++it) {
if ((*it)->desktopEntryName() == name) {
return loadPart(*it, parent);
}
......
......@@ -104,7 +104,7 @@ void KODialogManager::showOptionsDialog()
// add them all
QStringList::iterator mit;
QStringList::iterator mitEnd(modules.end());
for (mit = modules.begin(); mit != mitEnd ; ++mit) {
for (mit = modules.begin(); mit != mitEnd ; ++mit) {
mOptionsDialog->addModule(*mit);
}
}
......
......@@ -66,7 +66,7 @@ BirthdaySearchJob::BirthdaySearchJob(QObject *parent, int daysInAdvance)
: ItemSearchJob(parent)
{
fetchScope().fetchFullPayload();
setMimeTypes(QStringList() << KContacts::Addressee::mimeType());
setMimeTypes({KContacts::Addressee::mimeType()});
Akonadi::SearchQuery query;
query.addTerm(QStringLiteral("birthday"), QDate::currentDate().toJulianDay(),
......
......@@ -105,7 +105,7 @@ Quickview::Quickview(const KPIM::Person &person, const Akonadi::Collection &col)
, mCollection(col)
, mDayRange(7)
{
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(mainWidget);
......
......@@ -326,7 +326,7 @@ MultiAgendaViewConfigDialog::MultiAgendaViewConfigDialog(QAbstractItemModel *bas
setLayout(mainLayout);
QWidget *widget = new QWidget;
d->ui.setupUi(widget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......
......@@ -188,7 +188,7 @@ void KOTodoView::printPreviewTodo()
void KOTodoView::printTodo(bool preview)
{
Akonadi::Item::List selectedItems = mView->selectedIncidences();
const Akonadi::Item::List selectedItems = mView->selectedIncidences();
if (selectedItems.count() != 1) {
return;
}
......
......@@ -124,7 +124,7 @@ void NavigatorBar::showButtons(bool left, bool right)
void NavigatorBar::selectDates(const KCalCore::DateList &dateList)
{
if (dateList.count() > 0) {
if (!dateList.isEmpty()) {
mDate = dateList.first();
// set the label text at the top of the navigator
......
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