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
PIM
KIdentityManagement
Commits
cc632d27
Commit
cc632d27
authored
May 02, 2021
by
Laurent Montel
😁
Browse files
Modernize code
parent
1b005fda
Pipeline
#60485
passed with stage
in 9 minutes and 12 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/identity.h
View file @
cc632d27
...
...
@@ -73,7 +73,7 @@ class KIDENTITYMANAGEMENT_EXPORT Identity
friend
KIDENTITYMANAGEMENT_EXPORT
QDataStream
&
operator
>>
(
QDataStream
&
stream
,
KIdentityManagement
::
Identity
&
ident
);
public:
typedef
QVector
<
Identity
>
List
;
using
List
=
QVector
<
Identity
>
;
/** Constructor */
explicit
Identity
(
const
QString
&
id
=
QString
(),
...
...
src/identitymanager.h
View file @
cc632d27
...
...
@@ -45,18 +45,18 @@ public:
static
IdentityManager
*
self
();
public:
typedef
QVector
<
Identity
>::
Iterator
Iterator
;
typedef
QVector
<
Identity
>::
ConstIterator
ConstIterator
;
using
Iterator
=
QVector
<
Identity
>::
Iterator
;
using
ConstIterator
=
QVector
<
Identity
>::
ConstIterator
;
/**
* Typedef for STL style iterator
*/
typedef
I
terator
i
terator
;
using
i
terator
=
I
terator
;
/**
* Typedef for STL style iterator
*/
typedef
C
onst
I
terator
c
onst
_i
terator
;
using
c
onst
_i
terator
=
C
onst
I
terator
;
/** @return a unique name for a new identity based on @p name
* @param name the name of the base identity
...
...
src/signature.h
View file @
cc632d27
...
...
@@ -91,7 +91,7 @@ public:
QImage
image
;
QString
name
;
};
typedef
QSharedPointer
<
EmbeddedImage
>
EmbeddedImagePtr
;
using
EmbeddedImagePtr
=
QSharedPointer
<
EmbeddedImage
>
;
/** Used for comparison */
bool
operator
==
(
const
Signature
&
other
)
const
;
...
...
@@ -202,7 +202,7 @@ public:
};
/// Describes which additional parts should be added to the signature
typedef
QFlags
<
AddedTextFlag
>
AddedText
;
using
AddedText
=
QFlags
<
AddedTextFlag
>
;
/** Inserts this signature into the given text edit.
* If the signature is inserted at the beginning, a couple of new
...
...
src/signatureconfigurator.cpp
View file @
cc632d27
...
...
@@ -97,7 +97,7 @@ QString SignatureConfigurator::Private::asCleanedHTML() const
void
SignatureConfigurator
::
Private
::
init
()
{
auto
*
vlay
=
new
QVBoxLayout
(
q
);
auto
vlay
=
new
QVBoxLayout
(
q
);
vlay
->
setObjectName
(
QStringLiteral
(
"main layout"
));
// "enable signature" checkbox:
...
...
@@ -108,7 +108,7 @@ void SignatureConfigurator::Private::init()
vlay
->
addWidget
(
mEnableCheck
);
// "obtain signature text from" combo and label:
auto
*
hlay
=
new
QHBoxLayout
();
// inherits spacing
auto
hlay
=
new
QHBoxLayout
();
// inherits spacing
vlay
->
addLayout
(
hlay
);
mSourceCombo
=
new
QComboBox
(
q
);
mSourceCombo
->
setEditable
(
false
);
...
...
@@ -117,14 +117,14 @@ void SignatureConfigurator::Private::init()
mSourceCombo
->
addItems
(
QStringList
()
<<
i18nc
(
"continuation of
\"
obtain signature text from
\"
"
,
"Input Field Below"
)
<<
i18nc
(
"continuation of
\"
obtain signature text from
\"
"
,
"File"
)
<<
i18nc
(
"continuation of
\"
obtain signature text from
\"
"
,
"Output of Command"
));
QLabel
*
label
=
new
QLabel
(
i18n
(
"Obtain signature &text from:"
),
q
);
auto
label
=
new
QLabel
(
i18n
(
"Obtain signature &text from:"
),
q
);
label
->
setBuddy
(
mSourceCombo
);
label
->
setEnabled
(
false
);
// since !mEnableCheck->isChecked()
hlay
->
addWidget
(
label
);
hlay
->
addWidget
(
mSourceCombo
,
1
);
// widget stack that is controlled by the source combo:
auto
*
widgetStack
=
new
QStackedWidget
(
q
);
auto
widgetStack
=
new
QStackedWidget
(
q
);
widgetStack
->
setEnabled
(
false
);
// since !mEnableCheck->isChecked()
vlay
->
addWidget
(
widgetStack
,
1
);
q
->
connect
(
mSourceCombo
,
QOverload
<
int
>::
of
(
&
QComboBox
::
currentIndexChanged
),
widgetStack
,
&
QStackedWidget
::
setCurrentIndex
);
...
...
@@ -139,9 +139,9 @@ void SignatureConfigurator::Private::init()
int
pageno
=
0
;
// page 0: input field for direct entering:
QWidget
*
page
=
new
QWidget
(
widgetStack
);
auto
page
=
new
QWidget
(
widgetStack
);
widgetStack
->
insertWidget
(
pageno
,
page
);
auto
*
page_vlay
=
new
QVBoxLayout
(
page
);
auto
page_vlay
=
new
QVBoxLayout
(
page
);
page_vlay
->
setContentsMargins
(
0
,
0
,
0
,
0
);
#ifndef QT_NO_TOOLBAR
...
...
@@ -156,12 +156,12 @@ void SignatureConfigurator::Private::init()
mTextEdit
=
new
KPIMTextEdit
::
RichTextComposer
(
q
);
auto
*
richTextEditorwidget
=
new
KPIMTextEdit
::
RichTextEditorWidget
(
mTextEdit
,
q
);
auto
richTextEditorwidget
=
new
KPIMTextEdit
::
RichTextEditorWidget
(
mTextEdit
,
q
);
page_vlay
->
addWidget
(
richTextEditorwidget
,
2
);
mTextEdit
->
setWhatsThis
(
i18n
(
"Use this field to enter an arbitrary static signature."
));
// Fill the toolbars.
KActionCollection
*
actionCollection
=
new
KActionCollection
(
q
);
auto
actionCollection
=
new
KActionCollection
(
q
);
mTextEdit
->
createActions
(
actionCollection
);
#ifndef QT_NO_TOOLBAR
mEditToolBar
->
addAction
(
actionCollection
->
action
(
QStringLiteral
(
"format_text_bold"
)));
...
...
@@ -428,7 +428,7 @@ void SignatureConfigurator::slotEdit()
// slotEnableEditButton should prevent this assert from being hit:
assert
(
!
url
.
isEmpty
());
KIO
::
OpenUrlJob
*
job
=
new
KIO
::
OpenUrlJob
(
QUrl
::
fromLocalFile
(
url
),
QStringLiteral
(
"text/plain"
));
auto
job
=
new
KIO
::
OpenUrlJob
(
QUrl
::
fromLocalFile
(
url
),
QStringLiteral
(
"text/plain"
));
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
job
->
setDeleteTemporaryFile
(
true
);
job
->
start
();
...
...
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