Commit 11bb55b8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Don't rely on implicit QScopedPointer to bool conversion

No longer available in Qt6.
parent 6a862864
Pipeline #150314 failed with stage
in 5 minutes and 25 seconds
......@@ -132,7 +132,7 @@ ArchiveFolderDialog::ArchiveFolderDialog(QWidget *parent)
bool canRemoveFolder(const Akonadi::Collection &col)
{
const QSharedPointer<FolderSettings> folder = FolderSettings::forCollection(col, false);
return folder && col.isValid() && !col.isVirtual() && (col.rights() & Akonadi::Collection::CanDeleteCollection) && !folder->isStructural()
return !folder.isNull() && col.isValid() && !col.isVirtual() && (col.rights() & Akonadi::Collection::CanDeleteCollection) && !folder->isStructural()
&& !folder->isSystemFolder();
}
......
......@@ -2443,7 +2443,7 @@ void KMComposerWin::slotFetchJob(KJob *job)
const QString resourceName = parentCollection.resource();
if (!resourceName.isEmpty()) {
QSharedPointer<MailCommon::FolderSettings> fd(MailCommon::FolderSettings::forCollection(parentCollection, false));
if (fd) {
if (!fd.isNull()) {
identity = fd->identity();
}
}
......
......@@ -329,7 +329,7 @@ void KMReaderMainWin::slotForwardInlineMsg()
const Akonadi::Collection parentCol = mReaderWin->messageItem().parentCollection();
if (parentCol.isValid()) {
QSharedPointer<FolderSettings> fd = FolderSettings::forCollection(parentCol, false);
if (fd) {
if (!fd.isNull()) {
command = new KMForwardCommand(this, mReaderWin->messageItem(), fd->identity(), QString(), mReaderWin->copyText());
} else {
command = new KMForwardCommand(this, mReaderWin->messageItem(), 0, QString(), mReaderWin->copyText());
......@@ -350,7 +350,7 @@ void KMReaderMainWin::slotForwardAttachedMessage()
const Akonadi::Collection parentCol = mReaderWin->messageItem().parentCollection();
if (parentCol.isValid()) {
QSharedPointer<FolderSettings> fd = FolderSettings::forCollection(parentCol, false);
if (fd) {
if (!fd.isNull()) {
command = new KMForwardAttachedCommand(this, mReaderWin->messageItem(), fd->identity());
} else {
command = new KMForwardAttachedCommand(this, mReaderWin->messageItem());
......@@ -372,7 +372,7 @@ void KMReaderMainWin::slotNewMessageToRecipients()
job->setCurrentCollection(parentCol);
QSharedPointer<FolderSettings> fd = FolderSettings::forCollection(parentCol, false);
if (fd) {
if (!fd.isNull()) {
job->setFolderSettings(fd);
}
}
......
......@@ -46,7 +46,7 @@ bool CollectionStorageModel::isOutBoundFolder(const Akonadi::Collection &c) cons
return c.attribute<Akonadi::MessageFolderAttribute>()->isOutboundFolder();
}
QSharedPointer<FolderSettings> fd = FolderSettings::forCollection(c, false);
if (fd) {
if (!fd.isNull()) {
const QString folderId(QString::number(c.id()));
// default setting
const KIdentityManagement::Identity &identity = kmkernel->identityManager()->identityForUoidOrDefault(fd->identity());
......
Supports Markdown
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