mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-27 23:07:11 -05: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"
|
#include "gui/MessageWidget.h"
|
||||||
|
|
||||||
// I wanted to make the CSV import GUI future-proof, so if one day you need a new field,
|
// 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!
|
// 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)
|
CsvImportWidget::CsvImportWidget(QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
@ -45,6 +37,10 @@ CsvImportWidget::CsvImportWidget(QWidget* parent)
|
|||||||
, m_parserModel(new CsvParserModel(this))
|
, m_parserModel(new CsvParserModel(this))
|
||||||
, m_comboModel(new QStringListModel(this))
|
, m_comboModel(new QStringListModel(this))
|
||||||
, m_comboMapper(new QSignalMapper(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);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ private:
|
|||||||
QList<QComboBox*> m_combos;
|
QList<QComboBox*> m_combos;
|
||||||
Database* m_db;
|
Database* m_db;
|
||||||
|
|
||||||
static const QStringList m_columnHeader;
|
const QStringList m_columnHeader;
|
||||||
QStringList m_fieldSeparatorList;
|
QStringList m_fieldSeparatorList;
|
||||||
void configParser();
|
void configParser();
|
||||||
void updateTableview();
|
void updateTableview();
|
||||||
|
@ -30,17 +30,13 @@
|
|||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
#include "core/Metadata.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)
|
EntryModel::EntryModel(QObject* parent)
|
||||||
: QAbstractTableModel(parent)
|
: QAbstractTableModel(parent)
|
||||||
, m_group(nullptr)
|
, m_group(nullptr)
|
||||||
, m_hideUsernames(false)
|
, m_hideUsernames(false)
|
||||||
, m_hidePasswords(true)
|
, m_hidePasswords(true)
|
||||||
|
, HiddenContentDisplay(QString("\u25cf").repeated(6))
|
||||||
|
, DateFormat(Qt::DefaultLocaleShortDate)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,8 +100,8 @@ private:
|
|||||||
|
|
||||||
QPixmap m_paperClipPixmap;
|
QPixmap m_paperClipPixmap;
|
||||||
|
|
||||||
static const QString HiddenContentDisplay;
|
const QString HiddenContentDisplay;
|
||||||
static const Qt::DateFormat DateFormat;
|
const Qt::DateFormat DateFormat;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KEEPASSX_ENTRYMODEL_H
|
#endif // KEEPASSX_ENTRYMODEL_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user