diff --git a/src/misc.h b/src/misc.h index 7856fd27e..a4f1f1bd5 100644 --- a/src/misc.h +++ b/src/misc.h @@ -55,29 +55,29 @@ private: misc(); // Forbidden public: - static inline QString toQString(std::string str) { + static inline QString toQString(const std::string &str) { return QString::fromLocal8Bit(str.c_str()); } - static inline QString toQString(char* str) { + static inline QString toQString(const char* str) { return QString::fromLocal8Bit(str); } - static inline QString toQStringU(std::string str) { + static inline QString toQStringU(const std::string &str) { return QString::fromUtf8(str.c_str()); } - static inline QString toQStringU(char* str) { + static inline QString toQStringU(const char* str) { return QString::fromUtf8(str); } - static inline QString toQString(libtorrent::sha1_hash hash) { + static inline QString toQString(const libtorrent::sha1_hash &hash) { std::ostringstream o; o << hash; return QString(o.str().c_str()); } - static inline libtorrent::sha1_hash toSha1Hash(QString hash) { + static inline libtorrent::sha1_hash toSha1Hash(const QString &hash) { return libtorrent::sha1_hash(qPrintable(hash)); } diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index 654ce6a40..1b589cd9b 100644 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -2375,7 +2375,7 @@ QHash QBtSession::getTrackersInfo(QString hash) const{ } int QBtSession::getListenPort() const{ - qDebug() << getListenPort() << s->listen_port(); + qDebug() << Q_FUNC_INFO << s->listen_port(); return s->listen_port(); }