mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-29 05:48:47 +03:00
Code cleanup
This commit is contained in:
parent
c32b352ec1
commit
c4ed12bbd1
1 changed files with 4 additions and 9 deletions
13
src/misc.h
13
src/misc.h
|
@ -92,19 +92,14 @@ public:
|
|||
|
||||
static inline QString toQString(sha1_hash hash) {
|
||||
std::ostringstream o;
|
||||
if(!(o<<hash)) {
|
||||
throw std::runtime_error("::toString()");
|
||||
}
|
||||
return QString::fromLocal8Bit(o.str().c_str());
|
||||
//return QString::fromLocal8Bit(hash.to_string().c_str());
|
||||
o << hash;
|
||||
return QString(o.str().c_str());
|
||||
}
|
||||
|
||||
static inline sha1_hash QStringToSha1(const QString& s) {
|
||||
sha1_hash x;
|
||||
std::istringstream i(s.toStdString());
|
||||
if(!(i>>x)) {
|
||||
throw std::runtime_error("::fromString()");
|
||||
}
|
||||
sha1_hash x;
|
||||
i>>x;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue