diff options
Diffstat (limited to 'libLumina/LuminaUtils.cpp')
-rw-r--r-- | libLumina/LuminaUtils.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp index 46c2e26c..6f91082c 100644 --- a/libLumina/LuminaUtils.cpp +++ b/libLumina/LuminaUtils.cpp @@ -54,9 +54,9 @@ QStringList LUtils::readFile(QString filepath){ bool LUtils::writeFile(QString filepath, QStringList contents, bool overwrite){ QFile file(filepath); - QFile::OpenMode mode = overwrite ? (QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate) : (QIODevice::WriteOnly | QIODevice::Text); + if(file.exists() && !overwrite){ return false; } bool ok = false; - if(file.open( mode ) ){ + if( file.open(QIODevice::WriteOnly | QIODevice::Truncate) ){ QTextStream out(&file); out << contents.join("\n"); file.close(); |