mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-14 20:55:46 -04:00
Misc: Purge remaining ByteStream references
This commit is contained in:
@ -25,7 +25,6 @@
|
||||
#include "core/system.h"
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/byte_stream.h"
|
||||
#include "common/crash_handler.h"
|
||||
#include "common/error.h"
|
||||
#include "common/file_system.h"
|
||||
|
@ -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))
|
||||
|
@ -77,12 +77,6 @@ void ResizeColumnsForTreeView(QTreeView* view, const std::initializer_list<int>&
|
||||
/// NOTE: Defined in QtKeyCodes.cpp, not QtUtils.cpp.
|
||||
u32 KeyEventToCode(const QKeyEvent* ev);
|
||||
|
||||
/// Reads a whole stream to a Qt byte array.
|
||||
QByteArray ReadStreamToQByteArray(ByteStream* stream, bool rewind = false);
|
||||
|
||||
/// Creates a stream from a Qt byte array.
|
||||
bool WriteQByteArrayToStream(QByteArray& arr, ByteStream* stream);
|
||||
|
||||
/// Opens a URL with the default handler.
|
||||
void OpenURL(QWidget* parent, const QUrl& qurl);
|
||||
|
||||
|
Reference in New Issue
Block a user