Fix use of obsolete/deprecated Qt functionality

This commit is contained in:
baldurk
2019-07-10 14:42:54 +01:00
parent 328df29793
commit 6abfb6c790
3 changed files with 31 additions and 31 deletions
@@ -327,7 +327,7 @@ public:
{
if(node->file.lastmod == 0)
return QVariant();
return QDateTime::fromTime_t(node->file.lastmod);
return QDateTime::fromSecsSinceEpoch(node->file.lastmod);
}
default: break;
}
@@ -452,38 +452,38 @@ private:
if(!(node->file.flags & PathProperty::Directory))
return;
Renderer.ListFolder(
makePath(node), true, [node](const rdcstr &path, const rdcarray<PathEntry> &files) {
Renderer.ListFolder(makePath(node), true, [node](const rdcstr &path,
const rdcarray<PathEntry> &files) {
if(files.count() == 1 && (files[0].flags & PathProperty::ErrorAccessDenied))
{
node->file.flags |= PathProperty::ErrorAccessDenied;
return;
}
if(files.count() == 1 && (files[0].flags & PathProperty::ErrorAccessDenied))
{
node->file.flags |= PathProperty::ErrorAccessDenied;
return;
}
QVector<PathEntry> sortedFiles;
sortedFiles.reserve(files.count());
for(const PathEntry &f : files)
sortedFiles.push_back(f);
QVector<PathEntry> sortedFiles;
sortedFiles.reserve(files.count());
for(const PathEntry &f : files)
sortedFiles.push_back(f);
qSort(sortedFiles.begin(), sortedFiles.end(), [](const PathEntry &a, const PathEntry &b) {
// sort greater than so that files with the flag are sorted before those without
if((a.flags & PathProperty::Directory) != (b.flags & PathProperty::Directory))
return (a.flags & PathProperty::Directory) > (b.flags & PathProperty::Directory);
std::sort(sortedFiles.begin(), sortedFiles.end(), [](const PathEntry &a, const PathEntry &b) {
// sort greater than so that files with the flag are sorted before those without
if((a.flags & PathProperty::Directory) != (b.flags & PathProperty::Directory))
return (a.flags & PathProperty::Directory) > (b.flags & PathProperty::Directory);
return strcmp(a.filename.c_str(), b.filename.c_str()) < 0;
});
return strcmp(a.filename.c_str(), b.filename.c_str()) < 0;
});
for(int i = 0; i < sortedFiles.count(); i++)
{
FSNode *child = new FSNode();
child->parent = node;
child->parentIndex = i;
child->file = sortedFiles[i];
child->populated = !(child->file.flags & PathProperty::Directory);
node->children.push_back(child);
}
});
for(int i = 0; i < sortedFiles.count(); i++)
{
FSNode *child = new FSNode();
child->parent = node;
child->parentIndex = i;
child->file = sortedFiles[i];
child->populated = !(child->file.flags & PathProperty::Directory);
node->children.push_back(child);
}
});
}
};
+1 -1
View File
@@ -333,7 +333,7 @@ void LogView::messages_keyPress(QKeyEvent *event)
rows.push_back(idx.row());
}
qSort(rows);
std::sort(rows.begin(), rows.end());
int columns = m_ItemModel->columnCount();
+2 -2
View File
@@ -143,7 +143,7 @@ void TimelineBar::HighlightResourceUsage(ResourceId id)
GUIInvoke::call(this, [this, usage]() {
for(const EventUsage &u : usage)
m_UsageEvents << u;
qSort(m_UsageEvents);
std::sort(m_UsageEvents.begin(), m_UsageEvents.end());
viewport()->update();
});
});
@@ -163,7 +163,7 @@ void TimelineBar::HighlightHistory(ResourceId id, const rdcarray<PixelModificati
for(const PixelModification &mod : history)
m_HistoryEvents << mod;
qSort(m_HistoryEvents);
std::sort(m_HistoryEvents.begin(), m_HistoryEvents.end());
}
viewport()->update();