Commit 6c98c05e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Modernize code

parent 3604a4ec
Pipeline #60777 passed with stage
in 9 minutes and 1 second
......@@ -18,9 +18,9 @@ SelectThunderbirdProfileDialogTest::SelectThunderbirdProfileDialogTest(QObject *
void SelectThunderbirdProfileDialogTest::shouldHaveDefaultValue()
{
MailImporter::SelectThunderbirdProfileDialog dlg;
auto *widget = dlg.findChild<MailImporter::SelectThunderbirdProfileWidget *>(QStringLiteral("selectprofile"));
auto widget = dlg.findChild<MailImporter::SelectThunderbirdProfileWidget *>(QStringLiteral("selectprofile"));
QVERIFY(widget);
auto *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonBox"));
auto buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonBox"));
QVERIFY(buttonBox);
}
......
......@@ -176,7 +176,7 @@ void FilterKMailArchive::importMails(const QString &archiveFile)
QMimeDatabase db;
QMimeType mimeType = db.mimeTypeForFile(archiveFile, QMimeDatabase::MatchExtension);
typedef QSharedPointer<KArchive> KArchivePtr;
using KArchivePtr = QSharedPointer<KArchive>;
KArchivePtr archive;
if (!mimeType.globPatterns().filter(QStringLiteral("tar"), Qt::CaseInsensitive).isEmpty()) {
archive = KArchivePtr(new KTar(archiveFile));
......
......@@ -64,10 +64,10 @@ private:
3. ID of current folder
4. ID of parent folder
*/
typedef FolderStructureBase<4> FolderStructure;
using FolderStructure = FolderStructureBase<4>;
/** matrix with information about the folder structure*/
QList<FolderStructure> folderStructure;
typedef QList<FolderStructure>::Iterator FolderStructureIterator;
using FolderStructureIterator = QList<FolderStructure>::Iterator;
/** name of the current folder */
QString folderName;
......
......@@ -45,7 +45,7 @@ private:
QDir dir;
/** Folder structure here has 5 entries. */
typedef FolderStructureBase<5> FolderStructure;
using FolderStructure = FolderStructureBase<5>;
/** List with the folder matrix, which contains following strings:
1. type (2 for root-folder, 1 for folder, 0 for mailarchiv)
2. type (1 for root-folder, 3 for folder, 0 for mailarchiv)
......@@ -54,7 +54,7 @@ private:
5. name of folder/archiv
*/
QList<FolderStructure> folderMatrix;
typedef QList<FolderStructure>::Iterator FolderStructureIterator;
using FolderStructureIterator = QList<FolderStructure>::Iterator;
bool folderParsed = false;
......
......@@ -25,7 +25,7 @@ SelectThunderbirdProfileDialog::SelectThunderbirdProfileDialog(QWidget *parent)
mSelectProfile->setObjectName(QStringLiteral("selectprofile"));
topLayout->addWidget(mSelectProfile);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonBox"));
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
......
......@@ -223,7 +223,7 @@ bool FilterImporterAkonadi::checkForDuplicates(const QString &msgID, const Akona
if (!messageItem.hasPayload<KMime::Message::Ptr>()) {
continue;
}
const KMime::Message::Ptr message = messageItem.payload<KMime::Message::Ptr>();
const auto message = messageItem.payload<KMime::Message::Ptr>();
const KMime::Headers::Base *messageID = message->messageID(false);
if (messageID) {
if (!messageID->isEmpty()) {
......
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