mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-18 10:58:33 -05:00
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.
26 lines
539 B
C++
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;
|
|
}
|