- enhancement: When first display two editor panes, auto make them the same width

- change: Don't rebuild the whole project when run/debug, if only
contents of project unit file is modified.
- fix: rebuild may not work, if project's parallel build option is
enabled.
This commit is contained in:
Roy Qu 2023-03-02 18:15:31 +08:00
parent 5cba7365f5
commit 4ab15c2ee1
7 changed files with 50 additions and 5 deletions

View File

@ -11,6 +11,9 @@ Red Panda C++ Version 2.16
- fix: Can't correctly parse function pointer var definition. - fix: Can't correctly parse function pointer var definition.
- enhancement: Improve support for function pointer typedefs. - enhancement: Improve support for function pointer typedefs.
- enhancement: Improve support for function pointer vars. - enhancement: Improve support for function pointer vars.
- enhancement: When first display two editor panes, auto make them the same width
- change: Don't rebuild the whole project when run/debug, if only contents of project unit file is modified.
- fix: rebuild may not work, if project's parallel build option is enabled.
Red Panda C++ Version 2.15 Red Panda C++ Version 2.15

View File

@ -62,6 +62,9 @@ void Compiler::run()
QElapsedTimer timer; QElapsedTimer timer;
timer.start(); timer.start();
runCommand(mCompiler, mArguments, mDirectory, pipedText()); runCommand(mCompiler, mArguments, mDirectory, pipedText());
for(int i=0;i<mExtraArgumentsList.count();i++) {
runCommand(mExtraCompilersList[i],mExtraArgumentsList[i],mDirectory, pipedText());
}
log(""); log("");
log(tr("Compile Result:")); log(tr("Compile Result:"));
log("------------------"); log("------------------");

View File

@ -90,6 +90,8 @@ protected:
bool mOnlyCheckSyntax; bool mOnlyCheckSyntax;
QString mCompiler; QString mCompiler;
QString mArguments; QString mArguments;
QStringList mExtraCompilersList;
QStringList mExtraArgumentsList;
QString mOutputFile; QString mOutputFile;
int mErrorCount; int mErrorCount;
int mWarningCount; int mWarningCount;

View File

@ -603,10 +603,14 @@ bool ProjectCompiler::prepareForCompile()
mProject->directory(), mProject->directory(),
mProject->makeFileName())); mProject->makeFileName()));
} else if (mRebuild) { } else if (mRebuild) {
mArguments = QString(" %1 -f \"%2\" clean all").arg(parallelParam, mArguments = QString(" -f \"%1\" clean").arg(extractRelativePath(
extractRelativePath(
mProject->directory(), mProject->directory(),
mProject->makeFileName())); mProject->makeFileName()));
mExtraCompilersList.append(mCompiler);
mExtraArgumentsList.append(QString(" %1 -f \"%2\" all").arg(parallelParam,
extractRelativePath(
mProject->directory(),
mProject->makeFileName())));
} else { } else {
mArguments = QString(" %1 -f \"%2\" all").arg(parallelParam, mArguments = QString(" %1 -f \"%2\" all").arg(parallelParam,
extractRelativePath( extractRelativePath(
@ -619,6 +623,9 @@ bool ProjectCompiler::prepareForCompile()
log("--------"); log("--------");
log(tr("- makefile processer: %1").arg(mCompiler)); log(tr("- makefile processer: %1").arg(mCompiler));
log(tr("- Command: %1 %2").arg(extractFileName(mCompiler)).arg(mArguments)); log(tr("- Command: %1 %2").arg(extractFileName(mCompiler)).arg(mArguments));
for(int i=0;i<mExtraCompilersList.count();i++) {
log(tr("- Command: %1 %2").arg(extractFileName(mExtraCompilersList[i])).arg(mExtraArgumentsList[i]));
}
log(""); log("");
return true; return true;

View File

@ -103,6 +103,14 @@ void EditorList::showLayout(LayoutShowType layout)
case LayoutShowType::lstBoth: case LayoutShowType::lstBoth:
mLeftPageWidget->setVisible(true); mLeftPageWidget->setVisible(true);
mRightPageWidget->setVisible(true); mRightPageWidget->setVisible(true);
{
QList<int> sizes=mSplitter->sizes();
int total = sizes[0]+sizes[1];
sizes[0] = total / 2;
sizes[1] = total - sizes[0];
mSplitter->setSizes(sizes);
}
break;
} }
} }

View File

@ -2051,7 +2051,19 @@ void MainWindow::runExecutable(RunType runType)
QStringList binDirs = mProject->binDirs(); QStringList binDirs = mProject->binDirs();
QFileInfo execInfo(mProject->executable()); QFileInfo execInfo(mProject->executable());
QDateTime execModTime = execInfo.lastModified(); QDateTime execModTime = execInfo.lastModified();
if (execInfo.exists() && mProject->modifiedSince(execModTime)) {
//if project options changed, or units added/removed
//mProject->saveAll();
mCompileSuccessionTask=std::make_shared<CompileSuccessionTask>();
mCompileSuccessionTask->type = CompileSuccessionTaskType::RunNormal;
mCompileSuccessionTask->execName=mProject->executable();
mCompileSuccessionTask->isExecutable=true;
mCompileSuccessionTask->binDirs=binDirs;
compile(true);
return;
}
if (execInfo.exists() && mProject->unitsModifiedSince(execModTime)) { if (execInfo.exists() && mProject->unitsModifiedSince(execModTime)) {
//if units modified;
//mProject->saveAll(); //mProject->saveAll();
mCompileSuccessionTask=std::make_shared<CompileSuccessionTask>(); mCompileSuccessionTask=std::make_shared<CompileSuccessionTask>();
mCompileSuccessionTask->type = CompileSuccessionTaskType::RunNormal; mCompileSuccessionTask->type = CompileSuccessionTaskType::RunNormal;
@ -2166,7 +2178,8 @@ void MainWindow::debug()
{ {
QFileInfo execInfo(mProject->executable()); QFileInfo execInfo(mProject->executable());
QDateTime execModTime = execInfo.lastModified(); QDateTime execModTime = execInfo.lastModified();
if (execInfo.exists() && mProject->unitsModifiedSince(execModTime)) { if (execInfo.exists() && mProject->modifiedSince(execModTime)) {
//if project options changed, or units added/removed
//mProject->saveAll(); //mProject->saveAll();
mCompileSuccessionTask=std::make_shared<CompileSuccessionTask>(); mCompileSuccessionTask=std::make_shared<CompileSuccessionTask>();
mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug; mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug;
@ -2176,6 +2189,17 @@ void MainWindow::debug()
compile(true); compile(true);
return; return;
} }
if (execInfo.exists() && mProject->unitsModifiedSince(execModTime)) {
//if units modified
//mProject->saveAll();
mCompileSuccessionTask=std::make_shared<CompileSuccessionTask>();
mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug;
mCompileSuccessionTask->execName=mProject->executable();
mCompileSuccessionTask->isExecutable=true;
mCompileSuccessionTask->binDirs=binDirs;
compile();
return;
}
} }
// Did we choose a host application for our DLL? // Did we choose a host application for our DLL?
if (mProject->options().type == ProjectType::DynamicLib) { if (mProject->options().type == ProjectType::DynamicLib) {

View File

@ -189,8 +189,6 @@ bool Project::modifiedSince(const QDateTime &time)
{ {
if (modified()) if (modified())
return true; return true;
if (unitsModifiedSince(time))
return true;
QFileInfo info(filename()); QFileInfo info(filename());
return (info.lastModified()>time); return (info.lastModified()>time);
} }