Changeset View
Changeset View
Standalone View
Standalone View
plugins/textshape/TextTool.cpp
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | |||||
86 | #include <QMenu> | 86 | #include <QMenu> | ||
87 | #include <QMenuBar> | 87 | #include <QMenuBar> | ||
88 | #include <QAction> | 88 | #include <QAction> | ||
89 | #include <QTextTable> | 89 | #include <QTextTable> | ||
90 | #include <QTextList> | 90 | #include <QTextList> | ||
91 | #include <QTabWidget> | 91 | #include <QTabWidget> | ||
92 | #include <QTextDocumentFragment> | 92 | #include <QTextDocumentFragment> | ||
93 | #include <QToolTip> | 93 | #include <QToolTip> | ||
94 | #include <QSignalMapper> | | |||
95 | #include <QGraphicsObject> | 94 | #include <QGraphicsObject> | ||
96 | #include <QLinearGradient> | 95 | #include <QLinearGradient> | ||
97 | #include <QBitmap> | 96 | #include <QBitmap> | ||
98 | #include <QDrag> | 97 | #include <QDrag> | ||
99 | #include <QDragLeaveEvent> | 98 | #include <QDragLeaveEvent> | ||
100 | #include <QDragMoveEvent> | 99 | #include <QDragMoveEvent> | ||
101 | #include <QDropEvent> | 100 | #include <QDropEvent> | ||
102 | 101 | | |||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 173 | foreach (KoTextEditingPlugin* plugin, textEditingPluginContainer()->values()) { | |||
179 | QHash<QString, QAction*>::ConstIterator i = actions.begin(); | 178 | QHash<QString, QAction*>::ConstIterator i = actions.begin(); | ||
180 | while (i != actions.end()) { | 179 | while (i != actions.end()) { | ||
181 | addAction(i.key(), i.value()); | 180 | addAction(i.key(), i.value()); | ||
182 | ++i; | 181 | ++i; | ||
183 | } | 182 | } | ||
184 | } | 183 | } | ||
185 | 184 | | |||
186 | // setup the context list. | 185 | // setup the context list. | ||
187 | QSignalMapper *signalMapper = new QSignalMapper(this); | | |||
188 | connect(signalMapper, SIGNAL(mapped(QString)), this, SLOT(startTextEditingPlugin(QString))); | | |||
189 | QList<QAction*> list; | 186 | QList<QAction*> list; | ||
190 | list.append(this->action("format_font")); | 187 | list.append(this->action("format_font")); | ||
191 | foreach (const QString &key, KoTextEditingRegistry::instance()->keys()) { | 188 | foreach (const QString &key, KoTextEditingRegistry::instance()->keys()) { | ||
192 | KoTextEditingFactory *factory = KoTextEditingRegistry::instance()->value(key); | 189 | KoTextEditingFactory *factory = KoTextEditingRegistry::instance()->value(key); | ||
193 | if (factory && factory->showInMenu()) { | 190 | if (factory && factory->showInMenu()) { | ||
194 | QAction *a = new QAction(factory->title(), this); | 191 | QAction *a = new QAction(factory->title(), this); | ||
195 | connect(a, SIGNAL(triggered()), signalMapper, SLOT(map())); | 192 | connect(a, &QAction::triggered, [this, factory] { startTextEditingPlugin(factory->id()); }); | ||
dfaure: Remove `&` here too -- reference to local variable, used later = crash. | |||||
196 | signalMapper->setMapping(a, factory->id()); | | |||
197 | list.append(a); | 193 | list.append(a); | ||
198 | addAction(QString("apply_%1").arg(factory->id()), a); | 194 | addAction(QString("apply_%1").arg(factory->id()), a); | ||
199 | } | 195 | } | ||
200 | } | 196 | } | ||
201 | setPopupActionList(list); | 197 | setPopupActionList(list); | ||
202 | 198 | | |||
203 | connect(canvas->shapeManager()->selection(), SIGNAL(selectionChanged()), this, SLOT(shapeAddedToCanvas())); | 199 | connect(canvas->shapeManager()->selection(), SIGNAL(selectionChanged()), this, SLOT(shapeAddedToCanvas())); | ||
204 | 200 | | |||
▲ Show 20 Lines • Show All 2950 Lines • Show Last 20 Lines |
Remove & here too -- reference to local variable, used later = crash.