aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2018-10-18 16:57:29 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2018-10-18 16:57:29 +0000
commit1ad567e8ed964a39b2b90e5b740536c8861589ca (patch)
tree33f70b78650d981a989cbf8a695f7a755c5585e1 /src
parenta239ae1c9e0b49f911959d0c4066f35f242b4d8e (diff)
downloadqmmp-1ad567e8ed964a39b2b90e5b740536c8861589ca.tar.gz
qmmp-1ad567e8ed964a39b2b90e5b740536c8861589ca.tar.bz2
qmmp-1ad567e8ed964a39b2b90e5b740536c8861589ca.zip
replaced deprecated code
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8393 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
-rw-r--r--src/qmmpui/playlisttask.cpp8
-rw-r--r--src/qmmpui/radioitemdelegate.cpp8
2 files changed, 14 insertions, 2 deletions
diff --git a/src/qmmpui/playlisttask.cpp b/src/qmmpui/playlisttask.cpp
index be7feb3b2..adc37f896 100644
--- a/src/qmmpui/playlisttask.cpp
+++ b/src/qmmpui/playlisttask.cpp
@@ -69,12 +69,20 @@ static bool _numberGreaterComparator(TrackField* s1, TrackField* s2)
//by file creation date
static bool _fileCreationDateLessComparator(TrackField* s1, TrackField* s2)
{
+#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
+ return QFileInfo(s1->value).birthTime() < QFileInfo(s2->value).birthTime();
+#else
return QFileInfo(s1->value).created() < QFileInfo(s2->value).created();
+#endif
}
static bool _fileCreationDateGreaterComparator(TrackField* s1, TrackField* s2)
{
+#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
+ return QFileInfo(s1->value).birthTime() > QFileInfo(s2->value).birthTime();
+#else
return QFileInfo(s1->value).created() > QFileInfo(s2->value).created();
+#endif
}
//by file modification date
static bool _fileModificationDateLessComparator(TrackField* s1, TrackField* s2)
diff --git a/src/qmmpui/radioitemdelegate.cpp b/src/qmmpui/radioitemdelegate.cpp
index 992ba7fe8..2021936e1 100644
--- a/src/qmmpui/radioitemdelegate.cpp
+++ b/src/qmmpui/radioitemdelegate.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2012-2016 by Ilya Kotov *
+ * Copyright (C) 2012-2018 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -102,7 +102,11 @@ bool RadioItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
QModelIndex parentItem = index.parent();
for (int i = 0; i < model->rowCount(parentItem); ++i)
{
- QModelIndex childIndex = parentItem.child(i,0);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
+ QModelIndex childIndex = model->index(i, 0, parentItem);
+#else
+ QModelIndex childIndex = parentItem.child(i, 0);
+#endif
if (childIndex != index)
model->setData(childIndex, Qt::Unchecked, Qt::CheckStateRole);
}