diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2013-07-15 16:01:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-15 19:45:49 +0200 |
commit | 8a245c9fc2b4cb1a228d300f9dfbfea28806350f (patch) | |
tree | 83992e26ad066148ff4b2140f004b41e416e6229 /tools/configure | |
parent | 79fcc7787a7d52dbd33f3a5e64ea4b2e61d0ddee (diff) |
prune unused filesDiffer() and writeToFile() functions
Change-Id: I470a5b3514260a02e73389d057d89c64b08e05d0
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tools/configure')
-rw-r--r-- | tools/configure/configureapp.cpp | 43 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 1 |
2 files changed, 0 insertions, 44 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 349281dd1e..abc1ba4407 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -92,22 +92,6 @@ static inline void promptKeyPress() exit(0); // Exit cleanly for Ctrl+C } -bool writeToFile(const char* text, const QString &filename) -{ - QByteArray symFile(text); - QFile file(filename); - QDir dir(QFileInfo(file).absoluteDir()); - if (!dir.exists()) - dir.mkpath(dir.absolutePath()); - if (!file.open(QFile::WriteOnly | QFile::Text)) { - cout << "Couldn't write to " << qPrintable(filename) << ": " << qPrintable(file.errorString()) - << endl; - return false; - } - file.write(symFile); - return true; -} - Configure::Configure(int& argc, char** argv) { // Default values for indentation @@ -4286,31 +4270,4 @@ int Configure::platform() const return WINDOWS; } -bool -Configure::filesDiffer(const QString &fn1, const QString &fn2) -{ - QFile file1(fn1), file2(fn2); - if (!file1.open(QFile::ReadOnly) || !file2.open(QFile::ReadOnly)) - return true; - const int chunk = 2048; - int used1 = 0, used2 = 0; - char b1[chunk], b2[chunk]; - while (!file1.atEnd() && !file2.atEnd()) { - if (!used1) - used1 = file1.read(b1, chunk); - if (!used2) - used2 = file2.read(b2, chunk); - if (used1 > 0 && used2 > 0) { - const int cmp = qMin(used1, used2); - if (memcmp(b1, b2, cmp)) - return true; - if ((used1 -= cmp)) - memcpy(b1, b1+cmp, used1); - if ((used2 -= cmp)) - memcpy(b2, b2+cmp, used2); - } - } - return !file1.atEnd() || !file2.atEnd(); -} - QT_END_NAMESPACE diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 8f95e1fb95..d77b136ac8 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -159,7 +159,6 @@ private: QString formatPath(const QString &path); QString formatPaths(const QStringList &paths); - bool filesDiffer(const QString &file1, const QString &file2); QString locateFile(const QString &fileName) const; bool findFile(const QString &fileName) const { return !locateFile(fileName).isEmpty(); } |