Commit 93bc4371 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Time to increase version

clang-format is autogenerated now
port foreach
parent 6f7bc3b0
Pipeline #56836 passed with stage
in 8 minutes and 56 seconds
......@@ -66,6 +66,9 @@ NamespaceIndentation: None
# we use template< without space.
SpaceAfterTemplateKeyword: false
# Always break after template declaration
AlwaysBreakTemplateDeclarations: true
# macros for which the opening brace stays attached.
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]
......
cmake_minimum_required (VERSION 3.5.0 FATAL_ERROR)
cmake_minimum_required (VERSION 3.16.0 FATAL_ERROR)
project(kcron)
set (QT_MIN_VERSION "5.12.0")
set (KF5_MIN_VERSION "5.68.0")
set (QT_MIN_VERSION "5.15.0")
set (KF5_MIN_VERSION "5.80.0")
find_package (ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set (CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
......@@ -27,9 +27,7 @@ find_package(KF5 REQUIRED COMPONENTS
IconThemes
KIO
)
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
include(KDEGitCommitHooks)
endif()
include(KDEGitCommitHooks)
add_subdirectory(src)
......@@ -44,9 +42,7 @@ ecm_qt_install_logging_categories(
)
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
endif()
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
ki18n_install(po)
kdoctools_install(po)
......
......@@ -54,7 +54,7 @@ set(kcm_cron_SRCS
add_library(kcm_cron MODULE ${kcm_cron_SRCS})
target_link_libraries(kcm_cron
Qt5::PrintSupport
Qt::PrintSupport
KF5::ConfigWidgets
KF5::I18n
KF5::IconThemes
......
......@@ -206,14 +206,10 @@ void CrontabWidget::refreshCron()
void CrontabWidget::copy()
{
foreach (CTTask *task, mClipboardTasks) {
delete task;
}
qDeleteAll(mClipboardTasks);
mClipboardTasks.clear();
foreach (CTVariable *variable, mClipboardVariables) {
delete variable;
}
qDeleteAll(mClipboardVariables);
mClipboardVariables.clear();
QString clipboardText;
......
......@@ -245,14 +245,9 @@ QString CTCron::exportCron() const
CTCron::~CTCron()
{
foreach (CTTask *ctTask, d->task) {
delete ctTask;
}
foreach (CTVariable *ctVariable, d->variable) {
delete ctVariable;
}
qDeleteAll(d->task);
qDeleteAll(d->variable);
delete d;
}
......
......@@ -82,9 +82,7 @@ CTHost::CTHost(const QString &cronBinary, CTInitializationError &ctInitializatio
CTHost::~CTHost()
{
foreach (CTCron *ctCron, mCrons) {
delete ctCron;
}
qDeleteAll(mCrons);
}
bool CTHost::allowDeny(char *name)
......
......@@ -176,11 +176,11 @@ void TasksWidget::deleteSelection()
{
logDebug() << "Selection deleting...";
QList<QTreeWidgetItem *> tasksItems = treeWidget()->selectedItems();
const QList<QTreeWidgetItem *> tasksItems = treeWidget()->selectedItems();
bool deleteSomething = !(tasksItems.isEmpty());
foreach (QTreeWidgetItem *item, tasksItems) {
for (QTreeWidgetItem *item : tasksItems) {
TaskWidget *taskWidget = static_cast<TaskWidget *>(item);
crontabWidget()->currentCron()->removeTask(taskWidget->getCTTask());
......
......@@ -99,10 +99,10 @@ VariableWidget *VariablesWidget::firstSelectedVariableWidget() const
void VariablesWidget::deleteSelection()
{
QList<QTreeWidgetItem *> variablesItems = treeWidget()->selectedItems();
const QList<QTreeWidgetItem *> variablesItems = treeWidget()->selectedItems();
bool deleteSomething = !(variablesItems.isEmpty());
foreach (QTreeWidgetItem *item, variablesItems) {
for (QTreeWidgetItem *item : variablesItems) {
VariableWidget *variableWidget = static_cast<VariableWidget *>(item);
crontabWidget()->currentCron()->removeVariable(variableWidget->getCTVariable());
......
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