Revision 1788 trunk/client/gui_qt/DownloadQueueItem.cpp

DownloadQueueItem.cpp (revision 1788)
1
#include 
1 2
#include "DownloadQueueItem.h"
2 3

                
3 4
DownloadQueueItem::DownloadQueueItem(DownloadQueueItem *parent)
... ...
75 76
            return sizeRemainingStr;
76 77

                
77 78
        case FIELD_STAMP:
78
            return stamp;
79
        {
80
            char stamp_str[32];
81
            struct tm *stamp_tm;
82
            time_t stamp_time_t;
79 83

                
84
            memset(&stamp_str, 0, sizeof(stamp_str));
85
            stamp_time_t = stamp.toTime_t();
86
            if ((stamp_tm = localtime(&stamp_time_t)) == NULL) {
87
                /* Date could not be parsed */
88
                return stamp.toString();
89
            }
90

                
91
            if (strftime(stamp_str, sizeof(stamp_str) - 1, "%c", stamp_tm) == 0) {
92
                qWarning(__FILE__ ":%i buffer too small", __LINE__);
93
            }
94

                
95
            return QString(stamp_str);
96
        }
97

                
80 98
        case FIELD_ESTIMATED_TIME_REMAINING_STR:
81 99
            return estimatedTimeRemainingStr;
82 100

                
... ...
124 142

                
125 143
    return NULL;
126 144
}
145

                
146
int DownloadQueueItem::rowOfChild(DownloadQueueItem *child) const
147
{
148
    return childItems.indexOf(child);
149
}

Also available in: Unified diff