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
Network
Telepathy Contact Runner
Commits
c87442cc
Commit
c87442cc
authored
Oct 09, 2020
by
Alexander Lohnau
💬
Browse files
Fix some deprecations and warnings
parent
c648c9b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/contactrunner.cpp
View file @
c87442cc
...
...
@@ -61,8 +61,6 @@ ContactRunner::ContactRunner(QObject *parent, const QVariantList &args):
m_presenceModel
(
new
KTp
::
PresenceModel
()),
m_accountsModel
(
new
KTp
::
AccountsListModel
())
{
Q_UNUSED
(
args
);
setObjectName
(
QLatin1String
(
"IM Contacts Runner"
));
m_loggerDisabled
=
QStandardPaths
::
findExecutable
(
QLatin1String
(
"ktp-log-viewer"
)).
isEmpty
();
...
...
@@ -138,7 +136,7 @@ void ContactRunner::init()
Tp
::
AccountManagerPtr
accountManager
=
Tp
::
AccountManager
::
create
(
accountFactory
,
connectionFactory
,
channelFactory
,
contactFactory
);
m_globalPresence
->
addAccountManager
(
accountManager
);
connect
(
m_globalPresence
,
&
KTp
::
GlobalPresence
::
accountManagerReady
,
[
this
]
{
connect
(
m_globalPresence
,
&
KTp
::
GlobalPresence
::
accountManagerReady
,
this
,
[
this
]
{
m_accountsModel
->
setAccountSet
(
m_globalPresence
->
enabledAccounts
());
suspendMatching
(
false
);
});
...
...
@@ -230,7 +228,7 @@ void ContactRunner::run(const Plasma::RunnerContext &context, const Plasma::Quer
KTp
::
Actions
::
startAudioVideoCall
(
account
,
contact
);
}
else
if
(
match
.
selectedAction
()
==
action
(
"start-file-transfer"
))
{
QStringList
filenames
=
QFileDialog
::
getOpenFileNames
(
0
,
const
QStringList
filenames
=
QFileDialog
::
getOpenFileNames
(
0
,
i18n
(
"Choose files to send to %1"
,
contact
->
alias
()),
QStringLiteral
(
"kfiledialog:///FileTransferLastDirectory"
));
...
...
@@ -326,8 +324,8 @@ void ContactRunner::matchContacts(Plasma::RunnerContext &context)
continue
;
}
for
(
const
Tp
::
ContactPtr
&
cont
a
ct
:
account
->
connection
()
->
contactManager
()
->
allKnownContacts
()
)
{
const
auto
cont
e
ct
s
=
account
->
connection
()
->
contactManager
()
->
allKnownContacts
()
;
for
(
const
Tp
::
ContactPtr
&
contact
:
contects
)
{
Plasma
::
QueryMatch
match
(
this
);
qreal
relevance
=
0.1
;
...
...
@@ -359,7 +357,7 @@ void ContactRunner::matchContacts(Plasma::RunnerContext &context)
MatchInfo
data
;
data
.
accountsModelIndex
=
index
;
data
.
contact
=
contact
;
match
.
setData
(
q
Variant
F
romValue
(
data
));
match
.
setData
(
Q
Variant
::
f
romValue
(
data
));
match
.
setText
(
contact
->
alias
()
+
QLatin1String
(
" ("
)
+
account
->
displayName
()
+
')'
);
match
.
setType
(
Plasma
::
QueryMatch
::
ExactMatch
);
...
...
@@ -495,7 +493,7 @@ void ContactRunner::matchPresence(Plasma::RunnerContext &context)
data
.
presence
.
setStatusMessage
(
statusMessage
);
}
match
.
setData
(
q
Variant
F
romValue
(
data
));
match
.
setData
(
Q
Variant
::
f
romValue
(
data
));
context
.
addMatch
(
match
);
};
...
...
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