|
|
|
|
@ -6,7 +6,6 @@
|
|
|
|
|
#include "core/game_list.h"
|
|
|
|
|
#include "core/system.h"
|
|
|
|
|
|
|
|
|
|
#include "common/byte_stream.h"
|
|
|
|
|
#include "common/log.h"
|
|
|
|
|
|
|
|
|
|
#include <QtCore/QCoreApplication>
|
|
|
|
|
@ -146,27 +145,6 @@ void ResizeColumnsForTreeView(QTreeView* view, const std::initializer_list<int>&
|
|
|
|
|
ResizeColumnsForView(view, widths);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QByteArray ReadStreamToQByteArray(ByteStream* stream, bool rewind /*= false*/)
|
|
|
|
|
{
|
|
|
|
|
QByteArray ret;
|
|
|
|
|
const u64 old_pos = stream->GetPosition();
|
|
|
|
|
if (rewind && !stream->SeekAbsolute(0))
|
|
|
|
|
return {};
|
|
|
|
|
|
|
|
|
|
const u64 stream_size = stream->GetSize() - stream->GetPosition();
|
|
|
|
|
ret.resize(static_cast<int>(stream_size));
|
|
|
|
|
if (stream_size > 0 && !stream->Read2(ret.data(), static_cast<u32>(stream_size), nullptr))
|
|
|
|
|
return {};
|
|
|
|
|
|
|
|
|
|
stream->SeekAbsolute(old_pos);
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool WriteQByteArrayToStream(QByteArray& arr, ByteStream* stream)
|
|
|
|
|
{
|
|
|
|
|
return arr.isEmpty() || stream->Write2(arr.data(), static_cast<u32>(arr.size()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OpenURL(QWidget* parent, const QUrl& qurl)
|
|
|
|
|
{
|
|
|
|
|
if (!QDesktopServices::openUrl(qurl))
|
|
|
|
|
|