14 : QAbstractTableModel ( parent ),
16{ tr (
"Name" ), tr (
"Folder" ), tr (
"Access" ), tr (
"Status" ) }
24 : QAbstractTableModel ( parent ),
27{ tr (
"Name" ), tr (
"Folder" ), tr (
"Access" ), tr (
"Status" ) }
37 if ( !parent.isValid() )
53 if ( index.isValid() )
55 if ( role == Qt::DisplayRole ) {
59 if ( role == Qt::ForegroundRole )
66 if ( role == Qt::BackgroundRole )
81 if ( role == Qt::DisplayRole )
83 if ( orientation == Qt::Horizontal )
88 if ( orientation == Qt::Vertical )
102 return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
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 );
117 QString DUNEDAQ_DB_PATH = getenv (
"DUNEDAQ_DB_PATH" );
118 FolderPathList = DUNEDAQ_DB_PATH.split (
":", Qt::SkipEmptyParts );
123 if ( !PathName.endsWith (
"/" ) )
125 PathName.append (
"/" );
133 SLOT ( GetFileCache ( QList<QStringList> & ) ) );
145 QDir TdaqFolder ( Folder );
147 if ( TdaqFolder.exists ( FileName ) )
149 FileName = TdaqFolder.path() +
"/" + FileName;
150 char* rpath = realpath(FileName.toStdString().c_str(), NULL);
151 FileName = QString(rpath);
158 FileName =
FileInfo.absoluteFilePath();
176 for ( QString
const & source : sources )
178 QFileInfo srcinfo ( source );
179 QString fn = srcinfo.filePath();
180 QString dn =
GetFullFileName(fn).remove(QRegularExpression(
"/[a-zA-Z0-9_-]*.data.xml"));
184 for (
auto ufile: updated) {
186 modified =
"Modified";
int columnCount(const QModelIndex &parent) const
QList< QStringList > IncludedFiles
QStringList FolderPathList
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Qt::ItemFlags flags(const QModelIndex &index) const
FileModel(QObject *parent=nullptr)
Including QT Headers.
int rowCount(const QModelIndex &parent) const
QList< QStringList > GetFilesInfo() const
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
void FileCacheReady(QList< QStringList > &Files)
QString GetFullFileName(QString &FileName)
QString find_db_repository_dir()
static MainWindow * findthis()
static QColor FileReadOnlyForeground
static QColor FileReadOnlyBackground
static std::list< std::string > uncommitted_files()
static bool check_file_rw(const QString &FileName)
static QString dbfullname()
static confaccessor & ref()
static QStringList inclusions(QStringList const &candidates, QStringList files={ })