- change: Don't turn on "Show some more warnings (-Wextra)" option by default for DEBUG compiler set
- fix: Changes mainwindows's compiler set combobox not correctly handled for project - change: Don't localize autogenerated name for new files and new project (new msys2 gcc compiler can't correctly handle non-ascii chars in filenames)
This commit is contained in:
parent
819d217708
commit
01c1e96aeb
2
NEWS.md
2
NEWS.md
|
@ -12,6 +12,8 @@ Red Panda C++ Version 2.1
|
|||
- change: escape spaces in the executabe path under linux.
|
||||
- fix: Before run a project's executable, we should check timestamp for project files AND modification states of files openned in editor.
|
||||
- change: Don't turn on "Show some more warnings (-Wextra)" option by default for DEBUG compiler set
|
||||
- fix: Changes mainwindows's compiler set combobox not correctly handled for project
|
||||
- change: Don't localize autogenerated name for new files and new project (new msys2 gcc compiler can't correctly handle non-ascii chars in filenames)
|
||||
|
||||
Red Panda C++ Version 2.0
|
||||
|
||||
|
|
|
@ -341,7 +341,7 @@ QString Compiler::getCharsetArgument(const QByteArray& encoding,FileType fileTyp
|
|||
|
||||
}
|
||||
if ((forceExecUTF8 || compilerSet()->autoAddCharsetParams()) && encoding != ENCODING_ASCII
|
||||
&& compilerSet()->compilerType()!=COMPILER_CLANG) {
|
||||
&& compilerSet()->compilerType()!=CompilerType::Clang) {
|
||||
QString encodingName;
|
||||
QString execEncodingName;
|
||||
QString compilerSetExecCharset = compilerSet()->execCharset();
|
||||
|
@ -674,13 +674,13 @@ void Compiler::runCommand(const QString &cmd, const QString &arguments, const Q
|
|||
errorOccurred= true;
|
||||
});
|
||||
process.connect(&process, &QProcess::readyReadStandardError,[&process,this](){
|
||||
if (compilerSet()->compilerType() == COMPILER_CLANG)
|
||||
if (compilerSet()->compilerType() == CompilerType::Clang)
|
||||
this->error(QString::fromUtf8(process.readAllStandardError()));
|
||||
else
|
||||
this->error(QString::fromLocal8Bit( process.readAllStandardError()));
|
||||
});
|
||||
process.connect(&process, &QProcess::readyReadStandardOutput,[&process,this](){
|
||||
if (compilerSet()->compilerType() == COMPILER_CLANG)
|
||||
if (compilerSet()->compilerType() == CompilerType::Clang)
|
||||
this->log(QString::fromUtf8(process.readAllStandardOutput()));
|
||||
else
|
||||
this->log(QString::fromLocal8Bit( process.readAllStandardOutput()));
|
||||
|
|
|
@ -180,16 +180,17 @@ void CompilerInfo::prepareCompilerOptions()
|
|||
|
||||
CompilerInfoManager::CompilerInfoManager()
|
||||
{
|
||||
mInfos.insert(COMPILER_CLANG, std::make_shared<ClangCompilerInfo>());
|
||||
mInfos.insert(COMPILER_GCC, std::make_shared<GCCCompilerInfo>());
|
||||
mInfos.insert(CompilerType::Clang, std::make_shared<ClangCompilerInfo>());
|
||||
mInfos.insert(CompilerType::GCC, std::make_shared<GCCCompilerInfo>());
|
||||
mInfos.insert(CompilerType::GCC_UTF8, std::make_shared<GCCUTF8CompilerInfo>());
|
||||
}
|
||||
|
||||
PCompilerInfo CompilerInfoManager::getInfo(const QString &compilerType)
|
||||
PCompilerInfo CompilerInfoManager::getInfo(CompilerType compilerType)
|
||||
{
|
||||
return getInstance()->mInfos.value(compilerType,PCompilerInfo());
|
||||
}
|
||||
|
||||
bool CompilerInfoManager::hasCompilerOption(const QString &compilerType, const QString &optKey)
|
||||
bool CompilerInfoManager::hasCompilerOption(CompilerType compilerType, const QString &optKey)
|
||||
{
|
||||
PCompilerInfo pInfo = getInfo(compilerType);
|
||||
if (!pInfo)
|
||||
|
@ -197,7 +198,7 @@ bool CompilerInfoManager::hasCompilerOption(const QString &compilerType, const Q
|
|||
return pInfo->hasCompilerOption(optKey);
|
||||
}
|
||||
|
||||
PCompilerOption CompilerInfoManager::getCompilerOption(const QString &compilerType, const QString &optKey)
|
||||
PCompilerOption CompilerInfoManager::getCompilerOption(CompilerType compilerType, const QString &optKey)
|
||||
{
|
||||
PCompilerInfo pInfo = getInfo(compilerType);
|
||||
if (!pInfo)
|
||||
|
@ -205,7 +206,7 @@ PCompilerOption CompilerInfoManager::getCompilerOption(const QString &compilerTy
|
|||
return pInfo->getCompilerOption(optKey);
|
||||
}
|
||||
|
||||
QList<PCompilerOption> CompilerInfoManager::getCompilerOptions(const QString &compilerType)
|
||||
QList<PCompilerOption> CompilerInfoManager::getCompilerOptions(CompilerType compilerType)
|
||||
{
|
||||
PCompilerInfo pInfo = getInfo(compilerType);
|
||||
if (!pInfo)
|
||||
|
@ -213,7 +214,7 @@ QList<PCompilerOption> CompilerInfoManager::getCompilerOptions(const QString &co
|
|||
return pInfo->compilerOptions();
|
||||
}
|
||||
|
||||
bool CompilerInfoManager::supportCovertingCharset(const QString &compilerType)
|
||||
bool CompilerInfoManager::supportCovertingCharset(CompilerType compilerType)
|
||||
{
|
||||
PCompilerInfo pInfo = getInfo(compilerType);
|
||||
if (!pInfo)
|
||||
|
@ -221,7 +222,7 @@ bool CompilerInfoManager::supportCovertingCharset(const QString &compilerType)
|
|||
return pInfo->supportConvertingCharset();
|
||||
}
|
||||
|
||||
bool CompilerInfoManager::forceUTF8InDebugger(const QString &compilerType)
|
||||
bool CompilerInfoManager::forceUTF8InDebugger(CompilerType compilerType)
|
||||
{
|
||||
PCompilerInfo pInfo = getInfo(compilerType);
|
||||
if (!pInfo)
|
||||
|
@ -239,9 +240,9 @@ PCompilerInfoManager CompilerInfoManager::getInstance()
|
|||
return instance;
|
||||
}
|
||||
|
||||
void CompilerInfoManager::addInfo(const QString &name, PCompilerInfo info)
|
||||
void CompilerInfoManager::addInfo(CompilerType compilerType, PCompilerInfo info)
|
||||
{
|
||||
getInstance()->mInfos.insert(name,info);
|
||||
getInstance()->mInfos.insert(compilerType,info);
|
||||
}
|
||||
|
||||
ClangCompilerInfo::ClangCompilerInfo():CompilerInfo(COMPILER_CLANG)
|
||||
|
@ -258,6 +259,11 @@ bool ClangCompilerInfo::forceUTF8InDebugger()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ClangCompilerInfo::forceUTF8InMakefile()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
GCCCompilerInfo::GCCCompilerInfo():CompilerInfo(COMPILER_GCC)
|
||||
{
|
||||
}
|
||||
|
@ -272,6 +278,11 @@ bool GCCCompilerInfo::forceUTF8InDebugger()
|
|||
return false;
|
||||
}
|
||||
|
||||
bool GCCCompilerInfo::forceUTF8InMakefile()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
GCCUTF8CompilerInfo::GCCUTF8CompilerInfo():CompilerInfo(COMPILER_GCC_UTF8)
|
||||
{
|
||||
}
|
||||
|
@ -285,3 +296,8 @@ bool GCCUTF8CompilerInfo::forceUTF8InDebugger()
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GCCUTF8CompilerInfo::forceUTF8InMakefile()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -45,6 +45,18 @@
|
|||
|
||||
#define COMPILER_OPTION_ON "on"
|
||||
|
||||
enum class CompilerSetType {
|
||||
RELEASE,
|
||||
DEBUG,
|
||||
PROFILING
|
||||
};
|
||||
|
||||
enum class CompilerType {
|
||||
GCC,
|
||||
GCC_UTF8,
|
||||
Clang
|
||||
};
|
||||
|
||||
using CompileOptionChoiceList = QList<QPair<QString,QString>>;
|
||||
|
||||
typedef struct {
|
||||
|
@ -73,6 +85,7 @@ public:
|
|||
|
||||
virtual bool supportConvertingCharset()=0;
|
||||
virtual bool forceUTF8InDebugger()=0;
|
||||
virtual bool forceUTF8InMakefile()=0;
|
||||
protected:
|
||||
void addOption(const QString& key,
|
||||
const QString& name,
|
||||
|
@ -98,17 +111,17 @@ using PCompilerInfoManager = std::shared_ptr<CompilerInfoManager>;
|
|||
class CompilerInfoManager {
|
||||
public:
|
||||
CompilerInfoManager();
|
||||
static PCompilerInfo getInfo(const QString& compilerType);
|
||||
static bool hasCompilerOption(const QString& compilerType, const QString& optKey);
|
||||
static PCompilerOption getCompilerOption(const QString& compilerType, const QString& optKey);
|
||||
static QList<PCompilerOption> getCompilerOptions(const QString& compilerType);
|
||||
static bool supportCovertingCharset(const QString& compilerType);
|
||||
static bool forceUTF8InDebugger(const QString& compilerType);
|
||||
static PCompilerInfo getInfo(CompilerType compilerType);
|
||||
static bool hasCompilerOption(CompilerType compilerType, const QString& optKey);
|
||||
static PCompilerOption getCompilerOption(CompilerType compilerType, const QString& optKey);
|
||||
static QList<PCompilerOption> getCompilerOptions(CompilerType compilerType);
|
||||
static bool supportCovertingCharset(CompilerType compilerType);
|
||||
static bool forceUTF8InDebugger(CompilerType compilerType);
|
||||
static PCompilerInfoManager getInstance();
|
||||
static void addInfo(const QString& name, PCompilerInfo info);
|
||||
static void addInfo(CompilerType compilerType, PCompilerInfo info);
|
||||
private:
|
||||
static PCompilerInfoManager instance;
|
||||
QMap<QString,PCompilerInfo> mInfos;
|
||||
QMap<CompilerType,PCompilerInfo> mInfos;
|
||||
};
|
||||
|
||||
class ClangCompilerInfo: public CompilerInfo{
|
||||
|
@ -116,6 +129,7 @@ public:
|
|||
ClangCompilerInfo();
|
||||
bool supportConvertingCharset() override;
|
||||
bool forceUTF8InDebugger() override;
|
||||
bool forceUTF8InMakefile() override;
|
||||
};
|
||||
|
||||
class GCCCompilerInfo: public CompilerInfo{
|
||||
|
@ -123,6 +137,7 @@ public:
|
|||
GCCCompilerInfo();
|
||||
bool supportConvertingCharset() override;
|
||||
bool forceUTF8InDebugger() override;
|
||||
bool forceUTF8InMakefile() override;
|
||||
};
|
||||
|
||||
class GCCUTF8CompilerInfo: public CompilerInfo{
|
||||
|
@ -130,6 +145,7 @@ public:
|
|||
GCCUTF8CompilerInfo();
|
||||
bool supportConvertingCharset() override;
|
||||
bool forceUTF8InDebugger() override;
|
||||
bool forceUTF8InMakefile() override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -384,7 +384,7 @@ void ProjectCompiler::writeMakeObjFilesRules(QFile &file)
|
|||
// Or roll our own
|
||||
} else {
|
||||
QString encodingStr;
|
||||
if (compilerSet()->compilerType() != COMPILER_CLANG && mProject->options().addCharset) {
|
||||
if (compilerSet()->compilerType() != CompilerType::Clang && mProject->options().addCharset) {
|
||||
QByteArray defaultSystemEncoding=pCharsetInfoManager->getDefaultSystemEncoding();
|
||||
QByteArray encoding = mProject->options().execEncoding;
|
||||
QByteArray targetEncoding;
|
||||
|
|
|
@ -72,7 +72,7 @@ const char* SaveException::what() const noexcept {
|
|||
QHash<ParserLanguage,std::weak_ptr<CppParser>> Editor::mSharedParsers;
|
||||
|
||||
Editor::Editor(QWidget *parent):
|
||||
Editor(parent,QObject::tr("untitled"),ENCODING_AUTO_DETECT,nullptr,true,nullptr)
|
||||
Editor(parent,"untitled",ENCODING_AUTO_DETECT,nullptr,true,nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ Editor::Editor(QWidget *parent, const QString& filename,
|
|||
mCurrentLineModified = false;
|
||||
mUseCppSyntax = pSettings->editor().defaultFileCpp();
|
||||
if (mFilename.isEmpty()) {
|
||||
mFilename = tr("untitled")+QString("%1").arg(getNewFileNumber());
|
||||
mFilename = QString("untitled%1").arg(getNewFileNumber());
|
||||
}
|
||||
QFileInfo fileInfo(mFilename);
|
||||
QSynedit::PHighlighter highlighter;
|
||||
|
|
|
@ -3916,11 +3916,11 @@ void MainWindow::onFilesViewCreateFile()
|
|||
suffix=".cpp";
|
||||
else
|
||||
suffix=".c";
|
||||
QString fileName = tr("untitled")+suffix;
|
||||
QString fileName = QString("untitled")+suffix;
|
||||
int count = 0;
|
||||
while (dir.exists(fileName)) {
|
||||
count++;
|
||||
fileName = tr("untitled%1").arg(count)+suffix;
|
||||
fileName = QString("untitled%1").arg(count)+suffix;
|
||||
}
|
||||
QFile file(dir.filePath(fileName));
|
||||
file.open(QFile::NewOnly);
|
||||
|
@ -5044,7 +5044,7 @@ void MainWindow::onCompilerSetChanged(int index)
|
|||
mCompilerSet->setCurrentIndex(mProject->options().compilerSet);
|
||||
return;
|
||||
}
|
||||
mProject->setCompilerSet(mProject->options().compilerSet);
|
||||
mProject->setCompilerSet(index);
|
||||
mProject->saveOptions();
|
||||
scanActiveProject(true);
|
||||
return;
|
||||
|
@ -6669,7 +6669,7 @@ void MainWindow::newProjectUnitFile()
|
|||
return;
|
||||
} else {
|
||||
do {
|
||||
newFileName = tr("untitled")+QString("%1").arg(getNewFileNumber());
|
||||
newFileName = QString("untitled")+QString("%1").arg(getNewFileNumber());
|
||||
if (mProject->options().isCpp)
|
||||
newFileName += ".cpp";
|
||||
else
|
||||
|
|
|
@ -343,7 +343,7 @@ PProjectUnit Project::newUnit(PProjectModelNode parentNode, const QString& custo
|
|||
// Find unused 'new' filename
|
||||
if (customFileName.isEmpty()) {
|
||||
do {
|
||||
s = cleanPath(dir.absoluteFilePath(tr("untitled")+QString("%1").arg(getNewFileNumber())));
|
||||
s = cleanPath(dir.absoluteFilePath(QString("untitled%1").arg(getNewFileNumber())));
|
||||
} while (fileExists(s));
|
||||
} else {
|
||||
s = cleanPath(dir.absoluteFilePath(customFileName));
|
||||
|
@ -1123,7 +1123,7 @@ void Project::saveOptions()
|
|||
ini.SetLongValue("Project","IncludeVersionInfo", mOptions.includeVersionInfo);
|
||||
ini.SetLongValue("Project","SupportXPThemes", mOptions.supportXPThemes);
|
||||
ini.SetLongValue("Project","CompilerSet", mOptions.compilerSet);
|
||||
ini.SetLongValue("Project","CompilerSetType", mOptions.compilerSetType);
|
||||
ini.SetLongValue("Project","CompilerSetType", (int)mOptions.compilerSetType);
|
||||
ini.Delete("Project","CompilerSettings"); // remove old compiler settings
|
||||
ini.Delete("CompilerSettings",nullptr); // remove old compiler settings
|
||||
foreach (const QString& key, mOptions.compilerOptions.keys()) {
|
||||
|
@ -2043,8 +2043,11 @@ void Project::loadOptions(SimpleIni& ini)
|
|||
mOptions.execEncoding = ini.GetValue("Project","ExecEncoding", ENCODING_SYSTEM_DEFAULT);
|
||||
mOptions.addCharset = ini.GetBoolValue("Project", "AddCharset", true);
|
||||
|
||||
if (mOptions.compilerSetType<0) {
|
||||
int val=ini.GetLongValue("Project","CompilerSetType",-1);
|
||||
if (val<0) {
|
||||
updateCompilerSetType();
|
||||
} else {
|
||||
mOptions.compilerSetType=(CompilerSetType)val;
|
||||
}
|
||||
bool useUTF8 = ini.GetBoolValue("Project", "UseUTF8", false);
|
||||
if (useUTF8) {
|
||||
|
@ -2179,7 +2182,7 @@ void Project::updateCompilerSetType()
|
|||
mOptions.staticLink = defaultSet->staticLink();
|
||||
mOptions.compilerOptions = defaultSet->compileOptions();
|
||||
} else {
|
||||
mOptions.compilerSetType=CST_DEBUG;
|
||||
mOptions.compilerSetType=CompilerSetType::DEBUG;
|
||||
mOptions.staticLink = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ ProjectOptions::ProjectOptions()
|
|||
includeVersionInfo = false;
|
||||
supportXPThemes = false;
|
||||
compilerSet = 0;
|
||||
compilerSetType = 0;
|
||||
compilerSetType = CompilerSetType::DEBUG;
|
||||
staticLink = true;
|
||||
addCharset = true;
|
||||
modelType = ProjectModelType::FileSystem;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include <QMap>
|
||||
#include <QWidget>
|
||||
#include "compiler/compilerinfo.h"
|
||||
|
||||
enum class ProjectModelType {
|
||||
FileSystem,
|
||||
|
@ -88,7 +89,7 @@ struct ProjectOptions{
|
|||
bool includeVersionInfo;
|
||||
bool supportXPThemes;
|
||||
int compilerSet;
|
||||
int compilerSetType;
|
||||
CompilerSetType compilerSetType;
|
||||
QMap<QString,QString> compilerOptions;
|
||||
ProjectVersionInfo versionInfo;
|
||||
QString cmdLineArgs;
|
||||
|
|
|
@ -2024,7 +2024,7 @@ void Settings::CompilerSet::setProperties(const QString &binDir, const QString&
|
|||
targetStr = "clang version ";
|
||||
delimPos1 = output.indexOf(targetStr);
|
||||
if (delimPos1>=0) {
|
||||
mCompilerType = COMPILER_CLANG;
|
||||
mCompilerType = CompilerType::Clang;
|
||||
delimPos1+=strlen(targetStr);
|
||||
delimPos2 = delimPos1;
|
||||
while (delimPos2<output.length() && !isNonPrintableAsciiChar(output[delimPos2]))
|
||||
|
@ -2033,7 +2033,7 @@ void Settings::CompilerSet::setProperties(const QString &binDir, const QString&
|
|||
|
||||
mName = "Clang " + mVersion;
|
||||
} else {
|
||||
mCompilerType = COMPILER_GCC;
|
||||
mCompilerType = CompilerType::GCC;
|
||||
targetStr = "gcc version ";
|
||||
delimPos1 = output.indexOf(targetStr);
|
||||
if (delimPos1<0)
|
||||
|
@ -2044,6 +2044,18 @@ void Settings::CompilerSet::setProperties(const QString &binDir, const QString&
|
|||
delimPos2++;
|
||||
mVersion = output.mid(delimPos1,delimPos2-delimPos1);
|
||||
|
||||
int majorVersion;
|
||||
if (mVersion.indexOf('.')>0) {
|
||||
bool ok;
|
||||
majorVersion=mVersion.left(mVersion.indexOf('.')).toInt(&ok);
|
||||
if (!ok)
|
||||
majorVersion=-1;
|
||||
} else {
|
||||
bool ok;
|
||||
majorVersion=mVersion.toInt(&ok);
|
||||
if (!ok)
|
||||
majorVersion=-1;
|
||||
}
|
||||
// //fix for mingw64 gcc
|
||||
// double versionValue;
|
||||
// bool ok;
|
||||
|
@ -2060,6 +2072,8 @@ void Settings::CompilerSet::setProperties(const QString &binDir, const QString&
|
|||
delimPos2++;
|
||||
mType = output.mid(delimPos1 + 1, delimPos2 - delimPos1 - 1);
|
||||
|
||||
if (majorVersion>=12 && mType.contains("MSYS2"))
|
||||
mCompilerType = CompilerType::GCC_UTF8;
|
||||
// Assemble user friendly name if we don't have one yet
|
||||
if (mName == "") {
|
||||
if (mType.contains("tdm64")) {
|
||||
|
@ -2153,7 +2167,7 @@ void Settings::CompilerSet::setDefines() {
|
|||
|
||||
void Settings::CompilerSet::setExecutables()
|
||||
{
|
||||
if (mCompilerType == COMPILER_CLANG) {
|
||||
if (mCompilerType == CompilerType::Clang) {
|
||||
mCCompiler = findProgramInBinDirs(CLANG_PROGRAM);
|
||||
mCppCompiler = findProgramInBinDirs(CLANG_CPP_PROGRAM);
|
||||
mDebugger = findProgramInBinDirs(GDB_PROGRAM);
|
||||
|
@ -2177,11 +2191,11 @@ void Settings::CompilerSet::setExecutables()
|
|||
mProfiler = findProgramInBinDirs(GPROF_PROGRAM);
|
||||
}
|
||||
|
||||
void Settings::CompilerSet::setDirectories(const QString& binDir,const QString& compilerType)
|
||||
void Settings::CompilerSet::setDirectories(const QString& binDir,CompilerType compilerType)
|
||||
{
|
||||
QString folder = QFileInfo(binDir).absolutePath();
|
||||
QString cc_prog;
|
||||
if (compilerType==COMPILER_CLANG)
|
||||
if (compilerType==CompilerType::Clang)
|
||||
cc_prog = CLANG_PROGRAM;
|
||||
else
|
||||
cc_prog = GCC_PROGRAM;
|
||||
|
@ -2472,22 +2486,22 @@ void Settings::CompilerSet::setDebugServer(const QString &newDebugServer)
|
|||
mDebugServer = newDebugServer;
|
||||
}
|
||||
|
||||
int Settings::CompilerSet::compilerSetType() const
|
||||
CompilerSetType Settings::CompilerSet::compilerSetType() const
|
||||
{
|
||||
return mCompilerSetType;
|
||||
}
|
||||
|
||||
void Settings::CompilerSet::setCompilerSetType(int newCompilerSetType)
|
||||
void Settings::CompilerSet::setCompilerSetType(CompilerSetType newCompilerSetType)
|
||||
{
|
||||
mCompilerSetType = newCompilerSetType;
|
||||
}
|
||||
|
||||
void Settings::CompilerSet::setCompilerType(const QString &newCompilerType)
|
||||
void Settings::CompilerSet::setCompilerType(CompilerType newCompilerType)
|
||||
{
|
||||
mCompilerType = newCompilerType;
|
||||
}
|
||||
|
||||
const QString &Settings::CompilerSet::compilerType() const
|
||||
CompilerType Settings::CompilerSet::compilerType() const
|
||||
{
|
||||
return mCompilerType;
|
||||
}
|
||||
|
@ -2524,7 +2538,7 @@ Settings::PCompilerSet Settings::CompilerSets::addSet()
|
|||
Settings::PCompilerSet Settings::CompilerSets::addSet(const QString &folder, const QString& cc_prog)
|
||||
{
|
||||
PCompilerSet p=std::make_shared<CompilerSet>(folder,cc_prog);
|
||||
if (cc_prog==GCC_PROGRAM && p->compilerType()==COMPILER_CLANG)
|
||||
if (cc_prog==GCC_PROGRAM && p->compilerType()==CompilerType::Clang)
|
||||
return PCompilerSet();
|
||||
mList.push_back(p);
|
||||
return p;
|
||||
|
@ -2576,13 +2590,13 @@ bool Settings::CompilerSets::addSets(const QString &folder, const QString& cc_pr
|
|||
PCompilerSet set= addSet(baseSet);
|
||||
platformName = "32-bit";
|
||||
set->setName(baseName + " " + platformName + " Release");
|
||||
set->setCompilerSetType(CompilerSetType::CST_RELEASE);
|
||||
set->setCompilerSetType(CompilerSetType::RELEASE);
|
||||
set64_32Options(set);
|
||||
setReleaseOptions(set);
|
||||
|
||||
set = addSet(baseSet);
|
||||
set->setName(baseName + " " + platformName + " Debug");
|
||||
set->setCompilerSetType(CompilerSetType::CST_DEBUG);
|
||||
set->setCompilerSetType(CompilerSetType::DEBUG);
|
||||
set64_32Options(set);
|
||||
setDebugOptions(set);
|
||||
}
|
||||
|
@ -2594,11 +2608,11 @@ bool Settings::CompilerSets::addSets(const QString &folder, const QString& cc_pr
|
|||
|
||||
PCompilerSet set = addSet(baseSet);
|
||||
set->setName(baseName + " " + platformName + " Debug");
|
||||
set->setCompilerSetType(CompilerSetType::CST_DEBUG);
|
||||
set->setCompilerSetType(CompilerSetType::DEBUG);
|
||||
setDebugOptions(set);
|
||||
|
||||
baseSet->setName(baseName + " " + platformName + " Release");
|
||||
baseSet->setCompilerSetType(CompilerSetType::CST_RELEASE);
|
||||
baseSet->setCompilerSetType(CompilerSetType::RELEASE);
|
||||
setReleaseOptions(baseSet);
|
||||
|
||||
// baseSet = addSet(folder);
|
||||
|
@ -2902,8 +2916,8 @@ void Settings::CompilerSets::saveSet(int index)
|
|||
mSettings->mSettings.setValue("Type", pSet->type());
|
||||
mSettings->mSettings.setValue("Name", pSet->name());
|
||||
mSettings->mSettings.setValue("Target", pSet->target());
|
||||
mSettings->mSettings.setValue("CompilerType", pSet->compilerType());
|
||||
mSettings->mSettings.setValue("CompilerSetType", pSet->compilerSetType());
|
||||
mSettings->mSettings.setValue("CompilerType", (int)pSet->compilerType());
|
||||
mSettings->mSettings.setValue("CompilerSetType", (int)pSet->compilerSetType());
|
||||
|
||||
// Paths
|
||||
savePathList("Bins",pSet->binDirs());
|
||||
|
@ -2955,8 +2969,19 @@ Settings::PCompilerSet Settings::CompilerSets::loadSet(int index)
|
|||
pSet->setType(mSettings->mSettings.value("Type").toString());
|
||||
pSet->setName(mSettings->mSettings.value("Name").toString());
|
||||
pSet->setTarget(mSettings->mSettings.value("Target").toString());
|
||||
pSet->setCompilerType(mSettings->mSettings.value("CompilerType").toString());
|
||||
pSet->setCompilerSetType(mSettings->mSettings.value("CompilerSetType").toInt());
|
||||
//compatibility
|
||||
QString temp = mSettings->mSettings.value("CompilerType").toString();
|
||||
if (temp==COMPILER_CLANG) {
|
||||
pSet->setCompilerType(CompilerType::Clang);
|
||||
} else if (temp==COMPILER_GCC) {
|
||||
pSet->setCompilerType(CompilerType::GCC);
|
||||
} else if (temp==COMPILER_GCC_UTF8) {
|
||||
pSet->setCompilerType(CompilerType::GCC_UTF8);
|
||||
} else {
|
||||
pSet->setCompilerType((CompilerType)mSettings->mSettings.value("CompilerType").toInt());
|
||||
}
|
||||
|
||||
pSet->setCompilerSetType((CompilerSetType)mSettings->mSettings.value("CompilerSetType").toInt());
|
||||
|
||||
// Load extra 'general' options
|
||||
pSet->setUseCustomCompileParams(mSettings->mSettings.value("useCustomCompileParams", false).toBool());
|
||||
|
|
|
@ -53,12 +53,6 @@ extern const char ValueToChar[28];
|
|||
|
||||
class Settings;
|
||||
|
||||
enum CompilerSetType {
|
||||
CST_RELEASE,
|
||||
CST_DEBUG,
|
||||
CST_PROFILING
|
||||
};
|
||||
|
||||
class Settings
|
||||
{
|
||||
private:
|
||||
|
@ -1294,12 +1288,12 @@ public:
|
|||
|
||||
static int charToValue(char valueChar);
|
||||
static char valueToChar(int val);
|
||||
const QString &compilerType() const;
|
||||
CompilerType compilerType() const;
|
||||
|
||||
void setCompilerType(const QString &newCompilerType);
|
||||
void setCompilerType(CompilerType newCompilerType);
|
||||
|
||||
int compilerSetType() const;
|
||||
void setCompilerSetType(int newCompilerSetType);
|
||||
CompilerSetType compilerSetType() const;
|
||||
void setCompilerSetType(CompilerSetType newCompilerSetType);
|
||||
|
||||
const QString &execCharset() const;
|
||||
void setExecCharset(const QString &newExecCharset);
|
||||
|
@ -1325,7 +1319,7 @@ public:
|
|||
bool isOutputExecutable();
|
||||
|
||||
private:
|
||||
void setDirectories(const QString& binDir, const QString& mCompilerType);
|
||||
void setDirectories(const QString& binDir, CompilerType mCompilerType);
|
||||
//load hard defines
|
||||
void setDefines();
|
||||
void setExecutables();
|
||||
|
@ -1363,8 +1357,8 @@ public:
|
|||
QStringList mCppDefines; // list of predefined constants
|
||||
QStringList mCDefines; // list of predefined constants
|
||||
QString mTarget; // 'X86_64' / 'i686'
|
||||
QString mCompilerType; // 'Clang' / 'GCC'
|
||||
int mCompilerSetType; // RELEASE/ DEBUG/ Profile
|
||||
CompilerType mCompilerType; // 'Clang' / 'GCC'
|
||||
CompilerSetType mCompilerSetType; // RELEASE/ DEBUG/ Profile
|
||||
|
||||
// User settings
|
||||
bool mUseCustomCompileParams;
|
||||
|
|
|
@ -72,12 +72,12 @@ void CompilerSetOptionWidget::init()
|
|||
|
||||
|
||||
static void loadCompilerSetSettings(Settings::PCompilerSet pSet, Ui::CompilerSetOptionWidget* ui) {
|
||||
ui->chkAutoAddCharset->setEnabled(pSet->compilerType() != COMPILER_CLANG);
|
||||
ui->chkAutoAddCharset->setVisible(pSet->compilerType() != COMPILER_CLANG);
|
||||
ui->cbEncoding->setEnabled(pSet->compilerType() != COMPILER_CLANG);
|
||||
ui->cbEncoding->setVisible(pSet->compilerType() != COMPILER_CLANG);
|
||||
ui->cbEncodingDetails->setEnabled(pSet->compilerType() != COMPILER_CLANG);
|
||||
ui->cbEncodingDetails->setVisible(pSet->compilerType() != COMPILER_CLANG);
|
||||
ui->chkAutoAddCharset->setEnabled(pSet->compilerType() != CompilerType::Clang);
|
||||
ui->chkAutoAddCharset->setVisible(pSet->compilerType() != CompilerType::Clang);
|
||||
ui->cbEncoding->setEnabled(pSet->compilerType() != CompilerType::Clang);
|
||||
ui->cbEncoding->setVisible(pSet->compilerType() != CompilerType::Clang);
|
||||
ui->cbEncodingDetails->setEnabled(pSet->compilerType() != CompilerType::Clang);
|
||||
ui->cbEncodingDetails->setVisible(pSet->compilerType() != CompilerType::Clang);
|
||||
|
||||
ui->chkUseCustomCompilerParams->setChecked(pSet->useCustomCompileParams());
|
||||
ui->txtCustomCompileParams->setPlainText(pSet->customCompileParams());
|
||||
|
|
|
@ -38,7 +38,7 @@ void ProjectCompilerWidget::refreshOptions()
|
|||
Settings::PCompilerSet pSet = pSettings->compilerSets().getSet(ui->cbCompilerSet->currentIndex());
|
||||
if (!pSet)
|
||||
return;
|
||||
ui->panelAddCharset->setVisible(pSet->compilerType()!=COMPILER_CLANG);
|
||||
ui->panelAddCharset->setVisible(pSet->compilerType()!=CompilerType::Clang);
|
||||
//ui->chkAddCharset->setEnabled(pSet->compilerType()!=COMPILER_CLANG);
|
||||
mOptions = pMainWindow->project()->options().compilerOptions;
|
||||
if (mOptions.isEmpty())
|
||||
|
@ -87,7 +87,7 @@ void ProjectCompilerWidget::doSave()
|
|||
|
||||
pMainWindow->project()->setCompilerSet(ui->cbCompilerSet->currentIndex());
|
||||
pMainWindow->project()->options().compilerOptions = ui->tabOptions->arguments(true);
|
||||
if (pSet->compilerType()!=COMPILER_CLANG)
|
||||
if (pSet->compilerType()!=CompilerType::Clang)
|
||||
pMainWindow->project()->options().addCharset = ui->chkAddCharset->isChecked();
|
||||
pMainWindow->project()->options().staticLink = ui->chkStaticLink->isChecked();
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
void setBoolArgument(const QString &argKey, bool checked);
|
||||
|
||||
private:
|
||||
QString mCompilerType;
|
||||
CompilerType mCompilerType;
|
||||
};
|
||||
|
||||
#endif // COMPILEARGUMENTSWIDGET_H
|
||||
|
|
|
@ -43,7 +43,7 @@ NewProjectDialog::NewProjectDialog(QWidget *parent) :
|
|||
location = excludeTrailingPathDelimiter(pSettings->dirs().projectDir());
|
||||
while (true) {
|
||||
i++;
|
||||
projectName = tr("Project%1").arg(i);
|
||||
projectName = QString("Project%1").arg(i);
|
||||
QString tempLocation = includeTrailingPathDelimiter(location)+projectName;
|
||||
if (!QDir(tempLocation).exists())
|
||||
break;
|
||||
|
|
|
@ -192,7 +192,7 @@ void SynExporter::setTitle(const QString &Value)
|
|||
if (!Value.isEmpty())
|
||||
mTitle = Value;
|
||||
else
|
||||
mTitle = QObject::tr("Untitled");
|
||||
mTitle = "Untitled";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue