mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Convert private static vars into member vars
* CSV Import and Entry Model
This commit is contained in:
parent
53a17c2355
commit
b74fb3e208
@ -28,16 +28,8 @@
|
||||
#include "gui/MessageWidget.h"
|
||||
|
||||
// I wanted to make the CSV import GUI future-proof, so if one day you need a new field,
|
||||
// all you have to do is uncomment a row or two here, and the GUI will follow:
|
||||
// all you have to do is add a field to m_columnHeader, and the GUI will follow:
|
||||
// dynamic generation of comboBoxes, labels, placement and so on. Try it for immense fun!
|
||||
const QStringList CsvImportWidget::m_columnHeader =
|
||||
QStringList() << QObject::tr("Group") << QObject::tr("Title") << QObject::tr("Username") << QObject::tr("Password")
|
||||
<< QObject::tr("URL") << QObject::tr("Notes") << QObject::tr("Last Modified")
|
||||
<< QObject::tr("Created")
|
||||
// << QObject::tr("Future field1")
|
||||
// << QObject::tr("Future field2")
|
||||
// << QObject::tr("Future field3")
|
||||
;
|
||||
|
||||
CsvImportWidget::CsvImportWidget(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
@ -45,6 +37,10 @@ CsvImportWidget::CsvImportWidget(QWidget* parent)
|
||||
, m_parserModel(new CsvParserModel(this))
|
||||
, m_comboModel(new QStringListModel(this))
|
||||
, m_comboMapper(new QSignalMapper(this))
|
||||
, m_columnHeader(QStringList() << QObject::tr("Group") << QObject::tr("Title") << QObject::tr("Username")
|
||||
<< QObject::tr("Password") << QObject::tr("URL") << QObject::tr("Notes")
|
||||
<< QObject::tr("Last Modified") << QObject::tr("Created")
|
||||
/* << QObject::tr("Future field1") */ )
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
|
@ -66,7 +66,7 @@ private:
|
||||
QList<QComboBox*> m_combos;
|
||||
Database* m_db;
|
||||
|
||||
static const QStringList m_columnHeader;
|
||||
const QStringList m_columnHeader;
|
||||
QStringList m_fieldSeparatorList;
|
||||
void configParser();
|
||||
void updateTableview();
|
||||
|
@ -30,17 +30,13 @@
|
||||
#include "core/Group.h"
|
||||
#include "core/Metadata.h"
|
||||
|
||||
// String being displayed when hiding content
|
||||
const QString EntryModel::HiddenContentDisplay(QString("\u25cf").repeated(6));
|
||||
|
||||
// Format used to display dates
|
||||
const Qt::DateFormat EntryModel::DateFormat = Qt::DefaultLocaleShortDate;
|
||||
|
||||
EntryModel::EntryModel(QObject* parent)
|
||||
: QAbstractTableModel(parent)
|
||||
, m_group(nullptr)
|
||||
, m_hideUsernames(false)
|
||||
, m_hidePasswords(true)
|
||||
, HiddenContentDisplay(QString("\u25cf").repeated(6))
|
||||
, DateFormat(Qt::DefaultLocaleShortDate)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -100,8 +100,8 @@ private:
|
||||
|
||||
QPixmap m_paperClipPixmap;
|
||||
|
||||
static const QString HiddenContentDisplay;
|
||||
static const Qt::DateFormat DateFormat;
|
||||
const QString HiddenContentDisplay;
|
||||
const Qt::DateFormat DateFormat;
|
||||
};
|
||||
|
||||
#endif // KEEPASSX_ENTRYMODEL_H
|
||||
|
Loading…
Reference in New Issue
Block a user