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
KMail Account Wizard
Commits
6c10c8f5
Commit
6c10c8f5
authored
Jan 18, 2021
by
Laurent Montel
😁
Browse files
make it compiles without deprecated method
parent
d227003d
Pipeline
#48073
failed with stage
in 11 minutes and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/providerpage.cpp
View file @
6c10c8f5
...
...
@@ -16,10 +16,12 @@
ProviderPage
::
ProviderPage
(
KAssistantDialog
*
parent
)
:
Page
(
parent
)
,
m_model
(
new
QStandardItemModel
(
this
))
,
m_
downloadManager
(
new
KNSCore
::
DownloadManager
(
this
))
,
m_
engine
(
new
KNSCore
::
Engine
(
this
))
{
ui
.
setupUi
(
this
);
const
QString
name
=
QCoreApplication
::
applicationName
()
+
QStringLiteral
(
".knsrc"
);
m_engine
->
init
(
name
);
mProxy
=
new
QSortFilterProxyModel
(
this
);
mProxy
->
setSourceModel
(
m_model
);
mProxy
->
setFilterKeyColumn
(
-
1
);
...
...
@@ -32,16 +34,20 @@ ProviderPage::ProviderPage(KAssistantDialog *parent)
// we can start the search, whenever the user reaches this page, chances
// are we have the full list.
connect
(
m_downloadManager
,
&
KNSCore
::
DownloadManager
::
searchResult
,
this
,
&
ProviderPage
::
fillModel
);
connect
(
m_downloadManager
,
&
KNSCore
::
DownloadManager
::
entryStatusChanged
,
this
,
&
ProviderPage
::
providerStatusChanged
);
m_downloadManager
->
setSearchOrder
(
KNSCore
::
DownloadManager
::
Alphabetical
);
connect
(
m_engine
,
&
KNSCore
::
Engine
::
signalUpdateableEntriesLoaded
,
this
,
&
ProviderPage
::
fillModel
);
connect
(
m_engine
,
&
KNSCore
::
Engine
::
signalEntryEvent
,
this
,
[
this
](
const
KNSCore
::
EntryInternal
&
entry
,
KNSCore
::
EntryInternal
::
EntryEvent
event
)
{
if
(
event
==
KNSCore
::
EntryInternal
::
StatusChangedEvent
)
{
providerStatusChanged
(
entry
);
}
});
m_engine
->
setSortMode
(
KNSCore
::
Provider
::
Alphabetical
);
connect
(
ui
.
listView
->
selectionModel
(),
&
QItemSelectionModel
::
selectionChanged
,
this
,
&
ProviderPage
::
selectionChanged
);
}
void
ProviderPage
::
startFetchingData
()
{
m_
downloadManager
->
search
(
0
,
100000
);
m_
engine
->
requestData
(
0
,
100000
);
}
void
ProviderPage
::
slotTextChanged
(
const
QString
&
str
)
...
...
@@ -108,7 +114,7 @@ void ProviderPage::leavePageNext()
findDesktopAndSetAssistant
(
e
.
installedFiles
());
}
else
{
qCDebug
(
ACCOUNTWIZARD_LOG
)
<<
"Starting download for "
<<
e
.
name
();
m_
downloadManager
->
install
Entry
(
e
);
m_
engine
->
install
(
e
);
}
break
;
...
...
src/providerpage.h
View file @
6c10c8f5
...
...
@@ -12,15 +12,12 @@
#include <QStandardItemModel>
#include "ui_providerpage.h"
#include <KNSCore/
DownloadManager
>
#include <KNSCore/
Engine
>
struct
Provider
{
QString
entryId
;
QString
entryProviderId
;
};
class
QSortFilterProxyModel
;
namespace
KNSCore
{
class
DownloadManager
;
}
class
ProviderPage
:
public
Page
{
...
...
@@ -51,7 +48,7 @@ private:
Ui
::
ProviderPage
ui
;
QStandardItemModel
*
m_model
=
nullptr
;
QStandardItem
*
m_fetchItem
=
nullptr
;
KNSCore
::
DownloadManager
*
m_downloadManager
=
nullptr
;
KNSCore
::
Engine
*
m_engine
=
nullptr
;
QSortFilterProxyModel
*
mProxy
;
KNSCore
::
EntryInternal
::
List
m_providerEntries
;
Provider
m_wantedProvider
;
...
...
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