2018-03-12 11:43:03 +03:30
|
|
|
#include "baseclass.h"
|
2018-05-10 12:36:59 +03:00
|
|
|
#include <QRegularExpression>
|
2018-03-12 11:43:03 +03:30
|
|
|
|
|
|
|
QString BaseClass::m_qtdir = QString();
|
|
|
|
QString BaseClass::m_outputdir = QString();
|
|
|
|
QString BaseClass::m_projectdir = QString();
|
|
|
|
QString BaseClass::m_executablepath = QString();
|
|
|
|
|
|
|
|
QStringList BaseClass::findFilesInsideDir(const QString &name, const QString &dirpath)
|
|
|
|
{
|
|
|
|
QStringList files;
|
|
|
|
|
|
|
|
QDir dir(dirpath);
|
|
|
|
dir.setNameFilters(QStringList(name));
|
|
|
|
|
|
|
|
QDirIterator it(dir, QDirIterator::Subdirectories);
|
|
|
|
while (it.hasNext()) files << it.next();
|
|
|
|
|
|
|
|
return files;
|
|
|
|
}
|
|
|
|
|
2018-05-10 12:36:59 +03:00
|
|
|
bool BaseClass::getName(QString &name, const QString &url) const{
|
|
|
|
|
|
|
|
int index = url.lastIndexOf(QRegularExpression("[\\\/]"));
|
|
|
|
|
|
|
|
if(index < 0 || url.isEmpty()){
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
index = url.length() - index - 1;
|
|
|
|
|
|
|
|
name = url.right(index);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-03-12 11:43:03 +03:30
|
|
|
BaseClass::BaseClass(QObject *parent) : QObject(parent) {}
|