Files
MuditaOS/module-utils/Clipboard/Clipboard.cpp
Lefucjusz cf6c377776 [MOS-1028] Fix possibility to copy text from empty note
Fix of the issue that in Notes app 'Copy text'
option was shown in 'Options' menu even if
the note didn't contain any text.
2023-08-31 15:56:07 +02:00

26 lines
539 B
C++

// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "Clipboard.hpp"
cpp_freertos::MutexStandard Clipboard::mutex;
Clipboard &Clipboard::getInstance()
{
static Clipboard clipboard;
return clipboard;
}
void Clipboard::copy(const std::string &newData)
{
cpp_freertos::LockGuard lock(mutex);
data = newData;
validData = true;
}
std::string Clipboard::paste()
{
cpp_freertos::LockGuard lock(mutex);
return data;
}