X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;ds=sidebyside;f=src%2Fapps%2FPswGen%2FStorage%2Fistorage.h;h=add6f7a342d7a496835b0dfb69f062b6a3391da7;hb=refs%2Fheads%2Fmaster;hp=6560553fd0d3516a6200359b7f5e93f480ad2774;hpb=4a856bc600d1819e01c797881e0591810737c2fd;p=evaf
diff --git a/src/apps/PswGen/Storage/istorage.h b/src/apps/PswGen/Storage/istorage.h
index 6560553..add6f7a 100644
--- a/src/apps/PswGen/Storage/istorage.h
+++ b/src/apps/PswGen/Storage/istorage.h
@@ -3,7 +3,7 @@
* @brief Interface for password storage modules
* @author Enar Vaikene
*
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
*
* This file is part of the eVaf C++ cross-platform application development framework.
*
@@ -20,8 +20,6 @@
#ifndef __PSWGEN_STORAGE_ISTORAGE_H
# define __PSWGEN_STORAGE_ISTORAGE_H
-#include "lib.h"
-
#include
#include
#include
@@ -37,24 +35,41 @@ namespace Storage {
/**
* Data stored for every password.
*/
-class PSWGEN_STORAGE_EXPORT Data : public QSharedData
+class Data : public QSharedData
{
public:
- Data()
+ Data(QString const & name)
: QSharedData()
, mModified(false)
+ , mName(name)
+ , mSuffix()
, mLength(0)
, mFlags(0)
{}
- Data(int l, uint f = 0)
+ Data(QString const & name, QString const & suffix, int l, uint f = 0)
: QSharedData()
, mModified(false)
+ , mName(name)
+ , mSuffix(suffix)
, mLength(l)
, mFlags(f)
{}
+ /// Name of the password
+ inline QString const & name() const { return mName; }
+
+ /// Optional suffix added to the name
+ inline QString const & suffix() const { return mSuffix; }
+ void setSuffix(QString const & suffix)
+ {
+ if (suffix != mSuffix) {
+ mSuffix = suffix;
+ mModified = true;
+ }
+ }
+
/// Length of the generated password
inline int length() const { return mLength; }
inline void setLength(int value)
@@ -85,6 +100,8 @@ public:
private:
bool mModified;
+ QString mName;
+ QString mSuffix;
int mLength;
uint mFlags;
@@ -100,6 +117,11 @@ private:
struct iStorage
{
+ /**
+ * Empty virtual destructor
+ */
+ ~iStorage() {}
+
/**
* Saves the data record
* @param name Name of the password