|
|
@ -19,7 +19,7 @@
|
|
|
|
using namespace std::chrono;
|
|
|
|
using namespace std::chrono;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WalletKeysFiles::WalletKeysFiles(const QFileInfo &info, quint8 networkType, QString address) :
|
|
|
|
WalletKeysFiles::WalletKeysFiles(const QFileInfo &info, int networkType, QString address) :
|
|
|
|
m_fileName(info.fileName()),
|
|
|
|
m_fileName(info.fileName()),
|
|
|
|
m_modified(info.lastModified().toSecsSinceEpoch()),
|
|
|
|
m_modified(info.lastModified().toSecsSinceEpoch()),
|
|
|
|
m_path(QDir::toNativeSeparators(info.absoluteFilePath())),
|
|
|
|
m_path(QDir::toNativeSeparators(info.absoluteFilePath())),
|
|
|
@ -42,7 +42,7 @@ QString WalletKeysFiles::path() const {
|
|
|
|
return m_path;
|
|
|
|
return m_path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
quint8 WalletKeysFiles::networkType() const {
|
|
|
|
int WalletKeysFiles::networkType() const {
|
|
|
|
return m_networkType;
|
|
|
|
return m_networkType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -168,7 +168,7 @@ QVariant WalletKeysFilesModel::data(const QModelIndex &index, int role) const {
|
|
|
|
} else if(role == Qt::UserRole) {
|
|
|
|
} else if(role == Qt::UserRole) {
|
|
|
|
switch(index.column()) {
|
|
|
|
switch(index.column()) {
|
|
|
|
case ModelColumns::NetworkType:
|
|
|
|
case ModelColumns::NetworkType:
|
|
|
|
return static_cast<uint>(walletKeyFile.networkType());
|
|
|
|
return static_cast<int>(walletKeyFile.networkType());
|
|
|
|
case ModelColumns::FileName:
|
|
|
|
case ModelColumns::FileName:
|
|
|
|
return walletKeyFile.fileName();
|
|
|
|
return walletKeyFile.fileName();
|
|
|
|
case ModelColumns::Modified:
|
|
|
|
case ModelColumns::Modified:
|
|
|
@ -201,9 +201,15 @@ QVariant WalletKeysFilesModel::headerData(int section, Qt::Orientation orientati
|
|
|
|
return QVariant();
|
|
|
|
return QVariant();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WalletKeysFilesProxyModel::WalletKeysFilesProxyModel(QObject *parent) :
|
|
|
|
WalletKeysFilesProxyModel::WalletKeysFilesProxyModel(QObject *parent, NetworkType::Type nettype)
|
|
|
|
QSortFilterProxyModel(parent) {}
|
|
|
|
: QSortFilterProxyModel(parent)
|
|
|
|
|
|
|
|
, m_nettype(nettype)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool WalletKeysFilesProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const {
|
|
|
|
bool WalletKeysFilesProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const {
|
|
|
|
return true;
|
|
|
|
QModelIndex nettypeIndex = sourceModel()->index(sourceRow, WalletKeysFilesModel::NetworkType, sourceParent);
|
|
|
|
|
|
|
|
NetworkType::Type nettype = static_cast<NetworkType::Type>(sourceModel()->data(nettypeIndex, Qt::UserRole).toInt());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (m_nettype == nettype);
|
|
|
|
}
|
|
|
|
}
|