diff options
| author | Krzysztof Starecki <krzysztof.starecki@gmail.com> | 2018-12-31 20:53:35 +0100 |
|---|---|---|
| committer | Krzysztof Starecki <krzysztof.starecki@gmail.com> | 2018-12-31 20:53:35 +0100 |
| commit | 895556f257c2625ac53371089835aab0d01979be (patch) | |
| tree | daf4d66f4bf2e6e8de93d89810d6e93c8ef4e115 /src | |
| parent | e7c59b26e1c04251c38df038e93990a29ae09808 (diff) | |
Add filetime column to download tab
Diffstat (limited to 'src')
| -rw-r--r-- | src/downloadlist.cpp | 12 | ||||
| -rw-r--r-- | src/downloadlist.h | 3 | ||||
| -rw-r--r-- | src/downloadlistsortproxy.cpp | 4 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 2 | ||||
| -rw-r--r-- | src/mainwindow.ui | 2 |
5 files changed, 14 insertions, 9 deletions
diff --git a/src/downloadlist.cpp b/src/downloadlist.cpp index a0286aef..b21a5306 100644 --- a/src/downloadlist.cpp +++ b/src/downloadlist.cpp @@ -47,7 +47,7 @@ int DownloadList::rowCount(const QModelIndex&) const int DownloadList::columnCount(const QModelIndex&) const
{
- return 3;
+ return 4;
}
@@ -68,10 +68,11 @@ QVariant DownloadList::headerData(int section, Qt::Orientation orientation, int if ((role == Qt::DisplayRole) &&
(orientation == Qt::Horizontal)) {
switch (section) {
- case COL_NAME : return tr("Name");
- case COL_SIZE : return tr("Size");
- case COL_STATUS : return tr("Status");
- default : return QVariant();
+ case COL_NAME: return tr("Name");
+ case COL_SIZE: return tr("Size");
+ case COL_STATUS: return tr("Status");
+ case COL_FILETIME: return tr("Filetime");
+ default: return QVariant();
}
} else {
return QAbstractItemModel::headerData(section, orientation, role);
@@ -93,6 +94,7 @@ QVariant DownloadList::data(const QModelIndex &index, int role) const switch (index.column()) {
case COL_NAME: return m_MetaDisplay ? m_Manager->getDisplayName(index.row()) : m_Manager->getFileName(index.row());
case COL_SIZE: return sizeFormat(m_Manager->getFileSize(index.row()));
+ case COL_FILETIME: return m_Manager->getFileTime(index.row());
case COL_STATUS:
switch (m_Manager->getState(index.row())) {
// STATE_DOWNLOADING handled by DownloadProgressDelegate
diff --git a/src/downloadlist.h b/src/downloadlist.h index a504f209..2c32a397 100644 --- a/src/downloadlist.h +++ b/src/downloadlist.h @@ -39,7 +39,8 @@ public: enum EColumn {
COL_NAME = 0,
COL_STATUS,
- COL_SIZE
+ COL_SIZE,
+ COL_FILETIME
};
public:
diff --git a/src/downloadlistsortproxy.cpp b/src/downloadlistsortproxy.cpp index 1df3a9f1..dc97dc3e 100644 --- a/src/downloadlistsortproxy.cpp +++ b/src/downloadlistsortproxy.cpp @@ -50,8 +50,10 @@ bool DownloadListSortProxy::lessThan(const QModelIndex &left, return m_Manager->getFileTime(left.row()) < m_Manager->getFileTime(right.row());
else
return leftState > rightState;
- } else if(left.column() == DownloadList::COL_SIZE){
+ } else if (left.column() == DownloadList::COL_SIZE) {
return m_Manager->getFileSize(left.row()) < m_Manager->getFileSize(right.row());
+ } else if (left.column() == DownloadList::COL_FILETIME) {
+ return m_Manager->getFileTime(left.row()) < m_Manager->getFileTime(right.row());
} else {
return leftIndex < rightIndex;
}
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 63606833..f913ad0a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -5160,7 +5160,7 @@ void MainWindow::initDownloadView() ui->downloadView->setModel(sortProxy);
ui->downloadView->setManager(m_OrganizerCore.downloadManager());
ui->downloadView->setItemDelegate(new DownloadProgressDelegate(m_OrganizerCore.downloadManager(), sortProxy, ui->downloadView));
- ui->downloadView->setUniformRowHeights(true);
+ ui->downloadView->setUniformRowHeights(false);
ui->downloadView->header()->setStretchLastSection(false);
ui->downloadView->header()->setSectionResizeMode(QHeaderView::Interactive);
ui->downloadView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 771832fd..ba4b8d63 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -1365,7 +1365,7 @@ p, li { white-space: pre-wrap; } <number>15</number>
</attribute>
<attribute name="headerStretchLastSection">
- <bool>true</bool>
+ <bool>false</bool>
</attribute>
</widget>
</item>
|
