- fix: can't correctly test if it's not running in green mode

update README.md
This commit is contained in:
royqh1979@gmail.com 2021-11-05 11:48:46 +08:00
parent 02d935fb32
commit 32e354b800
8 changed files with 69 additions and 37 deletions

View File

@ -1,4 +1,4 @@
Beta Version 0.8 For Dev-C++ 7 Version 0.8 For Dev-C++ 7 Beta
- fix: find in the current file is not correcly saved in the search history - fix: find in the current file is not correcly saved in the search history
- fix: hit info not correctly displayed in the search result view - fix: hit info not correctly displayed in the search result view
- fix: If find in files found no hits, search result view will not be shown. - fix: If find in files found no hits, search result view will not be shown.
@ -6,6 +6,7 @@ Beta Version 0.8 For Dev-C++ 7
- fix: Results of "find symbol usage" in project not correctly set in the search result view - fix: Results of "find symbol usage" in project not correctly set in the search result view
- change: turn on gcc compiler's "-pipe" option by default, to use pipe instead of temp files in compiliation (and make the life of SSD longer) - change: turn on gcc compiler's "-pipe" option by default, to use pipe instead of temp files in compiliation (and make the life of SSD longer)
- fix: correctly save input histories for the find combo box in the Find dialog - fix: correctly save input histories for the find combo box in the Find dialog
- fix: can't correctly test if it's not running in green mode
Version 0.7.8 Version 0.7.8
- enhancement: In problem view's output control, indicates which line is different with the expected - enhancement: In problem view's output control, indicates which line is different with the expected

View File

@ -6,11 +6,26 @@ This project is the successor of Red Panda Dev-C++ 6.
All main features of version 6 have been ported. All main features of version 6 have been ported.
New Features: New Features:
* Code intellisense for unicode identifiers * Problem Set (run and test program against predefined input / expected output data)
* Competitve Companion support ( It's an chrome/firefox extension that can fetch problems from OJ websites)
* Memory View for debugging
* TODO View
* Find symbol occurrences
UI Improvements:
* Redesigned Find/Replace in Files UI
* Redesigned bookmark UI
* Better dark theme support
* Better editor color scheme support
Editing Improvements:
* Enhanced auto indent * Enhanced auto indent
* TODO view * Better code folding support
* Memory view in the debug panel
* Skip system header files when step into in debugging Code Intellisense Improvements:
* Better color scheme support * Support UTF-8 identifiers
* C++ 14 using type alias support * Support C++ 14 using type alias
* Code intellisense for clang (the msys2 version) * Support C-Style enum variable definitions
* Support MACRO with arguments
And many other improvements and bug fixes. See NEWS.md for full informantion.

View File

@ -9,6 +9,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QStringList> #include <QStringList>
#include <QAbstractNativeEventFilter> #include <QAbstractNativeEventFilter>
#include <QDir>
#include "common.h" #include "common.h"
#include "colorscheme.h" #include "colorscheme.h"
#include "iconsmanager.h" #include "iconsmanager.h"
@ -81,6 +82,9 @@ int main(int argc, char *argv[])
//Translation must be loaded first //Translation must be loaded first
QTranslator trans; QTranslator trans;
QString settingFilename = getSettingFilename(); QString settingFilename = getSettingFilename();
if (!isGreenEdition()) {
QDir::setCurrent(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0]);
}
if (settingFilename.isEmpty()) if (settingFilename.isEmpty())
return -1; return -1;
{ {

View File

@ -7,6 +7,7 @@
#include "systemconsts.h" #include "systemconsts.h"
#include <QDebug> #include <QDebug>
#include <QMessageBox> #include <QMessageBox>
#include <QStandardPaths>
const char ValueToChar[28] = {'0', '1', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', const char ValueToChar[28] = {'0', '1', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
@ -159,7 +160,12 @@ QString Settings::Dirs::templateDir() const
QString Settings::Dirs::projectDir() const QString Settings::Dirs::projectDir() const
{ {
if (isGreenEdition()) {
return includeTrailingPathDelimiter(app()) + "projects"; return includeTrailingPathDelimiter(app()) + "projects";
} else {
return includeTrailingPathDelimiter(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0])
+ "projects";
}
} }
QString Settings::Dirs::data(Settings::Dirs::DataType dataType) const QString Settings::Dirs::data(Settings::Dirs::DataType dataType) const

View File

@ -128,31 +128,6 @@ void FileAssociationModel::saveAssociations()
} }
bool readRegistry(HKEY key,QByteArray subKey, QString& value) {
DWORD dataSize;
LONG result;
result = RegGetValueA(key,subKey,
"", RRF_RT_REG_SZ | RRF_RT_REG_MULTI_SZ,
NULL,
NULL,
&dataSize);
if (result!=ERROR_SUCCESS)
return false;
char * buffer = new char[dataSize+10];
result = RegGetValueA(HKEY_CLASSES_ROOT,subKey,
"", RRF_RT_REG_SZ | RRF_RT_REG_MULTI_SZ,
NULL,
buffer,
&dataSize);
if (result!=ERROR_SUCCESS) {
delete[] buffer;
return false;
}
value=QString::fromLocal8Bit(buffer);
delete [] buffer;
return true;
}
bool FileAssociationModel::checkAssociation(const QString &extension, const QString &filetype, const QString &verb, const QString &serverApp) bool FileAssociationModel::checkAssociation(const QString &extension, const QString &filetype, const QString &verb, const QString &serverApp)
{ {
HKEY key; HKEY key;

View File

@ -3,7 +3,7 @@
#include <QStringList> #include <QStringList>
#define DEVCPP_VERSION "0.7.9" #define DEVCPP_VERSION "beta.0.8.0"
#define APP_SETTSINGS_FILENAME "redpandacpp.ini" #define APP_SETTSINGS_FILENAME "redpandacpp.ini"
#ifdef Q_OS_WIN #ifdef Q_OS_WIN

View File

@ -94,12 +94,16 @@ static bool gIsGreenEditionInited = false;
bool isGreenEdition() bool isGreenEdition()
{ {
if (!gIsGreenEditionInited) { if (!gIsGreenEditionInited) {
QString keyString = QString("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\RedPanda-C++");
QString value1,value2;
if (!readRegistry(HKEY_LOCAL_MACHINE,keyString.toLocal8Bit(),value1))
return false;
QSettings settings("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\RedPanda-C++", QSettings settings("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\RedPanda-C++",
QSettings::NativeFormat); QSettings::NativeFormat);
QString regPath = QFileInfo(settings.value("UninstallString").toString()).absolutePath(); QString regPath = extractFileDir(QFileInfo(settings.value("UninstallString").toString()).absolutePath());
QString appPath = QApplication::instance()->applicationDirPath(); QString appPath = QApplication::instance()->applicationDirPath();
gIsGreenEdition = (regPath != appPath); gIsGreenEdition = ( excludeTrailingPathDelimiter(regPath) != excludeTrailingPathDelimiter(appPath));
gIsGreenEditionInited = true; gIsGreenEditionInited = true;
} }
return gIsGreenEdition; return gIsGreenEdition;
@ -859,3 +863,28 @@ bool haveGoodContrast(const QColor& c1, const QColor &c2) {
int lightness2 = qGray(c2.rgb()); int lightness2 = qGray(c2.rgb());
return std::abs(lightness1 - lightness2)>=120; return std::abs(lightness1 - lightness2)>=120;
} }
bool readRegistry(HKEY key,QByteArray subKey, QString& value) {
DWORD dataSize;
LONG result;
result = RegGetValueA(key,subKey,
"", RRF_RT_REG_SZ | RRF_RT_REG_MULTI_SZ,
NULL,
NULL,
&dataSize);
if (result!=ERROR_SUCCESS)
return false;
char * buffer = new char[dataSize+10];
result = RegGetValueA(HKEY_CLASSES_ROOT,subKey,
"", RRF_RT_REG_SZ | RRF_RT_REG_MULTI_SZ,
NULL,
buffer,
&dataSize);
if (result!=ERROR_SUCCESS) {
delete[] buffer;
return false;
}
value=QString::fromLocal8Bit(buffer);
delete [] buffer;
return true;
}

View File

@ -191,6 +191,8 @@ QString fromByteArray(const QByteArray& s);
int getNewFileNumber(); int getNewFileNumber();
bool readRegistry(HKEY key,QByteArray subKey, QString& value);
class CppParser; class CppParser;
void resetCppParser(std::shared_ptr<CppParser> parser); void resetCppParser(std::shared_ptr<CppParser> parser);