refactor: replace deskflow::string::sizeTypeToString with QString::number()
This commit is contained in:
@ -140,13 +140,6 @@ std::string sprintf(const char *fmt, ...)
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string sizeTypeToString(size_t n)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << n;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
size_t stringToSizeType(const std::string &string)
|
||||
{
|
||||
std::istringstream iss(string);
|
||||
|
||||
@ -40,12 +40,6 @@ Equivalent to sprintf() except the result is returned as a String.
|
||||
*/
|
||||
std::string sprintf(const char *fmt, ...);
|
||||
|
||||
//! Convert a size type to a string
|
||||
/*!
|
||||
Convert an size type to a string
|
||||
*/
|
||||
std::string sizeTypeToString(size_t n);
|
||||
|
||||
//! Convert a string to a size type
|
||||
/*!
|
||||
Convert an a \c string to an size type
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
#include "base/Event.h"
|
||||
#include "base/IEventQueue.h"
|
||||
#include "base/Log.h"
|
||||
#include "base/String.h"
|
||||
#include "deskflow/ClipboardChunk.h"
|
||||
|
||||
static const size_t g_chunkSize = 512 * 1024; // 512kb
|
||||
@ -19,7 +18,7 @@ void StreamChunker::sendClipboard(
|
||||
)
|
||||
{
|
||||
// send first message (data size)
|
||||
std::string dataSize = deskflow::string::sizeTypeToString(size);
|
||||
std::string dataSize = QString::number(size).toStdString();
|
||||
ClipboardChunk *sizeMessage = ClipboardChunk::start(id, sequence, dataSize);
|
||||
|
||||
events->addEvent(Event(EventTypes::ClipboardSending, eventTarget, sizeMessage));
|
||||
|
||||
@ -40,11 +40,4 @@ void StringTests::stringToInt()
|
||||
QCOMPARE(value, 123);
|
||||
}
|
||||
|
||||
void StringTests::intToString()
|
||||
{
|
||||
size_t value = 123;
|
||||
std::string number = deskflow::string::sizeTypeToString(value);
|
||||
QCOMPARE(number, "123");
|
||||
}
|
||||
|
||||
QTEST_MAIN(StringTests)
|
||||
|
||||
@ -12,6 +12,5 @@ class StringTests : public QObject
|
||||
private Q_SLOTS:
|
||||
void formatWithArgs();
|
||||
void formatedString();
|
||||
void intToString();
|
||||
void stringToInt();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user