diff --git a/RedPandaIDE/HighlighterManager.cpp b/RedPandaIDE/HighlighterManager.cpp index 70e1bc61..6307c31d 100644 --- a/RedPandaIDE/HighlighterManager.cpp +++ b/RedPandaIDE/HighlighterManager.cpp @@ -34,6 +34,8 @@ PSynHighlighter HighlighterManager::copyHighlighter(PSynHighlighter highlighter) return PSynHighlighter(); if (highlighter->getName() == SYN_HIGHLIGHTER_CPP) return getCppHighlighter(); + //todo + return PSynHighlighter(); } PSynHighlighter HighlighterManager::getCppHighlighter() diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index 1940a878..8c332d52 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -15,6 +15,7 @@ SOURCES += \ compiler/compilermanager.cpp \ compiler/executablerunner.cpp \ compiler/filecompiler.cpp \ + compiler/stdincompiler.cpp \ editor.cpp \ editorlist.cpp \ iconsmanager.cpp \ @@ -58,6 +59,7 @@ HEADERS += \ compiler/compilermanager.h \ compiler/executablerunner.h \ compiler/filecompiler.h \ + compiler/stdincompiler.h \ editor.h \ editorlist.h \ iconsmanager.h \ diff --git a/RedPandaIDE/compiler/compiler.cpp b/RedPandaIDE/compiler/compiler.cpp index 04e48b03..63f0ffcb 100644 --- a/RedPandaIDE/compiler/compiler.cpp +++ b/RedPandaIDE/compiler/compiler.cpp @@ -9,10 +9,13 @@ #include #include -Compiler::Compiler(bool silent,bool onlyCheckSyntax): +#define COMPILE_PROCESS_END "---//END//----" + +Compiler::Compiler(const QString &filename, bool silent, bool onlyCheckSyntax): QThread(), mSilent(silent), - mOnlyCheckSyntax(onlyCheckSyntax) + mOnlyCheckSyntax(onlyCheckSyntax), + mFilename(filename) { } @@ -26,8 +29,7 @@ void Compiler::run() mWarningCount = 0; QElapsedTimer timer; timer.start(); - runCommand(mCompiler, mArguments, QFileInfo(mCompiler).absolutePath()); - + runCommand(mCompiler, mArguments, QFileInfo(mCompiler).absolutePath(), pipedText()); log(""); log(tr("Compile Result:")); log("------------------"); @@ -62,9 +64,10 @@ QString Compiler::getFileNameFromOutputLine(QString &line) { temp = line.mid(0,pos); line.remove(0,pos+1); line=line.trimmed(); -// if (temp.compare("", Qt::CaseInsensitive)!=0 && !QFile(temp).exists()) { -// continue; -// } + if (temp.compare("", Qt::CaseInsensitive)==0 ) { + temp = mFilename; + break; + } if (QFileInfo(temp).fileName() == QLatin1String("ld.exe")) { // skip ld.exe continue; @@ -137,6 +140,13 @@ CompileIssueType Compiler::getIssueTypeFromOutputLine(QString &line) void Compiler::processOutput(QString &line) { + if (line == COMPILE_PROCESS_END) { + if (mLastIssue) { + emit compileIssue(mLastIssue); + mLastIssue.reset(); + } + return; + } QString inFilePrefix = QString("In file included from "); QString fromPrefix = QString("from "); PCompileIssue issue = std::make_shared(); @@ -362,11 +372,14 @@ void Compiler::runCommand(const QString &cmd, const QString &arguments, const Q process.connect(&process, &QProcess::readyReadStandardOutput,[&process,this](){ this->log(QString::fromLocal8Bit( process.readAllStandardOutput())); }); + process.connect(&process, QOverload::of(&QProcess::finished),[&process,this](){ + this->error(COMPILE_PROCESS_END); + }); process.start(); - if (!inputText.isEmpty()) - process.write(inputText.toUtf8()); - process.closeWriteChannel(); process.waitForStarted(5000); + if (!inputText.isEmpty()) + process.write(inputText.toLocal8Bit()); + process.closeWriteChannel(); while (true) { process.waitForFinished(1000); if (process.state()!=QProcess::Running) { @@ -407,7 +420,8 @@ void Compiler::log(const QString &msg) void Compiler::error(const QString &msg) { - emit compileOutput(msg); + if (msg != COMPILE_PROCESS_END) + emit compileOutput(msg); for (QString& s:msg.split("\n")) { if (!s.isEmpty()) processOutput(s); diff --git a/RedPandaIDE/compiler/compiler.h b/RedPandaIDE/compiler/compiler.h index 3d3fd33b..f7313584 100644 --- a/RedPandaIDE/compiler/compiler.h +++ b/RedPandaIDE/compiler/compiler.h @@ -16,7 +16,7 @@ public: Project, StdIn }; - Compiler(bool silent,bool onlyCheckSyntax); + Compiler(const QString& filename, bool silent,bool onlyCheckSyntax); signals: void compileStarted(); @@ -38,6 +38,7 @@ protected: protected: virtual Settings::PCompilerSet compilerSet() = 0; virtual bool prepareForCompile() = 0; + virtual QString pipedText() = 0; virtual QString getCharsetArgument(const QByteArray& encoding); virtual QString getCCompileArguments(bool checkSyntax); virtual QString getCppCompileArguments(bool checkSyntax); @@ -57,6 +58,7 @@ protected: int mErrorCount; int mWarningCount; PCompileIssue mLastIssue; + QString mFilename; private: bool mStop; diff --git a/RedPandaIDE/compiler/compilermanager.cpp b/RedPandaIDE/compiler/compilermanager.cpp index b340f2ec..f56572b0 100644 --- a/RedPandaIDE/compiler/compilermanager.cpp +++ b/RedPandaIDE/compiler/compilermanager.cpp @@ -1,5 +1,6 @@ #include "compilermanager.h" #include "filecompiler.h" +#include "stdincompiler.h" #include #include "../mainwindow.h" #include "executablerunner.h" @@ -41,6 +42,23 @@ void CompilerManager::compile(const QString& filename, const QByteArray& encodin mCompiler->start(); } +void CompilerManager::checkSyntax(const QString &filename, const QString &content) +{ + QMutexLocker locker(&backgroundSyntaxChekMutex); + if (mBackgroundSyntaxChecker!=nullptr) { + return; + } + mSyntaxCheckErrorCount = 0; + mBackgroundSyntaxChecker = new StdinCompiler(filename,content,true,true); + connect(mBackgroundSyntaxChecker, &Compiler::compileFinished, this ,&CompilerManager::onSyntaxCheckFinished); + connect(mBackgroundSyntaxChecker, &Compiler::compileIssue, this, &CompilerManager::onSyntaxCheckIssue); + connect(mBackgroundSyntaxChecker, &Compiler::compileFinished, pMainWindow, &MainWindow::onCompileFinished); + connect(mBackgroundSyntaxChecker, &Compiler::compileOutput, pMainWindow, &MainWindow::onCompileLog); + connect(mBackgroundSyntaxChecker, &Compiler::compileIssue, pMainWindow, &MainWindow::onCompileIssue); + connect(mBackgroundSyntaxChecker, &Compiler::compileErrorOccured, pMainWindow, &MainWindow::onCompileErrorOccured); + mBackgroundSyntaxChecker->start(); +} + void CompilerManager::run(const QString &filename, const QString &arguments, const QString &workDir) { QMutexLocker locker(&runnerMutex); @@ -81,6 +99,18 @@ void CompilerManager::onCompileIssue(PCompileIssue) mCompileErrorCount ++; } +void CompilerManager::onSyntaxCheckFinished() +{ + QMutexLocker locker(&backgroundSyntaxChekMutex); + delete mBackgroundSyntaxChecker; + mBackgroundSyntaxChecker=nullptr; +} + +void CompilerManager::onSyntaxCheckIssue(PCompileIssue) +{ + mSyntaxCheckErrorCount++; +} + int CompilerManager::syntaxCheckErrorCount() const { return mSyntaxCheckErrorCount; diff --git a/RedPandaIDE/compiler/compilermanager.h b/RedPandaIDE/compiler/compilermanager.h index e75269a7..e41d3d7d 100644 --- a/RedPandaIDE/compiler/compilermanager.h +++ b/RedPandaIDE/compiler/compilermanager.h @@ -18,6 +18,7 @@ public: bool backgroundSyntaxChecking(); void compile(const QString& filename, const QByteArray& encoding, bool silent=false,bool onlyCheckSyntax=false); + void checkSyntax(const QString&filename, const QString& content); void run(const QString& filename, const QString& arguments, const QString& workDir); bool canCompile(const QString& filename); int compileErrorCount() const; @@ -25,9 +26,11 @@ public: int syntaxCheckErrorCount() const; private slots: - void onCompileFinished(); void onRunnerTerminated(); + void onCompileFinished(); void onCompileIssue(PCompileIssue issue); + void onSyntaxCheckFinished(); + void onSyntaxCheckIssue(PCompileIssue issue); private: Compiler* mCompiler; diff --git a/RedPandaIDE/compiler/filecompiler.cpp b/RedPandaIDE/compiler/filecompiler.cpp index 8b055ece..2d614bdc 100644 --- a/RedPandaIDE/compiler/filecompiler.cpp +++ b/RedPandaIDE/compiler/filecompiler.cpp @@ -9,8 +9,7 @@ FileCompiler::FileCompiler(const QString &filename, const QByteArray &encoding,bool silent,bool onlyCheckSyntax): - Compiler(silent,onlyCheckSyntax), - mFileName(filename), + Compiler(filename, silent,onlyCheckSyntax), mEncoding(encoding) { @@ -25,13 +24,13 @@ bool FileCompiler::prepareForCompile() { log(tr("Compiling single file...")); log("------------------"); - log(tr("- Filename: %1").arg(mFileName)); + log(tr("- Filename: %1").arg(mFilename)); log(tr("- Compiler Set Name: %1").arg(compilerSet()->name())); log(""); - FileType fileType = getFileType(mFileName); - mArguments= QString(" \"%1\"").arg(mFileName); + FileType fileType = getFileType(mFilename); + mArguments= QString(" \"%1\"").arg(mFilename); if (!mOnlyCheckSyntax) { - mOutputFile = getCompiledExecutableName(mFileName); + mOutputFile = getCompiledExecutableName(mFilename); mArguments+=QString(" -o \"%1\"").arg(mOutputFile); //remove the old file it exists @@ -60,7 +59,7 @@ bool FileCompiler::prepareForCompile() mCompiler = compilerSet()->cppCompiler(); break; default: - throw CompileError(tr("Can't find the compiler for file %1").arg(mFileName)); + throw CompileError(tr("Can't find the compiler for file %1").arg(mFilename)); } mArguments += getLibraryArguments(); @@ -74,3 +73,8 @@ bool FileCompiler::prepareForCompile() log(tr("Command: %1 %2").arg(QFileInfo(mCompiler).fileName()).arg(mArguments)); return true; } + +QString FileCompiler::pipedText() +{ + return QString(); +} diff --git a/RedPandaIDE/compiler/filecompiler.h b/RedPandaIDE/compiler/filecompiler.h index dfb3bf36..faa6230c 100644 --- a/RedPandaIDE/compiler/filecompiler.h +++ b/RedPandaIDE/compiler/filecompiler.h @@ -15,9 +15,11 @@ protected: bool prepareForCompile() override; private: - QString mFileName; QByteArray mEncoding; + // Compiler interface +protected: + QString pipedText(); }; #endif // FILECOMPILER_H diff --git a/RedPandaIDE/compiler/stdincompiler.cpp b/RedPandaIDE/compiler/stdincompiler.cpp new file mode 100644 index 00000000..d58985e5 --- /dev/null +++ b/RedPandaIDE/compiler/stdincompiler.cpp @@ -0,0 +1,63 @@ +#include "stdincompiler.h" +#include "compilermanager.h" +#include +#include + +StdinCompiler::StdinCompiler(const QString &filename, const QString& content, bool silent, bool onlyCheckSyntax): + Compiler(filename,silent,onlyCheckSyntax), + mContent(content) +{ + +} + +Settings::PCompilerSet StdinCompiler::compilerSet() +{ + return pSettings->compilerSets().defaultSet(); +} + +bool StdinCompiler::prepareForCompile() +{ + log(tr("Checking file syntax...")); + log("------------------"); + log(tr("- Filename: %1").arg(mFilename)); + log(tr("- Compiler Set Name: %1").arg(compilerSet()->name())); + log(""); + FileType fileType = getFileType(mFilename); + if (fileType == FileType::Other) + fileType = FileType::CppSource; + QString strFileType; + switch(fileType) { + case FileType::CSource: + mArguments += " -x c - "; + mArguments += getCCompileArguments(mOnlyCheckSyntax); + mArguments += getCIncludeArguments(); + strFileType = "C"; + mCompiler = compilerSet()->CCompiler(); + break; + case FileType::CppSource: + mArguments += " -x c++ - "; + mArguments += getCCompileArguments(mOnlyCheckSyntax); + mArguments += getCIncludeArguments(); + strFileType = "C++"; + mCompiler = compilerSet()->cppCompiler(); + break; + default: + throw CompileError(tr("Can't find the compiler for file %1").arg(mFilename)); + } + mArguments += getLibraryArguments(); + + if (!QFile(mCompiler).exists()) { + throw CompileError(tr("The Compiler '%1' doesn't exists!").arg(mCompiler)); + } + + log(tr("Processing %1 source file:").arg(strFileType)); + log("------------------"); + log(tr("%1 Compiler: %2").arg(strFileType).arg(mCompiler)); + log(tr("Command: %1 %2").arg(QFileInfo(mCompiler).fileName()).arg(mArguments)); + return true; +} + +QString StdinCompiler::pipedText() +{ + return mContent; +} diff --git a/RedPandaIDE/compiler/stdincompiler.h b/RedPandaIDE/compiler/stdincompiler.h new file mode 100644 index 00000000..7d31146f --- /dev/null +++ b/RedPandaIDE/compiler/stdincompiler.h @@ -0,0 +1,26 @@ +#ifndef STDINCOMPILER_H +#define STDINCOMPILER_H + +#include "compiler.h" + +class StdinCompiler : public Compiler +{ + Q_OBJECT + +public: + explicit StdinCompiler(const QString& filename, const QString& content, bool silent,bool onlyCheckSyntax); + + // Compiler interface +protected: + Settings::PCompilerSet compilerSet() override; + bool prepareForCompile() override; + +private: + QString mContent; + + // Compiler interface +protected: + QString pipedText(); +}; + +#endif // STDINCOMPILER_H diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index c308077e..6f46d5be 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -57,7 +57,8 @@ Editor::Editor(QWidget *parent, const QString& filename, mInProject(inProject), mIsNew(isNew), mSyntaxErrorColor(QColorConstants::Red), - mSyntaxWaringColor("orange") + mSyntaxWaringColor("orange"), + mLineCount(0) { if (mFilename.isEmpty()) { newfileCount++; @@ -631,6 +632,11 @@ void Editor::onModificationChanged(bool) { void Editor::onStatusChanged(SynStatusChanges changes) { + if (!changes.testFlag(SynStatusChange::scOpenFile) && (lines()->count()!=mLineCount) + && (lines()->count()!=0) && ((mLineCount>0) || (lines()->count()>1))) { + pMainWindow->checkSyntaxInBack(this); + } + mLineCount = lines()->count(); // if (not (scOpenFile in Changes)) and (fText.Lines.Count <> fLineCount) // and (fText.Lines.Count <> 0) and ((fLineCount>0) or (fText.Lines.Count>1)) then begin // if devCodeCompletion.Enabled diff --git a/RedPandaIDE/editor.h b/RedPandaIDE/editor.h index b44894d4..c3ba1430 100644 --- a/RedPandaIDE/editor.h +++ b/RedPandaIDE/editor.h @@ -144,6 +144,7 @@ private: QColor mSyntaxErrorColor; QColor mSyntaxWaringColor; int mSyntaxErrorLine; + int mLineCount; // QWidget interface protected: diff --git a/RedPandaIDE/editorlist.cpp b/RedPandaIDE/editorlist.cpp index 55145e51..5495ede0 100644 --- a/RedPandaIDE/editorlist.cpp +++ b/RedPandaIDE/editorlist.cpp @@ -135,12 +135,12 @@ bool EditorList::isFileOpened(const QString &name) QString filename = fileInfo.absoluteFilePath(); for (int i=0;icount();i++) { Editor* e = static_cast(mLeftPageWidget->widget(i)); - if (e->filename().compare(filename)==0) + if (e->filename().compare(filename)==0 || e->filename().compare(name)==0) return true; } for (int i=0;icount();i++) { Editor* e = static_cast(mRightPageWidget->widget(i)); - if (e->filename().compare(filename)==0) + if (e->filename().compare(filename)==0 || e->filename().compare(name)==0) return true; } return false; @@ -171,13 +171,13 @@ Editor* EditorList::getOpenedEditorByFilename(const QString &filename) QString fullname = fileInfo.absoluteFilePath(); for (int i=0;icount();i++) { Editor* e = static_cast(mLeftPageWidget->widget(i)); - if (e->filename() == fullname) { + if (e->filename().compare(filename)==0 || e->filename().compare(fullname)==0) { return e; } } for (int i=0;icount();i++) { Editor* e = static_cast(mRightPageWidget->widget(i)); - if (e->filename() == fullname) { + if (e->filename().compare(filename)==0 || e->filename().compare(fullname)==0) { return e; } } @@ -186,15 +186,15 @@ Editor* EditorList::getOpenedEditorByFilename(const QString &filename) Editor *EditorList::getEditorByFilename(const QString &filename) { - QFileInfo fileInfo(filename); - QString fullname = fileInfo.absoluteFilePath(); //check if an editor is already openned - Editor* e=getOpenedEditorByFilename(fullname); + Editor* e=getOpenedEditorByFilename(filename); if (e!=nullptr) return e; //Todo: check if is in the project //Create a new editor + QFileInfo fileInfo(filename); + QString fullname = fileInfo.absoluteFilePath(); if (fileInfo.exists()) return newEditor(fullname,ENCODING_AUTO_DETECT,false,false); return nullptr; diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index a8b09654..304d0386 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -4,6 +4,7 @@ #include "editor.h" #include "systemconsts.h" #include "settings.h" +#include "qsynedit/Constants.h" #include #include @@ -47,6 +48,7 @@ MainWindow::MainWindow(QWidget *parent) ui->EditorTabsRight->setVisible(false); mCompilerSet = new QComboBox(); + mCompilerSet->setMinimumWidth(200); ui->toolbarCompilerSet->addWidget(mCompilerSet); connect(mCompilerSet,QOverload::of(&QComboBox::currentIndexChanged), this, &MainWindow::onCompilerSetChanged); @@ -255,6 +257,45 @@ void MainWindow::updateCompilerSet() mCompilerSet->setCurrentIndex(index); } +void MainWindow::checkSyntaxInBack(Editor *e) +{ + if (e==nullptr) + return; + +// if not devEditor.AutoCheckSyntax then +// Exit; + //not c or cpp file + if (!e->highlighter() || e->highlighter()->getName()!=SYN_HIGHLIGHTER_CPP) + return; + if (mCompilerManager->backgroundSyntaxChecking()) + return; + if (mCompilerManager->compiling()) + return; +// if not Assigned(devCompilerSets.CompilationSet) then +// Exit; +// if fCompiler.Compiling then +// Exit; +// if fSyntaxChecker.Compiling then +// Exit; + if (mCheckSyntaxInBack) + return; + + mCheckSyntaxInBack=true; + e->clearSyntaxIssues(); + ui->tableIssues->clearIssues(); + mCompilerManager->checkSyntax(e->filename(),e->lines()->text()); +// if not PrepareForCompile(cttStdin,True) then begin +// fCheckSyntaxInBack:=False; +// Exit; +// end; +// if e.InProject then begin +// if not assigned(MainForm.fProject) then +// Exit; +// fSyntaxChecker.Project := MainForm.fProject; +// end; +// fSyntaxChecker.CheckSyntax(True); +} + void MainWindow::openCloseMessageSheet(bool open) { // if Assigned(fReportToolWindow) then @@ -436,8 +477,7 @@ void MainWindow::onCompileFinished() Editor * e = mEditorList->getEditor(); if (e!=nullptr) { - e->beginUpdate(); - e->endUpdate(); + e->invalidate(); } // Jump to problem location, sorted by significance @@ -490,6 +530,7 @@ void MainWindow::on_actionCompile_triggered() { Editor * editor = mEditorList->getEditor(); if (editor != NULL ) { + editor->clearSyntaxIssues(); ui->tableIssues->clearIssues(); mCompilerManager->compile(editor->filename(),editor->fileEncoding()); } diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index 35b84f0a..4e10cc22 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -4,7 +4,6 @@ #include #include "common.h" - QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE @@ -13,6 +12,7 @@ class EditorList; class QLabel; class QComboBox; class CompilerManager; +class Editor; class MainWindow : public QMainWindow { @@ -28,6 +28,8 @@ public: void updateEditorSettings(); void updateEditorActions(); void updateEditorColorSchemes(); + void updateCompilerSet(); + void checkSyntaxInBack(Editor* e); void applySettings(); @@ -102,8 +104,6 @@ public slots: private: void setupActions(); - - void updateCompilerSet(); void openCloseMessageSheet(bool open); private: diff --git a/RedPandaIDE/qsynedit/MiscProcs.cpp b/RedPandaIDE/qsynedit/MiscProcs.cpp index 09d66281..dd6ce151 100644 --- a/RedPandaIDE/qsynedit/MiscProcs.cpp +++ b/RedPandaIDE/qsynedit/MiscProcs.cpp @@ -540,6 +540,7 @@ SynFontStyles getFontStyles(const QFont &font) styles.setFlag(SynFontStyle::fsItalic, font.italic()); styles.setFlag(SynFontStyle::fsUnderline, font.underline()); styles.setFlag(SynFontStyle::fsStrikeOut, font.strikeOut()); + return styles; } bool isWordChar(const QChar& ch) { diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 1f90dadb..aac95cb5 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -1860,6 +1860,9 @@ void Settings::CompilerSets::saveSets() for (int i=0;i=mList.size()) { + mDefaultIndex = mList.size()-1; + } mSettings->mSettings.beginGroup(SETTING_COMPILTER_SETS); mSettings->mSettings.setValue(SETTING_COMPILTER_SETS_DEFAULT_INDEX,mDefaultIndex); mSettings->mSettings.setValue(SETTING_COMPILTER_SETS_COUNT,mList.size()); @@ -1888,8 +1891,7 @@ void Settings::CompilerSets::loadSets() +"

" +msg +"Would you like Dev-C++ to remove them for you and add the default paths to the valid paths?

Leaving those directories will lead to problems during compilation.

Unless you know exactly what you're doing, it is recommended that you click Yes.", - QMessageBox::Yes | QMessageBox::No) == QMessageBox::Ok) { - clearSets(); + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { findSets(); saveSets(); if ( mList.size() <= mDefaultIndex) diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp index 52b90a7a..71fe503c 100644 --- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp +++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp @@ -139,6 +139,7 @@ void CompilerSetOptionWidget::doSave() saveCurrentCompilerSet(); } pSettings->compilerSets().saveSets(); + pMainWindow->updateCompilerSet(); } void CompilerSetOptionWidget::on_cbCompilerSet_currentIndexChanged(int index) @@ -219,6 +220,7 @@ void CompilerSetOptionWidget::on_btnFindCompilers_pressed() pSettings->compilerSets().clearSets(); pSettings->compilerSets().findSets(); doLoad(); + setSettingsChanged(); if (pSettings->compilerSets().size()==0) { QMessageBox::warning(this,tr("Failed"),tr("Can't find any compiler.")); }