Commit f90f8613 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Remove the unused canvascontroller parameter in some more places

parent b338b71e
......@@ -617,7 +617,7 @@ void KoToolManager::Private::selectionChanged(QList<KoShape*> shapes)
}
}
emit q->toolCodesSelected(canvasData->canvas, types);
emit q->toolCodesSelected(types);
}
void KoToolManager::Private::currentLayerChanged(const KoShapeLayer *layer)
......
......@@ -245,7 +245,7 @@ signals:
* @param canvas the currently active canvas.
* @param types a list of string that are the shape types of the selected objects.
*/
void toolCodesSelected(const KoCanvasController *canvas, const QList<QString> &types);
void toolCodesSelected(const QList<QString> &types);
/**
* Emitted after the current layer changed either its properties or to a new layer.
......
......@@ -156,7 +156,7 @@ KoModeBox::KoModeBox(KoCanvasControllerWidget *canvas, const QString &appName)
qSort(d->buttons.begin(), d->buttons.end(), compareButton);
// Update visibility of buttons
updateShownTools(canvas, QList<QString>());
updateShownTools(QList<QString>());
d->tabBar->setContextMenuPolicy(Qt::CustomContextMenu);
connect(d->tabBar, SIGNAL(currentChanged(int)), this, SLOT(toolSelected(int)));
......@@ -167,8 +167,7 @@ KoModeBox::KoModeBox(KoCanvasControllerWidget *canvas, const QString &appName)
this, SLOT(setActiveTool(KoCanvasController *, int)));
connect(KoToolManager::instance(), SIGNAL(currentLayerChanged(const KoCanvasController *,const KoShapeLayer*)),
this, SLOT(setCurrentLayer(const KoCanvasController *,const KoShapeLayer *)));
connect(KoToolManager::instance(), SIGNAL(toolCodesSelected(const KoCanvasController*, QList<QString>)),
this, SLOT(updateShownTools(const KoCanvasController *, QList<QString>)));
connect(KoToolManager::instance(), SIGNAL(toolCodesSelected(QList<QString>)), this, SLOT(updateShownTools(QList<QString>)));
connect(KoToolManager::instance(),
SIGNAL(addedTool(const KoToolButton, KoCanvasController*)),
this, SLOT(toolAdded(const KoToolButton, KoCanvasController*)));
......@@ -388,12 +387,8 @@ void KoModeBox::addItem(const KoToolButton button)
d->addedButtons.append(button);
}
void KoModeBox::updateShownTools(const KoCanvasController *canvas, const QList<QString> &codes)
void KoModeBox::updateShownTools(const QList<QString> &codes)
{
if (canvas->canvas() != d->canvas) {
return;
}
if (d->iconTextFitted) {
d->fittingIterations = 0;
}
......@@ -448,7 +443,7 @@ void KoModeBox::updateShownTools(const KoCanvasController *canvas, const QList<Q
d->tabBar->blockSignals(false);
if (!d->iconTextFitted && d->fittingIterations++ < 8) {
updateShownTools(canvas, codes);
updateShownTools(codes);
}
d->iconTextFitted = true;
}
......@@ -587,7 +582,7 @@ void KoModeBox::toolAdded(const KoToolButton &button, KoCanvasController *canvas
qStableSort(d->buttons.begin(), d->buttons.end(), compareButton);
updateShownTools(canvas, QList<QString>());
updateShownTools(QList<QString>());
}
}
......@@ -636,7 +631,7 @@ void KoModeBox::switchIconMode(int mode)
} else {
d->tabBar->setIconSize(QSize(22,22));
}
updateShownTools(d->canvas->canvasController(), QList<QString>());
updateShownTools(QList<QString>());
KConfigGroup cfg = KGlobal::config()->group("calligra");
cfg.writeEntry("ModeBoxIconMode", (int)d->iconMode);
......@@ -674,5 +669,5 @@ void KoModeBox::switchTabsSide(int side)
KConfigGroup cfg = KGlobal::config()->group("calligra");
cfg.writeEntry("ModeBoxHorizontalTabsSide", (int)d->horizontalTabsSide);
}
updateShownTools(d->canvas->canvasController(), QList<QString>());
updateShownTools(QList<QString>());
}
......@@ -101,10 +101,9 @@ public slots:
* The modebox allows buttons to be optionally registered with a visibilityCode. This code
* can be passed here and all buttons that have that code are shown. All buttons that
* have another visibility code registered are hidden.
* @param canvas the currently active canvas.
* @param codes a list of all the codes to show.
*/
void updateShownTools(const KoCanvasController *canvas, const QList<QString> &codes);
void updateShownTools(const QList<QString> &codes);
void setOptionWidgets(const QList<QWidget *> &optionWidgetList);
......
......@@ -82,8 +82,7 @@ KoToolBox::KoToolBox()
this, SLOT(setActiveTool(KoCanvasController*, int)));
connect(KoToolManager::instance(), SIGNAL(currentLayerChanged(const KoCanvasController*,const KoShapeLayer*)),
this, SLOT(setCurrentLayer(const KoCanvasController*,const KoShapeLayer*)));
connect(KoToolManager::instance(), SIGNAL(toolCodesSelected(const KoCanvasController*, QList<QString>)),
this, SLOT(setButtonsVisible(const KoCanvasController*, QList<QString>)));
connect(KoToolManager::instance(), SIGNAL(toolCodesSelected(QList<QString>)), this, SLOT(setButtonsVisible(QList<QString>)));
connect(KoToolManager::instance(),
SIGNAL(addedTool(const KoToolButton, KoCanvasController*)),
this, SLOT(toolAdded(const KoToolButton, KoCanvasController*)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment