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
KTorrent
Commits
0e891e0b
Commit
0e891e0b
authored
Jun 25, 2021
by
Matt Whitlock
Browse files
adjust to new Priority constants in libktorrent
parent
53599a17
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/infowidget/iwfilelistmodel.cpp
View file @
0e891e0b
...
...
@@ -72,14 +72,16 @@ QVariant IWFileListModel::headerData(int section, Qt::Orientation orientation, i
static
QString
PriorityString
(
const
bt
::
TorrentFileInterface
*
file
)
{
switch
(
file
->
getPriority
())
{
case
FIRST_PREVIEW_PRIORITY
:
case
FIRST_PRIORITY
:
return
i18nc
(
"Download first"
,
"First"
);
case
LAST_PREVIEW_PRIORITY
:
case
LAST_PRIORITY
:
return
i18nc
(
"Download last"
,
"Last"
);
case
ONLY_SEED_PRIORITY
:
case
EXCLUDED
:
case
PREVIEW_PRIORITY
:
return
QString
();
case
NORMAL_PREVIEW_PRIORITY
:
default:
return
i18nc
(
"Download Normal (not as first or last)"
,
"Normal"
);
}
...
...
@@ -96,15 +98,17 @@ QVariant IWFileListModel::data(const QModelIndex &index, int role) const
if
(
role
==
Qt
::
ForegroundRole
&&
index
.
column
()
==
2
&&
tc
->
getStats
().
multi_file_torrent
)
{
const
bt
::
TorrentFileInterface
*
file
=
&
tc
->
getTorrentFile
(
index
.
row
());
switch
(
file
->
getPriority
())
{
case
FIRST_PREVIEW_PRIORITY
:
case
FIRST_PRIORITY
:
return
InfoWidgetPluginSettings
::
firstColor
();
case
LAST_PREVIEW_PRIORITY
:
case
LAST_PRIORITY
:
return
InfoWidgetPluginSettings
::
lastColor
();
case
NORMAL_PREVIEW_PRIORITY
:
case
NORMAL_PRIORITY
:
return
QVariant
();
case
ONLY_SEED_PRIORITY
:
case
EXCLUDED
:
case
PREVIEW_PRIORITY
:
default:
return
QVariant
();
}
...
...
plugins/infowidget/iwfiletreemodel.cpp
View file @
0e891e0b
...
...
@@ -82,14 +82,16 @@ QVariant IWFileTreeModel::headerData(int section, Qt::Orientation orientation, i
static
QString
PriorityString
(
const
bt
::
TorrentFileInterface
*
file
)
{
switch
(
file
->
getPriority
())
{
case
FIRST_PREVIEW_PRIORITY
:
case
FIRST_PRIORITY
:
return
i18nc
(
"Download first"
,
"First"
);
case
LAST_PREVIEW_PRIORITY
:
case
LAST_PRIORITY
:
return
i18nc
(
"Download last"
,
"Last"
);
case
ONLY_SEED_PRIORITY
:
case
EXCLUDED
:
case
PREVIEW_PRIORITY
:
return
QString
();
case
NORMAL_PREVIEW_PRIORITY
:
default:
return
i18nc
(
"Download normally(not as first or last)"
,
"Normal"
);
}
...
...
@@ -107,15 +109,17 @@ QVariant IWFileTreeModel::data(const QModelIndex &index, int role) const
if
(
role
==
Qt
::
ForegroundRole
&&
index
.
column
()
==
2
&&
tc
->
getStats
().
multi_file_torrent
&&
n
->
file
)
{
const
bt
::
TorrentFileInterface
*
file
=
n
->
file
;
switch
(
file
->
getPriority
())
{
case
FIRST_PREVIEW_PRIORITY
:
case
FIRST_PRIORITY
:
return
InfoWidgetPluginSettings
::
firstColor
();
case
LAST_PREVIEW_PRIORITY
:
case
LAST_PRIORITY
:
return
InfoWidgetPluginSettings
::
lastColor
();
case
NORMAL_PREVIEW_PRIORITY
:
case
NORMAL_PRIORITY
:
return
QVariant
();
case
ONLY_SEED_PRIORITY
:
case
EXCLUDED
:
case
PREVIEW_PRIORITY
:
default:
return
QVariant
();
}
...
...
Write
Preview
Markdown
is supported
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