Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 1a20906f authored by Laurent Montel's avatar Laurent Montel 😁

Fix some warning

parent 21809027
......@@ -139,7 +139,7 @@ void ArchiveMailAgent::reload()
void ArchiveMailAgent::configure(WId windowId)
{
showConfigureDialog((qulonglong)windowId);
showConfigureDialog(static_cast<qulonglong>(windowId));
}
void ArchiveMailAgent::pause()
......
......@@ -36,9 +36,6 @@ QDate ArchiveMailAgentUtil::diffDate(ArchiveMailInfo *info)
case ArchiveMailInfo::ArchiveYears:
diffDate = diffDate.addYears(info->archiveAge());
break;
default:
qCDebug(ARCHIVEMAILAGENT_LOG) << "archiveUnit not defined :" << info->archiveUnit();
break;
}
return diffDate;
}
......
......@@ -189,8 +189,8 @@ void ArchiveMailInfo::writeConfig(KConfigGroup &config)
}
config.writeEntry("saveSubCollection", mSaveSubCollection);
config.writeEntry("archiveType", (int)mArchiveType);
config.writeEntry("archiveUnit", (int)mArchiveUnit);
config.writeEntry("archiveType", static_cast<int>(mArchiveType));
config.writeEntry("archiveUnit", static_cast<int>(mArchiveUnit));
config.writeEntry("saveCollectionId", mSaveCollectionId);
config.writeEntry("archiveAge", mArchiveAge);
config.writeEntry("maximumArchiveCount", mMaximumArchiveCount);
......
......@@ -178,7 +178,7 @@ void ArchiveMailWidget::createOrUpdateItem(ArchiveMailInfo *info, ArchiveMailIte
void ArchiveMailWidget::updateDiffDate(ArchiveMailItem *item, ArchiveMailInfo *info)
{
const QDate diffDate = ArchiveMailAgentUtil::diffDate(info);
const int diff = QDate::currentDate().daysTo(diffDate);
const qint64 diff = QDate::currentDate().daysTo(diffDate);
item->setText(ArchiveMailWidget::NextArchive, i18np("Tomorrow", "%1 days", diff));
if (diff < 0) {
if (info->isEnabled()) {
......@@ -252,7 +252,7 @@ void ArchiveMailWidget::slotModifyItem()
void ArchiveMailWidget::slotAddItem()
{
QPointer<AddArchiveMailDialog> dialog = new AddArchiveMailDialog(0, this);
QPointer<AddArchiveMailDialog> dialog = new AddArchiveMailDialog(nullptr, this);
if (dialog->exec()) {
ArchiveMailInfo *info = dialog->info();
if (verifyExistingArchive(info)) {
......
......@@ -24,11 +24,11 @@ FormatComboBox::FormatComboBox(QWidget *parent)
: QComboBox(parent)
{
// These combobox values have to stay in sync with the ArchiveType enum from BackupJob!
addItem(i18n("Compressed Zip Archive (.zip)"), (int)MailCommon::BackupJob::Zip);
addItem(i18n("Uncompressed Archive (.tar)"), (int)MailCommon::BackupJob::Tar);
addItem(i18n("BZ2-Compressed Tar Archive (.tar.bz2)"), (int)MailCommon::BackupJob::TarBz2);
addItem(i18n("GZ-Compressed Tar Archive (.tar.gz)"), (int)MailCommon::BackupJob::TarGz);
setCurrentIndex(findData((int)MailCommon::BackupJob::TarBz2));
addItem(i18n("Compressed Zip Archive (.zip)"), static_cast<int>(MailCommon::BackupJob::Zip));
addItem(i18n("Uncompressed Archive (.tar)"), static_cast<int>(MailCommon::BackupJob::Tar));
addItem(i18n("BZ2-Compressed Tar Archive (.tar.bz2)"), static_cast<int>(MailCommon::BackupJob::TarBz2));
addItem(i18n("GZ-Compressed Tar Archive (.tar.gz)"), static_cast<int>(MailCommon::BackupJob::TarGz));
setCurrentIndex(findData(static_cast<int>(MailCommon::BackupJob::TarBz2)));
}
FormatComboBox::~FormatComboBox()
......@@ -37,7 +37,7 @@ FormatComboBox::~FormatComboBox()
void FormatComboBox::setFormat(MailCommon::BackupJob::ArchiveType type)
{
const int index = findData((int)type);
const int index = findData(static_cast<int>(type));
if (index != -1) {
setCurrentIndex(index);
} else {
......
......@@ -23,10 +23,10 @@
UnitComboBox::UnitComboBox(QWidget *parent)
: QComboBox(parent)
{
addItem(i18n("Days"), (int)ArchiveMailInfo::ArchiveDays);
addItem(i18n("Weeks"), (int)ArchiveMailInfo::ArchiveWeeks);
addItem(i18n("Months"), (int)ArchiveMailInfo::ArchiveMonths);
addItem(i18n("Years"), (int)ArchiveMailInfo::ArchiveYears);
addItem(i18n("Days"), static_cast<int>(ArchiveMailInfo::ArchiveDays));
addItem(i18n("Weeks"), static_cast<int>(ArchiveMailInfo::ArchiveWeeks));
addItem(i18n("Months"), static_cast<int>(ArchiveMailInfo::ArchiveMonths));
addItem(i18n("Years"), static_cast<int>(ArchiveMailInfo::ArchiveYears));
}
UnitComboBox::~UnitComboBox()
......@@ -35,7 +35,7 @@ UnitComboBox::~UnitComboBox()
void UnitComboBox::setUnit(ArchiveMailInfo::ArchiveUnit unit)
{
const int index = findData((int)unit);
const int index = findData(static_cast<int>(unit));
if (index != -1) {
setCurrentIndex(index);
} else {
......
......@@ -119,7 +119,7 @@ void FollowUpReminderAgent::showConfigureDialog(qlonglong windowId)
void FollowUpReminderAgent::configure(WId windowId)
{
showConfigureDialog((qulonglong)windowId);
showConfigureDialog(static_cast<qlonglong>(windowId));
}
void FollowUpReminderAgent::itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection)
......
......@@ -257,7 +257,7 @@ void FilterLogDialog::writeConfig()
group.writeEntry("LogRuleResult", FilterLog::instance()->isContentTypeEnabled(FilterLog::RuleResult));
group.writeEntry("LogPatternResult", FilterLog::instance()->isContentTypeEnabled(FilterLog::PatternResult));
group.writeEntry("LogAppliedAction", FilterLog::instance()->isContentTypeEnabled(FilterLog::AppliedAction));
group.writeEntry("maxLogSize", (int)(FilterLog::instance()->maxLogSize()));
group.writeEntry("maxLogSize", static_cast<int>(FilterLog::instance()->maxLogSize()));
group.sync();
}
......
......@@ -58,9 +58,9 @@ public:
Private(FilterManager *qq)
: q(qq)
, mRequiredPartsBasedOnAll(SearchRule::Envelope)
, mInboundFiltersExist(false)
, mTotalProgressCount(0)
, mCurrentProgressCount(0)
, mInboundFiltersExist(false)
{
pixmapNotification = QIcon::fromTheme(QStringLiteral("view-filter")).pixmap(KIconLoader::SizeSmall, KIconLoader::SizeSmall);
}
......@@ -81,12 +81,12 @@ public:
FilterManager *q;
QList<MailCommon::MailFilter *> mFilters;
QMap<QString, SearchRule::RequiredPart> mRequiredParts;
SearchRule::RequiredPart mRequiredPartsBasedOnAll;
QPixmap pixmapNotification;
bool mInboundFiltersExist = false;
bool mAllFoldersFiltersExist = false;
SearchRule::RequiredPart mRequiredPartsBasedOnAll;
int mTotalProgressCount = 0;
int mCurrentProgressCount = 0;
bool mInboundFiltersExist = false;
bool mAllFoldersFiltersExist = false;
};
void FilterManager::Private::slotItemsFetchedForFilter(const Akonadi::Item::List &items)
......
......@@ -138,7 +138,7 @@ bool SendLaterAgent::enabledAgent() const
void SendLaterAgent::configure(WId windowId)
{
showConfigureDialog((qlonglong)windowId);
showConfigureDialog(static_cast<qlonglong>(windowId));
}
void SendLaterAgent::slotSendNow(Akonadi::Item::Id id)
......
......@@ -91,7 +91,7 @@ void SendLaterManager::createSendInfoList()
if (!mListSendLaterInfo.isEmpty()) {
mCurrentInfo = mListSendLaterInfo.first();
const QDateTime now = QDateTime::currentDateTime();
const int seconds = now.secsTo(mCurrentInfo->dateTime());
const qint64 seconds = now.secsTo(mCurrentInfo->dateTime());
if (seconds > 0) {
//qCDebug(SENDLATERAGENT_LOG)<<" seconds"<<seconds;
mTimer->start(seconds * 1000);
......
......@@ -58,7 +58,7 @@ void KMLaunchExternalComponent::slotConfigureAutomaticArchiving()
OrgFreedesktopAkonadiArchiveMailAgentInterface archiveMailInterface(service, QStringLiteral("/ArchiveMailAgent"),
QDBusConnection::sessionBus(), this);
if (archiveMailInterface.isValid()) {
archiveMailInterface.showConfigureDialog((qlonglong)mParentWidget->winId());
archiveMailInterface.showConfigureDialog(static_cast<qlonglong>(mParentWidget->winId()));
} else {
KMessageBox::error(mParentWidget, i18n("Archive Mail Agent was not registered."));
}
......@@ -69,7 +69,7 @@ void KMLaunchExternalComponent::slotConfigureSendLater()
const QString service = akonadiPath(QStringLiteral("org.freedesktop.Akonadi.SendLaterAgent"));
OrgFreedesktopAkonadiSendLaterAgentInterface sendLaterInterface(service, QStringLiteral("/SendLaterAgent"), QDBusConnection::sessionBus(), this);
if (sendLaterInterface.isValid()) {
sendLaterInterface.showConfigureDialog((qlonglong)mParentWidget->winId());
sendLaterInterface.showConfigureDialog(static_cast<qlonglong>(mParentWidget->winId()));
} else {
KMessageBox::error(mParentWidget, i18n("Send Later Agent was not registered."));
}
......@@ -82,7 +82,7 @@ void KMLaunchExternalComponent::slotConfigureFollowupReminder()
OrgFreedesktopAkonadiFollowUpReminderAgentInterface followUpInterface(service, QStringLiteral("/FollowUpReminder"),
QDBusConnection::sessionBus(), this);
if (followUpInterface.isValid()) {
followUpInterface.showConfigureDialog((qlonglong)mParentWidget->winId());
followUpInterface.showConfigureDialog(static_cast<qlonglong>(mParentWidget->winId()));
} else {
KMessageBox::error(mParentWidget, i18n("Followup Reminder Agent was not registered."));
}
......@@ -147,5 +147,5 @@ void KMLaunchExternalComponent::slotAccountWizard()
void KMLaunchExternalComponent::slotFilterLogViewer()
{
MailCommon::FilterManager::instance()->showFilterLogDialog((qlonglong)mParentWidget->winId());
MailCommon::FilterManager::instance()->showFilterLogDialog(static_cast<qlonglong>(mParentWidget->winId()));
}
......@@ -20,7 +20,7 @@
using namespace KMail;
KMailSearchPatternEdit::KMailSearchPatternEdit(QWidget *parent)
: MailCommon::SearchPatternEdit(parent,
(MailCommon::SearchPatternEdit::SearchPatternEditOptions)(SearchPatternEdit::NotShowTags),
static_cast<MailCommon::SearchPatternEdit::SearchPatternEditOptions>(SearchPatternEdit::NotShowTags),
BalooMode)
{
}
......
......@@ -73,7 +73,7 @@ int UndoStack::newUndoAction(const Akonadi::Collection &srcFolder, const Akonadi
info->srcFolder = srcFolder;
info->destFolder = destFolder;
info->moveToTrash = (destFolder == CommonKernel->trashCollectionFolder());
if ((int)mStack.count() == mSize) {
if (static_cast<int>(mStack.count()) == mSize) {
delete mStack.last();
mStack.removeLast();
}
......
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