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
3d01e041
Commit
3d01e041
authored
Feb 09, 2022
by
Laurent Montel
Browse files
Modernize code
parent
982cf5b1
Pipeline
#135227
passed with stage
in 1 minute and 45 seconds
Changes
34
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/folderviewcontextmanageritem.cpp
View file @
3d01e041
...
...
@@ -239,14 +239,14 @@ QModelIndex FolderViewContextManagerItem::findClosestIndex(const QModelIndex &pa
if
(
!
index
.
isValid
())
{
index
=
findRootIndex
(
wantedUrl
);
if
(
!
index
.
isValid
())
{
return
QModelIndex
()
;
return
{}
;
}
}
QUrl
url
=
mModel
->
urlForIndex
(
index
);
if
(
!
url
.
isParentOf
(
wantedUrl
))
{
qCWarning
(
GWENVIEW_APP_LOG
)
<<
url
<<
"is not a parent of"
<<
wantedUrl
<<
"!"
;
return
QModelIndex
()
;
return
{}
;
}
QString
relativePath
=
QDir
(
url
.
path
()).
relativeFilePath
(
wantedUrl
.
path
());
...
...
app/semanticinfocontextmanageritem.cpp
View file @
3d01e041
...
...
@@ -254,7 +254,7 @@ struct SemanticInfoContextManagerItemPrivate : public Ui_SemanticInfoSideBarItem
const
QStringList
labels
(
labelMap
.
values
());
for
(
const
QString
&
label
:
labels
)
{
DecoratedTag
*
decoratedTag
=
new
DecoratedTag
(
label
);
auto
*
decoratedTag
=
new
DecoratedTag
(
label
);
mTagLayout
->
addWidget
(
decoratedTag
);
}
mTagLayout
->
addWidget
(
mEditLabel
);
...
...
app/sidebar.cpp
View file @
3d01e041
...
...
@@ -201,9 +201,7 @@ SideBarTabBar::SideBarTabBar(QWidget *parent)
setIconSize
(
QSize
(
KIconLoader
::
SizeSmallMedium
,
KIconLoader
::
SizeSmallMedium
));
}
SideBarTabBar
::~
SideBarTabBar
()
{
}
SideBarTabBar
::~
SideBarTabBar
()
=
default
;
SideBarTabBar
::
TabButtonStyle
SideBarTabBar
::
tabButtonStyle
()
const
{
...
...
app/viewmainpage.cpp
View file @
3d01e041
...
...
@@ -368,7 +368,7 @@ struct ViewMainPagePrivate {
QUrl
url
=
view
->
url
();
if
(
!
url
.
isValid
())
{
qCWarning
(
GWENVIEW_APP_LOG
)
<<
"View does not display any document!"
;
return
QModelIndex
()
;
return
{}
;
}
SortedDirModel
*
dirModel
=
mGvCore
->
sortedDirModel
();
...
...
@@ -607,7 +607,7 @@ Document::Ptr ViewMainPage::currentDocument() const
{
if
(
!
d
->
currentView
())
{
LOG
(
"!d->documentView()"
);
return
Document
::
Ptr
()
;
return
{}
;
}
return
d
->
currentView
()
->
document
();
...
...
importer/thumbnailpage.cpp
View file @
3d01e041
...
...
@@ -330,13 +330,13 @@ struct ThumbnailPagePrivate : public Ui_ThumbnailPage {
{
QUrl
url
=
mUrlMap
.
value
(
mSrcBaseUrl
);
if
(
!
url
.
isValid
())
{
return
QUrl
()
;
return
{}
;
}
KIO
::
StatJob
*
job
=
KIO
::
stat
(
url
);
KJobWidgets
::
setWindow
(
job
,
q
);
if
(
!
job
->
exec
())
{
return
QUrl
()
;
return
{}
;
}
KFileItem
item
(
job
->
statResult
(),
url
,
true
/* delayedMimeTypes */
);
return
item
.
isDir
()
?
url
:
QUrl
();
...
...
lib/archiveutils.cpp
View file @
3d01e041
...
...
@@ -62,7 +62,7 @@ QString protocolForMimeType(const QString &mimeType)
// We don't want .svgz to be considered as archives because QtSvg knows
// how to decode gzip-ed svg files
cache
.
insert
(
mimeType
,
QString
());
return
QString
()
;
return
{}
;
}
QString
protocol
=
KProtocolManager
::
protocolForArchiveMimetype
(
mimeType
);
...
...
lib/binder.cpp
View file @
3d01e041
...
...
@@ -28,8 +28,6 @@ BinderInternal::BinderInternal(QObject *parent)
{
}
BinderInternal
::~
BinderInternal
()
{
}
BinderInternal
::~
BinderInternal
()
=
default
;
}
// namespace
lib/decoratedtag/decoratedtag.cpp
View file @
3d01e041
...
...
@@ -50,9 +50,7 @@ DecoratedTag::DecoratedTag(const QString &text, QWidget *parent, Qt::WindowFlags
d
->
updateMargins
();
}
Gwenview
::
DecoratedTag
::~
DecoratedTag
()
noexcept
{
}
Gwenview
::
DecoratedTag
::~
DecoratedTag
()
noexcept
=
default
;
void
DecoratedTag
::
changeEvent
(
QEvent
*
event
)
{
...
...
lib/document/abstractdocumenteditor.h
View file @
3d01e041
...
...
@@ -41,9 +41,7 @@ namespace Gwenview
class
GWENVIEWLIB_EXPORT
AbstractDocumentEditor
{
public:
virtual
~
AbstractDocumentEditor
()
{
}
virtual
~
AbstractDocumentEditor
()
=
default
;
/**
* Replaces the current image with image.
...
...
lib/document/abstractdocumentimpl.h
View file @
3d01e041
...
...
@@ -73,7 +73,7 @@ public:
virtual
QByteArray
rawData
()
const
{
return
QByteArray
()
;
return
{}
;
}
virtual
bool
isEditable
()
const
...
...
lib/document/emptydocumentimpl.cpp
View file @
3d01e041
...
...
@@ -34,9 +34,7 @@ EmptyDocumentImpl::EmptyDocumentImpl(Document *document)
{
}
EmptyDocumentImpl
::~
EmptyDocumentImpl
()
{
}
EmptyDocumentImpl
::~
EmptyDocumentImpl
()
=
default
;
void
EmptyDocumentImpl
::
init
()
{
...
...
lib/documentview/abstractdocumentviewadapter.h
View file @
3d01e041
...
...
@@ -196,7 +196,7 @@ public:
}
Document
::
Ptr
document
()
const
override
{
return
Document
::
Ptr
()
;
return
{}
;
}
void
setDocument
(
const
Document
::
Ptr
&
)
override
{
...
...
lib/documentview/alphabackgrounditem.cpp
View file @
3d01e041
...
...
@@ -17,9 +17,7 @@ AlphaBackgroundItem::AlphaBackgroundItem(AbstractImageView *parent)
{
}
AlphaBackgroundItem
::~
AlphaBackgroundItem
()
{
}
AlphaBackgroundItem
::~
AlphaBackgroundItem
()
=
default
;
AbstractImageView
::
AlphaBackgroundMode
AlphaBackgroundItem
::
mode
()
const
{
...
...
lib/documentview/documentviewcontroller.cpp
View file @
3d01e041
...
...
@@ -112,7 +112,7 @@ struct DocumentViewControllerPrivate {
setBackgroundColorModeIcons
(
mBackgroundColorModeAuto
,
mBackgroundColorModeLight
,
mBackgroundColorModeNeutral
,
mBackgroundColorModeDark
);
QActionGroup
*
actionGroup
=
new
QActionGroup
(
q
);
auto
*
actionGroup
=
new
QActionGroup
(
q
);
actionGroup
->
addAction
(
mBackgroundColorModeAuto
);
actionGroup
->
addAction
(
mBackgroundColorModeLight
);
actionGroup
->
addAction
(
mBackgroundColorModeNeutral
);
...
...
lib/imagemetainfomodel.cpp
View file @
3d01e041
...
...
@@ -231,7 +231,7 @@ struct ImageMetaInfoModelPrivate {
{
if
(
index
.
internalId
()
==
NoGroup
)
{
if
(
index
.
column
()
!=
0
)
{
return
QVariant
()
;
return
{}
;
}
QString
label
=
mMetaInfoGroupVector
[
index
.
row
()]
->
label
();
return
QVariant
(
label
);
...
...
@@ -485,7 +485,7 @@ QString ImageMetaInfoModel::getValueForKey(const QString &key) const
QString
ImageMetaInfoModel
::
keyForIndex
(
const
QModelIndex
&
index
)
const
{
if
(
index
.
internalId
()
==
NoGroup
)
{
return
QString
()
;
return
{}
;
}
MetaInfoGroup
*
group
=
d
->
mMetaInfoGroupVector
[
index
.
internalId
()];
return
group
->
getKeyAt
(
index
.
row
());
...
...
@@ -494,19 +494,19 @@ QString ImageMetaInfoModel::keyForIndex(const QModelIndex &index) const
QModelIndex
ImageMetaInfoModel
::
index
(
int
row
,
int
col
,
const
QModelIndex
&
parent
)
const
{
if
(
col
<
0
||
col
>
1
)
{
return
QModelIndex
()
;
return
{}
;
}
if
(
!
parent
.
isValid
())
{
// This is a group
if
(
row
<
0
||
row
>=
d
->
mMetaInfoGroupVector
.
size
())
{
return
QModelIndex
()
;
return
{}
;
}
return
createIndex
(
row
,
col
,
col
==
0
?
NoGroup
:
NoGroupSpace
);
}
else
{
// This is an entry
int
group
=
parent
.
row
();
if
(
row
<
0
||
row
>=
d
->
mMetaInfoGroupVector
[
group
]
->
size
())
{
return
QModelIndex
()
;
return
{}
;
}
return
createIndex
(
row
,
col
,
group
);
}
...
...
@@ -515,10 +515,10 @@ QModelIndex ImageMetaInfoModel::index(int row, int col, const QModelIndex &paren
QModelIndex
ImageMetaInfoModel
::
parent
(
const
QModelIndex
&
index
)
const
{
if
(
!
index
.
isValid
())
{
return
QModelIndex
()
;
return
{}
;
}
if
(
index
.
internalId
()
==
NoGroup
||
index
.
internalId
()
==
NoGroupSpace
)
{
return
QModelIndex
()
;
return
{}
;
}
else
{
return
createIndex
(
index
.
internalId
(),
0
,
NoGroup
);
}
...
...
@@ -543,21 +543,21 @@ int ImageMetaInfoModel::columnCount(const QModelIndex & /*parent*/) const
QVariant
ImageMetaInfoModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
{
if
(
!
index
.
isValid
())
{
return
QVariant
()
;
return
{}
;
}
switch
(
role
)
{
case
Qt
::
DisplayRole
:
return
d
->
displayData
(
index
);
default:
return
QVariant
()
;
return
{}
;
}
}
QVariant
ImageMetaInfoModel
::
headerData
(
int
section
,
Qt
::
Orientation
orientation
,
int
role
)
const
{
if
(
orientation
==
Qt
::
Vertical
||
role
!=
Qt
::
DisplayRole
)
{
return
QVariant
()
;
return
{}
;
}
QString
caption
;
...
...
lib/iodevicejpegsourcemanager.cpp
View file @
3d01e041
...
...
@@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
// KF
// libjpeg
#include
<stdio
.h
>
#include
<
c
stdio>
#define XMD_H
extern
"C"
{
#include
<jpeglib.h>
...
...
lib/jpegcontent.cpp
View file @
3d01e041
...
...
@@ -21,10 +21,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include
"jpegcontent.h"
// System
#include
<math
.h
>
#include
<stdio
.h
>
#include
<stdlib
.h
>
#include
<string
.h
>
#include
<
c
math>
#include
<
c
stdio>
#include
<
c
stdlib>
#include
<
c
string>
extern
"C"
{
#include
<jpeglib.h>
// Must be included before transupp.h
...
...
lib/jpegcontent.h
View file @
3d01e041
...
...
@@ -80,8 +80,8 @@ private:
struct
Private
;
Private
*
d
;
JpegContent
(
const
JpegContent
&
);
void
operator
=
(
const
JpegContent
&
);
JpegContent
(
const
JpegContent
&
)
=
delete
;
void
operator
=
(
const
JpegContent
&
)
=
delete
;
void
applyPendingTransformation
();
int
dotsPerMeter
(
const
QString
&
keyName
)
const
;
};
...
...
lib/jpegerrormanager.h
View file @
3d01e041
...
...
@@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef JPEGERRORMANAGER_H
#define JPEGERRORMANAGER_H
#include
<setjmp
.h
>
#include
<
c
setjmp>
extern
"C"
{
#define XMD_H
...
...
lib/mpris2/mprismediaplayer2.cpp
View file @
3d01e041
...
...
@@ -32,9 +32,7 @@ MprisMediaPlayer2::MprisMediaPlayer2(const QString &objectDBusPath, QAction *ful
connect
(
mFullScreenAction
,
&
QAction
::
toggled
,
this
,
&
MprisMediaPlayer2
::
onFullScreenActionToggled
);
}
MprisMediaPlayer2
::~
MprisMediaPlayer2
()
{
}
MprisMediaPlayer2
::~
MprisMediaPlayer2
()
=
default
;
bool
MprisMediaPlayer2
::
canQuit
()
const
{
...
...
@@ -80,12 +78,12 @@ QString MprisMediaPlayer2::desktopEntry() const
QStringList
MprisMediaPlayer2
::
supportedUriSchemes
()
const
{
return
QStringList
()
;
return
{}
;
}
QStringList
MprisMediaPlayer2
::
supportedMimeTypes
()
const
{
return
QStringList
()
;
return
{}
;
}
bool
MprisMediaPlayer2
::
isFullscreen
()
const
...
...
Prev
1
2
Next
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