Skip to content

Commit 70f4ccc

Browse files
committed
AtSpiAdaptor: avoid static QLatin1StringViews
The static forces the compiler to allocate storage for the objects in the executable, either causing relocations on startup, or, on GCC, a pointless magic static guard: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84411 Make them constexpr instead. This allows the compiler to construct them ad-hoc when one is needed (one lea, one movi). Amends 8e1ff45. Also port to _L1 UDLs, amending 7b6b133. Manual conflict resolution for 6.10 - removed the change to collectionIntrospection, which doesn't exist in this patch, yet (7a478ff added it for 6.11). Pick-to: 6.8 6.5 Change-Id: I0cce28154f1155a2abee88572424f3c73073efe5 Reviewed-by: Volker Hilsheimer <[email protected]> (cherry picked from commit 37acfd1) Reviewed-by: Michael Weghorn <[email protected]>
1 parent 9bc85aa commit 70f4ccc

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/gui/accessible/linux/atspiadaptor.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ AtSpiAdaptor::~AtSpiAdaptor()
132132
*/
133133
QString AtSpiAdaptor::introspect(const QString &path) const
134134
{
135-
static const QLatin1StringView accessibleIntrospection(
135+
constexpr auto accessibleIntrospection =
136136
" <interface name=\"org.a11y.atspi.Accessible\">\n"
137137
" <property access=\"read\" type=\"s\" name=\"Name\"/>\n"
138138
" <property access=\"read\" type=\"s\" name=\"Description\"/>\n"
@@ -182,9 +182,9 @@ QString AtSpiAdaptor::introspect(const QString &path) const
182182
" <arg direction=\"out\" type=\"s\"/>\n"
183183
" </method>\n"
184184
" </interface>\n"
185-
);
185+
""_L1;
186186

187-
static const QLatin1StringView actionIntrospection(
187+
constexpr auto actionIntrospection =
188188
" <interface name=\"org.a11y.atspi.Action\">\n"
189189
" <property access=\"read\" type=\"i\" name=\"NActions\"/>\n"
190190
" <method name=\"GetDescription\">\n"
@@ -208,9 +208,9 @@ QString AtSpiAdaptor::introspect(const QString &path) const
208208
" <arg direction=\"out\" type=\"b\"/>\n"
209209
" </method>\n"
210210
" </interface>\n"
211-
);
211+
""_L1;
212212

213-
static const QLatin1StringView applicationIntrospection(
213+
constexpr auto applicationIntrospection =
214214
" <interface name=\"org.a11y.atspi.Application\">\n"
215215
" <property access=\"read\" type=\"s\" name=\"ToolkitName\"/>\n"
216216
" <property access=\"read\" type=\"s\" name=\"Version\"/>\n"
@@ -223,9 +223,9 @@ QString AtSpiAdaptor::introspect(const QString &path) const
223223
" <arg direction=\"out\" type=\"s\" name=\"address\"/>\n"
224224
" </method>\n"
225225
" </interface>\n"
226-
);
226+
""_L1;
227227

228-
static const QLatin1StringView componentIntrospection(
228+
constexpr auto componentIntrospection =
229229
" <interface name=\"org.a11y.atspi.Component\">\n"
230230
" <method name=\"Contains\">\n"
231231
" <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"
@@ -286,9 +286,9 @@ QString AtSpiAdaptor::introspect(const QString &path) const
286286
" <arg direction=\"out\" type=\"b\"/>\n"
287287
" </method>\n"
288288
" </interface>\n"
289-
);
289+
""_L1;
290290

291-
static const QLatin1StringView editableTextIntrospection(
291+
constexpr auto editableTextIntrospection =
292292
" <interface name=\"org.a11y.atspi.EditableText\">\n"
293293
" <method name=\"SetTextContents\">\n"
294294
" <arg direction=\"in\" type=\"s\" name=\"newContents\"/>\n"
@@ -319,9 +319,9 @@ QString AtSpiAdaptor::introspect(const QString &path) const
319319
" <arg direction=\"out\" type=\"b\"/>\n"
320320
" </method>\n"
321321
" </interface>\n"
322-
);
322+
""_L1;
323323

324-
static const QLatin1StringView selectionIntrospection(
324+
constexpr auto selectionIntrospection =
325325
" <interface name=\"org.a11y.atspi.Selection\">\n"
326326
" <property name=\"NSelectedChildren\" type=\"i\" access=\"read\"/>\n"
327327
" <method name=\"GetSelectedChild\">\n"
@@ -352,9 +352,9 @@ QString AtSpiAdaptor::introspect(const QString &path) const
352352
" <arg direction=\"out\" type=\"b\"/>\n"
353353
" </method>\n"
354354
" </interface>\n"
355-
);
355+
""_L1;
356356

357-
static const QLatin1StringView tableIntrospection(
357+
constexpr auto tableIntrospection =
358358
" <interface name=\"org.a11y.atspi.Table\">\n"
359359
" <property access=\"read\" type=\"i\" name=\"NRows\"/>\n"
360360
" <property access=\"read\" type=\"i\" name=\"NColumns\"/>\n"
@@ -460,9 +460,9 @@ QString AtSpiAdaptor::introspect(const QString &path) const
460460
" <arg direction=\"out\" type=\"b\" name=\"is_selected\"/>\n"
461461
" </method>\n"
462462
" </interface>\n"
463-
);
463+
""_L1;
464464

465-
static const QLatin1StringView tableCellIntrospection(
465+
constexpr auto tableCellIntrospection =
466466
" <interface name=\"org.a11y.atspi.TableCell\">\n"
467467
" <property access=\"read\" name=\"ColumnSpan\" type=\"i\" />\n"
468468
" <property access=\"read\" name=\"Position\" type=\"(ii)\">\n"
@@ -488,9 +488,9 @@ QString AtSpiAdaptor::introspect(const QString &path) const
488488
" <annotation value=\"QSpiObjectReferenceArray\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
489489
" </method>\n"
490490
" </interface>\n"
491-
);
491+
""_L1;
492492

493-
static const QLatin1StringView textIntrospection(
493+
constexpr auto textIntrospection =
494494
" <interface name=\"org.a11y.atspi.Text\">\n"
495495
" <property access=\"read\" type=\"i\" name=\"CharacterCount\"/>\n"
496496
" <property access=\"read\" type=\"i\" name=\"CaretOffset\"/>\n"
@@ -627,9 +627,9 @@ QString AtSpiAdaptor::introspect(const QString &path) const
627627
" <arg direction=\"out\" type=\"b\"/>\n"
628628
" </method>\n"
629629
" </interface>\n"
630-
);
630+
""_L1;
631631

632-
static const QLatin1StringView valueIntrospection(
632+
constexpr auto valueIntrospection =
633633
" <interface name=\"org.a11y.atspi.Value\">\n"
634634
" <property access=\"read\" type=\"d\" name=\"MinimumValue\"/>\n"
635635
" <property access=\"read\" type=\"d\" name=\"MaximumValue\"/>\n"
@@ -639,7 +639,7 @@ QString AtSpiAdaptor::introspect(const QString &path) const
639639
" <arg direction=\"in\" type=\"d\" name=\"value\"/>\n"
640640
" </method>\n"
641641
" </interface>\n"
642-
);
642+
""_L1;
643643

644644
QAccessibleInterface * interface = interfaceFromPath(path);
645645
if (!interface) {

0 commit comments

Comments
 (0)