Commit cf01301b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

fix clazy warning

parent ac30df57
......@@ -54,13 +54,13 @@ ConfigDialog::ConfigDialog(QWidget* parent)
widget = setupPage(mGeneralConfigPage);
mThumbnailActionsGroup = new InvisibleButtonGroup(widget);
mThumbnailActionsGroup->setObjectName(QLatin1String("kcfg_ThumbnailActions"));
mThumbnailActionsGroup->setObjectName(QStringLiteral("kcfg_ThumbnailActions"));
mThumbnailActionsGroup->addButton(mGeneralConfigPage.allButtonsThumbnailActionsRadioButton, int(ThumbnailActions::AllButtons));
mThumbnailActionsGroup->addButton(mGeneralConfigPage.selectionOnlyThumbnailActionsRadioButton, int(ThumbnailActions::ShowSelectionButtonOnly));
mThumbnailActionsGroup->addButton(mGeneralConfigPage.noneThumbnailActionsRadioButton, int(ThumbnailActions::None));
pageItem = addPage(widget, i18n("General"));
pageItem->setIcon(QIcon::fromTheme("gwenview"));
pageItem->setIcon(QIcon::fromTheme(QStringLiteral("gwenview")));
connect(mGeneralConfigPage.kcfg_ViewBackgroundValue, &QAbstractSlider::valueChanged, this, &ConfigDialog::updateViewBackgroundFrame);
connect(mGeneralConfigPage.kcfg_JPEGQuality, &QAbstractSlider::valueChanged, this, [=] (int value) {mGeneralConfigPage.jpegQualitySpinner->setValue(value);});
connect(mGeneralConfigPage.jpegQualitySpinner, QOverload<int>::of(&QSpinBox::valueChanged), this, [=] (int value) {mGeneralConfigPage.kcfg_JPEGQuality->setValue(value);});
......@@ -71,47 +71,47 @@ ConfigDialog::ConfigDialog(QWidget* parent)
widget = setupPage(mImageViewConfigPage);
mAlphaBackgroundModeGroup = new InvisibleButtonGroup(widget);
mAlphaBackgroundModeGroup->setObjectName(QLatin1String("kcfg_AlphaBackgroundMode"));
mAlphaBackgroundModeGroup->setObjectName(QStringLiteral("kcfg_AlphaBackgroundMode"));
mAlphaBackgroundModeGroup->addButton(mImageViewConfigPage.surroundingRadioButton, int(AbstractImageView::AlphaBackgroundNone));
mAlphaBackgroundModeGroup->addButton(mImageViewConfigPage.checkBoardRadioButton, int(AbstractImageView::AlphaBackgroundCheckBoard));
mAlphaBackgroundModeGroup->addButton(mImageViewConfigPage.solidColorRadioButton, int(AbstractImageView::AlphaBackgroundSolid));
mWheelBehaviorGroup = new InvisibleButtonGroup(widget);
mWheelBehaviorGroup->setObjectName(QLatin1String("kcfg_MouseWheelBehavior"));
mWheelBehaviorGroup->setObjectName(QStringLiteral("kcfg_MouseWheelBehavior"));
mWheelBehaviorGroup->addButton(mImageViewConfigPage.mouseWheelScrollRadioButton, int(MouseWheelBehavior::Scroll));
mWheelBehaviorGroup->addButton(mImageViewConfigPage.mouseWheelBrowseRadioButton, int(MouseWheelBehavior::Browse));
mWheelBehaviorGroup->addButton(mImageViewConfigPage.mouseWheelZoomRadioButton, int(MouseWheelBehavior::Zoom));
mAnimationMethodGroup = new InvisibleButtonGroup(widget);
mAnimationMethodGroup->setObjectName(QLatin1String("kcfg_AnimationMethod"));
mAnimationMethodGroup->setObjectName(QStringLiteral("kcfg_AnimationMethod"));
mAnimationMethodGroup->addButton(mImageViewConfigPage.glAnimationRadioButton, int(DocumentView::GLAnimation));
mAnimationMethodGroup->addButton(mImageViewConfigPage.softwareAnimationRadioButton, int(DocumentView::SoftwareAnimation));
mAnimationMethodGroup->addButton(mImageViewConfigPage.noAnimationRadioButton, int(DocumentView::NoAnimation));
mZoomModeGroup = new InvisibleButtonGroup(widget);
mZoomModeGroup->setObjectName(QLatin1String("kcfg_ZoomMode"));
mZoomModeGroup->setObjectName(QStringLiteral("kcfg_ZoomMode"));
mZoomModeGroup->addButton(mImageViewConfigPage.autofitZoomModeRadioButton, int(ZoomMode::Autofit));
mZoomModeGroup->addButton(mImageViewConfigPage.keepSameZoomModeRadioButton, int(ZoomMode::KeepSame));
mZoomModeGroup->addButton(mImageViewConfigPage.individualZoomModeRadioButton, int(ZoomMode::Individual));
mThumbnailBarOrientationGroup = new InvisibleButtonGroup(widget);
mThumbnailBarOrientationGroup->setObjectName(QLatin1String("kcfg_ThumbnailBarOrientation"));
mThumbnailBarOrientationGroup->setObjectName(QStringLiteral("kcfg_ThumbnailBarOrientation"));
mThumbnailBarOrientationGroup->addButton(mImageViewConfigPage.horizontalRadioButton, int(Qt::Horizontal));
mThumbnailBarOrientationGroup->addButton(mImageViewConfigPage.verticalRadioButton, int(Qt::Vertical));
pageItem = addPage(widget, i18n("Image View"));
pageItem->setIcon(QIcon::fromTheme("preferences-desktop-display-color"));
pageItem->setIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-display-color")));
// Advanced
widget = setupPage(mAdvancedConfigPage);
mRenderingIntentGroup = new InvisibleButtonGroup(widget);
mRenderingIntentGroup->setObjectName(QLatin1String("kcfg_RenderingIntent"));
mRenderingIntentGroup->setObjectName(QStringLiteral("kcfg_RenderingIntent"));
mRenderingIntentGroup->addButton(mAdvancedConfigPage.relativeRenderingIntentRadioButton, int(RenderingIntent::Relative));
mRenderingIntentGroup->addButton(mAdvancedConfigPage.perceptualRenderingIntentRadioButton, int(RenderingIntent::Perceptual));
pageItem = addPage(widget, i18n("Advanced"));
pageItem->setIcon(QIcon::fromTheme("preferences-other"));
pageItem->setIcon(QIcon::fromTheme(QStringLiteral("preferences-other")));
mAdvancedConfigPage.cacheHelpLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
mAdvancedConfigPage.perceptualHelpLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
mAdvancedConfigPage.relativeHelpLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
......@@ -121,9 +121,9 @@ ConfigDialog::ConfigDialog(QWidget* parent)
void ConfigDialog::updateViewBackgroundFrame()
{
QColor color = QColor::fromHsv(0, 0, mGeneralConfigPage.kcfg_ViewBackgroundValue->value());
QString css =
QString(
const QColor color = QColor::fromHsv(0, 0, mGeneralConfigPage.kcfg_ViewBackgroundValue->value());
const QString css =
QStringLiteral(
"background-color: %1;"
"border-radius: 5px;"
"border: 1px solid %1;")
......
......@@ -198,17 +198,17 @@ void showMenuForDroppedUrls(QWidget* parent, const QList<QUrl>& urlList, const Q
QMenu menu(parent);
QAction* moveAction = menu.addAction(
QIcon::fromTheme("go-jump"),
QIcon::fromTheme(QStringLiteral("go-jump")),
i18n("Move Here"));
QAction* copyAction = menu.addAction(
QIcon::fromTheme("edit-copy"),
QIcon::fromTheme(QStringLiteral("edit-copy")),
i18n("Copy Here"));
QAction* linkAction = menu.addAction(
QIcon::fromTheme("edit-link"),
QIcon::fromTheme(QStringLiteral("edit-link")),
i18n("Link Here"));
menu.addSeparator();
menu.addAction(
QIcon::fromTheme("process-stop"),
QIcon::fromTheme(QStringLiteral("process-stop")),
i18n("Cancel"));
QAction* action = menu.exec(QCursor::pos());
......
......@@ -143,55 +143,55 @@ FileOpsContextManagerItem::FileOpsContextManagerItem(ContextManager* manager, QL
mCopyAction = edit->addAction(KStandardAction::Copy, this, SLOT(copy()));
mPasteAction = edit->addAction(KStandardAction::Paste, this, SLOT(paste()));
mCopyToAction = file->addAction("file_copy_to", this, SLOT(copyTo()));
mCopyToAction = file->addAction(QStringLiteral("file_copy_to"), this, SLOT(copyTo()));
mCopyToAction->setText(i18nc("Verb", "Copy To..."));
mCopyToAction->setIcon(QIcon::fromTheme("edit-copy"));
mCopyToAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy")));
actionCollection->setDefaultShortcut(mCopyToAction, Qt::Key_F7);
mMoveToAction = file->addAction("file_move_to", this, SLOT(moveTo()));
mMoveToAction = file->addAction(QStringLiteral("file_move_to"), this, SLOT(moveTo()));
mMoveToAction->setText(i18nc("Verb", "Move To..."));
mMoveToAction->setIcon(QIcon::fromTheme("go-jump"));
mMoveToAction->setIcon(QIcon::fromTheme(QStringLiteral("go-jump")));
actionCollection->setDefaultShortcut(mMoveToAction, Qt::Key_F8);
mLinkToAction = file->addAction("file_link_to", this, SLOT(linkTo()));
mLinkToAction = file->addAction(QStringLiteral("file_link_to"), this, SLOT(linkTo()));
mLinkToAction->setText(i18nc("Verb: create link to the file where user wants", "Link To..."));
mLinkToAction->setIcon(QIcon::fromTheme("link"));
mLinkToAction->setIcon(QIcon::fromTheme(QStringLiteral("link")));
actionCollection->setDefaultShortcut(mLinkToAction, Qt::Key_F9);
mRenameAction = file->addAction("file_rename", this, SLOT(rename()));
mRenameAction = file->addAction(QStringLiteral("file_rename"), this, SLOT(rename()));
mRenameAction->setText(i18nc("Verb", "Rename..."));
mRenameAction->setIcon(QIcon::fromTheme("edit-rename"));
mRenameAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename")));
actionCollection->setDefaultShortcut(mRenameAction, Qt::Key_F2);
mTrashAction = file->addAction("file_trash", this, SLOT(trash()));
mTrashAction = file->addAction(QStringLiteral("file_trash"), this, SLOT(trash()));
mTrashAction->setText(i18nc("Verb", "Trash"));
mTrashAction->setIcon(QIcon::fromTheme("user-trash"));
mTrashAction->setIcon(QIcon::fromTheme(QStringLiteral("user-trash")));
actionCollection->setDefaultShortcut(mTrashAction, Qt::Key_Delete);
mDelAction = file->addAction(KStandardAction::DeleteFile, this, SLOT(del()));
mRestoreAction = file->addAction("file_restore", this, SLOT(restore()));
mRestoreAction = file->addAction(QStringLiteral("file_restore"), this, SLOT(restore()));
mRestoreAction->setText(i18n("Restore"));
mRestoreAction->setIcon(QIcon::fromTheme("restoration"));
mRestoreAction->setIcon(QIcon::fromTheme(QStringLiteral("restoration")));
mShowPropertiesAction = file->addAction("file_show_properties", this, SLOT(showProperties()));
mShowPropertiesAction = file->addAction(QStringLiteral("file_show_properties"), this, SLOT(showProperties()));
mShowPropertiesAction->setText(i18n("Properties"));
mShowPropertiesAction->setIcon(QIcon::fromTheme("document-properties"));
mShowPropertiesAction->setIcon(QIcon::fromTheme(QStringLiteral("document-properties")));
mCreateFolderAction = file->addAction("file_create_folder", this, SLOT(createFolder()));
mCreateFolderAction = file->addAction(QStringLiteral("file_create_folder"), this, SLOT(createFolder()));
mCreateFolderAction->setText(i18n("Create Folder..."));
mCreateFolderAction->setIcon(QIcon::fromTheme("folder-new"));
mCreateFolderAction->setIcon(QIcon::fromTheme(QStringLiteral("folder-new")));
mOpenWithAction = file->addAction("file_open_with");
mOpenWithAction = file->addAction(QStringLiteral("file_open_with"));
mOpenWithAction->setText(i18n("Open With"));
QMenu* menu = new QMenu;
mOpenWithAction->setMenu(menu);
connect(menu, &QMenu::aboutToShow, this, &FileOpsContextManagerItem::populateOpenMenu);
connect(menu, &QMenu::triggered, this, &FileOpsContextManagerItem::openWith);
mOpenContainingFolderAction = file->addAction("file_open_containing_folder", this, SLOT(openContainingFolder()));
mOpenContainingFolderAction = file->addAction(QStringLiteral("file_open_containing_folder"), this, SLOT(openContainingFolder()));
mOpenContainingFolderAction->setText(i18n("Open Containing Folder"));
mOpenContainingFolderAction->setIcon(QIcon::fromTheme("document-open-folder"));
mOpenContainingFolderAction->setIcon(QIcon::fromTheme(QStringLiteral("document-open-folder")));
mRegularFileActionList
<< mRenameAction
......
......@@ -250,7 +250,7 @@ public:
void setFilterWidget(QWidget* widget)
{
QToolButton* closeButton = new QToolButton;
closeButton->setIcon(QIcon::fromTheme("window-close"));
closeButton->setIcon(QIcon::fromTheme(QStringLiteral("window-close")));
closeButton->setAutoRaise(true);
closeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
int size = IconSize(KIconLoader::Small);
......@@ -345,7 +345,7 @@ void FilterController::slotFilterWidgetClosed()
}
void FilterController::addAction(const QString& text, const char* slot, const QKeySequence shortcut)
void FilterController::addAction(const QString& text, const char* slot, const QKeySequence &shortcut)
{
QAction* action = new QAction(text, q);
action->setShortcut(shortcut);
......
......@@ -353,7 +353,7 @@ private Q_SLOTS:
void slotFilterWidgetClosed();
private:
void addAction(const QString& text, const char* slot, const QKeySequence shortcut);
void addAction(const QString& text, const char* slot, const QKeySequence &shortcut);
void addFilter(QWidget* widget);
FilterController* q;
......
......@@ -114,7 +114,7 @@ void FullScreenContent::init(KActionCollection* actionCollection, QWidget* autoH
{
mSlideShow = slideShow;
mActionCollection = actionCollection;
connect(actionCollection->action("view"), &QAction::toggled,
connect(actionCollection->action(QStringLiteral("view")), &QAction::toggled,
this, &FullScreenContent::slotViewModeActionToggled);
// mAutoHideContainer
......@@ -196,7 +196,7 @@ void FullScreenContent::init(KActionCollection* actionCollection, QWidget* autoH
// Right bar
mRightToolBar = new FullScreenToolBar(mContent);
mRightToolBar->addAction(mActionCollection->action("leave_fullscreen"), Qt::ToolButtonFollowStyle);
mRightToolBar->addAction(mActionCollection->action(QStringLiteral("leave_fullscreen")), Qt::ToolButtonFollowStyle);
mRightToolBar->addAction(mOptionsAction, Qt::ToolButtonFollowStyle);
mRightToolBar->addStretch();
mRightToolBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
......@@ -407,7 +407,7 @@ void FullScreenContent::createOptionsAction()
// if the mode is changed to thumbnail-mode, we want the option button
// to remain visible
mOptionsAction = new QAction(this);
mOptionsAction->setIcon(QIcon::fromTheme("configure"));
mOptionsAction->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
mOptionsAction->setText(i18n("Configure"));
mOptionsAction->setToolTip(i18nc("@info:tooltip", "Configure full screen mode"));
QObject::connect(mOptionsAction, &QAction::triggered, this, &FullScreenContent::showOptionsMenu);
......
......@@ -83,25 +83,25 @@ struct ImageOpsContextManagerItem::Private
KActionCollection* actionCollection = mMainWindow->actionCollection();
KActionCategory* edit = new KActionCategory(i18nc("@title actions category - means actions changing image", "Edit"), actionCollection);
mRotateLeftAction = edit->addAction("rotate_left", q, SLOT(rotateLeft()));
mRotateLeftAction = edit->addAction(QStringLiteral("rotate_left"), q, SLOT(rotateLeft()));
mRotateLeftAction->setText(i18n("Rotate Left"));
mRotateLeftAction->setToolTip(i18nc("@info:tooltip", "Rotate image to the left"));
mRotateLeftAction->setIcon(QIcon::fromTheme("object-rotate-left"));
mRotateLeftAction->setIcon(QIcon::fromTheme(QStringLiteral("object-rotate-left")));
actionCollection->setDefaultShortcut(mRotateLeftAction, Qt::CTRL + Qt::SHIFT + Qt::Key_R);
mRotateRightAction = edit->addAction("rotate_right", q, SLOT(rotateRight()));
mRotateRightAction = edit->addAction(QStringLiteral("rotate_right"), q, SLOT(rotateRight()));
mRotateRightAction->setText(i18n("Rotate Right"));
mRotateRightAction->setToolTip(i18nc("@info:tooltip", "Rotate image to the right"));
mRotateRightAction->setIcon(QIcon::fromTheme("object-rotate-right"));
mRotateRightAction->setIcon(QIcon::fromTheme(QStringLiteral("object-rotate-right")));
actionCollection->setDefaultShortcut(mRotateRightAction, Qt::CTRL + Qt::Key_R);
mMirrorAction = edit->addAction("mirror", q, SLOT(mirror()));
mMirrorAction = edit->addAction(QStringLiteral("mirror"), q, SLOT(mirror()));
mMirrorAction->setText(i18n("Mirror"));
mMirrorAction->setIcon(QIcon::fromTheme("object-flip-horizontal"));
mMirrorAction->setIcon(QIcon::fromTheme(QStringLiteral("object-flip-horizontal")));
mFlipAction = edit->addAction("flip", q, SLOT(flip()));
mFlipAction = edit->addAction(QStringLiteral("flip"), q, SLOT(flip()));
mFlipAction->setText(i18n("Flip"));
mFlipAction->setIcon(QIcon::fromTheme("object-flip-vertical"));
mFlipAction->setIcon(QIcon::fromTheme(QStringLiteral("object-flip-vertical")));
mResizeAction = edit->addAction("resize", q, SLOT(resizeImage()));
mResizeAction->setText(i18n("Resize"));
......
......@@ -115,14 +115,14 @@ public:
return mImages;
}
QUrl uploadRoot() {
return QUrl("/");
return QUrl(QStringLiteral("/"));
}
QUrl uploadPath() {
return mDirURL;
}
QString uploadRootName() override
{
return "/";
return QStringLiteral("/");
}
bool isDirectory() override {
return true;
......
......@@ -444,7 +444,7 @@ ViewMainPage::ViewMainPage(QWidget* parent, SlideShow* slideShow, KActionCollect
d->mToggleThumbnailBarAction = view->add<KToggleAction>(QStringLiteral("toggle_thumbnailbar"));
d->mToggleThumbnailBarAction->setText(i18n("Thumbnail Bar"));
d->mToggleThumbnailBarAction->setIcon(QIcon::fromTheme("folder-image"));
d->mToggleThumbnailBarAction->setIcon(QIcon::fromTheme(QStringLiteral("folder-image")));
actionCollection->setDefaultShortcut(d->mToggleThumbnailBarAction, Qt::CTRL + Qt::Key_B);
connect(d->mToggleThumbnailBarAction, &KToggleAction::triggered, this, &ViewMainPage::setThumbnailBarVisibility);
d->mToggleThumbnailBarButton->setDefaultAction(d->mToggleThumbnailBarAction);
......
......@@ -87,7 +87,7 @@ struct DialogPagePrivate : public Ui_DialogPage
dirDetails->setVisible(true);
} else dirDetails->setVisible(false);
mErrorMessageWidget->setText(message.join("<br/>"));
mErrorMessageWidget->setText(message.join(QStringLiteral("<br/>")));
mErrorMessageWidget->animatedShow();
}
......
......@@ -58,12 +58,12 @@ QString FileNameFormater::format(const QUrl& url, const QDateTime& dateTime)
// Keep in sync with helpMap()
Dict dict;
dict["date"] = dateTime.toString("yyyy-MM-dd");
dict["time"] = dateTime.toString("HH-mm-ss");
dict["ext"] = info.suffix();
dict["ext.lower"] = info.suffix().toLower();
dict["name"] = info.completeBaseName();
dict["name.lower"] = info.completeBaseName().toLower();
dict[QStringLiteral("date")] = dateTime.toString(QStringLiteral("yyyy-MM-dd"));
dict[QStringLiteral("time")] = dateTime.toString(QStringLiteral("HH-mm-ss"));
dict[QStringLiteral("ext")] = info.suffix();
dict[QStringLiteral("ext.lower")] = info.suffix().toLower();
dict[QStringLiteral("name")] = info.completeBaseName();
dict[QStringLiteral("name.lower")] = info.completeBaseName().toLower();
QString name;
int length = d->mFormat.length();
......@@ -101,12 +101,12 @@ FileNameFormater::HelpMap FileNameFormater::helpMap()
// Keep in sync with dict in format()
static HelpMap map;
if (map.isEmpty()) {
map["date"] = i18n("Shooting date");
map["time"] = i18n("Shooting time");
map["ext"] = i18n("Original extension");
map["ext.lower"] = i18n("Original extension, in lower case");
map["name"] = i18n("Original filename");
map["name.lower"] = i18n("Original filename, in lower case");
map[QStringLiteral("date")] = i18n("Shooting date");
map[QStringLiteral("time")] = i18n("Shooting time");
map[QStringLiteral("ext")] = i18n("Original extension");
map[QStringLiteral("ext.lower")] = i18n("Original extension, in lower case");
map[QStringLiteral("name")] = i18n("Original filename");
map[QStringLiteral("name.lower")] = i18n("Original filename, in lower case");
}
return map;
}
......
......@@ -129,7 +129,7 @@ public:
}
int answer = KMessageBox::questionYesNo(mCentralWidget,
"<qt>" + message.join("<br/>") + "</qt>",
QStringLiteral("<qt>") + message.join(QStringLiteral("<br/>")) + QStringLiteral("</qt>"),
i18nc("@title:window", "Import Finished"),
KGuiItem(i18n("Keep")),
KStandardGuiItem::del()
......
......@@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
namespace Gwenview
{
static const QString PREVIEW_FILENAME = "PICT0012.JPG";
static const QString PREVIEW_FILENAME = QStringLiteral("PICT0012.JPG");
static const QDateTime PREVIEW_DATETIME = QDateTime(QDate(2009, 10, 25), QTime(17, 51, 18));
struct ImporterConfigDialogPrivate : public Ui_ImporterConfigDialog
......@@ -64,7 +64,7 @@ struct ImporterConfigDialogPrivate : public Ui_ImporterConfigDialog
};
ImporterConfigDialog::ImporterConfigDialog(QWidget* parent)
: KConfigDialog(parent, "Importer Settings", ImporterConfig::self())
: KConfigDialog(parent, QStringLiteral("Importer Settings"), ImporterConfig::self())
, d(new ImporterConfigDialogPrivate)
{
d->q = this;
......
......@@ -67,8 +67,9 @@ QString protocolForMimeType(const QString& mimeType)
if (protocol.isEmpty()) {
// No protocol, try with mimeType parents. This is useful for .cbz for
// example
QMimeType mime = QMimeDatabase().mimeTypeForName(mimeType);
for(const QString & parentMimeType : mime.allAncestors()) {
const QMimeType mime = QMimeDatabase().mimeTypeForName(mimeType);
const QStringList allAncestors = mime.allAncestors();
for(const QString & parentMimeType : allAncestors) {
protocol = KProtocolManager::protocolForArchiveMimetype(parentMimeType);
if (!protocol.isEmpty()) {
break;
......
......@@ -131,7 +131,7 @@ ContextManager::ContextManager(SortedDirModel* dirModel, QObject* parent)
d->mSelectedFileItemListNeedsUpdate = false;
connect(DocumentFactory::instance(), &DocumentFactory::readyForDirListerStart, [this](const QUrl &urlReady) {
connect(DocumentFactory::instance(), &DocumentFactory::readyForDirListerStart, this, [this](const QUrl &urlReady) {
setCurrentDirUrl(urlReady.adjusted(QUrl::RemoveFilename));
});
}
......
......@@ -38,6 +38,7 @@ namespace Gwenview
struct CropImageOperationPrivate;
class GWENVIEWLIB_EXPORT CropImageOperation : public AbstractImageOperation
{
Q_OBJECT
public:
CropImageOperation(const QRect&);
~CropImageOperation() override;
......
......@@ -543,7 +543,7 @@ void CropWidget::applyRatioConstraint()
void CropWidget::slotAdvancedCheckBoxToggled(bool checked)
{
for (auto w : d->mAdvancedWidgets) {
for (auto w : qAsConst(d->mAdvancedWidgets)) {
w->setVisible(checked);
}
d->mPreserveAspectRatioWidget->setVisible(!checked);
......
......@@ -94,7 +94,7 @@ HudButton* HudButtonBox::addAction(QAction* action, const QString& overrideText)
{
QString text = overrideText.isEmpty() ? action->text() : overrideText;
HudButton* button = addButton(text);
connect(button, SIGNAL(clicked()), action, SLOT(trigger()));
connect(button, &HudButton::clicked, action, &QAction::trigger);
return button;
}
......
......@@ -324,7 +324,7 @@ int JpegContent::dotsPerMeter(const QString& keyName) const
return 0;
}
int res = it->toLong();
QString keyVal = QLatin1String("Exif.Image.") + keyName;
QString keyVal = QStringLiteral("Exif.Image.") + keyName;
Exiv2::ExifKey keyResolution(keyVal.toLocal8Bit().data());
it = d->mExifData.findKey(keyResolution);
if (it == d->mExifData.end()) {
......
......@@ -166,7 +166,7 @@ Kind urlKind(const QUrl &url)
return mimeTypeKind(urlMimeType(url));
}
QMimeData* selectionMimeData(const KFileItemList& selectedFiles, const MimeTarget& mimeTarget)
QMimeData* selectionMimeData(const KFileItemList& selectedFiles, MimeTarget mimeTarget)
{
QMimeData* mimeData = new QMimeData;
......
......@@ -69,7 +69,7 @@ enum MimeTarget {
* is edited/unsaved) if there is a single image selected.
* Otherwise, returns a list of URLs for all selected images.
*/
GWENVIEWLIB_EXPORT QMimeData* selectionMimeData(const KFileItemList& selectedFiles, const MimeTarget& mimeTarget);
GWENVIEWLIB_EXPORT QMimeData* selectionMimeData(const KFileItemList& selectedFiles, MimeTarget mimeTarget);
} // namespace MimeTypeUtils
......
......@@ -108,7 +108,7 @@ void MprisMediaPlayer2::setFullscreen(bool isFullscreen)
void MprisMediaPlayer2::onFullScreenActionToggled(bool checked)
{
signalPropertyChange("Fullscreen", checked);
signalPropertyChange(QStringLiteral("Fullscreen"), checked);
}
}
......@@ -279,7 +279,7 @@ void MprisMediaPlayer2Player::onMetaInfoUpdated()
// To allow some bidrectional mapping, convert the url to base64 to encode it for
// matching the D-Bus object path spec
const QString slideId = QString::fromLatin1(url.toString().toUtf8().toBase64(QByteArray::OmitTrailingEquals));
const QDBusObjectPath trackId(QLatin1String("/org/kde/gwenview/imagelist/") + slideId);
const QDBusObjectPath trackId(QStringLiteral("/org/kde/gwenview/imagelist/") + slideId);
updatedMetaData.insert(QStringLiteral("mpris:trackid"),
QVariant::fromValue<QDBusObjectPath>(trackId));
......
......@@ -63,13 +63,13 @@ QList<QWidget*> TagItemDelegate::createItemWidgets(const QModelIndex &index) con
QToolButton* assignToAllButton = new QToolButton;
initButton(assignToAllButton);
assignToAllButton->setIcon(QIcon::fromTheme("fill-color")); /* FIXME: Probably not the appropriate icon */
assignToAllButton->setIcon(QIcon::fromTheme(QStringLiteral("fill-color"))); /* FIXME: Probably not the appropriate icon */
assignToAllButton->setToolTip(i18nc("@info:tooltip", "Assign this tag to all selected images"));
connect(assignToAllButton, &QToolButton::clicked, this, &TagItemDelegate::slotAssignToAllButtonClicked);
QToolButton* removeButton = new QToolButton;
initButton(removeButton);
removeButton->setIcon(QIcon::fromTheme("list-remove"));
removeButton->setIcon(QIcon::fromTheme(QStringLiteral("list-remove")));
connect(removeButton, &QToolButton::clicked, this, &TagItemDelegate::slotRemoveButtonClicked);
#undef initButton
......
......@@ -44,7 +44,7 @@ static QStandardItem* createItem(const SemanticInfoTag& tag, const QString& labe
item->setData(tag, TagModel::TagRole);
item->setData(label.toLower(), TagModel::SortRole);
item->setData(status, TagModel::AssignmentStatusRole);
item->setData(QIcon::fromTheme("mail-tagged"), Qt::DecorationRole);
item->setData(QIcon::fromTheme(QStringLiteral("mail-tagged")), Qt::DecorationRole);
return item;
}
......
......@@ -148,7 +148,7 @@ struct TagWidgetPrivate
mComboBox->setModel(mTagCompleterModel);
mAddButton = new QPushButton;
mAddButton->setIcon(QIcon::fromTheme("list-add"));
mAddButton->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
mAddButton->setToolTip(i18n("Add tag"));
mAddButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QObject::connect(mAddButton, SIGNAL(clicked()),
......
......@@ -113,7 +113,7 @@ QString ThumbnailProvider::thumbnailBaseDir(ThumbnailGroup::Enum group)
break;
case ThumbnailGroup::Large2x:
default:
dir += "x-gwenview/"; // Should never be hit, but just in case
dir += QLatin1String("x-gwenview/"); // Should never be hit, but just in case
}
return dir;
}
......
......@@ -55,7 +55,7 @@ static Exiv2::ExifData::const_iterator findDateTimeKey(const Exiv2::ExifData& ex
<< Exiv2::ExifKey("Exif.Image.DateTime");
Exiv2::ExifData::const_iterator it, end = exifData.end();
for (const Exiv2::ExifKey& key : lst) {
for (const Exiv2::ExifKey& key : qAsConst(lst)) {
it = exifData.findKey(key);
if (it != end) {
return it;
......
......@@ -45,7 +45,7 @@ GVBrowserExtension::GVBrowserExtension(KParts::ReadOnlyPart* part)
{
d->mPart = part;
emit enableAction("print", true);
const QString iconPath = KIconLoader::global()->iconPath("image-x-generic", KIconLoader::SizeSmall);
const QString iconPath = KIconLoader::global()->iconPath(QStringLiteral("image-x-generic"), KIconLoader::SizeSmall);
emit setIconUrl(QUrl::fromLocalFile(iconPath));
}
......
......@@ -79,7 +79,7 @@ GVPart::GVPart(QWidget* parentWidget, QObject* parent, const QVariantList& /*arg
QAction * action = new QAction(actionCollection());
action->setText(i18nc("@action", "Properties"));
connect(action, &QAction::triggered, this, &GVPart::showProperties);
actionCollection()->addAction("file_show_properties", action);
actionCollection()->addAction(QStringLiteral("file_show_properties"), action);
KStandardAction::saveAs(this, SLOT(saveAs()), actionCollection());
......
......@@ -51,7 +51,7 @@ inline QUrl urlForTestFile(const QString& name)
inline QString pathForTestOutputFile(const QString& name)
{
return QStringLiteral("%1/%2").arg(QDir::currentPath()).arg(name);
return QStringLiteral("%1/%2").arg(QDir::currentPath(), name);
}
inline QUrl urlForTestOutputFile(const QString& name)
......
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