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 49243192 authored by Laurent Montel's avatar Laurent Montel 😁

Fix warning. Use static_cast. Avoid to shadow variable etc.

parent 4903715b
......@@ -92,7 +92,7 @@ public:
int mStatusCode;
QString mStatusMessage;
uint mProgress;
int mProgress;
QString mProgressMessage;
bool mNeedsNetwork;
......
......@@ -51,7 +51,7 @@ void TransportResourceBasePrivate::fetchResult(KJob *job)
{
if (job->error()) {
const Item::Id id = job->property("id").toLongLong();
emit transportResult(id, (int)TransportResourceBase::TransportFailed, job->errorText());
emit transportResult(id, static_cast<int>(TransportResourceBase::TransportFailed), job->errorText());
return;
}
......
......@@ -249,7 +249,8 @@ void ProcessControl::start()
qCDebug(AKONADICONTROL_LOG) << "'gdb --pid" << pid << "' to debug";
qCDebug(AKONADICONTROL_LOG) << "'kill -SIGCONT" << pid << "' to continue";
kill(pid, SIGSTOP);
#else defined(Q_OS_WIN)
#endif
#ifdef Q_OS_WIN
qCDebug(AKONADICONTROL_LOG) << "PID:" << pid;
qCDebug(AKONADICONTROL_LOG) << "Process is waiting for a debugger...";
// the agent process will wait for a debugger to be attached in AgentBase::debugAgent()
......
......@@ -41,7 +41,7 @@ public:
Item::List mItems;
Collection mCollection;
Tag mTag;
Tag mCurrentTag;
};
......@@ -90,7 +90,7 @@ ItemDeleteJob::ItemDeleteJob(const Tag &tag, QObject *parent)
{
Q_D(ItemDeleteJob);
d->mTag = tag;
d->mCurrentTag = tag;
}
ItemDeleteJob::~ItemDeleteJob()
......@@ -111,7 +111,7 @@ void ItemDeleteJob::doStart()
try {
d->sendCommand(Protocol::DeleteItemsCommandPtr::create(
d->mItems.isEmpty() ? Scope() : ProtocolHelper::entitySetToScope(d->mItems),
ProtocolHelper::commandContextToProtocol(d->mCollection, d->mTag, d->mItems)));
ProtocolHelper::commandContextToProtocol(d->mCollection, d->mCurrentTag, d->mItems)));
} catch (const Akonadi::Exception &e) {
setError(Job::Unknown);
setErrorText(QString::fromUtf8(e.what()));
......
......@@ -110,7 +110,7 @@ public:
Q_DECLARE_PUBLIC(ItemFetchJob)
Collection mCollection;
Tag mTag;
Tag mCurrentTag;
Item::List mRequestedItems;
Item::List mResultItems;
ItemFetchScope mFetchScope;
......@@ -179,7 +179,7 @@ ItemFetchJob::ItemFetchJob(const Tag &tag, QObject *parent)
Q_D(ItemFetchJob);
d->init();
d->mTag = tag;
d->mCurrentTag = tag;
d->mValuePool = new ProtocolHelperValuePool;
}
......@@ -194,7 +194,7 @@ void ItemFetchJob::doStart()
try {
d->sendCommand(Protocol::FetchItemsCommandPtr::create(
d->mRequestedItems.isEmpty() ? Scope() : ProtocolHelper::entitySetToScope(d->mRequestedItems),
ProtocolHelper::commandContextToProtocol(d->mCollection, d->mTag, d->mRequestedItems),
ProtocolHelper::commandContextToProtocol(d->mCollection, d->mCurrentTag, d->mRequestedItems),
ProtocolHelper::itemFetchScopeToProtocol(d->mFetchScope)));
} catch (const Akonadi::Exception &e) {
setError(Job::Unknown);
......
......@@ -31,10 +31,10 @@ class SearchResultJobPrivate : public Akonadi::JobPrivate
public:
SearchResultJobPrivate(SearchResultJob *parent);
QVector<QByteArray> rid;
QByteArray searchId;
Collection collection;
ImapSet uid;
QVector<QByteArray> rid;
// JobPrivate interface
public:
......
......@@ -237,20 +237,20 @@ public:
DefaultResourceJob *const q;
KCoreConfigSkeleton *mSettings = nullptr;
bool mResourceWasPreexisting = true;
int mPendingModifyJobs = 0;
QString mDefaultResourceType;
QVariantMap mDefaultResourceOptions;
QList<QByteArray> mKnownTypes;
QMap<QByteArray, QString> mNameForTypeMap;
QMap<QByteArray, QString> mIconForTypeMap;
QString mDefaultResourceType;
int mPendingModifyJobs = 0;
bool mResourceWasPreexisting = true;
};
DefaultResourceJobPrivate::DefaultResourceJobPrivate(KCoreConfigSkeleton *settings, DefaultResourceJob *qq)
: q(qq)
, mSettings(settings)
, mResourceWasPreexisting(true /* for safety, so as not to accidentally delete data */)
, mPendingModifyJobs(0)
, mResourceWasPreexisting(true /* for safety, so as not to accidentally delete data */)
{
}
......
......@@ -319,7 +319,7 @@ QAction *AgentActionManager::createAction(Type type)
void AgentActionManager::createAllActions()
{
for (int type = 0; type < LastType; ++type) {
createAction((Type)type);
createAction(static_cast<Type>(type));
}
}
......
......@@ -173,13 +173,13 @@ public:
EntityTreeView *mView = nullptr;
AsyncSelectionHandler *mSelectionHandler = nullptr;
QLabel *mTextLabel = nullptr;
bool mAllowToCreateNewChildCollection = false;
bool mKeepTreeExpanded = false;
KRecursiveFilterProxyModel *mFilterCollection = nullptr;
QCheckBox *mUseByDefault = nullptr;
QStringList mContentMimeTypes;
QDialogButtonBox *mButtonBox = nullptr;
QPushButton *mNewSubfolderButton = nullptr;
bool mAllowToCreateNewChildCollection = false;
bool mKeepTreeExpanded = false;
void slotDoubleClicked();
void slotSelectionChanged();
......
......@@ -55,7 +55,7 @@ public:
QStringLiteral("/"),
QStringLiteral("org.freedesktop.Akonadi.Indexer"));
if (indexingAgentIface.isValid()) {
indexingAgentIface.call(QStringLiteral("reindexCollection"), (qlonglong)currentCollection.id());
indexingAgentIface.call(QStringLiteral("reindexCollection"), static_cast<qlonglong>(currentCollection.id()));
ui.indexedCountLbl->setText(i18n("Remember that indexing can take some minutes."));
} else {
qCWarning(AKONADIWIDGETS_LOG) << "indexer interface not valid";
......
......@@ -120,8 +120,8 @@ QStandardItem *SelfTestDialog::report(ResultType type, const KLocalizedString &s
item->setIcon(QIcon::fromTheme(QStringLiteral("dialog-warning")));
break;
case Error:
default:
item->setIcon(QIcon::fromTheme(QStringLiteral("dialog-error")));
break;
}
item->setEditable(false);
item->setWhatsThis(details.toString());
......
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