diff --git a/src/gui/csvImport/CsvImportWidget.cpp b/src/gui/csvImport/CsvImportWidget.cpp index 2997b4c9f..45e0da247 100644 --- a/src/gui/csvImport/CsvImportWidget.cpp +++ b/src/gui/csvImport/CsvImportWidget.cpp @@ -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); diff --git a/src/gui/csvImport/CsvImportWidget.h b/src/gui/csvImport/CsvImportWidget.h index 721a8988f..2a68c95e9 100644 --- a/src/gui/csvImport/CsvImportWidget.h +++ b/src/gui/csvImport/CsvImportWidget.h @@ -66,7 +66,7 @@ private: QList m_combos; Database* m_db; - static const QStringList m_columnHeader; + const QStringList m_columnHeader; QStringList m_fieldSeparatorList; void configParser(); void updateTableview(); diff --git a/src/gui/entry/EntryModel.cpp b/src/gui/entry/EntryModel.cpp index aa61a4068..d3859e498 100644 --- a/src/gui/entry/EntryModel.cpp +++ b/src/gui/entry/EntryModel.cpp @@ -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) { } diff --git a/src/gui/entry/EntryModel.h b/src/gui/entry/EntryModel.h index 4fc765044..1965066a1 100644 --- a/src/gui/entry/EntryModel.h +++ b/src/gui/entry/EntryModel.h @@ -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