be a bit safer with the widget pointer; too easy to trigger with sloppy scripting
This commit is contained in:
parent
0e9d609542
commit
592a6a63b3
@ -251,6 +251,10 @@ ServiceJob *Service::startOperationCall(const KConfigGroup &description, QObject
|
||||
|
||||
void Service::associateWidget(QWidget *widget, const QString &operation)
|
||||
{
|
||||
if (!widget) {
|
||||
return;
|
||||
}
|
||||
|
||||
disassociateWidget(widget);
|
||||
d->associatedWidgets.insert(widget, operation);
|
||||
connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(associatedWidgetDestroyed(QObject*)));
|
||||
@ -260,6 +264,10 @@ void Service::associateWidget(QWidget *widget, const QString &operation)
|
||||
|
||||
void Service::disassociateWidget(QWidget *widget)
|
||||
{
|
||||
if (!widget) {
|
||||
return;
|
||||
}
|
||||
|
||||
disconnect(widget, SIGNAL(destroyed(QObject*)),
|
||||
this, SLOT(associatedWidgetDestroyed(QObject*)));
|
||||
d->associatedWidgets.remove(widget);
|
||||
|
Loading…
Reference in New Issue
Block a user