diff options
| author | 2021-11-10 00:54:35 -0500 | |
|---|---|---|
| committer | 2021-11-10 00:54:35 -0500 | |
| commit | 58fb7a0cee13d84170aac52f3f89d91888e1afe3 (patch) | |
| tree | 1d6312ba15f9ece5a8031e5280dfb8b38be8dfa3 /src/lib/barrier/App.cpp | |
| parent | 28db84b46139c9bb2bbcac8c6cc56e71d1e35629 (diff) | |
| parent | beb08eb751fa8e1f72042f263316ab5e5ddb596d (diff) | |
Update upstream source from tag 'upstream/2.4.0+dfsg'
Update to upstream version '2.4.0+dfsg'
with Debian dir 4b6668cc08c7b0e56b1e1f7b4e89ecdb316182a0
Diffstat (limited to 'src/lib/barrier/App.cpp')
| -rw-r--r-- | src/lib/barrier/App.cpp | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/lib/barrier/App.cpp b/src/lib/barrier/App.cpp index 8a79aa2..2b3eccc 100644 --- a/src/lib/barrier/App.cpp +++ b/src/lib/barrier/App.cpp @@ -2,11 +2,11 @@ * barrier -- mouse and keyboard sharing utility * Copyright (C) 2012-2016 Symless Ltd. * Copyright (C) 2002 Chris Schoeneman - * + * * This package is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * found in the file LICENSE that should have accompanied this file. - * + * * This package is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -34,7 +34,6 @@ #if SYSAPI_WIN32 #include "base/IEventQueue.h" -#include "base/TMethodJob.h" #endif #include <iostream> @@ -79,18 +78,18 @@ App::~App() void App::version() { - std::cout << argsBase().m_exename << " " << kVersion << std::endl; - std::cout <<"Protocol version " << kProtocolMajorVersion << "." << kProtocolMinorVersion << std::endl; - std::cout << kCopyright << std::endl; + std::cout << argsBase().m_exename << " " << kVersion << "\n"; + std::cout <<"Protocol version " << kProtocolMajorVersion << "." << kProtocolMinorVersion << "\n"; + std::cout << kCopyright << "\n"; } int App::run(int argc, char** argv) -{ +{ #if MAC_OS_X_VERSION_10_7 // dock hide only supported on lion :( ProcessSerialNumber psn = { 0, kCurrentProcess }; - + #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" GetCurrentProcess(&psn); @@ -101,7 +100,7 @@ App::run(int argc, char** argv) // install application in to arch appUtil().adoptApp(this); - + // HACK: fail by default (saves us setting result in each catch) int result = kExitFailed; @@ -110,7 +109,7 @@ App::run(int argc, char** argv) } catch (XExitApp& e) { // instead of showing a nasty error, just exit with the error code. - // not sure if i like this behaviour, but it's probably better than + // not sure if i like this behaviour, but it's probably better than // using the exit(int) function! result = e.getCode(); } @@ -122,7 +121,7 @@ App::run(int argc, char** argv) } appUtil().beforeAppExit(); - + return result; } @@ -137,7 +136,7 @@ App::daemonMainLoop(int, const char**) return mainLoop(); } -void +void App::setupFileLogging() { if (argsBase().m_logFile != NULL) { @@ -147,24 +146,24 @@ App::setupFileLogging() } } -void +void App::loggingFilterWarning() { if (CLOG->getFilter() > CLOG->getConsoleMaxLevel()) { if (argsBase().m_logFile == NULL) { - LOG((CLOG_WARN "log messages above %s are NOT sent to console (use file logging)", + LOG((CLOG_WARN "log messages above %s are NOT sent to console (use file logging)", CLOG->getFilterName(CLOG->getConsoleMaxLevel()))); } } } -void +void App::initApp(int argc, const char** argv) { // parse command line parseArgs(argc, argv); - - DataDirectories::profile(argsBase().m_profileDirectory); + + barrier::DataDirectories::profile(argsBase().m_profileDirectory); // set log filter if (!CLOG->setFilter(argsBase().m_logFilter)) { @@ -173,9 +172,12 @@ App::initApp(int argc, const char** argv) m_bye(kExitArgs); } loggingFilterWarning(); - + if (argsBase().m_enableDragDrop) { LOG((CLOG_INFO "drag and drop enabled")); + if (!argsBase().m_dropTarget.empty()) { + LOG((CLOG_INFO "drop target: %s", argsBase().m_dropTarget.c_str())); + } } // setup file logging after parsing args @@ -226,15 +228,14 @@ App::handleIpcMessage(const Event& e, void*) } } -void -App::runEventsLoop(void*) +void App::run_events_loop() { m_events->loop(); - + #if defined(MAC_OS_X_VERSION_10_7) - + stopCocoaLoop(); - + #endif } |
