HTML-escape strings in tooltips, esp. required for C++ templates.
authorMilian Wolff <mail@milianw.de>
Tue, 5 Apr 2016 21:39:19 +0000 (23:39 +0200)
committerMilian Wolff <mail@milianw.de>
Tue, 5 Apr 2016 21:39:19 +0000 (23:39 +0200)
gui/callercalleemodel.cpp
gui/treemodel.cpp

index c909620..f40008e 100644 (file)
@@ -220,11 +220,13 @@ QVariant CallerCalleeModel::data(const QModelIndex& index, int role) const
         stream << "<qt><pre style='font-family:monospace;'>";
         if (row.location->line > 0) {
             stream << i18nc("1: function, 2: file, 3: line, 4: module", "%1\n  at %2:%3\n  in %4",
-                            row.location->function,
-                            row.location->file, row.location->line, row.location->module);
+                            row.location->function.toHtmlEscaped(),
+                            row.location->file.toHtmlEscaped(), row.location->line,
+                            row.location->module.toHtmlEscaped());
         } else {
             stream << i18nc("1: function, 2: module", "%1\n  in %2",
-                            row.location->function, row.location->module);
+                            row.location->function.toHtmlEscaped(),
+                            row.location->module.toHtmlEscaped());
         }
         stream << '\n';
         stream << i18n("inclusive: allocated %1 over %2 calls (%3 temporary, i.e. %4%), peak at %5, leaked %6",
index cdbe955..7888040 100644 (file)
@@ -197,11 +197,11 @@ QVariant TreeModel::data(const QModelIndex& index, int role) const
         stream << "<qt><pre style='font-family:monospace;'>";
         if (row->location->line > 0) {
             stream << i18nc("1: function, 2: file, 3: line, 4: module", "%1\n  at %2:%3\n  in %4",
-                            row->location->function,
-                            row->location->file, row->location->line, row->location->module);
+                            row->location->function.toHtmlEscaped(),
+                            row->location->file.toHtmlEscaped(), row->location->line, row->location->module.toHtmlEscaped());
         } else {
             stream << i18nc("1: function, 2: module", "%1\n  in %2",
-                            row->location->function, row->location->module);
+                            row->location->function.toHtmlEscaped(), row->location->module.toHtmlEscaped());
         }
         stream << '\n';
         stream << '\n';
@@ -229,12 +229,12 @@ QVariant TreeModel::data(const QModelIndex& index, int role) const
                 stream << "\n";
                 if (child->location->line > 0) {
                     stream << i18nc("1: function, 2: file, 3: line, 4: module", "%1\n  at %2:%3\n  in %4",
-                                    child->location->function,
-                                    child->location->file, child->location->line,
-                                    child->location->module);
+                                    child->location->function.toHtmlEscaped(),
+                                    child->location->file.toHtmlEscaped(), child->location->line,
+                                    child->location->module.toHtmlEscaped());
                 } else {
                     stream << i18nc("1: function, 2: module", "%1\n  in %2",
-                                    child->location->function, child->location->module);
+                                    child->location->function.toHtmlEscaped(), child->location->module.toHtmlEscaped());
                 }
                 child = child->children.data();
             }