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
Kleopatra
Commits
65137e1f
Commit
65137e1f
authored
Sep 10, 2020
by
Laurent Montel
😁
Browse files
Modernize code
parent
5d51a75d
Pipeline
#33748
passed with stage
in 13 minutes and 32 seconds
Changes
29
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/commands/dumpcrlcachecommand.cpp
View file @
65137e1f
...
...
@@ -68,7 +68,7 @@ public:
mWithRevocations
=
value
;
}
bool
withRevocations
()
{
Q_REQUIRED_RESULT
bool
withRevocations
()
{
return
mWithRevocations
;
}
...
...
src/commands/exportcertificatecommand.cpp
View file @
65137e1f
...
...
@@ -60,7 +60,7 @@ public:
private:
QMap
<
GpgME
::
Protocol
,
QString
>
fileNames
;
uint
jobsPending
;
uint
jobsPending
=
0
;
QMap
<
QObject
*
,
QString
>
outFileForSender
;
QPointer
<
ExportJob
>
cmsJob
;
QPointer
<
ExportJob
>
pgpJob
;
...
...
@@ -79,8 +79,7 @@ const ExportCertificateCommand::Private *ExportCertificateCommand::d_func() cons
#define q q_func()
ExportCertificateCommand
::
Private
::
Private
(
ExportCertificateCommand
*
qq
,
KeyListController
*
c
)
:
Command
::
Private
(
qq
,
c
),
jobsPending
(
0
)
:
Command
::
Private
(
qq
,
c
)
{
}
...
...
src/commands/exportpaperkeycommand.h
View file @
65137e1f
...
...
@@ -49,7 +49,7 @@ private:
QString
errorExitMessage
(
const
QStringList
&
)
const
override
;
private:
QWidget
*
mParent
;
QWidget
*
const
mParent
;
QProcess
mPkProc
;
};
...
...
src/commands/importcrlcommand.cpp
View file @
65137e1f
...
...
@@ -39,7 +39,7 @@ public:
explicit
Private
(
ImportCrlCommand
*
qq
,
KeyListController
*
c
);
~
Private
();
QString
errorString
()
const
Q_REQUIRED_RESULT
QString
errorString
()
const
{
return
stringFromGpgOutput
(
errorBuffer
);
}
...
...
src/crypto/autodecryptverifyfilescontroller.cpp
View file @
65137e1f
...
...
@@ -87,17 +87,13 @@ public:
std
::
vector
<
std
::
shared_ptr
<
const
DecryptVerifyResult
>
>
m_results
;
std
::
vector
<
std
::
shared_ptr
<
Task
>
>
m_runnableTasks
,
m_completedTasks
;
std
::
shared_ptr
<
Task
>
m_runningTask
;
bool
m_errorDetected
;
DecryptVerifyOperation
m_operation
;
DecryptVerifyFilesDialog
*
m_dialog
;
QTemporaryDir
*
m_workDir
;
bool
m_errorDetected
=
false
;
DecryptVerifyOperation
m_operation
=
DecryptVerify
;
DecryptVerifyFilesDialog
*
m_dialog
=
nullptr
;
QTemporaryDir
*
m_workDir
=
nullptr
;
};
AutoDecryptVerifyFilesController
::
Private
::
Private
(
AutoDecryptVerifyFilesController
*
qq
)
:
q
(
qq
),
m_errorDetected
(
false
),
m_operation
(
DecryptVerify
),
m_dialog
(
nullptr
),
m_workDir
(
nullptr
)
AutoDecryptVerifyFilesController
::
Private
::
Private
(
AutoDecryptVerifyFilesController
*
qq
)
:
q
(
qq
)
{
qRegisterMetaType
<
VerificationResult
>
();
}
...
...
src/crypto/controller.cpp
View file @
65137e1f
...
...
@@ -21,15 +21,13 @@ class Controller::Private
Controller
*
const
q
;
public:
explicit
Private
(
Controller
*
qq
)
:
q
(
qq
),
lastError
(
0
),
lastErrorString
()
:
q
(
qq
)
{
}
private:
int
lastError
;
int
lastError
=
0
;
QString
lastErrorString
;
};
...
...
src/crypto/gui/certificatelineedit.cpp
View file @
65137e1f
...
...
@@ -84,16 +84,12 @@ CertificateLineEdit::CertificateLineEdit(AbstractKeyListModel *model,
:
QLineEdit
(
parent
),
mFilterModel
(
new
KeyListSortFilterProxyModel
(
this
)),
mFilter
(
std
::
shared_ptr
<
KeyFilter
>
(
filter
)),
mEditStarted
(
false
),
mEditFinished
(
false
),
mLineAction
(
new
QAction
(
this
))
{
setPlaceholderText
(
i18n
(
"Please enter a name or email address..."
));
setClearButtonEnabled
(
true
);
addAction
(
mLineAction
,
QLineEdit
::
LeadingPosition
);
QFontMetrics
fm
(
font
());
auto
*
completer
=
new
QCompleter
(
this
);
auto
*
completeFilterModel
=
new
ProxyModel
(
completer
);
completeFilterModel
->
setKeyFilter
(
mFilter
);
...
...
src/crypto/gui/certificatelineedit.h
View file @
65137e1f
...
...
@@ -82,15 +82,15 @@ private Q_SLOTS:
void
checkLocate
();
private:
KeyListSortFilterProxyModel
*
mFilterModel
;
KeyListSortFilterProxyModel
*
const
mFilterModel
;
QLabel
*
mStatusLabel
,
*
mStatusIcon
;
GpgME
::
Key
mKey
;
GpgME
::
Protocol
mCurrentProto
;
std
::
shared_ptr
<
KeyFilter
>
mFilter
;
bool
mEditStarted
,
mEditFinished
;
QAction
*
mLineAction
;
bool
mEditStarted
=
false
;
bool
mEditFinished
=
false
;
QAction
*
const
mLineAction
;
};
}
#endif
src/crypto/gui/certificateselectionline.cpp
View file @
65137e1f
...
...
@@ -77,11 +77,11 @@ public:
}
QString
initialText
()
const
Q_REQUIRED_RESULT
QString
initialText
()
const
{
return
m_initialText
;
}
QIcon
initialIcon
()
const
Q_REQUIRED_RESULT
QIcon
initialIcon
()
const
{
return
m_initialIcon
;
}
...
...
src/crypto/gui/decryptverifyfilesdialog.cpp
View file @
65137e1f
...
...
@@ -39,7 +39,7 @@ using namespace Kleo::Crypto;
using
namespace
Kleo
::
Crypto
::
Gui
;
DecryptVerifyFilesDialog
::
DecryptVerifyFilesDialog
(
const
std
::
shared_ptr
<
TaskCollection
>
&
coll
,
QWidget
*
parent
)
:
QDialog
(
parent
),
m_tasks
(
coll
),
m_saveButton
(
QDialogButtonBox
::
NoButton
),
m_buttonBox
(
new
QDialogButtonBox
)
:
QDialog
(
parent
),
m_tasks
(
coll
),
m_buttonBox
(
new
QDialogButtonBox
)
{
readConfig
();
auto
vLay
=
new
QVBoxLayout
(
this
);
...
...
src/crypto/gui/decryptverifyfilesdialog.h
View file @
65137e1f
...
...
@@ -65,8 +65,8 @@ private:
int
m_lastErrorItemIndex
;
ResultListWidget
*
m_resultList
;
FileNameRequester
*
m_outputLocationFNR
;
QDialogButtonBox
::
StandardButton
m_saveButton
;
QDialogButtonBox
*
m_buttonBox
;
QDialogButtonBox
::
StandardButton
m_saveButton
=
QDialogButtonBox
::
NoButton
;
QDialogButtonBox
*
const
m_buttonBox
;
};
}
// namespace Gui
...
...
src/crypto/gui/encryptemailwizard.cpp
View file @
65137e1f
...
...
@@ -21,8 +21,7 @@ using namespace Kleo::Crypto::Gui;
class
EncryptEMailWizard
::
Private
{
public:
Private
()
:
m_quickMode
(
false
)
{}
bool
m_quickMode
;
bool
m_quickMode
=
false
;
};
EncryptEMailWizard
::
EncryptEMailWizard
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
SignEncryptWizard
(
parent
,
flags
),
d
(
new
Private
)
...
...
src/crypto/gui/resolverecipientspage.cpp
View file @
65137e1f
...
...
@@ -59,7 +59,8 @@ ResolveRecipientsPage::ListWidget::~ListWidget()
void
ResolveRecipientsPage
::
ListWidget
::
onSelectionChange
()
{
Q_FOREACH
(
const
QString
&
i
,
widgets
.
keys
())
{
const
auto
widgetskeys
=
widgets
.
keys
();
for
(
const
QString
&
i
:
widgetskeys
)
{
Q_ASSERT
(
items
.
contains
(
i
));
widgets
[
i
]
->
setSelected
(
items
[
i
]
->
isSelected
());
}
...
...
src/crypto/gui/resultitemwidget.cpp
View file @
65137e1f
...
...
@@ -85,7 +85,7 @@ class ResultItemWidget::Private
{
ResultItemWidget
*
const
q
;
public:
explicit
Private
(
const
std
::
shared_ptr
<
const
Task
::
Result
>
&
result
,
ResultItemWidget
*
qq
)
:
q
(
qq
),
m_result
(
result
)
,
m_detailsLabel
(
nullptr
),
m_actionsLabel
(
nullptr
),
m_closeButton
(
nullptr
),
m_importCanceled
(
false
)
explicit
Private
(
const
std
::
shared_ptr
<
const
Task
::
Result
>
&
result
,
ResultItemWidget
*
qq
)
:
q
(
qq
),
m_result
(
result
)
{
Q_ASSERT
(
m_result
);
}
...
...
@@ -99,10 +99,10 @@ public:
void
oneImportFinished
();
const
std
::
shared_ptr
<
const
Task
::
Result
>
m_result
;
QLabel
*
m_detailsLabel
;
QLabel
*
m_actionsLabel
;
QPushButton
*
m_closeButton
;
bool
m_importCanceled
;
QLabel
*
m_detailsLabel
=
nullptr
;
QLabel
*
m_actionsLabel
=
nullptr
;
QPushButton
*
m_closeButton
=
nullptr
;
bool
m_importCanceled
=
false
;
};
void
ResultItemWidget
::
Private
::
oneImportFinished
()
...
...
src/crypto/gui/resultlistwidget.cpp
View file @
65137e1f
...
...
@@ -49,23 +49,17 @@ public:
void
resizeIfStandalone
();
std
::
vector
<
std
::
shared_ptr
<
TaskCollection
>
>
m_collections
;
bool
m_standaloneMode
;
int
m_lastErrorItemIndex
;
ScrollArea
*
m_scrollArea
;
QPushButton
*
m_closeButton
;
QVBoxLayout
*
m_layout
;
QLabel
*
m_progressLabel
;
bool
m_standaloneMode
=
false
;
int
m_lastErrorItemIndex
=
0
;
ScrollArea
*
m_scrollArea
=
nullptr
;
QPushButton
*
m_closeButton
=
nullptr
;
QVBoxLayout
*
m_layout
=
nullptr
;
QLabel
*
m_progressLabel
=
nullptr
;
};
ResultListWidget
::
Private
::
Private
(
ResultListWidget
*
qq
)
:
q
(
qq
),
m_collections
(),
m_standaloneMode
(
false
),
m_lastErrorItemIndex
(
0
),
m_scrollArea
(
nullptr
),
m_closeButton
(
nullptr
),
m_layout
(
nullptr
),
m_progressLabel
(
nullptr
)
m_collections
()
{
m_layout
=
new
QVBoxLayout
(
q
);
m_layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
...
...
src/crypto/gui/resultpage.cpp
View file @
65137e1f
...
...
@@ -47,12 +47,12 @@ public:
QProgressBar
*
m_progressBar
;
QHash
<
QString
,
QLabel
*>
m_progressLabelByTag
;
QVBoxLayout
*
m_progressLabelLayout
;
int
m_lastErrorItemIndex
;
int
m_lastErrorItemIndex
=
0
;
ResultListWidget
*
m_resultList
;
QCheckBox
*
m_keepOpenCB
;
};
ResultPage
::
Private
::
Private
(
ResultPage
*
qq
)
:
q
(
qq
)
,
m_lastErrorItemIndex
(
0
)
ResultPage
::
Private
::
Private
(
ResultPage
*
qq
)
:
q
(
qq
)
{
QBoxLayout
*
const
layout
=
new
QVBoxLayout
(
q
);
QWidget
*
const
labels
=
new
QWidget
;
...
...
src/crypto/gui/signemailwizard.cpp
View file @
65137e1f
...
...
@@ -46,7 +46,8 @@ private:
};
}
SignerResolveValidator
::
SignerResolveValidator
(
SignerResolvePage
*
page
)
:
SignerResolvePage
::
Validator
(),
m_page
(
page
),
complete
(
true
)
SignerResolveValidator
::
SignerResolveValidator
(
SignerResolvePage
*
page
)
:
SignerResolvePage
::
Validator
(),
m_page
(
page
),
complete
(
true
)
{
Q_ASSERT
(
m_page
);
}
...
...
src/crypto/gui/signencryptfileswizard.cpp
View file @
65137e1f
...
...
@@ -370,8 +370,6 @@ private:
SignEncryptFilesWizard
::
SignEncryptFilesWizard
(
QWidget
*
parent
,
Qt
::
WindowFlags
f
)
:
QWizard
(
parent
,
f
)
,
mSigningUserMutable
(
true
)
,
mEncryptionUserMutable
(
true
)
{
readConfig
();
...
...
src/crypto/gui/signencryptfileswizard.h
View file @
65137e1f
...
...
@@ -93,11 +93,11 @@ private Q_SLOTS:
void
slotCurrentIdChanged
(
int
);
private:
SigEncPage
*
mSigEncPage
;
ResultPage
*
mResultPage
;
QAbstractButton
*
mLabel
;
bool
mSigningUserMutable
,
mEncryptionUserMutable
;
SigEncPage
*
mSigEncPage
=
nullptr
;
ResultPage
*
mResultPage
=
nullptr
;
QAbstractButton
*
mLabel
=
nullptr
;
bool
mSigningUserMutable
=
true
;
bool
mEncryptionUserMutable
=
true
;
};
}
...
...
src/crypto/gui/signencryptwidget.h
View file @
65137e1f
...
...
@@ -102,21 +102,21 @@ Q_SIGNALS:
void
keysChanged
();
private:
KeySelectionCombo
*
mSigSelect
,
*
mSelfSelect
;
KeySelectionCombo
*
mSigSelect
=
nullptr
;
KeySelectionCombo
*
mSelfSelect
=
nullptr
;
QVector
<
CertificateLineEdit
*>
mRecpWidgets
;
QVector
<
UnknownRecipientWidget
*>
mUnknownWidgets
;
QVector
<
GpgME
::
Key
>
mAddedKeys
;
QGridLayout
*
mRecpLayout
;
QGridLayout
*
mRecpLayout
=
nullptr
;
QString
mOp
;
AbstractKeyListModel
*
mModel
;
QCheckBox
*
mSymmetric
,
*
mSigChk
,
*
mEncOtherChk
,
*
mEncSelfChk
;
int
mRecpRowCount
;
AbstractKeyListModel
*
mModel
=
nullptr
;
QCheckBox
*
mSymmetric
=
nullptr
;
QCheckBox
*
mSigChk
=
nullptr
;
QCheckBox
*
mEncOtherChk
=
nullptr
;
QCheckBox
*
mEncSelfChk
=
nullptr
;
int
mRecpRowCount
=
2
;
GpgME
::
Protocol
mCurrentProto
;
bool
mIsExclusive
;
const
bool
mIsExclusive
;
};
}
// namespace Kleo
#endif // CRYPTO_GUI_SIGNENCRYPTWIDGET_H
Prev
1
2
Next
Write
Preview
Supports
Markdown
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