minor fix and clean up

This commit is contained in:
Roy Qu 2023-09-21 12:52:56 +08:00
parent f145e87962
commit 9557dd8378
3 changed files with 16 additions and 8 deletions

View File

@ -734,6 +734,7 @@ void MainWindow::updateCompileActions(const Editor *e)
switch(fileType) {
case FileType::CSource:
canCompile = set->canCompileC();
qDebug()<<(int)set->compilerType();
#ifdef ENABLE_SDCC
if (set->compilerType()!=CompilerType::SDCC)
#endif
@ -741,6 +742,7 @@ void MainWindow::updateCompileActions(const Editor *e)
canGenerateAssembly = canCompile;
canRun = canCompile ;
}
qDebug()<<canCompile<<canRun;
canDebug = set->canDebug();
break;
case FileType::CppSource:

View File

@ -3627,6 +3627,8 @@ void Settings::Environment::doLoad()
mTerminalPath = stringValue("terminal_path", "");
mTerminalArgumentsPattern = stringValue("terminal_arguments_pattern", "");
checkAndSetTerminal();
mAStylePath = includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"astyle";
mHideNonSupportFilesInFileView=boolValue("hide_non_support_files_file_view",true);
mOpenFilesInSingleInstance = boolValue("open_files_in_single_instance",false);
@ -3791,7 +3793,9 @@ void Settings::Environment::setUseCustomTerminal(bool newUseCustomTerminal)
void Settings::Environment::checkAndSetTerminal()
{
if (!mUseCustomTerminal || !mTerminalPath.isEmpty()) return;
if (!mUseCustomTerminal) return;
if (!mTerminalPath.isEmpty() && !mTerminalArgumentsPattern.isEmpty()) return;
QStringList pathList = getExecutableSearchPaths();
QList<TerminalItem> terminalList = loadTerminalList();
for (const QString &dirPath: pathList) {

View File

@ -546,6 +546,12 @@ public:
class Environment: public _Base {
public:
struct TerminalItem {
QString name;
QString terminal;
QString param;
};
explicit Environment(Settings * settings);
QString theme() const;
void setTheme(const QString &theme);
@ -601,15 +607,11 @@ public:
bool useCustomTerminal() const;
void setUseCustomTerminal(bool newUseCustomTerminal);
private:
struct TerminalItem {
QString terminal;
QString param;
};
void checkAndSetTerminal();
QList<TerminalItem> loadTerminalList() const;
private:
void checkAndSetTerminal();
//Appearance
QString mTheme;
QString mInterfaceFont;