Merge branch 'master' of github.com:royqh1979/RedPanda-CPP
This commit is contained in:
commit
a485dac4cd
6
NEWS.md
6
NEWS.md
|
@ -138,6 +138,12 @@ Red Panda C++ Version 2.27
|
|||
- enhancement: Auto hide Project menu if no project openning.
|
||||
- fix: Toggle breakpoint by shortcut may use wrong line.
|
||||
- fix: Size of the icons in problem and problem set panel are not correct.
|
||||
- fix: Shouldn't consider preceeding '&'/'*' when popping completion suggest list for variable members.
|
||||
- fix: Positions of current matching parenthesis not correctly updated.
|
||||
- fix: Can't show correct completion info for vars declared with template parameters ending with ">>".
|
||||
- enhancement: Auto type induction for "std::make_shared"/"std::make_unique".
|
||||
- enhancement: sdcc project compiler: compile source file in subfolders.
|
||||
- fix: project options -> compiler set -> static link & auto convert charset options not correctly loaded.
|
||||
|
||||
Red Panda C++ Version 2.26
|
||||
- enhancement: Code suggestion for embedded std::vectors.
|
||||
|
|
|
@ -173,10 +173,11 @@ void CompilerInfo::prepareCompilerOptions()
|
|||
addOption(CC_CMD_OPT_WARNING_AS_ERROR, QObject::tr("Make all warnings into errors (-Werror)"), groupName, true, true, false, "-Werror");
|
||||
addOption(CC_CMD_OPT_ABORT_ON_ERROR , QObject::tr("Abort compilation on first error (-Wfatal-errors)"), groupName, true, true, false, "-Wfatal-errors");
|
||||
sl.clear();
|
||||
sl.append(QPair<QString,QString>("Normal",""));
|
||||
sl.append(QPair<QString,QString>("Strong","-strong"));
|
||||
sl.append(QPair<QString,QString>("All","-all"));
|
||||
addOption(CC_CMD_OPT_STACK_PROTECTOR , QObject::tr("Check for stack smashing attacks (-fstack-protector)"), groupName, false, false, true, "-fstack-protector", CompilerOptionType::Choice, sl);
|
||||
sl.append(QPair<QString,QString>("Normal","protector"));
|
||||
sl.append(QPair<QString,QString>("Explicit","protector-explicit"));
|
||||
sl.append(QPair<QString,QString>("Strong","protector-strong"));
|
||||
sl.append(QPair<QString,QString>("All","protector-all"));
|
||||
addOption(CC_CMD_OPT_STACK_PROTECTOR , QObject::tr("Check for stack smashing attacks (-fstack-protector)"), groupName, false, false, true, "-fstack-", CompilerOptionType::Choice, sl);
|
||||
sl.clear();
|
||||
sl.append(QPair<QString,QString>("Address","address"));
|
||||
sl.append(QPair<QString,QString>("Hwaddress","hwaddress"));
|
||||
|
|
|
@ -265,6 +265,7 @@ void ProjectCompiler::writeMakeDefines(QFile &file, bool &genModuleDef)
|
|||
writeln(file, "WINDRES = " + escapeArgumentForMakefileVariableValue(windres, true));
|
||||
#endif
|
||||
writeln(file, "RM = " CLEAN_PROGRAM);
|
||||
writeln(file, "CD = " CD_PROGRAM);
|
||||
|
||||
// compiler flags
|
||||
writeln(file, "LIBS = " + escapeArgumentsForMakefileVariableValue(libraryArguments));
|
||||
|
@ -361,7 +362,7 @@ void ProjectCompiler::writeMakeClean(QFile &file)
|
|||
if (mProject->options().type == ProjectType::DynamicLib) {
|
||||
target +=" $(STATIC)";
|
||||
}
|
||||
writeln(file, QString("\t-$(RM) %1 > %2 2>&1").arg(target,NULL_FILE));
|
||||
writeln(file, QString("\t-$(RM) %1 >%2 2>&1").arg(target,NULL_FILE));
|
||||
writeln(file);
|
||||
}
|
||||
|
||||
|
|
|
@ -169,6 +169,7 @@ void SDCCProjectCompiler::writeMakeDefines(QFile &file)
|
|||
writeln(file, "BIN_ARG = " + escapeArgumentForMakefileVariableValue(executable, false));
|
||||
writeln(file, "CFLAGS = $(INCS) " + escapeArgumentsForMakefileVariableValue(cCompileArguments));
|
||||
writeln(file, "RM = " CLEAN_PROGRAM);
|
||||
writeln(file, "CD = " CD_PROGRAM);
|
||||
|
||||
writeln(file);
|
||||
}
|
||||
|
@ -195,7 +196,7 @@ void SDCCProjectCompiler::writeMakeIncludes(QFile &file)
|
|||
void SDCCProjectCompiler::writeMakeClean(QFile &file)
|
||||
{
|
||||
writeln(file, "clean: clean-custom");
|
||||
writeln(file, QString("\t-$(RM) $(CLEANOBJ) > %1 2>&1").arg(NULL_FILE));
|
||||
writeln(file, QString("\t-$(RM) $(CLEANOBJ) >%1 2>&1||:").arg(NULL_FILE));
|
||||
writeln(file);
|
||||
}
|
||||
|
||||
|
@ -256,6 +257,7 @@ void SDCCProjectCompiler::writeMakeObjFilesRules(QFile &file)
|
|||
writeln(file, objStr);
|
||||
|
||||
// Write custom build command
|
||||
|
||||
if (unit->overrideBuildCmd() && !unit->buildCmd().isEmpty()) {
|
||||
QString BuildCmd = unit->buildCmd();
|
||||
BuildCmd.replace("<CRTAB>", "\n\t");
|
||||
|
@ -263,8 +265,16 @@ void SDCCProjectCompiler::writeMakeObjFilesRules(QFile &file)
|
|||
// Or roll our own
|
||||
} else {
|
||||
if (fileType==FileType::CSource) {
|
||||
writeln(file, "\t$(CC) $(CFLAGS) -c " + escapeArgumentForMakefileRecipe(shortFileName, false));
|
||||
}
|
||||
if(mProject->options().folderForObjFiles.isEmpty()) {
|
||||
writeln(file, "\t$(CC) $(CFLAGS) -c " + escapeArgumentForMakefileRecipe(shortFileName, false));
|
||||
}else{
|
||||
QString fullObjDir = includeTrailingPathDelimiter(mProject->options().folderForObjFiles);
|
||||
QString relativeObjDir = extractRelativePath(mProject->directory(),fullObjDir);
|
||||
QString objfile=extractRelativePath(generateAbsolutePath(mProject->directory(),relativeObjDir),unit->fileName());
|
||||
writeln(file, "\t$(CD) "+ localizePath(relativeObjDir)+" && $(CC) $(CFLAGS) -c " + localizePath(objfile));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1859,6 +1859,12 @@ void Editor::onStatusChanged(QSynedit::StatusChanges changes)
|
|||
|
||||
if (changes.testFlag(QSynedit::StatusChange::CaretX)
|
||||
|| changes.testFlag(QSynedit::StatusChange::CaretY)) {
|
||||
if (pSettings->editor().highlightMathingBraces()) {
|
||||
invalidateLine(mHighlightCharPos1.line);
|
||||
invalidateLine(mHighlightCharPos2.line);
|
||||
}
|
||||
mHighlightCharPos1 = QSynedit::BufferCoord{0,0};
|
||||
mHighlightCharPos2 = QSynedit::BufferCoord{0,0};
|
||||
if (mTabStopBegin >=0) {
|
||||
if (mTabStopY==caretY()) {
|
||||
if (mLineAfterTabStop.isEmpty()) {
|
||||
|
@ -1885,10 +1891,6 @@ void Editor::onStatusChanged(QSynedit::StatusChanges changes)
|
|||
}
|
||||
}
|
||||
} else if (!selAvail() && pSettings->editor().highlightMathingBraces()){
|
||||
invalidateLine(mHighlightCharPos1.line);
|
||||
invalidateLine(mHighlightCharPos2.line);
|
||||
mHighlightCharPos1 = QSynedit::BufferCoord{0,0};
|
||||
mHighlightCharPos2 = QSynedit::BufferCoord{0,0};
|
||||
// Is there a bracket char before us?
|
||||
int lineLength = lineText().length();
|
||||
int ch = caretX() - 2;
|
||||
|
@ -2341,6 +2343,10 @@ QStringList Editor::getOwnerExpressionAndMemberAtPositionForCompletion(
|
|||
QStringList &memberExpression)
|
||||
{
|
||||
QStringList expression = getExpressionAtPosition(pos);
|
||||
// *(Deference) and &(Address-of) has low precedence than '.'/'->',
|
||||
// so don't includes them in the owner expression in comletion calculation
|
||||
while (!expression.isEmpty() && (expression.front()=='*' || expression.front()=='&'))
|
||||
expression.pop_front();
|
||||
return getOwnerExpressionAndMember(expression,memberOperator,memberExpression);
|
||||
}
|
||||
|
||||
|
|
|
@ -4108,8 +4108,18 @@ void CppParser::handleVar(const QString& typePrefix,bool isExtern,bool isStatic,
|
|||
if(aliasStatement) {
|
||||
if (aliasStatement->typeStatement) {
|
||||
addedVar->type = aliasStatement->typeStatement->fullName;
|
||||
if (!addedVar->type.endsWith(">"))
|
||||
addedVar->type += aliasStatement->templateParams;
|
||||
if (!aliasStatement->templateParams.isEmpty()) {
|
||||
if (!addedVar->type.endsWith(">")) {
|
||||
addedVar->type += aliasStatement->templateParams;
|
||||
} else {
|
||||
QString type = addedVar->type;
|
||||
int pos = type.indexOf('<');
|
||||
if (pos>=0) {
|
||||
type = type.left(pos);
|
||||
addedVar->type = type + aliasStatement->templateParams;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aliasStatement->typeStatement
|
||||
&& STLIterators.contains(aliasStatement->typeStatement->command)
|
||||
&& !aliasStatement->templateParams.isEmpty()) {
|
||||
|
@ -4686,7 +4696,7 @@ PEvalStatement CppParser::doEvalExpression(const QString& fileName,
|
|||
}
|
||||
return result;
|
||||
} else
|
||||
return doEvalPointerArithmetic(
|
||||
return doEvalArithmeticOperation(
|
||||
fileName,
|
||||
phraseExpression,
|
||||
pos,
|
||||
|
@ -4695,7 +4705,7 @@ PEvalStatement CppParser::doEvalExpression(const QString& fileName,
|
|||
freeScoped);
|
||||
}
|
||||
|
||||
PEvalStatement CppParser::doEvalPointerArithmetic(const QString &fileName, const QStringList &phraseExpression, int &pos, const PStatement &scope, const PEvalStatement &previousResult, bool freeScoped) const
|
||||
PEvalStatement CppParser::doEvalArithmeticOperation(const QString &fileName, const QStringList &phraseExpression, int &pos, const PStatement &scope, const PEvalStatement &previousResult, bool freeScoped) const
|
||||
{
|
||||
if (pos>=phraseExpression.length())
|
||||
return PEvalStatement();
|
||||
|
@ -4755,7 +4765,7 @@ PEvalStatement CppParser::doEvalPointerToMembers(
|
|||
if (pos>=phraseExpression.length())
|
||||
return PEvalStatement();
|
||||
//find the start scope statement
|
||||
PEvalStatement currentResult = doEvalCCast(
|
||||
PEvalStatement currentResult = doEvalTypeCast(
|
||||
fileName,
|
||||
phraseExpression,
|
||||
pos,
|
||||
|
@ -4771,7 +4781,7 @@ PEvalStatement CppParser::doEvalPointerToMembers(
|
|||
|| phraseExpression[pos]=="->*")) {
|
||||
pos++;
|
||||
currentResult =
|
||||
doEvalCCast(
|
||||
doEvalTypeCast(
|
||||
fileName,
|
||||
phraseExpression,
|
||||
pos,
|
||||
|
@ -4788,7 +4798,7 @@ PEvalStatement CppParser::doEvalPointerToMembers(
|
|||
return currentResult;
|
||||
}
|
||||
|
||||
PEvalStatement CppParser::doEvalCCast(const QString &fileName,
|
||||
PEvalStatement CppParser::doEvalTypeCast(const QString &fileName,
|
||||
const QStringList &phraseExpression,
|
||||
int &pos,
|
||||
const PStatement& scope,
|
||||
|
@ -4799,8 +4809,9 @@ PEvalStatement CppParser::doEvalCCast(const QString &fileName,
|
|||
return PEvalStatement();
|
||||
PEvalStatement result;
|
||||
if (phraseExpression[pos]=="*") {
|
||||
//deference
|
||||
pos++; //skip "*"
|
||||
result = doEvalCCast(
|
||||
result = doEvalTypeCast(
|
||||
fileName,
|
||||
phraseExpression,
|
||||
pos,
|
||||
|
@ -4862,8 +4873,9 @@ PEvalStatement CppParser::doEvalCCast(const QString &fileName,
|
|||
result->pointerLevel--;
|
||||
}
|
||||
} else if (phraseExpression[pos]=="&") {
|
||||
//Address-of
|
||||
pos++; //skip "&"
|
||||
result = doEvalCCast(
|
||||
result = doEvalTypeCast(
|
||||
fileName,
|
||||
phraseExpression,
|
||||
pos,
|
||||
|
@ -4875,8 +4887,9 @@ PEvalStatement CppParser::doEvalCCast(const QString &fileName,
|
|||
}
|
||||
} else if (phraseExpression[pos]=="++"
|
||||
|| phraseExpression[pos]=="--") {
|
||||
// Prefix increment and decrement
|
||||
pos++; //skip "++" or "--"
|
||||
result = doEvalCCast(
|
||||
result = doEvalTypeCast(
|
||||
fileName,
|
||||
phraseExpression,
|
||||
pos,
|
||||
|
@ -4884,6 +4897,7 @@ PEvalStatement CppParser::doEvalCCast(const QString &fileName,
|
|||
previousResult,
|
||||
freeScoped);
|
||||
} else if (phraseExpression[pos]=="(") {
|
||||
//Type Cast
|
||||
//parse
|
||||
int startPos = pos;
|
||||
pos++;
|
||||
|
@ -4904,7 +4918,7 @@ PEvalStatement CppParser::doEvalCCast(const QString &fileName,
|
|||
pos++; // skip ")"
|
||||
// qDebug()<<"parse type cast exp";
|
||||
//it's a type cast
|
||||
result = doEvalCCast(fileName,
|
||||
result = doEvalTypeCast(fileName,
|
||||
phraseExpression,
|
||||
pos,
|
||||
scope,
|
||||
|
@ -4930,11 +4944,6 @@ PEvalStatement CppParser::doEvalCCast(const QString &fileName,
|
|||
scope,
|
||||
previousResult,
|
||||
freeScoped);
|
||||
// if (result) {
|
||||
// qDebug()<<pos<<(int)result->kind<<result->baseType;
|
||||
// } else {
|
||||
// qDebug()<<"!!!!!!!!!!!not found";
|
||||
// }
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -4963,8 +4972,10 @@ PEvalStatement CppParser::doEvalMemberAccess(const QString &fileName,
|
|||
if (!result)
|
||||
break;
|
||||
if (phraseExpression[pos]=="++" || phraseExpression[pos]=="--") {
|
||||
//Suffix/postfix increment and decrement
|
||||
pos++; //just skip it
|
||||
} else if (phraseExpression[pos] == "(") {
|
||||
// Function call
|
||||
if (result->kind == EvalStatementKind::Type) {
|
||||
doSkipInExpression(phraseExpression,pos,"(",")");
|
||||
result->kind = EvalStatementKind::Variable;
|
||||
|
@ -5025,11 +5036,13 @@ PEvalStatement CppParser::doEvalMemberAccess(const QString &fileName,
|
|||
result = PEvalStatement();
|
||||
}
|
||||
} else if (phraseExpression[pos] == "{") {
|
||||
// Varaible Initialization
|
||||
if (result->kind == EvalStatementKind::Type) {
|
||||
doSkipInExpression(phraseExpression,pos,"{","}");
|
||||
result->kind = EvalStatementKind::Variable;
|
||||
}
|
||||
} else if (phraseExpression[pos] == "[") {
|
||||
//Array subscripting
|
||||
//skip to "]"
|
||||
doSkipInExpression(phraseExpression,pos,"[","]");
|
||||
if (result->kind == EvalStatementKind::Type) {
|
||||
|
@ -5079,6 +5092,7 @@ PEvalStatement CppParser::doEvalMemberAccess(const QString &fileName,
|
|||
}
|
||||
}
|
||||
} else if (phraseExpression[pos] == ".") {
|
||||
//Structure and union member access
|
||||
pos++;
|
||||
lastResult = result;
|
||||
result = doEvalScopeResolution(
|
||||
|
@ -5089,6 +5103,7 @@ PEvalStatement CppParser::doEvalMemberAccess(const QString &fileName,
|
|||
result,
|
||||
false);
|
||||
} else if (phraseExpression[pos] == "->") {
|
||||
// Structure and union member access through pointer
|
||||
pos++;
|
||||
if (result->pointerLevel==0) {
|
||||
// iterator
|
||||
|
@ -5374,13 +5389,17 @@ PEvalStatement CppParser::doEvalTerm(const QString &fileName,
|
|||
pos++;
|
||||
}
|
||||
result->pointerLevel = pointerLevel;
|
||||
} else if (result && result->kind == EvalStatementKind::Function
|
||||
&& pos<phraseExpression.length()
|
||||
&& phraseExpression[pos]=='<') {
|
||||
result->templateParams = "";
|
||||
int oldPos = pos;
|
||||
doSkipInExpression(phraseExpression,pos,"<",">");
|
||||
for(int i=oldPos;i<pos;i++) {
|
||||
result->templateParams+=phraseExpression[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
// qDebug()<<pos<<" term end";
|
||||
// if (!result) {
|
||||
// qDebug()<<"not found !!!!";
|
||||
// }
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -5693,10 +5712,13 @@ PEvalStatement CppParser::doCreateEvalFunction(
|
|||
int pointerLevel=0;
|
||||
QString templateParams;
|
||||
PStatement typeStatement;
|
||||
QString type = funcStatement->type;
|
||||
if (funcStatement->fullName == "std::make_unique")
|
||||
type = "unique_ptr";
|
||||
PStatement effetiveTypeStatement = doParseEvalTypeInfo(
|
||||
fileName,
|
||||
funcStatement->parentScope.lock(),
|
||||
funcStatement->type,
|
||||
type,
|
||||
baseType,
|
||||
typeStatement,
|
||||
pointerLevel,
|
||||
|
@ -5799,6 +5821,8 @@ PStatement CppParser::doParseEvalTypeInfo(
|
|||
templateLevel++;
|
||||
} else if (token == ">") {
|
||||
templateLevel--;
|
||||
} else if (token == ">>") {
|
||||
templateLevel-=2;
|
||||
}
|
||||
templateParams += token;
|
||||
}
|
||||
|
@ -6587,9 +6611,18 @@ QStringList CppParser::splitExpression(const QString &expr)
|
|||
for(int i=0;i<lines.length();i++) {
|
||||
syntaxer.setLine(lines[i],i+1);
|
||||
while(!syntaxer.eol()) {
|
||||
if (syntaxer.getTokenAttribute()->tokenType()!=QSynedit::TokenType::Comment
|
||||
&& syntaxer.getTokenAttribute()->tokenType()!=QSynedit::TokenType::Space)
|
||||
result.append(syntaxer.getToken());
|
||||
QSynedit::TokenType tokenType = syntaxer.getTokenAttribute()->tokenType();
|
||||
QString token = syntaxer.getToken();
|
||||
if (tokenType == QSynedit::TokenType::Operator) {
|
||||
if ( token == ">>" ) {
|
||||
result.append(">");
|
||||
result.append(">");
|
||||
} else {
|
||||
result.append(token);
|
||||
}
|
||||
} else if (tokenType!=QSynedit::TokenType::Comment
|
||||
&& tokenType!=QSynedit::TokenType::Space)
|
||||
result.append(token);
|
||||
syntaxer.next();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -325,13 +325,15 @@ private:
|
|||
bool freeScoped,
|
||||
bool expandMacros) const;
|
||||
|
||||
PEvalStatement doEvalPointerArithmetic(
|
||||
/* add + / minus - */
|
||||
PEvalStatement doEvalArithmeticOperation(
|
||||
const QString& fileName,
|
||||
const QStringList& phraseExpression,
|
||||
int &pos,
|
||||
const PStatement& scope,
|
||||
const PEvalStatement& previousResult,
|
||||
bool freeScoped) const;
|
||||
/* Pointer to members .* / ->* */
|
||||
PEvalStatement doEvalPointerToMembers(
|
||||
const QString& fileName,
|
||||
const QStringList& phraseExpression,
|
||||
|
@ -339,13 +341,19 @@ private:
|
|||
const PStatement& scope,
|
||||
const PEvalStatement& previousResult,
|
||||
bool freeScoped) const;
|
||||
PEvalStatement doEvalCCast(
|
||||
|
||||
/*
|
||||
* Dereference * / Address-of & / Type Cast / Prefix increment and decrement
|
||||
* */
|
||||
PEvalStatement doEvalTypeCast(
|
||||
const QString& fileName,
|
||||
const QStringList& phraseExpression,
|
||||
int &pos,
|
||||
const PStatement& scope,
|
||||
const PEvalStatement& previousResult,
|
||||
bool freeScoped) const;
|
||||
|
||||
|
||||
PEvalStatement doEvalMemberAccess(
|
||||
const QString& fileName,
|
||||
const QStringList& phraseExpression,
|
||||
|
|
|
@ -45,7 +45,7 @@ function main()
|
|||
PaletteButtonDisabled = "#efefef",
|
||||
PaletteButtonTextDisabled = "#bebebe",
|
||||
PaletteHighlight = "#688DB2",
|
||||
PaletteHighlightedText = "#000000",
|
||||
PaletteHighlightedText = "#ffffff",
|
||||
},
|
||||
}
|
||||
end
|
||||
|
|
|
@ -44,10 +44,10 @@ void ProjectCompilerWidget::refreshOptions()
|
|||
|
||||
ui->tabOptions->resetUI(pSet,mOptions);
|
||||
|
||||
ui->chkStaticLink->setChecked(pSet->staticLink());
|
||||
ui->chkAddCharset->setChecked(pSet->autoAddCharsetParams());
|
||||
ui->chkStaticLink->setChecked(mStaticLink);
|
||||
ui->chkAddCharset->setChecked(mAddCharset);
|
||||
|
||||
QByteArray execEncoding = pMainWindow->project()->options().execEncoding;
|
||||
QByteArray execEncoding = mExecCharset;
|
||||
if (execEncoding == ENCODING_AUTO_DETECT
|
||||
|| execEncoding == ENCODING_SYSTEM_DEFAULT
|
||||
|| execEncoding == ENCODING_UTF8) {
|
||||
|
@ -75,11 +75,12 @@ void ProjectCompilerWidget::doLoad()
|
|||
Settings::PCompilerSet pSet = pSettings->compilerSets().getSet(ui->cbCompilerSet->currentIndex());
|
||||
if (mOptions.isEmpty() && pSet)
|
||||
mOptions = pSet->compileOptions();
|
||||
mStaticLink = pMainWindow->project()->options().staticLink;
|
||||
mAddCharset = pMainWindow->project()->options().addCharset;
|
||||
mExecCharset = pMainWindow->project()->options().execEncoding;
|
||||
ui->cbCompilerSet->blockSignals(true);
|
||||
ui->cbCompilerSet->setCurrentIndex(pMainWindow->project()->options().compilerSet);
|
||||
ui->cbCompilerSet->blockSignals(false);
|
||||
ui->chkAddCharset->setChecked(pMainWindow->project()->options().addCharset);
|
||||
ui->chkStaticLink->setChecked(pMainWindow->project()->options().staticLink);
|
||||
refreshOptions();
|
||||
}
|
||||
|
||||
|
@ -99,6 +100,10 @@ void ProjectCompilerWidget::doSave()
|
|||
} else {
|
||||
pMainWindow->project()->options().execEncoding = ui->cbEncoding->currentData().toString().toLocal8Bit();
|
||||
}
|
||||
mOptions = pMainWindow->project()->options().compilerOptions;
|
||||
mStaticLink = pMainWindow->project()->options().staticLink;
|
||||
mAddCharset = pMainWindow->project()->options().addCharset;
|
||||
mExecCharset = pMainWindow->project()->options().execEncoding;
|
||||
pMainWindow->project()->saveOptions();
|
||||
}
|
||||
|
||||
|
@ -169,6 +174,10 @@ void ProjectCompilerWidget::on_cbCompilerSet_currentIndexChanged(int index)
|
|||
return;
|
||||
}
|
||||
mOptions = pSet->compileOptions();
|
||||
mStaticLink = pSet->staticLink();
|
||||
mAddCharset = pSet->autoAddCharsetParams();
|
||||
mExecCharset = pSet->execCharset().toUtf8();
|
||||
|
||||
setSettingsChanged();
|
||||
//project->saveOptions();
|
||||
}
|
||||
|
|
|
@ -37,6 +37,9 @@ private:
|
|||
private:
|
||||
Ui::ProjectCompilerWidget *ui;
|
||||
QMap<QString,QString> mOptions;
|
||||
bool mStaticLink;
|
||||
bool mAddCharset;
|
||||
QByteArray mExecCharset;
|
||||
|
||||
// SettingsWidget interface
|
||||
protected:
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#define MAKE_PROGRAM "mingw32-make.exe"
|
||||
#define WINDRES_PROGRAM "windres.exe"
|
||||
#define CLEAN_PROGRAM "del /q /f"
|
||||
#define CD_PROGRAM "cd /d"
|
||||
#define CPP_PROGRAM "cpp.exe"
|
||||
#define GIT_PROGRAM "git.exe"
|
||||
#define CLANG_PROGRAM "clang.exe"
|
||||
|
@ -50,6 +51,7 @@
|
|||
#define WINDRES_PROGRAM ""
|
||||
#define GPROF_PROGRAM "gprof"
|
||||
#define CLEAN_PROGRAM "rm -rf"
|
||||
#define CD_PROGRAM "cd"
|
||||
#define CPP_PROGRAM "cpp"
|
||||
#define GIT_PROGRAM "git"
|
||||
#define CLANG_PROGRAM "clang"
|
||||
|
|
|
@ -1125,7 +1125,6 @@ void QSynEditPainter::paintLines()
|
|||
if (mIsCurrentLine && mEdit->mInputPreeditString.length()>0) {
|
||||
int startPos = mEdit->mSyntaxer->getTokenPos()+1;
|
||||
int endPos = mEdit->mSyntaxer->getTokenPos() + sToken.length();
|
||||
//qDebug()<<startPos<<":"<<endPos<<" - "+sToken+" - "<<edit->mCaretX<<":"<<edit->mCaretX+edit->mInputPreeditString.length();
|
||||
if (!(endPos < mEdit->mCaretX
|
||||
|| startPos >= mEdit->mCaretX+mEdit->mInputPreeditString.length())) {
|
||||
if (!preeditAttr) {
|
||||
|
@ -1200,7 +1199,7 @@ void QSynEditPainter::paintLines()
|
|||
glyphStartCharList,
|
||||
oldLen,
|
||||
sLine.length(),
|
||||
calculateGlyphPositions,
|
||||
true,
|
||||
glyphStartPositionsList,
|
||||
tokenWidth);
|
||||
tokenLeft += tokenWidth;
|
||||
|
|
|
@ -5380,11 +5380,6 @@ int QSynEdit::doInsertTextByNormalMode(const BufferCoord& pos, const QStringList
|
|||
sLeftSide += QString(pos.ch - 1 - sLeftSide.length(),' ');
|
||||
}
|
||||
sRightSide = line.mid(pos.ch - 1);
|
||||
// if (mUndoing) {
|
||||
// SpaceCount = 0;
|
||||
// } else {
|
||||
// SpaceCount = leftSpaces(sLeftSide);
|
||||
// }
|
||||
int caretY=pos.line;
|
||||
// step1: insert the first line of Value into current line
|
||||
if (text.length()>1) {
|
||||
|
@ -5406,14 +5401,7 @@ int QSynEdit::doInsertTextByNormalMode(const BufferCoord& pos, const QStringList
|
|||
// step2: insert remaining lines of Value
|
||||
for (int i=1;i<text.length();i++) {
|
||||
bool notInComment = true;
|
||||
// if (mHighlighter) {
|
||||
// notInComment = !mHighlighter->isCommentNotFinished(
|
||||
// mHighlighter->getRangeState().state)
|
||||
// && !mHighlighter->isStringNotFinished(
|
||||
// mHighlighter->getRangeState().state);
|
||||
// }
|
||||
caretY=pos.line+i;
|
||||
// mStatusChanges.setFlag(SynStatusChange::scCaretY);
|
||||
if (text[i].isEmpty()) {
|
||||
if (i==text.length()-1) {
|
||||
str = sRightSide;
|
||||
|
|
|
@ -449,30 +449,26 @@ public:
|
|||
void setBackgroundColor(const QColor &newBackgroundColor);
|
||||
|
||||
bool isEmpty();
|
||||
|
||||
int mouseSelectionScrollSpeed() const;
|
||||
void setMouseSelectionScrollSpeed(int newMouseSelectionScrollSpeed);
|
||||
|
||||
ScrollStyle scrollBars() const;
|
||||
void setScrollBars(ScrollStyle newScrollBars);
|
||||
|
||||
double lineSpacingFactor() const;
|
||||
void setLineSpacingFactor(double newLineSpacingFactor);
|
||||
|
||||
const QDateTime &lastModifyTime() const;
|
||||
|
||||
const PFormatter &formatter() const;
|
||||
void setFormatter(const PFormatter &newFormatter);
|
||||
signals:
|
||||
void linesDeleted(int FirstLine, int Count);
|
||||
void linesInserted(int FirstLine, int Count);
|
||||
|
||||
void changed();
|
||||
|
||||
// void chainUndoAdded();
|
||||
// void chainRedoAdded();
|
||||
// void chainLinesChanging();
|
||||
// void chainLinesChanged();
|
||||
// void chainListCleared();
|
||||
|
||||
// void chainListDeleted(int Index, int Count);
|
||||
// void chainListInserted(int Index, int Count);
|
||||
// void chainListPutted(int Index, int Count);
|
||||
|
||||
// void filesDropped(int X,int Y, const QStringList& AFiles);
|
||||
void gutterClicked(Qt::MouseButton button, int x, int y, int line);
|
||||
// void imeInputed(const QString& s);
|
||||
|
||||
// void contextHelp(const QString& word);
|
||||
|
||||
void statusChanged(StatusChanges changes);
|
||||
|
||||
void fontChanged();
|
||||
void tabSizeChanged();
|
||||
protected:
|
||||
|
@ -727,11 +723,6 @@ private:
|
|||
StatusChanges mStatusChanges;
|
||||
int mLastKey;
|
||||
Qt::KeyboardModifiers mLastKeyModifiers;
|
||||
//fSearchEngine: TSynEditSearchCustom;
|
||||
//fHookedCommandHandlers: TList;
|
||||
//fKbdHandler: TSynEditKbdHandler;
|
||||
// fFocusList: TList;
|
||||
// fPlugins: TList;
|
||||
QTimer* mScrollTimer;
|
||||
|
||||
PSynEdit fChainedEditor;
|
||||
|
@ -740,20 +731,7 @@ private:
|
|||
bool mIsScrolling;
|
||||
int mOptionLock; // lock counter to prevent recalculate glyph widths while change settings;
|
||||
bool mUndoing;
|
||||
// event handlers
|
||||
// ProcessCommandProc mOnCommandProcessed;
|
||||
// MouseCursorProc mOnMouseCursor;
|
||||
// PaintProc mOnPaint;
|
||||
// SynPreparePaintHighlightTokenProc mOnPaintHighlightToken;
|
||||
// ProcessCommandProc mOnProcessingCommand;
|
||||
// ProcessCommandProc mOnProcessingUserCommand;
|
||||
|
||||
// SynSpecialLineColorsProc mOnSpecialLineColors;
|
||||
// SynEditingAreasProc mOnEditingAreas;
|
||||
// SynGutterGetTextProc mOnGutterGetText;
|
||||
// SynTGutterPaintProc mOnGutterPaint;
|
||||
int mGutterWidth;
|
||||
|
||||
//caret blink related
|
||||
int m_blinkTimerId;
|
||||
int m_blinkStatus;
|
||||
|
@ -799,23 +777,9 @@ protected:
|
|||
bool viewportEvent(QEvent * event) override;
|
||||
|
||||
// QWidget interface
|
||||
public:
|
||||
public:
|
||||
QVariant inputMethodQuery(Qt::InputMethodQuery property) const override;
|
||||
|
||||
int mouseSelectionScrollSpeed() const;
|
||||
void setMouseSelectionScrollSpeed(int newMouseSelectionScrollSpeed);
|
||||
|
||||
ScrollStyle scrollBars() const;
|
||||
void setScrollBars(ScrollStyle newScrollBars);
|
||||
|
||||
double lineSpacingFactor() const;
|
||||
void setLineSpacingFactor(double newLineSpacingFactor);
|
||||
|
||||
const QDateTime &lastModifyTime() const;
|
||||
|
||||
const PFormatter &formatter() const;
|
||||
void setFormatter(const PFormatter &newFormatter);
|
||||
|
||||
protected:
|
||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
|
|
|
@ -7,7 +7,7 @@ arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64' 'riscv64')
|
|||
url="https://github.com/royqh1979/$_pkgname"
|
||||
license=('GPL3')
|
||||
depends=(qt5-base qt5-svg gcc gdb)
|
||||
makedepends=(qt5-tools)
|
||||
makedepends=(qt5-tools imagemagick librsvg)
|
||||
optdepends=(
|
||||
'clang: C/C++ compiler (alternative)'
|
||||
)
|
||||
|
@ -42,4 +42,13 @@ package() {
|
|||
|
||||
cd redpanda-build
|
||||
make INSTALL_ROOT="$pkgdir" install
|
||||
|
||||
for size in 16 22 24 32 36 48 64 72 96 128 192 256 512; do
|
||||
mkdir -p "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps"
|
||||
magick convert \
|
||||
-background none \
|
||||
"$pkgdir/usr/share/icons/hicolor/scalable/apps/redpandaide.svg" \
|
||||
-resize ${size}x${size} \
|
||||
"$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/redpandaide.png"
|
||||
done
|
||||
}
|
||||
|
|
|
@ -12,9 +12,11 @@ cd $DEBIAN_DIR
|
|||
pwd
|
||||
oldver=`head changelog -n 1 | sed -r 's/^redpanda-cpp\s\((.*)-(.*)\)\s.*$/\1/g'`
|
||||
count=`head changelog -n 1 | sed -r 's/^redpanda-cpp\s\((.*)-(.*)\)\s.*$/\2/g'`
|
||||
echo $oldver
|
||||
echo "Old version: $oldver"
|
||||
|
||||
|
||||
if [ "$oldver" != "$ver" ]; then
|
||||
echo "Upgrade to $ver"
|
||||
tmpfile=$(mktemp)
|
||||
now=`date -R`
|
||||
echo "redpanda-cpp ($ver-1) unstable; urgency=medium" >> $tmpfile
|
||||
|
|
|
@ -131,8 +131,8 @@ Section "$(SectionMainName)" SectionMain
|
|||
!endif
|
||||
|
||||
; Write required paths
|
||||
SetOutPath $INSTDIR\Templates
|
||||
File /nonfatal /r "Templates\*"
|
||||
SetOutPath $INSTDIR\templates
|
||||
File /nonfatal /r "templates\*"
|
||||
|
||||
SectionEnd
|
||||
|
||||
|
@ -440,8 +440,7 @@ Section "Uninstall"
|
|||
Delete "$INSTDIR\OpenConsole.exe"
|
||||
Delete "$INSTDIR\compiler_hint.lua"
|
||||
|
||||
RMDir /r "$INSTDIR\Lang"
|
||||
RMDir /r "$INSTDIR\Templates"
|
||||
RMDir /r "$INSTDIR\templates"
|
||||
RMDir /r "$INSTDIR\mingw32"
|
||||
RMDir /r "$INSTDIR\mingw64"
|
||||
RMDir /r "$INSTDIR\llvm-mingw"
|
||||
|
|
Loading…
Reference in New Issue