Skip to content
GitLab
Menu
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
30b580f1
Commit
30b580f1
authored
May 20, 2021
by
Laurent Montel
😁
Browse files
Fix some clazy warning
parent
c29de9b2
Changes
14
Hide whitespace changes
Inline
Side-by-side
app/browsemainpage.cpp
View file @
30b580f1
...
...
@@ -207,9 +207,9 @@ struct BrowseMainPagePrivate : public Ui_BrowseMainPage
#endif
KActionCategory
*
file
=
new
KActionCategory
(
i18nc
(
"@title actions category"
,
"File"
),
actionCollection
);
action
=
file
->
addAction
(
"add_folder_to_places"
,
q
,
SLOT
(
addFolderToPlaces
()));
action
=
file
->
addAction
(
QStringLiteral
(
"add_folder_to_places"
)
,
q
,
SLOT
(
addFolderToPlaces
()));
action
->
setText
(
i18nc
(
"@action:inmenu"
,
"Add Folder to Places"
));
action
->
setIcon
(
QIcon
::
fromTheme
(
"bookmark-new"
));
action
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"bookmark-new"
))
)
;
}
void
setupFilterController
()
...
...
@@ -227,12 +227,12 @@ struct BrowseMainPagePrivate : public Ui_BrowseMainPage
{
mFullScreenToolBar
->
setIconDimensions
(
KIconLoader
::
SizeMedium
);
mFullScreenToolBar
->
setToolButtonStyle
(
Qt
::
ToolButtonIconOnly
);
mFullScreenToolBar
->
addAction
(
mActionCollection
->
action
(
"browse"
));
mFullScreenToolBar
->
addAction
(
mActionCollection
->
action
(
"view"
));
mFullScreenToolBar
->
addAction
(
mActionCollection
->
action
(
QStringLiteral
(
"browse"
))
)
;
mFullScreenToolBar
->
addAction
(
mActionCollection
->
action
(
QStringLiteral
(
"view"
))
)
;
mFullScreenToolBar2
->
setIconDimensions
(
KIconLoader
::
SizeMedium
);
mFullScreenToolBar2
->
setToolButtonStyle
(
Qt
::
ToolButtonIconOnly
);
mFullScreenToolBar2
->
addAction
(
mActionCollection
->
action
(
"leave_fullscreen"
));
mFullScreenToolBar2
->
addAction
(
mActionCollection
->
action
(
QStringLiteral
(
"leave_fullscreen"
))
)
;
}
void
updateSelectedMediaItems
(
const
QItemSelection
&
selected
,
const
QItemSelection
&
deselected
)
...
...
@@ -404,7 +404,7 @@ bool BrowseMainPage::eventFilter(QObject* watched, QEvent* event)
if
(
window
()
->
isFullScreen
()
&&
event
->
type
()
==
QEvent
::
ShortcutOverride
)
{
const
QKeyEvent
*
keyEvent
=
static_cast
<
QKeyEvent
*>
(
event
);
if
(
keyEvent
->
key
()
==
Qt
::
Key_Escape
)
{
d
->
mActionCollection
->
action
(
"leave_fullscreen"
)
->
trigger
();
d
->
mActionCollection
->
action
(
QStringLiteral
(
"leave_fullscreen"
)
)
->
trigger
();
event
->
accept
();
}
}
...
...
app/imageopscontextmanageritem.cpp
View file @
30b580f1
...
...
@@ -105,17 +105,17 @@ struct ImageOpsContextManagerItem::Private
mResizeAction
=
edit
->
addAction
(
"resize"
,
q
,
SLOT
(
resizeImage
()));
mResizeAction
->
setText
(
i18n
(
"Resize"
));
mResizeAction
->
setIcon
(
QIcon
::
fromTheme
(
"transform-scale"
));
mResizeAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"transform-scale"
))
)
;
actionCollection
->
setDefaultShortcut
(
mResizeAction
,
Qt
::
SHIFT
|
Qt
::
Key_R
);
mCropAction
=
edit
->
addAction
(
"crop"
,
q
,
SLOT
(
crop
()));
mCropAction
->
setText
(
i18n
(
"Crop"
));
mCropAction
->
setIcon
(
QIcon
::
fromTheme
(
"transform-crop-and-resize"
));
mCropAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"transform-crop-and-resize"
))
)
;
actionCollection
->
setDefaultShortcut
(
mCropAction
,
Qt
::
SHIFT
|
Qt
::
Key_C
);
mRedEyeReductionAction
=
edit
->
addAction
(
"red_eye_reduction"
,
q
,
SLOT
(
startRedEyeReduction
()));
mRedEyeReductionAction
->
setText
(
i18n
(
"Reduce Red Eye"
));
mRedEyeReductionAction
->
setIcon
(
QIcon
::
fromTheme
(
"redeyes"
));
mRedEyeReductionAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"redeyes"
))
)
;
actionCollection
->
setDefaultShortcut
(
mRedEyeReductionAction
,
Qt
::
SHIFT
|
Qt
::
Key_E
);
mActionList
...
...
app/kipiexportaction.cpp
View file @
30b580f1
...
...
@@ -63,7 +63,7 @@ struct KIPIExportActionPrivate
};
KIPIExportAction
::
KIPIExportAction
(
QObject
*
parent
)
:
KToolBarPopupAction
(
QIcon
::
fromTheme
(
"document-share"
),
i18nc
(
"@action"
,
"Share"
),
parent
)
:
KToolBarPopupAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-share"
)
)
,
i18nc
(
"@action"
,
"Share"
),
parent
)
,
d
(
new
KIPIExportActionPrivate
)
{
d
->
q
=
this
;
...
...
app/kipiinterface.cpp
View file @
30b580f1
...
...
@@ -77,14 +77,14 @@ public:
{
KFileItem
item
(
url
);
mAttributes
.
insert
(
"name"
,
url
.
fileName
());
mAttributes
.
insert
(
"comment"
,
comment
());
mAttributes
.
insert
(
"date"
,
TimeUtils
::
dateTimeForFileItem
(
item
));
mAttributes
.
insert
(
"orientation"
,
orientation
());
mAttributes
.
insert
(
"title"
,
prettyFileName
());
mAttributes
.
insert
(
QStringLiteral
(
"name"
)
,
url
.
fileName
());
mAttributes
.
insert
(
QStringLiteral
(
"comment"
)
,
comment
());
mAttributes
.
insert
(
QStringLiteral
(
"date"
)
,
TimeUtils
::
dateTimeForFileItem
(
item
));
mAttributes
.
insert
(
QStringLiteral
(
"orientation"
)
,
orientation
());
mAttributes
.
insert
(
QStringLiteral
(
"title"
)
,
prettyFileName
());
int
size
=
item
.
size
();
if
(
size
>
0
)
{
mAttributes
.
insert
(
"filesize"
,
size
);
mAttributes
.
insert
(
QStringLiteral
(
"filesize"
)
,
size
);
}
}
...
...
@@ -190,7 +190,7 @@ struct MenuInfo
MenuInfo
()
{}
MenuInfo
(
const
QString
&
name
,
QString
iconName
)
MenuInfo
(
const
QString
&
name
,
const
QString
&
iconName
)
:
mName
(
name
)
,
mIconName
(
iconName
)
{}
...
...
app/mainwindow.cpp
View file @
30b580f1
...
...
@@ -1567,11 +1567,11 @@ void MainWindow::updateSlideShowAction()
{
if
(
d
->
mSlideShow
->
isRunning
())
{
d
->
mToggleSlideShowAction
->
setText
(
i18n
(
"Pause Slideshow"
));
d
->
mToggleSlideShowAction
->
setIcon
(
QIcon
::
fromTheme
(
"media-playback-pause"
));
d
->
mToggleSlideShowAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"media-playback-pause"
))
)
;
}
else
{
d
->
mToggleSlideShowAction
->
setText
(
d
->
mFullScreenAction
->
isChecked
()
?
i18n
(
"Resume Slideshow"
)
:
i18n
(
"Start Slideshow"
));
d
->
mToggleSlideShowAction
->
setIcon
(
QIcon
::
fromTheme
(
"media-playback-start"
));
d
->
mToggleSlideShowAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"media-playback-start"
))
)
;
}
}
...
...
app/semanticinfocontextmanageritem.cpp
View file @
30b580f1
...
...
@@ -436,9 +436,9 @@ void SemanticInfoContextManagerItem::showSemanticInfoDialog()
d
->
mSemanticInfoDialog
->
setAttribute
(
Qt
::
WA_DeleteOnClose
,
true
);
connect
(
d
->
mSemanticInfoDialog
->
mPreviousButton
,
&
QAbstractButton
::
clicked
,
d
->
mActionCollection
->
action
(
"go_previous"
),
&
QAction
::
trigger
);
d
->
mActionCollection
->
action
(
QStringLiteral
(
"go_previous"
)
)
,
&
QAction
::
trigger
);
connect
(
d
->
mSemanticInfoDialog
->
mNextButton
,
&
QAbstractButton
::
clicked
,
d
->
mActionCollection
->
action
(
"go_next"
),
&
QAction
::
trigger
);
d
->
mActionCollection
->
action
(
QStringLiteral
(
"go_next"
)
)
,
&
QAction
::
trigger
);
connect
(
d
->
mSemanticInfoDialog
->
mButtonBox
,
&
QDialogButtonBox
::
rejected
,
d
->
mSemanticInfoDialog
.
data
(),
&
QWidget
::
close
);
...
...
app/startmainpage.cpp
View file @
30b580f1
...
...
@@ -284,10 +284,10 @@ void StartMainPage::showContextMenu(const QPoint& pos)
// Create menu
DialogGuard
<
QMenu
>
menu
(
this
);
QAction
*
addAction
=
menu
->
addAction
(
QIcon
::
fromTheme
(
"bookmark-new"
),
QString
());
QAction
*
forgetAction
=
menu
->
addAction
(
QIcon
::
fromTheme
(
"edit-delete"
),
QString
());
QAction
*
addAction
=
menu
->
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"bookmark-new"
)
)
,
QString
());
QAction
*
forgetAction
=
menu
->
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-delete"
)
)
,
QString
());
menu
->
addSeparator
();
QAction
*
forgetAllAction
=
menu
->
addAction
(
QIcon
::
fromTheme
(
"edit-delete-all"
),
QString
());
QAction
*
forgetAllAction
=
menu
->
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-delete-all"
)
)
,
QString
());
if
(
d
->
mHistoryWidget
->
currentWidget
()
==
d
->
mRecentFoldersTab
)
{
addAction
->
setText
(
i18nc
(
"@action Recent Folders view"
,
"Add Folder to Places"
));
...
...
app/viewmainpage.cpp
View file @
30b580f1
...
...
@@ -804,7 +804,7 @@ bool ViewMainPage::eventFilter(QObject* watched, QEvent* event)
}
// Leave fullscreen when viewing an image
if
(
window
()
->
isFullScreen
()
&&
key
==
Qt
::
Key_Escape
)
{
d
->
mActionCollection
->
action
(
"leave_fullscreen"
)
->
trigger
();
d
->
mActionCollection
->
action
(
QStringLiteral
(
"leave_fullscreen"
)
)
->
trigger
();
event
->
accept
();
}
}
...
...
importer/importdialog.cpp
View file @
30b580f1
...
...
@@ -167,7 +167,7 @@ public:
void
startGwenview
()
{
KService
::
Ptr
service
=
KService
::
serviceByDesktopName
(
"org.kde.gwenview"
);
KService
::
Ptr
service
=
KService
::
serviceByDesktopName
(
QStringLiteral
(
"org.kde.gwenview"
)
)
;
if
(
!
service
)
{
qCCritical
(
GWENVIEW_IMPORTER_LOG
)
<<
"Could not find gwenview"
;
}
else
{
...
...
@@ -241,7 +241,7 @@ ImportDialog::ImportDialog()
d
->
mCentralWidget
->
setCurrentWidget
(
d
->
mThumbnailPage
);
setWindowIcon
(
QIcon
::
fromTheme
(
"gwenview"
));
setWindowIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"gwenview"
))
)
;
setAutoSaveSettings
();
}
...
...
@@ -262,11 +262,11 @@ void ImportDialog::setSourceUrl(const QUrl& url, const QString& deviceUdi)
name
=
url
.
url
(
QUrl
::
PreferLocalFile
);
iconName
=
KProtocolInfo
::
icon
(
url
.
scheme
());
if
(
iconName
.
isEmpty
())
{
iconName
=
"folder"
;
iconName
=
QStringLiteral
(
"folder"
)
;
}
}
else
{
Solid
::
Device
device
(
deviceUdi
);
name
=
device
.
vendor
()
+
' '
+
device
.
product
();
name
=
device
.
vendor
()
+
QLatin1Char
(
' '
)
+
device
.
product
();
iconName
=
device
.
icon
();
}
d
->
mThumbnailPage
->
setSourceUrl
(
url
,
iconName
,
name
);
...
...
importer/main.cpp
View file @
30b580f1
...
...
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
qCCritical
(
GWENVIEW_IMPORTER_LOG
)
<<
i18n
(
"Invalid source folder."
);
return
1
;
}
QString
deviceUdi
=
parser
.
isSet
(
"udi"
)
?
parser
.
value
(
"udi"
)
:
QString
();
QString
deviceUdi
=
parser
.
isSet
(
QStringLiteral
(
"udi"
)
)
?
parser
.
value
(
QStringLiteral
(
"udi"
)
)
:
QString
();
Gwenview
::
ImportDialog
*
dialog
=
new
Gwenview
::
ImportDialog
();
dialog
->
show
();
...
...
lib/documentview/documentview.h
View file @
30b580f1
...
...
@@ -181,7 +181,7 @@ Q_SIGNALS:
void
adapterChanged
();
void
focused
(
DocumentView
*
);
void
focused
(
Gwenview
::
DocumentView
*
);
void
zoomToFitChanged
(
bool
);
...
...
@@ -189,10 +189,10 @@ Q_SIGNALS:
void
positionChanged
();
void
hudTrashClicked
(
DocumentView
*
);
void
hudDeselectClicked
(
DocumentView
*
);
void
hudTrashClicked
(
Gwenview
::
DocumentView
*
);
void
hudDeselectClicked
(
Gwenview
::
DocumentView
*
);
void
fadeInFinished
(
DocumentView
*
);
void
fadeInFinished
(
Gwenview
::
DocumentView
*
);
void
contextMenuRequested
();
...
...
tests/auto/contextmanagertest.cpp
View file @
30b580f1
...
...
@@ -45,7 +45,7 @@ void ContextManagerTest::testRemove()
// there is any, otherwise to the previous image.
SandBoxDir
sandBox
;
sandBox
.
fill
(
QStringList
()
<<
"a"
<<
"b"
<<
"c"
);
sandBox
.
fill
(
QStringList
()
<<
QStringLiteral
(
"a"
)
<<
QStringLiteral
(
"b"
)
<<
QStringLiteral
(
"c"
)
)
;
QUrl
dirUrl
=
QUrl
::
fromLocalFile
(
sandBox
.
absolutePath
());
SortedDirModel
dirModel
;
...
...
tests/auto/testutils.h
View file @
30b580f1
...
...
@@ -42,7 +42,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
inline
QString
pathForTestFile
(
const
QString
&
name
)
{
return
QDir
::
cleanPath
(
QStringLiteral
(
"%1/%2"
).
arg
(
GV_TEST_DATA_DIR
).
arg
(
name
));
return
QDir
::
cleanPath
(
QStringLiteral
(
"%1/%2"
).
arg
(
GV_TEST_DATA_DIR
,
name
));
}
inline
QUrl
urlForTestFile
(
const
QString
&
name
)
...
...
tests/manual/thumbnailgen.cpp
View file @
30b580f1
...
...
@@ -75,7 +75,7 @@ int main(int argc, char** argv)
}
else
{
qFatal
(
"Invalid thumbnail size: %s"
,
qPrintable
(
args
.
last
()));
}
QString
thumbnailBaseDirName
=
parser
.
value
(
"thumbnail-dir"
);
QString
thumbnailBaseDirName
=
parser
.
value
(
QStringLiteral
(
"thumbnail-dir"
)
)
;
// Set up thumbnail base dir
if
(
!
thumbnailBaseDirName
.
isEmpty
())
{
...
...
@@ -88,8 +88,8 @@ int main(int argc, char** argv)
return
1
;
}
}
if
(
!
thumbnailBaseDirName
.
endsWith
(
'/'
))
{
thumbnailBaseDirName
+=
'/'
;
if
(
!
thumbnailBaseDirName
.
endsWith
(
QLatin1Char
(
'/'
))
)
{
thumbnailBaseDirName
+=
QLatin1Char
(
'/'
)
;
}
ThumbnailProvider
::
setThumbnailBaseDir
(
thumbnailBaseDirName
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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