- 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.
- enhancement: Improve support for function pointer typedefs.
- 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

View File

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

View File

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

View File

@ -603,10 +603,14 @@ bool ProjectCompiler::prepareForCompile()
mProject->directory(),
mProject->makeFileName()));
} else if (mRebuild) {
mArguments = QString(" %1 -f \"%2\" clean all").arg(parallelParam,
extractRelativePath(
mArguments = QString(" -f \"%1\" clean").arg(extractRelativePath(
mProject->directory(),
mProject->makeFileName()));
mExtraCompilersList.append(mCompiler);
mExtraArgumentsList.append(QString(" %1 -f \"%2\" all").arg(parallelParam,
extractRelativePath(
mProject->directory(),
mProject->makeFileName())));
} else {
mArguments = QString(" %1 -f \"%2\" all").arg(parallelParam,
extractRelativePath(
@ -619,6 +623,9 @@ bool ProjectCompiler::prepareForCompile()
log("--------");
log(tr("- makefile processer: %1").arg(mCompiler));
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("");
return true;

View File

@ -103,6 +103,14 @@ void EditorList::showLayout(LayoutShowType layout)
case LayoutShowType::lstBoth:
mLeftPageWidget->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();
QFileInfo execInfo(mProject->executable());
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 units modified;
//mProject->saveAll();
mCompileSuccessionTask=std::make_shared<CompileSuccessionTask>();
mCompileSuccessionTask->type = CompileSuccessionTaskType::RunNormal;
@ -2166,7 +2178,8 @@ void MainWindow::debug()
{
QFileInfo execInfo(mProject->executable());
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();
mCompileSuccessionTask=std::make_shared<CompileSuccessionTask>();
mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug;
@ -2176,6 +2189,17 @@ void MainWindow::debug()
compile(true);
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?
if (mProject->options().type == ProjectType::DynamicLib) {

View File

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