Am 18.12.2013 01:13, schrieb Thomas Arp:
Am 18.12.2013 00:49, schrieb John Paul Adrian Glaubitz:And I made a stupid mistake. I forgot to push a previous contribution made by Howard Chu [1] and also tagging version 0.9.10. Could you rebase your patches against the github repository for linux-minidisc until I have fixed our main repository? Sorry for the confusion and thanks for the patches! Cheers, AdrianI took a quick look at it,The contribution by Howard Chu depends on files that will be deleted in my patches (code movement to other files).My pathes can be applied anyway but Howards changes will be deleted.I think the easiest way is that i make another patch that intergates this into my new files/classes.Else i have to rebuild my patch manually to integrate it.
O.K., i made an additional patch which includes Howards changes. I also initialized QTime and QDate objects for Qt5 support. Thomas
>From beda8dbbfd207d660f9f19f3dd2eb040cfdf56f0 Mon Sep 17 00:00:00 2001 From: Thomas Arp <manner.moe@gmx.de> Date: Wed, 18 Dec 2013 02:09:38 +0100 Subject: [PATCH 8/8] Added missing patch by Howard Chu: Add column in trackview to display recording date and time (updated for Qt5 support) --- qhimdtransfer/qmdmodel.cpp | 13 +++++++++++-- qhimdtransfer/qmdtrack.cpp | 17 +++++++++++++++++ qhimdtransfer/qmdtrack.h | 1 + 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/qhimdtransfer/qmdmodel.cpp b/qhimdtransfer/qmdmodel.cpp index 48ff275..890d51f 100644 --- a/qhimdtransfer/qmdmodel.cpp +++ b/qhimdtransfer/qmdmodel.cpp @@ -3,8 +3,8 @@ #include <qmdmodel.h> enum hcolumnum { - ColId, ColTitle, ColArtist, ColAlbum, ColLength, ColCodec, ColUploadable, - LAST_hcolumnnum = ColUploadable + ColId, ColTitle, ColArtist, ColAlbum, ColLength, ColCodec, ColUploadable, ColRecDate, + LAST_hcolumnnum = ColRecDate }; enum ncolumnum { @@ -205,6 +205,8 @@ QVariant QHiMDTracksModel::headerData(int section, Qt::Orientation orientation, /* Really use the header for the metric in these columns, contents will be shorter */ return QAbstractListModel::headerData(section,orientation,role); + case ColRecDate: + return QSize(met.width("yyyy.MM.dd hh:mm:ss"), 0); } } @@ -226,6 +228,8 @@ QVariant QHiMDTracksModel::headerData(int section, Qt::Orientation orientation, return tr("Format"); case ColUploadable: return tr("Uploadable"); + case ColRecDate: + return tr("Recorded At"); } } return QVariant(); @@ -269,6 +273,11 @@ QVariant QHiMDTracksModel::data(const QModelIndex & index, int role) const return track.codecname(); case ColUploadable: return QVariant(); /* Displayed by checkbox */ + case ColRecDate: + { + QDateTime dt = track.recdate(); + return dt.toString("yyyy.MM.dd hh:mm:ss"); + } } } return QVariant(); diff --git a/qhimdtransfer/qmdtrack.cpp b/qhimdtransfer/qmdtrack.cpp index 9ecca74..3d6bf1f 100644 --- a/qhimdtransfer/qmdtrack.cpp +++ b/qhimdtransfer/qmdtrack.cpp @@ -74,6 +74,23 @@ QTime QHiMDTrack::duration() const return QTime(); } +QDateTime QHiMDTrack::recdate() const +{ + QDate d(0,0,0); + QTime t(0,0,0); + if (trackslot != 0) + { + t.setHMS(ti.recordingtime.tm_hour, + ti.recordingtime.tm_min, + ti.recordingtime.tm_sec); + d.setDate(ti.recordingtime.tm_year+1900, + ti.recordingtime.tm_mon+1, + ti.recordingtime.tm_mday); + return QDateTime(d,t); + } + return QDateTime(); +} + bool QHiMDTrack::copyprotected() const { if(trackslot != 0) diff --git a/qhimdtransfer/qmdtrack.h b/qhimdtransfer/qmdtrack.h index ac47a9f..629448f 100644 --- a/qhimdtransfer/qmdtrack.h +++ b/qhimdtransfer/qmdtrack.h @@ -49,6 +49,7 @@ public: virtual QString album() const; virtual QString codecname() const; virtual QTime duration() const; + QDateTime recdate() const; virtual bool copyprotected() const; virtual int blockcount() const; -- 1.8.4.msysgit.0