#include <FileModel.hpp>
|
| ~FileModel () |
|
| FileModel (QObject *parent=nullptr) |
| Including QT Headers.
|
|
| FileModel (QList< QStringList > const &FileList, QObject *parent=nullptr) |
|
int | rowCount (const QModelIndex &parent) const |
|
int | columnCount (const QModelIndex &parent) const |
|
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
|
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
|
Qt::ItemFlags | flags (const QModelIndex &index) const |
|
QString | GetFullFileName (QString &FileName) |
|
QList< QStringList > | GetFilesInfo () const |
|
Definition at line 11 of file FileModel.hpp.
◆ ~FileModel()
dbe::FileModel::~FileModel |
( |
| ) |
|
◆ FileModel() [1/2]
dbe::FileModel::FileModel |
( |
QObject * | parent = nullptr | ) |
|
|
explicit |
Including QT Headers.
Including DBE Headers
Definition at line 12 of file FileModel.cpp.
13 : QAbstractTableModel ( parent ),
15{ tr ( "Name" ), tr ( "Folder" ), tr ( "Permission" ) }
16{
20}
◆ FileModel() [2/2]
dbe::FileModel::FileModel |
( |
QList< QStringList > const & | FileList, |
|
|
QObject * | parent = nullptr ) |
|
explicit |
Definition at line 22 of file FileModel.cpp.
23 : QAbstractTableModel ( parent ),
26{ tr ( "Name" ), tr ( "Folder" ), tr ( "Permission" ) }
27{
29}
QList< QStringList > IncludedFiles
◆ columnCount()
int dbe::FileModel::columnCount |
( |
const QModelIndex & | parent | ) |
const |
Definition at line 44 of file FileModel.cpp.
45{
46 Q_UNUSED ( parent )
48}
◆ data()
QVariant dbe::FileModel::data |
( |
const QModelIndex & | index, |
|
|
int | role = Qt::DisplayRole ) const |
Definition at line 50 of file FileModel.cpp.
51{
52 if (
index.isValid() )
53 {
54 if ( role == Qt::DisplayRole )
55 return QVariant (
57 }
58
59 return QVariant();
60}
◆ FileCacheReady
void dbe::FileModel::FileCacheReady |
( |
QList< QStringList > & | Files | ) |
|
|
signal |
◆ flags()
Qt::ItemFlags dbe::FileModel::flags |
( |
const QModelIndex & | index | ) |
const |
Definition at line 81 of file FileModel.cpp.
82{
85 {
86 return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
87 }
88
89 return Qt::ItemIsSelectable;
90}
◆ GetFilesInfo()
QList< QStringList > dbe::FileModel::GetFilesInfo |
( |
| ) |
const |
◆ GetFullFileName()
QString dbe::FileModel::GetFullFileName |
( |
QString & | FileName | ) |
|
Definition at line 120 of file FileModel.cpp.
121{
122 QFileInfo FileInfo ( FileName );
123
124 if ( FileInfo.isRelative() )
125 {
126
128 {
129 QDir TdaqFolder ( Folder );
130
131 if ( TdaqFolder.exists ( FileName ) )
132 {
133 FileName = TdaqFolder.path() + "/" + FileName;
134 break;
135 }
136 }
137 }
138
139 return FileName;
140}
QStringList FolderPathList
◆ headerData()
QVariant dbe::FileModel::headerData |
( |
int | section, |
|
|
Qt::Orientation | orientation, |
|
|
int | role = Qt::DisplayRole ) const |
Definition at line 62 of file FileModel.cpp.
64{
65 if ( role == Qt::DisplayRole )
66 {
67 if ( orientation == Qt::Horizontal )
68 {
70 }
71
72 if ( orientation == Qt::Vertical )
73 {
75 }
76 }
77
78 return QVariant();
79}
Missing configuration section
Message.
◆ initconnections()
void dbe::FileModel::initconnections |
( |
| ) |
|
|
private |
Definition at line 114 of file FileModel.cpp.
115{
117 SLOT ( GetFileCache ( QList<QStringList> & ) ) );
118}
void FileCacheReady(QList< QStringList > &Files)
static confaccessor & ref()
◆ initmodel()
void dbe::FileModel::initmodel |
( |
| ) |
|
|
private |
Definition at line 147 of file FileModel.cpp.
148{
151
152 for ( QString const & source : sources )
153 {
154
155 QFileInfo srcinfo ( source );
156 QString fn = srcinfo.filePath();
157
159 {
160 if ( fn.startsWith ( path ) )
161 {
162 fn = fn.replace ( 0, path.size(), "" );
163 break;
164 }
165 }
166
168 }
169
171 {
173 }
174}
static bool check_file_rw(const QString &FileName)
static QString dbfullname()
static QStringList inclusions(QStringList const &candidates, QStringList files={ })
◆ initpaths()
void dbe::FileModel::initpaths |
( |
| ) |
|
|
private |
Definition at line 92 of file FileModel.cpp.
93{
94 QString TDAQ_DB_REPOSITORY = getenv ( "TDAQ_DB_REPOSITORY" );
95 if(TDAQ_DB_REPOSITORY.isEmpty() == false) {
96 QString TDAQ_DB_USER_REPOSITORY = getenv ( "TDAQ_DB_USER_REPOSITORY" );
97 FolderPathList = TDAQ_DB_USER_REPOSITORY.split (
":", QString::SkipEmptyParts );
98
100 } else {
101 QString DUNEDAQ_DB_PATH = getenv ( "DUNEDAQ_DB_PATH" );
102 FolderPathList = DUNEDAQ_DB_PATH.split (
":", QString::SkipEmptyParts );
103 }
104
106 {
107 if ( !PathName.endsWith ( "/" ) )
108 {
109 PathName.append ( "/" );
110 }
111 }
112}
QString find_db_repository_dir()
static MainWindow * findthis()
◆ rowCount()
int dbe::FileModel::rowCount |
( |
const QModelIndex & | parent | ) |
const |
Definition at line 34 of file FileModel.cpp.
35{
36 if ( !parent.isValid() )
37 {
39 }
40
41 return 0;
42}
◆ FolderPathList
QStringList dbe::FileModel::FolderPathList |
|
private |
◆ Headers
QStringList dbe::FileModel::Headers |
|
private |
◆ IncludedFiles
QList<QStringList> dbe::FileModel::IncludedFiles |
|
private |
The documentation for this class was generated from the following files:
- /github/workspace/dunedaq/sourcecode/dbe/include/dbe/FileModel.hpp
- /github/workspace/dunedaq/sourcecode/dbe/src/structure/FileModel.cpp