RedPanda-CPP/RedPandaIDE/systemconsts.cpp

41 lines
1.1 KiB
C++
Raw Normal View History

2021-04-11 21:33:08 +08:00
#include "systemconsts.h"
#include <QObject>
#include <QString>
#include <QStringList>
SystemConsts* pSystemConsts;
SystemConsts::SystemConsts(): mDefaultFileFilters()
{
2021-09-11 18:42:49 +08:00
addDefaultFileFilter(QObject::tr("All files"),"*");
addDefaultFileFilter(QObject::tr("Dev C++ Project files"),"*.dev");
2021-04-11 21:33:08 +08:00
addDefaultFileFilter(QObject::tr("C files"),"*.c");
addDefaultFileFilter(QObject::tr("C++ files"),"*.cpp *.cc *.cxx");
addDefaultFileFilter(QObject::tr("Header files"),"*.h *.hh");
}
const QStringList &SystemConsts::defaultFileFilters() const noexcept
{
return mDefaultFileFilters;
}
const QString &SystemConsts::defaultCFileFilter() const noexcept
{
2021-09-11 18:42:49 +08:00
return mDefaultFileFilters[2];
}
const QString &SystemConsts::defaultCPPFileFilter() const noexcept
2021-04-11 21:33:08 +08:00
{
2021-09-11 18:42:49 +08:00
return mDefaultFileFilters[3];
2021-04-11 21:33:08 +08:00
}
2021-08-30 19:52:38 +08:00
const QString &SystemConsts::defaultAllFileFilter() const noexcept
{
2021-09-11 18:42:49 +08:00
return mDefaultFileFilters[0];
2021-09-09 00:15:12 +08:00
}
2021-04-11 21:33:08 +08:00
void SystemConsts::addDefaultFileFilter(const QString &name, const QString &fileExtensions)
{
mDefaultFileFilters.append(name+ " (" + fileExtensions+")");
}