├── .gitignore ├── CMakeLists.txt ├── ReadMe.md ├── changelog.gz ├── cmake ├── DeployQt5.cmake ├── FindQt5.cmake ├── doxygen.config.in └── version_config.h.in ├── copyright ├── deploy ├── exiftool.exe ├── exiv2.exe └── libexpat.dll ├── install └── CMakeLists.txt └── src ├── CMakeLists.txt ├── app.qrc ├── composerDlg.cpp ├── composerDlg.h ├── exifData.cpp ├── exifData.h ├── exifWrapper.cpp ├── exifWrapper.h ├── main.cpp ├── mainWindow.cpp ├── mainWindow.h ├── mover.cpp ├── mover.h ├── patternFormat.cpp ├── patternFormat.h ├── reportDlg.cpp ├── reportDlg.h ├── resources └── logo.ico ├── simpleLog.cpp ├── simpleLog.h └── yaps.rc /.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | *~ 3 | .DS_Store 4 | build 5 | buildx86 6 | buildx64*.user 7 | .cproject 8 | .project 9 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | PROJECT(yaps) 4 | 5 | 6 | #----------------------------------------------------------------------------- 7 | # See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details 8 | # 9 | 10 | set(project_policies 11 | CMP0001 # NEW: CMAKE_BACKWARDS_COMPATIBILITY should no longer be used. 12 | CMP0002 # NEW: Logical target names must be globally unique. 13 | CMP0003 # NEW: Libraries linked via full path no longer produce linker search paths. 14 | CMP0004 # NEW: Libraries linked may NOT have leading or trailing whitespace. 15 | CMP0005 # NEW: Preprocessor definition values are now escaped automatically. 16 | CMP0006 # NEW: Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION. 17 | CMP0007 # NEW: List command no longer ignores empty elements. 18 | CMP0008 # NEW: Libraries linked by full-path must have a valid library file name. 19 | CMP0009 # NEW: FILE GLOB_RECURSE calls should not follow symlinks by default. 20 | CMP0010 # NEW: Bad variable reference syntax is an error. 21 | CMP0011 # NEW: Included scripts do automatic cmake_policy PUSH and POP. 22 | CMP0012 # NEW: if() recognizes numbers and boolean constants. 23 | CMP0013 # NEW: Duplicate binary directories are not allowed. 24 | CMP0014 # NEW: Input directories must have CMakeLists.txt 25 | CMP0020 # NEW: disable autolinking to qtmain as we have our own main() functions (new in Qt 5.1) 26 | CMP0043 # NEW: Ignore COMPILE_DEFINITIONS_ properties 27 | ) 28 | 29 | foreach(policy ${project_policies}) 30 | if(POLICY ${policy}) 31 | cmake_policy(SET ${policy} NEW) 32 | endif() 33 | endforeach() 34 | 35 | 36 | ## ################################################################# 37 | ## PROJECT SETTINGS 38 | ## ################################################################# 39 | 40 | set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE) 41 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") 42 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 43 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 44 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 45 | 46 | set(VERSION_MAJOR 1 CACHE STRING "${PROJECT_NAME} major version number.") 47 | set(VERSION_MINOR 2 CACHE STRING "${PROJECT_NAME} minor version number.") 48 | set(VERSION_BUILD 0 CACHE STRING "${PROJECT_NAME} build version number.") 49 | 50 | configure_file( cmake/version_config.h.in ${CMAKE_BINARY_DIR}/generated/version_config.h ) 51 | include_directories( ${CMAKE_BINARY_DIR}/generated/ ) # Make sure it can be included 52 | 53 | set(BIN_INSTALL_DIR ".") 54 | 55 | IF(WIN32) 56 | SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install_dir CACHE INTERNAL "Prefix prepended to install directories" FORCE) 57 | ENDIF() 58 | 59 | #----------------------------------------------------------------------------- 60 | # Set a default build type if none was specified 61 | #----------------------------------------------------------------------------- 62 | 63 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 64 | message(STATUS "Setting build type to 'RelWithDebugInfo' as none was specified.") 65 | set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) 66 | 67 | # Set the possible values of build type for cmake-gui 68 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY 69 | STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") 70 | endif() 71 | 72 | 73 | # determine deployment system 74 | if(WIN32) 75 | option(SHOW_CONSOLE "Show console at runtime (mainly for debugging)" "FALSE") 76 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") 77 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") 78 | ENDIF(WIN32) 79 | set(DEPLOYMENT_SYSTEM) 80 | IF(APPLE) 81 | set(DEPLOYMENT_SYSTEM MACOSX_BUNDLE) 82 | endif() 83 | if(WIN32) 84 | if( NOT ${SHOW_CONSOLE} ) 85 | set(DEPLOYMENT_SYSTEM WIN32) 86 | endif() 87 | endif() 88 | 89 | if(UNIX OR APPLE) 90 | SET(CMAKE_CXX_FLAGS "-std=gnu++0x") 91 | endif() 92 | 93 | 94 | ## ################################################################# 95 | ## DEPENDENCIES 96 | ## ################################################################# 97 | 98 | # Qt 99 | set(CMAKE_CXX_STANDARD 17) 100 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 101 | #set(CMAKE_PREFIX_PATH "" CACHE PATH "C:/Qt/6.8.0/msvc2022_64") 102 | list(APPEND CMAKE_PREFIX_PATH "C:/Qt/6.8.0/msvc2022_64") 103 | #set(CMAKE_PREFIX_PATH C:/Qt/6.8.0/msvc2022_64) 104 | 105 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Concurrent) 106 | qt_standard_project_setup() 107 | #INCLUDE(FindQt5) 108 | #FIND_PACKAGE(Qt5Core REQUIRED) 109 | #FIND_PACKAGE(Qt5Gui REQUIRED) 110 | #FIND_PACKAGE(Qt5Widgets REQUIRED) 111 | #FIND_PACKAGE(Qt5Concurrent REQUIRED) 112 | 113 | #add_subdirectory 114 | add_subdirectory(src) 115 | 116 | ## ################################################################# 117 | ## DOCUMENTATION 118 | ## ################################################################# 119 | 120 | FIND_PACKAGE(Doxygen) 121 | IF (DOXYGEN) 122 | SET(DOXYGEN_BUILD_DIR ${PROJECT_BINARY_DIR}/Doxygen) 123 | 124 | CONFIGURE_FILE ( 125 | ${PROJECT_SOURCE_DIR}/cmake/doxygen.config.in 126 | ${DOXYGEN_BUILD_DIR}/doxygen.config 127 | ) 128 | 129 | ADD_CUSTOM_TARGET(${PROJECT_NAME}-doc 130 | ${DOXYGEN} 131 | ${DOXYGEN_BUILD_DIR}/doxygen.config 132 | ) 133 | ENDIF (DOXYGEN) 134 | 135 | ## ################################################################# 136 | ## INSTALLING 137 | ## ################################################################# 138 | 139 | if(WIN32) 140 | FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/deploy/*.*") 141 | install (FILES ${files} DESTINATION ${BIN_INSTALL_DIR} ) 142 | endif(WIN32) 143 | 144 | if(APPLE) 145 | install (DIRECTORY deploy/lib DESTINATION ${BIN_INSTALL_DIR} ) 146 | install (PROGRAMS deploy/exiftool deploy/exiv2 DESTINATION ${BIN_INSTALL_DIR} ) 147 | endif(APPLE) 148 | 149 | ## ################################################################# 150 | ## PACKAGING 151 | ## ################################################################# 152 | 153 | #SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) 154 | SET(CPACK_PACKAGE_DESCRIPTION "yaps") 155 | SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A simple tool to move your photos or videos into a directory structure created 156 | based on the EXIF information (creation date/time) of those files") 157 | SET(CPACK_PACKAGE_VENDOR "Michael Knopke") 158 | SET(CPACK_PACKAGE_MAINTAINER "Michael Knopke") 159 | SET(CPACK_PACKAGE_CONTACT "Michael Knopke ") 160 | SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/copyright") 161 | SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.md") 162 | SET(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.md") 163 | SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) 164 | SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) 165 | SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_BUILD}) 166 | SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}") 167 | SET(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON) 168 | 169 | # Installers for 32- vs. 64-bit CMake: 170 | # - Root install directory (displayed to end user at installer-run time) 171 | # - "NSIS package/display name" (text used in the installer GUI) 172 | # - Registry key used to store info about the installation 173 | IF(CMAKE_CL_64) 174 | SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") 175 | SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)") 176 | SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} 177 | ${CPACK_PACKAGE_VERSION} (Win64)") 178 | ELSE() 179 | SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") 180 | SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") 181 | SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} 182 | ${CPACK_PACKAGE_VERSION}") 183 | ENDIF() 184 | 185 | if(WIN32) 186 | SET(CPACK_GENERATOR "NSIS") 187 | SET(CPACK_NSIS_DISPLAY_NAME "yaps") 188 | SET(CPACK_NSIS_HELP_LINK "http://www.pacsnode.com/yaps") 189 | SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.pacsnode.com/yaps") 190 | SET(CPACK_NSIS_CONTACT "knopkem@pacsnode.com") 191 | SET(CPACK_NSIS_MODIFY_PATH OFF) 192 | set(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}" "${PROJECT_NAME}") 193 | set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/src/resources/logo.ico") 194 | set(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/src/resources/logo.ico") 195 | set(CPACK_NSIS_EXECUTABLES_DIRECTORY "${BIN_INSTALL_DIR}") 196 | set(CPACK_CREATE_DESKTOP_LINKS "yaps") 197 | 198 | elseif(APPLE) 199 | set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}) 200 | set(CMAKE_INSTALL_PREFIX "/Applications/yaps") 201 | set(CPACK_GENERATOR "DragNDrop") 202 | set(CPACK_DMG_FORMAT "UDBZ") 203 | set(CPACK_DMG_VOLUME_NAME "${PROJECT_NAME} ") 204 | set(CPACK_SYSTEM_NAME "OSX") 205 | set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}") 206 | elseif(UNIX) 207 | SET (CPACK_GENERATOR "DEB") 208 | set(CPACK_PACKAGING_INSTALL_PREFIX "/tmp") 209 | set(CPACK_DEBIAN_PACKAGE_DEPENDS " libc6 (>= 2.3.1-6), libqtgui4, exiv2, libimage-exiftool-perl") 210 | set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Description for yaps 211 | A simple tool to move your photos or videos into a directory structure created 212 | based on the EXIF information (creation date/time) of those files") 213 | SET(CPACK_STRIP_FILES "TRUE") 214 | set(CPACK_SET_DESTDIR On) 215 | SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") 216 | SET(CPACK_DEBIAN_PACKAGE_SECTION "devel") 217 | SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Michael Knopke ") 218 | SET(CPACK_DEBIAN_PACKAGE_NAME "yaps") 219 | INSTALL(FILES "${CMAKE_SOURCE_DIR}/copyright" 220 | DESTINATION "/usr/share/doc/${CPACK_DEBIAN_PACKAGE_NAME}") 221 | INSTALL(FILES "${CMAKE_SOURCE_DIR}/changelog.gz" 222 | DESTINATION "/usr/share/doc/${CPACK_DEBIAN_PACKAGE_NAME}") 223 | 224 | endif() 225 | 226 | INCLUDE(CPack) 227 | 228 | if(APPLE) 229 | set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") 230 | set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}") 231 | set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") 232 | set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") 233 | set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") 234 | set(MACOSX_BUNDLE_ICON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/resources/logo.icns") 235 | set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") 236 | set(MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}") 237 | 238 | set(MACOSX_BUNDLE_RESOURCES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.app/Contents/Resources") 239 | set(MACOSX_BUNDLE_ICON "${ICONS_DIR}/${MACOSX_BUNDLE_ICON_FILE}") 240 | execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${MACOSX_BUNDLE_RESOURCES}) 241 | execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MACOSX_BUNDLE_ICON} ${MACOSX_BUNDLE_RESOURCES}) 242 | endif() 243 | 244 | add_subdirectory(install) 245 | 246 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | # YAPS - Yet Another Photo Sorter 2 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fknopkem%2Fyaps.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fknopkem%2Fyaps?ref=badge_shield) 3 | 4 | 5 | A flexible photo sorting tool that uses the EXIF information of your photos and videos to copy or move them into a structured folder hierarchy. 6 | 7 | Download the [installer] (http://sourceforge.net/projects/yapsyetanotherphotosorter) 8 | or 9 | Visit [website] (http://knopkem.github.io/yaps/) 10 | 11 | Update: use the latest release from the release page (zip file only, no installer yet) 12 | 13 | # Purpose 14 | 15 | If you are like me and have a heap of photos and videos in randomly named folders laying on your hard disk this tool might be something for you (provided you don't like it that way). It takes your photos and nicely sorts them into a new folder structure auto generated on the criteria you chose. For example like this: 16 | 17 | **[year]/[month]/[day]_[timestamp].jpg** 18 | 19 | Of course the structure can be customized to your needs. Optionally duplicate files can be removed. 20 | 21 | # Features 22 | 23 | * parses images for: create date and time, camera model and make, media type (mime type) 24 | * highly customizable folder structure 25 | * fixes duplicates based on md5sums 26 | * fixes file name clashes (auto rename) 27 | * cross-platform ready (linux, windows, mac) 28 | 29 | # Binaries 30 | 31 | * grab them here: http://sourceforge.net/projects/yapsyetanotherphotosorter 32 | 33 | # Build Instructions 34 | 35 | ## Requirements 36 | * CMAKE 37 | * Essential build tools 38 | * Qt5 39 | 40 | ## Steps 41 | * compile or install Qt library + add bin directory to path 42 | * run cmake on the project, set QT_ROOT_PREFIX to install directory of QT 43 | * build 44 | * optional (windows/mac): build package project (requires NSIS on windows) 45 | 46 | # Notes 47 | 48 | The tool uses the following projects behind: [exiv2] (http://www.exiv2.org) and [exiftool] (http://www.sno.phy.queensu.ca/~phil/exiftool). 49 | Credits go there. 50 | 51 | # Usage 52 | 53 | * you need exiv2 AND exiftool available (either from path or copied into the bin folder) 54 | * on debian linux, just install both packages 55 | * on windows, build or download prebuild executables and put them into the same folder as the application 56 | * alternatively just build the INSTALL target project or the PACKAGING target (needs NSIS on windows) 57 | 58 | # Roadmap 59 | 60 | * *watch folder* to easily drop photos from anywhere and auto import them into an existing archive 61 | * deamon/service to run in background at system start (watching the watch folder) 62 | 63 | 64 | ## License 65 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fknopkem%2Fyaps.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fknopkem%2Fyaps?ref=badge_large) -------------------------------------------------------------------------------- /changelog.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knopkem/yaps/20e9b638ee47372020716d9daf1b778d4880167c/changelog.gz -------------------------------------------------------------------------------- /cmake/DeployQt5.cmake: -------------------------------------------------------------------------------- 1 | # - Functions to help assemble a standalone Qt5 executable. 2 | # A collection of CMake utility functions useful for deploying 3 | # Qt5 executables. 4 | # 5 | # The following functions are provided by this module: 6 | # write_qt5_conf 7 | # resolve_qt5_paths 8 | # fixup_qt5_executable 9 | # install_qt5_plugin_path 10 | # install_qt5_plugin 11 | # install_qt5_executable 12 | # Requires CMake 2.6 or greater because it uses function and 13 | # PARENT_SCOPE. Also depends on BundleUtilities.cmake. 14 | # 15 | # WRITE_QT5_CONF( ) 16 | # Writes a qt.conf file with the into . 17 | # 18 | # RESOLVE_QT5_PATHS( []) 19 | # Loop through list and if any don't exist resolve them 20 | # relative to the (if supplied) or the CMAKE_INSTALL_PREFIX. 21 | # 22 | # FIXUP_QT5_EXECUTABLE( [ ]) 23 | # Copies Qt plugins, writes a Qt configuration file (if needed) and fixes up a 24 | # Qt5 executable using BundleUtilities so it is standalone and can be 25 | # drag-and-drop copied to another machine as long as all of the system 26 | # libraries are compatible. 27 | # 28 | # should point to the executable to be fixed-up. 29 | # 30 | # should contain a list of the names or paths of any Qt plugins 31 | # to be installed. 32 | # 33 | # will be passed to BundleUtilities and should be a list of any already 34 | # installed plugins, libraries or executables to also be fixed-up. 35 | # 36 | # will be passed to BundleUtilities and should contain and directories 37 | # to be searched to find library dependencies. 38 | # 39 | # allows an custom plugins directory to be used. 40 | # 41 | # will force a qt.conf file to be written even if not needed. 42 | # 43 | # INSTALL_QT5_PLUGIN_PATH(plugin executable copy installed_plugin_path_var ) 44 | # Install (or copy) a resolved to the default plugins directory 45 | # (or ) relative to and store the result in 46 | # . 47 | # 48 | # If is set to TRUE then the plugins will be copied rather than 49 | # installed. This is to allow this module to be used at CMake time rather than 50 | # install time. 51 | # 52 | # If is set then anything installed will use this COMPONENT. 53 | # 54 | # INSTALL_QT5_PLUGIN(plugin executable copy installed_plugin_path_var ) 55 | # Install (or copy) an unresolved to the default plugins directory 56 | # (or ) relative to and store the result in 57 | # . See documentation of INSTALL_QT5_PLUGIN_PATH. 58 | # 59 | # INSTALL_QT5_EXECUTABLE( [ ]) 60 | # Installs Qt plugins, writes a Qt configuration file (if needed) and fixes up 61 | # a Qt5 executable using BundleUtilities so it is standalone and can be 62 | # drag-and-drop copied to another machine as long as all of the system 63 | # libraries are compatible. The executable will be fixed-up at install time. 64 | # is the COMPONENT used for bundle fixup and plugin installation. 65 | # See documentation of FIXUP_QT5_BUNDLE. 66 | 67 | #============================================================================= 68 | # Copyright 2011 Mike McQuaid 69 | # Copyright 2013 Mihai Moldovan 70 | # CMake - Cross Platform Makefile Generator 71 | # Copyright 2000-2011 Kitware, Inc., Insight Software Consortium 72 | # All rights reserved. 73 | # 74 | # Redistribution and use in source and binary forms, with or without 75 | # modification, are permitted provided that the following conditions 76 | # are met: 77 | # 78 | # * Redistributions of source code must retain the above copyright 79 | # notice, this list of conditions and the following disclaimer. 80 | # 81 | # * Redistributions in binary form must reproduce the above copyright 82 | # notice, this list of conditions and the following disclaimer in the 83 | # documentation and/or other materials provided with the distribution. 84 | # 85 | # * Neither the names of Kitware, Inc., the Insight Software Consortium, 86 | # nor the names of their contributors may be used to endorse or promote 87 | # products derived from this software without specific prior written 88 | # permission. 89 | # 90 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 91 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 92 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 93 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 94 | # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 95 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 96 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 97 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 98 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 99 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 100 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 101 | 102 | # The functions defined in this file depend on the fixup_bundle function 103 | # (and others) found in BundleUtilities.cmake 104 | 105 | include(BundleUtilities) 106 | set(DeployQt5_cmake_dir "${CMAKE_CURRENT_LIST_DIR}") 107 | set(DeployQt5_apple_plugins_dir "PlugIns") 108 | 109 | function(write_qt5_conf qt_conf_dir qt_conf_contents) 110 | set(qt_conf_path "${qt_conf_dir}/qt.conf") 111 | message(STATUS "Writing ${qt_conf_path}") 112 | file(WRITE "${qt_conf_path}" "${qt_conf_contents}") 113 | endfunction() 114 | 115 | function(resolve_qt5_paths paths_var) 116 | set(executable_path ${ARGV1}) 117 | 118 | set(paths_resolved) 119 | foreach(path ${${paths_var}}) 120 | if(EXISTS "${path}") 121 | list(APPEND paths_resolved "${path}") 122 | else() 123 | if(${executable_path}) 124 | list(APPEND paths_resolved "${executable_path}/${path}") 125 | else() 126 | list(APPEND paths_resolved "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${path}") 127 | endif() 128 | endif() 129 | endforeach() 130 | set(${paths_var} ${paths_resolved} PARENT_SCOPE) 131 | endfunction() 132 | 133 | function(fixup_qt5_executable executable) 134 | set(qtplugins ${ARGV1}) 135 | set(libs ${ARGV2}) 136 | set(dirs ${ARGV3}) 137 | set(plugins_dir ${ARGV4}) 138 | set(request_qt_conf ${ARGV5}) 139 | 140 | message(STATUS "fixup_qt5_executable") 141 | message(STATUS " executable='${executable}'") 142 | message(STATUS " qtplugins='${qtplugins}'") 143 | message(STATUS " libs='${libs}'") 144 | message(STATUS " dirs='${dirs}'") 145 | message(STATUS " plugins_dir='${plugins_dir}'") 146 | message(STATUS " request_qt_conf='${request_qt_conf}'") 147 | 148 | if(QT_LIBRARY_DIR) 149 | list(APPEND dirs "${QT_LIBRARY_DIR}") 150 | endif() 151 | if(QT_BINARY_DIR) 152 | list(APPEND dirs "${QT_BINARY_DIR}") 153 | endif() 154 | 155 | if(APPLE) 156 | set(qt_conf_dir "${executable}/Contents/Resources") 157 | set(executable_path "${executable}") 158 | set(write_qt_conf TRUE) 159 | if(NOT plugins_dir) 160 | set(plugins_dir "${DeployQt5_apple_plugins_dir}") 161 | endif() 162 | else() 163 | get_filename_component(executable_path "${executable}" PATH) 164 | if(NOT executable_path) 165 | set(executable_path ".") 166 | endif() 167 | set(qt_conf_dir "${executable_path}") 168 | set(write_qt_conf ${request_qt_conf}) 169 | endif() 170 | 171 | foreach(plugin ${qtplugins}) 172 | set(installed_plugin_path "") 173 | install_qt5_plugin("${plugin}" "${executable}" 1 installed_plugin_path) 174 | list(APPEND libs ${installed_plugin_path}) 175 | endforeach() 176 | 177 | foreach(lib ${libs}) 178 | if(NOT EXISTS "${lib}") 179 | message(FATAL_ERROR "Library does not exist: ${lib}") 180 | endif() 181 | endforeach() 182 | 183 | resolve_qt5_paths(libs "${executable_path}") 184 | 185 | if(write_qt_conf) 186 | set(qt_conf_contents "[Paths]\nPlugins = ${plugins_dir}") 187 | write_qt5_conf("${qt_conf_dir}" "${qt_conf_contents}") 188 | endif() 189 | 190 | fixup_bundle("${executable}" "${libs}" "${dirs}") 191 | endfunction() 192 | 193 | function(install_qt5_plugin_path plugin executable copy installed_plugin_path_var) 194 | set(plugins_dir ${ARGV4}) 195 | set(component ${ARGV5}) 196 | set(configurations ${ARGV6}) 197 | if(EXISTS "${plugin}") 198 | if(APPLE) 199 | if(NOT plugins_dir) 200 | set(plugins_dir "${DeployQt5_apple_plugins_dir}") 201 | endif() 202 | set(plugins_path "${executable}/Contents/${plugins_dir}") 203 | else() 204 | get_filename_component(plugins_path "${executable}" PATH) 205 | if(NOT plugins_path) 206 | set(plugins_path ".") 207 | endif() 208 | if(plugins_dir) 209 | set(plugins_path "${plugins_path}/${plugins_dir}") 210 | endif() 211 | endif() 212 | 213 | set(plugin_group "") 214 | 215 | get_filename_component(plugin_path "${plugin}" PATH) 216 | get_filename_component(plugin_parent_path "${plugin_path}" PATH) 217 | get_filename_component(plugin_parent_dir_name "${plugin_parent_path}" NAME) 218 | get_filename_component(plugin_name "${plugin}" NAME) 219 | string(TOLOWER "${plugin_parent_dir_name}" plugin_parent_dir_name) 220 | 221 | if("${plugin_parent_dir_name}" STREQUAL "plugins") 222 | get_filename_component(plugin_group "${plugin_path}" NAME) 223 | set(${plugin_group_var} "${plugin_group}") 224 | endif() 225 | set(plugins_path "${plugins_path}/${plugin_group}") 226 | 227 | if(${copy}) 228 | file(MAKE_DIRECTORY "${plugins_path}") 229 | file(COPY "${plugin}" DESTINATION "${plugins_path}") 230 | else() 231 | if(configurations AND (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)) 232 | set(configurations CONFIGURATIONS ${configurations}) 233 | else() 234 | unset(configurations) 235 | endif() 236 | install(FILES "${plugin}" DESTINATION "${plugins_path}" ${configurations} ${component}) 237 | endif() 238 | set(${installed_plugin_path_var} "${plugins_path}/${plugin_name}" PARENT_SCOPE) 239 | endif() 240 | endfunction() 241 | 242 | function(install_qt5_plugin plugin executable copy installed_plugin_path_var) 243 | set(plugins_dir ${ARGV4}) 244 | set(component ${ARGV5}) 245 | if(EXISTS "${plugin}") 246 | install_qt5_plugin_path("${plugin}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}") 247 | else() 248 | #string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var) 249 | if(WIN32) 250 | set(libPrefix "") 251 | set(libExtension "dll") 252 | else() 253 | set(libPrefix "lib") 254 | set(libExtension "dylib") 255 | endif() 256 | set(plugin_release) 257 | set(plugin_debug) 258 | set(plugin_tmp_path) 259 | set(plugin_find_path "${Qt5Core_DIR}/../../../plugins/") 260 | get_filename_component(plugin_find_path "${plugin_find_path}" REALPATH) 261 | set(plugin_find_release_filename "${libPrefix}${plugin}.${libExtension}") 262 | set(plugin_find_debug_filename "${libPrefix}${plugin}_debug.${libExtension}") 263 | file(GLOB_RECURSE pluginlist "${plugin_find_path}" "${plugin_find_path}/*/${libPrefix}*.${libExtension}") 264 | foreach(found_plugin ${pluginlist}) 265 | get_filename_component(curname "${found_plugin}" NAME) 266 | if("${curname}" STREQUAL "${plugin_find_release_filename}") 267 | set(plugin_tmp_release_path "${found_plugin}") 268 | endif() 269 | if("${curname}" STREQUAL "${plugin_find_debug_filename}") 270 | set(plugin_tmp_debug_path "${found_plugin}") 271 | endif() 272 | endforeach() 273 | 274 | if((NOT DEFINED plugin_tmp_release_path OR NOT EXISTS "${plugin_tmp_release_path}") AND (NOT DEFINED plugin_tmp_debug_PATH OR NOT EXISTS "${plugin_tmp_debug_path}")) 275 | message(WARNING "Qt plugin \"${plugin_find_release_filename}\" not recognized or found.") 276 | endif() 277 | 278 | if(EXISTS "${plugin_tmp_release_path}") 279 | set(plugin_release "${plugin_tmp_release_path}") 280 | elseif(EXISTS "${plugin_tmp_debug_path}") 281 | set(plugin_release "${plugin_tmp_debug_path}") 282 | endif() 283 | 284 | if(EXISTS "${plugin_tmp_debug_path}") 285 | set(plugin_debug "${plugin_tmp_debug_path}") 286 | elseif(EXISTS "${plugin_tmp_release_path}") 287 | set(plugin_debug "${plugin_tmp_release_path}") 288 | endif() 289 | 290 | if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) 291 | install_qt5_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}_release" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel") 292 | install_qt5_plugin_path("${plugin_debug}" "${executable}" "${copy}" "${installed_plugin_path_var}_debug" "${plugins_dir}" "${component}" "Debug") 293 | 294 | if(CMAKE_BUILD_TYPE MATCHES "^Debug$") 295 | set(${installed_plugin_path_var} ${${installed_plugin_path_var}_debug}) 296 | else() 297 | set(${installed_plugin_path_var} ${${installed_plugin_path_var}_release}) 298 | endif() 299 | else() 300 | install_qt5_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}") 301 | endif() 302 | endif() 303 | set(${installed_plugin_path_var} ${${installed_plugin_path_var}} PARENT_SCOPE) 304 | endfunction() 305 | 306 | function(install_qt5_executable executable) 307 | set(qtplugins ${ARGV1}) 308 | set(libs ${ARGV2}) 309 | set(dirs ${ARGV3}) 310 | set(plugins_dir ${ARGV4}) 311 | set(request_qt_conf ${ARGV5}) 312 | set(component ${ARGV6}) 313 | if(QT_LIBRARY_DIR) 314 | list(APPEND dirs "${QT_LIBRARY_DIR}") 315 | endif() 316 | if(QT_BINARY_DIR) 317 | list(APPEND dirs "${QT_BINARY_DIR}") 318 | endif() 319 | if(component) 320 | set(component COMPONENT ${component}) 321 | else() 322 | unset(component) 323 | endif() 324 | 325 | get_filename_component(executable_absolute "${executable}" ABSOLUTE) 326 | if(EXISTS "${QT_QTCORE_LIBRARY_RELEASE}") 327 | gp_file_type("${executable_absolute}" "${QT_QTCORE_LIBRARY_RELEASE}" qtcore_type) 328 | elseif(EXISTS "${QT_QTCORE_LIBRARY_DEBUG}") 329 | gp_file_type("${executable_absolute}" "${QT_QTCORE_LIBRARY_DEBUG}" qtcore_type) 330 | endif() 331 | if(qtcore_type STREQUAL "system") 332 | set(qt_plugins_dir "") 333 | endif() 334 | 335 | if(QT_IS_STATIC) 336 | message(WARNING "Qt built statically: not installing plugins.") 337 | else() 338 | foreach(plugin ${qtplugins}) 339 | message(STATUS "trying to install plugin ${plugin}") 340 | set(installed_plugin_paths "") 341 | install_qt5_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${component}") 342 | list(APPEND libs ${installed_plugin_paths}) 343 | endforeach() 344 | endif() 345 | 346 | resolve_qt5_paths(libs "") 347 | 348 | install(CODE 349 | "include(\"${DeployQt5_cmake_dir}/DeployQt5.cmake\") 350 | set(BU_CHMOD_BUNDLE_ITEMS TRUE) 351 | FIXUP_QT5_EXECUTABLE(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")" 352 | ${component} 353 | ) 354 | endfunction() -------------------------------------------------------------------------------- /cmake/FindQt5.cmake: -------------------------------------------------------------------------------- 1 | find_path(QT5_ROOT_PREFIX 2 | PATHS lib/cmake/Qt5Core/Qt5CoreConfig.cmake 3 | HINTS "${CMAKE_PREFIX_PATH}" 4 | DOC "Qt5 root path") 5 | 6 | if( (NOT QT5_ROOT_PREFIX) OR (NOT IS_DIRECTORY "${QT5_ROOT_PREFIX}") ) 7 | message(FATAL_ERROR "Qt5 path not found. please set QT5_ROOT_PREFIX") 8 | endif() 9 | 10 | list(FIND CMAKE_PREFIX_PATH "${QT5_ROOT_PREFIX}" _index) 11 | if(_index LESS 0) 12 | list(APPEND CMAKE_PREFIX_PATH "${QT5_ROOT_PREFIX}") 13 | endif() 14 | 15 | 16 | 17 | # Display a little status information 18 | message(STATUS "Found Qt5 at ${QT5_ROOT_PREFIX}") 19 | 20 | -------------------------------------------------------------------------------- /cmake/doxygen.config.in: -------------------------------------------------------------------------------- 1 | # Doxyfile 1.6.3 2 | 3 | # This file describes the settings to be used by the documentation system 4 | # doxygen (www.doxygen.org) for a project 5 | # 6 | # All text after a hash (#) is considered a comment and will be ignored 7 | # The format is: 8 | # TAG = value [value, ...] 9 | # For lists items can also be appended using: 10 | # TAG += value [value, ...] 11 | # Values that contain spaces should be placed between quotes (" ") 12 | 13 | #--------------------------------------------------------------------------- 14 | # Project related configuration options 15 | #--------------------------------------------------------------------------- 16 | 17 | # This tag specifies the encoding used for all characters in the config file 18 | # that follow. The default is UTF-8 which is also the encoding used for all 19 | # text before the first occurrence of this tag. Doxygen uses libiconv (or the 20 | # iconv built into libc) for the transcoding. See 21 | # http://www.gnu.org/software/libiconv for the list of possible encodings. 22 | 23 | DOXYFILE_ENCODING = UTF-8 24 | 25 | # The PROJECT_NAME tag is a single word (or a sequence of words surrounded 26 | # by quotes) that should identify the project. 27 | 28 | PROJECT_NAME = @CMAKE_PROJECT_NAME@ 29 | 30 | # The PROJECT_NUMBER tag can be used to enter a project or revision number. 31 | # This could be handy for archiving the generated documentation or 32 | # if some version control system is used. 33 | 34 | PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_BUILD@ 35 | 36 | # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 37 | # base path where the generated documentation will be put. 38 | # If a relative path is entered, it will be relative to the location 39 | # where doxygen was started. If left blank the current directory will be used. 40 | 41 | OUTPUT_DIRECTORY = 42 | 43 | # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 44 | # 4096 sub-directories (in 2 levels) under the output directory of each output 45 | # format and will distribute the generated files over these directories. 46 | # Enabling this option can be useful when feeding doxygen a huge amount of 47 | # source files, where putting all generated files in the same directory would 48 | # otherwise cause performance problems for the file system. 49 | 50 | CREATE_SUBDIRS = NO 51 | 52 | # The OUTPUT_LANGUAGE tag is used to specify the language in which all 53 | # documentation generated by doxygen is written. Doxygen will use this 54 | # information to generate all constant output in the proper language. 55 | # The default language is English, other supported languages are: 56 | # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 57 | # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, 58 | # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 59 | # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, 60 | # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, 61 | # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. 62 | 63 | OUTPUT_LANGUAGE = English 64 | 65 | # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 66 | # include brief member descriptions after the members that are listed in 67 | # the file and class documentation (similar to JavaDoc). 68 | # Set to NO to disable this. 69 | 70 | BRIEF_MEMBER_DESC = YES 71 | 72 | # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 73 | # the brief description of a member or function before the detailed description. 74 | # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 75 | # brief descriptions will be completely suppressed. 76 | 77 | REPEAT_BRIEF = YES 78 | 79 | # This tag implements a quasi-intelligent brief description abbreviator 80 | # that is used to form the text in various listings. Each string 81 | # in this list, if found as the leading text of the brief description, will be 82 | # stripped from the text and the result after processing the whole list, is 83 | # used as the annotated text. Otherwise, the brief description is used as-is. 84 | # If left blank, the following values are used ("$name" is automatically 85 | # replaced with the name of the entity): "The $name class" "The $name widget" 86 | # "The $name file" "is" "provides" "specifies" "contains" 87 | # "represents" "a" "an" "the" 88 | 89 | ABBREVIATE_BRIEF = 90 | 91 | # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 92 | # Doxygen will generate a detailed section even if there is only a brief 93 | # description. 94 | 95 | ALWAYS_DETAILED_SEC = NO 96 | 97 | # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 98 | # inherited members of a class in the documentation of that class as if those 99 | # members were ordinary class members. Constructors, destructors and assignment 100 | # operators of the base classes will not be shown. 101 | 102 | INLINE_INHERITED_MEMB = NO 103 | 104 | # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 105 | # path before files name in the file list and in the header files. If set 106 | # to NO the shortest path that makes the file name unique will be used. 107 | 108 | FULL_PATH_NAMES = YES 109 | 110 | # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 111 | # can be used to strip a user-defined part of the path. Stripping is 112 | # only done if one of the specified strings matches the left-hand part of 113 | # the path. The tag can be used to show relative paths in the file list. 114 | # If left blank the directory from which doxygen is run is used as the 115 | # path to strip. 116 | 117 | STRIP_FROM_PATH = 118 | 119 | # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 120 | # the path mentioned in the documentation of a class, which tells 121 | # the reader which header file to include in order to use a class. 122 | # If left blank only the name of the header file containing the class 123 | # definition is used. Otherwise one should specify the include paths that 124 | # are normally passed to the compiler using the -I flag. 125 | 126 | STRIP_FROM_INC_PATH = 127 | 128 | # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 129 | # (but less readable) file names. This can be useful is your file systems 130 | # doesn't support long names like on DOS, Mac, or CD-ROM. 131 | 132 | SHORT_NAMES = YES 133 | 134 | # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 135 | # will interpret the first line (until the first dot) of a JavaDoc-style 136 | # comment as the brief description. If set to NO, the JavaDoc 137 | # comments will behave just like regular Qt-style comments 138 | # (thus requiring an explicit @brief command for a brief description.) 139 | 140 | JAVADOC_AUTOBRIEF = YES 141 | 142 | # If the QT_AUTOBRIEF tag is set to YES then Doxygen will 143 | # interpret the first line (until the first dot) of a Qt-style 144 | # comment as the brief description. If set to NO, the comments 145 | # will behave just like regular Qt-style comments (thus requiring 146 | # an explicit \brief command for a brief description.) 147 | 148 | QT_AUTOBRIEF = YES 149 | 150 | # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 151 | # treat a multi-line C++ special comment block (i.e. a block of //! or /// 152 | # comments) as a brief description. This used to be the default behaviour. 153 | # The new default is to treat a multi-line C++ comment block as a detailed 154 | # description. Set this tag to YES if you prefer the old behaviour instead. 155 | 156 | MULTILINE_CPP_IS_BRIEF = NO 157 | 158 | # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 159 | # member inherits the documentation from any documented member that it 160 | # re-implements. 161 | 162 | INHERIT_DOCS = YES 163 | 164 | # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 165 | # a new page for each member. If set to NO, the documentation of a member will 166 | # be part of the file/class/namespace that contains it. 167 | 168 | SEPARATE_MEMBER_PAGES = NO 169 | 170 | # The TAB_SIZE tag can be used to set the number of spaces in a tab. 171 | # Doxygen uses this value to replace tabs by spaces in code fragments. 172 | 173 | TAB_SIZE = 8 174 | 175 | # This tag can be used to specify a number of aliases that acts 176 | # as commands in the documentation. An alias has the form "name=value". 177 | # For example adding "sideeffect=\par Side Effects:\n" will allow you to 178 | # put the command \sideeffect (or @sideeffect) in the documentation, which 179 | # will result in a user-defined paragraph with heading "Side Effects:". 180 | # You can put \n's in the value part of an alias to insert newlines. 181 | 182 | ALIASES = 183 | 184 | # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 185 | # sources only. Doxygen will then generate output that is more tailored for C. 186 | # For instance, some of the names that are used will be different. The list 187 | # of all members will be omitted, etc. 188 | 189 | OPTIMIZE_OUTPUT_FOR_C = NO 190 | 191 | # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 192 | # sources only. Doxygen will then generate output that is more tailored for 193 | # Java. For instance, namespaces will be presented as packages, qualified 194 | # scopes will look different, etc. 195 | 196 | OPTIMIZE_OUTPUT_JAVA = NO 197 | 198 | # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 199 | # sources only. Doxygen will then generate output that is more tailored for 200 | # Fortran. 201 | 202 | OPTIMIZE_FOR_FORTRAN = NO 203 | 204 | # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 205 | # sources. Doxygen will then generate output that is tailored for 206 | # VHDL. 207 | 208 | OPTIMIZE_OUTPUT_VHDL = NO 209 | 210 | # Doxygen selects the parser to use depending on the extension of the files it parses. 211 | # With this tag you can assign which parser to use for a given extension. 212 | # Doxygen has a built-in mapping, but you can override or extend it using this tag. 213 | # The format is ext=language, where ext is a file extension, and language is one of 214 | # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, 215 | # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat 216 | # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), 217 | # use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. 218 | 219 | EXTENSION_MAPPING = 220 | 221 | # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 222 | # to include (a tag file for) the STL sources as input, then you should 223 | # set this tag to YES in order to let doxygen match functions declarations and 224 | # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 225 | # func(std::string) {}). This also make the inheritance and collaboration 226 | # diagrams that involve STL classes more complete and accurate. 227 | 228 | BUILTIN_STL_SUPPORT = YES 229 | 230 | # If you use Microsoft's C++/CLI language, you should set this option to YES to 231 | # enable parsing support. 232 | 233 | CPP_CLI_SUPPORT = NO 234 | 235 | # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 236 | # Doxygen will parse them like normal C++ but will assume all classes use public 237 | # instead of private inheritance when no explicit protection keyword is present. 238 | 239 | SIP_SUPPORT = NO 240 | 241 | # For Microsoft's IDL there are propget and propput attributes to indicate getter 242 | # and setter methods for a property. Setting this option to YES (the default) 243 | # will make doxygen to replace the get and set methods by a property in the 244 | # documentation. This will only work if the methods are indeed getting or 245 | # setting a simple type. If this is not the case, or you want to show the 246 | # methods anyway, you should set this option to NO. 247 | 248 | IDL_PROPERTY_SUPPORT = YES 249 | 250 | # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 251 | # tag is set to YES, then doxygen will reuse the documentation of the first 252 | # member in the group (if any) for the other members of the group. By default 253 | # all members of a group must be documented explicitly. 254 | 255 | DISTRIBUTE_GROUP_DOC = NO 256 | 257 | # Set the SUBGROUPING tag to YES (the default) to allow class member groups of 258 | # the same type (for instance a group of public functions) to be put as a 259 | # subgroup of that type (e.g. under the Public Functions section). Set it to 260 | # NO to prevent subgrouping. Alternatively, this can be done per class using 261 | # the \nosubgrouping command. 262 | 263 | SUBGROUPING = YES 264 | 265 | # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 266 | # is documented as struct, union, or enum with the name of the typedef. So 267 | # typedef struct TypeS {} TypeT, will appear in the documentation as a struct 268 | # with name TypeT. When disabled the typedef will appear as a member of a file, 269 | # namespace, or class. And the struct will be named TypeS. This can typically 270 | # be useful for C code in case the coding convention dictates that all compound 271 | # types are typedef'ed and only the typedef is referenced, never the tag name. 272 | 273 | TYPEDEF_HIDES_STRUCT = NO 274 | 275 | # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 276 | # determine which symbols to keep in memory and which to flush to disk. 277 | # When the cache is full, less often used symbols will be written to disk. 278 | # For small to medium size projects (<1000 input files) the default value is 279 | # probably good enough. For larger projects a too small cache size can cause 280 | # doxygen to be busy swapping symbols to and from disk most of the time 281 | # causing a significant performance penality. 282 | # If the system has enough physical memory increasing the cache will improve the 283 | # performance by keeping more symbols in memory. Note that the value works on 284 | # a logarithmic scale so increasing the size by one will rougly double the 285 | # memory usage. The cache size is given by this formula: 286 | # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 287 | # corresponding to a cache size of 2^16 = 65536 symbols 288 | 289 | SYMBOL_CACHE_SIZE = 0 290 | 291 | #--------------------------------------------------------------------------- 292 | # Build related configuration options 293 | #--------------------------------------------------------------------------- 294 | 295 | # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 296 | # documentation are documented, even if no documentation was available. 297 | # Private class members and static file members will be hidden unless 298 | # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES 299 | 300 | EXTRACT_ALL = NO 301 | 302 | # If the EXTRACT_PRIVATE tag is set to YES all private members of a class 303 | # will be included in the documentation. 304 | 305 | EXTRACT_PRIVATE = NO 306 | 307 | # If the EXTRACT_STATIC tag is set to YES all static members of a file 308 | # will be included in the documentation. 309 | 310 | EXTRACT_STATIC = NO 311 | 312 | # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 313 | # defined locally in source files will be included in the documentation. 314 | # If set to NO only classes defined in header files are included. 315 | 316 | EXTRACT_LOCAL_CLASSES = YES 317 | 318 | # This flag is only useful for Objective-C code. When set to YES local 319 | # methods, which are defined in the implementation section but not in 320 | # the interface are included in the documentation. 321 | # If set to NO (the default) only methods in the interface are included. 322 | 323 | EXTRACT_LOCAL_METHODS = NO 324 | 325 | # If this flag is set to YES, the members of anonymous namespaces will be 326 | # extracted and appear in the documentation as a namespace called 327 | # 'anonymous_namespace{file}', where file will be replaced with the base 328 | # name of the file that contains the anonymous namespace. By default 329 | # anonymous namespace are hidden. 330 | 331 | EXTRACT_ANON_NSPACES = NO 332 | 333 | # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 334 | # undocumented members of documented classes, files or namespaces. 335 | # If set to NO (the default) these members will be included in the 336 | # various overviews, but no documentation section is generated. 337 | # This option has no effect if EXTRACT_ALL is enabled. 338 | 339 | HIDE_UNDOC_MEMBERS = NO 340 | 341 | # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 342 | # undocumented classes that are normally visible in the class hierarchy. 343 | # If set to NO (the default) these classes will be included in the various 344 | # overviews. This option has no effect if EXTRACT_ALL is enabled. 345 | 346 | HIDE_UNDOC_CLASSES = NO 347 | 348 | # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 349 | # friend (class|struct|union) declarations. 350 | # If set to NO (the default) these declarations will be included in the 351 | # documentation. 352 | 353 | HIDE_FRIEND_COMPOUNDS = NO 354 | 355 | # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 356 | # documentation blocks found inside the body of a function. 357 | # If set to NO (the default) these blocks will be appended to the 358 | # function's detailed documentation block. 359 | 360 | HIDE_IN_BODY_DOCS = NO 361 | 362 | # The INTERNAL_DOCS tag determines if documentation 363 | # that is typed after a \internal command is included. If the tag is set 364 | # to NO (the default) then the documentation will be excluded. 365 | # Set it to YES to include the internal documentation. 366 | 367 | INTERNAL_DOCS = NO 368 | 369 | # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 370 | # file names in lower-case letters. If set to YES upper-case letters are also 371 | # allowed. This is useful if you have classes or files whose names only differ 372 | # in case and if your file system supports case sensitive file names. Windows 373 | # and Mac users are advised to set this option to NO. 374 | 375 | CASE_SENSE_NAMES = YES 376 | 377 | # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 378 | # will show members with their full class and namespace scopes in the 379 | # documentation. If set to YES the scope will be hidden. 380 | 381 | HIDE_SCOPE_NAMES = NO 382 | 383 | # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 384 | # will put a list of the files that are included by a file in the documentation 385 | # of that file. 386 | 387 | SHOW_INCLUDE_FILES = YES 388 | 389 | # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen 390 | # will list include files with double quotes in the documentation 391 | # rather than with sharp brackets. 392 | 393 | FORCE_LOCAL_INCLUDES = NO 394 | 395 | # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 396 | # is inserted in the documentation for inline members. 397 | 398 | INLINE_INFO = YES 399 | 400 | # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 401 | # will sort the (detailed) documentation of file and class members 402 | # alphabetically by member name. If set to NO the members will appear in 403 | # declaration order. 404 | 405 | SORT_MEMBER_DOCS = YES 406 | 407 | # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 408 | # brief documentation of file, namespace and class members alphabetically 409 | # by member name. If set to NO (the default) the members will appear in 410 | # declaration order. 411 | 412 | SORT_BRIEF_DOCS = NO 413 | 414 | # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. 415 | 416 | SORT_MEMBERS_CTORS_1ST = NO 417 | 418 | # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 419 | # hierarchy of group names into alphabetical order. If set to NO (the default) 420 | # the group names will appear in their defined order. 421 | 422 | SORT_GROUP_NAMES = NO 423 | 424 | # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 425 | # sorted by fully-qualified names, including namespaces. If set to 426 | # NO (the default), the class list will be sorted only by class name, 427 | # not including the namespace part. 428 | # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 429 | # Note: This option applies only to the class list, not to the 430 | # alphabetical list. 431 | 432 | SORT_BY_SCOPE_NAME = NO 433 | 434 | # The GENERATE_TODOLIST tag can be used to enable (YES) or 435 | # disable (NO) the todo list. This list is created by putting \todo 436 | # commands in the documentation. 437 | 438 | GENERATE_TODOLIST = NO 439 | 440 | # The GENERATE_TESTLIST tag can be used to enable (YES) or 441 | # disable (NO) the test list. This list is created by putting \test 442 | # commands in the documentation. 443 | 444 | GENERATE_TESTLIST = NO 445 | 446 | # The GENERATE_BUGLIST tag can be used to enable (YES) or 447 | # disable (NO) the bug list. This list is created by putting \bug 448 | # commands in the documentation. 449 | 450 | GENERATE_BUGLIST = NO 451 | 452 | # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 453 | # disable (NO) the deprecated list. This list is created by putting 454 | # \deprecated commands in the documentation. 455 | 456 | GENERATE_DEPRECATEDLIST= NO 457 | 458 | # The ENABLED_SECTIONS tag can be used to enable conditional 459 | # documentation sections, marked by \if sectionname ... \endif. 460 | 461 | ENABLED_SECTIONS = 462 | 463 | # The MAX_INITIALIZER_LINES tag determines the maximum number of lines 464 | # the initial value of a variable or define consists of for it to appear in 465 | # the documentation. If the initializer consists of more lines than specified 466 | # here it will be hidden. Use a value of 0 to hide initializers completely. 467 | # The appearance of the initializer of individual variables and defines in the 468 | # documentation can be controlled using \showinitializer or \hideinitializer 469 | # command in the documentation regardless of this setting. 470 | 471 | MAX_INITIALIZER_LINES = 30 472 | 473 | # Set the SHOW_USED_FILES tag to NO to disable the list of files generated 474 | # at the bottom of the documentation of classes and structs. If set to YES the 475 | # list will mention the files that were used to generate the documentation. 476 | 477 | SHOW_USED_FILES = NO 478 | 479 | # If the sources in your project are distributed over multiple directories 480 | # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 481 | # in the documentation. The default is NO. 482 | 483 | SHOW_DIRECTORIES = NO 484 | 485 | # Set the SHOW_FILES tag to NO to disable the generation of the Files page. 486 | # This will remove the Files entry from the Quick Index and from the 487 | # Folder Tree View (if specified). The default is YES. 488 | 489 | SHOW_FILES = NO 490 | 491 | # Set the SHOW_NAMESPACES tag to NO to disable the generation of the 492 | # Namespaces page. 493 | # This will remove the Namespaces entry from the Quick Index 494 | # and from the Folder Tree View (if specified). The default is YES. 495 | 496 | SHOW_NAMESPACES = NO 497 | 498 | # The FILE_VERSION_FILTER tag can be used to specify a program or script that 499 | # doxygen should invoke to get the current version for each file (typically from 500 | # the version control system). Doxygen will invoke the program by executing (via 501 | # popen()) the command , where is the value of 502 | # the FILE_VERSION_FILTER tag, and is the name of an input file 503 | # provided by doxygen. Whatever the program writes to standard output 504 | # is used as the file version. See the manual for examples. 505 | 506 | FILE_VERSION_FILTER = 507 | 508 | # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by 509 | # doxygen. The layout file controls the global structure of the generated output files 510 | # in an output format independent way. The create the layout file that represents 511 | # doxygen's defaults, run doxygen with the -l option. You can optionally specify a 512 | # file name after the option, if omitted DoxygenLayout.xml will be used as the name 513 | # of the layout file. 514 | 515 | LAYOUT_FILE = 516 | 517 | #--------------------------------------------------------------------------- 518 | # configuration options related to warning and progress messages 519 | #--------------------------------------------------------------------------- 520 | 521 | # The QUIET tag can be used to turn on/off the messages that are generated 522 | # by doxygen. Possible values are YES and NO. If left blank NO is used. 523 | 524 | QUIET = NO 525 | 526 | # The WARNINGS tag can be used to turn on/off the warning messages that are 527 | # generated by doxygen. Possible values are YES and NO. If left blank 528 | # NO is used. 529 | 530 | WARNINGS = YES 531 | 532 | # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 533 | # for undocumented members. If EXTRACT_ALL is set to YES then this flag will 534 | # automatically be disabled. 535 | 536 | WARN_IF_UNDOCUMENTED = YES 537 | 538 | # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 539 | # potential errors in the documentation, such as not documenting some 540 | # parameters in a documented function, or documenting parameters that 541 | # don't exist or using markup commands wrongly. 542 | 543 | WARN_IF_DOC_ERROR = YES 544 | 545 | # This WARN_NO_PARAMDOC option can be abled to get warnings for 546 | # functions that are documented, but have no documentation for their parameters 547 | # or return value. If set to NO (the default) doxygen will only warn about 548 | # wrong or incomplete parameter documentation, but not about the absence of 549 | # documentation. 550 | 551 | WARN_NO_PARAMDOC = NO 552 | 553 | # The WARN_FORMAT tag determines the format of the warning messages that 554 | # doxygen can produce. The string should contain the $file, $line, and $text 555 | # tags, which will be replaced by the file and line number from which the 556 | # warning originated and the warning text. Optionally the format may contain 557 | # $version, which will be replaced by the version of the file (if it could 558 | # be obtained via FILE_VERSION_FILTER) 559 | 560 | WARN_FORMAT = "$file:$line: $text" 561 | 562 | # The WARN_LOGFILE tag can be used to specify a file to which warning 563 | # and error messages should be written. If left blank the output is written 564 | # to stderr. 565 | 566 | WARN_LOGFILE = 567 | 568 | #--------------------------------------------------------------------------- 569 | # configuration options related to the input files 570 | #--------------------------------------------------------------------------- 571 | 572 | # The INPUT tag can be used to specify the files and/or directories that contain 573 | # documented source files. You may enter file names like "myfile.cpp" or 574 | # directories like "/usr/src/myproject". Separate the files or directories 575 | # with spaces. 576 | 577 | INPUT = @PROJECT_SOURCE_DIR@/src 578 | 579 | # This tag can be used to specify the character encoding of the source files 580 | # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 581 | # also the default input encoding. Doxygen uses libiconv (or the iconv built 582 | # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 583 | # the list of possible encodings. 584 | 585 | INPUT_ENCODING = UTF-8 586 | 587 | # If the value of the INPUT tag contains directories, you can use the 588 | # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 589 | # and *.h) to filter out the source-files in the directories. If left 590 | # blank the following patterns are tested: 591 | # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 592 | # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 593 | 594 | FILE_PATTERNS = *.h 595 | 596 | # The RECURSIVE tag can be used to turn specify whether or not subdirectories 597 | # should be searched for input files as well. Possible values are YES and NO. 598 | # If left blank NO is used. 599 | 600 | RECURSIVE = NO 601 | 602 | # The EXCLUDE tag can be used to specify files and/or directories that should 603 | # excluded from the INPUT source files. This way you can easily exclude a 604 | # subdirectory from a directory tree whose root is specified with the INPUT tag. 605 | 606 | EXCLUDE = 607 | 608 | # The EXCLUDE_SYMLINKS tag can be used select whether or not files or 609 | # directories that are symbolic links (a Unix filesystem feature) are excluded 610 | # from the input. 611 | 612 | EXCLUDE_SYMLINKS = NO 613 | 614 | # If the value of the INPUT tag contains directories, you can use the 615 | # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 616 | # certain files from those directories. Note that the wildcards are matched 617 | # against the file with absolute path, so to exclude all test directories 618 | # for example use the pattern */test/* 619 | 620 | EXCLUDE_PATTERNS = 621 | 622 | # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 623 | # (namespaces, classes, functions, etc.) that should be excluded from the 624 | # output. The symbol name can be a fully qualified name, a word, or if the 625 | # wildcard * is used, a substring. Examples: ANamespace, AClass, 626 | # AClass::ANamespace, ANamespace::*Test 627 | 628 | EXCLUDE_SYMBOLS = 629 | 630 | # The EXAMPLE_PATH tag can be used to specify one or more files or 631 | # directories that contain example code fragments that are included (see 632 | # the \include command). 633 | 634 | EXAMPLE_PATH = 635 | 636 | # If the value of the EXAMPLE_PATH tag contains directories, you can use the 637 | # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 638 | # and *.h) to filter out the source-files in the directories. If left 639 | # blank all files are included. 640 | 641 | EXAMPLE_PATTERNS = 642 | 643 | # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 644 | # searched for input files to be used with the \include or \dontinclude 645 | # commands irrespective of the value of the RECURSIVE tag. 646 | # Possible values are YES and NO. If left blank NO is used. 647 | 648 | EXAMPLE_RECURSIVE = NO 649 | 650 | # The IMAGE_PATH tag can be used to specify one or more files or 651 | # directories that contain image that are included in the documentation (see 652 | # the \image command). 653 | 654 | IMAGE_PATH = 655 | 656 | # The INPUT_FILTER tag can be used to specify a program that doxygen should 657 | # invoke to filter for each input file. Doxygen will invoke the filter program 658 | # by executing (via popen()) the command , where 659 | # is the value of the INPUT_FILTER tag, and is the name of an 660 | # input file. Doxygen will then use the output that the filter program writes 661 | # to standard output. 662 | # If FILTER_PATTERNS is specified, this tag will be 663 | # ignored. 664 | 665 | INPUT_FILTER = 666 | 667 | # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 668 | # basis. 669 | # Doxygen will compare the file name with each pattern and apply the 670 | # filter if there is a match. 671 | # The filters are a list of the form: 672 | # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 673 | # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 674 | # is applied to all files. 675 | 676 | FILTER_PATTERNS = 677 | 678 | # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 679 | # INPUT_FILTER) will be used to filter the input files when producing source 680 | # files to browse (i.e. when SOURCE_BROWSER is set to YES). 681 | 682 | FILTER_SOURCE_FILES = NO 683 | 684 | #--------------------------------------------------------------------------- 685 | # configuration options related to source browsing 686 | #--------------------------------------------------------------------------- 687 | 688 | # If the SOURCE_BROWSER tag is set to YES then a list of source files will 689 | # be generated. Documented entities will be cross-referenced with these sources. 690 | # Note: To get rid of all source code in the generated output, make sure also 691 | # VERBATIM_HEADERS is set to NO. 692 | 693 | SOURCE_BROWSER = NO 694 | 695 | # Setting the INLINE_SOURCES tag to YES will include the body 696 | # of functions and classes directly in the documentation. 697 | 698 | INLINE_SOURCES = NO 699 | 700 | # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 701 | # doxygen to hide any special comment blocks from generated source code 702 | # fragments. Normal C and C++ comments will always remain visible. 703 | 704 | STRIP_CODE_COMMENTS = YES 705 | 706 | # If the REFERENCED_BY_RELATION tag is set to YES 707 | # then for each documented function all documented 708 | # functions referencing it will be listed. 709 | 710 | REFERENCED_BY_RELATION = NO 711 | 712 | # If the REFERENCES_RELATION tag is set to YES 713 | # then for each documented function all documented entities 714 | # called/used by that function will be listed. 715 | 716 | REFERENCES_RELATION = NO 717 | 718 | # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 719 | # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 720 | # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 721 | # link to the source code. 722 | # Otherwise they will link to the documentation. 723 | 724 | REFERENCES_LINK_SOURCE = YES 725 | 726 | # If the USE_HTAGS tag is set to YES then the references to source code 727 | # will point to the HTML generated by the htags(1) tool instead of doxygen 728 | # built-in source browser. The htags tool is part of GNU's global source 729 | # tagging system (see http://www.gnu.org/software/global/global.html). You 730 | # will need version 4.8.6 or higher. 731 | 732 | USE_HTAGS = NO 733 | 734 | # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 735 | # will generate a verbatim copy of the header file for each class for 736 | # which an include is specified. Set to NO to disable this. 737 | 738 | VERBATIM_HEADERS = YES 739 | 740 | #--------------------------------------------------------------------------- 741 | # configuration options related to the alphabetical class index 742 | #--------------------------------------------------------------------------- 743 | 744 | # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 745 | # of all compounds will be generated. Enable this if the project 746 | # contains a lot of classes, structs, unions or interfaces. 747 | 748 | ALPHABETICAL_INDEX = NO 749 | 750 | # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 751 | # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 752 | # in which this list will be split (can be a number in the range [1..20]) 753 | 754 | COLS_IN_ALPHA_INDEX = 5 755 | 756 | # In case all classes in a project start with a common prefix, all 757 | # classes will be put under the same header in the alphabetical index. 758 | # The IGNORE_PREFIX tag can be used to specify one or more prefixes that 759 | # should be ignored while generating the index headers. 760 | 761 | IGNORE_PREFIX = 762 | 763 | #--------------------------------------------------------------------------- 764 | # configuration options related to the HTML output 765 | #--------------------------------------------------------------------------- 766 | 767 | # If the GENERATE_HTML tag is set to YES (the default) Doxygen will 768 | # generate HTML output. 769 | 770 | GENERATE_HTML = YES 771 | 772 | # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 773 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 774 | # put in front of it. If left blank `html' will be used as the default path. 775 | 776 | HTML_OUTPUT = html 777 | 778 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for 779 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank 780 | # doxygen will generate files with .html extension. 781 | 782 | HTML_FILE_EXTENSION = .html 783 | 784 | # The HTML_HEADER tag can be used to specify a personal HTML header for 785 | # each generated HTML page. If it is left blank doxygen will generate a 786 | # standard header. 787 | 788 | HTML_HEADER = 789 | 790 | # The HTML_FOOTER tag can be used to specify a personal HTML footer for 791 | # each generated HTML page. If it is left blank doxygen will generate a 792 | # standard footer. 793 | 794 | HTML_FOOTER = 795 | 796 | # The HTML_STYLESHEET tag can be used to specify a user-defined cascading 797 | # style sheet that is used by each HTML page. It can be used to 798 | # fine-tune the look of the HTML output. If the tag is left blank doxygen 799 | # will generate a default style sheet. Note that doxygen will try to copy 800 | # the style sheet file to the HTML output directory, so don't put your own 801 | # stylesheet in the HTML output directory as well, or it will be erased! 802 | 803 | HTML_STYLESHEET = 804 | 805 | # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML 806 | # page will contain the date and time when the page was generated. Setting 807 | # this to NO can help when comparing the output of multiple runs. 808 | 809 | HTML_TIMESTAMP = YES 810 | 811 | # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 812 | # files or namespaces will be aligned in HTML using tables. If set to 813 | # NO a bullet list will be used. 814 | 815 | HTML_ALIGN_MEMBERS = YES 816 | 817 | # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 818 | # documentation will contain sections that can be hidden and shown after the 819 | # page has loaded. For this to work a browser that supports 820 | # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 821 | # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). 822 | 823 | HTML_DYNAMIC_SECTIONS = NO 824 | 825 | # If the GENERATE_DOCSET tag is set to YES, additional index files 826 | # will be generated that can be used as input for Apple's Xcode 3 827 | # integrated development environment, introduced with OSX 10.5 (Leopard). 828 | # To create a documentation set, doxygen will generate a Makefile in the 829 | # HTML output directory. Running make will produce the docset in that 830 | # directory and running "make install" will install the docset in 831 | # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 832 | # it at startup. 833 | # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. 834 | 835 | GENERATE_DOCSET = NO 836 | 837 | # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 838 | # feed. A documentation feed provides an umbrella under which multiple 839 | # documentation sets from a single provider (such as a company or product suite) 840 | # can be grouped. 841 | 842 | DOCSET_FEEDNAME = "Doxygen generated docs" 843 | 844 | # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 845 | # should uniquely identify the documentation set bundle. This should be a 846 | # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 847 | # will append .docset to the name. 848 | 849 | DOCSET_BUNDLE_ID = org.doxygen.Project 850 | 851 | # If the GENERATE_HTMLHELP tag is set to YES, additional index files 852 | # will be generated that can be used as input for tools like the 853 | # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 854 | # of the generated HTML documentation. 855 | 856 | GENERATE_HTMLHELP = NO 857 | 858 | # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 859 | # be used to specify the file name of the resulting .chm file. You 860 | # can add a path in front of the file if the result should not be 861 | # written to the html output directory. 862 | 863 | CHM_FILE = 864 | 865 | # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 866 | # be used to specify the location (absolute path including file name) of 867 | # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 868 | # the HTML help compiler on the generated index.hhp. 869 | 870 | HHC_LOCATION = 871 | 872 | # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 873 | # controls if a separate .chi index file is generated (YES) or that 874 | # it should be included in the master .chm file (NO). 875 | 876 | GENERATE_CHI = NO 877 | 878 | # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING 879 | # is used to encode HtmlHelp index (hhk), content (hhc) and project file 880 | # content. 881 | 882 | CHM_INDEX_ENCODING = 883 | 884 | # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 885 | # controls whether a binary table of contents is generated (YES) or a 886 | # normal table of contents (NO) in the .chm file. 887 | 888 | BINARY_TOC = NO 889 | 890 | # The TOC_EXPAND flag can be set to YES to add extra items for group members 891 | # to the contents of the HTML help documentation and to the tree view. 892 | 893 | TOC_EXPAND = NO 894 | 895 | # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER 896 | # are set, an additional index file will be generated that can be used as input for 897 | # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated 898 | # HTML documentation. 899 | 900 | GENERATE_QHP = NO 901 | 902 | # If the QHG_LOCATION tag is specified, the QCH_FILE tag can 903 | # be used to specify the file name of the resulting .qch file. 904 | # The path specified is relative to the HTML output folder. 905 | 906 | QCH_FILE = 907 | 908 | # The QHP_NAMESPACE tag specifies the namespace to use when generating 909 | # Qt Help Project output. For more information please see 910 | # http://doc.trolltech.com/qthelpproject.html#namespace 911 | 912 | QHP_NAMESPACE = org.doxygen.Project 913 | 914 | # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 915 | # Qt Help Project output. For more information please see 916 | # http://doc.trolltech.com/qthelpproject.html#virtual-folders 917 | 918 | QHP_VIRTUAL_FOLDER = doc 919 | 920 | # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. 921 | # For more information please see 922 | # http://doc.trolltech.com/qthelpproject.html#custom-filters 923 | 924 | QHP_CUST_FILTER_NAME = 925 | 926 | # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see 927 | # Qt Help Project / Custom Filters. 928 | 929 | QHP_CUST_FILTER_ATTRS = 930 | 931 | # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's 932 | # filter section matches. 933 | # Qt Help Project / Filter Attributes. 934 | 935 | QHP_SECT_FILTER_ATTRS = 936 | 937 | # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 938 | # be used to specify the location of Qt's qhelpgenerator. 939 | # If non-empty doxygen will try to run qhelpgenerator on the generated 940 | # .qhp file. 941 | 942 | QHG_LOCATION = 943 | 944 | # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files 945 | # will be generated, which together with the HTML files, form an Eclipse help 946 | # plugin. To install this plugin and make it available under the help contents 947 | # menu in Eclipse, the contents of the directory containing the HTML and XML 948 | # files needs to be copied into the plugins directory of eclipse. The name of 949 | # the directory within the plugins directory should be the same as 950 | # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears. 951 | 952 | GENERATE_ECLIPSEHELP = NO 953 | 954 | # A unique identifier for the eclipse help plugin. When installing the plugin 955 | # the directory name containing the HTML and XML files should also have 956 | # this name. 957 | 958 | ECLIPSE_DOC_ID = org.doxygen.Project 959 | 960 | # The DISABLE_INDEX tag can be used to turn on/off the condensed index at 961 | # top of each HTML page. The value NO (the default) enables the index and 962 | # the value YES disables it. 963 | 964 | DISABLE_INDEX = NO 965 | 966 | # This tag can be used to set the number of enum values (range [1..20]) 967 | # that doxygen will group on one line in the generated HTML documentation. 968 | 969 | ENUM_VALUES_PER_LINE = 4 970 | 971 | # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 972 | # structure should be generated to display hierarchical information. 973 | # If the tag value is set to YES, a side panel will be generated 974 | # containing a tree-like index structure (just like the one that 975 | # is generated for HTML Help). For this to work a browser that supports 976 | # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). 977 | # Windows users are probably better off using the HTML help feature. 978 | 979 | GENERATE_TREEVIEW = NO 980 | 981 | # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, 982 | # and Class Hierarchy pages using a tree view instead of an ordered list. 983 | 984 | USE_INLINE_TREES = NO 985 | 986 | # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 987 | # used to set the initial width (in pixels) of the frame in which the tree 988 | # is shown. 989 | 990 | TREEVIEW_WIDTH = 250 991 | 992 | # Use this tag to change the font size of Latex formulas included 993 | # as images in the HTML documentation. The default is 10. Note that 994 | # when you change the font size after a successful doxygen run you need 995 | # to manually remove any form_*.png images from the HTML output directory 996 | # to force them to be regenerated. 997 | 998 | FORMULA_FONTSIZE = 10 999 | 1000 | # When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript 1001 | # and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should 1002 | # typically be disabled. For large projects the javascript based search engine 1003 | # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. 1004 | 1005 | SEARCHENGINE = YES 1006 | 1007 | # When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index 1008 | # file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup 1009 | # and does not have live searching capabilities. 1010 | 1011 | SERVER_BASED_SEARCH = NO 1012 | 1013 | #--------------------------------------------------------------------------- 1014 | # configuration options related to the LaTeX output 1015 | #--------------------------------------------------------------------------- 1016 | 1017 | # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 1018 | # generate Latex output. 1019 | 1020 | GENERATE_LATEX = NO 1021 | 1022 | # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 1023 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1024 | # put in front of it. If left blank `latex' will be used as the default path. 1025 | 1026 | LATEX_OUTPUT = latex 1027 | 1028 | # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 1029 | # invoked. If left blank `latex' will be used as the default command name. 1030 | # Note that when enabling USE_PDFLATEX this option is only used for 1031 | # generating bitmaps for formulas in the HTML output, but not in the 1032 | # Makefile that is written to the output directory. 1033 | 1034 | LATEX_CMD_NAME = latex 1035 | 1036 | # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 1037 | # generate index for LaTeX. If left blank `makeindex' will be used as the 1038 | # default command name. 1039 | 1040 | MAKEINDEX_CMD_NAME = makeindex 1041 | 1042 | # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 1043 | # LaTeX documents. This may be useful for small projects and may help to 1044 | # save some trees in general. 1045 | 1046 | COMPACT_LATEX = NO 1047 | 1048 | # The PAPER_TYPE tag can be used to set the paper type that is used 1049 | # by the printer. Possible values are: a4, a4wide, letter, legal and 1050 | # executive. If left blank a4wide will be used. 1051 | 1052 | PAPER_TYPE = a4wide 1053 | 1054 | # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 1055 | # packages that should be included in the LaTeX output. 1056 | 1057 | EXTRA_PACKAGES = 1058 | 1059 | # The LATEX_HEADER tag can be used to specify a personal LaTeX header for 1060 | # the generated latex document. The header should contain everything until 1061 | # the first chapter. If it is left blank doxygen will generate a 1062 | # standard header. Notice: only use this tag if you know what you are doing! 1063 | 1064 | LATEX_HEADER = 1065 | 1066 | # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 1067 | # is prepared for conversion to pdf (using ps2pdf). The pdf file will 1068 | # contain links (just like the HTML output) instead of page references 1069 | # This makes the output suitable for online browsing using a pdf viewer. 1070 | 1071 | PDF_HYPERLINKS = YES 1072 | 1073 | # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 1074 | # plain latex in the generated Makefile. Set this option to YES to get a 1075 | # higher quality PDF documentation. 1076 | 1077 | USE_PDFLATEX = YES 1078 | 1079 | # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 1080 | # command to the generated LaTeX files. This will instruct LaTeX to keep 1081 | # running if errors occur, instead of asking the user for help. 1082 | # This option is also used when generating formulas in HTML. 1083 | 1084 | LATEX_BATCHMODE = NO 1085 | 1086 | # If LATEX_HIDE_INDICES is set to YES then doxygen will not 1087 | # include the index chapters (such as File Index, Compound Index, etc.) 1088 | # in the output. 1089 | 1090 | LATEX_HIDE_INDICES = NO 1091 | 1092 | # If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. 1093 | 1094 | LATEX_SOURCE_CODE = NO 1095 | 1096 | #--------------------------------------------------------------------------- 1097 | # configuration options related to the RTF output 1098 | #--------------------------------------------------------------------------- 1099 | 1100 | # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 1101 | # The RTF output is optimized for Word 97 and may not look very pretty with 1102 | # other RTF readers or editors. 1103 | 1104 | GENERATE_RTF = NO 1105 | 1106 | # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 1107 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1108 | # put in front of it. If left blank `rtf' will be used as the default path. 1109 | 1110 | RTF_OUTPUT = rtf 1111 | 1112 | # If the COMPACT_RTF tag is set to YES Doxygen generates more compact 1113 | # RTF documents. This may be useful for small projects and may help to 1114 | # save some trees in general. 1115 | 1116 | COMPACT_RTF = NO 1117 | 1118 | # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 1119 | # will contain hyperlink fields. The RTF file will 1120 | # contain links (just like the HTML output) instead of page references. 1121 | # This makes the output suitable for online browsing using WORD or other 1122 | # programs which support those fields. 1123 | # Note: wordpad (write) and others do not support links. 1124 | 1125 | RTF_HYPERLINKS = NO 1126 | 1127 | # Load stylesheet definitions from file. Syntax is similar to doxygen's 1128 | # config file, i.e. a series of assignments. You only have to provide 1129 | # replacements, missing definitions are set to their default value. 1130 | 1131 | RTF_STYLESHEET_FILE = 1132 | 1133 | # Set optional variables used in the generation of an rtf document. 1134 | # Syntax is similar to doxygen's config file. 1135 | 1136 | RTF_EXTENSIONS_FILE = 1137 | 1138 | #--------------------------------------------------------------------------- 1139 | # configuration options related to the man page output 1140 | #--------------------------------------------------------------------------- 1141 | 1142 | # If the GENERATE_MAN tag is set to YES (the default) Doxygen will 1143 | # generate man pages 1144 | 1145 | GENERATE_MAN = NO 1146 | 1147 | # The MAN_OUTPUT tag is used to specify where the man pages will be put. 1148 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1149 | # put in front of it. If left blank `man' will be used as the default path. 1150 | 1151 | MAN_OUTPUT = man 1152 | 1153 | # The MAN_EXTENSION tag determines the extension that is added to 1154 | # the generated man pages (default is the subroutine's section .3) 1155 | 1156 | MAN_EXTENSION = .3 1157 | 1158 | # If the MAN_LINKS tag is set to YES and Doxygen generates man output, 1159 | # then it will generate one additional man file for each entity 1160 | # documented in the real man page(s). These additional files 1161 | # only source the real man page, but without them the man command 1162 | # would be unable to find the correct page. The default is NO. 1163 | 1164 | MAN_LINKS = NO 1165 | 1166 | #--------------------------------------------------------------------------- 1167 | # configuration options related to the XML output 1168 | #--------------------------------------------------------------------------- 1169 | 1170 | # If the GENERATE_XML tag is set to YES Doxygen will 1171 | # generate an XML file that captures the structure of 1172 | # the code including all documentation. 1173 | 1174 | GENERATE_XML = NO 1175 | 1176 | # The XML_OUTPUT tag is used to specify where the XML pages will be put. 1177 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1178 | # put in front of it. If left blank `xml' will be used as the default path. 1179 | 1180 | XML_OUTPUT = xml 1181 | 1182 | # The XML_SCHEMA tag can be used to specify an XML schema, 1183 | # which can be used by a validating XML parser to check the 1184 | # syntax of the XML files. 1185 | 1186 | XML_SCHEMA = 1187 | 1188 | # The XML_DTD tag can be used to specify an XML DTD, 1189 | # which can be used by a validating XML parser to check the 1190 | # syntax of the XML files. 1191 | 1192 | XML_DTD = 1193 | 1194 | # If the XML_PROGRAMLISTING tag is set to YES Doxygen will 1195 | # dump the program listings (including syntax highlighting 1196 | # and cross-referencing information) to the XML output. Note that 1197 | # enabling this will significantly increase the size of the XML output. 1198 | 1199 | XML_PROGRAMLISTING = YES 1200 | 1201 | #--------------------------------------------------------------------------- 1202 | # configuration options for the AutoGen Definitions output 1203 | #--------------------------------------------------------------------------- 1204 | 1205 | # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 1206 | # generate an AutoGen Definitions (see autogen.sf.net) file 1207 | # that captures the structure of the code including all 1208 | # documentation. Note that this feature is still experimental 1209 | # and incomplete at the moment. 1210 | 1211 | GENERATE_AUTOGEN_DEF = NO 1212 | 1213 | #--------------------------------------------------------------------------- 1214 | # configuration options related to the Perl module output 1215 | #--------------------------------------------------------------------------- 1216 | 1217 | # If the GENERATE_PERLMOD tag is set to YES Doxygen will 1218 | # generate a Perl module file that captures the structure of 1219 | # the code including all documentation. Note that this 1220 | # feature is still experimental and incomplete at the 1221 | # moment. 1222 | 1223 | GENERATE_PERLMOD = NO 1224 | 1225 | # If the PERLMOD_LATEX tag is set to YES Doxygen will generate 1226 | # the necessary Makefile rules, Perl scripts and LaTeX code to be able 1227 | # to generate PDF and DVI output from the Perl module output. 1228 | 1229 | PERLMOD_LATEX = NO 1230 | 1231 | # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 1232 | # nicely formatted so it can be parsed by a human reader. 1233 | # This is useful 1234 | # if you want to understand what is going on. 1235 | # On the other hand, if this 1236 | # tag is set to NO the size of the Perl module output will be much smaller 1237 | # and Perl will parse it just the same. 1238 | 1239 | PERLMOD_PRETTY = YES 1240 | 1241 | # The names of the make variables in the generated doxyrules.make file 1242 | # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 1243 | # This is useful so different doxyrules.make files included by the same 1244 | # Makefile don't overwrite each other's variables. 1245 | 1246 | PERLMOD_MAKEVAR_PREFIX = 1247 | 1248 | #--------------------------------------------------------------------------- 1249 | # Configuration options related to the preprocessor 1250 | #--------------------------------------------------------------------------- 1251 | 1252 | # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 1253 | # evaluate all C-preprocessor directives found in the sources and include 1254 | # files. 1255 | 1256 | ENABLE_PREPROCESSING = YES 1257 | 1258 | # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 1259 | # names in the source code. If set to NO (the default) only conditional 1260 | # compilation will be performed. Macro expansion can be done in a controlled 1261 | # way by setting EXPAND_ONLY_PREDEF to YES. 1262 | 1263 | MACRO_EXPANSION = NO 1264 | 1265 | # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 1266 | # then the macro expansion is limited to the macros specified with the 1267 | # PREDEFINED and EXPAND_AS_DEFINED tags. 1268 | 1269 | EXPAND_ONLY_PREDEF = NO 1270 | 1271 | # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 1272 | # in the INCLUDE_PATH (see below) will be search if a #include is found. 1273 | 1274 | SEARCH_INCLUDES = YES 1275 | 1276 | # The INCLUDE_PATH tag can be used to specify one or more directories that 1277 | # contain include files that are not input files but should be processed by 1278 | # the preprocessor. 1279 | 1280 | INCLUDE_PATH = 1281 | 1282 | # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 1283 | # patterns (like *.h and *.hpp) to filter out the header-files in the 1284 | # directories. If left blank, the patterns specified with FILE_PATTERNS will 1285 | # be used. 1286 | 1287 | INCLUDE_FILE_PATTERNS = 1288 | 1289 | # The PREDEFINED tag can be used to specify one or more macro names that 1290 | # are defined before the preprocessor is started (similar to the -D option of 1291 | # gcc). The argument of the tag is a list of macros of the form: name 1292 | # or name=definition (no spaces). If the definition and the = are 1293 | # omitted =1 is assumed. To prevent a macro definition from being 1294 | # undefined via #undef or recursively expanded use the := operator 1295 | # instead of the = operator. 1296 | 1297 | PREDEFINED = 1298 | 1299 | # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 1300 | # this tag can be used to specify a list of macro names that should be expanded. 1301 | # The macro definition that is found in the sources will be used. 1302 | # Use the PREDEFINED tag if you want to use a different macro definition. 1303 | 1304 | EXPAND_AS_DEFINED = 1305 | 1306 | # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 1307 | # doxygen's preprocessor will remove all function-like macros that are alone 1308 | # on a line, have an all uppercase name, and do not end with a semicolon. Such 1309 | # function macros are typically used for boiler-plate code, and will confuse 1310 | # the parser if not removed. 1311 | 1312 | SKIP_FUNCTION_MACROS = YES 1313 | 1314 | #--------------------------------------------------------------------------- 1315 | # Configuration::additions related to external references 1316 | #--------------------------------------------------------------------------- 1317 | 1318 | # The TAGFILES option can be used to specify one or more tagfiles. 1319 | # Optionally an initial location of the external documentation 1320 | # can be added for each tagfile. The format of a tag file without 1321 | # this location is as follows: 1322 | # 1323 | # TAGFILES = file1 file2 ... 1324 | # Adding location for the tag files is done as follows: 1325 | # 1326 | # TAGFILES = file1=loc1 "file2 = loc2" ... 1327 | # where "loc1" and "loc2" can be relative or absolute paths or 1328 | # URLs. If a location is present for each tag, the installdox tool 1329 | # does not have to be run to correct the links. 1330 | # Note that each tag file must have a unique name 1331 | # (where the name does NOT include the path) 1332 | # If a tag file is not located in the directory in which doxygen 1333 | # is run, you must also specify the path to the tagfile here. 1334 | 1335 | TAGFILES = 1336 | 1337 | # When a file name is specified after GENERATE_TAGFILE, doxygen will create 1338 | # a tag file that is based on the input files it reads. 1339 | 1340 | GENERATE_TAGFILE = 1341 | 1342 | # If the ALLEXTERNALS tag is set to YES all external classes will be listed 1343 | # in the class index. If set to NO only the inherited external classes 1344 | # will be listed. 1345 | 1346 | ALLEXTERNALS = NO 1347 | 1348 | # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 1349 | # in the modules index. If set to NO, only the current project's groups will 1350 | # be listed. 1351 | 1352 | EXTERNAL_GROUPS = YES 1353 | 1354 | # The PERL_PATH should be the absolute path and name of the perl script 1355 | # interpreter (i.e. the result of `which perl'). 1356 | 1357 | PERL_PATH = /usr/bin/perl 1358 | 1359 | #--------------------------------------------------------------------------- 1360 | # Configuration options related to the dot tool 1361 | #--------------------------------------------------------------------------- 1362 | 1363 | # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 1364 | # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 1365 | # or super classes. Setting the tag to NO turns the diagrams off. Note that 1366 | # this option is superseded by the HAVE_DOT option below. This is only a 1367 | # fallback. It is recommended to install and use dot, since it yields more 1368 | # powerful graphs. 1369 | 1370 | CLASS_DIAGRAMS = YES 1371 | 1372 | # You can define message sequence charts within doxygen comments using the \msc 1373 | # command. Doxygen will then run the mscgen tool (see 1374 | # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 1375 | # documentation. The MSCGEN_PATH tag allows you to specify the directory where 1376 | # the mscgen tool resides. If left empty the tool is assumed to be found in the 1377 | # default search path. 1378 | 1379 | MSCGEN_PATH = 1380 | 1381 | # If set to YES, the inheritance and collaboration graphs will hide 1382 | # inheritance and usage relations if the target is undocumented 1383 | # or is not a class. 1384 | 1385 | HIDE_UNDOC_RELATIONS = YES 1386 | 1387 | # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 1388 | # available from the path. This tool is part of Graphviz, a graph visualization 1389 | # toolkit from AT&T and Lucent Bell Labs. The other options in this section 1390 | # have no effect if this option is set to NO (the default) 1391 | 1392 | HAVE_DOT = YES 1393 | 1394 | # By default doxygen will write a font called FreeSans.ttf to the output 1395 | # directory and reference it in all dot files that doxygen generates. This 1396 | # font does not include all possible unicode characters however, so when you need 1397 | # these (or just want a differently looking font) you can specify the font name 1398 | # using DOT_FONTNAME. You need need to make sure dot is able to find the font, 1399 | # which can be done by putting it in a standard location or by setting the 1400 | # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 1401 | # containing the font. 1402 | 1403 | DOT_FONTNAME = FreeSans 1404 | 1405 | # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 1406 | # The default size is 10pt. 1407 | 1408 | DOT_FONTSIZE = 10 1409 | 1410 | # By default doxygen will tell dot to use the output directory to look for the 1411 | # FreeSans.ttf font (which doxygen will put there itself). If you specify a 1412 | # different font using DOT_FONTNAME you can set the path where dot 1413 | # can find it using this tag. 1414 | 1415 | DOT_FONTPATH = 1416 | 1417 | # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 1418 | # will generate a graph for each documented class showing the direct and 1419 | # indirect inheritance relations. Setting this tag to YES will force the 1420 | # the CLASS_DIAGRAMS tag to NO. 1421 | 1422 | CLASS_GRAPH = YES 1423 | 1424 | # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 1425 | # will generate a graph for each documented class showing the direct and 1426 | # indirect implementation dependencies (inheritance, containment, and 1427 | # class references variables) of the class with other documented classes. 1428 | 1429 | COLLABORATION_GRAPH = YES 1430 | 1431 | # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 1432 | # will generate a graph for groups, showing the direct groups dependencies 1433 | 1434 | GROUP_GRAPHS = YES 1435 | 1436 | # If the UML_LOOK tag is set to YES doxygen will generate inheritance and 1437 | # collaboration diagrams in a style similar to the OMG's Unified Modeling 1438 | # Language. 1439 | 1440 | UML_LOOK = NO 1441 | 1442 | # If set to YES, the inheritance and collaboration graphs will show the 1443 | # relations between templates and their instances. 1444 | 1445 | TEMPLATE_RELATIONS = NO 1446 | 1447 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 1448 | # tags are set to YES then doxygen will generate a graph for each documented 1449 | # file showing the direct and indirect include dependencies of the file with 1450 | # other documented files. 1451 | 1452 | INCLUDE_GRAPH = YES 1453 | 1454 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 1455 | # HAVE_DOT tags are set to YES then doxygen will generate a graph for each 1456 | # documented header file showing the documented files that directly or 1457 | # indirectly include this file. 1458 | 1459 | INCLUDED_BY_GRAPH = YES 1460 | 1461 | # If the CALL_GRAPH and HAVE_DOT options are set to YES then 1462 | # doxygen will generate a call dependency graph for every global function 1463 | # or class method. Note that enabling this option will significantly increase 1464 | # the time of a run. So in most cases it will be better to enable call graphs 1465 | # for selected functions only using the \callgraph command. 1466 | 1467 | CALL_GRAPH = NO 1468 | 1469 | # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 1470 | # doxygen will generate a caller dependency graph for every global function 1471 | # or class method. Note that enabling this option will significantly increase 1472 | # the time of a run. So in most cases it will be better to enable caller 1473 | # graphs for selected functions only using the \callergraph command. 1474 | 1475 | CALLER_GRAPH = NO 1476 | 1477 | # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 1478 | # will graphical hierarchy of all classes instead of a textual one. 1479 | 1480 | GRAPHICAL_HIERARCHY = YES 1481 | 1482 | # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 1483 | # then doxygen will show the dependencies a directory has on other directories 1484 | # in a graphical way. The dependency relations are determined by the #include 1485 | # relations between the files in the directories. 1486 | 1487 | DIRECTORY_GRAPH = YES 1488 | 1489 | # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 1490 | # generated by dot. Possible values are png, jpg, or gif 1491 | # If left blank png will be used. 1492 | 1493 | DOT_IMAGE_FORMAT = png 1494 | 1495 | # The tag DOT_PATH can be used to specify the path where the dot tool can be 1496 | # found. If left blank, it is assumed the dot tool can be found in the path. 1497 | 1498 | DOT_PATH = ${DOXYGEN_DOT_PATH} 1499 | 1500 | # The DOTFILE_DIRS tag can be used to specify one or more directories that 1501 | # contain dot files that are included in the documentation (see the 1502 | # \dotfile command). 1503 | 1504 | DOTFILE_DIRS = 1505 | 1506 | # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 1507 | # nodes that will be shown in the graph. If the number of nodes in a graph 1508 | # becomes larger than this value, doxygen will truncate the graph, which is 1509 | # visualized by representing a node as a red box. Note that doxygen if the 1510 | # number of direct children of the root node in a graph is already larger than 1511 | # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 1512 | # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. 1513 | 1514 | DOT_GRAPH_MAX_NODES = 50 1515 | 1516 | # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 1517 | # graphs generated by dot. A depth value of 3 means that only nodes reachable 1518 | # from the root by following a path via at most 3 edges will be shown. Nodes 1519 | # that lay further from the root node will be omitted. Note that setting this 1520 | # option to 1 or 2 may greatly reduce the computation time needed for large 1521 | # code bases. Also note that the size of a graph can be further restricted by 1522 | # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. 1523 | 1524 | MAX_DOT_GRAPH_DEPTH = 0 1525 | 1526 | # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 1527 | # background. This is disabled by default, because dot on Windows does not 1528 | # seem to support this out of the box. Warning: Depending on the platform used, 1529 | # enabling this option may lead to badly anti-aliased labels on the edges of 1530 | # a graph (i.e. they become hard to read). 1531 | 1532 | DOT_TRANSPARENT = NO 1533 | 1534 | # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 1535 | # files in one run (i.e. multiple -o and -T options on the command line). This 1536 | # makes dot run faster, but since only newer versions of dot (>1.8.10) 1537 | # support this, this feature is disabled by default. 1538 | 1539 | DOT_MULTI_TARGETS = NO 1540 | 1541 | # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 1542 | # generate a legend page explaining the meaning of the various boxes and 1543 | # arrows in the dot generated graphs. 1544 | 1545 | GENERATE_LEGEND = YES 1546 | 1547 | # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 1548 | # remove the intermediate dot files that are used to generate 1549 | # the various graphs. 1550 | 1551 | DOT_CLEANUP = YES -------------------------------------------------------------------------------- /cmake/version_config.h.in: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_CONFIG_H 2 | #define VERSION_CONFIG_H 3 | 4 | // warning this is a cmake generated file 5 | #define VERSION_MAJOR @VERSION_MAJOR@ 6 | #define VERSION_MINOR @VERSION_MINOR@ 7 | #define VERSION_BUILD @VERSION_BUILD@ 8 | 9 | #define VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}" 10 | 11 | 12 | #endif // VERSION_CONFIG_H -------------------------------------------------------------------------------- /copyright: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 Michael Knopke 2 | 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | 10 | -------------------------------------------------------------------------------- /deploy/exiftool.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knopkem/yaps/20e9b638ee47372020716d9daf1b778d4880167c/deploy/exiftool.exe -------------------------------------------------------------------------------- /deploy/exiv2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knopkem/yaps/20e9b638ee47372020716d9daf1b778d4880167c/deploy/exiv2.exe -------------------------------------------------------------------------------- /deploy/libexpat.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knopkem/yaps/20e9b638ee47372020716d9daf1b778d4880167c/deploy/libexpat.dll -------------------------------------------------------------------------------- /install/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${BIN_INSTALL_DIR}") 2 | include(InstallRequiredSystemLibraries) 3 | 4 | SET (IAPPS 5 | "yaps" 6 | ) 7 | 8 | FOREACH( APP_NAME ${IAPPS} ) 9 | if(APPLE) 10 | set(EXECUTABLE "${APP_NAME}.app") 11 | elseif(WIN32) 12 | set(EXECUTABLE "${APP_NAME}${CMAKE_EXECUTABLE_SUFFIX}") 13 | else() 14 | set(EXECUTABLE "${BIN_INSTALL_DIR}/${APP_NAME}${CMAKE_EXECUTABLE_SUFFIX}") 15 | endif() 16 | 17 | if(WIN32 AND TARGET Qt5::Core) 18 | get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION) 19 | get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH) 20 | endif() 21 | 22 | if(WIN32 AND EXISTS "${QT_QMAKE_EXECUTABLE}") 23 | get_filename_component(_Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH) 24 | if(EXISTS "${_Qt_BIN_DIR}/QtCore4.dll") 25 | set(Qt_BIN_DIR ${_Qt_BIN_DIR}) 26 | endif() 27 | endif() 28 | 29 | if(WIN32 OR APPLE) 30 | set(APPS \${CMAKE_INSTALL_PREFIX}/${EXECUTABLE} ) # paths to executables 31 | set(DIRS ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${Qt_BIN_DIR}) # directories to search for prerequisites 32 | message(STATUS "Search Libraries ${DIRS}") 33 | INSTALL(CODE " 34 | include(BundleUtilities) 35 | fixup_bundle(\"${APPS}\" \"\" \"${DIRS}\" ) 36 | " COMPONENT Runtime) 37 | endif() 38 | 39 | ENDFOREACH(APP_NAME) 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 2 | 3 | # applying global policies 4 | foreach(policy ${project_policies}) 5 | if(POLICY ${policy}) 6 | cmake_policy(SET ${policy} NEW) 7 | endif() 8 | endforeach() 9 | 10 | 11 | ## ################################################################# 12 | ## Sources 13 | ## ################################################################# 14 | 15 | SET(RESOURCES 16 | app.qrc 17 | ) 18 | 19 | SET(HEADERS_WRAP 20 | mainWindow.h 21 | mover.h 22 | exifWrapper.h 23 | reportDlg.h 24 | composerDlg.h 25 | ) 26 | 27 | SET(HEADERS 28 | ${HEADERS_WRAP} 29 | exifData.h 30 | simpleLog.h 31 | patternFormat.h 32 | ) 33 | 34 | SET(SOURCES 35 | main.cpp 36 | mainWindow.cpp 37 | mover.cpp 38 | exifWrapper.cpp 39 | exifData.cpp 40 | reportDlg.cpp 41 | simpleLog.cpp 42 | composerDlg.cpp 43 | patternFormat.cpp 44 | ) 45 | 46 | QT6_WRAP_CPP(HEADERS_MOC ${HEADERS_WRAP}) 47 | QT6_ADD_RESOURCES(RESOURCES_QRC ${RESOURCES}) 48 | 49 | if(WIN32) 50 | SET(SOURCES ${SOURCES} ${PROJECT_NAME}.rc) 51 | ENDIF(WIN32) 52 | 53 | INCLUDE_DIRECTORIES( 54 | ${CMAKE_CURRENT_BINARY_DIR} 55 | ${CMAKE_CURRENT_SOURCE_DIR} 56 | ) 57 | 58 | ADD_EXECUTABLE(${PROJECT_NAME} 59 | ${DEPLOYMENT_SYSTEM} 60 | ${HEADERS_MOC} 61 | ${HEADERS} 62 | ${SOURCES} 63 | ${RESOURCES_QRC} 64 | ) 65 | 66 | target_link_libraries(${PROJECT_NAME} Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Concurrent) 67 | 68 | # Group common files together in Visual Studio. 69 | SOURCE_GROUP("Header Files" FILES ${HEADERS}) 70 | SOURCE_GROUP("Source Files" FILES ${SOURCES}) 71 | SOURCE_GROUP("Generated Files" FILES ${HEADERS_MOC}) 72 | 73 | install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${BIN_INSTALL_DIR} BUNDLE DESTINATION ${BIN_INSTALL_DIR} ) 74 | 75 | #deploy qt plugins 76 | INSTALL( DIRECTORY ${QT5_ROOT_PREFIX}/plugins/platforms DESTINATION ${BIN_INSTALL_DIR} ) 77 | INSTALL( DIRECTORY ${QT5_ROOT_PREFIX}/plugins/imageformats DESTINATION ${BIN_INSTALL_DIR} ) 78 | 79 | -------------------------------------------------------------------------------- /src/app.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/logo.ico 4 | 5 | -------------------------------------------------------------------------------- /src/composerDlg.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Michael Knopke 3 | * 4 | * See the COPYRIGHT file for terms of use. 5 | */ 6 | 7 | #include "composerDlg.h" 8 | 9 | #include 10 | #include 11 | 12 | class ComposerDlgPrivate 13 | { 14 | public: 15 | QListWidget* collection; 16 | QList selection; 17 | QLineEdit* pattern; 18 | QLineEdit* example; 19 | QLabel* description; 20 | }; 21 | 22 | //-------------------------------------------------------------------------------------- 23 | 24 | ComposerDlg::ComposerDlg( QList items, QList selectedItems, 25 | const QString& labelText, QWidget* parent /*= NULL*/ ): QDialog(parent), d (new ComposerDlgPrivate) 26 | { 27 | setWindowFlags( Qt::Dialog | Qt::WindowTitleHint ); 28 | this->setMinimumWidth(800); 29 | 30 | d->description = new QLabel; 31 | d->description->setText(labelText); 32 | d->collection = new QListWidget; 33 | d->collection->setSelectionMode(QAbstractItemView::SingleSelection); 34 | 35 | d->selection = selectedItems; 36 | 37 | d->pattern = new QLineEdit; 38 | d->pattern->setReadOnly(true); 39 | d->example = new QLineEdit; 40 | d->example->setReadOnly(true); 41 | 42 | // fill collection 43 | foreach(PatternFormat::eTag item, items) { 44 | QListWidgetItem * it = new QListWidgetItem; 45 | it->setText(PatternFormat::tagToString(item) + " - " + PatternFormat::tagToDescription(item)); 46 | it->setData(Qt::UserRole, item); 47 | d->collection->addItem(it); 48 | } 49 | 50 | QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); 51 | 52 | connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); 53 | connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); 54 | 55 | connect(d->collection, SIGNAL(clicked(QModelIndex)), this, SLOT(copyFromCollection(QModelIndex))); 56 | 57 | QPushButton* minusButton = new QPushButton(tr("<-")); 58 | connect(minusButton,SIGNAL(clicked()), this, SLOT(removeLast())); 59 | 60 | QHBoxLayout* hbox = new QHBoxLayout; 61 | hbox->addWidget(d->pattern); 62 | hbox->addWidget(minusButton); 63 | 64 | QVBoxLayout* vbox = new QVBoxLayout; 65 | vbox->addWidget(d->description); 66 | vbox->addWidget(d->collection); 67 | vbox->addLayout(hbox); 68 | vbox->addWidget(d->example); 69 | vbox->addWidget(buttonBox); 70 | 71 | build(); 72 | 73 | this->setLayout(vbox); 74 | } 75 | 76 | //-------------------------------------------------------------------------------------- 77 | 78 | ComposerDlg::~ComposerDlg() 79 | { 80 | delete d; 81 | d = NULL; 82 | } 83 | 84 | //-------------------------------------------------------------------------------------- 85 | 86 | void ComposerDlg::copyFromCollection( QModelIndex index) 87 | { 88 | PatternFormat::eTag tag = static_cast(d->collection->item(index.row())->data(Qt::UserRole).toInt()); 89 | if ( (tag == PatternFormat::NewSubDir) && (d->selection.last() == PatternFormat::NewSubDir)) { 90 | return; 91 | } 92 | d->selection << tag; 93 | build(); 94 | } 95 | 96 | //-------------------------------------------------------------------------------------- 97 | 98 | QList ComposerDlg::selectedItems() const 99 | { 100 | return d->selection; 101 | } 102 | 103 | //-------------------------------------------------------------------------------------- 104 | 105 | void ComposerDlg::build() 106 | { 107 | QString textPattern; 108 | QString textExample; 109 | for (int i=0; i < d->selection.count(); i++) { 110 | PatternFormat::eTag tag = d->selection.at(i); 111 | textPattern += PatternFormat::tagToString(tag); 112 | textExample += PatternFormat::tagToExample(tag); 113 | } 114 | 115 | d->pattern->setText(textPattern); 116 | d->example->setText(textExample); 117 | } 118 | 119 | //-------------------------------------------------------------------------------------- 120 | 121 | void ComposerDlg::removeLast() 122 | { 123 | if (d->selection.isEmpty()) { 124 | return; 125 | } 126 | d->selection.takeLast(); 127 | build(); 128 | } 129 | 130 | //-------------------------------------------------------------------------------------- 131 | 132 | -------------------------------------------------------------------------------- /src/composerDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef composerDlg_h__ 2 | #define composerDlg_h__ 3 | 4 | #include 5 | #include 6 | 7 | #include "mover.h" 8 | 9 | class ComposerDlgPrivate; 10 | class ComposerDlg : public QDialog 11 | { 12 | Q_OBJECT 13 | public: 14 | ComposerDlg( QList items, QList selectedItems, const QString& labelText, QWidget* parent = NULL); 15 | ~ComposerDlg(); 16 | 17 | QList selectedItems() const; 18 | 19 | protected slots: 20 | void copyFromCollection(QModelIndex); 21 | void removeLast(); 22 | 23 | protected: 24 | void build(); 25 | 26 | private: 27 | ComposerDlgPrivate* d; 28 | }; 29 | #endif // composerDlg_h__ 30 | 31 | -------------------------------------------------------------------------------- /src/exifData.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Michael Knopke 3 | * 4 | * See the COPYRIGHT file for terms of use. 5 | */ 6 | 7 | #include "exifData.h" 8 | 9 | #include 10 | 11 | //-------------------------------------------------------------------------------------- 12 | 13 | ExifDate::ExifDate( const QString& input ) 14 | { 15 | int y = parseYear(input); 16 | int M = parseMonth(input); 17 | int d = parseDay(input); 18 | 19 | int h = parseHour(input); 20 | int m = parseMinute(input); 21 | int s = parseSecond(input); 22 | 23 | m_date = QDateTime(QDate(y,M,d), QTime(h,m,s)); 24 | } 25 | 26 | //-------------------------------------------------------------------------------------- 27 | 28 | QString ExifDate::year() const 29 | { 30 | return m_date.date().toString("yyyy"); 31 | } 32 | 33 | //-------------------------------------------------------------------------------------- 34 | 35 | QString ExifDate::month() const 36 | { 37 | return m_date.date().toString("MM"); 38 | } 39 | 40 | //-------------------------------------------------------------------------------------- 41 | 42 | QString ExifDate::monthS() const 43 | { 44 | return m_date.date().toString("MMM"); 45 | } 46 | 47 | //-------------------------------------------------------------------------------------- 48 | 49 | QString ExifDate::monthL() const 50 | { 51 | return m_date.date().toString("MMMM"); 52 | } 53 | 54 | //-------------------------------------------------------------------------------------- 55 | 56 | QString ExifDate::weekNumber() const 57 | { 58 | return QString::number(m_date.date().weekNumber()).rightJustified(2, '0'); 59 | } 60 | 61 | //-------------------------------------------------------------------------------------- 62 | 63 | QString ExifDate::day() const 64 | { 65 | return m_date.date().toString("dd"); 66 | } 67 | 68 | //-------------------------------------------------------------------------------------- 69 | 70 | QString ExifDate::dayS() const 71 | { 72 | return m_date.date().toString("ddd"); 73 | } 74 | 75 | //-------------------------------------------------------------------------------------- 76 | 77 | QString ExifDate::dayL() const 78 | { 79 | return m_date.date().toString("dddd"); 80 | } 81 | 82 | //-------------------------------------------------------------------------------------- 83 | 84 | QString ExifDate::hour() const 85 | { 86 | return m_date.time().toString("hh"); 87 | } 88 | 89 | //-------------------------------------------------------------------------------------- 90 | 91 | QString ExifDate::minute() const 92 | { 93 | return m_date.time().toString("mm"); 94 | } 95 | 96 | //-------------------------------------------------------------------------------------- 97 | 98 | QString ExifDate::second() const 99 | { 100 | return m_date.time().toString("ss"); 101 | } 102 | 103 | //-------------------------------------------------------------------------------------- 104 | 105 | bool ExifDate::isInvalid() const 106 | { 107 | return !m_date.isValid(); 108 | } 109 | 110 | //-------------------------------------------------------------------------------------- 111 | 112 | int ExifDate::parseYear(const QString& input) 113 | { 114 | QString cp = input; 115 | return cp.left(4).toInt(); 116 | } 117 | 118 | //-------------------------------------------------------------------------------------- 119 | 120 | int ExifDate::parseMonth(const QString& input) 121 | { 122 | QString cp = input; 123 | return cp.remove(0,5).left(2).toInt(); 124 | } 125 | 126 | //-------------------------------------------------------------------------------------- 127 | 128 | int ExifDate::parseDay(const QString& input) 129 | { 130 | QString cp = input; 131 | return cp.remove(0,8).left(2).toInt(); 132 | } 133 | 134 | //-------------------------------------------------------------------------------------- 135 | 136 | int ExifDate::parseHour(const QString& input) 137 | { 138 | QString cp = input; 139 | return cp.remove(0,11).left(2).toInt(); 140 | } 141 | 142 | //-------------------------------------------------------------------------------------- 143 | 144 | int ExifDate::parseMinute(const QString& input) 145 | { 146 | QString cp = input; 147 | return cp.remove(0,14).left(2).toInt(); 148 | } 149 | 150 | //-------------------------------------------------------------------------------------- 151 | 152 | int ExifDate::parseSecond(const QString& input) 153 | { 154 | QString cp = input; 155 | return cp.remove(0,17).left(2).toInt(); 156 | } 157 | 158 | //-------------------------------------------------------------------------------------- 159 | 160 | -------------------------------------------------------------------------------- /src/exifData.h: -------------------------------------------------------------------------------- 1 | #ifndef exifData_h__ 2 | #define exifData_h__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class ExifDate 9 | { 10 | public: 11 | ExifDate(const QString& input=""); 12 | 13 | QString year() const; 14 | QString month() const; 15 | QString monthS() const; 16 | QString monthL() const; 17 | QString weekNumber() const; 18 | 19 | QString day() const; 20 | QString dayS() const; 21 | QString dayL() const; 22 | 23 | QString hour() const; 24 | QString minute() const; 25 | QString second() const; 26 | 27 | bool isInvalid() const; 28 | 29 | protected: 30 | 31 | int parseYear(const QString& input); 32 | int parseMonth(const QString& input); 33 | int parseDay(const QString& input); 34 | int parseHour(const QString& input); 35 | int parseMinute(const QString& input); 36 | int parseSecond(const QString& input); 37 | 38 | QDateTime m_date; 39 | }; 40 | 41 | struct ExifData 42 | { 43 | QString FilePath; 44 | QString FileName; 45 | QString AbsolutePath; 46 | QString Extention; 47 | ExifDate CreateDate; 48 | QString CameraModel; 49 | QString CameraMake; 50 | QString MimeType; 51 | }; 52 | #endif // exifData_h__ 53 | 54 | -------------------------------------------------------------------------------- /src/exifWrapper.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Michael Knopke 3 | * 4 | * See the COPYRIGHT file for terms of use. 5 | */ 6 | 7 | #include "exifWrapper.h" 8 | #include "exifData.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | class ExifWrapperPrivate 15 | { 16 | public: 17 | QString appPath; 18 | }; 19 | //-------------------------------------------------------------------------------------- 20 | 21 | ExifWrapper::ExifWrapper( const QString& path, QObject* parent /*= NULL*/ ) : 22 | QObject(parent), d(new ExifWrapperPrivate) 23 | { 24 | d->appPath = path; 25 | 26 | } 27 | 28 | //-------------------------------------------------------------------------------------- 29 | 30 | ExifWrapper::~ExifWrapper() 31 | { 32 | delete d; 33 | } 34 | 35 | //-------------------------------------------------------------------------------------- 36 | 37 | QString ExifWrapper::findValue( const QStringList input, const QString& key ) 38 | { 39 | QString result; 40 | bool found = false; 41 | for(int i=0; i < input.count(); ++i) { 42 | QString current = input.at(i); 43 | if (current.contains(key)) { 44 | int index = current.indexOf(":"); 45 | if (index > 0) { 46 | result = current.right(current.length() - (index+1)).trimmed(); 47 | found = true; 48 | } 49 | break; 50 | } 51 | } 52 | if (!found) { 53 | qWarning() << "could not find" << key << " in meta data" << input; 54 | } 55 | return result; 56 | } 57 | 58 | //-------------------------------------------------------------------------------------- 59 | 60 | void ExifWrapper::parseFile( ExifData& data ) 61 | { 62 | 63 | // prepare data 64 | QFileInfo info (data.FilePath); 65 | 66 | // skip known extensions 67 | if (isUnsupportedFileType(info.suffix())) { 68 | data.Extention = info.suffix(); 69 | data.FileName = info.completeBaseName(); 70 | return; 71 | } 72 | 73 | // decide what tool to use, we want exiv2 only for jpg 74 | if (isEqual(info.suffix(), "jpg") ) { 75 | data = doParse(EXIV2, data.FilePath); 76 | if (data.CreateDate.isInvalid()) { 77 | qWarning() << "Parsing failed once, retrying."; 78 | data = doParse(EXIFTOOL, data.FilePath); 79 | if (data.CreateDate.isInvalid()) { 80 | qWarning() << "Parsing failed again, giving up on file" << data.FilePath; 81 | } 82 | } 83 | } 84 | else { 85 | data = doParse(EXIFTOOL, data.FilePath); 86 | } 87 | 88 | } 89 | 90 | //-------------------------------------------------------------------------------------- 91 | 92 | ExifData ExifWrapper::doParse( eLookup type, const QString& path ) 93 | { 94 | QFileInfo info (path); 95 | ExifData data; 96 | data.FilePath = path; 97 | data.Extention = info.suffix(); 98 | data.FileName = info.completeBaseName(); 99 | data.AbsolutePath = info.absolutePath(); 100 | 101 | BaseLookup* lookup = NULL; 102 | if (type == EXIFTOOL) { 103 | lookup = new ExifToolLookup; 104 | } 105 | else { 106 | lookup = new Exiv2Lookup; 107 | } 108 | QString processPath = this->osSpecificPath() + lookup->processName() + this->osSpecificExtension(); 109 | 110 | #if defined (Q_WS_WIN) || defined( Q_WS_MAC) 111 | if (!QFile::exists(processPath) ) { 112 | qCritical() << "process not found" << processPath; 113 | } 114 | #endif 115 | 116 | // start process 117 | QStringList args; 118 | args << lookup->processParams() << path; 119 | QProcess* process = new QProcess; 120 | 121 | process->start(processPath, args); 122 | // and wait for it to finish 123 | process->waitForReadyRead(); 124 | process->waitForFinished(); 125 | 126 | // make sure we have all events processed 127 | //qApp->processEvents(); 128 | 129 | // now read and parse the result 130 | QByteArray bytes = process->readAllStandardOutput(); 131 | QString message(bytes.constData()); 132 | QStringList result = message.split("\n"); 133 | 134 | data.CreateDate = ExifDate(findValue(result, lookup->createDate())); 135 | data.CameraModel = findValue(result, lookup->cameraModel()); 136 | data.CameraMake = findValue(result, lookup->cameraMake()); 137 | data.MimeType = findValue(result, lookup->mimeType()); 138 | 139 | delete process; 140 | delete lookup; 141 | // finally data should be up-to-date 142 | return data; 143 | } 144 | 145 | //-------------------------------------------------------------------------------------- 146 | 147 | 148 | QString ExifWrapper::osSpecificPath() 149 | { 150 | #if defined (Q_WS_WIN) || defined( Q_WS_MAC) 151 | return d->appPath + "/"; 152 | #endif 153 | return QString(); 154 | } 155 | 156 | //-------------------------------------------------------------------------------------- 157 | 158 | QString ExifWrapper::osSpecificExtension() 159 | { 160 | #ifdef Q_WS_WIN 161 | return ".exe"; 162 | #endif 163 | return QString(); 164 | } 165 | 166 | //-------------------------------------------------------------------------------------- 167 | 168 | bool ExifWrapper::isUnsupportedFileType( const QString& extension ) 169 | { 170 | QStringList fileTypes; 171 | fileTypes << "txt"; 172 | fileTypes << "png"; 173 | fileTypes << "raw"; 174 | 175 | foreach(const QString& type, fileTypes) { 176 | if (isEqual(extension, type)) { 177 | return true; 178 | } 179 | } 180 | 181 | return false; 182 | } 183 | 184 | //-------------------------------------------------------------------------------------- 185 | 186 | bool ExifWrapper::isEqual( const QString& a, const QString& b ) 187 | { 188 | return (a.compare(b, Qt::CaseInsensitive) == 0 ); 189 | } 190 | 191 | //-------------------------------------------------------------------------------------- 192 | 193 | 194 | -------------------------------------------------------------------------------- /src/exifWrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef exifWrapper_h__ 2 | #define exifWrapper_h__ 3 | 4 | #include "exifData.h" 5 | #include 6 | 7 | class BaseLookup 8 | { 9 | public: 10 | BaseLookup() {} 11 | virtual ~BaseLookup() {} 12 | virtual QString processName() = 0; 13 | virtual QStringList processParams() = 0; 14 | virtual QString fileName() = 0; 15 | virtual QString createDate() = 0; 16 | virtual QString cameraModel() = 0; 17 | virtual QString cameraMake() = 0; 18 | virtual QString mimeType() = 0; 19 | }; 20 | 21 | class Exiv2Lookup : public BaseLookup 22 | { 23 | public: 24 | inline QString processName() {return "exiv2";} 25 | inline QStringList processParams() {return QStringList();} 26 | inline QString fileName() {return "File name";} 27 | inline QString createDate() {return "Image timestamp";} 28 | inline QString cameraModel() {return "Camera model";} 29 | inline QString cameraMake() {return "Camera make";} 30 | inline QString mimeType() {return "MIME type";} 31 | }; 32 | 33 | class ExifToolLookup : public BaseLookup 34 | { 35 | public: 36 | inline QString processName() {return "exifTool";} 37 | inline QStringList processParams() {return QStringList() << "-CreateDate" << "-Model" << "-Make" << "-MIMEType";} 38 | inline QString fileName() {return "File Name";} 39 | inline QString createDate() {return "Create Date";} 40 | inline QString cameraModel() {return "Model";} 41 | inline QString cameraMake() {return "Make";} 42 | inline QString mimeType() {return "MIME Type";} 43 | 44 | }; 45 | 46 | 47 | class ExifWrapperPrivate; 48 | class ExifWrapper : public QObject 49 | { 50 | Q_OBJECT 51 | public: 52 | ExifWrapper(const QString& path, QObject* parent = NULL); 53 | ~ExifWrapper(); 54 | 55 | void parseFile(ExifData& data); 56 | 57 | enum eLookup { 58 | EXIFTOOL, 59 | EXIV2 60 | }; 61 | 62 | protected: 63 | 64 | ExifData doParse(eLookup type, const QString& path); 65 | 66 | QString findValue(const QStringList input, const QString& key); 67 | QString osSpecificPath(); 68 | QString osSpecificExtension(); 69 | 70 | bool isUnsupportedFileType(const QString& extension); 71 | 72 | bool isEqual(const QString& a, const QString& b); 73 | 74 | private: 75 | ExifWrapperPrivate* d; 76 | 77 | }; 78 | #endif // exifWrapper_h__ 79 | 80 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Michael Knopke 3 | * 4 | * See the COPYRIGHT file for terms of use. 5 | */ 6 | 7 | #include "mainWindow.h" 8 | #include "simpleLog.h" 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | void redirectMessageOutput(QtMsgType type, const QMessageLogContext& ctx, const QString &msg) 16 | { 17 | switch (type) { 18 | case QtDebugMsg: 19 | SimpleLog::log(SimpleLog::LOG_DEBUG, msg); 20 | break; 21 | case QtWarningMsg: 22 | SimpleLog::log(SimpleLog::LOG_WARNING, msg); 23 | break; 24 | case QtCriticalMsg: 25 | SimpleLog::log(SimpleLog::LOG_ERROR, msg); 26 | break; 27 | case QtFatalMsg: 28 | SimpleLog::log(SimpleLog::LOG_ERROR, msg); 29 | break; 30 | default: 31 | break; 32 | } 33 | } 34 | 35 | /** 36 | * Main application entry point 37 | */ 38 | int main(int argc, char *argv[]) 39 | { 40 | QCoreApplication::setOrganizationName("nonprofit"); 41 | QCoreApplication::setOrganizationDomain("nonprofit"); 42 | QCoreApplication::setApplicationName("yaps"); 43 | QCoreApplication::setApplicationVersion(VERSION_STRING); 44 | Q_INIT_RESOURCE(app); 45 | 46 | qInstallMessageHandler(redirectMessageOutput); 47 | 48 | QApplication app(argc, argv); 49 | MainWindow window; 50 | 51 | window.show(); 52 | return app.exec(); 53 | } 54 | -------------------------------------------------------------------------------- /src/mainWindow.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Michael Knopke 3 | * 4 | * See the COPYRIGHT file for terms of use. 5 | */ 6 | 7 | #include "mainWindow.h" 8 | #include 9 | #include "composerDlg.h" 10 | 11 | #include 12 | #include 13 | 14 | 15 | //-------------------------------------------------------------------------------------- 16 | 17 | class MainWindowPrivate { 18 | public: 19 | QLineEdit* sourceLineEdit; 20 | QPushButton* sourceButton; 21 | QCheckBox* traverseCheckBox; 22 | QLineEdit* targetLineEdit; 23 | QPushButton* targetButton; 24 | 25 | QLineEdit* patternLineEdit; 26 | QLineEdit* exampleLineEdit; 27 | QPushButton* editFolderPb; 28 | 29 | QCheckBox* fixDuplicatesCheckBox; 30 | QCheckBox* copyDuplicatesCheckBox; 31 | QLineEdit* patternFileLineEdit; 32 | QLineEdit* exampleFileLineEdit; 33 | QPushButton* editFilePb; 34 | 35 | QPushButton* moveButton; 36 | QPushButton* copyButton; 37 | 38 | Mover* mover; 39 | PatternFormat currentFormat; 40 | FileOptions currentOptions; 41 | 42 | QList folderPatternList; 43 | QList filePatternList; 44 | 45 | QSettings* settings; 46 | }; 47 | 48 | //-------------------------------------------------------------------------------------- 49 | 50 | MainWindow::MainWindow() : d(new MainWindowPrivate) 51 | { 52 | qDebug() << "init"; 53 | setWindowFlags( Qt::Dialog ); 54 | this->setWindowTitle( tr("YAPS - ") + VERSION_STRING ); 55 | this->setMinimumWidth(800); 56 | 57 | d->settings = new QSettings(QApplication::organizationName(), QApplication::applicationName()); 58 | 59 | QVBoxLayout* mainLayout = new QVBoxLayout; 60 | mainLayout->addWidget(createIntroGroup()); 61 | mainLayout->addWidget(createSourceGroup()); 62 | mainLayout->addWidget(createTargetGroup()); 63 | mainLayout->addWidget(createFolderGroup()); 64 | mainLayout->addWidget(createFileGroup()); 65 | mainLayout->addWidget(createActionGroup()); 66 | mainLayout->addStretch(1); 67 | setLayout(mainLayout); 68 | 69 | // Create connections 70 | QObject::connect(d->sourceButton, SIGNAL(clicked()), this, SLOT(onSourceButtonClicked())); 71 | QObject::connect(d->targetButton, SIGNAL(clicked()), this, SLOT(onTargetButtonClicked())); 72 | QObject::connect(d->fixDuplicatesCheckBox, SIGNAL(stateChanged(int)), this, SLOT(onDetermineState())); 73 | 74 | QObject::connect(d->editFolderPb, SIGNAL(clicked()), this, SLOT(editFolderPattern())); 75 | QObject::connect(d->editFilePb, SIGNAL(clicked()), this, SLOT(editFilePattern())); 76 | 77 | QObject::connect(d->moveButton, SIGNAL(clicked()), this, SLOT(doMove())); 78 | QObject::connect(d->copyButton, SIGNAL(clicked()), this, SLOT(doCopy())); 79 | 80 | d->sourceButton->setFocus(); 81 | 82 | d->mover = new Mover(this); 83 | 84 | readSettings(); 85 | evaluateFolderStructure(); 86 | evaluateFilenameStructure(); 87 | onDetermineState(); 88 | qDebug() << "init done"; 89 | } 90 | 91 | //-------------------------------------------------------------------------------------- 92 | 93 | MainWindow::~MainWindow( void ) 94 | { 95 | writeSettings(); 96 | delete d->settings; 97 | delete d; 98 | } 99 | 100 | //-------------------------------------------------------------------------------------- 101 | 102 | QGroupBox* MainWindow::createIntroGroup() 103 | { 104 | QGroupBox* introGroupBox = new QGroupBox(tr("Introduction")); 105 | QLabel* introText = new QLabel; 106 | introText->setText(tr("Welcome to YAPS - Yet Another Photo Sorter.\n" 107 | "\n" 108 | "Photos and videos can be easily sorted using the EXIF meta information (date, time, camera model etc.)\n" 109 | "You can customize the folder and file structure to your needs by editing the default patterns.\n" 110 | "Duplicates can be detected based on their file hashes (md5sum). Happy sorting!" 111 | )); 112 | QVBoxLayout* vboxIntro = new QVBoxLayout; 113 | vboxIntro->addWidget(introText); 114 | 115 | introGroupBox->setLayout(vboxIntro); 116 | return introGroupBox; 117 | } 118 | 119 | //-------------------------------------------------------------------------------------- 120 | 121 | QGroupBox* MainWindow::createSourceGroup() 122 | { 123 | QGroupBox* sourceGroupBox = new QGroupBox(tr("Source Folder")); 124 | d->sourceLineEdit = new QLineEdit; 125 | d->sourceLineEdit->setPlaceholderText(tr("Directory where your original photos/movies are stored")); 126 | 127 | d->sourceButton = new QPushButton(tr("Choose source folder")); 128 | d->sourceButton->setMaximumWidth(200); 129 | 130 | d->traverseCheckBox = new QCheckBox(tr("Include Subdirectories")); 131 | d->traverseCheckBox->setChecked(true); 132 | 133 | QHBoxLayout *hboxSource = new QHBoxLayout; 134 | hboxSource->addWidget(d->sourceButton); 135 | hboxSource->addWidget(d->traverseCheckBox); 136 | 137 | QVBoxLayout *vboxSource = new QVBoxLayout; 138 | vboxSource->addWidget(d->sourceLineEdit); 139 | vboxSource->addLayout(hboxSource); 140 | sourceGroupBox->setLayout(vboxSource); 141 | return sourceGroupBox; 142 | } 143 | 144 | //-------------------------------------------------------------------------------------- 145 | 146 | QGroupBox* MainWindow::createTargetGroup() 147 | { 148 | QGroupBox* targetGroupBox = new QGroupBox(tr("Target Folder")); 149 | d->targetLineEdit = new QLineEdit; 150 | d->targetLineEdit->setPlaceholderText(tr("Directory where Photo Mover will copy or move them")); 151 | 152 | d->targetButton = new QPushButton(tr("Choose target folder")); 153 | d->targetButton->setMaximumWidth(200); 154 | 155 | d->fixDuplicatesCheckBox = new QCheckBox(tr("Fix duplicates")); 156 | d->fixDuplicatesCheckBox->setChecked(true); 157 | 158 | d->copyDuplicatesCheckBox = new QCheckBox(tr("Copy to duplicates folder")); 159 | d->copyDuplicatesCheckBox->setChecked(false); 160 | 161 | QHBoxLayout *hboxTarget = new QHBoxLayout; 162 | hboxTarget->addWidget(d->targetButton); 163 | hboxTarget->addWidget(d->fixDuplicatesCheckBox); 164 | hboxTarget->addWidget(d->copyDuplicatesCheckBox); 165 | 166 | QVBoxLayout *vboxTarget = new QVBoxLayout; 167 | vboxTarget->addWidget(d->targetLineEdit); 168 | vboxTarget->addLayout(hboxTarget); 169 | targetGroupBox->setLayout(vboxTarget); 170 | return targetGroupBox; 171 | } 172 | 173 | //-------------------------------------------------------------------------------------- 174 | 175 | QGroupBox* MainWindow::createFolderGroup() 176 | { 177 | QGroupBox* folderGroupBox = new QGroupBox(tr("Output Folder Structure")); 178 | 179 | d->editFolderPb = new QPushButton(tr("Edit")); 180 | d->patternLineEdit = new QLineEdit; 181 | d->patternLineEdit->setReadOnly(true); 182 | d->exampleLineEdit = new QLineEdit; 183 | d->exampleLineEdit->setReadOnly(true); 184 | 185 | QHBoxLayout* hbox = new QHBoxLayout; 186 | hbox->addWidget(d->patternLineEdit); 187 | hbox->addWidget(d->editFolderPb); 188 | 189 | QFormLayout* formLayoutFolderPattern = new QFormLayout; 190 | formLayoutFolderPattern->addRow("Pattern:", hbox); 191 | formLayoutFolderPattern->addRow("Example:", d->exampleLineEdit); 192 | formLayoutFolderPattern->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); 193 | 194 | folderGroupBox->setLayout(formLayoutFolderPattern); 195 | return folderGroupBox; 196 | } 197 | 198 | //-------------------------------------------------------------------------------------- 199 | 200 | QGroupBox* MainWindow::createFileGroup() 201 | { 202 | QGroupBox* fileGroupBox = new QGroupBox(tr("Filename Structure")); 203 | 204 | d->patternFileLineEdit = new QLineEdit; 205 | d->patternFileLineEdit->setReadOnly(true); 206 | d->exampleFileLineEdit = new QLineEdit; 207 | d->exampleLineEdit->setReadOnly(true); 208 | 209 | d->editFilePb = new QPushButton(tr("Edit")); 210 | 211 | QHBoxLayout* hbox = new QHBoxLayout; 212 | hbox->addWidget(d->patternFileLineEdit); 213 | hbox->addWidget(d->editFilePb); 214 | 215 | QFormLayout* formLayoutFilePattern = new QFormLayout; 216 | formLayoutFilePattern->addRow("Pattern:", hbox); 217 | formLayoutFilePattern->addRow("Example:", d->exampleFileLineEdit); 218 | formLayoutFilePattern->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); 219 | 220 | fileGroupBox->setLayout(formLayoutFilePattern); 221 | return fileGroupBox; 222 | } 223 | 224 | //-------------------------------------------------------------------------------------- 225 | 226 | QGroupBox* MainWindow::createActionGroup() 227 | { 228 | QGroupBox* actionGroupBox = new QGroupBox(tr("Action")); 229 | d->copyButton = new QPushButton(tr("COPY Files")); 230 | d->moveButton = new QPushButton(tr("MOVE Files")); 231 | 232 | QHBoxLayout* hboxAction = new QHBoxLayout; 233 | hboxAction->addWidget(d->copyButton); 234 | hboxAction->addWidget(d->moveButton); 235 | actionGroupBox->setLayout(hboxAction); 236 | return actionGroupBox; 237 | } 238 | 239 | //-------------------------------------------------------------------------------------- 240 | 241 | void MainWindow::onSourceButtonClicked() 242 | { 243 | d->sourceLineEdit->setText(openFileDialog()); 244 | } 245 | 246 | //-------------------------------------------------------------------------------------- 247 | 248 | void MainWindow::onTargetButtonClicked() 249 | { 250 | d->targetLineEdit->setText(openFileDialog()); 251 | evaluateFolderStructure(); 252 | } 253 | 254 | //-------------------------------------------------------------------------------------- 255 | 256 | QString MainWindow::openFileDialog() 257 | { 258 | QDir selDir; 259 | QFileDialog dialog(this); 260 | dialog.setFileMode(QFileDialog::Directory); 261 | if (dialog.exec()) { 262 | QStringList selected = dialog.selectedFiles(); 263 | if (!selected.empty()) 264 | return (selected.first()); 265 | } 266 | return ""; 267 | } 268 | 269 | //-------------------------------------------------------------------------------------- 270 | 271 | void MainWindow::evaluateFolderStructure() 272 | { 273 | d->currentFormat.FolderStructureContainer = d->folderPatternList; 274 | 275 | QString pattern; 276 | QString example; 277 | 278 | foreach( PatternFormat::eTag tag, d->currentFormat.FolderStructureContainer) { 279 | pattern += PatternFormat::tagToString(tag); 280 | example += PatternFormat::tagToExample(tag); 281 | } 282 | d->patternLineEdit->setText(pattern); 283 | d->exampleLineEdit->setText(example); 284 | } 285 | 286 | //-------------------------------------------------------------------------------------- 287 | 288 | void MainWindow::evaluateFilenameStructure() 289 | { 290 | d->currentFormat.FileStructureContainer = d->filePatternList; 291 | 292 | QString pattern; 293 | QString example; 294 | 295 | foreach( PatternFormat::eTag tag, d->currentFormat.FileStructureContainer) { 296 | pattern += PatternFormat::tagToString(tag); 297 | example += PatternFormat::tagToExample(tag); 298 | } 299 | d->patternFileLineEdit->setText(pattern); 300 | d->exampleFileLineEdit->setText(example); 301 | } 302 | 303 | //-------------------------------------------------------------------------------------- 304 | 305 | void MainWindow::doMove() 306 | { 307 | if (!validateSelection()) { 308 | return; 309 | } 310 | 311 | int ret = QMessageBox::warning(this, tr("Attention"), 312 | tr("Do you really want to move files?\n" 313 | "Consider using copy instead which leaves your source folder intact.\n" 314 | "Proceed at your own risk!"), 315 | QMessageBox::Ok | QMessageBox::Cancel); 316 | 317 | if ( ret == QMessageBox::Ok) { 318 | evaluateFileOptions(); 319 | d->currentOptions.fileOp = FileOptions::MOVE; 320 | d->mover->performOperations(d->sourceLineEdit->text(), d->targetLineEdit->text(), d->currentOptions, d->currentFormat); 321 | } 322 | } 323 | 324 | //-------------------------------------------------------------------------------------- 325 | 326 | void MainWindow::doCopy() 327 | { 328 | if (!validateSelection()) { 329 | return; 330 | } 331 | 332 | evaluateFileOptions(); 333 | d->currentOptions.fileOp = FileOptions::COPY; 334 | d->mover->performOperations(d->sourceLineEdit->text(), d->targetLineEdit->text(), d->currentOptions, d->currentFormat); 335 | } 336 | 337 | //-------------------------------------------------------------------------------------- 338 | 339 | void MainWindow::evaluateFileOptions() 340 | { 341 | d->currentOptions.traverseSubdirectories = d->traverseCheckBox->isChecked(); 342 | d->currentOptions.fixDuplicates = d->fixDuplicatesCheckBox->isChecked(); 343 | d->currentOptions.copyDuplicates = d->copyDuplicatesCheckBox->isChecked(); 344 | } 345 | 346 | //-------------------------------------------------------------------------------------- 347 | 348 | void MainWindow::editFolderPattern() 349 | { 350 | QList items; 351 | items << PatternFormat::NewSubDir; 352 | items << PatternFormat::DelimiterDash; 353 | items << PatternFormat::DelimiterUnderscore; 354 | items << PatternFormat::DelimiterDot; 355 | items << PatternFormat::DelimiterHash; 356 | items << PatternFormat::DelimiterTilde; 357 | items << PatternFormat::DelimiterWhiteSpace; 358 | items << PatternFormat::CameraMake; 359 | items << PatternFormat::CameraModel; 360 | items << PatternFormat::MediaType; 361 | items << PatternFormat::Year; 362 | items << PatternFormat::Month; 363 | items << PatternFormat::MonthS; 364 | items << PatternFormat::MonthL; 365 | items << PatternFormat::Day; 366 | items << PatternFormat::DayS; 367 | items << PatternFormat::DayL; 368 | items << PatternFormat::WeekNumber; 369 | 370 | QString description = tr("Usage: Compose your desired folder structure by clicking on the items in the selection list.\n" 371 | "Inserting a subdirectory element will mark the beginning of a new sub folder."); 372 | 373 | ComposerDlg composer(items, d->folderPatternList, description); 374 | composer.setModal(true); 375 | int ret = composer.exec(); 376 | 377 | switch (ret) { 378 | case QDialog::Accepted: 379 | d->folderPatternList = composer.selectedItems(); 380 | evaluateFolderStructure(); 381 | break; 382 | default: 383 | break; 384 | } 385 | } 386 | 387 | //-------------------------------------------------------------------------------------- 388 | 389 | void MainWindow::editFilePattern() 390 | { 391 | QList items; 392 | items << PatternFormat::DelimiterDash; 393 | items << PatternFormat::DelimiterUnderscore; 394 | items << PatternFormat::DelimiterDot; 395 | items << PatternFormat::DelimiterHash; 396 | items << PatternFormat::DelimiterTilde; 397 | items << PatternFormat::DelimiterWhiteSpace; 398 | items << PatternFormat::CameraMake; 399 | items << PatternFormat::CameraModel; 400 | items << PatternFormat::MediaType; 401 | items << PatternFormat::Year; 402 | items << PatternFormat::Month; 403 | items << PatternFormat::MonthS; 404 | items << PatternFormat::MonthL; 405 | items << PatternFormat::Day; 406 | items << PatternFormat::DayS; 407 | items << PatternFormat::DayL; 408 | items << PatternFormat::Hour; 409 | items << PatternFormat::Minute; 410 | items << PatternFormat::Second; 411 | items << PatternFormat::Filename; 412 | 413 | QString description = tr("Usage: Compose your desired filename pattern by clicking on the items in the selection list."); 414 | 415 | ComposerDlg composer(items, d->filePatternList, description); 416 | composer.setModal(true); 417 | int ret = composer.exec(); 418 | 419 | switch (ret) { 420 | case QDialog::Accepted: 421 | d->filePatternList = composer.selectedItems(); 422 | evaluateFilenameStructure(); 423 | break; 424 | default: 425 | break; 426 | } 427 | } 428 | 429 | //-------------------------------------------------------------------------------------- 430 | 431 | bool MainWindow::validateSelection() 432 | { 433 | if (d->filePatternList.isEmpty()) { 434 | QMessageBox::warning(this, tr("Attention"), 435 | tr("The file name pattern cannot be empty!"), 436 | QMessageBox::Ok); 437 | return false; 438 | } 439 | 440 | if ( !Mover::dirExists(d->sourceLineEdit->text())) { 441 | QMessageBox::warning(this, tr("Attention"), 442 | tr("Invalid source folder!"), 443 | QMessageBox::Ok); 444 | return false; 445 | } 446 | 447 | if ( !Mover::makedir(d->targetLineEdit->text()) ) { 448 | QMessageBox::warning(this, tr("Attention"), 449 | tr("Cannot create target folder!"), 450 | QMessageBox::Ok); 451 | return false; 452 | } 453 | 454 | return true; 455 | } 456 | 457 | //-------------------------------------------------------------------------------------- 458 | 459 | void MainWindow::readSettings() 460 | { 461 | QString inputPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); 462 | QString outputPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/yaps_output"; 463 | 464 | QVariantList defaultFolderPattern; 465 | defaultFolderPattern << PatternFormat::Year; 466 | defaultFolderPattern << PatternFormat::NewSubDir; 467 | defaultFolderPattern << PatternFormat::Month; 468 | defaultFolderPattern << PatternFormat::DelimiterDash; 469 | defaultFolderPattern << PatternFormat::MonthL; 470 | 471 | QVariantList varList = d->settings->value("FolderPattern", defaultFolderPattern).toList(); 472 | foreach(const QVariant & var, varList) { 473 | if (var.canConvert()) { 474 | d->folderPatternList << var.value(); 475 | } 476 | } 477 | 478 | QVariantList defaultFilePattern; 479 | defaultFilePattern << PatternFormat::Day; 480 | defaultFilePattern << PatternFormat::DelimiterDash; 481 | defaultFilePattern << PatternFormat::MonthS; 482 | defaultFilePattern << PatternFormat::DelimiterDash; 483 | defaultFilePattern << PatternFormat::Hour; 484 | defaultFilePattern << PatternFormat::Minute; 485 | defaultFilePattern << PatternFormat::Second; 486 | 487 | QVariantList varList2 = d->settings->value("FilePattern", defaultFilePattern).toList(); 488 | foreach(const QVariant& var, varList2) { 489 | if (var.canConvert()) { 490 | d->filePatternList << var.value(); 491 | } 492 | } 493 | 494 | d->sourceLineEdit->setText(d->settings->value("SourceFolder", inputPath).toString()); 495 | d->targetLineEdit->setText(d->settings->value("TargetFolder", outputPath).toString()); 496 | } 497 | 498 | //-------------------------------------------------------------------------------------- 499 | 500 | void MainWindow::writeSettings() 501 | { 502 | QVariantList currentFolderPattern; 503 | foreach(PatternFormat::eTag tag, d->folderPatternList) { 504 | currentFolderPattern << tag; 505 | } 506 | d->settings->setValue("FolderPattern", currentFolderPattern); 507 | 508 | QVariantList currentFilePattern; 509 | foreach(PatternFormat::eTag tag, d->filePatternList) { 510 | currentFilePattern << tag; 511 | } 512 | d->settings->setValue("FilePattern", currentFilePattern); 513 | 514 | d->settings->setValue("SourceFolder", d->sourceLineEdit->text()); 515 | d->settings->setValue("TargetFolder", d->targetLineEdit->text()); 516 | d->settings->sync(); 517 | } 518 | 519 | //-------------------------------------------------------------------------------------- 520 | 521 | void MainWindow::onDetermineState() 522 | { 523 | bool enabled = d->fixDuplicatesCheckBox->isChecked(); 524 | d->copyDuplicatesCheckBox->setEnabled(enabled); 525 | } 526 | 527 | //-------------------------------------------------------------------------------------- 528 | 529 | 530 | 531 | -------------------------------------------------------------------------------- /src/mainWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef mainWindow_h__ 2 | #define mainWindow_h__ 3 | 4 | #include 5 | #include "mover.h" 6 | 7 | class QGroupBox; 8 | class MainWindowPrivate; 9 | 10 | /** 11 | * The main window of the desktop application 12 | */ 13 | class MainWindow : public QDialog 14 | { 15 | Q_OBJECT 16 | public: 17 | MainWindow(); 18 | virtual ~MainWindow(void); 19 | 20 | protected slots: 21 | void onSourceButtonClicked(); 22 | void onTargetButtonClicked(); 23 | 24 | void evaluateFolderStructure(); 25 | void evaluateFilenameStructure(); 26 | 27 | void editFilePattern(); 28 | void editFolderPattern(); 29 | 30 | void doMove(); 31 | void doCopy(); 32 | 33 | void onDetermineState(); 34 | 35 | protected: 36 | QGroupBox* createIntroGroup(); 37 | QGroupBox* createSourceGroup(); 38 | QGroupBox* createTargetGroup(); 39 | QGroupBox* createFolderGroup(); 40 | QGroupBox* createFileGroup(); 41 | QGroupBox* createActionGroup(); 42 | 43 | QString openFileDialog(); 44 | void evaluateFileOptions(); 45 | bool validateSelection(); 46 | void readSettings(); 47 | void writeSettings(); 48 | 49 | private: 50 | MainWindowPrivate* d; 51 | }; 52 | 53 | #endif // mainWindow_h__ 54 | -------------------------------------------------------------------------------- /src/mover.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Michael Knopke 3 | * 4 | * See the COPYRIGHT file for terms of use. 5 | */ 6 | 7 | #include "mover.h" 8 | #include "exifWrapper.h" 9 | #include "simpleLog.h" 10 | #include "reportDlg.h" 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | struct AddWrapper { 17 | ExifWrapper *instance; 18 | AddWrapper(ExifWrapper *w): instance(w) {} 19 | void operator()(ExifData& data) { 20 | instance->parseFile(data); 21 | } 22 | }; 23 | 24 | namespace { 25 | QString DUPLICATES_FOLDER = "[Duplicates]"; 26 | QString NOEXIFDATA_FOLDER = "[NoExifData]"; 27 | QString HASH_FILE_NAME = "hash.txt"; 28 | QString INVALID_CHECKSUM = "invalid_check_sum"; 29 | } 30 | 31 | //-------------------------------------------------------------------------------------- 32 | 33 | class MoverPrivate 34 | { 35 | public: 36 | QString appPath; 37 | QString currentTarget; 38 | QString sourcePath; 39 | QHash > md5HashSet; 40 | ExifWrapper* wrapper; 41 | 42 | ReportDetail report; 43 | 44 | AddWrapper *wrap; 45 | }; 46 | 47 | //-------------------------------------------------------------------------------------- 48 | 49 | Mover::Mover( QObject* parent/*= NULL*/ ) : QObject(parent), d(new MoverPrivate) 50 | { 51 | d->appPath = QApplication::applicationDirPath(); 52 | #ifdef Q_WS_MAC 53 | d->appPath = QCoreApplication::applicationDirPath() + "/../../.."; 54 | #endif 55 | d->wrapper = new ExifWrapper(d->appPath, this); 56 | d->wrap = new AddWrapper(d->wrapper); 57 | } 58 | 59 | //-------------------------------------------------------------------------------------- 60 | 61 | Mover::~Mover() 62 | { 63 | delete d; 64 | d = NULL; 65 | } 66 | 67 | //-------------------------------------------------------------------------------------- 68 | 69 | bool Mover::performOperations(const QString &source, const QString &target, const FileOptions& options, const PatternFormat& format) 70 | { 71 | this->reset(); 72 | d->sourcePath = source; 73 | 74 | // make sure the target folder exists 75 | if (!makedir(target) ) { 76 | return false; 77 | } 78 | 79 | d->currentTarget = target; 80 | QString logs = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/yaps_logs"; 81 | makedir(logs); 82 | QString logFilepath = logs + "/" + QDateTime::currentDateTime().toString("yyyyMMdd_hhmmss") + ".txt"; 83 | SimpleLog::startFileLogging(logFilepath); 84 | 85 | QElapsedTimer elapsed; 86 | elapsed.start(); 87 | 88 | // query all files in the directory 89 | QStringList files = findAllFilesInDirectory(source, options.traverseSubdirectories); 90 | 91 | // parse meta tags 92 | QList parsedData = parseFiles(files, options); 93 | 94 | // now copy or move 95 | bool result = performFileOperation(parsedData, target, options, format); 96 | 97 | // update hash files 98 | this->writeHashFiles(); 99 | 100 | SimpleLog::stopFileLogging(); 101 | 102 | // show report 103 | ReportDlg myDialog; 104 | myDialog.setModal(true); 105 | 106 | ReportDetail detail; 107 | detail = d->report; 108 | detail.ElapsedTime = QDateTime::fromSecsSinceEpoch(elapsed.elapsed()/1000).toUTC().toString("hh:mm:ss"); 109 | detail.LogfilePath = logFilepath; 110 | 111 | myDialog.setReportDetail(detail); 112 | 113 | qWarning() << "Operation took" << detail.ElapsedTime; 114 | myDialog.exec(); 115 | 116 | return result; 117 | } 118 | 119 | //-------------------------------------------------------------------------------------- 120 | 121 | QStringList Mover::findAllFilesInDirectory( const QString& path, bool traverseSubdir ) 122 | { 123 | QStringList result; 124 | qDebug() << "traversal started"; 125 | 126 | QDir dir(path); 127 | dir.setFilter(QDir::Files); 128 | 129 | QProgressDialog progress(tr("Looking for files..."), tr("Cancel"), 0, 0); 130 | progress.setModal(true); 131 | 132 | if ( dir.exists() ) { 133 | bool stop = false; 134 | QDirIterator directory_walker(path, QDir::Files, QDirIterator::Subdirectories); 135 | int i=0; 136 | while( directory_walker.hasNext() && !stop) { 137 | if (progress.wasCanceled()) { 138 | break; 139 | } 140 | QString file = directory_walker.next(); 141 | result << file; 142 | 143 | if (!traverseSubdir) { 144 | stop = true; 145 | } 146 | 147 | progress.setValue(i++); 148 | d->report.FilesTotal++; 149 | } 150 | } 151 | 152 | qDebug() << "traversal finished"; 153 | progress.hide(); 154 | 155 | return result; 156 | } 157 | 158 | //-------------------------------------------------------------------------------------- 159 | 160 | QList Mover::parseFiles( const QStringList& files, const FileOptions& options ) 161 | { 162 | qDebug() << "parsing started"; 163 | 164 | int numFiles = files.count(); 165 | QProgressDialog progress("", tr("Cancel"), 0, numFiles); 166 | progress.setLabelText(QString(tr("Parsing meta information using %1 thread(s)...")).arg(QThread::idealThreadCount())); 167 | progress.setModal(true); 168 | 169 | QList parsedData; 170 | foreach(const QString& path, files) { 171 | ExifData data; 172 | data.FilePath = path; 173 | QFileInfo info(path); 174 | data.AbsolutePath = info.absolutePath(); 175 | parsedData << data; 176 | } 177 | 178 | // Create a QFutureWatcher and connect signals and slots. 179 | // Monitor progress changes of the future 180 | QFutureWatcher watcher; 181 | connect(&watcher, &QFutureWatcher::finished, &progress, &QProgressDialog::reset); 182 | connect(&watcher, &QFutureWatcher::progressRangeChanged, &progress, &QProgressDialog::setRange); 183 | connect(&watcher, &QFutureWatcher::progressValueChanged, &progress, &QProgressDialog::setValue); 184 | connect(&progress, &QProgressDialog::canceled, &watcher, &QFutureWatcher::cancel); 185 | 186 | // Start the computation. 187 | watcher.setFuture(QtConcurrent::map(parsedData, *d->wrap)); 188 | 189 | // Display the dialog and start the event loop. 190 | progress.exec(); 191 | 192 | watcher.waitForFinished(); 193 | 194 | qDebug() << "parsing finished"; 195 | 196 | return parsedData; 197 | 198 | } 199 | 200 | //-------------------------------------------------------------------------------------- 201 | 202 | bool Mover::performFileOperation( const QList& parsedData, const QString& target, const FileOptions& options, const PatternFormat& format ) 203 | { 204 | qDebug() << "copying started"; 205 | 206 | int numFiles = parsedData.count(); 207 | QProgressDialog progress("Copying files...", "Cancel", 0, numFiles); 208 | progress.setModal(true); 209 | 210 | for(int i=0; ireport.FilesFailed++; 217 | } 218 | progress.setValue(i); 219 | } 220 | 221 | qDebug() << "copying finished"; 222 | progress.hide(); 223 | 224 | return true; 225 | } 226 | 227 | //-------------------------------------------------------------------------------------- 228 | 229 | bool Mover::fileOperation(const ExifData &data, const QString &target, const FileOptions& options, const PatternFormat& format) 230 | { 231 | if (data.FilePath.isEmpty()) { 232 | qWarning() << "file error, no path given"; 233 | return false; 234 | } 235 | 236 | if (data.CreateDate.isInvalid()) { 237 | qWarning() << "invalid creation date, or no exif meta data present" << data.FilePath; 238 | QString relativePath = data.AbsolutePath; 239 | relativePath.remove(d->sourcePath); 240 | QString folder = target + "/" + NOEXIFDATA_FOLDER + "/" + relativePath; 241 | makedir(folder); 242 | return copyOrMoveFile(data.FilePath, folder + "/" + data.FileName + "." + data.Extention, options); 243 | } 244 | 245 | d->report.FilesWithExif++; 246 | 247 | // create folders from pattern 248 | QString finalTarget = createFolderStructure(target, data, format); 249 | 250 | // check for duplicates 251 | if (options.fixDuplicates) { 252 | initializeFolder(finalTarget); 253 | if (hasDuplicateHash(finalTarget, data.FilePath)) { 254 | d->report.Duplicates++; 255 | qWarning() << data.FileName << ", file already exists in target location" << finalTarget; 256 | if (options.copyDuplicates) { 257 | QString relativePath = data.AbsolutePath; 258 | relativePath.remove(d->sourcePath); 259 | QString folder = target + "/" + DUPLICATES_FOLDER + "/" + relativePath; 260 | qDebug() << "copy " << folder; 261 | makedir(folder); 262 | return copyOrMoveFile(data.FilePath, folder + "/" + data.FileName + "." + data.Extention, options); 263 | } 264 | return true; 265 | } 266 | } 267 | 268 | // create filename from pattern 269 | finalTarget += "/"+ createFilename(data, format); 270 | 271 | bool result = copyOrMoveFile(data.FilePath, finalTarget, options); 272 | if (result) { 273 | d->report.FilesCopied++; 274 | } 275 | return result; 276 | } 277 | 278 | //-------------------------------------------------------------------------------------- 279 | 280 | bool Mover::copyOrMoveFile( const QString& source, const QString& target, const FileOptions& options ) 281 | { 282 | QFile original(source); 283 | QString finalTarget = target; 284 | // now check for name clashes and create a new filename 285 | if (QFile::exists(target)) { 286 | d->report.Duplicates++; 287 | if (options.fileOp != FileOptions::COPY) { 288 | original.remove(source); 289 | } 290 | return true; 291 | } 292 | 293 | 294 | // depending on the input either copy or move the file 295 | 296 | bool ok = false; 297 | if (options.fileOp == FileOptions::COPY) { 298 | ok = original.copy(finalTarget); 299 | } 300 | else { 301 | ok = original.rename(finalTarget); 302 | } 303 | 304 | if (!ok) { 305 | qWarning() << QString("Failed to copy file %1 to target %2").arg(source, target); 306 | } 307 | 308 | return ok; 309 | } 310 | 311 | //-------------------------------------------------------------------------------------- 312 | 313 | bool Mover::dirExists( const QString& path ) 314 | { 315 | QDir dir(path); 316 | return dir.exists(path); 317 | } 318 | 319 | //-------------------------------------------------------------------------------------- 320 | 321 | bool Mover::makedir( const QString& path ) 322 | { 323 | QDir dir(path); 324 | 325 | if (dir.exists(path)){ 326 | return true; 327 | } 328 | qDebug() << "creating directory" << path; 329 | 330 | if (!dir.mkpath(path)) { 331 | qWarning() << "Could not create directory: " << path; 332 | return false; 333 | } 334 | return true; 335 | } 336 | 337 | //-------------------------------------------------------------------------------------- 338 | 339 | QString Mover::proposeNewFilename(const QString &path) 340 | { 341 | QString result = path; 342 | 343 | QString proposed; 344 | int i = 1; 345 | do { 346 | QFileInfo info(result); 347 | QString suffix = info.suffix(); 348 | if (!suffix.isEmpty()) { 349 | suffix.prepend("."); 350 | } 351 | proposed = info.path() + "/" + info.completeBaseName() + "(" + QString::number(i) + ")" + suffix; 352 | i++; 353 | } while (QFile::exists(proposed)); 354 | result = proposed; 355 | return result; 356 | } 357 | 358 | //-------------------------------------------------------------------------------------- 359 | 360 | QString Mover::createFolderStructure( const QString& root, const ExifData& data, const PatternFormat& format ) 361 | { 362 | QString result; 363 | foreach( PatternFormat::eTag tag, format.FolderStructureContainer) { 364 | result += tagToValue(tag, data); 365 | } 366 | 367 | QStringList subdirs = result.split("/"); 368 | 369 | QString part = root; 370 | for(int i=0; i < subdirs.count(); ++i) { 371 | QString next = subdirs.at(i); 372 | part += "/"+ next; 373 | makedir(part); 374 | } 375 | result.prepend(root + "/"); 376 | return result; 377 | } 378 | 379 | //-------------------------------------------------------------------------------------- 380 | 381 | QString Mover::createFilename( const ExifData& data, const PatternFormat& format ) 382 | { 383 | QString result; 384 | foreach( PatternFormat::eTag tag, format.FileStructureContainer) { 385 | result += tagToValue(tag, data); 386 | } 387 | return result + "." + data.Extention; 388 | } 389 | 390 | //-------------------------------------------------------------------------------------- 391 | 392 | QString Mover::tagToValue(PatternFormat::eTag tag, const ExifData& data) 393 | { 394 | QString result; 395 | switch(tag) 396 | { 397 | case PatternFormat::CameraMake: 398 | result = data.CameraMake; 399 | break; 400 | case PatternFormat::CameraModel: 401 | result = data.CameraModel; 402 | break; 403 | case PatternFormat::MediaType: 404 | if (data.MimeType.contains("image")) 405 | result = "image"; 406 | else if (data.MimeType.contains("video")) 407 | result = "video"; 408 | else 409 | result = "other"; 410 | break; 411 | case PatternFormat::Year: 412 | result = data.CreateDate.year(); 413 | break; 414 | case PatternFormat::Month: 415 | result = data.CreateDate.month(); 416 | break; 417 | case PatternFormat::MonthS: 418 | result = data.CreateDate.monthS(); 419 | break; 420 | case PatternFormat::MonthL: 421 | result = data.CreateDate.monthL(); 422 | break; 423 | case PatternFormat::WeekNumber: 424 | result = data.CreateDate.weekNumber(); 425 | break; 426 | case PatternFormat::Day: 427 | result = data.CreateDate.day(); 428 | break; 429 | case PatternFormat::DayS: 430 | result = data.CreateDate.dayS(); 431 | break; 432 | case PatternFormat::DayL: 433 | result = data.CreateDate.dayL(); 434 | break; 435 | case PatternFormat::Hour: 436 | result = data.CreateDate.hour(); 437 | break; 438 | case PatternFormat::Minute: 439 | result = data.CreateDate.minute(); 440 | break; 441 | case PatternFormat::Second: 442 | result = data.CreateDate.second(); 443 | break; 444 | case PatternFormat::Filename: 445 | result = data.FileName; 446 | break; 447 | case PatternFormat::NewSubDir: 448 | result = "/"; 449 | break; 450 | case PatternFormat::DelimiterDash: 451 | result = "-"; 452 | break; 453 | case PatternFormat::DelimiterDot: 454 | result = "."; 455 | break; 456 | case PatternFormat::DelimiterHash: 457 | result = "#"; 458 | break; 459 | case PatternFormat::DelimiterUnderscore: 460 | result = "_"; 461 | break; 462 | case PatternFormat::DelimiterTilde: 463 | result = "~"; 464 | break; 465 | case PatternFormat::DelimiterWhiteSpace: 466 | result = " "; 467 | break; 468 | 469 | default: 470 | qWarning() << "default not implemented"; 471 | break; 472 | } 473 | return result; 474 | } 475 | 476 | //-------------------------------------------------------------------------------------- 477 | 478 | QString Mover::md5sum( const QString& filepath ) 479 | { 480 | QFile file(filepath); 481 | 482 | if (!file.exists()) { 483 | qWarning() << "file doesn't exist at location" << filepath; 484 | return INVALID_CHECKSUM; 485 | } 486 | 487 | if (file.open(QIODevice::ReadOnly)) { 488 | QByteArray fileData = file.readAll(); 489 | 490 | QByteArray hashData = QCryptographicHash::hash(fileData,QCryptographicHash::Md5); 491 | return hashData.toHex(); 492 | } 493 | qWarning() << "[md5sum] unable to read file" << filepath; 494 | return INVALID_CHECKSUM; 495 | } 496 | 497 | //-------------------------------------------------------------------------------------- 498 | 499 | bool Mover::hasDuplicateHash( const QString& folder, const QString& filepath ) 500 | { 501 | if (!d->md5HashSet.contains(folder)) { 502 | return false; 503 | } 504 | 505 | QHash set = d->md5HashSet.value(folder); 506 | QString md5 = md5sum(filepath); 507 | 508 | QString result = set.value(md5, ""); 509 | if (result.isEmpty()) { 510 | QFileInfo info(filepath); 511 | set.insert(info.fileName(), md5); 512 | d->md5HashSet[folder] = set; 513 | } 514 | return !result.isEmpty(); 515 | } 516 | 517 | //-------------------------------------------------------------------------------------- 518 | 519 | void Mover::initializeFolder( const QString& folder ) 520 | { 521 | if (d->md5HashSet.contains(folder)) { 522 | return; 523 | } 524 | 525 | bool hashIntegrity = this->checkHashIntegrity(folder); 526 | 527 | 528 | // if hash integrity is not given rehash 529 | if (!hashIntegrity) { 530 | 531 | // find all files 532 | QDir dir(folder); 533 | QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot); 534 | 535 | if (!files.empty()) { 536 | qDebug() << "initializing folder " << folder << " with" << files.count() << "files"; 537 | 538 | // hash them and update global hashset 539 | QHash set; 540 | foreach(const QString & file, files) { 541 | QString filepath = folder + "/" + file; 542 | QString md5 = md5sum(filepath); 543 | set.insert(file, md5); 544 | } 545 | d->md5HashSet[folder] = set; 546 | } 547 | } 548 | } 549 | 550 | //-------------------------------------------------------------------------------------- 551 | 552 | bool Mover::checkHashIntegrity(const QString& folder) 553 | { 554 | QDir dir(folder); 555 | QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot); 556 | if (files.isEmpty()) return true; 557 | files.removeAll(HASH_FILE_NAME); 558 | 559 | QFile hashFile(folder + "/" + HASH_FILE_NAME); 560 | if (!hashFile.exists()) return false; 561 | 562 | QHash set; 563 | if (!hashFile.open(QIODevice::ReadOnly)) { 564 | qWarning() << "could not open hash file: " << folder << "/" << HASH_FILE_NAME; 565 | return false; 566 | } 567 | QTextStream in(&hashFile); 568 | bool hashIntegrity = true; 569 | QStringList filesInHash; 570 | while (!in.atEnd()) { 571 | QString line = in.readLine(); 572 | QStringList fields = line.split(","); 573 | if (fields.count() == 2) { 574 | QString filename = fields.at(0); 575 | QString md5 = fields.at(1); 576 | if (md5 == INVALID_CHECKSUM) { 577 | hashIntegrity = false; 578 | qWarning() << filename << " : " << INVALID_CHECKSUM; 579 | break; 580 | } 581 | set.insert(filename, md5); 582 | filesInHash.push_back(filename); 583 | } 584 | else { 585 | hashIntegrity = false; 586 | qWarning() << "invalid hash structure"; 587 | } 588 | } 589 | hashFile.close(); 590 | 591 | // check that each file exists in the hashfile 592 | for (const auto& i : files) { 593 | if (!filesInHash.contains(i)) { 594 | hashIntegrity = false; 595 | qWarning() << i << " not found in hashfile"; 596 | break; 597 | } 598 | } 599 | 600 | if (hashIntegrity) { 601 | qDebug() << "successfully initialized " << folder << " from hash file"; 602 | d->md5HashSet[folder] = set; 603 | } 604 | 605 | return hashIntegrity; 606 | } 607 | 608 | //-------------------------------------------------------------------------------------- 609 | 610 | void Mover::reset() 611 | { 612 | d->md5HashSet.clear(); 613 | 614 | d->report.Duplicates = 0; 615 | d->report.FilesCopied = 0; 616 | d->report.FilesFailed = 0; 617 | d->report.FilesWithExif = 0; 618 | d->report.FilesTotal = 0; 619 | } 620 | 621 | //-------------------------------------------------------------------------------------- 622 | 623 | void Mover::writeHashFiles() 624 | { 625 | for (auto it = d->md5HashSet.cbegin(), end = d->md5HashSet.cend(); it != end; ++it) { 626 | auto folder = it.key(); 627 | auto fileToMd5Map = it.value(); 628 | this->writeHashFile(folder, fileToMd5Map); 629 | } 630 | } 631 | //-------------------------------------------------------------------------------------- 632 | 633 | void Mover::writeHashFile(const QString& folder, const QHash& fileToMd5Map) 634 | { 635 | auto hashFile = QFile(folder + "/" + HASH_FILE_NAME); 636 | if (hashFile.open(QFile::WriteOnly | QFile::Truncate)) { 637 | QTextStream stream(&hashFile); 638 | for (auto i = fileToMd5Map.cbegin(), end = fileToMd5Map.cend(); i != end; ++i) { 639 | stream << i.key() << "," << i.value() << "\n"; 640 | } 641 | hashFile.resize(hashFile.pos()); 642 | hashFile.close(); 643 | return; 644 | } 645 | qWarning() << "failed writing hash file" << hashFile.fileName(); 646 | } 647 | //-------------------------------------------------------------------------------------- 648 | -------------------------------------------------------------------------------- /src/mover.h: -------------------------------------------------------------------------------- 1 | #ifndef mover_h__ 2 | #define mover_h__ 3 | 4 | /* 5 | * Copyright (C) 2014 Michael Knopke 6 | * 7 | * See the COPYRIGHT file for terms of use. 8 | */ 9 | 10 | #include "exifData.h" 11 | #include "patternFormat.h" 12 | 13 | #include 14 | 15 | class FileOptions 16 | { 17 | public: 18 | enum eFileOperation { 19 | COPY, 20 | MOVE 21 | }; 22 | 23 | FileOptions() { 24 | traverseSubdirectories = true; 25 | fixDuplicates = true; 26 | fileOp = COPY; 27 | } 28 | 29 | bool traverseSubdirectories; 30 | bool fixDuplicates; 31 | bool copyDuplicates; 32 | eFileOperation fileOp; 33 | }; 34 | 35 | 36 | class MoverPrivate; 37 | class Mover : public QObject 38 | { 39 | Q_OBJECT 40 | public: 41 | Mover(QObject* parent= NULL); 42 | ~Mover(); 43 | 44 | bool performOperations(const QString& source, const QString& target, const FileOptions& options, const PatternFormat& format); 45 | 46 | static bool makedir(const QString& path); 47 | 48 | static bool dirExists(const QString& path); 49 | protected: 50 | 51 | QStringList findAllFilesInDirectory(const QString& path, bool traverseSubdir); 52 | 53 | QList parseFiles(const QStringList& files, const FileOptions& options); 54 | 55 | bool performFileOperation(const QList& files, const QString& target, const FileOptions& options, const PatternFormat& format); 56 | 57 | bool fileOperation(const ExifData& data, const QString& target, const FileOptions& options, const PatternFormat& format); 58 | 59 | QString proposeNewFilename(const QString& path); 60 | 61 | QString createFolderStructure(const QString& root, const ExifData& data, const PatternFormat& format); 62 | 63 | QString createFilename(const ExifData& data, const PatternFormat& format); 64 | 65 | QString tagToValue(PatternFormat::eTag tag, const ExifData& data); 66 | 67 | bool hasDuplicateHash(const QString& folder, const QString& filepath); 68 | 69 | QString md5sum(const QString& filepath); 70 | 71 | void initializeFolder(const QString& folder); 72 | 73 | bool copyOrMoveFile(const QString& source, const QString& target, const FileOptions& options); 74 | 75 | void writeHashFiles(); 76 | 77 | void writeHashFile(const QString& folder, const QHash& fileToMd5Map); 78 | 79 | bool checkHashIntegrity(const QString& folder); 80 | 81 | void reset(); 82 | 83 | private: 84 | MoverPrivate* d; 85 | }; 86 | #endif // mover_h__ 87 | -------------------------------------------------------------------------------- /src/patternFormat.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Michael Knopke 3 | * 4 | * See the COPYRIGHT file for terms of use. 5 | */ 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | QString PatternFormat::tagToString( eTag tag ) 14 | { 15 | QString result; 16 | switch(tag) { 17 | case PatternFormat::CameraMake: 18 | result = "[CamMake]"; 19 | break; 20 | case PatternFormat::CameraModel: 21 | result = "[CamModel]"; 22 | break; 23 | case PatternFormat::MediaType: 24 | result = "[MediaType]"; 25 | break; 26 | case PatternFormat::Year: 27 | result = "[year: yyyy]"; 28 | break; 29 | case PatternFormat::Month: 30 | result = "[month: mm]"; 31 | break; 32 | case PatternFormat::MonthS: 33 | result = "[month: short]"; 34 | break; 35 | case PatternFormat::MonthL: 36 | result = "[month: long]"; 37 | break; 38 | case PatternFormat::WeekNumber: 39 | result = "[WeekNumber]"; 40 | break; 41 | case PatternFormat::Day: 42 | result = "[day: dd]"; 43 | break; 44 | case PatternFormat::DayS: 45 | result = "[day: short]"; 46 | break; 47 | case PatternFormat::DayL: 48 | result = "[day: long]"; 49 | break; 50 | case PatternFormat::Hour: 51 | result = "[hour: hh]"; 52 | break; 53 | case PatternFormat::Minute: 54 | result = "[minute: MM]"; 55 | break; 56 | case PatternFormat::Second: 57 | result = "[second: ss]"; 58 | break; 59 | case PatternFormat::Filename: 60 | result = "[fname]"; 61 | break; 62 | case PatternFormat::NewSubDir: 63 | result = "[/]"; 64 | break; 65 | case PatternFormat::DelimiterDash: 66 | result = "[-]"; 67 | break; 68 | case PatternFormat::DelimiterDot: 69 | result = "[.]"; 70 | break; 71 | case PatternFormat::DelimiterHash: 72 | result = "[#]"; 73 | break; 74 | case PatternFormat::DelimiterUnderscore: 75 | result = "[_]"; 76 | break; 77 | case PatternFormat::DelimiterTilde: 78 | result = "[~]"; 79 | break; 80 | case PatternFormat::DelimiterWhiteSpace: 81 | result = "[ ]"; 82 | break; 83 | default: 84 | qWarning() << "default not implemented"; 85 | break; 86 | } 87 | return result; 88 | } 89 | 90 | //-------------------------------------------------------------------------------------- 91 | 92 | QString PatternFormat::tagToDescription( eTag tag ) 93 | { 94 | QString result; 95 | switch(tag) { 96 | case PatternFormat::CameraMake: 97 | result = "Camera brand name"; 98 | break; 99 | case PatternFormat::CameraModel: 100 | result = "Camera model name"; 101 | break; 102 | case PatternFormat::MediaType: 103 | result = "One of the following: image, video, other"; 104 | break; 105 | case PatternFormat::Year: 106 | result = "creation date - year"; 107 | break; 108 | case PatternFormat::Month: 109 | result = "creation date - month"; 110 | break; 111 | case PatternFormat::MonthS: 112 | result = "creation date - month short name"; 113 | break; 114 | case PatternFormat::MonthL: 115 | result = "creation date - month long name"; 116 | break; 117 | case PatternFormat::WeekNumber: 118 | result = "creation date - week number"; 119 | break; 120 | case PatternFormat::Day: 121 | result = "creation date - day"; 122 | break; 123 | case PatternFormat::DayS: 124 | result = "creation date - day short name"; 125 | break; 126 | case PatternFormat::DayL: 127 | result = "creation date - day long name"; 128 | break; 129 | case PatternFormat::Hour: 130 | result = "creation date - hour"; 131 | break; 132 | case PatternFormat::Minute: 133 | result = "creation date - minute"; 134 | break; 135 | case PatternFormat::Second: 136 | result = "creation date - second"; 137 | break; 138 | case PatternFormat::Filename: 139 | result = "original filename"; 140 | break; 141 | case PatternFormat::NewSubDir: 142 | result = "create new subdirectory"; 143 | break; 144 | case PatternFormat::DelimiterDash: 145 | result = "insert delimiter -"; 146 | break; 147 | case PatternFormat::DelimiterDot: 148 | result = "insert delimiter ."; 149 | break; 150 | case PatternFormat::DelimiterHash: 151 | result = "insert delimiter #"; 152 | break; 153 | case PatternFormat::DelimiterUnderscore: 154 | result = "insert delimiter _"; 155 | break; 156 | case PatternFormat::DelimiterTilde: 157 | result = "insert delimiter ~"; 158 | break; 159 | case PatternFormat::DelimiterWhiteSpace: 160 | result = "insert delimiter [whitespace]"; 161 | break; 162 | 163 | default: 164 | qWarning() << "default not implemented"; 165 | break; 166 | } 167 | return result; 168 | } 169 | 170 | //-------------------------------------------------------------------------------------- 171 | 172 | QString PatternFormat::tagToExample( eTag tag ) 173 | { 174 | QString result; 175 | switch(tag) { 176 | case PatternFormat::CameraMake: 177 | result = "Nikon"; 178 | break; 179 | case PatternFormat::CameraModel: 180 | result = "D50"; 181 | break; 182 | case PatternFormat::MediaType: 183 | result = "image"; 184 | break; 185 | case PatternFormat::Year: 186 | result = QDate::currentDate().toString("yyyy"); 187 | break; 188 | case PatternFormat::Month: 189 | result = QDate::currentDate().toString("MM"); 190 | break; 191 | case PatternFormat::MonthS: 192 | result = QDate::currentDate().toString("MMM"); 193 | break; 194 | case PatternFormat::MonthL: 195 | result = QDate::currentDate().toString("MMMM"); 196 | break; 197 | case PatternFormat::WeekNumber: 198 | result = QString::number(QDate::currentDate().weekNumber()).rightJustified(2, '0'); 199 | break; 200 | case PatternFormat::Day: 201 | result = QDate::currentDate().toString("dd"); 202 | break; 203 | case PatternFormat::DayS: 204 | result = QDate::currentDate().toString("ddd"); 205 | break; 206 | case PatternFormat::DayL: 207 | result = QDate::currentDate().toString("dddd"); 208 | break; 209 | case PatternFormat::Hour: 210 | result = QTime::currentTime().toString("hh"); 211 | break; 212 | case PatternFormat::Minute: 213 | result = QTime::currentTime().toString("mm"); 214 | break; 215 | case PatternFormat::Second: 216 | result = QTime::currentTime().toString("ss"); 217 | break; 218 | case PatternFormat::Filename: 219 | result = "P0001"; 220 | break; 221 | case PatternFormat::NewSubDir: 222 | result = "/"; 223 | break; 224 | case PatternFormat::DelimiterDash: 225 | result = "-"; 226 | break; 227 | case PatternFormat::DelimiterDot: 228 | result = "."; 229 | break; 230 | case PatternFormat::DelimiterHash: 231 | result = "#"; 232 | break; 233 | case PatternFormat::DelimiterUnderscore: 234 | result = "_"; 235 | break; 236 | case PatternFormat::DelimiterTilde: 237 | result = "~"; 238 | break; 239 | case PatternFormat::DelimiterWhiteSpace: 240 | result = " "; 241 | break; 242 | 243 | default: 244 | qWarning() << "default not implemented"; 245 | break; 246 | } 247 | return result; 248 | } 249 | 250 | //-------------------------------------------------------------------------------------- 251 | 252 | -------------------------------------------------------------------------------- /src/patternFormat.h: -------------------------------------------------------------------------------- 1 | #ifndef patternFormat_h__ 2 | #define patternFormat_h__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class PatternFormat 9 | { 10 | public: 11 | enum eTag { 12 | CameraMake, 13 | CameraModel, 14 | MediaType, 15 | Year, 16 | Month, 17 | MonthS, 18 | MonthL, 19 | Day, 20 | DayS, 21 | DayL, 22 | Hour, 23 | Minute, 24 | Second, 25 | Filename, 26 | NewSubDir, 27 | DelimiterDash, 28 | DelimiterDot, 29 | DelimiterHash, 30 | DelimiterUnderscore, 31 | DelimiterTilde, 32 | DelimiterWhiteSpace, 33 | WeekNumber 34 | }; 35 | 36 | QList FolderStructureContainer; 37 | 38 | QList FileStructureContainer; 39 | 40 | static QString tagToString(PatternFormat::eTag tag); 41 | 42 | static QString tagToDescription(PatternFormat::eTag tag); 43 | 44 | static QString tagToExample(PatternFormat::eTag tag); 45 | 46 | }; 47 | 48 | Q_DECLARE_METATYPE(PatternFormat) 49 | Q_DECLARE_METATYPE(PatternFormat::eTag) 50 | 51 | #endif //patternFormat_h__ 52 | -------------------------------------------------------------------------------- /src/reportDlg.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Michael Knopke 3 | * 4 | * See the COPYRIGHT file for terms of use. 5 | */ 6 | 7 | #include "reportDlg.h" 8 | 9 | #include 10 | #include 11 | 12 | class ReportDlgPrivate 13 | { 14 | public: 15 | QLabel* statusL; 16 | QPushButton* openButton; 17 | QString logpath; 18 | }; 19 | 20 | ReportDlg::ReportDlg( QWidget *parent /*= 0*/ ) : QDialog(parent), d(new ReportDlgPrivate) 21 | { 22 | setWindowFlags( Qt::Dialog | Qt::WindowTitleHint ); 23 | QLabel* captionL = new QLabel(QString(tr("Report from: ")) + QDateTime::currentDateTime().toString()); 24 | d->statusL = new QLabel; 25 | d->openButton = new QPushButton(tr("show log")); 26 | QVBoxLayout* hbox = new QVBoxLayout; 27 | QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); 28 | 29 | connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); 30 | connect(d->openButton, SIGNAL(clicked()), this, SLOT(openLogFile())); 31 | 32 | hbox->addWidget(captionL); 33 | hbox->addWidget(d->statusL); 34 | hbox->addWidget(d->openButton); 35 | hbox->addWidget(buttonBox); 36 | setLayout(hbox); 37 | } 38 | 39 | ReportDlg::~ReportDlg() 40 | { 41 | delete d; 42 | d = NULL; 43 | } 44 | 45 | void ReportDlg::setReportDetail( const ReportDetail& detail ) 46 | { 47 | d->statusL->setText( QString("Time taken: %1\n" 48 | "Total number of files found: %2\n" 49 | "Number of Exif files: %3\n" 50 | "Number of duplicate files: %4\n" 51 | "Number of copied files: %5\n" 52 | "Number of failed files: %6\n" 53 | ).arg(detail.ElapsedTime) 54 | .arg(detail.FilesTotal) 55 | .arg(detail.FilesWithExif) 56 | .arg(detail.Duplicates) 57 | .arg(detail.FilesCopied) 58 | .arg(detail.FilesFailed)); 59 | d->logpath = detail.LogfilePath; 60 | } 61 | 62 | void ReportDlg::openLogFile() 63 | { 64 | if (!QDesktopServices::openUrl(QUrl("file:///" + d->logpath, QUrl::TolerantMode))) { 65 | qWarning() << "failed to open logfile file" << d->logpath; 66 | } 67 | } 68 | 69 | -------------------------------------------------------------------------------- /src/reportDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef reportDlg_h__ 2 | #define reportDlg_h__ 3 | 4 | #include 5 | 6 | struct ReportDetail { 7 | QString ElapsedTime; 8 | int FilesTotal; 9 | int FilesWithExif; 10 | int FilesFailed; 11 | int FilesCopied; 12 | int Duplicates; 13 | QString LogfilePath; 14 | }; 15 | 16 | class ReportDlgPrivate; 17 | class ReportDlg : public QDialog 18 | { 19 | Q_OBJECT 20 | public: 21 | ReportDlg(QWidget *parent = 0); 22 | ~ReportDlg(); 23 | 24 | void setReportDetail(const ReportDetail& detail); 25 | 26 | protected slots: 27 | void openLogFile(); 28 | 29 | private: 30 | ReportDlgPrivate* d; 31 | }; 32 | 33 | #endif // reportDlg_h__ 34 | 35 | -------------------------------------------------------------------------------- /src/resources/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knopkem/yaps/20e9b638ee47372020716d9daf1b778d4880167c/src/resources/logo.ico -------------------------------------------------------------------------------- /src/simpleLog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Michael Knopke 3 | * 4 | * See the COPYRIGHT file for terms of use. 5 | */ 6 | 7 | #include "simpleLog.h" 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | QString SimpleLog::logFileLocation = ""; 15 | QFile* SimpleLog::m_File = NULL; 16 | QTextStream* SimpleLog::m_OutputStream = NULL; 17 | QMutex SimpleLog::mutex; 18 | 19 | //-------------------------------------------------------------------------------------- 20 | 21 | void SimpleLog::log( eLogLevel level, const QString& msg ) 22 | { 23 | QMutexLocker locker(&mutex); 24 | 25 | std::cout << msg.toStdString() << std::endl; 26 | 27 | QString outMsg = levelToString(level) + " (" + QDateTime::currentDateTime().toString("yyyy/MM/dd-hh:mm:ss") + ") " + msg; 28 | 29 | if (logFileLocation.isEmpty()) { 30 | return; 31 | } 32 | *m_OutputStream << outMsg 33 | 34 | #ifdef Q_OS_WIN 35 | << '\r' // Use standard windows line endings 36 | #endif 37 | << Qt::endl; // This is '\n' << flush; 38 | 39 | m_OutputStream->flush(); 40 | } 41 | 42 | //-------------------------------------------------------------------------------------- 43 | 44 | QString SimpleLog::levelToString( eLogLevel l ) 45 | { 46 | QString result ="[INVALID_LOG_LEVEL]"; 47 | switch(l) 48 | { 49 | case LOG_DEBUG: 50 | result = "[DEB]"; 51 | break; 52 | case LOG_WARNING: 53 | result = "[WAR]"; 54 | break; 55 | case LOG_ERROR: 56 | result = "[ERR]"; 57 | break; 58 | default: 59 | break; 60 | } 61 | return result; 62 | } 63 | 64 | //-------------------------------------------------------------------------------------- 65 | 66 | void SimpleLog::startFileLogging( const QString& location ) 67 | { 68 | if (m_File) { 69 | stopFileLogging(); 70 | } 71 | 72 | m_File = new QFile; 73 | m_OutputStream = new QTextStream; 74 | logFileLocation = location; 75 | m_File->setFileName(logFileLocation); 76 | m_OutputStream->setDevice(m_File); 77 | m_File->open(QFile::WriteOnly); 78 | } 79 | 80 | //-------------------------------------------------------------------------------------- 81 | 82 | void SimpleLog::stopFileLogging() 83 | { 84 | if (m_File) { 85 | logFileLocation = ""; 86 | if (m_File->isOpen()) { 87 | m_OutputStream->flush(); 88 | m_OutputStream->setDevice(NULL); 89 | m_File->close(); 90 | } 91 | delete m_File; 92 | m_File = NULL; 93 | delete m_OutputStream; 94 | m_OutputStream = NULL; 95 | } 96 | } 97 | 98 | //-------------------------------------------------------------------------------------- 99 | 100 | -------------------------------------------------------------------------------- /src/simpleLog.h: -------------------------------------------------------------------------------- 1 | #ifndef simpleLog_h__ 2 | #define simpleLog_h__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class SimpleLog 10 | { 11 | public: 12 | enum eLogLevel { 13 | LOG_ERROR, 14 | LOG_WARNING, 15 | LOG_DEBUG 16 | }; 17 | static void log(eLogLevel level, const QString& msg); 18 | 19 | static void startFileLogging(const QString& location); 20 | 21 | static void stopFileLogging(); 22 | 23 | protected: 24 | static QString levelToString(eLogLevel l); 25 | 26 | private: 27 | static QString logFileLocation; 28 | 29 | static QFile* m_File; 30 | static QTextStream* m_OutputStream; 31 | 32 | static QMutex mutex; 33 | }; 34 | #endif // simpleLog_h__ 35 | 36 | -------------------------------------------------------------------------------- /src/yaps.rc: -------------------------------------------------------------------------------- 1 | // Icon with lowest ID value placed first to ensure application icon 2 | // remains consistent on all systems. 3 | IDI_ICON1 ICON "resources/logo.ico" --------------------------------------------------------------------------------