mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
This reverts commit 141bba0464
.
This commit is contained in:
parent
c2db12c727
commit
1493533345
@ -45,7 +45,6 @@
|
||||
#include <QDropEvent>
|
||||
#include <QtConcurrentRun>
|
||||
#include <QtNetwork>
|
||||
#include <QFile>
|
||||
|
||||
#include "ui_qt.h"
|
||||
#include "qt/gridview.h"
|
||||
@ -83,7 +82,6 @@ extern "C" {
|
||||
#include "../../command.h"
|
||||
#include "../ui_companion_driver.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../encodings/crc32.h"
|
||||
#include "../../frontend/frontend.h"
|
||||
#include "../../frontend/frontend_driver.h"
|
||||
#include "../../file_path_special.h"
|
||||
@ -2601,7 +2599,7 @@ void MainWindow::onFileDoubleClicked(const QModelIndex &proxyIndex)
|
||||
if (m_fileModel->isDir(index))
|
||||
m_dirTree->setCurrentIndex(m_dirModel->index(m_fileModel->filePath(index)));
|
||||
else
|
||||
loadContent(getFileContentHashWithCRC32(index));
|
||||
loadContent(getFileContentHash(index));
|
||||
}
|
||||
|
||||
void MainWindow::selectBrowserDir(QString path)
|
||||
@ -2672,29 +2670,6 @@ QHash<QString, QString> MainWindow::getFileContentHash(const QModelIndex &index)
|
||||
return hash;
|
||||
}
|
||||
|
||||
QHash<QString, QString> MainWindow::getFileContentHashWithCRC32(const QModelIndex &index)
|
||||
{
|
||||
QHash<QString, QString> hash = getFileContentHash(index);
|
||||
hash["crc32"] = getFileCRC32(hash["path"]);
|
||||
return hash;
|
||||
}
|
||||
|
||||
QString MainWindow::getFileCRC32(const QString &path)
|
||||
{
|
||||
QString crc32;
|
||||
QFile file(path);
|
||||
if (file.exists() && file.open(QIODevice::ReadOnly)) {
|
||||
const QByteArray buf = file.readAll();
|
||||
file.close();
|
||||
crc32 = QString::number(encoding_crc32(0, (const uint8_t *) buf.data(), buf.size()), 16).toUpper();
|
||||
while (crc32.length() < 8) {
|
||||
crc32 = crc32.prepend('0');
|
||||
}
|
||||
}
|
||||
|
||||
return crc32;
|
||||
}
|
||||
|
||||
void MainWindow::onContentItemDoubleClicked(const QModelIndex &index)
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
@ -2958,7 +2933,7 @@ void MainWindow::onRunClicked()
|
||||
switch (m_currentBrowser)
|
||||
{
|
||||
case BROWSER_TYPE_FILES:
|
||||
contentHash = getFileContentHashWithCRC32(
|
||||
contentHash = getFileContentHash(
|
||||
m_proxyFileModel->mapToSource(m_fileTableView->currentIndex()));
|
||||
break;
|
||||
case BROWSER_TYPE_PLAYLISTS:
|
||||
|
@ -398,8 +398,6 @@ public:
|
||||
QModelIndex getCurrentContentIndex();
|
||||
QHash<QString, QString> getCurrentContentHash();
|
||||
QHash<QString, QString> getFileContentHash(const QModelIndex &index);
|
||||
QHash<QString, QString> getFileContentHashWithCRC32(const QModelIndex &index);
|
||||
QString getFileCRC32(const QString &path);
|
||||
static double lerp(double x, double y, double a, double b, double d);
|
||||
QString getSpecialPlaylistPath(SpecialPlaylist playlist);
|
||||
QVector<QPair<QString, QString> > getPlaylists();
|
||||
|
Loading…
Reference in New Issue
Block a user