1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-19 18:17:40 +00:00

GVariant: Add a constructor that takes const char*.

This prevents the compiler from selecting the GVariant(bool) constructor
which is clearly not what I want when I do GVariant("Hello"). :^)
This commit is contained in:
Andreas Kling 2019-06-22 10:37:44 +02:00
parent e9cbda29e9
commit 9ee63ef8b3
2 changed files with 6 additions and 0 deletions

View file

@ -47,6 +47,11 @@ GVariant::GVariant(bool value)
m_value.as_bool = value;
}
GVariant::GVariant(const char* cstring)
: GVariant(String(cstring))
{
}
GVariant::GVariant(const String& value)
: m_type(Type::String)
{

View file

@ -10,6 +10,7 @@ public:
GVariant(bool);
GVariant(float);
GVariant(int);
GVariant(const char*);
GVariant(const String&);
GVariant(const GraphicsBitmap&);
GVariant(const GIcon&);