#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 13 of file FileModel.cpp.
14 : QAbstractTableModel ( parent ),
16{ tr ( "Name" ), tr ( "Folder" ), tr ( "Access" ), tr ( "Status" ) }
17{
21}
◆ FileModel() [2/2]
| dbe::FileModel::FileModel |
( |
QList< QStringList > const & | FileList, |
|
|
QObject * | parent = nullptr ) |
|
explicit |
Definition at line 23 of file FileModel.cpp.
24 : QAbstractTableModel ( parent ),
27{ tr ( "Name" ), tr ( "Folder" ), tr ( "Access" ), tr ( "Status" ) }
28{
30}
QList< QStringList > IncludedFiles
◆ columnCount()
| int dbe::FileModel::columnCount |
( |
const QModelIndex & | parent | ) |
const |
Definition at line 45 of file FileModel.cpp.
46{
47 Q_UNUSED ( parent )
49}
◆ data()
| QVariant dbe::FileModel::data |
( |
const QModelIndex & | index, |
|
|
int | role = Qt::DisplayRole ) const |
Definition at line 51 of file FileModel.cpp.
52{
53 if (
index.isValid() )
54 {
55 if ( role == Qt::DisplayRole ) {
56 return QVariant (
58 }
59 if ( role == Qt::ForegroundRole )
60 {
64 }
65 }
66 if ( role == Qt::BackgroundRole )
67 {
71 }
72 }
73 }
74
75 return QVariant();
76}
static QColor FileReadOnlyForeground
static QColor FileReadOnlyBackground
◆ FileCacheReady
| void dbe::FileModel::FileCacheReady |
( |
QList< QStringList > & | Files | ) |
|
|
signal |
◆ flags()
| Qt::ItemFlags dbe::FileModel::flags |
( |
const QModelIndex & | index | ) |
const |
Definition at line 97 of file FileModel.cpp.
98{
99
100
101
102 return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
103
104
105
106}
◆ GetFilesInfo()
| QList< QStringList > dbe::FileModel::GetFilesInfo |
( |
| ) |
const |
◆ GetFullFileName()
| QString dbe::FileModel::GetFullFileName |
( |
QString & | FileName | ) |
|
Definition at line 136 of file FileModel.cpp.
137{
138 QFileInfo FileInfo ( FileName );
139
140 if ( FileInfo.isRelative() )
141 {
142 bool found=false;
144 {
145 QDir TdaqFolder ( Folder );
146
147 if ( TdaqFolder.exists ( FileName ) )
148 {
149 FileName = TdaqFolder.path() + "/" + FileName;
150 found=true;
151 break;
152 }
153 }
154 if (!found) {
155 FileName = FileInfo.absoluteFilePath();
156 }
157 }
158
159 return FileName;
160}
QStringList FolderPathList
◆ headerData()
| QVariant dbe::FileModel::headerData |
( |
int | section, |
|
|
Qt::Orientation | orientation, |
|
|
int | role = Qt::DisplayRole ) const |
Definition at line 78 of file FileModel.cpp.
80{
81 if ( role == Qt::DisplayRole )
82 {
83 if ( orientation == Qt::Horizontal )
84 {
86 }
87
88 if ( orientation == Qt::Vertical )
89 {
91 }
92 }
93
94 return QVariant();
95}
Missing configuration section
Message.
◆ initconnections()
| void dbe::FileModel::initconnections |
( |
| ) |
|
|
private |
Definition at line 130 of file FileModel.cpp.
131{
133 SLOT ( GetFileCache ( QList<QStringList> & ) ) );
134}
void FileCacheReady(QList< QStringList > &Files)
static confaccessor & ref()
◆ initmodel()
| void dbe::FileModel::initmodel |
( |
| ) |
|
|
private |
Definition at line 167 of file FileModel.cpp.
168{
171
173 for ( QString const & source : sources )
174 {
175 QFileInfo srcinfo ( source );
176 QString fn = srcinfo.filePath();
177 QString dn =
GetFullFileName(fn).remove(QRegularExpression(
"/[a-zA-Z0-9_-]*.data.xml"));
178
179 QString modified{};
181 for (auto ufile: updated) {
182 if (file == ufile) {
183 modified = "Modified";
184 break;
185 }
186 }
187
189 dn,
191 modified}
192 );
193 }
194
196 {
198 }
199}
QString GetFullFileName(QString &FileName)
static std::list< std::string > uncommitted_files()
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 108 of file FileModel.cpp.
109{
110 QString TDAQ_DB_REPOSITORY = getenv ( "TDAQ_DB_REPOSITORY" );
111 if(TDAQ_DB_REPOSITORY.isEmpty() == false) {
112 QString TDAQ_DB_USER_REPOSITORY = getenv ( "TDAQ_DB_USER_REPOSITORY" );
113 FolderPathList = TDAQ_DB_USER_REPOSITORY.split (
":", Qt::SkipEmptyParts );
114
116 } else {
117 QString DUNEDAQ_DB_PATH = getenv ( "DUNEDAQ_DB_PATH" );
118 FolderPathList = DUNEDAQ_DB_PATH.split (
":", Qt::SkipEmptyParts );
119 }
120
122 {
123 if ( !PathName.endsWith ( "/" ) )
124 {
125 PathName.append ( "/" );
126 }
127 }
128}
QString find_db_repository_dir()
static MainWindow * findthis()
◆ rowCount()
| int dbe::FileModel::rowCount |
( |
const QModelIndex & | parent | ) |
const |
Definition at line 35 of file FileModel.cpp.
36{
37 if ( !parent.isValid() )
38 {
40 }
41
42 return 0;
43}
◆ 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