From ff16422a8be5333cc5993670e10194eddd1902d0 Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Thu, 12 Dec 2019 13:52:39 +0900 Subject: [PATCH] - now app builds via CMake --- client/CMakeLists.txt | 127 ++++++++++- client/build-number/build_number.h | 2 +- client/fervor/CMakeLists.txt | 71 ++++--- client/fervor/fvavailableupdate.h | 56 ++--- client/fervor/fvupdater.h | 1 + client/mainwindow.cpp | 6 +- client/platforms/osx/hidtrackerimpl_osx.mm | 184 ++++++++-------- client/platforms/osx/sleeptracker_osx.mm | 74 +++---- client/qtkeychain/CMakeLists.txt | 32 +-- .../qtkeychain/translations/qtkeychain_de.ts | 140 +++++------- .../qtkeychain/translations/qtkeychain_ro.ts | 199 ++++++++---------- 11 files changed, 484 insertions(+), 408 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index f793c16..fd6f465 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required (VERSION 3.5) # This directive is ignored for non OSX environments -set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "Minimum OS X deployment version") +set (CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment version") project (outliner C CXX) # Your project name @@ -42,10 +42,98 @@ else (Qt5OpenGL_FOUND) endif(Qt5OpenGL_FOUND) # List all source files in project directory -file (GLOB SOURCES "*.cpp") -file (GLOB C_SOURCES "*.c") -file (GLOB HEADERS "*.h") -file (GLOB UI "*.ui") +set (SOURCES + aboutdlg.cpp + appevents.cpp + attachmentsdialog.cpp + attachmentslist.cpp + browserwidget.cpp + connectdb_widget.cpp + encryption.cpp + finddialog.cpp + findsupport.cpp + helper.cpp + initial_ui.cpp + logger.cpp + main.cpp + mainwindow.cpp + newpassworddlg.cpp + openorcreatedb_widget.cpp + passworddlg.cpp + preferencesdlg.cpp + qrc_mainwindow.cpp + qrc_media.cpp + qrc_style.cpp + settings.cpp + startworkdialog.cpp + stopworkdialog.cpp + storage.cpp + task.cpp + taskaction.cpp + tasktreemodel.cpp + timeintervaldlg.cpp + timereportwizard.cpp + timetreedlg.cpp + timetreemodel.cpp + twofish.cpp + ) + +set (C_SOURCES + sqlite3.c + ) + +set (HEADERS + aboutdlg.h + appevents.h + attachmentsdialog.h + attachmentslist.h + browserwidget.h + config.h + connectdb_widget.h + encryption.h + finddialog.h + findsupport.h + helper.h + initial_ui.h + logger.h + mainwindow.h + moc_predefs.h + newpassworddlg.h + openorcreatedb_widget.h + passworddlg.h + preferencesdlg.h + settings.h + sqlite3.h + sqlite3ext.h + startworkdialog.h + stopworkdialog.h + storage.h + task.h + taskaction.h + tasktreemodel.h + timeintervaldlg.h + timereportwizard.h + timetreedlg.h + timetreemodel.h + twofish.h + ) + +set (UI + aboutdlg.ui + attachmentsdialog.ui + attachmentslist.ui + browserwidget.ui + connectdb_widget.ui + finddialog.ui + mainwindow.ui + newpassworddlg.ui + openorcreatedb_widget.ui + passworddlg.ui + preferencesdlg.ui + startworkdialog.ui + stopworkdialog.ui + timeintervaldlg.ui + timetreedlg.ui) if (CMAKE_SYSTEM MATCHES "Windows*") add_definitions(-DTARGET_WIN) @@ -78,6 +166,21 @@ if(TARGET_OSX) set (ADDITIONAL_EXE_OPTIONS MACOSX_BUNDLE) set (MACOS_ICON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/icons/appicon-osx.icns) + set (SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/platforms/osx/sleeptracker_osx.h + ${CMAKE_CURRENT_SOURCE_DIR}/platforms/osx/sleeptracker_osx.mm + ${CMAKE_CURRENT_SOURCE_DIR}/platforms/osx/hidtrackerimpl_osx.h + ${CMAKE_CURRENT_SOURCE_DIR}/platforms/osx/hidtrackerimpl_osx.mm + ) + + + find_library(COREFOUNDATION_LIBRARY CoreFoundation) + find_library(COCOA Cocoa) + find_library(IOKIT_LIBRARY IOKit) + find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox) + find_library(COREAUDIO_LIBRARY CoreAudio) + find_library(CARBON_LIBRARY Carbon) + set (PLATFORM_LIBS ${COCOA} ${COREFOUNDATION_LIBRARY} ${IOKIT_LIBRARY} ${AUDIOTOOLBOX_LIBRARY} ${COREAUDIO_LIBRARY} ${CARBON_LIBRARY}) + endif() if (TARGET_WIN) @@ -124,6 +227,8 @@ add_executable(${EXE_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/qmarkdowntextedit/qplaintexteditsearchwidget.cpp ${CMAKE_CURRENT_SOURCE_DIR}/platforms/hidtracker.cpp ${CMAKE_CURRENT_SOURCE_DIR}/platforms/hidtrackerimpl.cpp + ${SOURCE_FILES} + ${PLATFORM_LIBS} ${UI_RESOURCES} ${MACOS_ICON_FILE} ${RESOURCE_FILES} @@ -135,7 +240,7 @@ target_include_directories(${EXE_NAME} SYSTEM BEFORE PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/sqlitecpp/include PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/sqlitecpp/sqlite3/include PUBLIC ${OPENSSL_INCLUDE} - PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../lib/uuid/include + # PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../lib/uuid/include PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/fervor ) @@ -157,9 +262,10 @@ endif() target_link_libraries(${EXE_NAME} SQLiteCpp qtkeychain + Fervor ${UUID_LIB} ${OPENSSL_CRYPTO} - Qt5::Core Qt5::Widgets Qt5::PrintSupport Qt5::OpenGL # Qt + Qt5::Core Qt5::Widgets Qt5::PrintSupport Qt5::OpenGL Qt5::Network # Qt ${PLATFORM_LIBS} # System specific libraries ) @@ -192,3 +298,8 @@ if (NOT APP_SKIP_BUILD_NUMBER) COMMAND ${SCRIPT_PROCESSOR} ${CMAKE_CURRENT_SOURCE_DIR}/build-number/${BUILD_NUMBER_SCRIPT} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build-number/ ) endif(NOT APP_SKIP_BUILD_NUMBER) + +get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) +foreach(dir ${dirs}) + message(STATUS "dir='${dir}'") +endforeach() diff --git a/client/build-number/build_number.h b/client/build-number/build_number.h index 7e788f0..cc6df39 100644 --- a/client/build-number/build_number.h +++ b/client/build-number/build_number.h @@ -1,2 +1,2 @@ // Auto generated file ! Please do not edit ! -#define APP_BUILD_NUMBER 38 \ No newline at end of file +#define APP_BUILD_NUMBER 41 \ No newline at end of file diff --git a/client/fervor/CMakeLists.txt b/client/fervor/CMakeLists.txt index bbfe64d..702cffc 100644 --- a/client/fervor/CMakeLists.txt +++ b/client/fervor/CMakeLists.txt @@ -14,58 +14,69 @@ set (QT_USE_QTWEBKIT true) set (FERVOR_APP_VERSION "0.9.2") set (FERVOR_APP_NAME "Litt") +# Instruct CMake to run moc automatically when needed. +set (CMAKE_AUTOMOC ON) +set (CMAKE_INCLUDE_CURRENT_DIR ON) + +# Instruct CMake to run uic automatically when needed. +set (CMAKE_AUTOUIC ON) + + #include(${QT_USE_FILE}) #add_definitions(${QT_DEFINITIONS}) if(DEFINED FERVOR_APP_VERSION) - add_definitions(-DFV_APP_VERSION="${FERVOR_APP_VERSION}") + add_definitions(-DFV_APP_VERSION="${FERVOR_APP_VERSION}") else() - add_definitions(-DFV_APP_VERSION="1.0") - message(WARNING "No version information for Fervor given (please set FERVOR_APP_VERSION)! Assuming 1.0.") + add_definitions(-DFV_APP_VERSION="1.0") + message(WARNING "No version information for Fervor given (please set FERVOR_APP_VERSION)! Assuming 1.0.") endif() + if(DEFINED FERVOR_APP_NAME) - add_definitions(-DFV_APP_NAME="${FERVOR_APP_NAME}") + add_definitions(-DFV_APP_NAME="${FERVOR_APP_NAME}") else() - add_definitions(-DFV_APP_NAME="App Name") - message(WARNING "No application name for Fervor given (please set FERVOR_APP_NAME)! Assuming 'App Name'.") + add_definitions(-DFV_APP_NAME="App Name") + message(WARNING "No application name for Fervor given (please set FERVOR_APP_NAME)! Assuming 'App Name'.") endif() set(SOURCES - fvavailableupdate.cpp - fvignoredversions.cpp - fvplatform.cpp - fvupdateconfirmdialog.cpp - fvupdater.cpp - fvupdatewindow.cpp - fvversioncomparator.cpp -) + fvavailableupdate.cpp + fvignoredversions.cpp + fvplatform.cpp + fvupdateconfirmdialog.cpp + fvupdater.cpp + fvupdatewindow.cpp + fvversioncomparator.cpp + ) set(MOC_HEADERS - fvavailableupdate.h - fvignoredversions.h - fvplatform.h - fvupdateconfirmdialog.h - fvupdater.h - fvupdatewindow.h -) + fvavailableupdate.h + fvignoredversions.h + fvplatform.h + fvupdateconfirmdialog.h + fvupdater.h + fvupdatewindow.h + ) set(UIS - fvupdateconfirmdialog.ui - fvupdatewindow.ui -) + fvupdateconfirmdialog.ui + fvupdatewindow.ui + ) #qt4_wrap_ui(UI_HEADERS ${UIS}) #qt4_wrap_cpp(MOC_SOURCES ${MOC_HEADERS}) include_directories( - ${CMAKE_SOURCE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} -) + ${CMAKE_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ) +include_directories (${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS}) + add_library(Fervor ${SOURCES} ${MOC_HEADERS} ${MOC_SOURCES} ${UIS}) if(FERVOR_BUILD_SAMPLE) - add_subdirectory(sample) + add_subdirectory(sample) endif() if(FERVOR_BUILD_TESTS) - ENABLE_TESTING() - add_subdirectory(tests) + ENABLE_TESTING() + add_subdirectory(tests) endif() diff --git a/client/fervor/fvavailableupdate.h b/client/fervor/fvavailableupdate.h index bbce04a..320ce79 100644 --- a/client/fervor/fvavailableupdate.h +++ b/client/fervor/fvavailableupdate.h @@ -6,45 +6,45 @@ class FvAvailableUpdate : public QObject { - Q_OBJECT + Q_OBJECT public: - explicit FvAvailableUpdate(QObject *parent = 0); + explicit FvAvailableUpdate(QObject *parent = 0); - QString GetTitle(); - void SetTitle(QString title); + QString GetTitle(); + void SetTitle(QString title); - QUrl GetReleaseNotesLink(); - void SetReleaseNotesLink(QUrl releaseNotesLink); - void SetReleaseNotesLink(QString releaseNotesLink); + QUrl GetReleaseNotesLink(); + void SetReleaseNotesLink(QUrl releaseNotesLink); + void SetReleaseNotesLink(QString releaseNotesLink); - QString GetPubDate(); - void SetPubDate(QString pubDate); + QString GetPubDate(); + void SetPubDate(QString pubDate); - QUrl GetEnclosureUrl(); - void SetEnclosureUrl(QUrl enclosureUrl); - void SetEnclosureUrl(QString enclosureUrl); + QUrl GetEnclosureUrl(); + void SetEnclosureUrl(QUrl enclosureUrl); + void SetEnclosureUrl(QString enclosureUrl); - QString GetEnclosureVersion(); - void SetEnclosureVersion(QString enclosureVersion); + QString GetEnclosureVersion(); + void SetEnclosureVersion(QString enclosureVersion); - QString GetEnclosurePlatform(); - void SetEnclosurePlatform(QString enclosurePlatform); + QString GetEnclosurePlatform(); + void SetEnclosurePlatform(QString enclosurePlatform); - unsigned long GetEnclosureLength(); - void SetEnclosureLength(unsigned long enclosureLength); + unsigned long GetEnclosureLength(); + void SetEnclosureLength(unsigned long enclosureLength); - QString GetEnclosureType(); - void SetEnclosureType(QString enclosureType); + QString GetEnclosureType(); + void SetEnclosureType(QString enclosureType); private: - QString m_title; - QUrl m_releaseNotesLink; - QString m_pubDate; - QUrl m_enclosureUrl; - QString m_enclosureVersion; - QString m_enclosurePlatform; - unsigned long m_enclosureLength; - QString m_enclosureType; + QString m_title; + QUrl m_releaseNotesLink; + QString m_pubDate; + QUrl m_enclosureUrl; + QString m_enclosureVersion; + QString m_enclosurePlatform; + unsigned long m_enclosureLength; + QString m_enclosureType; }; diff --git a/client/fervor/fvupdater.h b/client/fervor/fvupdater.h index 04b69fa..620ed86 100644 --- a/client/fervor/fvupdater.h +++ b/client/fervor/fvupdater.h @@ -6,6 +6,7 @@ #include #include #include + class FvUpdateWindow; class FvUpdateConfirmDialog; class FvAvailableUpdate; diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index bda8efb..d3ad1ba 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -871,12 +871,14 @@ void MainWindow::buildOpenOrCreateView() // Ask password void MainWindow::askDbPassword(const QString& message) { - mStackedViews->setCurrentIndex(0); + if (mStackedViews) + mStackedViews->setCurrentIndex(0); } void MainWindow::askNewDbPassword() { - mStackedViews->setCurrentIndex(1); + if (mStackedViews) + mStackedViews->setCurrentIndex(1); } void MainWindow::startOrStopTracking() diff --git a/client/platforms/osx/hidtrackerimpl_osx.mm b/client/platforms/osx/hidtrackerimpl_osx.mm index f114ac1..699729a 100644 --- a/client/platforms/osx/hidtrackerimpl_osx.mm +++ b/client/platforms/osx/hidtrackerimpl_osx.mm @@ -4,7 +4,7 @@ #include HIDTrackerImplOSX::HIDTrackerImplOSX() - :mMachPortRef(0), mKeyboardEventSrc(0) + :mMachPortRef(0), mKeyboardEventSrc(0) { } @@ -17,24 +17,24 @@ HIDTrackerImplOSX::~HIDTrackerImplOSX() bool HIDTrackerImplOSX::isPossible() { - if (AXIsProcessTrustedWithOptions != NULL) - { - // 10.9 and later - const void * keys[] = { kAXTrustedCheckOptionPrompt }; - const void * values[] = { kCFBooleanTrue }; + if (AXIsProcessTrustedWithOptions != NULL) + { + // 10.9 and later + const void * keys[] = { kAXTrustedCheckOptionPrompt }; + const void * values[] = { kCFBooleanTrue }; - CFDictionaryRef options = CFDictionaryCreate( - kCFAllocatorDefault, - keys, - values, - sizeof(keys) / sizeof(*keys), - &kCFCopyStringDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); + CFDictionaryRef options = CFDictionaryCreate( + kCFAllocatorDefault, + keys, + values, + sizeof(keys) / sizeof(*keys), + &kCFCopyStringDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); - return AXIsProcessTrustedWithOptions(options); - } - else - return AXAPIEnabled() != 0; + return AXIsProcessTrustedWithOptions(options); + } + else + return AXAPIEnabled() != 0; } time_t LastKeyboardActivityTime = 0; @@ -42,106 +42,106 @@ time_t LastMouseActivityTime = 0; CGEventRef eventTapFunction(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon) { - if (type != NX_KEYUP && type != NX_OMOUSEDOWN && type != NX_OMOUSEUP && type != NX_OMOUSEDRAGGED && - type != NX_LMOUSEUP && type != NX_LMOUSEDOWN && type != NX_RMOUSEUP && type != NX_RMOUSEDOWN && - type != NX_MOUSEMOVED && type != NX_LMOUSEDRAGGED && type != NX_RMOUSEDRAGGED) + if (type != NX_KEYUP && type != NX_OMOUSEDOWN && type != NX_OMOUSEUP && type != NX_OMOUSEDRAGGED && + type != NX_LMOUSEUP && type != NX_LMOUSEDOWN && type != NX_RMOUSEUP && type != NX_RMOUSEDOWN && + type != NX_MOUSEMOVED && type != NX_LMOUSEDRAGGED && type != NX_RMOUSEDRAGGED) + return event; + + NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; + + NSEvent* sysEvent = [NSEvent eventWithCGEvent:event]; + if (type == NX_KEYUP && [sysEvent type] == NSKeyUp) + LastKeyboardActivityTime = time(NULL); + else + LastMouseActivityTime = time(NULL); + + [pool release]; return event; - - NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - - NSEvent* sysEvent = [NSEvent eventWithCGEvent:event]; - if (type == NX_KEYUP && [sysEvent type] == NSKeyUp) - LastKeyboardActivityTime = time(NULL); - else - LastMouseActivityTime = time(NULL); - - [pool release]; - return event; } bool HIDTrackerImplOSX::start() { - LastKeyboardActivityTime = LastMouseActivityTime = time(NULL); - CGEventMask keyboardMask = CGEventMaskBit(kCGEventKeyUp); - CGEventMask mouseMask = CGEventMaskBit(kCGEventMouseMoved) | CGEventMaskBit(kCGEventLeftMouseDown) | - CGEventMaskBit(kCGEventRightMouseDown); + LastKeyboardActivityTime = LastMouseActivityTime = time(NULL); + CGEventMask keyboardMask = CGEventMaskBit(kCGEventKeyUp); + CGEventMask mouseMask = CGEventMaskBit(kCGEventMouseMoved) | CGEventMaskBit(kCGEventLeftMouseDown) | + CGEventMaskBit(kCGEventRightMouseDown); - CGEventMask mask = keyboardMask + mouseMask;// + mouseMask;//CGEventMaskBit(kCGEventKeyDown) | CGEventMaskBit(kCGEventMouseMoved); + CGEventMask mask = keyboardMask + mouseMask;// + mouseMask;//CGEventMaskBit(kCGEventKeyDown) | CGEventMaskBit(kCGEventMouseMoved); - // Try to create keyboard-only hook. It will fail if Assistive Devices are not set. - mMachPortRef = CGEventTapCreate( - kCGAnnotatedSessionEventTap, - kCGTailAppendEventTap, // kCGHeadInsertEventTap - kCGEventTapOptionListenOnly, - keyboardMask, - (CGEventTapCallBack)eventTapFunction, - 0 ); - if (!mMachPortRef) - return false; - else - CFRelease(mMachPortRef); + // Try to create keyboard-only hook. It will fail if Assistive Devices are not set. + mMachPortRef = CGEventTapCreate( + kCGAnnotatedSessionEventTap, + kCGTailAppendEventTap, // kCGHeadInsertEventTap + kCGEventTapOptionListenOnly, + keyboardMask, + (CGEventTapCallBack)eventTapFunction, + 0 ); + if (!mMachPortRef) + return false; + else + CFRelease(mMachPortRef); - mMachPortRef = CGEventTapCreate( - kCGAnnotatedSessionEventTap, - kCGTailAppendEventTap, // kCGHeadInsertEventTap - kCGEventTapOptionListenOnly, - mask, - (CGEventTapCallBack)eventTapFunction, - 0 ); - if (!mMachPortRef) - return false; + mMachPortRef = CGEventTapCreate( + kCGAnnotatedSessionEventTap, + kCGTailAppendEventTap, // kCGHeadInsertEventTap + kCGEventTapOptionListenOnly, + mask, + (CGEventTapCallBack)eventTapFunction, + 0 ); + if (!mMachPortRef) + return false; - mKeyboardEventSrc = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, mMachPortRef, 0); - if ( !mKeyboardEventSrc ) - { - CFRelease(mMachPortRef); mMachPortRef = 0; - return false; - } + mKeyboardEventSrc = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, mMachPortRef, 0); + if ( !mKeyboardEventSrc ) + { + CFRelease(mMachPortRef); mMachPortRef = 0; + return false; + } - CFRunLoopRef runLoop = CFRunLoopGetCurrent(); - if ( !runLoop ) - { - CFRelease(mMachPortRef); mMachPortRef = 0; - return false; - } + CFRunLoopRef runLoop = CFRunLoopGetCurrent(); + if ( !runLoop ) + { + CFRelease(mMachPortRef); mMachPortRef = 0; + return false; + } - CFRunLoopAddSource(runLoop, mKeyboardEventSrc, kCFRunLoopDefaultMode); - return true; + CFRunLoopAddSource(runLoop, mKeyboardEventSrc, kCFRunLoopDefaultMode); + return true; } void HIDTrackerImplOSX::stop() { - if (mKeyboardEventSrc && mMachPortRef) - CFRunLoopRemoveSource(CFRunLoopGetCurrent(), mKeyboardEventSrc, kCFRunLoopDefaultMode); - if (mKeyboardEventSrc) - CFRelease(mKeyboardEventSrc); - if (mMachPortRef) - CFRelease(mMachPortRef); + if (mKeyboardEventSrc && mMachPortRef) + CFRunLoopRemoveSource(CFRunLoopGetCurrent(), mKeyboardEventSrc, kCFRunLoopDefaultMode); + if (mKeyboardEventSrc) + CFRelease(mKeyboardEventSrc); + if (mMachPortRef) + CFRelease(mMachPortRef); - mKeyboardEventSrc = NULL; - mMachPortRef = NULL; + mKeyboardEventSrc = NULL; + mMachPortRef = NULL; } bool HIDTrackerImplOSX::isUserActive() { - if (!LastKeyboardActivityTime && !LastMouseActivityTime) - { - LastKeyboardActivityTime = LastMouseActivityTime = time(NULL); - return true; - } + if (!LastKeyboardActivityTime && !LastMouseActivityTime) + { + LastKeyboardActivityTime = LastMouseActivityTime = time(NULL); + return true; + } - time_t current = time(NULL); - if (current - LastKeyboardActivityTime <= mInterval) - return true; + time_t current = time(NULL); + if (current - LastKeyboardActivityTime <= mInterval) + return true; - if (current - LastMouseActivityTime <= mInterval) - return true; + if (current - LastMouseActivityTime <= mInterval) + return true; - return false; + return false; } void HIDTrackerImplOSX::resetUserActive() { - LastKeyboardActivityTime = 0; - LastMouseActivityTime = 0; + LastKeyboardActivityTime = 0; + LastMouseActivityTime = 0; } diff --git a/client/platforms/osx/sleeptracker_osx.mm b/client/platforms/osx/sleeptracker_osx.mm index 0975f49..8a7ca35 100644 --- a/client/platforms/osx/sleeptracker_osx.mm +++ b/client/platforms/osx/sleeptracker_osx.mm @@ -1,10 +1,10 @@ #include "sleeptracker_osx.h" -#include -#include +#import +#import @interface SleepNotificationHandler: NSObject { - SleepTracker* mTracker; + SleepTracker* mTracker; } - (id)initWithTracker:(SleepTracker*)tracker; @@ -20,55 +20,55 @@ - (id)initWithTracker:(SleepTracker*)tracker { - if (![super init]) - return nil; + if (![super init]) + return nil; - mTracker = tracker; - return self; + mTracker = tracker; + return self; } - (void)dealloc { - [super dealloc]; + [super dealloc]; } - (void)install { - NSNotificationCenter *center = [[NSWorkspace sharedWorkspace] notificationCenter]; - [center addObserver:self - selector:@selector(appWillSleep:) - name:NSWorkspaceWillSleepNotification - object:NULL]; + NSNotificationCenter *center = [[NSWorkspace sharedWorkspace] notificationCenter]; + [center addObserver:self + selector:@selector(appWillSleep:) + name:NSWorkspaceWillSleepNotification + object:NULL]; - [center addObserver:self - selector:@selector(appDidWake:) - name:NSWorkspaceDidWakeNotification - object:NULL]; + [center addObserver:self + selector:@selector(appDidWake:) + name:NSWorkspaceDidWakeNotification + object:NULL]; } - (void)uninstall { - NSNotificationCenter *center = [[NSWorkspace sharedWorkspace] notificationCenter]; - [center removeObserver: self]; + NSNotificationCenter *center = [[NSWorkspace sharedWorkspace] notificationCenter]; + [center removeObserver: self]; } - (void)appWillSleep:(NSNotification*)notification { - if (self->mTracker) - self->mTracker->onAppWillSleep(); + if (self->mTracker) + self->mTracker->onAppWillSleep(); } - (void)appDidWake:(NSNotification*)notification { - if (self->mTracker) - self->mTracker->onAppDidWake(); + if (self->mTracker) + self->mTracker->onAppDidWake(); } @end SleepTracker STSharedInstance; SleepTracker::SleepTracker(QObject *parent) - :QObject(parent), mHandler(nullptr) + :QObject(parent), mHandler(nullptr) { @@ -81,30 +81,30 @@ SleepTracker::~SleepTracker() void SleepTracker::install() { - if (!mHandler) - { - mHandler = [[SleepNotificationHandler alloc] initWithTracker: this]; - [(id)mHandler install]; - } + if (!mHandler) + { + mHandler = [[SleepNotificationHandler alloc] initWithTracker: this]; + [(id)mHandler install]; + } } void SleepTracker::uninstall() { - if (mHandler) - { - [(id)mHandler uninstall]; - [(id)mHandler release]; - mHandler = nullptr; - } + if (mHandler) + { + [(id)mHandler uninstall]; + [(id)mHandler release]; + mHandler = nullptr; + } } void SleepTracker::onAppWillSleep() { - emit onSystemSleep(); + emit onSystemSleep(); } void SleepTracker::onAppDidWake() { - emit onSystemResume(); + emit onSystemResume(); } diff --git a/client/qtkeychain/CMakeLists.txt b/client/qtkeychain/CMakeLists.txt index 160d002..7e74837 100644 --- a/client/qtkeychain/CMakeLists.txt +++ b/client/qtkeychain/CMakeLists.txt @@ -1,26 +1,26 @@ -cmake_minimum_required(VERSION 2.8.11) -project(qtkeychain) +cmake_minimum_required (VERSION 2.8.11) +project (qtkeychain) -include(FindPkgConfig) +include (FindPkgConfig) ### -set(QTKEYCHAIN_VERSION 0.9.90) -set(QTKEYCHAIN_SOVERSION 1) +set (QTKEYCHAIN_VERSION 0.9.90) +set (QTKEYCHAIN_SOVERSION 1) ### -set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake/Modules") -include(GNUInstallDirs) -include(GenerateExportHeader) -include(ECMPackageConfigHelpers) -include(ECMSetupVersion) -include(ECMGeneratePriFile) +set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake/Modules") +include (GNUInstallDirs) +include (GenerateExportHeader) +include (ECMPackageConfigHelpers) +include (ECMSetupVersion) +include (ECMGeneratePriFile) -option(BUILD_WITH_QT4 "Build qtkeychain with Qt4 no matter if Qt5 was found" OFF) -option(BUILD_TEST_APPLICATION "Build test application" OFF) -option(BUILD_TRANSLATIONS "Build translations" ON) -option(QTKEYCHAIN_STATIC "Build static library" ON) +option (BUILD_WITH_QT4 "Build qtkeychain with Qt4 no matter if Qt5 was found" OFF) +option (BUILD_TEST_APPLICATION "Build test application" OFF) +option (BUILD_TRANSLATIONS "Build translations" ON) +option (QTKEYCHAIN_STATIC "Build static library" ON) if(CMAKE_SYSTEM_NAME STREQUAL Android) set(ANDROID 1) @@ -66,7 +66,7 @@ if (Qt5Core_FOUND AND NOT BUILD_WITH_QT4) endmacro() set(QTCORE_LIBRARIES ${Qt5Core_LIBRARIES}) - include_directories(${Qt5Core_INCLUDE_DIRS}) + include_directories (${Qt5Core_INCLUDE_DIRS}) if (NOT Qt5Core_VERSION VERSION_LESS "5.7.0") if (CMAKE_COMPILER_IS_GNUCXX) diff --git a/client/qtkeychain/translations/qtkeychain_de.ts b/client/qtkeychain/translations/qtkeychain_de.ts index 18eeba0..0543230 100644 --- a/client/qtkeychain/translations/qtkeychain_de.ts +++ b/client/qtkeychain/translations/qtkeychain_de.ts @@ -11,18 +11,18 @@ Could not decrypt data - Kann Daten nicht entschlüsseln + Unknown error - Unbekannter Fehler + Could not open wallet: %1; %2 - Konnte Brieftasche nicht öffnen: %1; %2 + @@ -30,12 +30,12 @@ Unknown error - Unbekannter Fehler + Access to keychain denied - Zugriff auf Schlüsselbund verweigert + @@ -63,41 +63,57 @@ Entry not found - Eintrag nicht gefunden + QKeychain::ReadPasswordJobPrivate - - - Unknown error - Unbekannter Fehler + + Password entry not found + + + + + + Could not decrypt data + D-Bus is not running + + + + Unknown error + + No keychain service available - Kein Schlüsselbund-Dienst verfügbar + Could not open wallet: %1; %2 - Konnte Brieftasche nicht öffnen: %1; %2 + Access to keychain denied - Zugriff auf Schlüsselbund verweigert + Could not determine data type: %1; %2 - Datentyp kann nicht ermittelt werden: %1: %2 + + + + + Entry not found + @@ -109,62 +125,14 @@ Unknown kwallet entry type '%1' - - Could not read password: %1; %2 - Passwort konnte nicht ausgelesen werden: %1; %2 - Password not found - Passwort nicht gefunden - - - - Entry not found - Eintrag nicht gefunden - - - - Password entry not found - - - - Could not decrypt data - Kann Daten nicht entschlüsseln - QKeychain::WritePasswordJobPrivate - - - - Unknown error - Unbekannter Fehler - - - - D-Bus is not running - - - - - Could not open wallet: %1; %2 - Konnte Brieftasche nicht öffnen: %1; %2 - - - Access to keychain denied - Zugriff auf Schlüsselbund verweigert - - - Could not delete encrypted data from settings: access error - Kann verschlüsselte Daten nicht aus den Einstellungen entfernen: Zugriffsfehler - - - Could not delete encrypted data from settings: format error - Kann verschlüsselte Daten nicht aus den Einstellungen entfernen: Formatfehler - Credential size exceeds maximum size of %1 @@ -183,68 +151,81 @@ Encryption failed - Verschlüsselung fehlgeschlagen + - Could not store encrypted data in settings: access error - Kann verschlüsselte Daten nicht in den Einstellungen speichern: Zugriffsfehler + + D-Bus is not running + - Could not store encrypted data in settings: format error - Kann verschlüsselte Daten nicht in den Einstellungen speichern: Formatfehler + + + Unknown error + + + + + Could not open wallet: %1; %2 + QObject + + + Entry not found + + Access to keychain denied - Zugriff auf Schlüsselbund verweigert + No keyring daemon - Kein Schlüsselbund-Dienst + Already unlocked - Bereits entsperrt + No such keyring - Kein solcher Schlüsselbund + Bad arguments - Ungültige Argumente + I/O error - Ein-/Ausgabe-Fehler + Cancelled - Abgebrochen + Keyring already exists - Schlüsselbund existiert bereits + No match - Kein Treffer + Unknown error - Unbekannter Fehler + @@ -256,10 +237,5 @@ %1 (OSStatus %2) - - - Entry not found - Eintrag nicht gefunden - diff --git a/client/qtkeychain/translations/qtkeychain_ro.ts b/client/qtkeychain/translations/qtkeychain_ro.ts index 7a2b43e..73dd773 100644 --- a/client/qtkeychain/translations/qtkeychain_ro.ts +++ b/client/qtkeychain/translations/qtkeychain_ro.ts @@ -11,18 +11,18 @@ Could not decrypt data - Nu se poate decripta data + Unknown error - Eroare necunoscută + Could not open wallet: %1; %2 - Nu se poate deschide portofelul: %1; %2 + @@ -30,12 +30,12 @@ Unknown error - Eroare necunoscută + Access to keychain denied - Acces interzis la serviciul de chei + @@ -63,67 +63,11 @@ Entry not found - Înregistrarea nu a fost găsită + QKeychain::ReadPasswordJobPrivate - - - - Unknown error - Eroare necunoscută - - - - D-Bus is not running - D-Bus nu rulează - - - - No keychain service available - Nu există niciun serviciu de chei disponibil - Kein Schlüsselbund-Dienst verfügbar - - - - Could not open wallet: %1; %2 - Nu se poate deschide portofelul: %1; %2 - - - - Access to keychain denied - Acces interzis la serviciul de chei - - - - Could not determine data type: %1; %2 - Nu se poate stabili tipul de date: %1: %2 - - - - Unsupported entry type 'Map' - Tip de înregistrare nesuportat 'Map' - - - - Unknown kwallet entry type '%1' - Tip de înregistrare kwallet necunoscut '%1' - - - Could not read password: %1; %2 - Nu se poate citi parola: %1; %2 - - - - Password not found - Parola nu a fost găsită - - - - Entry not found - Înregistrarea nu a fost găsită - Password entry not found @@ -133,39 +77,62 @@ Could not decrypt data - Nu se poate decripta data + + + + + D-Bus is not running + + + + + + Unknown error + + + + + No keychain service available + + + + + Could not open wallet: %1; %2 + + + + + Access to keychain denied + + + + + Could not determine data type: %1; %2 + + + + + Entry not found + + + + + Unsupported entry type 'Map' + + + + + Unknown kwallet entry type '%1' + + + + + Password not found + QKeychain::WritePasswordJobPrivate - - - - Unknown error - Eroare necunoscută - - - - D-Bus is not running - D-Bus nu rulează - - - - Could not open wallet: %1; %2 - Nu se poate deschide portofelul: %1; %2 - - - Access to keychain denied - Acces interzis la serviciul de chei - - - Could not delete encrypted data from settings: access error - Nu se pot șterge datele criptate din setări: eroare de acces - - - Could not delete encrypted data from settings: format error - Nu se pot șterge datele criptate din setări: eroare de format - Credential size exceeds maximum size of %1 @@ -184,68 +151,81 @@ Encryption failed - Criptarea a eșuat + - Could not store encrypted data in settings: access error - Nu se pot stoca datele criptate în setări: eroare de acces + + D-Bus is not running + - Could not store encrypted data in settings: format error - Nu se pot stoca datele criptate în setări: eroare de format + + + Unknown error + + + + + Could not open wallet: %1; %2 + QObject + + + Entry not found + + Access to keychain denied - Acces interzis la serviciul de chei + No keyring daemon - Niciun demon pentru inelul de chei + Already unlocked - Deja deblocat + No such keyring - Nu există astfel de inel de chei + Bad arguments - Argumente greșite + I/O error - Eroare de I/E + Cancelled - Anulat + Keyring already exists - Inelul de chei deja există + No match - Nicio potrivire + Unknown error - Eroare necunoscută + @@ -255,12 +235,7 @@ %1 (OSStatus %2) - %1 (OSStatus %2) - - - - Entry not found - Înregistrarea nu a fost găsită +