mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-02 14:57:59 +03:00
Merge pull request #2119 from akortunov/stringstream
Get rid of unnecessary string streams
This commit is contained in:
commit
4617dea154
16 changed files with 111 additions and 176 deletions
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
|
||||
#include "intsetting.hpp"
|
||||
#include "doublesetting.hpp"
|
||||
|
@ -393,9 +392,7 @@ CSMPrefs::IntSetting& CSMPrefs::State::declareInt (const std::string& key,
|
|||
if (mCurrentCategory==mCategories.end())
|
||||
throw std::logic_error ("no category for setting");
|
||||
|
||||
std::ostringstream stream;
|
||||
stream << default_;
|
||||
setDefault (key, stream.str());
|
||||
setDefault(key, std::to_string(default_));
|
||||
|
||||
default_ = mSettings.getInt (key, mCurrentCategory->second.getKey());
|
||||
|
||||
|
@ -414,9 +411,7 @@ CSMPrefs::DoubleSetting& CSMPrefs::State::declareDouble (const std::string& key,
|
|||
if (mCurrentCategory==mCategories.end())
|
||||
throw std::logic_error ("no category for setting");
|
||||
|
||||
std::ostringstream stream;
|
||||
stream << default_;
|
||||
setDefault (key, stream.str());
|
||||
setDefault(key, std::to_string(default_));
|
||||
|
||||
default_ = mSettings.getFloat (key, mCurrentCategory->second.getKey());
|
||||
|
||||
|
|
|
@ -77,14 +77,9 @@ void CSMTools::Search::searchRecordStateCell (const CSMWorld::IdTableBase *model
|
|||
{
|
||||
std::vector<std::string> states =
|
||||
CSMWorld::Columns::getEnums (CSMWorld::Columns::ColumnId_Modification);
|
||||
|
||||
std::ostringstream message;
|
||||
message << states.at (data);
|
||||
|
||||
std::ostringstream hint;
|
||||
hint << "r: " << model->getColumnId (index.column());
|
||||
|
||||
messages.add (id, message.str(), hint.str());
|
||||
const std::string hint = "r: " + model->getColumnId (index.column());
|
||||
messages.add (id, states.at(data), hint);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ int CSMWorld::Resources::getIndex (const std::string& id) const
|
|||
std::ostringstream stream;
|
||||
stream << "Invalid resource: " << mBaseDirectory << '/' << id;
|
||||
|
||||
throw std::runtime_error (stream.str().c_str());
|
||||
throw std::runtime_error (stream.str());
|
||||
}
|
||||
|
||||
return index;
|
||||
|
|
|
@ -150,10 +150,8 @@ std::string CSVWorld::SceneSubView::getTitle() const
|
|||
void CSVWorld::SceneSubView::cellSelectionChanged (const CSMWorld::UniversalId& id)
|
||||
{
|
||||
setUniversalId(id);
|
||||
std::ostringstream stream;
|
||||
stream << "Scene: " << getUniversalId().getId();
|
||||
|
||||
mTitle = stream.str();
|
||||
mTitle = "Scene: " + getUniversalId().getId();
|
||||
setWindowTitle (QString::fromUtf8 (mTitle.c_str()));
|
||||
emit updateTitle();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue