diff --git a/src/presentation/availablenotepagesmodel.cpp b/src/presentation/availablenotepagesmodel.cpp --- a/src/presentation/availablenotepagesmodel.cpp +++ b/src/presentation/availablenotepagesmodel.cpp @@ -234,7 +234,7 @@ foreach (const auto &droppedArtifact, droppedArtifacts) { auto note = droppedArtifact.staticCast(); const auto job = m_tagRepository->associate(tag, note); - installHandler(job, tr("Cannot tag %1 with %2").arg(note->title()).arg(tag->name())); + installHandler(job, tr("Cannot tag %1 with %2").arg(note->title(), tag->name())); } return true; } else if (object == m_inboxObject) { diff --git a/src/presentation/availabletaskpagesmodel.cpp b/src/presentation/availabletaskpagesmodel.cpp --- a/src/presentation/availabletaskpagesmodel.cpp +++ b/src/presentation/availabletaskpagesmodel.cpp @@ -137,7 +137,7 @@ auto project = Domain::Project::Ptr::create(); project->setName(name); const auto job = m_projectRepository->create(project, source); - installHandler(job, tr("Cannot add project %1 in dataSource %2").arg(name).arg(source->name())); + installHandler(job, tr("Cannot add project %1 in dataSource %2").arg(name, source->name())); } void AvailableTaskPagesModel::addContext(const QString &name) @@ -287,7 +287,7 @@ if (auto project = object.objectCast()) { foreach (const auto &droppedArtifact, droppedArtifacts) { const auto job = m_projectRepository->associate(project, droppedArtifact); - installHandler(job, tr("Cannot add %1 to project %2").arg(droppedArtifact->title()).arg(project->name())); + installHandler(job, tr("Cannot add %1 to project %2").arg(droppedArtifact->title(), project->name())); } return true; } else if (auto context = object.objectCast()) { @@ -300,7 +300,7 @@ foreach (const auto &droppedArtifact, droppedArtifacts) { auto task = droppedArtifact.staticCast(); const auto job = m_contextRepository->associate(context, task); - installHandler(job, tr("Cannot add %1 to context %2").arg(task->title()).arg(context->name())); + installHandler(job, tr("Cannot add %1 to context %2").arg(task->title(), context->name())); } return true; } else if (object == m_inboxObject) { diff --git a/src/presentation/contextpagemodel.cpp b/src/presentation/contextpagemodel.cpp --- a/src/presentation/contextpagemodel.cpp +++ b/src/presentation/contextpagemodel.cpp @@ -68,7 +68,7 @@ const auto job = parentTask ? m_taskRepository->createChild(task, parentTask) : m_taskRepository->createInContext(task, m_context); - installHandler(job, tr("Cannot add task %1 in context %2").arg(title).arg(m_context->name())); + installHandler(job, tr("Cannot add task %1 in context %2").arg(title, m_context->name())); return task; } @@ -80,7 +80,7 @@ auto task = artifact.objectCast(); const auto job = index.parent().isValid() ? m_taskRepository->dissociate(task) : m_contextRepository->dissociate(m_context, task); - installHandler(job, tr("Cannot remove task %1 from context %2").arg(task->title()).arg(m_context->name())); + installHandler(job, tr("Cannot remove task %1 from context %2").arg(task->title(), m_context->name())); } void ContextPageModel::promoteItem(const QModelIndex &index) @@ -139,7 +139,7 @@ task->setDone(value.toInt() == Qt::Checked); const auto job = m_taskRepository->update(task); - installHandler(job, tr("Cannot modify task %1 in context %2").arg(currentTitle).arg(m_context->name())); + installHandler(job, tr("Cannot modify task %1 in context %2").arg(currentTitle, m_context->name())); return true; }; diff --git a/src/presentation/errorhandler.cpp b/src/presentation/errorhandler.cpp --- a/src/presentation/errorhandler.cpp +++ b/src/presentation/errorhandler.cpp @@ -44,6 +44,6 @@ void ErrorHandler::displayMessage(KJob *job, const QString &message) { if (job->error() != KJob::NoError) { - doDisplayMessage(QStringLiteral("%1: %2").arg(message).arg(job->errorString())); + doDisplayMessage(QStringLiteral("%1: %2").arg(message, job->errorString())); } } diff --git a/src/presentation/projectpagemodel.cpp b/src/presentation/projectpagemodel.cpp --- a/src/presentation/projectpagemodel.cpp +++ b/src/presentation/projectpagemodel.cpp @@ -61,7 +61,7 @@ const auto job = parentTask ? m_taskRepository->createChild(task, parentTask) : m_taskRepository->createInProject(task, m_project); - installHandler(job, tr("Cannot add task %1 in project %2").arg(title).arg(m_project->name())); + installHandler(job, tr("Cannot add task %1 in project %2").arg(title, m_project->name())); return task; } @@ -73,7 +73,7 @@ auto task = artifact.objectCast(); Q_ASSERT(task); const auto job = m_taskRepository->remove(task); - installHandler(job, tr("Cannot remove task %1 from project %2").arg(task->title()).arg(m_project->name())); + installHandler(job, tr("Cannot remove task %1 from project %2").arg(task->title(), m_project->name())); } void ProjectPageModel::promoteItem(const QModelIndex &index) @@ -130,7 +130,7 @@ task->setDone(value.toInt() == Qt::Checked); const auto job = m_taskRepository->update(task); - installHandler(job, tr("Cannot modify task %1 in project %2").arg(currentTitle).arg(m_project->name())); + installHandler(job, tr("Cannot modify task %1 in project %2").arg(currentTitle, m_project->name())); return true; }; diff --git a/src/presentation/tagpagemodel.cpp b/src/presentation/tagpagemodel.cpp --- a/src/presentation/tagpagemodel.cpp +++ b/src/presentation/tagpagemodel.cpp @@ -61,7 +61,7 @@ auto note = Domain::Note::Ptr::create(); note->setTitle(title); const auto job = m_noteRepository->createInTag(note, m_tag); - installHandler(job, tr("Cannot add note %1 in tag %2").arg(title).arg(m_tag->name())); + installHandler(job, tr("Cannot add note %1 in tag %2").arg(title, m_tag->name())); return note; } @@ -72,7 +72,7 @@ auto note = artifact.objectCast(); Q_ASSERT(note); const auto job = m_tagRepository->dissociate(m_tag, note); - installHandler(job, tr("Cannot remove note %1 from tag %2").arg(note->title()).arg(m_tag->name())); + installHandler(job, tr("Cannot remove note %1 from tag %2").arg(note->title(), m_tag->name())); } void TagPageModel::promoteItem(const QModelIndex &) @@ -117,7 +117,7 @@ const auto currentTitle = note->title(); note->setTitle(value.toString()); const auto job = m_noteRepository->update(note); - installHandler(job, tr("Cannot modify note %1 in tag %2").arg(currentTitle).arg(m_tag->name())); + installHandler(job, tr("Cannot modify note %1 in tag %2").arg(currentTitle, m_tag->name())); return true; }; diff --git a/src/presentation/taskinboxpagemodel.cpp b/src/presentation/taskinboxpagemodel.cpp --- a/src/presentation/taskinboxpagemodel.cpp +++ b/src/presentation/taskinboxpagemodel.cpp @@ -144,7 +144,7 @@ if (parentTask) { const auto job = m_taskRepository->associate(parentTask, childTask); - installHandler(job, tr("Cannot move task %1 as sub-task of %2").arg(childTask->title()).arg(parentTask->title())); + installHandler(job, tr("Cannot move task %1 as sub-task of %2").arg(childTask->title(), parentTask->title())); } else { const auto job = m_taskRepository->dissociate(childTask); installHandler(job, tr("Cannot deparent task %1 from its parent").arg(childTask->title())); diff --git a/src/presentation/workdaypagemodel.cpp b/src/presentation/workdaypagemodel.cpp --- a/src/presentation/workdaypagemodel.cpp +++ b/src/presentation/workdaypagemodel.cpp @@ -161,7 +161,7 @@ if (parentTask) { const auto job = m_taskRepository->associate(parentTask, childTask); - installHandler(job, tr("Cannot move task %1 as sub-task of %2").arg(childTask->title()).arg(parentTask->title())); + installHandler(job, tr("Cannot move task %1 as sub-task of %2").arg(childTask->title(), parentTask->title())); } else { childTask->setStartDate(Utils::DateTime::currentDateTime());