Skip to content
Snippets Groups Projects
Commit c4bf5f8b authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

"" instead of QString() in default argument or return value

parent fa69f2fe
No related branches found
No related tags found
No related merge requests found
Showing
with 29 additions and 29 deletions
...@@ -29,7 +29,7 @@ public: ...@@ -29,7 +29,7 @@ public:
ComboProperty(); ComboProperty();
static ComboProperty fromList(const QStringList& values, static ComboProperty fromList(const QStringList& values,
const QString& current_value = QString()); const QString& current_value = "");
QString getValue() const; QString getValue() const;
void setValue(const QString& name); void setValue(const QString& name);
......
...@@ -37,7 +37,7 @@ public: ...@@ -37,7 +37,7 @@ public:
SessionItem* populateSampleModel(SampleModel* sampleModel, MaterialModel* materialModel, SessionItem* populateSampleModel(SampleModel* sampleModel, MaterialModel* materialModel,
const MultiLayer& sample, const MultiLayer& sample,
const QString& sample_name = QString()); const QString& sample_name = "");
using INodeVisitor::visit; using INodeVisitor::visit;
......
...@@ -39,11 +39,11 @@ BA_CORE_API_ SessionItem* populateSampleModelFromSim(SampleModel* sampleModel, ...@@ -39,11 +39,11 @@ BA_CORE_API_ SessionItem* populateSampleModelFromSim(SampleModel* sampleModel,
BA_CORE_API_ SessionItem* populateSampleModel(SampleModel* sampleModel, BA_CORE_API_ SessionItem* populateSampleModel(SampleModel* sampleModel,
MaterialModel* materialModel, MaterialModel* materialModel,
const MultiLayer& sample, const MultiLayer& sample,
const QString& sample_name = QString()); const QString& sample_name = "");
BA_CORE_API_ SessionItem* populateInstrumentModel(InstrumentModel* p_instrument_model, BA_CORE_API_ SessionItem* populateInstrumentModel(InstrumentModel* p_instrument_model,
const Simulation& simulation, const Simulation& simulation,
const QString& instrument_name = QString()); const QString& instrument_name = "");
BA_CORE_API_ SessionItem* populateDocumentModel(DocumentModel* p_documentModel, BA_CORE_API_ SessionItem* populateDocumentModel(DocumentModel* p_documentModel,
const Simulation& simulation); const Simulation& simulation);
......
...@@ -39,7 +39,7 @@ void GroupInfo::add(const QString& itemType, const QString& itemLabel) ...@@ -39,7 +39,7 @@ void GroupInfo::add(const QString& itemType, const QString& itemLabel)
QString GroupInfo::defaultType() const QString GroupInfo::defaultType() const
{ {
if (m_defaultItemType == QString() && m_info.size() != 0) if (m_defaultItemType == "" && m_info.size() != 0)
return m_info[0].m_itemType; return m_info[0].m_itemType;
return m_defaultItemType; return m_defaultItemType;
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
class BA_CORE_API_ GroupInfo class BA_CORE_API_ GroupInfo
{ {
public: public:
explicit GroupInfo(const QString& groupType = QString(), bool is_sorted = true); explicit GroupInfo(const QString& groupType = "", bool is_sorted = true);
void add(const QString& itemType, const QString& itemLabel); void add(const QString& itemType, const QString& itemLabel);
......
...@@ -132,7 +132,7 @@ ComboProperty JobItemUtils::availableUnits(const IUnitConverter& converter) ...@@ -132,7 +132,7 @@ ComboProperty JobItemUtils::availableUnits(const IUnitConverter& converter)
ComboProperty result; ComboProperty result;
for (auto units : converter.availableUnits()) { for (auto units : converter.availableUnits()) {
auto unit_name = nameFromAxesUnits(units); auto unit_name = nameFromAxesUnits(units);
if (unit_name != QString()) if (unit_name != "")
result << unit_name; result << unit_name;
} }
......
...@@ -28,7 +28,7 @@ QString ModelPath::getPathFromIndex(const QModelIndex& index) ...@@ -28,7 +28,7 @@ QString ModelPath::getPathFromIndex(const QModelIndex& index)
std::reverse(namePath.begin(), namePath.end()); std::reverse(namePath.begin(), namePath.end());
return namePath.join("/"); return namePath.join("/");
} }
return QString(); return "";
} }
// TODO cover with unit tests and simplify // TODO cover with unit tests and simplify
......
...@@ -26,7 +26,7 @@ class SessionModel; ...@@ -26,7 +26,7 @@ class SessionModel;
namespace ModelUtils namespace ModelUtils
{ {
//! Returns list of top iten manes. //! Returns list of top iten manes.
BA_CORE_API_ QStringList topItemNames(SessionModel* model, const QString& modelType = QString()); BA_CORE_API_ QStringList topItemNames(SessionModel* model, const QString& modelType = "");
//! Iterates through all model indices and calls user function. //! Iterates through all model indices and calls user function.
BA_CORE_API_ void iterate(const QModelIndex& index, const QAbstractItemModel* model, BA_CORE_API_ void iterate(const QModelIndex& index, const QAbstractItemModel* model,
......
...@@ -25,7 +25,7 @@ public: ...@@ -25,7 +25,7 @@ public:
static const QString P_YPOS; static const QString P_YPOS;
protected: protected:
explicit SessionGraphicsItem(const QString& model_type = QString()); explicit SessionGraphicsItem(const QString& model_type = "");
}; };
#endif // BORNAGAIN_GUI_COREGUI_MODELS_SESSIONGRAPHICSITEM_H #endif // BORNAGAIN_GUI_COREGUI_MODELS_SESSIONGRAPHICSITEM_H
...@@ -33,7 +33,7 @@ class BA_CORE_API_ SessionItem ...@@ -33,7 +33,7 @@ class BA_CORE_API_ SessionItem
public: public:
static const QString P_NAME; static const QString P_NAME;
explicit SessionItem(const QString& modelType = QString()); explicit SessionItem(const QString& modelType = "");
virtual ~SessionItem(); virtual ~SessionItem();
SessionModel* model() const; SessionModel* model() const;
SessionItem* parent() const; SessionItem* parent() const;
...@@ -59,10 +59,10 @@ public: ...@@ -59,10 +59,10 @@ public:
QVector<QString> acceptableDefaultItemTypes() const; QVector<QString> acceptableDefaultItemTypes() const;
// access tagged items // access tagged items
SessionItem* getItem(const QString& tag = QString(), int row = 0) const; SessionItem* getItem(const QString& tag = "", int row = 0) const;
template <typename T> T& item(const QString& tag) const; template <typename T> T& item(const QString& tag) const;
QVector<SessionItem*> getItems(const QString& tag = QString()) const; QVector<SessionItem*> getItems(const QString& tag = "") const;
bool insertItem(int row, SessionItem* item, const QString& tag = QString()); bool insertItem(int row, SessionItem* item, const QString& tag = "");
SessionItem* takeItem(int row, const QString& tag); SessionItem* takeItem(int row, const QString& tag);
// convenience functions for properties // convenience functions for properties
......
...@@ -114,7 +114,7 @@ int SessionItemTags::insertIndexFromTagRow(const QString& tagName, int row) ...@@ -114,7 +114,7 @@ int SessionItemTags::insertIndexFromTagRow(const QString& tagName, int row)
QString SessionItemTags::tagFromIndex(int index) const QString SessionItemTags::tagFromIndex(int index) const
{ {
if (index < 0) if (index < 0)
return QString(); return "";
for (const auto& tag : m_tags) { for (const auto& tag : m_tags) {
if (index < tag.childCount) if (index < tag.childCount)
...@@ -123,7 +123,7 @@ QString SessionItemTags::tagFromIndex(int index) const ...@@ -123,7 +123,7 @@ QString SessionItemTags::tagFromIndex(int index) const
index -= tag.childCount; index -= tag.childCount;
} }
return QString(); return "";
} }
int SessionItemTags::childCount(const QString& tagName) int SessionItemTags::childCount(const QString& tagName)
......
...@@ -27,7 +27,7 @@ class BA_CORE_API_ SessionItemTags ...@@ -27,7 +27,7 @@ class BA_CORE_API_ SessionItemTags
public: public:
bool registerTag(const QString& name, int min, int max, const QStringList& modelTypes); bool registerTag(const QString& name, int min, int max, const QStringList& modelTypes);
bool isValid(const QString& tagName, const QString& modelType = QString()) const; bool isValid(const QString& tagName, const QString& modelType = "") const;
QStringList modelTypesForTag(const QString& tagName) const; QStringList modelTypesForTag(const QString& tagName) const;
......
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
QModelIndex indexOfItem(SessionItem* item) const; QModelIndex indexOfItem(SessionItem* item) const;
SessionItem* insertNewItem(QString model_type, const QModelIndex& parent = QModelIndex(), SessionItem* insertNewItem(QString model_type, const QModelIndex& parent = QModelIndex(),
int row = -1, QString tag = QString()); int row = -1, QString tag = "");
QString getModelTag() const; QString getModelTag() const;
QString getModelName() const; QString getModelName() const;
...@@ -63,8 +63,8 @@ public: ...@@ -63,8 +63,8 @@ public:
QVector<QString> acceptableDefaultItemTypes(const QModelIndex& parent) const; QVector<QString> acceptableDefaultItemTypes(const QModelIndex& parent) const;
virtual void clear(); virtual void clear();
void load(const QString& filename = QString()); void load(const QString& filename = "");
void save(const QString& filename = QString()); void save(const QString& filename = "");
// Sets mimedata pointer of item being dragged // Sets mimedata pointer of item being dragged
void setDraggedItemType(const QString& type); void setDraggedItemType(const QString& type);
...@@ -76,10 +76,10 @@ public: ...@@ -76,10 +76,10 @@ public:
void writeTo(QXmlStreamWriter* writer, SessionItem* parent = 0); void writeTo(QXmlStreamWriter* writer, SessionItem* parent = 0);
SessionItem* moveItem(SessionItem* item, SessionItem* new_parent = 0, int row = -1, SessionItem* moveItem(SessionItem* item, SessionItem* new_parent = 0, int row = -1,
const QString& tag = QString()); const QString& tag = "");
SessionItem* copyItem(const SessionItem* item_to_copy, SessionItem* new_parent = 0, SessionItem* copyItem(const SessionItem* item_to_copy, SessionItem* new_parent = 0,
const QString& tag = QString()); const QString& tag = "");
virtual SessionModel* createCopy(SessionItem* parent = 0); virtual SessionModel* createCopy(SessionItem* parent = 0);
......
...@@ -57,7 +57,7 @@ BA_CORE_API_ void writeItemAndChildItems(QXmlStreamWriter* writer, const Session ...@@ -57,7 +57,7 @@ BA_CORE_API_ void writeItemAndChildItems(QXmlStreamWriter* writer, const Session
BA_CORE_API_ void writeVariant(QXmlStreamWriter* writer, QVariant variant, int role); BA_CORE_API_ void writeVariant(QXmlStreamWriter* writer, QVariant variant, int role);
BA_CORE_API_ void readItems(QXmlStreamReader* reader, SessionItem* parent, BA_CORE_API_ void readItems(QXmlStreamReader* reader, SessionItem* parent,
QString topTag = QString(), MessageService* messageService = nullptr); QString topTag = "", MessageService* messageService = nullptr);
BA_CORE_API_ QString readProperty(QXmlStreamReader* reader, SessionItem* item, BA_CORE_API_ QString readProperty(QXmlStreamReader* reader, SessionItem* item,
MessageService* messageService = nullptr); MessageService* messageService = nullptr);
} // namespace SessionXML } // namespace SessionXML
......
...@@ -161,7 +161,7 @@ double CsvImportData::multiplier(CsvImportData::DATA_TYPE type) const ...@@ -161,7 +161,7 @@ double CsvImportData::multiplier(CsvImportData::DATA_TYPE type) const
QString CsvImportData::columnLabel(CsvImportData::DATA_TYPE type) const QString CsvImportData::columnLabel(CsvImportData::DATA_TYPE type) const
{ {
if (m_selected_cols.find(type) == m_selected_cols.end()) if (m_selected_cols.find(type) == m_selected_cols.end())
return QString(); return "";
return csv::HeaderLabels[m_selected_cols.at(type).name()]; return csv::HeaderLabels[m_selected_cols.at(type).name()];
} }
......
...@@ -143,7 +143,7 @@ void RealDataPropertiesWidget::onInstrumentMapUpdate() ...@@ -143,7 +143,7 @@ void RealDataPropertiesWidget::onInstrumentMapUpdate()
m_instrumentCombo->setCurrentIndex(index); m_instrumentCombo->setCurrentIndex(index);
} else { } else {
// instrument corresponding to m_current_id was deleted // instrument corresponding to m_current_id was deleted
m_current_id = QString(); m_current_id = "";
m_instrumentCombo->setCurrentIndex(0); m_instrumentCombo->setCurrentIndex(0);
} }
setComboConnected(true); setComboConnected(true);
......
...@@ -31,7 +31,7 @@ class BA_CORE_API_ ComboSelectorDialog : public QDialog ...@@ -31,7 +31,7 @@ class BA_CORE_API_ ComboSelectorDialog : public QDialog
public: public:
ComboSelectorDialog(QWidget* parent = 0); ComboSelectorDialog(QWidget* parent = 0);
void addItems(const QStringList& selection, const QString& currentItem = QString()); void addItems(const QStringList& selection, const QString& currentItem = "");
void setTextTop(const QString& text); void setTextTop(const QString& text);
void setTextBottom(const QString& text); void setTextBottom(const QString& text);
......
...@@ -34,7 +34,7 @@ class BA_CORE_API_ ProjectLoadWarningDialog : public QDialog ...@@ -34,7 +34,7 @@ class BA_CORE_API_ ProjectLoadWarningDialog : public QDialog
public: public:
ProjectLoadWarningDialog(QWidget* parent, const MessageService* messageService = 0, ProjectLoadWarningDialog(QWidget* parent, const MessageService* messageService = 0,
const QString& documentVersion = QString()); const QString& documentVersion = "");
private: private:
QWidget* createTopPanel(); QWidget* createTopPanel();
......
...@@ -82,7 +82,7 @@ private: ...@@ -82,7 +82,7 @@ private:
bool matchMultiline(const QString& text, const QRegExp& delimiter, const int inState, bool matchMultiline(const QString& text, const QRegExp& delimiter, const int inState,
const QTextCharFormat& style); const QTextCharFormat& style);
const QTextCharFormat getTextCharFormat(const QString& colorName, const QTextCharFormat getTextCharFormat(const QString& colorName,
const QString& style = QString()); const QString& style = "");
QList<HighlightingRule> rules; QList<HighlightingRule> rules;
QRegExp triSingleQuote; QRegExp triSingleQuote;
......
...@@ -138,7 +138,7 @@ QString SavePlotAssistant::getExtensionFromFilterName(const QString& filterName) ...@@ -138,7 +138,7 @@ QString SavePlotAssistant::getExtensionFromFilterName(const QString& filterName)
return m_formats[i].m_file_extention; return m_formats[i].m_file_extention;
} }
} }
return QString(); return "";
} }
bool SavePlotAssistant::isPngFile(const QString& fileName) const bool SavePlotAssistant::isPngFile(const QString& fileName) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment