Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-10-27 13:44:01 +0300
committerHannah von Reth <vonreth@kde.org>2021-10-27 17:09:19 +0300
commit5a22a5782441b4fcc1316e1900c0fa91e2c299bf (patch)
tree0605cf6ae1efdfae027722fe3ceae9760d0d844f /src/common
parent29cae9bfff37dd3292ea2ce8343e1a34512d2f46 (diff)
Move writeRandomFile to test utils
Diffstat (limited to 'src/common')
-rw-r--r--src/common/utility.cpp26
-rw-r--r--src/common/utility.h1
2 files changed, 0 insertions, 27 deletions
diff --git a/src/common/utility.cpp b/src/common/utility.cpp
index 42e03a03c..8404b92f1 100644
--- a/src/common/utility.cpp
+++ b/src/common/utility.cpp
@@ -52,32 +52,6 @@ namespace OCC {
Q_LOGGING_CATEGORY(lcUtility, "sync.utility")
-bool Utility::writeRandomFile(const QString &fname, int size)
-{
- auto rg = QRandomGenerator::global();
-
- const int maxSize = 10 * 10 * 1024;
- if (size == -1) {
- size = static_cast<int>(rg->generate() % maxSize);
- }
-
- QString randString;
- for (int i = 0; i < size; i++) {
- int r = static_cast<int>(rg->generate() % 128);
- randString.append(QChar(r));
- }
-
- QFile file(fname);
- if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- QTextStream out(&file);
- out << randString;
- // optional, as QFile destructor will already do it:
- file.close();
- return true;
- }
- return false;
-}
-
QString Utility::formatFingerprint(const QByteArray &fmhash, bool colonSeparated)
{
QByteArray hash;
diff --git a/src/common/utility.h b/src/common/utility.h
index bc0f07258..d39e960a3 100644
--- a/src/common/utility.h
+++ b/src/common/utility.h
@@ -54,7 +54,6 @@ OCSYNC_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcUtility)
OCSYNC_EXPORT void usleep(int usec);
OCSYNC_EXPORT QString formatFingerprint(const QByteArray &, bool colonSeparated = true);
OCSYNC_EXPORT void setupFavLink(const QString &folder);
- OCSYNC_EXPORT bool writeRandomFile(const QString &fname, int size = -1);
OCSYNC_EXPORT QString octetsToString(qint64 octets);
OCSYNC_EXPORT QByteArray userAgentString();
/**