File indexing completed on 2024-10-27 04:51:11
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <KActionMenu> 0010 0011 class AgentIdentifier 0012 { 0013 public: 0014 AgentIdentifier() = default; 0015 0016 AgentIdentifier(const QString &identifier, const QString &name, int index = -1) 0017 : mIdentifier(identifier) 0018 , mName(name) 0019 , mIndex(index) 0020 { 0021 } 0022 0023 QString mIdentifier; 0024 QString mName; 0025 int mIndex = -1; 0026 }; 0027 0028 class KActionMenuAccount : public KActionMenu 0029 { 0030 Q_OBJECT 0031 public: 0032 explicit KActionMenuAccount(QObject *parent = nullptr); 0033 ~KActionMenuAccount() override; 0034 0035 void setAccountOrder(const QStringList &identifier); 0036 0037 private: 0038 void updateAccountMenu(); 0039 void slotCheckTransportMenu(); 0040 void slotSelectAccount(QAction *act); 0041 0042 QStringList mOrderIdentifier; 0043 bool mInitialized = false; 0044 };