- enhancement: option "open files in the same red panda C++ instance", in options->environment->file associations

- enhancement: hide unsupported files in files view
This commit is contained in:
Roy Qu 2022-02-28 22:40:09 +08:00
parent 08c285e55b
commit cc0b209e2f
19 changed files with 766 additions and 264 deletions

View File

@ -1,5 +1,7 @@
Red Panda C++ Version 0.14.5
- fix: the "gnu c++ 20" option in compiler set options is wrong
- enhancement: option "open files in the same red panda C++ instance", in options->environment->file associations
- enhancement: hide unsupported files in files view
Red Panda C++ Version 0.14.4

View File

@ -10,7 +10,7 @@ isEmpty(APP_NAME) {
}
isEmpty(APP_VERSION) {
APP_VERSION=0.14.4
APP_VERSION=0.14.5
}
isEmpty(PREFIX) {

File diff suppressed because it is too large Load Diff

View File

@ -95,6 +95,7 @@ void IconsManager::updateActionIcons(const QString& iconSet, int size)
mIconPixmaps.insert(ACTION_MISC_VALIDATE, createSVGIcon(iconFolder+"00Misc-10Check.svg",size,size));
mIconPixmaps.insert(ACTION_MISC_RENAME, createSVGIcon(iconFolder+"00Misc-11Rename.svg",size,size));
mIconPixmaps.insert(ACTION_MISC_HELP, createSVGIcon(iconFolder+"00Misc-12Help.svg",size,size));
mIconPixmaps.insert(ACTION_MISC_FILTER, createSVGIcon(iconFolder+"00Misc-13Filter.svg",size,size));
mIconPixmaps.insert(ACTION_FILE_NEW, createSVGIcon(iconFolder+"01File-01New.svg",size,size));
mIconPixmaps.insert(ACTION_FILE_OPEN, createSVGIcon(iconFolder+"01File-02Open.svg",size,size));

View File

@ -112,6 +112,7 @@ public:
ACTION_MISC_VALIDATE,
ACTION_MISC_RENAME,
ACTION_MISC_HELP,
ACTION_MISC_FILTER,
ACTION_FILE_NEW,
ACTION_FILE_OPEN,

View File

@ -38,9 +38,14 @@
#include "widgets/choosethemedialog.h"
#include "thememanager.h"
#ifdef Q_OS_WIN
#include <QTemporaryFile>
#include <windows.h>
#include <psapi.h>
#include <QSharedMemory>
#include <QBuffer>
#endif
QString getSettingFilename(const QString& filepath, bool& firstRun);
#ifdef Q_OS_WIN
class WindowLogoutEventFilter : public QAbstractNativeEventFilter {
@ -48,6 +53,61 @@ class WindowLogoutEventFilter : public QAbstractNativeEventFilter {
public:
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
};
#define WM_USER_OPEN_FILE (WM_USER+1)
HWND prevAppInstance = NULL;
BOOL CALLBACK GetPreviousInstanceCallback(HWND hwnd, LPARAM param){
BOOL result = TRUE;
WCHAR buffer[4098];
HINSTANCE hWindowModule = (HINSTANCE)GetWindowLongPtr(hwnd,GWLP_HINSTANCE);
if (hWindowModule==0)
return result;
DWORD processID;
// Get the ID of the process that created this window
GetWindowThreadProcessId(hwnd,&processID);
if (processID==0)
return result;
// Get the process associated with the ID
HANDLE hWindowProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID);
if (hWindowProcess == 0)
return result;
// Get its module filename
if (GetModuleFileNameExW(hWindowProcess, hWindowModule, buffer, sizeof(buffer)) == 0)
return TRUE;
CloseHandle(hWindowProcess); // not needed anymore
WCHAR * compareFilename=(WCHAR*)param;
QString s1=QString::fromWCharArray(compareFilename);
QString s2=QString::fromWCharArray(buffer);
//Is from the "same" application?
if (QString::compare(s1,s2,PATH_SENSITIVITY)==0) {
//found, stop EnumWindows loop
prevAppInstance = hwnd;
return FALSE;
}
return TRUE;
}
HWND getPreviousInstance() {
WCHAR buffer[4098];
//ShowMessage('ERROR_ALREADY_EXISTS');
// Store our own module filename
if (GetModuleFileNameW(GetModuleHandle(NULL), buffer, sizeof(buffer)) == 0)
return NULL;
// If that's the case, walk all top level windows and find the previous instance
// At this point, the program that created the mutex might not have created its MainForm yet
if (EnumWindows(GetPreviousInstanceCallback, LPARAM(buffer))==0) {
return prevAppInstance;
} else
return NULL;
}
bool WindowLogoutEventFilter::nativeEventFilter(const QByteArray & /*eventType*/, void *message, long *result){
MSG * pMsg = static_cast<MSG *>(message);
@ -72,6 +132,46 @@ bool WindowLogoutEventFilter::nativeEventFilter(const QByteArray & /*eventType*/
pMainWindow->updateDPI(oldDPI,newDPI);
break;
}
case WM_USER_OPEN_FILE: {
QSharedMemory sharedMemory("RedPandaCpp/openfiles");
if (sharedMemory.attach()) {
QBuffer buffer;
QDataStream in(&buffer);
QStringList files;
sharedMemory.lock();
buffer.setData((char*)sharedMemory.constData(), sharedMemory.size());
buffer.open(QBuffer::ReadOnly);
in >> files;
sharedMemory.unlock();
pMainWindow->openFiles(files);
sharedMemory.detach();
}
return true;
}
}
return false;
}
bool sendFilesToInstance() {
HWND prevInstance = getPreviousInstance();
if (prevInstance != NULL) {
QSharedMemory sharedMemory("RedPandaCpp/openfiles");
QBuffer buffer;
buffer.open(QBuffer::ReadWrite);
QDataStream out(&buffer);
QStringList filesToOpen = qApp->arguments();
filesToOpen.pop_front();
out<<filesToOpen;
int size = buffer.size();
if (sharedMemory.create(size)) {
sharedMemory.lock();
char *to = (char*)sharedMemory.data();
const char *from = buffer.data().data();
memcpy(to, from, qMin(sharedMemory.size(), size));
sharedMemory.unlock();
SendMessage(prevInstance,WM_USER_OPEN_FILE,0,0);
return true;
}
}
return false;
}
@ -130,6 +230,35 @@ int main(int argc, char *argv[])
{
//QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
QFile tempFile(QDir::tempPath()+QDir::separator()+"RedPandaDevCppStartUp.lock");
{
bool firstRun;
QString settingFilename = getSettingFilename(QString(), firstRun);
bool openInSingleInstance = false;
if (!settingFilename.isEmpty() && !firstRun) {
Settings settings(settingFilename);
settings.load();
openInSingleInstance = settings.environment().openFilesInSingleInstance();
} else if (!settingFilename.isEmpty() && firstRun)
openInSingleInstance = false;
if (openInSingleInstance) {
while (true) {
if (tempFile.open(QFile::NewOnly))
break;
QThread::msleep(100);
}
if (app.arguments().length()>=2) {
#ifdef Q_OS_WIN
if (sendFilesToInstance()) {
tempFile.remove();
return 0;
}
#endif
}
}
}
//Translation must be loaded first
QTranslator trans,transQt;
@ -138,8 +267,10 @@ int main(int argc, char *argv[])
if (!isGreenEdition()) {
QDir::setCurrent(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0]);
}
if (settingFilename.isEmpty())
if (settingFilename.isEmpty()) {
tempFile.remove();
return -1;
}
{
QSettings languageSetting(settingFilename,QSettings::IniFormat);
@ -230,6 +361,7 @@ int main(int argc, char *argv[])
WindowLogoutEventFilter filter;
app.installNativeEventFilter(&filter);
#endif
tempFile.remove();
int retCode = app.exec();
QString configDir = pSettings->dirs().config();
// save settings
@ -242,6 +374,7 @@ int main(int argc, char *argv[])
}
return retCode;
} catch (BaseError e) {
tempFile.remove();
QMessageBox::critical(nullptr,QApplication::tr("Error"),e.reason());
return -1;
}

View File

@ -296,6 +296,9 @@ MainWindow::MainWindow(QWidget *parent)
ui->treeFiles->setModel(&mFileSystemModel);
mFileSystemModel.setReadOnly(false);
mFileSystemModel.setIconProvider(&mFileSystemModelIconProvider);
mFileSystemModel.setNameFilters(pSystemConsts->defaultFileNameFilters());
mFileSystemModel.setNameFilterDisables(false);
setFilesViewRoot(pSettings->environment().currentFolder());
for (int i=1;i<mFileSystemModel.columnCount();i++) {
ui->treeFiles->hideColumn(i);
@ -1366,6 +1369,7 @@ void MainWindow::updateActionIcons()
mFilesView_Open->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_OPEN));
mFilesView_OpenInTerminal->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_TERM));
mFilesView_OpenInExplorer->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_FOLDER));
ui->actionFilesView_Hide_Non_Support_Files->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_FILTER));
//problem view
pIconsManager->setIcon(ui->btnNewProblemSet, IconsManager::ACTION_PROBLEM_SET);
@ -2796,7 +2800,7 @@ void MainWindow::buildContextMenus()
//toolbar for files view
{
QHBoxLayout* hlayout = dynamic_cast<QHBoxLayout*>( ui->panelFiles->layout());
QHBoxLayout* hlayout = dynamic_cast<QHBoxLayout*>(ui->panelFiles->layout());
QToolButton * toolButton;
int size = pointToPixel(pSettings->environment().interfaceFontSize());
QSize iconSize(size,size);
@ -2808,6 +2812,15 @@ void MainWindow::buildContextMenus()
toolButton->setIconSize(iconSize);
toolButton->setDefaultAction(ui->actionLocate_in_Files_View);
hlayout->addWidget(toolButton);
QFrame * vLine = new QFrame();
vLine->setFrameShape(QFrame::VLine);
vLine->setFrameShadow(QFrame::Sunken);
hlayout->addWidget(vLine);
toolButton = new QToolButton;
toolButton->setIconSize(iconSize);
toolButton->setDefaultAction(ui->actionFilesView_Hide_Non_Support_Files);
ui->actionFilesView_Hide_Non_Support_Files->setChecked(pSettings->environment().hideNonSupportFilesInFileView());
hlayout->addWidget(toolButton);
}
//context menu signal for class browser
@ -3207,6 +3220,8 @@ void MainWindow::onFilesViewContextMenu(const QPoint &pos)
menu.addSeparator();
menu.addAction(mFilesView_OpenInTerminal);
menu.addAction(mFilesView_OpenInExplorer);
menu.addSeparator();
menu.addAction(ui->actionFilesView_Hide_Non_Support_Files);
QString path = mFileSystemModel.filePath(ui->treeFiles->currentIndex());
QFileInfo info(path);
mFilesView_Open->setEnabled(info.isFile());
@ -7062,3 +7077,14 @@ void MainWindow::on_actionGit_Push_triggered()
}
}
void MainWindow::on_actionFilesView_Hide_Non_Support_Files_toggled(bool /* arg1 */)
{
mFileSystemModel.setNameFilterDisables(!ui->actionFilesView_Hide_Non_Support_Files->isChecked());
if (pSettings->environment().hideNonSupportFilesInFileView()
!= ui->actionFilesView_Hide_Non_Support_Files->isChecked()) {
pSettings->environment().setHideNonSupportFilesInFileView(ui->actionFilesView_Hide_Non_Support_Files->isChecked());
pSettings->environment().save();
}
}

View File

@ -604,6 +604,8 @@ private slots:
void on_actionGit_Push_triggered();
void on_actionFilesView_Hide_Non_Support_Files_toggled(bool arg1);
private:
Ui::MainWindow *ui;
EditorList *mEditorList;

View File

@ -1422,7 +1422,7 @@
<x>0</x>
<y>0</y>
<width>1114</width>
<height>25</height>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -2839,6 +2839,18 @@
<string>Push</string>
</property>
</action>
<action name="actionFilesView_Hide_Non_Support_Files">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/images/newlook24/037-filter.png</normaloff>:/icons/images/newlook24/037-filter.png</iconset>
</property>
<property name="text">
<string>Hide Non Support Files</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100"
height="100"
viewBox="0 0 26.458333 26.458333"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="00Misc-13Filter.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="true"
inkscape:document-units="px"
showgrid="false"
inkscape:zoom="1.0230034"
inkscape:cx="-291.29913"
inkscape:cy="64.027158"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
units="px"
width="100px" />
<defs
id="defs2">
<linearGradient
id="linearGradient3056"
inkscape:swatch="gradient">
<stop
style="stop-color:#45c200;stop-opacity:1"
offset="0"
id="stop826" />
<stop
style="stop-color:#53e900;stop-opacity:1"
offset="1"
id="stop828" />
</linearGradient>
<linearGradient
id="linearGradient3056-2">
<stop
style="stop-color:#45c200;stop-opacity:1"
offset="0"
id="stop3052" />
<stop
style="stop-color:#5fff07;stop-opacity:1"
offset="1"
id="stop3054" />
</linearGradient>
</defs>
<g
inkscape:label="图层 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:none;fill-opacity:1;stroke:#1f74fe;stroke-width:2.38125;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 2.6246389,4.8265718 H 24.099988 L 16.708565,15.641624 v 5.216446 l -6.295705,2.032732 v -7.147477 z"
id="path2472"
sodipodi:nodetypes="ccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100"
height="100"
viewBox="0 0 26.458333 26.458333"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="00Misc-13Filter.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="true"
inkscape:document-units="px"
showgrid="false"
inkscape:zoom="1.0230034"
inkscape:cx="-291.29913"
inkscape:cy="64.027158"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
units="px"
width="100px" />
<defs
id="defs2">
<linearGradient
id="linearGradient3056"
inkscape:swatch="gradient">
<stop
style="stop-color:#45c200;stop-opacity:1"
offset="0"
id="stop826" />
<stop
style="stop-color:#53e900;stop-opacity:1"
offset="1"
id="stop828" />
</linearGradient>
<linearGradient
id="linearGradient3056-2">
<stop
style="stop-color:#45c200;stop-opacity:1"
offset="0"
id="stop3052" />
<stop
style="stop-color:#5fff07;stop-opacity:1"
offset="1"
id="stop3054" />
</linearGradient>
</defs>
<g
inkscape:label="图层 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.582084;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 1.4346825,3.7982842 H 25.296182 L 17.083489,15.815009 v 5.796051 l -6.995227,2.258591 V 15.92801 Z"
id="path2472"
sodipodi:nodetypes="ccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100"
height="100"
viewBox="0 0 26.458333 26.458333"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="00Misc-13Filter.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="px"
showgrid="false"
inkscape:zoom="1.0230034"
inkscape:cx="-292.27664"
inkscape:cy="64.027157"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
units="px"
width="100px" />
<defs
id="defs2">
<linearGradient
id="linearGradient3056"
inkscape:swatch="gradient">
<stop
style="stop-color:#45c200;stop-opacity:1"
offset="0"
id="stop826" />
<stop
style="stop-color:#53e900;stop-opacity:1"
offset="1"
id="stop828" />
</linearGradient>
<linearGradient
id="linearGradient3056-2">
<stop
style="stop-color:#45c200;stop-opacity:1"
offset="0"
id="stop3052" />
<stop
style="stop-color:#5fff07;stop-opacity:1"
offset="1"
id="stop3054" />
</linearGradient>
</defs>
<g
inkscape:label="图层 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:#cdf1ff;fill-opacity:1;stroke:#000000;stroke-width:0.582084;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 1.4346825,3.7982842 H 25.296182 L 17.083489,15.815009 v 5.796051 l -6.995227,2.258591 V 15.92801 Z"
id="path2472"
sodipodi:nodetypes="ccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -2937,6 +2937,8 @@ void Settings::Environment::doLoad()
mTerminalPath = stringValue("terminal_path","/usr/bin/x-terminal-emulator");
mAStylePath = includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"astyle";
#endif
mHideNonSupportFilesInFileView=boolValue("hide_non_support_files_file_view",true);
mOpenFilesInSingleInstance = boolValue("open_files_in_single_instance",false);
}
int Settings::Environment::interfaceFontSize() const
@ -3029,6 +3031,26 @@ void Settings::Environment::setUseCustomTheme(bool newUseCustomTheme)
mUseCustomTheme = newUseCustomTheme;
}
bool Settings::Environment::hideNonSupportFilesInFileView() const
{
return mHideNonSupportFilesInFileView;
}
void Settings::Environment::setHideNonSupportFilesInFileView(bool newHideNonSupportFilesInFileView)
{
mHideNonSupportFilesInFileView = newHideNonSupportFilesInFileView;
}
bool Settings::Environment::openFilesInSingleInstance() const
{
return mOpenFilesInSingleInstance;
}
void Settings::Environment::setOpenFilesInSingleInstance(bool newOpenFilesInSingleInstance)
{
mOpenFilesInSingleInstance = newOpenFilesInSingleInstance;
}
void Settings::Environment::doSave()
{
//Appearence
@ -3046,6 +3068,9 @@ void Settings::Environment::doSave()
saveValue("terminal_path",mTerminalPath);
saveValue("asyle_path",mAStylePath);
#endif
saveValue("hide_non_support_files_file_view",mHideNonSupportFilesInFileView);
saveValue("open_files_in_single_instance",mOpenFilesInSingleInstance);
}
QString Settings::Environment::interfaceFont() const

View File

@ -528,6 +528,12 @@ public:
bool useCustomTheme() const;
void setUseCustomTheme(bool newUseCustomTheme);
bool hideNonSupportFilesInFileView() const;
void setHideNonSupportFilesInFileView(bool newHideNonSupportFilesInFileView);
bool openFilesInSingleInstance() const;
void setOpenFilesInSingleInstance(bool newOpenFilesInSingleInstance);
private:
//Appearence
@ -543,6 +549,8 @@ public:
QString mDefaultOpenFolder;
QString mTerminalPath;
QString mAStylePath;
bool mHideNonSupportFilesInFileView;
bool mOpenFilesInSingleInstance;
// _Base interface
protected:
void doSave() override;

View File

@ -49,6 +49,10 @@ EnvironmentFileAssociationWidget::~EnvironmentFileAssociationWidget()
void EnvironmentFileAssociationWidget::doLoad()
{
if (pSettings->environment().openFilesInSingleInstance())
ui->rbOpenInSingleApplication->setChecked(true);
else
ui->rbOpenInMultiApplication->setChecked(true);
mModel.updateAssociationStates();
}
@ -56,6 +60,8 @@ void EnvironmentFileAssociationWidget::doSave()
{
mModel.saveAssociations();
mModel.updateAssociationStates();
pSettings->environment().setOpenFilesInSingleInstance(ui->rbOpenInSingleApplication->isChecked());
pSettings->environment().save();
}
FileAssociationModel::FileAssociationModel(QObject *parent) : QAbstractListModel(parent)

View File

@ -7,13 +7,36 @@
<x>0</x>
<y>0</y>
<width>708</width>
<height>350</height>
<height>459</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Open Each File In</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QRadioButton" name="rbOpenInMultiApplication">
<property name="text">
<string>Independant Red Panda C++ applications</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbOpenInSingleApplication">
<property name="text">
<string>The same Red Panda C++ application</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">

View File

@ -59,6 +59,22 @@ SystemConsts::SystemConsts(): mDefaultFileFilters()
}
std::sort(codecNames.begin(),codecNames.end());
mCodecNames.append(codecNames);
mDefaultFileNameFilters.append("*.c");
mDefaultFileNameFilters.append("*.cpp");
mDefaultFileNameFilters.append("*.cc");
mDefaultFileNameFilters.append("*.C");
mDefaultFileNameFilters.append("*.cxx");
mDefaultFileNameFilters.append("*.cxx");
mDefaultFileNameFilters.append("*.h");
mDefaultFileNameFilters.append("*.hpp");
mDefaultFileNameFilters.append("*.hxx");
mDefaultFileNameFilters.append(".gitignore");
mDefaultFileNameFilters.append("*.vs");
mDefaultFileNameFilters.append("*.fs");
mDefaultFileNameFilters.append("*.txt");
mDefaultFileNameFilters.append("*.md");
mDefaultFileNameFilters.append("*.dev");
}
const QStringList &SystemConsts::defaultFileFilters() const noexcept
@ -91,6 +107,11 @@ void SystemConsts::addFileFilter(QStringList& filters, const QString &name, cons
filters.append(name+ " (" + fileExtensions+")");
}
const QStringList &SystemConsts::defaultFileNameFilters() const
{
return mDefaultFileNameFilters;
}
const QStringList &SystemConsts::codecNames() const
{
return mCodecNames;

View File

@ -109,10 +109,13 @@ public:
const QStringList &codecNames() const;
const QStringList &defaultFileNameFilters() const;
private:
void addFileFilter(QStringList& filters, const QString& name, const QString& fileExtensions);
QStringList mDefaultFileFilters;
QStringList mIconFileFilters;
QStringList mDefaultFileNameFilters;
QStringList mCodecNames;
};

View File

@ -17,7 +17,7 @@ SUBDIRS += \
APP_NAME = RedPandaCPP
APP_VERSION = 0.14.4
APP_VERSION = 0.14.5
linux: {