summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper K. Pedersen <jesper.pedersen@kdab.com>2013-05-21 08:33:41 +0000
committerJesper K. Pedersen <jesper.pedersen@kdab.com>2013-05-22 15:32:33 +0200
commit20604c28517aa4e318393598cf3d86d5ce113b77 (patch)
tree5f4bc321dc650bf04e8e8f418510f4fc732d73d3
parent5439e054f33fb62fcecf497ebf5152a0fe508de8 (diff)
make it possible to touch a file so it gets created if it doesn't exists
Change-Id: I876a4b6f683c2183925bf19300b88a9332db5514 Reviewed-by: Jesper K. Pedersen <jesper.pedersen@kdab.com>
-rw-r--r--utils/utils.cpp7
-rw-r--r--utils/utils.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/utils/utils.cpp b/utils/utils.cpp
index 9cb341a..9208b45 100644
--- a/utils/utils.cpp
+++ b/utils/utils.cpp
@@ -75,6 +75,13 @@ bool Scripting::Internal::Utils::copyFile(const QString &from, const QString &to
return true;
}
+void Utils::touchFile(const QString &fileName)
+{
+ QFile file(fileName);
+ file.open(QFile::Append);
+ file.close();
+}
+
} // namespace Internal
} // namespace Scripting
diff --git a/utils/utils.h b/utils/utils.h
index e6f8655..d0f12f6 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -46,6 +46,7 @@ public:
public slots:
QStringList backtrace() const;
bool copyFile(const QString& from, const QString& to);
+ void touchFile(const QString& fileName);
public:
QString currentScripRoot() const;