File indexing completed on 2024-11-24 04:50:43

0001 // SPDX-FileCopyrightText: 2023 Carl Schwan <carl@carlschwan.eu>
0002 // SPDX-License-Identifier: LGPL-3.0-or-later
0003 
0004 #include "mailapplication.h"
0005 #include <KAuthorized>
0006 #include <KLocalizedString>
0007 #include <QIcon>
0008 
0009 MailApplication::MailApplication(QObject *parent)
0010     : AbstractApplication(parent)
0011 {
0012     setupActions();
0013 }
0014 
0015 void MailApplication::setupActions()
0016 {
0017     AbstractApplication::setupActions();
0018 
0019     auto actionName = QLatin1StringView("create_mail");
0020     if (KAuthorized::authorizeAction(actionName)) {
0021         auto action = mCollection->addAction(actionName, this, &MailApplication::createNewMail);
0022         action->setText(i18n("New Mail…"));
0023         action->setIcon(QIcon::fromTheme(QStringLiteral("mail-message-new")));
0024     }
0025 
0026     mCollection->readSettings();
0027 }
0028 
0029 QList<KActionCollection *> MailApplication::actionCollections() const
0030 {
0031     return {
0032         mCollection,
0033     };
0034 }
0035 
0036 #include "moc_mailapplication.cpp"