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
KDE PIM Runtime
Commits
4e2022eb
Commit
4e2022eb
authored
Nov 11, 2021
by
Laurent Montel
😁
Browse files
Const'ify pointer + fix mem leak
parent
b9b6f81a
Pipeline
#96853
skipped
Changes
9
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
kcms/ldap/kcmldap.cpp
View file @
4e2022eb
...
...
@@ -20,6 +20,7 @@ K_PLUGIN_CLASS_WITH_JSON(KCMLdap, "kcmldap.json")
KCMLdap
::
KCMLdap
(
QWidget
*
parent
,
const
QVariantList
&
)
:
KCModule
(
parent
)
,
mLdapConfigureWidget
(
new
KLDAP
::
LdapConfigureWidget
(
this
))
{
setButtons
(
KCModule
::
Apply
);
auto
about
=
new
KAboutData
(
QStringLiteral
(
"kcmldap"
),
...
...
@@ -33,7 +34,6 @@ KCMLdap::KCMLdap(QWidget *parent, const QVariantList &)
auto
layout
=
new
QVBoxLayout
(
this
);
layout
->
setContentsMargins
({});
mLdapConfigureWidget
=
new
KLDAP
::
LdapConfigureWidget
(
this
);
layout
->
addWidget
(
mLdapConfigureWidget
);
connect
(
mLdapConfigureWidget
,
&
KLDAP
::
LdapConfigureWidget
::
changed
,
this
,
qOverload
<
bool
>
(
&
KCMLdap
::
changed
));
...
...
kcms/ldap/kcmldap_p.h
View file @
4e2022eb
...
...
@@ -28,6 +28,6 @@ public:
void
save
()
override
;
private:
KLDAP
::
LdapConfigureWidget
*
mLdapConfigureWidget
=
nullptr
;
KLDAP
::
LdapConfigureWidget
*
const
mLdapConfigureWidget
;
};
resources/dav/resource/configdialog.cpp
View file @
4e2022eb
...
...
@@ -40,7 +40,7 @@ ConfigDialog::ConfigDialog(QWidget *parent)
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
ConfigDialog
::
onCancelClicked
);
mainLayout
->
addWidget
(
buttonBox
);
mModel
=
new
QStandardItemModel
();
mModel
=
new
QStandardItemModel
(
this
);
const
QStringList
headers
=
{
i18n
(
"Protocol"
),
i18n
(
"URL"
)};
mModel
->
setHorizontalHeaderLabels
(
headers
);
...
...
@@ -202,8 +202,8 @@ void ConfigDialog::onRemoveButtonClicked()
return
;
}
QString
proto
=
mModel
->
index
(
indexes
.
at
(
0
).
row
(),
0
).
data
().
toString
();
QString
url
=
mModel
->
index
(
indexes
.
at
(
0
).
row
(),
1
).
data
().
toString
();
const
QString
proto
=
mModel
->
index
(
indexes
.
at
(
0
).
row
(),
0
).
data
().
toString
();
const
QString
url
=
mModel
->
index
(
indexes
.
at
(
0
).
row
(),
1
).
data
().
toString
();
mRemovedUrls
<<
QPair
<
QString
,
KDAV
::
Protocol
>
(
url
,
Utils
::
protocolByTranslatedName
(
proto
));
mModel
->
removeRow
(
indexes
.
at
(
0
).
row
());
...
...
resources/dav/resource/davfreebusyhandler.cpp
View file @
4e2022eb
...
...
@@ -83,7 +83,7 @@ void DavFreeBusyHandler::retrieveFreeBusy(const QString &email, const QDateTime
void
DavFreeBusyHandler
::
onPrincipalSearchJobFinished
(
KJob
*
job
)
{
QString
email
=
job
->
property
(
"email"
).
toString
();
const
QString
email
=
job
->
property
(
"email"
).
toString
();
int
handlingJobCount
=
--
mRequestsTracker
[
email
].
handlingJobCount
;
if
(
job
->
error
())
{
...
...
@@ -128,7 +128,7 @@ void DavFreeBusyHandler::onPrincipalSearchJobFinished(KJob *job)
void
DavFreeBusyHandler
::
onRetrieveFreeBusyJobFinished
(
KJob
*
job
)
{
QString
email
=
job
->
property
(
"email"
).
toString
();
const
QString
email
=
job
->
property
(
"email"
).
toString
();
uint
requestId
=
job
->
property
(
"request-id"
).
toUInt
();
int
retrievalJobCount
=
--
mRequestsTracker
[
email
].
retrievalJobCount
;
...
...
@@ -200,7 +200,7 @@ void DavFreeBusyHandler::onRetrieveFreeBusyJobFinished(KJob *job)
return
;
}
QString
rawData
=
calendarDataElement
.
text
();
const
QString
rawData
=
calendarDataElement
.
text
();
KCalendarCore
::
ICalFormat
format
;
KCalendarCore
::
FreeBusy
::
Ptr
fb
=
format
.
parseFreeBusy
(
rawData
);
...
...
resources/dav/resource/setupwizard.cpp
View file @
4e2022eb
...
...
@@ -57,13 +57,13 @@ static QString settingsToUrl(const QWizard *wizard, const QString &protocol)
return
QString
();
}
QString
pathPattern
;
const
QString
pathPropertyName
(
QStringLiteral
(
"X-DavGroupware-"
)
+
protocol
+
QStringLiteral
(
"Path"
));
if
(
service
->
property
(
pathPropertyName
).
isNull
())
{
return
QString
();
}
QString
pathPattern
;
pathPattern
.
append
(
service
->
property
(
pathPropertyName
).
toString
()
+
QLatin1Char
(
'/'
));
QString
username
=
wizard
->
field
(
QStringLiteral
(
"credentialsUserName"
)).
toString
();
...
...
@@ -167,7 +167,7 @@ SetupWizard::Url::List SetupWizard::urls() const
{
Url
::
List
urls
;
QString
desktopFilePath
=
property
(
"providerDesktopFilePath"
).
toString
();
const
QString
desktopFilePath
=
property
(
"providerDesktopFilePath"
).
toString
();
if
(
desktopFilePath
.
isEmpty
())
{
return
urls
;
}
...
...
resources/dav/resource/urlconfigurationdialog.cpp
View file @
4e2022eb
...
...
@@ -38,7 +38,7 @@ UrlConfigurationDialog::UrlConfigurationDialog(QWidget *parent)
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
UrlConfigurationDialog
::
reject
);
mainLayout
->
addWidget
(
buttonBox
);
mModel
=
new
QStandardItemModel
();
mModel
=
new
QStandardItemModel
(
this
);
initModel
();
mUi
.
discoveredUrls
->
setModel
(
mModel
);
...
...
resources/google-groupware/googlesettings.cpp
View file @
4e2022eb
...
...
@@ -17,7 +17,6 @@ using namespace KGAPI2;
static
const
QString
googleWalletFolder
=
QStringLiteral
(
"Akonadi Google"
);
GoogleSettings
::
GoogleSettings
()
:
m_winId
(
0
)
{
m_wallet
=
Wallet
::
openWallet
(
Wallet
::
NetworkWallet
(),
m_winId
,
Wallet
::
Asynchronous
);
if
(
m_wallet
)
{
...
...
resources/google-groupware/googlesettings.h
View file @
4e2022eb
...
...
@@ -55,7 +55,7 @@ private Q_SLOTS:
void
slotWalletOpened
(
bool
success
);
private:
WId
m_winId
;
WId
m_winId
=
0
;
QString
m_resourceId
;
bool
m_isReady
=
false
;
KGAPI2
::
AccountPtr
m_account
;
...
...
resources/imap/passwordrequester.h
View file @
4e2022eb
...
...
@@ -24,6 +24,6 @@ public:
private:
PasswordRequesterInterface
*
requesterImpl
();
PasswordRequesterInterface
*
mImpl
=
nullptr
;
ImapResourceBase
*
mResource
=
nullptr
;
ImapResourceBase
*
const
mResource
;
};
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