diff options
Diffstat (limited to 'lumina-fm/widgets/DirWidget.h')
-rw-r--r-- | lumina-fm/widgets/DirWidget.h | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/lumina-fm/widgets/DirWidget.h b/lumina-fm/widgets/DirWidget.h index 514b3e7f..adf349a9 100644 --- a/lumina-fm/widgets/DirWidget.h +++ b/lumina-fm/widgets/DirWidget.h @@ -52,6 +52,10 @@ public: void setDetails(QList<DETAILTYPES> list); //Which details to show and in which order (L->R) void setThumbnailSize(int px); void setShowCloseButton(bool show); + + //Date format for show items + QStringList getDateFormat(); + void setDateFormat(); public slots: void LoadDir(QString dir, LFileInfoList list); @@ -94,6 +98,7 @@ private: //Functions for internal use void setupConnections(); QStringList currentSelection(); + QStringList date_format; private slots: //UI BUTTONS/Actions @@ -132,7 +137,7 @@ private slots: //Browser Functions void OpenContextMenu(); void SelectionChanged(); - void startSync(); //used internally to collect/pause before updating the dir + void startSync(const QString &file); //used internally to collect/pause before updating the dir signals: //Directory loading/finding signals @@ -180,22 +185,8 @@ public: inline virtual bool operator<(const QTreeWidgetItem &tmp) const { int column = this->treeWidget()->sortColumn(); // We are in date text - if(column == DirWidget::DATEMOD || column == DirWidget::DATECREATE) { - // Get the stored text and try to convert to QDateTime - QString text = this->text(column); - QString text_tmp = tmp.text(column); - QDateTime date_time = QDateTime::fromString(text, Qt::DefaultLocaleShortDate); - QDateTime date_time_tmp = QDateTime::fromString(text_tmp, Qt::DefaultLocaleShortDate); - // If the conversion are ok in both objects, compare them - if(date_time.isValid() && date_time_tmp.isValid()) - return date_time < date_time_tmp; - // If some of the dates are invalid, use the base class implementation (order by string) - else { - if(DEBUG) - qDebug() << "Cannot convert the date. Texts arrived are " << text << " and " << text_tmp; - return QTreeWidgetItem::operator <(tmp); - } - } + if(column == DirWidget::DATEMOD || column == DirWidget::DATECREATE) + return this->whatsThis(column) < tmp.whatsThis(column); // We are in size text else if(column == DirWidget::SIZE) { QString text = this->text(column); |