Commit ad15727c authored by Frederik Gladhorn's avatar Frederik Gladhorn

Cleanup usage of empty strings

There is no need to explicitly initialize QString in constructurs.
Using "" for an empty string is actually less type safe and more costly
than using QString() which returns an empty shared null string, so it's
always preferable to signify empty QStrings that way.
parent 01841330
......@@ -134,7 +134,7 @@ struct KisBrush::Private {
};
KisBrush::KisBrush()
: KoResource("")
: KoResource(QString())
, d(new Private)
{
}
......@@ -146,7 +146,7 @@ KisBrush::KisBrush(const QString& filename)
}
KisBrush::KisBrush(const KisBrush& rhs)
: KoResource("")
: KoResource(QString())
, KisShared()
, d(new Private)
{
......
......@@ -55,7 +55,7 @@ public:
KisGbrBrush(KisPaintDeviceSP image, int x, int y, int w, int h);
/// Load brush as a copy from the specified QImage (handy when you need to copy a brush!)
KisGbrBrush(const QImage& image, const QString& name = QString(""));
KisGbrBrush(const QImage& image, const QString& name = QString());
virtual ~KisGbrBrush();
......
......@@ -193,7 +193,7 @@ KisImagePipeBrush::KisImagePipeBrush(const QString& filename)
KisImagePipeBrush::KisImagePipeBrush(const QString& name, int w, int h,
QVector< QVector<KisPaintDevice*> > devices,
QVector<KisParasite::SelectionMode > modes)
: KisGbrBrush("")
: KisGbrBrush(QString())
, m_d(new Private())
{
Q_ASSERT(devices.count() == modes.count());
......
......@@ -23,10 +23,10 @@
#include "kritaflake_export.h"
class QRectF;
class QString;
class QPointF;
#include <QtGlobal>
#include <QtCore/QString>
/// This class provides a loading context for filter effects
class KRITAFLAKE_EXPORT KoFilterEffectLoadingContext
......@@ -36,7 +36,7 @@ public:
* Constructs a new filter effect loading context
* @param basePath the xml document base path
*/
explicit KoFilterEffectLoadingContext(const QString &basePath);
explicit KoFilterEffectLoadingContext(const QString &basePath = QString());
/// Destructor
virtual ~KoFilterEffectLoadingContext();
......
......@@ -155,7 +155,7 @@ QSet<QString> KoFilterEffectStack::requiredStandarsInputs() const
if (isEmpty())
return requiredInputs;
if (d->filterEffects.first()->inputs().contains(""))
if (d->filterEffects.first()->inputs().contains(QString()))
requiredInputs.insert("SourceGraphic");
Q_FOREACH (KoFilterEffect *effect, d->filterEffects) {
......
......@@ -238,7 +238,7 @@ KoShape * KoShapeRegistry::createShapeFromOdf(const KoXmlElement & e, KoShapeLoa
// in any way, so we disable the tools of the shape. This can
// be done in a hacky way (courtesy of Jaham) by setting its
// shapeID to "".
childShape->setShapeId("");
childShape->setShapeId(QString());
break;
}
}
......
......@@ -629,7 +629,7 @@ void KoPathTool::mouseMoveEvent(KoPointerEvent *event)
} else {
uint selectedPointCount = m_pointSelection.size();
if (selectedPointCount == 0)
emit statusTextChanged("");
emit statusTextChanged(QString());
else if (selectedPointCount == 1)
emit statusTextChanged(i18n("Press B to break path at selected point."));
else
......
......@@ -51,7 +51,7 @@ KisFilterRegistry::~KisFilterRegistry()
KisFilterRegistry* KisFilterRegistry::instance()
{
KisFilterRegistry *reg = qApp->findChild<KisFilterRegistry *>("");
KisFilterRegistry *reg = qApp->findChild<KisFilterRegistry *>(QString());
if (!reg) {
reg = new KisFilterRegistry(qApp);
KoPluginLoader::instance()->load("Krita/Filter", "Type == 'Service' and ([X-Krita-Version] == 28)");
......
......@@ -49,7 +49,7 @@ KisGeneratorRegistry::~KisGeneratorRegistry()
KisGeneratorRegistry* KisGeneratorRegistry::instance()
{
KisGeneratorRegistry *reg = qApp->findChild<KisGeneratorRegistry *>("");
KisGeneratorRegistry *reg = qApp->findChild<KisGeneratorRegistry *>(QString());
if (!reg) {
reg = new KisGeneratorRegistry(qApp);
KoPluginLoader::instance()->load("Krita/Generator", "Type == 'Service' and ([X-Krita-Version] == 28)");
......
......@@ -55,7 +55,7 @@ public:
return false;
}
virtual QString description() {
return QString("");
return QString();
}
protected:
......
......@@ -40,7 +40,7 @@
#endif
KisImageConfig::KisImageConfig(bool readOnly)
: m_config( KSharedConfig::openConfig()->group("")),
: m_config( KSharedConfig::openConfig()->group(QString())),
m_readOnly(readOnly)
{
}
......
......@@ -193,7 +193,7 @@ void KisAslParserTest::testWritingGradients()
{
KisAslXmlWriter w1;
KoSegmentGradient segmentGradient("");
KoSegmentGradient segmentGradient;
segmentGradient.createSegment(INTERP_LINEAR, COLOR_INTERP_RGB,
0.0, 0.3, 0.15,
Qt::black, Qt::red);
......@@ -218,7 +218,7 @@ void KisAslParserTest::testWritingGradients()
stops << KoGradientStop(0.6, KoColor(Qt::green, cs));
stops << KoGradientStop(1.0, KoColor(Qt::white, cs));
KoStopGradient stopGradient("");
KoStopGradient stopGradient;
stopGradient.setStops(stops);
w2.writeStopGradient("tstG", &stopGradient);
......
......@@ -338,7 +338,7 @@ bool KoOdfLoadingContext::parseManifest(const KoXmlDocument &manifestDocument)
continue;
QString fullPath = el.attributeNS(KoXmlNS::manifest, "full-path", QString());
QString mediaType = el.attributeNS(KoXmlNS::manifest, "media-type", QString(""));
QString mediaType = el.attributeNS(KoXmlNS::manifest, "media-type", QString());
QString version = el.attributeNS(KoXmlNS::manifest, "version", QString());
// Only if fullPath is valid, should we store this entry.
......
......@@ -924,7 +924,7 @@ void TestXmlReader::testNamespace()
QCOMPARE(bookAuthorElement.hasAttributeNS(fnordNS, "title"), true);
QCOMPARE(bookAuthorElement.attributeNS(defaultNS, "title", ""), QString("Goddess"));
QCOMPARE(bookAuthorElement.attributeNS(bookNS, "title", ""), QString(""));
QCOMPARE(bookAuthorElement.attributeNS(bookNS, "title", ""), QString());
QCOMPARE(bookAuthorElement.attributeNS(fnordNS, "title", ""), QString("Goddess"));
QCOMPARE(bookAuthorElement.hasAttributeNS(defaultNS, "fnord:title"), false);
......@@ -1055,7 +1055,7 @@ void TestXmlReader::testParseQString()
QCOMPARE(bookAuthorElement.hasAttributeNS(fnordNS, "title"), true);
QCOMPARE(bookAuthorElement.attributeNS(defaultNS, "title", ""), QString("Goddess"));
QCOMPARE(bookAuthorElement.attributeNS(bookNS, "title", ""), QString(""));
QCOMPARE(bookAuthorElement.attributeNS(bookNS, "title", ""), QString());
QCOMPARE(bookAuthorElement.attributeNS(fnordNS, "title", ""), QString("Goddess"));
QCOMPARE(bookAuthorElement.hasAttributeNS(defaultNS, "fnord:title"), false);
......
......@@ -909,7 +909,7 @@ void TestXmlReaderWithoutSpaces::testNamespace()
QCOMPARE(bookAuthorElement.hasAttributeNS(fnordNS, "title"), true);
QCOMPARE(bookAuthorElement.attributeNS(defaultNS, "title", ""), QString("Goddess"));
QCOMPARE(bookAuthorElement.attributeNS(bookNS, "title", ""), QString(""));
QCOMPARE(bookAuthorElement.attributeNS(bookNS, "title", ""), QString());
QCOMPARE(bookAuthorElement.attributeNS(fnordNS, "title", ""), QString("Goddess"));
QCOMPARE(bookAuthorElement.hasAttributeNS(defaultNS, "fnord:title"), false);
......@@ -1036,7 +1036,7 @@ void TestXmlReaderWithoutSpaces::testParseQString()
QCOMPARE(bookAuthorElement.hasAttributeNS(fnordNS, "title"), true);
QCOMPARE(bookAuthorElement.attributeNS(defaultNS, "title", ""), QString("Goddess"));
QCOMPARE(bookAuthorElement.attributeNS(bookNS, "title", ""), QString(""));
QCOMPARE(bookAuthorElement.attributeNS(bookNS, "title", ""), QString());
QCOMPARE(bookAuthorElement.attributeNS(fnordNS, "title", ""), QString("Goddess"));
QCOMPARE(bookAuthorElement.hasAttributeNS(defaultNS, "fnord:title"), false);
......
......@@ -363,7 +363,7 @@ void KoColorSpace::addCompositeOp(const KoCompositeOp * op)
const KoColorConversionTransformation* KoColorSpace::toLabA16Converter() const
{
if (!d->transfoToLABA16) {
d->transfoToLABA16 = KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter(this, KoColorSpaceRegistry::instance()->lab16(""), KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::internalConversionFlags()) ;
d->transfoToLABA16 = KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter(this, KoColorSpaceRegistry::instance()->lab16(), KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::internalConversionFlags()) ;
}
return d->transfoToLABA16;
}
......@@ -371,21 +371,21 @@ const KoColorConversionTransformation* KoColorSpace::toLabA16Converter() const
const KoColorConversionTransformation* KoColorSpace::fromLabA16Converter() const
{
if (!d->transfoFromLABA16) {
d->transfoFromLABA16 = KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter(KoColorSpaceRegistry::instance()->lab16(""), this, KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::internalConversionFlags()) ;
d->transfoFromLABA16 = KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter(KoColorSpaceRegistry::instance()->lab16(), this, KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::internalConversionFlags()) ;
}
return d->transfoFromLABA16;
}
const KoColorConversionTransformation* KoColorSpace::toRgbA16Converter() const
{
if (!d->transfoToRGBA16) {
d->transfoToRGBA16 = KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter(this, KoColorSpaceRegistry::instance()->rgb16(""), KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::internalConversionFlags()) ;
d->transfoToRGBA16 = KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter(this, KoColorSpaceRegistry::instance()->rgb16(), KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::internalConversionFlags()) ;
}
return d->transfoToRGBA16;
}
const KoColorConversionTransformation* KoColorSpace::fromRgbA16Converter() const
{
if (!d->transfoFromRGBA16) {
d->transfoFromRGBA16 = KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter(KoColorSpaceRegistry::instance()->rgb16("") , this, KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::internalConversionFlags()) ;
d->transfoFromRGBA16 = KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter(KoColorSpaceRegistry::instance()->rgb16() , this, KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::internalConversionFlags()) ;
}
return d->transfoFromRGBA16;
}
......
......@@ -73,7 +73,7 @@ KoColorSet::KoColorSet(const QString& filename)
}
KoColorSet::KoColorSet()
: KoResource("")
: KoResource(QString())
{
m_columns = 0; // Set the default value that the GIMP uses...
}
......@@ -81,7 +81,7 @@ KoColorSet::KoColorSet()
/// Create an copied palette
KoColorSet::KoColorSet(const KoColorSet& rhs)
: QObject(0)
, KoResource("")
, KoResource(QString())
{
setFilename(rhs.filename());
m_ownData = false;
......
......@@ -257,7 +257,7 @@ class KRITAPIGMENT_EXPORT KoSegmentGradient : public KoAbstractGradient
{
public:
explicit KoSegmentGradient(const QString &file);
explicit KoSegmentGradient(const QString &file = QString());
virtual ~KoSegmentGradient();
KoAbstractGradient* clone() const;
......
......@@ -210,7 +210,7 @@ KoStopGradient * KoStopGradient::fromQGradient(QGradient * gradient)
if (! gradient)
return 0;
KoStopGradient * newGradient = new KoStopGradient("");
KoStopGradient * newGradient = new KoStopGradient(QString());
newGradient->setType(gradient->type());
newGradient->setSpread(gradient->spread());
......
......@@ -36,7 +36,7 @@ class KRITAPIGMENT_EXPORT KoStopGradient : public KoAbstractGradient
{
public:
explicit KoStopGradient(const QString &filename);
explicit KoStopGradient(const QString &filename = QString());
virtual ~KoStopGradient();
KoAbstractGradient* clone() const;
......
......@@ -43,8 +43,8 @@ int main(int argc, char** argv)
// Initialize the list of options
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("graphs"), i18n("return the list of available graphs")));
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("graph"), i18n("specify the type of graph (see --graphs to get the full list, the default is full)"), QLatin1String("type"), QLatin1String("full")));
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("key"), i18n("specify the key of the source color space"), QLatin1String("key"), QLatin1String("")));
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("key"), i18n("specify the key of the destination color space"), QLatin1String("key"), QLatin1String("")));
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("key"), i18n("specify the key of the source color space"), QLatin1String("key"), QString()));
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("key"), i18n("specify the key of the destination color space"), QLatin1String("key"), QString()));
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("output"), i18n("specify the output (can be ps or dot, the default is ps)"), QLatin1String("type"), QLatin1String("ps")));
parser.addPositionalArgument(QLatin1String("outputfile"), i18n("name of the output file"));
parser.process(app); // PORTING SCRIPT: move this to after any parser.addOption
......
......@@ -397,7 +397,7 @@ bool KisApplication::start(const KisApplicationArguments &args)
checkAutosaveFiles();
}
setSplashScreenLoadingText(""); // done loading, so clear out label
setSplashScreenLoadingText(QString()); // done loading, so clear out label
// Get the command line arguments which we have to parse
int argsCount = args.filenames().count();
......
......@@ -115,8 +115,8 @@ bool KisResourceBundleManifest::load(QIODevice *device)
continue;
QString fullPath = el.attributeNS(KoXmlNS::manifest, "full-path", QString());
QString mediaType = el.attributeNS(KoXmlNS::manifest, "media-type", QString(""));
QString md5sum = el.attributeNS(KoXmlNS::manifest, "md5sum", QString(""));
QString mediaType = el.attributeNS(KoXmlNS::manifest, "media-type", QString());
QString md5sum = el.attributeNS(KoXmlNS::manifest, "md5sum", QString());
QString version = el.attributeNS(KoXmlNS::manifest, "version", QString());
QStringList tagList;
......
......@@ -115,7 +115,7 @@ void KisWorkspaceChooser::slotSave()
}
KoResourceServer<KisWorkspaceResource> * rserver = KisResourceServerProvider::instance()->workspaceServer();
KisWorkspaceResource* workspace = new KisWorkspaceResource("");
KisWorkspaceResource* workspace = new KisWorkspaceResource(QString());
workspace->setDockerState(m_view->qtMainWindow()->saveState());
m_view->resourceProvider()->notifySavingWorkspace(workspace);
workspace->setValid(true);
......
......@@ -51,7 +51,7 @@ public:
const KoColorSpace* cs = KoColorSpaceRegistry::instance()->rgb8();
QList<KoGradientStop> stops;
KoStopGradient* gradient = new KoStopGradient("");
KoStopGradient* gradient = new KoStopGradient();
gradient->setType(QGradient::LinearGradient);
gradient->setName("Foreground to Transparent");
stops << KoGradientStop(0.0, KoColor(Qt::black, cs)) << KoGradientStop(1.0, KoColor(QColor(0, 0, 0, 0), cs));
......@@ -62,7 +62,7 @@ public:
addResource(gradient, false, true);
m_foregroundToTransparent = gradient;
gradient = new KoStopGradient("");
gradient = new KoStopGradient();
gradient->setType(QGradient::LinearGradient);
gradient->setName("Foreground to Background");
......
......@@ -227,7 +227,7 @@ void KisDoubleParseSpinBox::clearErrorStyle()
if (boolLastValid) {
warningIcon->setVisible(false);
//setStyleSheet("");
//setStyleSheet(QString());
setPalette(oldPalette);
isOldPaletteSaved = false;
......
......@@ -232,7 +232,7 @@ void KisIntParseSpinBox::clearErrorStyle()
if (boolLastValid) {
warningIcon->setVisible(false);
//setStyleSheet("");
//setStyleSheet(QString());
setPalette(oldPalette);
isOldPaletteSaved = false;
......
......@@ -445,15 +445,12 @@ void KisActionRegistry::Private::loadActionFiles()
// dbgAction << "default shortcut for" << name << " - " << info.defaultShortcut;
actionInfoList.insert(name,info);
}
}
actionXml = actionXml.nextSiblingElement();
}
actions = actions.nextSiblingElement();
}
}
};
void KisActionRegistry::Private::loadCustomShortcuts(QString filename)
......@@ -461,7 +458,6 @@ void KisActionRegistry::Private::loadCustomShortcuts(QString filename)
const KConfigGroup localShortcuts(KSharedConfig::openConfig(filename),
QStringLiteral("Shortcuts"));
if (!localShortcuts.exists()) {
return;
}
......@@ -473,7 +469,7 @@ void KisActionRegistry::Private::loadCustomShortcuts(QString filename)
if (entry == QStringLiteral("none")) {
// A shortcut list with a single entry "" means the user has disabled the shortcut.
// This occurs after stealing the shortcut without assigning a new one.
i.value().customShortcuts = QKeySequence::listFromString("");
i.value().customShortcuts = QList<QKeySequence>();
} else {
i.value().customShortcuts = QKeySequence::listFromString(entry);
}
......
......@@ -84,7 +84,7 @@ IccColorProfile::IccColorProfile(const QString &fileName)
}
IccColorProfile::IccColorProfile(const QByteArray &rawData)
: KoColorProfile(""), d(new Private)
: KoColorProfile(QString()), d(new Private)
{
d->shared = QSharedPointer<Private::Shared>(new Private::Shared());
d->shared->data.reset(new Data());
......
......@@ -143,7 +143,7 @@ KisColorSliderWidget::KisColorSliderWidget(KoColorDisplayRendererInterface *disp
KisColorSliderWidget::~KisColorSliderWidget()
{
//KConfigGroup cfg = KSharedConfig::openConfig()->group("");
//KConfigGroup cfg = KSharedConfig::openConfig()->group(QString());
//cfg.writeEntry("SpecificColorSelector/ShowColorSpaceSelector", m_chkShowColorSpaceSelector->isChecked());
}
......
......@@ -61,7 +61,7 @@ KisSpecificColorSelectorWidget::KisSpecificColorSelectorWidget(QWidget* parent)
m_chkShowColorSpaceSelector = new QCheckBox(i18n("Show Colorspace Selector"), this);
connect(m_chkShowColorSpaceSelector, SIGNAL(toggled(bool)), m_colorspaceSelector, SLOT(setVisible(bool)));
KConfigGroup cfg = KSharedConfig::openConfig()->group("");
KConfigGroup cfg = KSharedConfig::openConfig()->group(QString());
m_chkShowColorSpaceSelector->setChecked(cfg.readEntry("SpecificColorSelector/ShowColorSpaceSelector", true));
m_colorspaceSelector->setVisible(m_chkShowColorSpaceSelector->isChecked());
......@@ -76,7 +76,7 @@ KisSpecificColorSelectorWidget::KisSpecificColorSelectorWidget(QWidget* parent)
KisSpecificColorSelectorWidget::~KisSpecificColorSelectorWidget()
{
KConfigGroup cfg = KSharedConfig::openConfig()->group("");
KConfigGroup cfg = KSharedConfig::openConfig()->group(QString());
cfg.writeEntry("SpecificColorSelector/ShowColorSpaceSelector", m_chkShowColorSpaceSelector->isChecked());
}
......
......@@ -194,7 +194,7 @@ void TasksetDockerDock::saveClicked()
m_taskThread->barrier();
TasksetResource* taskset = new TasksetResource("");
TasksetResource* taskset = new TasksetResource(QString());
QStringList actionNames;
Q_FOREACH (QAction* action, m_model->actions()) {
......
......@@ -726,7 +726,7 @@ FileParameter::FileParameter(const QString& name, bool updatePreview): Parameter
void FileParameter::parseValues(const QString& typeDefinition)
{
QStringList values = getValues(typeDefinition);
// some definitions are like _file=("")
// some definitions are like _file=QString()
QString filePath = stripQuotes(values.at(0));
if (!filePath.isEmpty())
{
......
......@@ -201,14 +201,14 @@ void DlgBundleManager::removeSelected()
void DlgBundleManager::itemSelected(QListWidgetItem *current, QListWidgetItem *)
{
if (!current) {
m_ui->lblName->setText("");
m_ui->lblAuthor->setText("");
m_ui->lblEmail->setText("");
m_ui->lblLicense->setText("");
m_ui->lblWebsite->setText("");
m_ui->lblDescription->setPlainText("");
m_ui->lblCreated->setText("");
m_ui->lblUpdated->setText("");
m_ui->lblName->clear();
m_ui->lblAuthor->clear();
m_ui->lblEmail->clear();
m_ui->lblLicense->clear();
m_ui->lblWebsite->clear();
m_ui->lblDescription->clear();
m_ui->lblCreated->clear();
m_ui->lblUpdated->clear();
m_ui->lblPreview->setPixmap(QPixmap::fromImage(QImage()));
m_ui->listBundleContents->clear();
m_ui->bnEditBundle->setEnabled(false);
......
......@@ -333,7 +333,7 @@ void ArtisticTextTool::mouseMoveEvent(KoPointerEvent *event)
if (m_currentShape) {
emit statusTextChanged(i18n("Press escape to finish editing."));
} else {
emit statusTextChanged("");
emit statusTextChanged(QString());
}
}
}
......
......@@ -38,7 +38,7 @@
QString format(qreal v)
{
static const QString f("%1");
static const QString e("");
static const QString e;
static const QRegExp r("\\.?0+$");
return f.arg(v, 0, 'f').replace(r, e);
}
......
......@@ -72,8 +72,8 @@ LabeledWidget::LabeledWidget(QAction *action, const QString &label, LabelPositio
layout->addWidget(l);
layout->addWidget(m_lineEdit);
if (warningLabelRequired) {
m_warningLabel[0] = new QLabel("");
m_warningLabel[1] = new QLabel("");
m_warningLabel[0] = new QLabel();
m_warningLabel[1] = new QLabel();
m_warningLabel[0]->setWordWrap(true);
m_warningLabel[1]->setWordWrap(true);
layout->addWidget(m_warningLabel[0]);
......@@ -106,7 +106,7 @@ void LabeledWidget::setWarningText(int pos, const QString &warning)
void LabeledWidget::clearLineEdit()
{
m_lineEdit->setText("");
m_lineEdit->setText(QString());
}
ReferencesTool::ReferencesTool(KoCanvasBase *canvas): TextTool(canvas),
......
......@@ -161,7 +161,7 @@ void LinkInsertionDialog::insertHyperlink(QString &linkURLString, const QString
{
QString linkhtml;
QUrl linkURL = QUrl(linkURLString);
dlg.weblinkStatusLabel->setText("");
dlg.weblinkStatusLabel->setText(QString());
if (!linkURL.isValid()) {
displayInlineWarning(i18n("The URL is invalid"), dlg.weblinkStatusLabel);
} else {
......@@ -175,7 +175,7 @@ void LinkInsertionDialog::insertHyperlink(QString &linkURLString, const QString
void LinkInsertionDialog::insertBookmarkLink(const QString &linkURL, const QString &linkText)
{
dlg.bookmarkLinkStatusLabel->setText("");
dlg.bookmarkLinkStatusLabel->setText(QString());
m_editor->insertText(linkText, linkURL);
this->close();
}
......@@ -272,7 +272,7 @@ void LinkInsertionDialog::replyFinished()
}
}
dlg.hyperlinkText->setText(QStringRef(&res, start, end - start).toString());
dlg.weblinkStatusLabel->setText("");
dlg.weblinkStatusLabel->setText(QString());
}
void LinkInsertionDialog::updateTitleDownloadProgress(qint64 received, qint64 total)
......
......@@ -84,7 +84,7 @@ KoTableOfContentsGeneratorInfo::KoTableOfContentsGeneratorInfo(bool generateEntr
// index-entry-tab-stop
IndexEntryTabStop *entryTabStop = new IndexEntryTabStop(QString());
entryTabStop->tab.type = QTextOption::RightTab;
entryTabStop->setPosition("");
entryTabStop->setPosition(QString());
entryTabStop->tab.leaderText = '.';
tocEntryTemplate.indexEntries.append(static_cast<IndexEntry*>(entryTabStop));
......
......@@ -1441,7 +1441,7 @@ void KoTextEditor::insertHtml(const QString &html)
QTextList *currentTextList = currentBlock.textList();
if(currentTextList && !pastedLists.contains(currentBlock.textList())) {
KoListStyle *listStyle = KoTextDocument(d->document).styleManager()->defaultListStyle()->clone();
listStyle->setName("");
listStyle->setName(QString());
listStyle->setStyleId(0);
currentPastedList = new KoList(d->document, listStyle);
QTextListFormat currentTextListFormat = currentTextList->format();
......@@ -1449,8 +1449,8 @@ void KoTextEditor::insertHtml(const QString &html)
KoListLevelProperties levelProperty = listStyle->levelProperties(currentTextListFormat.indent());
levelProperty.setStyle(static_cast<KoListStyle::Style>(currentTextListFormat.style()));
levelProperty.setLevel(currentTextListFormat.indent());
levelProperty.setListItemPrefix("");
levelProperty.setListItemSuffix("");
levelProperty.setListItemPrefix(QString());
levelProperty.setListItemSuffix(QString());
levelProperty.setListId((KoListStyle::ListIdType)currentTextList);
listStyle->setLevelProperties(levelProperty);
......
......@@ -98,7 +98,7 @@ void TextPasteCommand::redo()
}
if (editor->blockFormat().hasProperty(KoParagraphStyle::HiddenByTable)) {
editor->insertText("");
editor->insertText(QString());
}
if (m_pasteAsText) {
......
......@@ -22,8 +22,6 @@
CSVLayerRecord::CSVLayerRecord()
: layer(0)
, channel(0)
, last("")
, path()
, frame(0)
{
}
......
......@@ -90,7 +90,7 @@ KisImageBuilder_Result CSVLoader::decode(const QString &filename)
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
idx= filename.lastIndexOf(QRegExp("[\\/]"));
QString base = (idx == -1) ? QString("") : filename.left(idx + 1); //include separator
QString base = (idx == -1) ? QString() : filename.left(idx + 1); //include separator
QString path = filename;
if (path.right(4).toUpper() == ".CSV")
......
......@@ -85,7 +85,7 @@ KisHatchingPaintOpSettingsWidget:: KisHatchingPaintOpSettingsWidget(QWidget* par
/*xMLAnalyzer is an empty document we'll use to analyze and edit the config string part by part
I know the important string is "brush_definition" because I read the tree with the snippet
in kis_hatching_paintop_settings.cpp */
QDomDocument xMLAnalyzer("");
QDomDocument xMLAnalyzer;
xMLAnalyzer.setContent(reconfigurationCourier->getString("brush_definition"));
/*More things I know by reading the XML tree. At this point you can just read it with:
......
......@@ -59,7 +59,7 @@ KisSketchPaintOpSettingsWidget::KisSketchPaintOpSettingsWidget(QWidget* parent)
addPaintOpOption(m_paintActionType, i18n("Painting Mode"));
KisPropertiesConfigurationSP reconfigurationCourier = configuration();
QDomDocument xMLAnalyzer("");
QDomDocument xMLAnalyzer;
xMLAnalyzer.setContent(reconfigurationCourier->getString("brush_definition"));
QDomElement firstTag = xMLAnalyzer.documentElement();
......
......@@ -327,7 +327,7 @@ void ConnectionTool::mousePressEvent(KoPointerEvent *event)
}
//add connector label
connectionShape->createTextShape(canvas()->shapeController()->resourceManager());
connectionShape->setPlainText("");
connectionShape->setPlainText(QString());
// create the connection edit strategy from the path tool
m_currentStrategy = new KoPathConnectionPointStrategy(this, connectionShape, 1);
if (!m_currentStrategy) {
......@@ -781,7 +781,7 @@ void ConnectionTool::updateStatusText()
emit statusTextChanged(i18n("Click to edit connection points."));
}
} else {
emit statusTextChanged("");
emit statusTextChanged(QString());
}
break;
case EditConnection:
......@@ -804,7 +804,7 @@ void ConnectionTool::updateStatusText()
emit statusTextChanged(i18n("Drag to create new connection."));
break;
default:
emit statusTextChanged("");