Password is no longer saved with the connection list. Password is not entered along with other connection credentials. Password is now asked for when required. Still working on saving the password and auto retrieving it from the password manager.
49 lines
967 B
C++
49 lines
967 B
C++
#ifndef CONNECTIONLIST_H
|
|
#define CONNECTIONLIST_H
|
|
|
|
#include "ConnectionConfig.h"
|
|
|
|
#include <QString>
|
|
#include <QUuid>
|
|
#include <vector>
|
|
#include "Expected.h"
|
|
|
|
class ConnectionList {
|
|
public:
|
|
|
|
ConnectionList();
|
|
size_t size() const { return m_connections.size(); }
|
|
|
|
ConnectionConfig& getConfigByIdx(size_t idx)
|
|
{
|
|
return m_connections.at(idx);
|
|
}
|
|
|
|
size_t createNew();
|
|
|
|
void remove(size_t idx, size_t count);
|
|
|
|
void load();
|
|
void save();
|
|
void save(size_t index);
|
|
|
|
private:
|
|
// class LijstElem {
|
|
// public:
|
|
// QUuid m_uuid; ///< Unique identifier, used as a key for storing password in psk db.
|
|
// ConnectionConfig m_config;
|
|
|
|
// LijstElem(const QUuid id, const ConnectionConfig &cfg)
|
|
// : m_uuid(id), m_config(cfg)
|
|
// {}
|
|
// };
|
|
|
|
using t_Connections = std::vector<ConnectionConfig>;
|
|
t_Connections m_connections;
|
|
|
|
void deleteFromIni(t_Connections::iterator begin, t_Connections::iterator end);
|
|
|
|
static QString iniFileName();
|
|
};
|
|
|
|
#endif // CONNECTIONLIST_H
|