mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-08 11:51:23 -04:00
forward declare context and remove getter error handling
This commit is contained in:
parent
624df21a9c
commit
9fd0a66787
@ -1,7 +1,7 @@
|
|||||||
#include "clipboardbindings.hpp"
|
#include "clipboardbindings.hpp"
|
||||||
|
|
||||||
#include <SDL.h>
|
|
||||||
#include <SDL_clipboard.h>
|
#include <SDL_clipboard.h>
|
||||||
|
#include <SDL_error.h>
|
||||||
|
|
||||||
#include <components/debug/debuglog.hpp>
|
#include <components/debug/debuglog.hpp>
|
||||||
|
|
||||||
@ -17,15 +17,10 @@ namespace MWLua
|
|||||||
api["get"] = []() {
|
api["get"] = []() {
|
||||||
std::string text;
|
std::string text;
|
||||||
|
|
||||||
if (char* raw = SDL_GetClipboardText())
|
char* raw = SDL_GetClipboardText();
|
||||||
{
|
text = raw;
|
||||||
text = raw;
|
|
||||||
SDL_free(raw);
|
SDL_free(raw);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Log(Debug::Error) << "Failed to get clipboard content: " << SDL_GetError();
|
|
||||||
}
|
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
};
|
};
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
#include <sol/forward.hpp>
|
#include <sol/forward.hpp>
|
||||||
|
|
||||||
#include "context.hpp"
|
|
||||||
|
|
||||||
namespace MWLua
|
namespace MWLua
|
||||||
{
|
{
|
||||||
|
struct Context;
|
||||||
|
|
||||||
sol::table initClipboardPackage(const Context&);
|
sol::table initClipboardPackage(const Context&);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user