From 4d473a36fbe390d0c49a9c8d92aaa40286a962bc Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sat, 2 Jul 2011 13:29:22 +0200 Subject: [PATCH] ConfigMgr: properly write configuration file if it contains non-ASCII chars There has been a problem UTF-8 characters in the configuration file since 2006 (!), as the length of the data to be written was mis- calculated. We can omit the specification of the data length at all when just passing a QByteArray object to QFile::write(). Fixes setup dialog appearing each start if one of the configured paths in the setup dialog contains non-ASCII characters. Closes #3348920, #3017409, #2812054. --- src/core/config_mgr.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/core/config_mgr.cpp b/src/core/config_mgr.cpp index 7e2a17680..e8d121692 100644 --- a/src/core/config_mgr.cpp +++ b/src/core/config_mgr.cpp @@ -1,10 +1,8 @@ -#ifndef SINGLE_SOURCE_COMPILE - /* * config_mgr.cpp - implementation of class configManager * - * Copyright (c) 2005-2008 Tobias Doerffel - * + * Copyright (c) 2005-2011 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -24,7 +22,6 @@ * */ - #include #include #include @@ -454,10 +451,8 @@ void configManager::saveConfigFile() return; } - outfile.write( xml.toUtf8().constData(), xml.length() ); + outfile.write( xml.toUtf8() ); outfile.close(); } - -#endif