rework mime types, support pasting file lists, SIP when dropping single files
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Failing after 5m18s
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Failing after 6m48s
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Failing after 6m37s
ContinuousIntegration / linux (push) Successful in 4m29s
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Failing after 6m16s
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Failing after 6m6s
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Failing after 5m18s
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Failing after 6m48s
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Failing after 6m37s
ContinuousIntegration / linux (push) Successful in 4m29s
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Failing after 6m16s
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Failing after 6m6s
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <memory>
|
||||
#include <cmath>
|
||||
#include <string_view>
|
||||
|
||||
MainScreen::MainScreen(SimpleConfigModel&& conf_, SDL_Renderer* renderer_, Theme& theme_, std::string save_path, std::string save_password, std::string new_username, std::vector<std::string> plugins) :
|
||||
renderer(renderer_),
|
||||
@@ -143,10 +144,11 @@ MainScreen::~MainScreen(void) {
|
||||
bool MainScreen::handleEvent(SDL_Event& e) {
|
||||
if (e.type == SDL_EVENT_DROP_FILE) {
|
||||
std::cout << "DROP FILE: " << e.drop.data << "\n";
|
||||
cg.sendFilePath(e.drop.data);
|
||||
_dopped_files.emplace_back(e.drop.data);
|
||||
//cg.sendFilePath(e.drop.data);
|
||||
_render_interval = 1.f/60.f; // TODO: magic
|
||||
_time_since_event = 0.f;
|
||||
return true; // TODO: forward return succ from sendFilePath()
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -482,6 +484,17 @@ Screen* MainScreen::tick(float time_delta, bool& quit) {
|
||||
|
||||
mts.iterate(); // compute (after mfs)
|
||||
|
||||
if (!_dopped_files.empty()) {
|
||||
std::vector<std::string_view> tmp_view;
|
||||
for (const std::string& it : _dopped_files) {
|
||||
tmp_view.push_back(std::string_view{it});
|
||||
}
|
||||
|
||||
cg.sendFileList(tmp_view);
|
||||
|
||||
_dopped_files.clear();
|
||||
}
|
||||
|
||||
_min_tick_interval = std::min<float>(
|
||||
// HACK: pow by 1.6 to increase 50 -> ~500 (~522)
|
||||
// and it does not change 1
|
||||
|
Reference in New Issue
Block a user