Skip to content

Commit

Permalink
corelib: settings - make qsettings.cpp unity buildable
Browse files Browse the repository at this point in the history
Both qsettings.cpp and qjsonparser.cpp defined Space in the
global namespace. Hiding it in one of them in an implementation
namespace resolves the name clash.

Pick-to: 6.7 6.6 6.5
Change-Id: I8dd1244f80d87f3908597ed82c8e41b49b7b916c
Reviewed-by: Marc Mutz <[email protected]>
  • Loading branch information
timblechmann authored and marcmutz committed Feb 26, 2024
1 parent 3ec9331 commit 4ff65f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/corelib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ qt_internal_add_module(Core
text/qstringconverter.cpp # enum Data
tools/qcryptographichash.cpp # KeccakNISTInterface/Final
io/qdebug.cpp # undef qDebug
io/qsettings.cpp # Space (also in qjsonparser.cpp)
NO_PCH_SOURCES
compat/removed_api.cpp
global/qsimd.cpp
Expand Down
7 changes: 7 additions & 0 deletions src/corelib/io/qsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,8 @@ void QConfFileSettingsPrivate::syncConfFile(QConfFile *confFile)
}
}

namespace SettingsImpl {

enum { Space = 0x1, Special = 0x2 };

static const char charTraits[256] =
Expand All @@ -1544,10 +1546,15 @@ static const char charTraits[256] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};

} // namespace SettingsImpl

using SettingsImpl::charTraits;

bool QConfFileSettingsPrivate::readIniLine(QByteArrayView data, qsizetype &dataPos,
qsizetype &lineStart, qsizetype &lineLen,
qsizetype &equalsPos)
{
using namespace SettingsImpl;
qsizetype dataLen = data.size();
bool inQuotes = false;

Expand Down

0 comments on commit 4ff65f0

Please sign in to comment.