Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Gwenview
Commits
42223038
Commit
42223038
authored
Oct 14, 2022
by
Laurent Montel
Browse files
Fix some clazy warning
parent
0f563654
Pipeline
#247571
passed with stage
in 1 minute and 48 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/browsemainpage.cpp
View file @
42223038
...
...
@@ -170,7 +170,7 @@ struct BrowseMainPagePrivate : public Ui_BrowseMainPage {
#endif
QObject
::
connect
(
mSortAction
,
SIGNAL
(
triggered
(
QAction
*
)),
q
,
SLOT
(
updateSortOrder
()));
mSortDescendingAction
=
view
->
add
<
KToggleAction
>
(
"sort_desc"
);
mSortDescendingAction
=
view
->
add
<
KToggleAction
>
(
QStringLiteral
(
"sort_desc"
)
)
;
mSortDescendingAction
->
setText
(
i18nc
(
"@action:inmenu Sort"
,
"Descending"
));
QObject
::
connect
(
mSortDescendingAction
,
SIGNAL
(
toggled
(
bool
)),
q
,
SLOT
(
updateSortOrder
()));
...
...
@@ -182,7 +182,7 @@ struct BrowseMainPagePrivate : public Ui_BrowseMainPage {
mThumbnailDetailsActionGroup
=
new
QActionGroup
(
q
);
mThumbnailDetailsActionGroup
->
setExclusive
(
false
);
auto
thumbnailDetailsAction
=
view
->
add
<
KActionMenu
>
(
"thumbnail_details"
);
auto
thumbnailDetailsAction
=
view
->
add
<
KActionMenu
>
(
QStringLiteral
(
"thumbnail_details"
)
)
;
thumbnailDetailsAction
->
setText
(
i18nc
(
"@action:inmenu"
,
"Thumbnail Details"
));
thumbnailDetailsAction
->
addAction
(
thumbnailDetailAction
(
i18nc
(
"@action:inmenu"
,
"Filename"
),
PreviewItemDelegate
::
FileNameDetail
));
thumbnailDetailsAction
->
addAction
(
thumbnailDetailAction
(
i18nc
(
"@action:inmenu"
,
"Date"
),
PreviewItemDelegate
::
DateDetail
));
...
...
app/configdialog.cpp
View file @
42223038
...
...
@@ -79,7 +79,7 @@ ConfigDialog::ConfigDialog(QWidget *parent)
mGeneralConfigPage
.
lossyImageFormatHelpLabel
->
setFont
(
QFontDatabase
::
systemFont
(
QFontDatabase
::
SmallestReadableFont
));
mGeneralConfigPage
.
kcfg_AutoplayVideos
->
setEnabled
(
mGeneralConfigPage
.
kcfg_ListVideos
->
isChecked
());
connect
(
mGeneralConfigPage
.
kcfg_ListVideos
,
&
QCheckBox
::
stateChanged
,
[
=
](
const
int
&
state
)
{
connect
(
mGeneralConfigPage
.
kcfg_ListVideos
,
&
QCheckBox
::
stateChanged
,
this
,
[
=
](
int
state
)
{
mGeneralConfigPage
.
kcfg_AutoplayVideos
->
setEnabled
(
state
==
Qt
::
Checked
);
});
...
...
app/fileopscontextmanageritem.cpp
View file @
42223038
...
...
@@ -224,7 +224,7 @@ void FileOpsContextManagerItem::updateActions()
const
bool
urlIsValid
=
contextManager
()
->
currentUrl
().
isValid
();
const
bool
dirUrlIsValid
=
contextManager
()
->
currentDirUrl
().
isValid
();
mInTrash
=
contextManager
()
->
currentDirUrl
().
scheme
()
==
"trash"
;
mInTrash
=
contextManager
()
->
currentDirUrl
().
scheme
()
==
QLatin1String
(
"trash"
)
;
mCutAction
->
setEnabled
(
selectionNotEmpty
);
mCopyAction
->
setEnabled
(
selectionNotEmpty
);
...
...
@@ -241,9 +241,9 @@ void FileOpsContextManagerItem::updateActions()
mCreateFolderAction
->
setEnabled
(
dirUrlIsValid
);
mShowPropertiesAction
->
setEnabled
(
dirUrlIsValid
||
urlIsValid
);
mXMLGUIClient
->
unplugActionList
(
"file_action_list"
);
mXMLGUIClient
->
unplugActionList
(
QStringLiteral
(
"file_action_list"
)
)
;
QList
<
QAction
*>
&
list
=
mInTrash
?
mTrashFileActionList
:
mRegularFileActionList
;
mXMLGUIClient
->
plugActionList
(
"file_action_list"
,
list
);
mXMLGUIClient
->
plugActionList
(
QStringLiteral
(
"file_action_list"
)
,
list
);
updateSideBarContent
();
}
...
...
app/mainwindow.cpp
View file @
42223038
...
...
@@ -384,7 +384,7 @@ struct MainWindow::Private {
file
->
addAction
(
KStandardAction
::
PrintPreview
,
q
,
SLOT
(
printPreview
()));
file
->
addAction
(
KStandardAction
::
Quit
,
qApp
,
SLOT
(
closeAllWindows
()));
QAction
*
action
=
file
->
addAction
(
"reload"
,
q
,
SLOT
(
reload
()));
QAction
*
action
=
file
->
addAction
(
QStringLiteral
(
"reload"
)
,
q
,
SLOT
(
reload
()));
action
->
setText
(
i18nc
(
"@action reload the currently viewed image"
,
"Reload"
));
action
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"view-refresh"
)));
actionCollection
->
setDefaultShortcuts
(
action
,
KStandardShortcut
::
reload
());
...
...
@@ -394,7 +394,7 @@ struct MainWindow::Private {
actionCollection
->
setDefaultShortcut
(
replaceLocationAction
,
Qt
::
CTRL
|
Qt
::
Key_L
);
connect
(
replaceLocationAction
,
&
QAction
::
triggered
,
q
,
&
MainWindow
::
replaceLocation
);
mBrowseAction
=
view
->
addAction
(
"browse"
);
mBrowseAction
=
view
->
addAction
(
QStringLiteral
(
"browse"
)
)
;
mBrowseAction
->
setText
(
i18nc
(
"@action:intoolbar Switch to file list"
,
"Browse"
));
mBrowseAction
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"Browse folders for images"
));
mBrowseAction
->
setCheckable
(
true
);
...
...
@@ -402,7 +402,7 @@ struct MainWindow::Private {
actionCollection
->
setDefaultShortcut
(
mBrowseAction
,
Qt
::
Key_Escape
);
connect
(
mViewMainPage
,
&
ViewMainPage
::
goToBrowseModeRequested
,
mBrowseAction
,
&
QAction
::
trigger
);
mViewAction
=
view
->
addAction
(
"view"
);
mViewAction
=
view
->
addAction
(
QStringLiteral
(
"view"
)
)
;
mViewAction
->
setText
(
i18nc
(
"@action:intoolbar Switch to image view"
,
"View"
));
mViewAction
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"View selected images"
));
mViewAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"view-preview"
)));
...
...
@@ -432,21 +432,21 @@ struct MainWindow::Private {
mGoToPreviousAction
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"Go to previous image"
));
installDisabledActionShortcutMonitor
(
mGoToPreviousAction
,
SLOT
(
showFirstDocumentReached
()));
mGoToNextAction
=
view
->
addAction
(
"go_next"
,
q
,
SLOT
(
goToNext
()));
mGoToNextAction
=
view
->
addAction
(
QStringLiteral
(
"go_next"
)
,
q
,
SLOT
(
goToNext
()));
mGoToNextAction
->
setPriority
(
QAction
::
LowPriority
);
mGoToNextAction
->
setIcon
(
QIcon
::
fromTheme
(
QGuiApplication
::
layoutDirection
()
==
Qt
::
LeftToRight
?
"go-next"
:
"go-next-symbolic-rtl"
));
mGoToNextAction
->
setText
(
i18nc
(
"@action Go to next image"
,
"Next"
));
mGoToNextAction
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"Go to next image"
));
installDisabledActionShortcutMonitor
(
mGoToNextAction
,
SLOT
(
showLastDocumentReached
()));
mGoToFirstAction
=
view
->
addAction
(
"go_first"
,
q
,
SLOT
(
goToFirst
()));
mGoToFirstAction
=
view
->
addAction
(
QStringLiteral
(
"go_first"
)
,
q
,
SLOT
(
goToFirst
()));
mGoToFirstAction
->
setPriority
(
QAction
::
LowPriority
);
mGoToFirstAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"go-first-view"
)));
mGoToFirstAction
->
setText
(
i18nc
(
"@action Go to first image"
,
"First"
));
mGoToFirstAction
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"Go to first image"
));
actionCollection
->
setDefaultShortcut
(
mGoToFirstAction
,
Qt
::
Key_Home
);
mGoToLastAction
=
view
->
addAction
(
"go_last"
,
q
,
SLOT
(
goToLast
()));
mGoToLastAction
=
view
->
addAction
(
QStringLiteral
(
"go_last"
)
,
q
,
SLOT
(
goToLast
()));
mGoToLastAction
->
setPriority
(
QAction
::
LowPriority
);
mGoToLastAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"go-last-view"
)));
mGoToLastAction
->
setText
(
i18nc
(
"@action Go to last image"
,
"Last"
));
...
...
@@ -464,7 +464,7 @@ struct MainWindow::Private {
action
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"Open the start page"
));
actionCollection
->
setDefaultShortcuts
(
action
,
KStandardShortcut
::
home
());
mToggleSideBarAction
=
view
->
add
<
KToggleAction
>
(
"toggle_sidebar"
);
mToggleSideBarAction
=
view
->
add
<
KToggleAction
>
(
QStringLiteral
(
"toggle_sidebar"
)
)
;
connect
(
mToggleSideBarAction
,
&
KToggleAction
::
triggered
,
q
,
&
MainWindow
::
toggleSideBar
);
mToggleSideBarAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"view-sidetree"
)));
actionCollection
->
setDefaultShortcut
(
mToggleSideBarAction
,
Qt
::
Key_F4
);
...
...
@@ -472,7 +472,7 @@ struct MainWindow::Private {
connect
(
mBrowseMainPage
->
toggleSideBarButton
(),
&
QAbstractButton
::
clicked
,
mToggleSideBarAction
,
&
QAction
::
trigger
);
connect
(
mViewMainPage
->
toggleSideBarButton
(),
&
QAbstractButton
::
clicked
,
mToggleSideBarAction
,
&
QAction
::
trigger
);
mToggleOperationsSideBarAction
=
view
->
add
<
KToggleAction
>
(
"toggle_operations_sidebar"
);
mToggleOperationsSideBarAction
=
view
->
add
<
KToggleAction
>
(
QStringLiteral
(
"toggle_operations_sidebar"
)
)
;
mToggleOperationsSideBarAction
->
setText
(
i18nc
(
"@action opens crop, rename, etc."
,
"Show Editing Tools"
));
mToggleOperationsSideBarAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-image"
),
QIcon
::
fromTheme
(
QStringLiteral
(
"document-edit"
))));
connect
(
mToggleOperationsSideBarAction
,
&
KToggleAction
::
triggered
,
q
,
&
MainWindow
::
toggleOperationsSideBar
);
...
...
@@ -480,7 +480,7 @@ struct MainWindow::Private {
mToggleOperationsSideBarAction
->
setChecked
(
mSideBar
->
isVisible
()
&&
mSideBar
->
currentPage
()
==
QLatin1String
(
"operations"
));
});
mToggleSlideShowAction
=
view
->
addAction
(
"toggle_slideshow"
,
q
,
SLOT
(
toggleSlideShow
()));
mToggleSlideShowAction
=
view
->
addAction
(
QStringLiteral
(
"toggle_slideshow"
)
,
q
,
SLOT
(
toggleSlideShow
()));
q
->
updateSlideShowAction
();
connect
(
mSlideShow
,
&
SlideShow
::
stateChanged
,
q
,
&
MainWindow
::
updateSlideShowAction
);
...
...
@@ -624,13 +624,13 @@ struct MainWindow::Private {
// Fill sidebar
SideBarPage
*
page
;
page
=
new
SideBarPage
(
QIcon
::
fromTheme
(
QStringLiteral
(
"folder"
)),
i18n
(
"Folders"
));
page
->
setObjectName
(
Q
Latin1
String
(
"folders"
));
page
->
setObjectName
(
QString
Literal
(
"folders"
));
page
->
addWidget
(
folderViewItem
->
widget
());
page
->
layout
()
->
setContentsMargins
(
0
,
0
,
0
,
0
);
mSideBar
->
addPage
(
page
);
page
=
new
SideBarPage
(
QIcon
::
fromTheme
(
QStringLiteral
(
"documentinfo"
)),
i18n
(
"Information"
));
page
->
setObjectName
(
Q
Latin1
String
(
"information"
));
page
->
setObjectName
(
QString
Literal
(
"information"
));
page
->
addWidget
(
infoItem
->
widget
());
#ifndef GWENVIEW_SEMANTICINFO_BACKEND_NONE
if
(
semanticInfoItem
)
{
...
...
@@ -644,7 +644,7 @@ struct MainWindow::Private {
mSideBar
->
addPage
(
page
);
page
=
new
SideBarPage
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-edit"
)),
i18n
(
"Operations"
));
page
->
setObjectName
(
Q
Latin1
String
(
"operations"
));
page
->
setObjectName
(
QString
Literal
(
"operations"
));
page
->
addWidget
(
imageOpsItem
->
widget
());
auto
separator
=
new
QFrame
;
separator
->
setFrameShape
(
QFrame
::
HLine
);
...
...
@@ -771,10 +771,10 @@ struct MainWindow::Private {
}
KActionCollection
*
actionCollection
=
q
->
actionCollection
();
actionCollection
->
action
(
"file_save"
)
->
setEnabled
(
canSave
&&
isModified
);
actionCollection
->
action
(
"file_save_as"
)
->
setEnabled
(
canSave
);
actionCollection
->
action
(
"file_print"
)
->
setEnabled
(
isRasterImage
);
actionCollection
->
action
(
"file_print_preview"
)
->
setEnabled
(
isRasterImage
);
actionCollection
->
action
(
QStringLiteral
(
"file_save"
)
)
->
setEnabled
(
canSave
&&
isModified
);
actionCollection
->
action
(
QStringLiteral
(
"file_save_as"
)
)
->
setEnabled
(
canSave
);
actionCollection
->
action
(
QStringLiteral
(
"file_print"
)
)
->
setEnabled
(
isRasterImage
);
actionCollection
->
action
(
QStringLiteral
(
"file_print_preview"
)
)
->
setEnabled
(
isRasterImage
);
#ifdef KF5Purpose_FOUND
if
(
url
.
isEmpty
())
{
...
...
@@ -996,7 +996,7 @@ MainWindow::MainWindow()
new
Mpris2Service
(
d
->
mSlideShow
,
d
->
mContextManager
,
d
->
mToggleSlideShowAction
,
d
->
mFullScreenAction
,
d
->
mGoToPreviousAction
,
d
->
mGoToNextAction
,
this
);
#endif
auto
ratingMenu
=
static_cast
<
QMenu
*>
(
guiFactory
()
->
container
(
"rating"
,
this
));
auto
ratingMenu
=
static_cast
<
QMenu
*>
(
guiFactory
()
->
container
(
QStringLiteral
(
"rating"
)
,
this
));
ratingMenu
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"rating-unrated"
)));
#ifdef GWENVIEW_SEMANTICINFO_BACKEND_NONE
if
(
ratingMenu
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment