Commit 3512309e authored by Boudewijn Rempt's avatar Boudewijn Rempt

Merge branch 'master' into rempt/T379-resource-management

parents 4fbc4749 92ef7958
......@@ -42,7 +42,6 @@ enum OutlineStyle {
OUTLINE_CIRCLE,
OUTLINE_FULL,
OUTLINE_TILT,
OUTLINE_COLOR,
N_OUTLINE_STYLE_SIZE
};
......
......@@ -385,13 +385,13 @@ bool KisPaintOpSettings::needsAsynchronousUpdates() const
return false;
}
QPainterPath KisPaintOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode)
QPainterPath KisPaintOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
QPainterPath path;
if (mode == CursorIsOutline || mode == CursorIsCircleOutline || mode == CursorTiltOutline) {
if (mode.isVisible) {
path = ellipseOutline(10, 10, 1.0, 0);
if (mode == CursorTiltOutline) {
if (mode.showTiltDecoration) {
path.addPath(makeTiltIndicator(info, QPointF(0.0, 0.0), 0.0, 2.0));
}
......
......@@ -164,14 +164,13 @@ public:
virtual bool needsAsynchronousUpdates() const;
/**
* This enum defines the current mode for painting an outline.
* This structure defines the current mode for painting an outline.
*/
enum OutlineMode {
CursorIsOutline = 1, ///< When this mode is set, an outline is painted around the cursor
CursorIsCircleOutline,
CursorNoOutline,
CursorTiltOutline,
CursorColorOutline
struct OutlineMode {
bool isVisible = false;
bool forceCircle = false;
bool showTiltDecoration = false;
bool forceFullSize = false;
};
/**
......@@ -179,7 +178,7 @@ public:
* Outline mode has to be passed to the paintop which builds the outline as some paintops have to paint outline
* always like clone paintop indicating the duplicate position
*/
virtual QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode);
virtual QPainterPath brushOutline(const KisPaintInformation &info, const OutlineMode &mode);
/**
* Helpers for drawing the brush outline
......
......@@ -56,7 +56,6 @@
#include <KoPluginLoader.h>
#include <KoShapeRegistry.h>
#include <KoDpi.h>
#include "KoGlobal.h"
#include "KoConfig.h"
#include <resources/KoHashGeneratorProvider.h>
#include <KoResourcePaths.h>
......@@ -426,9 +425,6 @@ bool KisApplication::start(const KisApplicationArguments &args)
KoHashGeneratorProvider::instance()->setGenerator("MD5", new KisMD5Generator());
// Initialize all Krita directories etc.
KoGlobal::initialize();
KConfigGroup group(KSharedConfig::openConfig(), "theme");
Digikam::ThemeManager themeManager;
themeManager.setCurrentTheme(group.readEntry("Theme", "Krita dark"));
......
......@@ -958,7 +958,6 @@ bool KisMainWindow::installBundle(const QString &fileName) const
{
QFileInfo from(fileName);
QFileInfo to(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/bundles/" + from.fileName());
qDebug() << "from" << from << "to" << to;
if (to.exists()) {
QFile::remove(to.canonicalFilePath());
}
......
......@@ -70,7 +70,6 @@
#include <KoZoomHandler.h>
#include <KoPluginLoader.h>
#include <KoDocumentInfo.h>
#include <KoGlobal.h>
#include <KoColorSpaceRegistry.h>
#include "input/kis_input_manager.h"
......@@ -1345,7 +1344,7 @@ void KisViewManager::setShowFloatingMessage(bool show)
void KisViewManager::changeAuthorProfile(const QString &profileName)
{
KConfigGroup appAuthorGroup(KoGlobal::calligraConfig(), "Author");
KConfigGroup appAuthorGroup(KSharedConfig::openConfig(), "Author");
if (profileName.isEmpty() || profileName == i18nc("choice for author profile", "Anonymous")) {
appAuthorGroup.writeEntry("active-profile", "");
} else {
......@@ -1366,7 +1365,7 @@ void KisViewManager::slotUpdateAuthorProfileActions()
d->actionAuthor->clear();
d->actionAuthor->addAction(i18nc("choice for author profile", "Anonymous"));
KConfigGroup authorGroup(KoGlobal::calligraConfig(), "Author");
KConfigGroup authorGroup(KSharedConfig::openConfig(), "Author");
QStringList profiles = authorGroup.readEntry("profile-names", QStringList());
QString authorInfo = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/authorinfo/";
QStringList filters = QStringList() << "*.authorinfo";
......@@ -1382,7 +1381,7 @@ void KisViewManager::slotUpdateAuthorProfileActions()
d->actionAuthor->addAction(profile);
}
KConfigGroup appAuthorGroup(KoGlobal::calligraConfig(), "Author");
KConfigGroup appAuthorGroup(KSharedConfig::openConfig(), "Author");
QString profileName = appAuthorGroup.readEntry("active-profile", "");
if (profileName == "anonymous" || profileName.isEmpty()) {
......
......@@ -121,6 +121,7 @@ GeneralTab::GeneralTab(QWidget *_parent, const char *_name)
m_cmbOutlineShape->setCurrentIndex(cfg.newOutlineStyle());
m_showOutlinePainting->setChecked(cfg.showOutlineWhilePainting());
m_changeBrushOutline->setChecked(!cfg.forceAlwaysFullSizedOutline());
KoColor cursorColor(KoColorSpaceRegistry::instance()->rgb8());
cursorColor.fromQColor(cfg.getCursorMainColor());
......@@ -232,6 +233,7 @@ void GeneralTab::setDefault()
m_undoStackSize->setValue(cfg.undoStackLimit(true));
m_backupFileCheckBox->setChecked(cfg.backupFile(true));
m_showOutlinePainting->setChecked(cfg.showOutlineWhilePainting(true));
m_changeBrushOutline->setChecked(!cfg.forceAlwaysFullSizedOutline(true));
m_hideSplashScreen->setChecked(cfg.hideSplashScreen(true));
m_chkNativeFileDialog->setChecked(false);
......@@ -1297,6 +1299,7 @@ bool KisDlgPreferences::editPreferences()
cfg.setNewOutlineStyle(dialog->m_general->outlineStyle());
cfg.setShowRootLayer(dialog->m_general->showRootLayer());
cfg.setShowOutlineWhilePainting(dialog->m_general->showOutlineWhilePainting());
cfg.setForceAlwaysFullSizedOutline(!dialog->m_general->m_changeBrushOutline->isChecked());
cfg.setHideSplashScreen(dialog->m_general->hideSplashScreen());
cfg.setSessionOnStartup(dialog->m_general->sessionOnStartup());
cfg.setSaveSessionOnQuit(dialog->m_general->saveSessionOnQuit());
......
......@@ -95,22 +95,50 @@
<widget class="QComboBox" name="m_cmbOutlineShape"/>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="m_showOutlinePainting">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Show brush outline while painting</string>
</property>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>While painting...</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QCheckBox" name="m_showOutlinePainting">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Show outline</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="m_changeBrushOutline">
<property name="text">
<string>Use effective outline size</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
......
......@@ -960,6 +960,16 @@ void KisConfig::setShowOutlineWhilePainting(bool showOutlineWhilePainting) const
m_cfg.writeEntry("ShowOutlineWhilePainting", showOutlineWhilePainting);
}
bool KisConfig::forceAlwaysFullSizedOutline(bool defaultValue) const
{
return (defaultValue ? false : m_cfg.readEntry("forceAlwaysFullSizedOutline", false));
}
void KisConfig::setForceAlwaysFullSizedOutline(bool value) const
{
m_cfg.writeEntry("forceAlwaysFullSizedOutline", value);
}
bool KisConfig::hideSplashScreen(bool defaultValue) const
{
KConfigGroup cfg( KSharedConfig::openConfig(), "SplashScreen");
......
......@@ -248,6 +248,9 @@ public:
bool showOutlineWhilePainting(bool defaultValue = false) const;
void setShowOutlineWhilePainting(bool showOutlineWhilePainting) const;
bool forceAlwaysFullSizedOutline(bool defaultValue = false) const;
void setForceAlwaysFullSizedOutline(bool value) const;
bool hideSplashScreen(bool defaultValue = false) const;
void setHideSplashScreen(bool hideSplashScreen) const;
......
......@@ -721,28 +721,29 @@ void KisToolPaint::requestUpdateOutline(const QPointF &outlineDocPoint, const Ko
KisConfig cfg;
KisPaintOpSettings::OutlineMode outlineMode;
outlineMode = KisPaintOpSettings::CursorNoOutline;
if (isOutlineEnabled() &&
(mode() == KisTool::GESTURE_MODE ||
((cfg.newOutlineStyle() == OUTLINE_FULL ||
cfg.newOutlineStyle() == OUTLINE_CIRCLE ||
cfg.newOutlineStyle() == OUTLINE_TILT ||
cfg.newOutlineStyle() == OUTLINE_COLOR ) &&
cfg.newOutlineStyle() == OUTLINE_TILT) &&
((mode() == HOVER_MODE) ||
(mode() == PAINT_MODE && cfg.showOutlineWhilePainting()))))) { // lisp forever!
if(cfg.newOutlineStyle() == OUTLINE_CIRCLE) {
outlineMode = KisPaintOpSettings::CursorIsCircleOutline;
outlineMode.isVisible = true;
if (cfg.newOutlineStyle() == OUTLINE_CIRCLE) {
outlineMode.forceCircle = true;
} else if(cfg.newOutlineStyle() == OUTLINE_TILT) {
outlineMode = KisPaintOpSettings::CursorTiltOutline;
} else if(cfg.newOutlineStyle() == OUTLINE_COLOR) {
outlineMode = KisPaintOpSettings::CursorColorOutline;
outlineMode.forceCircle = true;
outlineMode.showTiltDecoration = true;
} else {
outlineMode = KisPaintOpSettings::CursorIsOutline;
// noop
}
}
outlineMode.forceFullSize = cfg.forceAlwaysFullSizedOutline();
m_outlineDocPoint = outlineDocPoint;
m_currentOutline = getOutlinePath(m_outlineDocPoint, event, outlineMode);
......
......@@ -6,7 +6,6 @@ set(kritawidgets_LIB_SRCS
KoGradientEditWidget.cpp
KoVBox.cpp
KoDialog.cpp
KoGlobal.cpp
KoZoomWidget.cpp
KoTagToolButton.cpp
KoTagChooserWidget.cpp
......@@ -25,7 +24,6 @@ set(kritawidgets_LIB_SRCS
KoZoomHandler.cpp
KoZoomMode.cpp
KoDpi.cpp
KoGlobal.cpp
KoColorPatch.cpp
KoColorPopupAction.cpp
KoColorSetWidget.cpp
......@@ -58,7 +56,7 @@ set(kritawidgets_LIB_SRCS
KoToolBoxDocker.cpp
KoToolBoxFactory.cpp
KoToolDocker.cpp
KoPageLayoutWidget.cpp
KoPageLayoutDialog.cpp
......@@ -68,9 +66,8 @@ set(kritawidgets_LIB_SRCS
KoMarkerItemDelegate.cpp
KoDocumentInfoDlg.cpp
KoGlobal.cpp
KoTableView.cpp
WidgetsDebug.cpp
kis_file_name_requester.cpp
......
......@@ -24,7 +24,6 @@
#include "ui_KoConfigAuthorPage.h"
#include <KoGlobal.h>
#include <KoIcon.h>
#include <QDebug>
......@@ -181,8 +180,7 @@ KoConfigAuthorPage::KoConfigAuthorPage()
}
// Add all the user defined profiles (old type)
KConfig *config = KoGlobal::calligraConfig();
KConfigGroup authorGroup(config, "Author");
KConfigGroup authorGroup(KSharedConfig::openConfig(), "Author");
QStringList profiles = authorGroup.readEntry("profile-names", QStringList());
......
......@@ -25,7 +25,6 @@
#include "KoDocumentInfo.h"
#include "KoDocumentBase.h"
#include "KoGlobal.h"
#include "KoPageWidgetItem.h"
#include <KoIcon.h>
......@@ -91,8 +90,6 @@ KoDocumentInfoDlg::KoDocumentInfoDlg(QWidget* parent, KoDocumentInfo* docInfo)
d->aboutUi = new Ui::KoDocumentInfoAboutWidget();
QWidget *infodlg = new QWidget();
d->aboutUi->setupUi(infodlg);
d->aboutUi->cbLanguage->addItems(KoGlobal::listOfLanguages());
d->aboutUi->cbLanguage->setCurrentIndex(-1);
QStringList licenseExamples;
licenseExamples << "CC-BY 4.0" << "CC-BY-SA 4.0" << "CC-BY-SA-NC 4.0" << "CC-0";
QCompleter *examples = new QCompleter(licenseExamples);
......@@ -178,8 +175,6 @@ void KoDocumentInfoDlg::initAboutTab()
d->aboutUi->leTitle->setText(d->info->aboutInfo("title"));
d->aboutUi->leSubject->setText(d->info->aboutInfo("subject"));
QString language = KoGlobal::languageFromTag(d->info->aboutInfo("language"));
d->aboutUi->cbLanguage->setCurrentIndex(d->aboutUi->cbLanguage->findText(language));
d->aboutUi->leKeywords->setToolTip(i18n("Use ';' (Example: Office;KDE;Calligra)"));
if (!d->info->aboutInfo("keyword").isEmpty())
......@@ -238,7 +233,6 @@ void KoDocumentInfoDlg::saveAboutData()
d->info->setAboutInfo("subject", d->aboutUi->leSubject->text());
d->info->setAboutInfo("abstract", d->aboutUi->meDescription->toPlainText());
d->info->setAboutInfo("license", d->aboutUi->leLicense->text());
d->info->setAboutInfo("language", KoGlobal::tagOfLanguage(d->aboutUi->cbLanguage->currentText()));
}
void KoDocumentInfoDlg::hideEvent( QHideEvent *event )
......
/* This file is part of the KDE project
Copyright (C) 2001 David Faure <faure@kde.org>
Copyright 2003 Nicolas GOUTTE <goutte@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "KoGlobal.h"
#include <KoConfig.h>
#include <KoResourcePaths.h>
#include <QPaintDevice>
#include <QFont>
#include <QFontInfo>
#include <QFontDatabase>
#include <QGlobalStatic>
#include <WidgetsDebug.h>
#include <kconfiggroup.h>
#include <klocalizedstring.h>
#include <ksharedconfig.h>
#include <kconfig.h>
Q_GLOBAL_STATIC(KoGlobal, s_instance)
KoGlobal* KoGlobal::self()
{
return s_instance;
}
KoGlobal::KoGlobal()
: m_pointSize(-1)
, m_calligraConfig(0)
{
// Fixes a bug where values from some config files are not picked up
// due to KSharedConfig::openConfig() being initialized before paths have been set up above.
// NOTE: Values set without a sync() call before KoGlobal has been initialized will not stick
KSharedConfig::openConfig()->reparseConfiguration();
}
KoGlobal::~KoGlobal()
{
delete m_calligraConfig;
}
QStringList KoGlobal::_listOfLanguageTags()
{
if (m_langMap.isEmpty())
createListOfLanguages();
return m_langMap.values();
}
QStringList KoGlobal::_listOfLanguages()
{
if (m_langMap.empty())
createListOfLanguages();
return m_langMap.keys();
}
void KoGlobal::createListOfLanguages()
{
KConfig config("all_languages", KConfig::NoGlobals);
// Note that we could also use KLocale::allLanguagesTwoAlpha
QMap<QString, bool> seenLanguages;
const QStringList langlist = config.groupList();
for (QStringList::ConstIterator itall = langlist.begin();
itall != langlist.end(); ++itall) {
const QString tag = *itall;
const QString name = config.group(tag).readEntry("Name", tag);
// e.g. name is "French" and tag is "fr"
// The QMap does the sorting on the display-name, so that
// comboboxes are sorted.
m_langMap.insert(name, tag);
seenLanguages.insert(tag, true);
}
// Also take a look at the installed translations.
// Many of them are already in all_languages but all_languages doesn't
// currently have en_GB or en_US etc.
QStringList translationList = KoResourcePaths::findAllResources("locale",
QString::fromLatin1("*/entry.desktop"))
+ KoResourcePaths::findAllResources("locale",
QString::fromLatin1("*/kf5_entry.desktop"));
translationList.removeDuplicates();
for (QStringList::Iterator it = translationList.begin();
it != translationList.end(); ++it) {
// Extract the language tag from the directory name
QString tag = *it;
int index = tag.lastIndexOf('/');
tag = tag.left(index);
index = tag.lastIndexOf('/');
tag = tag.mid(index + 1);
if (seenLanguages.find(tag) == seenLanguages.end()) {
KConfig entry(*it, KConfig::SimpleConfig);
const QString name = entry.group("KCM Locale").readEntry("Name", tag);
// e.g. name is "US English" and tag is "en_US"
m_langMap.insert(name, tag);
// enable this if writing a third way of finding languages below
//seenLanguages.insert( tag, true );
}
}
// #### We also might not have an entry for a language where spellchecking is supported,
// but no KDE translation is available, like fr_CA.
// How to add them?
}
QString KoGlobal::tagOfLanguage(const QString & _lang)
{
const LanguageMap& map = self()->m_langMap;
QMap<QString, QString>::ConstIterator it = map.find(_lang);
if (it != map.end())
return *it;
return QString();
}
QString KoGlobal::languageFromTag(const QString &langTag)
{
const LanguageMap& map = self()->m_langMap;
QMap<QString, QString>::ConstIterator it = map.begin();
const QMap<QString, QString>::ConstIterator end = map.end();
for (; it != end; ++it)
if (it.value() == langTag)
return it.key();
// Language code not found. Better return the code (tag) than nothing.
return langTag;
}
KConfig* KoGlobal::_calligraConfig()
{
if (!m_calligraConfig) {
m_calligraConfig = new KConfig("kritarc");
}
return m_calligraConfig;
}
/* This file is part of the KDE project
Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
Copyright 2002, 2003 David Faure <faure@kde.org>
Copyright 2003 Nicolas GOUTTE <goutte@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KOGLOBAL_H
#define KOGLOBAL_H
#include <QStringList>
#include <QFont>
#include <QMap>
#include "kritawidgets_export.h"
class KConfig;
class KRITAWIDGETS_EXPORT KoGlobal
{
public:
KoGlobal();
/// For KoApplication
static void initialize() {
(void)self(); // I don't want to make KGlobal instances public, so self() is private
}
/**
* @return the global KConfig object around kritarc.
* kritarc is used for Calligra-wide settings, from totally unrelated classes,
* so this is the centralization of the KConfig object so that the file is
* parsed only once
*/
static KConfig* calligraConfig() {
return self()->_calligraConfig();
}
/// Return the list of available languages, in their displayable form
/// (translated names)
static QStringList listOfLanguages() {
return self()->_listOfLanguages();
}
/// Return the list of available languages, in their internal form
/// e.g. "fr" or "en_US", here called "tag"
static QStringList listOfLanguageTags() {
return self()->_listOfLanguageTags();
}
/// For a given language display name, return its tag
static QString tagOfLanguage(const QString & _lang);
/// For a given language tag, return its display name
static QString languageFromTag(const QString &_lang);
~KoGlobal();
private:
static KoGlobal* self();
QStringList _listOfLanguages();
QStringList _listOfLanguageTags();
KConfig* _calligraConfig();
void createListOfLanguages();
int m_pointSize;
typedef QMap<QString, QString> LanguageMap;
LanguageMap m_langMap; // display-name -> language tag
KConfig* m_calligraConfig;
// No BC problem here, constructor is private, feel free to add members
friend class this_is_a_singleton; // work around gcc warning
};
#endif // KOGLOBAL
This diff is collapsed.
......@@ -23,7 +23,6 @@
#include <QCommandLineOption>
#include <KisApplication.h>
#include <KoGlobal.h>
#include <resources/KoHashGeneratorProvider.h>
#include "kis_md5_generator.h"
#include "PythonPluginManager.h"
......@@ -68,7 +67,6 @@ extern "C" int main(int argc, char **argv)
qDebug() << parser.positionalArguments();
KoHashGeneratorProvider::instance()->setGenerator("MD5", new KisMD5Generator());
KoGlobal::initialize();
app.addResourceTypes();
app.loadResources();
app.loadPlugins();
......
......@@ -18,7 +18,6 @@
*/
#include "LanguageTab.h"
#include "KoGlobal.h"
#include <KoCharacterStyle.h>
#include <KoIcon.h>
......@@ -37,8 +36,8 @@ LanguageTab::LanguageTab(/*KSpell2::Loader::Ptr loader,*/bool uniqueFormat, QWid
widget.languageListSearchLine->setListWidget(widget.languageList);
//TODO use fl
const QStringList langNames = KoGlobal::listOfLanguages();
const QStringList langTags = KoGlobal::listOfLanguageTags();
const QStringList langNames;
const QStringList langTags;
QSet<QString> spellCheckLanguages;
widget.languageList->addItem(QString("None"));
......@@ -70,17 +69,13 @@ LanguageTab::~LanguageTab()
void LanguageTab::save(KoCharacterStyle *style) const
{
if (!widget.languageList->currentItem() || widget.languageList->currentItem()->text() == "None") { //TODO i18n
style->setLanguage(QString());
} else {
style->setLanguage(KoGlobal::tagOfLanguage(widget.languageList->currentItem()->text()));
}
style->setLanguage(QString());
}
void LanguageTab::setDisplay(KoCharacterStyle *style)
void LanguageTab::setDisplay(KoCharacterStyle *)
{
if (m_uniqueFormat) {
const QString &name = KoGlobal::languageFromTag(style->language());
const QString name;
QList<QListWidgetItem *> items = widget.languageList->findItems(name,
Qt::MatchFixedString);
......
......@@ -132,12 +132,19 @@ KisPaintOpSettingsSP KisDuplicateOpSettings::clone() const
return setting;
}
QPainterPath KisDuplicateOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode)
QPainterPath KisDuplicateOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
QPainterPath path;
OutlineMode forcedMode = mode;
if (!forcedMode.isVisible) {
forcedMode.isVisible = true;
forcedMode.forceCircle = true;
}
// clone tool should always show an outline
path = KisBrushBasedPaintOpSettings::brushOutlineImpl(info, mode, 1.0, true);
path = KisBrushBasedPaintOpSettings::brushOutlineImpl(info, forcedMode, 1.0);
QPainterPath copy(path);
QRectF rect2 = copy.boundingRect();
......
......@@ -50,7 +50,7 @@ public:
KisPaintOpSettingsSP clone() const override;
using KisBrushBasedPaintOpSettings::brushOutline;
QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode) override;
QPainterPath brushOutline(const KisPaintInformation &info, const OutlineMode &mode) override;
KisNodeWSP sourceNode() const;
......
......@@ -71,30 +71,19 @@ bool KisDeformPaintOpSettings::isAirbrushing() const
}
}
QPainterPath KisDeformPaintOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode)
QPainterPath KisDeformPaintOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
QPainterPath path;
if (mode == CursorIsOutline || mode == CursorIsCircleOutline || mode == CursorTiltOutline) {
if (mode.isVisible) {
qreal width = getInt(BRUSH_DIAMETER);
qreal height = getInt(BRUSH_DIAMETER) * getDouble(BRUSH_ASPECT);