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
Akonadi
Commits
7156605d
Commit
7156605d
authored
Aug 12, 2021
by
Laurent Montel
😁
Browse files
Const'ify variable + initialize variable in header
parent
f6e008cb
Pipeline
#74371
passed with stage
in 11 minutes and 11 seconds
Changes
15
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
autotests/libs/testsearchplugin/testsearchplugin.cpp
View file @
7156605d
...
...
@@ -22,7 +22,7 @@ QSet<qint64> TestSearchPlugin::search(const QString &query, const QVector<qint64
QSet
<
qint64
>
TestSearchPlugin
::
parseQuery
(
const
QString
&
queryString
)
{
QSet
<
qint64
>
resultSet
;
Akonadi
::
SearchQuery
query
=
Akonadi
::
SearchQuery
::
fromJSON
(
queryString
.
toLatin1
());
const
Akonadi
::
SearchQuery
query
=
Akonadi
::
SearchQuery
::
fromJSON
(
queryString
.
toLatin1
());
const
QList
<
Akonadi
::
SearchTerm
>
subTerms
=
query
.
term
().
subTerms
();
for
(
const
Akonadi
::
SearchTerm
&
term
:
subTerms
)
{
if
(
term
.
key
()
==
QLatin1String
(
"plugin"
))
{
...
...
src/akonadictl/main.cpp
View file @
7156605d
...
...
@@ -86,7 +86,7 @@ static bool checkSearchSupportStatus()
}
else
{
const
QStringList
dirs
=
QCoreApplication
::
libraryPaths
();
for
(
const
QString
&
pluginDir
:
dirs
)
{
QDir
dir
(
pluginDir
+
QLatin1String
(
"/akonadi/"
));
const
QDir
dir
(
pluginDir
+
QLatin1String
(
"/akonadi/"
));
const
QStringList
pluginFiles
=
dir
.
entryList
(
QDir
::
Files
);
for
(
const
QString
&
pluginFileName
:
pluginFiles
)
{
QPluginLoader
loader
(
dir
.
absolutePath
()
+
QLatin1Char
(
'/'
)
+
pluginFileName
);
...
...
@@ -112,7 +112,7 @@ static bool checkAvailableAgentTypes()
const
auto
dirs
=
Akonadi
::
StandardDirs
::
locateAllResourceDirs
(
QStringLiteral
(
"akonadi/agents"
));
QStringList
types
;
for
(
const
QString
&
pluginDir
:
dirs
)
{
QDir
dir
(
pluginDir
);
const
QDir
dir
(
pluginDir
);
const
QStringList
plugins
=
dir
.
entryList
(
QStringList
()
<<
QStringLiteral
(
"*.desktop"
),
QDir
::
Files
);
for
(
const
QString
&
plugin
:
plugins
)
{
QSettings
pluginInfo
(
pluginDir
+
QLatin1Char
(
'/'
)
+
plugin
,
QSettings
::
IniFormat
);
...
...
src/core/agentconfigurationbase.cpp
View file @
7156605d
...
...
@@ -31,7 +31,7 @@ public:
KSharedConfigPtr
config
;
QString
identifier
;
QScopedPointer
<
KAboutData
>
aboutData
;
QWidget
*
parentWidget
=
nullptr
;
QWidget
*
const
parentWidget
;
};
}
// namespace Akonadi
...
...
src/core/braveheart.cpp
View file @
7156605d
...
...
@@ -13,8 +13,11 @@
#include
<QTimer>
#include
<QVariant>
#include
<chrono>
#include
<malloc.h>
using
namespace
std
::
chrono_literals
;
namespace
Akonadi
{
class
Braveheart
...
...
@@ -35,7 +38,7 @@ private:
malloc_trim
(
50
*
1024
*
1024
);
});
// Fight for freedom every 15 minutes
freedom
->
start
(
15
*
60
*
1000
);
freedom
->
start
(
15
min
);
qApp
->
setProperty
(
"__Akonadi__Braveheart"
,
true
);
}
...
...
src/core/collectionpathresolver.cpp
View file @
7156605d
...
...
@@ -24,7 +24,6 @@ class Akonadi::CollectionPathResolverPrivate : public JobPrivate
public:
explicit
CollectionPathResolverPrivate
(
CollectionPathResolver
*
parent
)
:
JobPrivate
(
parent
)
,
mColId
(
-
1
)
{
}
...
...
@@ -78,7 +77,7 @@ public:
Collection
mCurrentNode
;
QStringList
mPathParts
;
QString
mPath
;
Collection
::
Id
mColId
;
Collection
::
Id
mColId
=
-
1
;
bool
mPathToId
=
false
;
};
...
...
src/core/jobs/agentinstancecreatejob.cpp
View file @
7156605d
...
...
@@ -165,7 +165,7 @@ void AgentInstanceCreateJobPrivate::doStart()
int
timeout
=
safetyTimeout
;
#ifdef Q_OS_UNIX
// Increate the timeout when valgrinding the agent, because that slows down things a log.
QString
agentValgrind
=
QString
::
fromLocal8Bit
(
qgetenv
(
"AKONADI_VALGRIND"
));
const
QString
agentValgrind
=
QString
::
fromLocal8Bit
(
qgetenv
(
"AKONADI_VALGRIND"
));
if
(
!
agentValgrind
.
isEmpty
()
&&
agentType
.
identifier
().
contains
(
agentValgrind
))
{
timeout
*=
15
;
}
...
...
src/core/jobs/specialcollectionshelperjobs.cpp
View file @
7156605d
...
...
@@ -53,7 +53,7 @@ static QString defaultResourceId(KCoreConfigSkeleton *settings)
static
QString
dbusServiceName
()
{
QString
service
=
QStringLiteral
(
"org.kde.pim.SpecialCollections"
);
const
QString
service
=
QStringLiteral
(
"org.kde.pim.SpecialCollections"
);
if
(
ServerManager
::
hasInstanceIdentifier
())
{
return
service
+
ServerManager
::
instanceIdentifier
();
}
...
...
src/core/jobs/specialcollectionsrequestjob.cpp
View file @
7156605d
...
...
@@ -36,14 +36,14 @@ public:
SpecialCollectionsRequestJob
*
const
q
;
SpecialCollections
*
mSpecialCollections
=
nullptr
;
int
mPendingCreateJobs
;
int
mPendingCreateJobs
=
0
;
QByteArray
mRequestedType
;
AgentInstance
mRequestedResource
;
// Input:
QHash
<
QByteArray
,
bool
>
mDefaultFolders
;
bool
mRequestingDefaultFolders
;
bool
mRequestingDefaultFolders
=
false
;
QHash
<
QString
,
QHash
<
QByteArray
,
bool
>>
mFoldersForResource
;
QString
mDefaultResourceType
;
QVariantMap
mDefaultResourceOptions
;
...
...
@@ -59,8 +59,6 @@ public:
SpecialCollectionsRequestJobPrivate
::
SpecialCollectionsRequestJobPrivate
(
SpecialCollections
*
collections
,
SpecialCollectionsRequestJob
*
qq
)
:
q
(
qq
)
,
mSpecialCollections
(
collections
)
,
mPendingCreateJobs
(
0
)
,
mRequestingDefaultFolders
(
false
)
{
}
...
...
src/core/jobs/tagfetchjob.cpp
View file @
7156605d
...
...
@@ -12,7 +12,7 @@
#include
<QTimer>
using
namespace
Akonadi
;
using
namespace
std
::
chrono_literals
;
class
Akonadi
::
TagFetchJobPrivate
:
public
JobPrivate
{
public:
...
...
@@ -26,7 +26,7 @@ public:
Q_Q
(
TagFetchJob
);
mEmitTimer
=
new
QTimer
(
q
);
mEmitTimer
->
setSingleShot
(
true
);
mEmitTimer
->
setInterval
(
100
);
mEmitTimer
->
setInterval
(
100
ms
);
q
->
connect
(
mEmitTimer
,
&
QTimer
::
timeout
,
q
,
[
this
]()
{
timeout
();
});
...
...
@@ -156,3 +156,6 @@ Tag::List TagFetchJob::tags() const
}
#include
"moc_tagfetchjob.cpp"
#include
<chrono>
using
namespace
std
::
chrono_literals
;
src/core/mimetypechecker.cpp
View file @
7156605d
...
...
@@ -14,8 +14,8 @@
using
namespace
Akonadi
;
MimeTypeChecker
::
MimeTypeChecker
()
:
d
(
new
MimeTypeCheckerPrivate
())
{
d
=
new
MimeTypeCheckerPrivate
();
}
MimeTypeChecker
::
MimeTypeChecker
(
const
MimeTypeChecker
&
other
)
...
...
src/core/models/entityorderproxymodel.cpp
View file @
7156605d
...
...
@@ -104,7 +104,7 @@ QStringList EntityOrderProxyModel::configStringsForDroppedUrls(const QList<QUrl>
QStringList
droppedList
;
droppedList
.
reserve
(
urls
.
count
());
for
(
const
QUrl
&
url
:
urls
)
{
Collection
col
=
Collection
::
fromUrl
(
url
);
const
Collection
col
=
Collection
::
fromUrl
(
url
);
if
(
!
col
.
isValid
())
{
Item
item
=
Item
::
fromUrl
(
url
);
...
...
src/core/models/recursivecollectionfilterproxymodel.cpp
View file @
7156605d
...
...
@@ -18,7 +18,7 @@ namespace Akonadi
class
RecursiveCollectionFilterProxyModelPrivate
{
Q_DECLARE_PUBLIC
(
RecursiveCollectionFilterProxyModel
)
RecursiveCollectionFilterProxyModel
*
q_ptr
;
RecursiveCollectionFilterProxyModel
*
const
q_ptr
;
public:
explicit
RecursiveCollectionFilterProxyModelPrivate
(
RecursiveCollectionFilterProxyModel
*
model
)
...
...
src/core/models/selectionproxymodel.cpp
View file @
7156605d
...
...
@@ -54,7 +54,7 @@ public:
}
Q_DECLARE_PUBLIC
(
SelectionProxyModel
)
SelectionProxyModel
*
q_ptr
;
SelectionProxyModel
*
const
q_ptr
;
};
}
// namespace Akonadi
...
...
src/core/monitor_p.cpp
View file @
7156605d
...
...
@@ -40,11 +40,8 @@ MonitorPrivate::MonitorPrivate(ChangeNotificationDependenciesFactory *dependenci
,
mFetchChangedOnly
(
false
)
,
session
(
Session
::
defaultSession
())
,
collectionCache
(
nullptr
)
,
itemCache
(
nullptr
)
,
tagCache
(
nullptr
)
,
mCommandBuffer
(
parent
,
"handleCommands"
)
,
pendingModificationChanges
(
Protocol
::
ModifySubscriptionCommand
::
None
)
,
pendingModificationTimer
(
nullptr
)
,
monitorReady
(
false
)
,
fetchCollection
(
false
)
,
fetchCollectionStatistics
(
false
)
...
...
src/core/monitor_p.h
View file @
7156605d
...
...
@@ -104,8 +104,8 @@ public:
Protocol
::
ModifySubscriptionCommand
::
ModifiedParts
pendingModificationChanges
;
Protocol
::
ModifySubscriptionCommand
pendingModification
;
QTimer
*
pendingModificationTimer
;
bool
monitorReady
;
QTimer
*
pendingModificationTimer
=
nullptr
;
bool
monitorReady
=
false
;
// The waiting list
QQueue
<
Protocol
::
ChangeNotificationPtr
>
pendingNotifications
;
...
...
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