logic: switched to using wstring for compiler flags
* removed getter for strings from QtDirectoryListBox because it is not used anymore * regard encoding of clang error messages
This commit is contained in:
@@ -240,7 +240,7 @@ void QtDirectoryListBox::dropEvent(QDropEvent *event)
|
||||
std::vector<FilePath> QtDirectoryListBox::getList()
|
||||
{
|
||||
std::vector<FilePath> list;
|
||||
for (const std::wstring& s : getWStringList())
|
||||
for (const std::wstring& s : getStringList())
|
||||
{
|
||||
list.push_back(FilePath(s));
|
||||
}
|
||||
@@ -254,10 +254,10 @@ void QtDirectoryListBox::setList(const std::vector<FilePath>& list, bool readOnl
|
||||
{
|
||||
strList.push_back(path.wstr());
|
||||
}
|
||||
setWStringList(strList, readOnly);
|
||||
setStringList(strList, readOnly);
|
||||
}
|
||||
|
||||
std::vector<std::wstring> QtDirectoryListBox::getWStringList()
|
||||
std::vector<std::wstring> QtDirectoryListBox::getStringList()
|
||||
{
|
||||
std::vector<std::wstring> list;
|
||||
for (int i = 0; i < m_list->count(); ++i)
|
||||
@@ -268,7 +268,7 @@ std::vector<std::wstring> QtDirectoryListBox::getWStringList()
|
||||
return list;
|
||||
}
|
||||
|
||||
void QtDirectoryListBox::setWStringList(const std::vector<std::wstring>& list, bool readOnly)
|
||||
void QtDirectoryListBox::setStringList(const std::vector<std::wstring>& list, bool readOnly)
|
||||
{
|
||||
clear();
|
||||
|
||||
@@ -285,26 +285,6 @@ void QtDirectoryListBox::setWStringList(const std::vector<std::wstring>& list, b
|
||||
m_relativeRootDirectory = root;
|
||||
}
|
||||
|
||||
std::vector<std::string> QtDirectoryListBox::getStringList()
|
||||
{
|
||||
std::vector<std::string> list;
|
||||
for (std::wstring s: getWStringList())
|
||||
{
|
||||
list.push_back(utility::encodeToUtf8(s));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
void QtDirectoryListBox::setStringList(const std::vector<std::string>& list, bool readOnly)
|
||||
{
|
||||
std::vector<std::wstring> wlist;
|
||||
for (std::string s : list)
|
||||
{
|
||||
wlist.push_back(utility::decodeFromUtf8(s));
|
||||
}
|
||||
setWStringList(wlist);
|
||||
}
|
||||
|
||||
QtListItemWidget* QtDirectoryListBox::addListBoxItemWithText(const QString& text)
|
||||
{
|
||||
QtListItemWidget* widget = addListBoxItem();
|
||||
|
||||
@@ -59,11 +59,8 @@ public:
|
||||
std::vector<FilePath> getList();
|
||||
void setList(const std::vector<FilePath>& list, bool readOnly = false);
|
||||
|
||||
std::vector<std::wstring> getWStringList();
|
||||
void setWStringList(const std::vector<std::wstring>& list, bool readOnly = false);
|
||||
|
||||
std::vector<std::string> getStringList();
|
||||
void setStringList(const std::vector<std::string>& list, bool readOnly = false);
|
||||
std::vector<std::wstring> getStringList();
|
||||
void setStringList(const std::vector<std::wstring>& list, bool readOnly = false);
|
||||
|
||||
QtListItemWidget* addListBoxItemWithText(const QString& text);
|
||||
|
||||
|
||||
@@ -644,10 +644,10 @@ void QtProjectWizzard::selectedProjectType(SourceGroupType sourceGroupType)
|
||||
m_newSourceGroupSettings = std::make_shared<SourceGroupSettingsCxxEmpty>(sourceGroupId, sourceGroupType, m_projectSettings.get());
|
||||
if (applicationSettingsContainVisualStudioHeaderSearchPaths())
|
||||
{
|
||||
std::vector<std::string> flags;
|
||||
flags.push_back("-fms-extensions");
|
||||
flags.push_back("-fms-compatibility");
|
||||
flags.push_back("-fms-compatibility-version=19");
|
||||
std::vector<std::wstring> flags;
|
||||
flags.push_back(L"-fms-extensions");
|
||||
flags.push_back(L"-fms-compatibility");
|
||||
flags.push_back(L"-fms-compatibility-version=19");
|
||||
std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_newSourceGroupSettings)->setCompilerFlags(flags);
|
||||
}
|
||||
emptySourceGroup();
|
||||
|
||||
+16
-16
@@ -61,11 +61,11 @@ void QtProjectWizzardContentCrossCompilationOptions::populate(QGridLayout* layou
|
||||
QLabel* label = new QLabel("Architecture:");
|
||||
|
||||
m_arch = new QComboBox();
|
||||
std::vector<std::string> archTypes = SourceGroupSettingsCxxEmpty::getAvailableArchTypes();
|
||||
std::vector<std::wstring> archTypes = SourceGroupSettingsCxxEmpty::getAvailableArchTypes();
|
||||
std::sort(archTypes.begin(), archTypes.end());
|
||||
for (size_t i = 0; i < archTypes.size(); i++)
|
||||
{
|
||||
m_arch->insertItem(i, archTypes[i].c_str());
|
||||
m_arch->insertItem(i, QString::fromStdWString(archTypes[i]));
|
||||
}
|
||||
m_arch->setCurrentIndex(m_arch->findText("x86_64"));
|
||||
|
||||
@@ -77,11 +77,11 @@ void QtProjectWizzardContentCrossCompilationOptions::populate(QGridLayout* layou
|
||||
QLabel* label = new QLabel("Vendor:");
|
||||
|
||||
m_vendor = new QComboBox();
|
||||
std::vector<std::string> vendorTypes = SourceGroupSettingsCxxEmpty::getAvailableVendorTypes();
|
||||
std::vector<std::wstring> vendorTypes = SourceGroupSettingsCxxEmpty::getAvailableVendorTypes();
|
||||
std::sort(vendorTypes.begin() + 1, vendorTypes.end());
|
||||
for (size_t i = 0; i < vendorTypes.size(); i++)
|
||||
{
|
||||
m_vendor->insertItem(i, vendorTypes[i].c_str());
|
||||
m_vendor->insertItem(i, QString::fromStdWString(vendorTypes[i]));
|
||||
}
|
||||
|
||||
gridLayout->addWidget(label, 1, 0, Qt::AlignRight);
|
||||
@@ -92,11 +92,11 @@ void QtProjectWizzardContentCrossCompilationOptions::populate(QGridLayout* layou
|
||||
QLabel* label = new QLabel("OS:");
|
||||
|
||||
m_sys = new QComboBox();
|
||||
std::vector<std::string> osTypes = SourceGroupSettingsCxxEmpty::getAvailableOsTypes();
|
||||
std::vector<std::wstring> osTypes = SourceGroupSettingsCxxEmpty::getAvailableOsTypes();
|
||||
std::sort(osTypes.begin() + 1, osTypes.end());
|
||||
for (size_t i = 0; i < osTypes.size(); i++)
|
||||
{
|
||||
m_sys->insertItem(i, osTypes[i].c_str());
|
||||
m_sys->insertItem(i, QString::fromStdWString(osTypes[i]));
|
||||
}
|
||||
|
||||
gridLayout->addWidget(label, 2, 0, Qt::AlignRight);
|
||||
@@ -107,11 +107,11 @@ void QtProjectWizzardContentCrossCompilationOptions::populate(QGridLayout* layou
|
||||
QLabel* label = new QLabel("Environment:");
|
||||
|
||||
m_abi = new QComboBox();
|
||||
std::vector<std::string> environmentTypes = SourceGroupSettingsCxxEmpty::getAvailableEnvironmentTypes();
|
||||
std::vector<std::wstring> environmentTypes = SourceGroupSettingsCxxEmpty::getAvailableEnvironmentTypes();
|
||||
std::sort(environmentTypes.begin() + 1, environmentTypes.end());
|
||||
for (size_t i = 0; i < environmentTypes.size(); i++)
|
||||
{
|
||||
m_abi->insertItem(i, environmentTypes[i].c_str());
|
||||
m_abi->insertItem(i, QString::fromStdWString(environmentTypes[i]));
|
||||
}
|
||||
|
||||
gridLayout->addWidget(label, 3, 0, Qt::AlignRight);
|
||||
@@ -132,10 +132,10 @@ void QtProjectWizzardContentCrossCompilationOptions::load()
|
||||
if (std::shared_ptr<SourceGroupSettingsCxxEmpty> cxxSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxxEmpty>(m_sourceGroupSettings))
|
||||
{
|
||||
m_useTargetOptions->setChecked(cxxSettings->getTargetOptionsEnabled());
|
||||
m_arch->setCurrentText(QString::fromStdString(cxxSettings->getTargetArch()));
|
||||
m_vendor->setCurrentText(QString::fromStdString(cxxSettings->getTargetVendor()));
|
||||
m_sys->setCurrentText(QString::fromStdString(cxxSettings->getTargetSys()));
|
||||
m_abi->setCurrentText(QString::fromStdString(cxxSettings->getTargetAbi()));
|
||||
m_arch->setCurrentText(QString::fromStdWString(cxxSettings->getTargetArch()));
|
||||
m_vendor->setCurrentText(QString::fromStdWString(cxxSettings->getTargetVendor()));
|
||||
m_sys->setCurrentText(QString::fromStdWString(cxxSettings->getTargetSys()));
|
||||
m_abi->setCurrentText(QString::fromStdWString(cxxSettings->getTargetAbi()));
|
||||
}
|
||||
|
||||
updateTargetOptionsEnabled();
|
||||
@@ -146,10 +146,10 @@ void QtProjectWizzardContentCrossCompilationOptions::save()
|
||||
if (std::shared_ptr<SourceGroupSettingsCxxEmpty> cxxSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxxEmpty>(m_sourceGroupSettings))
|
||||
{
|
||||
cxxSettings->setTargetOptionsEnabled(m_useTargetOptions->isChecked());
|
||||
cxxSettings->setTargetArch(m_arch->currentText().toStdString());
|
||||
cxxSettings->setTargetVendor(m_vendor->currentText().toStdString());
|
||||
cxxSettings->setTargetSys(m_sys->currentText().toStdString());
|
||||
cxxSettings->setTargetAbi(m_abi->currentText().toStdString());
|
||||
cxxSettings->setTargetArch(m_arch->currentText().toStdWString());
|
||||
cxxSettings->setTargetVendor(m_vendor->currentText().toStdWString());
|
||||
cxxSettings->setTargetSys(m_sys->currentText().toStdWString());
|
||||
cxxSettings->setTargetAbi(m_abi->currentText().toStdWString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@ void QtProjectWizzardContentExtensions::populate(QGridLayout* layout, int& row)
|
||||
|
||||
void QtProjectWizzardContentExtensions::load()
|
||||
{
|
||||
m_sourceList->setWStringList(m_settings->getSourceExtensions());
|
||||
m_sourceList->setStringList(m_settings->getSourceExtensions());
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentExtensions::save()
|
||||
{
|
||||
m_settings->setSourceExtensions(m_sourceList->getWStringList());
|
||||
m_settings->setSourceExtensions(m_sourceList->getStringList());
|
||||
}
|
||||
|
||||
@@ -647,7 +647,7 @@ void QtProjectWizzardContentPathsHeaderSearch::finishedAcceptDetectedIncludePath
|
||||
const std::vector<std::wstring> detectedPaths = utility::split<std::vector<std::wstring>>(m_filesDialog->getText(), L"\n");
|
||||
closedFilesDialog();
|
||||
|
||||
std::vector<std::wstring> headerSearchPaths = m_list->getWStringList();
|
||||
std::vector<std::wstring> headerSearchPaths = m_list->getStringList();
|
||||
|
||||
headerSearchPaths.reserve(headerSearchPaths.size() + detectedPaths.size());
|
||||
for (const std::wstring& detectedPath : detectedPaths)
|
||||
@@ -658,7 +658,7 @@ void QtProjectWizzardContentPathsHeaderSearch::finishedAcceptDetectedIncludePath
|
||||
}
|
||||
}
|
||||
|
||||
m_list->setWStringList(headerSearchPaths);
|
||||
m_list->setStringList(headerSearchPaths);
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentPathsHeaderSearch::closedPathsDialog()
|
||||
|
||||
Reference in New Issue
Block a user