diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000000..041d7a0e87d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,24 @@ +[submodule "third-party/dht"] + path = third-party/dht + url = https://github.com/transmission/dht + branch = post-0.24-transmission +[submodule "third-party/libb64"] + path = third-party/libb64 + url = https://github.com/transmission/libb64 + branch = post-1.2.1-transmission +[submodule "third-party/libevent"] + path = third-party/libevent + url = https://github.com/transmission/libevent + branch = post-2.0.22-transmission +[submodule "third-party/libnatpmp"] + path = third-party/libnatpmp + url = https://github.com/transmission/libnatpmp + branch = post-20151025-transmission +[submodule "third-party/libutp"] + path = third-party/libutp + url = https://github.com/transmission/libutp + branch = post-3.3-transmission +[submodule "third-party/miniupnpc"] + path = third-party/miniupnpc + url = https://github.com/transmission/miniupnpc + branch = post-1.9-transmission diff --git a/.tx/config b/.tx/config index af78d667ded..b24954864ad 100644 --- a/.tx/config +++ b/.tx/config @@ -1,7 +1,22 @@ [main] host = https://www.transifex.com -[transmissionbt.transmission-qt] +[transmissionbt.qt] file_filter = qt/translations/transmission_.ts source_lang = en type = QT + +[transmissionbt.gtk] +file_filter = po/.po +source_lang = en +type = PO + +[transmissionbt.mac] +file_filter = macosx/.lproj/Localizable.strings +source_lang = en +type = STRINGS + +[transmissionbt.mac-ql] +file_filter = macosx/QuickLookPlugin/.lproj/Localizable.strings +source_lang = en +type = STRINGS diff --git a/AUTHORS b/AUTHORS index 21a71b7df37..8b526c77dda 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,9 +1,10 @@ The Transmission Project -http://www.transmissionbt.com/ +https://transmissionbt.com/ Lead Developers Jordan Lee, Mnemosyne LLC (Daemon, Backend, GTK+ client) Mitchell Livingston, Digital Ignition LLC (Mac OS X client) + Mike Gelfand Project Contributors John Clay (Website maintenance and troubleshooting, Mac OS X help documentation) @@ -11,7 +12,7 @@ Project Contributors Juliusz Chroboczek (DHT, network code, BitTorrent code improvements) Daniel Lee (Patches) Tomas Carnecky (Profiling, patches, and detection of sneaky bugs) - Diego Jimnez (Patches) + Diego Jiménez (Patches) Kendall Hopkins (Web client) Malcolm Jarvis (Web client) Kevin Glowacz (Web client) @@ -40,8 +41,8 @@ Mac OS X Translators, current release: Guilherme Fernandes (Brazilian Portuguese) Sven-S. Porst (German) Tianhao He (Simplified Chinese) - Srgio Miranda (European Portuguese) - Daniel stergaard Nielsen (Danish) + Sérgio Miranda (European Portuguese) + Daniel Østergaard Nielsen (Danish) Emir SARI (Turkish) GTK+ Translators: diff --git a/CMakeLists.txt b/CMakeLists.txt index bf58df70529..870dd27eb3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ project(transmission) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) +set(CMAKE_MACOSX_RPATH ON) + include(CheckIncludeFile) include(CheckIncludeFiles) include(CheckFunctionExists) @@ -14,6 +16,7 @@ include(TrMacros) option(ENABLE_DAEMON "Build daemon" ON) tr_auto_option(ENABLE_GTK "Build GTK+ client" AUTO) tr_auto_option(ENABLE_QT "Build Qt client" AUTO) +tr_auto_option(ENABLE_MAC "Build Mac client" AUTO) option(ENABLE_UTILS "Build utils (create, edit, show)" ON) option(ENABLE_CLI "Build command-line client" OFF) option(ENABLE_TESTS "Build unit tests" ON) @@ -22,7 +25,6 @@ tr_auto_option(ENABLE_QT "Build Qt client" AUTO) option(ENABLE_NLS "Enable native language support" ON) option(INSTALL_DOC "Build/install documentation" ON) option(INSTALL_LIB "Install the library" OFF) - option(USE_QT5 "Use Qt 5 (instead of default Qt 4)" OFF) tr_auto_option(USE_SYSTEM_EVENT2 "Use system event2 library" AUTO) tr_auto_option(USE_SYSTEM_DHT "Use system dht library" AUTO) tr_auto_option(USE_SYSTEM_MINIUPNPC "Use system miniupnpc library" AUTO) @@ -32,6 +34,7 @@ tr_auto_option(USE_SYSTEM_B64 "Use system b64 library" AUTO) tr_list_option(WITH_CRYPTO "Use specified crypto library" AUTO openssl cyassl polarssl) tr_auto_option(WITH_INOTIFY "Enable inotify support (on systems that support it)" AUTO) tr_auto_option(WITH_KQUEUE "Enable kqueue support (on systems that support it)" AUTO) +tr_auto_option(WITH_LIBAPPINDICATOR "Use libappindicator in GTK+ client" AUTO) tr_auto_option(WITH_SYSTEMD "Add support for systemd startup notification (on systems that support it)" AUTO) set(TR_NAME ${PROJECT_NAME}) @@ -56,64 +59,42 @@ else() set(TR_STABLE_RELEASE 1) endif() -set(TR_SCM_REVISION_FILE "${CMAKE_SOURCE_DIR}/REVISION") -set(TR_SCM_REVISION_RELIABLE ON) +set(TR_VCS_REVISION_FILE "${CMAKE_SOURCE_DIR}/REVISION") -if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.svn) - if(NOT "$ENV{JENKINS_URL}" STREQUAL "" AND NOT "$ENV{SVN_REVISION}" STREQUAL "") - # Jenkins automated build, use the set environment variables to avoid - # version mismatches between java's svn and command line's svn - set(TR_SCM_REVISION "$ENV{SVN_REVISION}") - else() - find_package(Subversion) - if(Subversion_FOUND) - Subversion_WC_INFO(${CMAKE_SOURCE_DIR} TR_SVN) - set(TR_SCM_REVISION "${TR_SVN_WC_REVISION}") - endif() - endif() +if(NOT "$ENV{JENKINS_URL}" STREQUAL "" AND NOT "$ENV{GIT_COMMIT}" STREQUAL "") + set(TR_VCS_REVISION "$ENV{GIT_COMMIT}") +elseif(NOT "$ENV{TEAMCITY_PROJECT_NAME}" STREQUAL "" AND NOT "$ENV{BUILD_VCS_NUMBER}" STREQUAL "") + set(TR_VCS_REVISION "$ENV{BUILD_VCS_NUMBER}") elseif(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git) find_package(Git) if(GIT_FOUND) execute_process( COMMAND - ${GIT_EXECUTABLE} rev-list --max-count=1 --abbrev-commit HEAD + ${GIT_EXECUTABLE} rev-list --max-count=1 HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE - TR_SCM_REVISION + TR_VCS_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE ) endif() endif() -if("${TR_SCM_REVISION}" STREQUAL "" AND EXISTS "${TR_SCM_REVISION_FILE}") - file(READ "${TR_SCM_REVISION_FILE}" TR_SCM_REVISION) - string(STRIP "${TR_SCM_REVISION}" TR_SCM_REVISION) +if("${TR_VCS_REVISION}" STREQUAL "" AND EXISTS "${TR_VCS_REVISION_FILE}") + file(READ "${TR_VCS_REVISION_FILE}" TR_VCS_REVISION) endif() -if("${TR_SCM_REVISION}" STREQUAL "") - # Give up and check the source files - set(TR_SCM_REVISION 0) - set(TR_SCM_REVISION_RELIABLE OFF) - file(GLOB_RECURSE TR_ALL_SOURCES RELATIVE ${CMAKE_SOURCE_DIR} *.cc *.[chm] *.po) - foreach(F ${TR_ALL_SOURCES}) - file(STRINGS ${F} F_ID REGEX "\\$Id:") - if(F_ID MATCHES "\\$Id: [^ ]+ ([0-9]+) " AND CMAKE_MATCH_1 GREATER TR_SCM_REVISION) - set(TR_SCM_REVISION ${CMAKE_MATCH_1}) - endif() - endforeach() -endif() +string(STRIP "${TR_VCS_REVISION}" TR_VCS_REVISION) -if("${TR_SCM_REVISION}" STREQUAL "") - set(TR_SCM_REVISION 0) +if(NOT "${TR_VCS_REVISION}" STREQUAL "") + file(WRITE "${TR_VCS_REVISION_FILE}" "${TR_VCS_REVISION}\n") else() - if(TR_SCM_REVISION_RELIABLE) - file(WRITE "${TR_SCM_REVISION_FILE}" "${TR_SCM_REVISION}") - else() - file(REMOVE "${TR_SCM_REVISION_FILE}") - endif() + set(TR_VCS_REVISION 0) + file(REMOVE "${TR_VCS_REVISION_FILE}") endif() +string(SUBSTRING "${TR_VCS_REVISION}" 0 10 TR_VCS_REVISION) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) set(CURL_MINIMUM 7.15.4) @@ -126,13 +107,7 @@ set(GTK_MINIMUM 3.4.0) set(GLIB_MINIMUM 2.32.0) set(GIO_MINIMUM 2.26.0) set(LIBAPPINDICATOR_MINIMUM 0.4.90) - -tr_github_upstream(EVENT2 transmission/libevent c51b159cff 7be95856a39714dfd2218cb56415c990) -tr_github_upstream(NATPMP transmission/libnatpmp cf7f452d66 f1e7d5bf580972738d8ef21743d0adf7) -tr_github_upstream(MINIUPNPC transmission/miniupnp 5de2bcb561 bdc5b64b9b8401d3524c50b9ec8173c1) -tr_github_upstream(DHT transmission/dht cc379e406d 958253fafa01c59950d357c148aff090) -tr_github_upstream(UTP transmission/libutp 7c4f19abdf 8b92aa05abec5f6675cdde6477cd6f51) -tr_github_upstream(B64 transmission/libb64 c1e3323498 10128cb30ad768d2c4caf627e0f69db3) +set(QT5_MINIMUM 5.2) if(WIN32) foreach(L C CXX) @@ -162,6 +137,7 @@ find_package(CURL ${CURL_MINIMUM} REQUIRED) find_package(ICONV) +set(CRYPTO_PKG "") if(WITH_CRYPTO STREQUAL "AUTO" OR WITH_CRYPTO STREQUAL "openssl") tr_get_required_flag(WITH_CRYPTO OPENSSL_IS_REQUIRED) find_package(OpenSSL ${OPENSSL_MINIMUM} ${OPENSSL_IS_REQUIRED}) @@ -213,13 +189,13 @@ if(ENABLE_GTK) tr_fixup_auto_option(ENABLE_GTK GTK_FOUND GTK_IS_REQUIRED) - set(WITH_LIBAPPINDICATOR OFF) - if(ENABLE_GTK) + if(ENABLE_GTK AND WITH_LIBAPPINDICATOR) + tr_get_required_flag(WITH_LIBAPPINDICATOR LIBAPPINDICATOR_IS_REQUIRED) pkg_check_modules(LIBAPPINDICATOR appindicator3-0.1>=${LIBAPPINDICATOR_MINIMUM}) - if(LIBAPPINDICATOR_FOUND) - set(WITH_LIBAPPINDICATOR ON) - endif() + tr_fixup_auto_option(WITH_LIBAPPINDICATOR LIBAPPINDICATOR_FOUND LIBAPPINDICATOR_IS_REQUIRED) endif() +else() + set(WITH_LIBAPPINDICATOR OFF) endif() if(ENABLE_QT) @@ -233,67 +209,44 @@ if(ENABLE_QT) set(ENABLE_QT_COM_INTEROP OFF) set(ENABLE_QT_DBUS_INTEROP OFF) - if(USE_QT5) - set(QT5_REQUIRED_MODULES Core Gui Widgets Network LinguistTools) - set(QT5_OPTIONAL_MODULES DBus AxContainer AxServer) - foreach(M ${QT5_REQUIRED_MODULES}) - find_package(Qt5${M} QUIET) - if(Qt5${M}_FOUND) - if(NOT M STREQUAL "LinguistTools") - list(APPEND QT_TARGETS Qt5::${M}) - endif() - else() - set(QT_TARGETS) - break() - endif() - endforeach() - if(QT_TARGETS) - foreach(M ${QT5_OPTIONAL_MODULES}) - find_package(Qt5${M} QUIET) - if(Qt5${M}_FOUND) - list(APPEND QT_TARGETS Qt5::${M}) - endif() - endforeach() - if(Qt5AxContainer_FOUND AND Qt5AxServer_FOUND) - set(ENABLE_QT_COM_INTEROP ON) - endif() - if(Qt5DBus_FOUND) - set(ENABLE_QT_DBUS_INTEROP ON) + set(QT5_REQUIRED_MODULES Core Gui Widgets Network LinguistTools) + set(QT5_OPTIONAL_MODULES DBus AxContainer AxServer) + + if(WIN32) + list(APPEND QT5_REQUIRED_MODULES WinExtras) + endif() + + foreach(M ${QT5_REQUIRED_MODULES}) + find_package(Qt5${M} ${QT5_MINIMUM} QUIET) + if(Qt5${M}_FOUND) + if(NOT M STREQUAL "LinguistTools") + list(APPEND QT_TARGETS Qt5::${M}) endif() + else() + set(QT_TARGETS) + break() endif() - else() - set(QT4_REQUIRED_MODULES QtCore QtGui QtNetwork) - set(QT4_OPTIONAL_MODULES QtDBus QAxContainer QAxServer) - find_package(Qt4 4.8.0 QUIET COMPONENTS ${QT4_REQUIRED_MODULES} OPTIONAL_COMPONENTS ${QT4_OPTIONAL_MODULES}) - foreach(M ${QT4_REQUIRED_MODULES}) - string(TOUPPER "${M}" M_UPPER) - if(QT_${M_UPPER}_FOUND) - list(APPEND QT_TARGETS Qt4::${M}) - else() - set(QT_TARGETS) - break() + endforeach() + + if(QT_TARGETS) + foreach(M ${QT5_OPTIONAL_MODULES}) + find_package(Qt5${M} ${QT5_MINIMUM} QUIET) + if(Qt5${M}_FOUND) + list(APPEND QT_TARGETS Qt5::${M}) endif() endforeach() - if (QT_TARGETS) - foreach(M ${QT4_OPTIONAL_MODULES}) - string(TOUPPER "${M}" M_UPPER) - if(QT_${M_UPPER}_FOUND) - list(APPEND QT_TARGETS Qt4::${M}) - endif() - endforeach() - if(QT_QAXCONTAINER_FOUND AND QT_QAXSERVER_FOUND) - set(ENABLE_QT_COM_INTEROP ON) - endif() - if(QT_QTDBUS_FOUND) - set(ENABLE_QT_DBUS_INTEROP ON) + + if(Qt5AxContainer_FOUND AND Qt5AxServer_FOUND) + set(ENABLE_QT_COM_INTEROP ON) + + find_program(MIDL_EXECUTABLE midl) + if(NOT MIDL_EXECUTABLE) + set(ENABLE_QT_COM_INTEROP OFF) endif() endif() - endif() - if(ENABLE_QT_COM_INTEROP) - find_program(MIDL_EXECUTABLE midl) - if(NOT MIDL_EXECUTABLE) - set(ENABLE_QT_COM_INTEROP OFF) + if(Qt5DBus_FOUND) + set(ENABLE_QT_DBUS_INTEROP ON) endif() endif() @@ -308,6 +261,21 @@ if(ENABLE_QT) tr_fixup_auto_option(ENABLE_QT QT_FOUND QT_IS_REQUIRED) endif() +if(ENABLE_MAC) + tr_get_required_flag(ENABLE_MAC MAC_IS_REQUIRED) + + if(APPLE) + set(MAC_FOUND ON) + else() + set(MAC_FOUND OFF) + if(MAC_IS_REQUIRED) + message(SEND_ERROR "Mac build is impossible on non-Mac system.") + endif() + endif() + + tr_fixup_auto_option(ENABLE_MAC MAC_FOUND MAC_IS_REQUIRED) +endif() + find_package(ZLIB ${ZLIB_MINIMUM}) if(ZLIB_FOUND) add_definitions(-DHAVE_ZLIB) @@ -316,31 +284,28 @@ endif() set(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/third-party) if(WIN32) - tr_add_external_auto_library(EVENT2 event - PATCH_COMMAND "${CMAKE_COMMAND}" -E copy "${THIRD_PARTY_DIR}/event2.cmake" "/CMakeLists.txt" - COMMAND "${CMAKE_COMMAND}" -E chdir "" patch -p1 -i "${THIRD_PARTY_DIR}/event2-01-win32.patch" - COMMAND "${CMAKE_COMMAND}" -E chdir "" patch -p1 -i "${THIRD_PARTY_DIR}/event2-02-win32.patch") + tr_add_external_auto_library(EVENT2 libevent event) else() - tr_add_external_auto_library(EVENT2 event + set(EVENT2_CONFIGURE_FLAGS) + if(APPLE) + if(CRYPTO_PKG STREQUAL "openssl") + list(APPEND EVENT2_CONFIGURE_FLAGS "CPPFLAGS=-I${CRYPTO_INCLUDE_DIRS}") + else() + list(APPEND EVENT2_CONFIGURE_FLAGS "CPPFLAGS=-I${THIRD_PARTY_DIR}/openssl/include") + endif() + endif() + tr_add_external_auto_library(EVENT2 libevent event BUILD_IN_SOURCE 1 CONFIGURE_COMMAND "/autogen.sh" - COMMAND "/configure" "--prefix=" "--disable-shared") + COMMAND "/configure" "--prefix=" "--disable-shared" ${EVENT2_CONFIGURE_FLAGS}) endif() -tr_add_external_auto_library(NATPMP natpmp - PATCH_COMMAND "${CMAKE_COMMAND}" -E copy "${THIRD_PARTY_DIR}/natpmp.cmake" "/CMakeLists.txt") +tr_add_external_auto_library(NATPMP libnatpmp natpmp) if(NOT USE_SYSTEM_NATPMP) set(NATPMP_DEFINITIONS -DNATPMP_STATICLIB) endif() -tr_add_external_auto_library(MINIUPNPC miniupnpc - PATCH_COMMAND "${CMAKE_COMMAND}" -E remove_directory "/minissdpd" - COMMAND "${CMAKE_COMMAND}" -E remove_directory "/miniupnpc-async" - COMMAND "${CMAKE_COMMAND}" -E remove_directory "/miniupnpc-libevent" - COMMAND "${CMAKE_COMMAND}" -E remove_directory "/miniupnpd" - COMMAND "${CMAKE_COMMAND}" -E remove "/README" - COMMAND "${CMAKE_COMMAND}" -E copy_directory "/miniupnpc" "" - COMMAND "${CMAKE_COMMAND}" -E remove_directory "/miniupnpc" +tr_add_external_auto_library(MINIUPNPC miniupnpc miniupnpc CMAKE_ARGS -DUPNPC_BUILD_STATIC=ON -DUPNPC_BUILD_SHARED=OFF @@ -352,22 +317,13 @@ if(NOT USE_SYSTEM_MINIUPNPC) set(MINIUPNPC_API_VERSION 12) endif() -tr_add_external_auto_library(DHT dht - PATCH_COMMAND "${CMAKE_COMMAND}" -E copy "${THIRD_PARTY_DIR}/dht.cmake" "/CMakeLists.txt") +tr_add_external_auto_library(DHT dht dht) if(ENABLE_UTP) - tr_add_external_auto_library(UTP utp - PATCH_COMMAND "${CMAKE_COMMAND}" -E copy "${THIRD_PARTY_DIR}/utp.cmake" "/CMakeLists.txt" - COMMAND "${CMAKE_COMMAND}" -E copy "${THIRD_PARTY_DIR}/utp_config.h" "/utp_config.h" - COMMAND "${CMAKE_COMMAND}" -E chdir "" patch -p1 --binary -i "${THIRD_PARTY_DIR}/utp-01-ticket-5002.patch" - COMMAND "${CMAKE_COMMAND}" -E chdir "" patch -p1 --binary -i "${THIRD_PARTY_DIR}/utp-02-win32.patch" - COMMAND "${CMAKE_COMMAND}" -E chdir "" patch -p1 --binary -i "${THIRD_PARTY_DIR}/utp-03-msvc14.patch") + tr_add_external_auto_library(UTP libutp utp) endif() -tr_add_external_auto_library(B64 b64 - PATCH_COMMAND "${CMAKE_COMMAND}" -E copy "${THIRD_PARTY_DIR}/b64.cmake" "/CMakeLists.txt" - COMMAND "${CMAKE_COMMAND}" -E chdir "" patch -p1 -i "${THIRD_PARTY_DIR}/b64-01-newline.patch" - COMMAND "${CMAKE_COMMAND}" -E chdir "" patch -p1 -i "${THIRD_PARTY_DIR}/b64-02-unsigned-char.patch") +tr_add_external_auto_library(B64 libb64 b64) if(WITH_INOTIFY) tr_get_required_flag(WITH_INOTIFY INOTIFY_IS_REQUIRED) @@ -397,9 +353,7 @@ endif() if(WITH_SYSTEMD) tr_get_required_flag(WITH_SYSTEMD SYSTEMD_IS_REQUIRED) - - pkg_check_modules(SYSTEMD ${SYSTEMD_IS_REQUIRED} libsystemd) - + find_package(SYSTEMD) tr_fixup_auto_option(WITH_SYSTEMD SYSTEMD_FOUND SYSTEMD_IS_REQUIRED) endif() @@ -544,25 +498,48 @@ if(HAVE_LIBM) set(LIBM_LIBRARY m) endif() +set(TR_NETWORK_LIBRARIES) +if(WIN32) + list(APPEND TR_NETWORK_LIBRARIES iphlpapi ws2_32) +else() + tr_select_library("c;socket;net" socket "" LIB) + if(NOT LIB MATCHES "^(|c)$") + list(APPEND TR_NETWORK_LIBRARIES ${LIB}) + endif() + + tr_select_library("c;nsl;bind" gethostbyname "" LIB) + if(NOT LIB MATCHES "^(|c)$") + list(APPEND TR_NETWORK_LIBRARIES ${LIB}) + endif() +endif() + if(ENABLE_TESTS) enable_testing() - include(CTest) endif() +function(tr_install_web DST_DIR) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/web DESTINATION ${DST_DIR} + PATTERN *.am EXCLUDE + PATTERN *.in EXCLUDE + PATTERN *.scss EXCLUDE) +endfunction() + add_subdirectory(libtransmission) -foreach(P daemon cli utils gtk qt) +set(MAC_PROJECT_DIR macosx) + +foreach(P daemon cli utils gtk qt mac) string(TOUPPER "${P}" P_ID) if(ENABLE_${P_ID}) + if(DEFINED ${P_ID}_PROJECT_DIR) + set(P ${${P_ID}_PROJECT_DIR}) + endif() add_subdirectory(${P}) endif() endforeach() if(ENABLE_DAEMON OR ENABLE_GTK OR ENABLE_QT) - install(DIRECTORY web DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${TR_NAME} - PATTERN *.am EXCLUDE - PATTERN *.in EXCLUDE - PATTERN *.scss EXCLUDE) + tr_install_web(${CMAKE_INSTALL_DATAROOTDIR}/${TR_NAME}) endif() if(ENABLE_GTK AND ENABLE_NLS) @@ -571,17 +548,17 @@ if(ENABLE_GTK AND ENABLE_NLS) endif() if(INSTALL_DOC) - install(FILES AUTHORS COPYING NEWS README extras/rpc-spec.txt extras/send-email-when-torrent-done.sh DESTINATION ${CMAKE_INSTALL_DOCDIR}) + install(FILES AUTHORS COPYING NEWS README.md extras/rpc-spec.txt extras/send-email-when-torrent-done.sh DESTINATION ${CMAKE_INSTALL_DOCDIR}) endif() -if(MSVC AND ENABLE_DAEMON AND ENABLE_QT AND ENABLE_UTILS AND USE_QT5 AND WITH_CRYPTO STREQUAL "openssl") +if(MSVC AND ENABLE_DAEMON AND ENABLE_QT AND ENABLE_UTILS AND WITH_CRYPTO STREQUAL "openssl") add_subdirectory(dist/msi) endif() set(CPACK_SOURCE_GENERATOR TBZ2) set(CPACK_SOURCE_PACKAGE_FILE_NAME "${TR_NAME}-${TR_USER_AGENT_PREFIX}") set(CPACK_SOURCE_IGNORE_FILES - \\\\.svn + \\\\.git ) include(CPack) diff --git a/Makefile.am b/Makefile.am index 036ccdd0f5d..0276acfe112 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,7 +31,7 @@ EXTRA_DIST = \ NEWS \ AUTHORS \ COPYING \ - README \ + README.md \ autogen.sh \ update-version-h.sh \ Transmission.xcodeproj/project.pbxproj @@ -46,19 +46,6 @@ EXTRA_DIST += \ libtransmission/version.h.in \ po/CMakeLists.txt \ qt/CMakeLists.txt \ - third-party/b64-01-newline.patch \ - third-party/b64-02-unsigned-char.patch \ - third-party/b64.cmake \ - third-party/dht.cmake \ - third-party/event2.cmake \ - third-party/event2-01-win32.patch \ - third-party/event2-02-win32.patch \ - third-party/natpmp.cmake \ - third-party/utp-01-ticket-5002.patch \ - third-party/utp-02-win32.patch \ - third-party/utp-03-msvc14.patch \ - third-party/utp.cmake \ - third-party/utp_config.h \ utils/CMakeLists.txt if HAVE_REVISION_FILE diff --git a/NEWS b/NEWS index 5f77a6e9220..c3c8f72455c 100644 --- a/NEWS +++ b/NEWS @@ -1,10 +1,10 @@ === Transmission 2.92 (2016/03/06) === -[http://trac.transmissionbt.com/query?milestone=2.92&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.92&group=component&order=severity All tickets closed by this release] ==== Mac Client ==== * Build OSX.KeRanger.A ransomware removal into the app === Transmission 2.91 (2016/03/06) === -[http://trac.transmissionbt.com/query?milestone=2.91&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.91&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix Makefile.am to include Windows patches into source archive * Fix miniupnpc script to handle spaces and other special chars in paths @@ -21,7 +21,7 @@ * Use `-rad` as short form of `--remove-and-delete` option in transmission-remote === Transmission 2.90 (2016/02/28) === -[http://trac.transmissionbt.com/query?milestone=2.90&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.90&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix renaming torrent files with common prefix * Fix some more thread safety bugs in the tr_list datatype @@ -82,12 +82,12 @@ * Update to jQuery 1.11.2, jQueryUI 1.11.4; use jQueryUI menus instead of custom ones === Transmission 2.84 (2014/07/01) === -[http://trac.transmissionbt.com/query?milestone=2.84&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.84&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix peer communication vulnerability (no known exploits) reported by Ben Hawkes === Transmission 2.83 (2014/05/18) === -[http://trac.transmissionbt.com/query?milestone=2.83&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.83&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Licensing change: the GNU GPLv2 code can now be used under GNU GPL v2 or v3 * Fix network hanging issues that could occur when both UTP and DHT were enabled @@ -115,7 +115,7 @@ * Fix toggle-downloading-by-pressing-spacebar in the file list * Fix "Open URL" crash from dangling pointer * Support launching downloaded files from inside Transmission - * On Windows, use native Windows icons + * On Windows, use native Windows icons * Improved network status info and tooltip in the status bar * Fix "Open Torrent" dialog crash in Qt 5.2 ==== Daemon ==== @@ -129,7 +129,7 @@ * Make URLs in the torrent's comment field clickable (and sanitize them to prevent cross-scripting) === Transmission 2.82 (2013/08/08) === -[http://trac.transmissionbt.com/query?milestone=2.82&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.82&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix webseed crash * Fix crash when adding UDP trackers whose host's canonical name couldn't be found @@ -155,7 +155,7 @@ * Fix file uploading issue in Internet Explorer 11 === Transmission 2.81 (2013/07/17) === -[http://trac.transmissionbt.com/query?milestone=2.81&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.81&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix 2.80 bug that showed the incorrect status for some peers * Better handling of announce errors returned by some trackers @@ -175,7 +175,7 @@ * Slightly better compression of png files === Transmission 2.80 (2013/06/25) === -[http://trac.transmissionbt.com/query?milestone=2.80&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.80&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Support renaming a transfer's files and folders * Remove the most frequent thread locks in libtransmission (ie, fewer beachballs) @@ -212,7 +212,7 @@ * Support user-defined piece sizes in transmission-create === Transmission 2.77 (2013/02/18) === -[http://trac.transmissionbt.com/query?milestone=2.77&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.77&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix 2.75 regression that broke JSON parsing of real numbers in locales that don't use '.' as a decimal separator * Don't invalidate the OS's file cache when closing files @@ -235,7 +235,7 @@ * Fix transmission-cli failure when the download directory doesn't exist === Transmission 2.76 (2013/01/08) === -[http://trac.transmissionbt.com/query?milestone=2.76&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.76&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Better error logging when user-provided scripts can't be executed * The "Time Remaining" property wasn't set for torrents with webseeds but no peers @@ -262,16 +262,16 @@ * If the Download directory doesn't exist, try to create it instead of exiting === Transmission 2.75 (2012/12/13) === -[http://trac.transmissionbt.com/query?milestone=2.75&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.75&group=component&order=severity All tickets closed by this release] ==== Mac ==== * Fix crash on non-English localizations === Transmission 2.74 (2012/12/10) === -[http://trac.transmissionbt.com/query?milestone=2.74&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.74&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix a bug that prevented IPv6 addresses from being saved in dht.dat * Better handling of magnet links that contain 'tr.x=' parameters - * Add filtering of addresses used for uTP peer connections + * Add filtering of addresses used for uTP peer connections * Fix detection of whether or not a peer supports uTP connections ==== Mac ==== * Auto-grouping won't apply until torrents are demagnetized @@ -284,12 +284,12 @@ * Fix bug when displaying the tracker list === Transmission 2.73 (2012/10/08) === -[http://trac.transmissionbt.com/query?milestone=2.73&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.73&group=component&order=severity All tickets closed by this release] ==== Mac ==== * Fix crash on non-English localizations === Transmission 2.72 (2012/10/16) === -[http://trac.transmissionbt.com/query?milestone=2.72&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.72&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix crash when adding magnet links with malformed webseeds * Fix handling of magnet links' webseed URLs that contain whitespace @@ -306,14 +306,14 @@ * Minor interface fixes === Transmission 2.71 (2012/09/26) === -[http://trac.transmissionbt.com/query?milestone=2.71&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.71&group=component&order=severity All tickets closed by this release] ==== Mac ==== * Fix 2.70 crasher on 10.6 Snow Leopard === Transmission 2.70 (2012/09/25) === -[http://trac.transmissionbt.com/query?milestone=2.70&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.70&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== - * Improved speed with the TP protocol + * Improved speed with the µTP protocol * Fix bug that caused some incoming encrypted peer connections to fail * Fix bugs with the speed limit scheduler * Fix crasher with magnet links @@ -339,7 +339,7 @@ * Fix bug involving attempts to post notifications without permission === Transmission 2.61 (2012/07/23) === -[http://trac.transmissionbt.com/query?milestone=2.61&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.61&group=component&order=severity All tickets closed by this release] ==== Mac ==== * Fix crash when creating a torrent file on Lion or newer ==== GTK+ ==== @@ -356,7 +356,7 @@ * Add magnet link generation to the transmission-show command line tool === Transmission 2.60 (2012/07/05) === -[http://trac.transmissionbt.com/query?milestone=2.60&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.60&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix issues when adding magnet links * Improved scraping behavior for certain trackers @@ -376,7 +376,7 @@ * Re-add select all and deselect all buttons to the file inspector tab === Transmission 2.52 (2012/05/19) === -[http://trac.transmissionbt.com/query?milestone=2.52&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.52&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix bug with zero termination of multiscrape strings * Update the bundled libnatpmp and miniupnp port forwarding libraries @@ -388,7 +388,7 @@ * Fix minor bug in Ubuntu app indicator support === Transmission 2.51 (2012/04/08) === -[http://trac.transmissionbt.com/query?milestone=2.51&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.51&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Update the bundled libnatpmp and miniupnp port forwarding libraries * Add environment variable options to have libcurl verify SSL certs @@ -415,7 +415,7 @@ * Show magnet link information in transmission-remote -i === Transmission 2.50 (2012/02/14) === -[http://trac.transmissionbt.com/query?milestone=2.50&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.50&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix crash when adding some magnet links * Improved support for downloading webseeds with large files @@ -456,7 +456,7 @@ * Fix corrupted status string in transmission-remote === Transmission 2.42 (2011/10/19) === -[http://trac.transmissionbt.com/query?milestone=2.42&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.42&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix error connecting to UDP trackers from big-endian computers * Fix RPC error when editing UDP trackers @@ -473,12 +473,12 @@ * Fix bug which broke Opera support === Transmission 2.41 (2011/10/08) === -[http://trac.transmissionbt.com/query?milestone=2.41&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.41&group=component&order=severity All tickets closed by this release] ==== Mac ==== * Fix crasher on 10.5 Leopard === Transmission 2.40 (2011/10/08) === -[http://trac.transmissionbt.com/query?milestone=2.40&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.40&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Torrent queuing * Improved webseed support @@ -514,7 +514,7 @@ * Fix transmission-create bug when specifying a directory with a leading "./" === Transmission 2.33 (2011/07/20) === -[http://trac.transmissionbt.com/query?milestone=2.33&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.33&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Improved webseed support * Better support for moving and deleting files @@ -524,19 +524,19 @@ ==== Mac ==== * Minor Lion interface tweaks ==== GTK+ ==== - * Remove deprecated GConf2 dependency + * Remove deprecated GConf2 dependency ==== Qt ==== * Fix high CPU issues * Fix wrong torrent count on tracker filterbar * Update Spanish translation === Transmission 2.32 (2011/06/28) === -[http://trac.transmissionbt.com/query?milestone=2.32&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.32&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix error caused by some "open-file-limit" configuration settings * Fix 2.30 problem seeding to some peers * Fix bug converting torrent file text contents to UTF-8 - * Better TP support on systems running uClibc + * Better µTP support on systems running uClibc * Other small bug fixes ==== Mac ==== * Improved tabbing behavior @@ -552,14 +552,14 @@ * Allow drag-and-drop to add links === Transmission 2.31 (2011/05/17) === -[http://trac.transmissionbt.com/query?milestone=2.31&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.31&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * This release fixes a 2.30 packaging error === Transmission 2.30 (2011/05/16) === -[http://trac.transmissionbt.com/query?milestone=2.30&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.30&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== - * TP support + * µTP support * UDP tracker support * Multiscrape support * Download scarcest pieces first @@ -578,7 +578,7 @@ * Peer and Network preferences === Transmission 2.22 (2011/03/04) === -[http://trac.transmissionbt.com/query?milestone=2.22&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.22&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Faster endgame * Fix bug where leechers might be disconnected while seeding in some situations @@ -597,7 +597,7 @@ * Fix bandwidth display issue === Transmission 2.21 (2011/02/08) === -[http://trac.transmissionbt.com/query?milestone=2.21&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.21&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix compile error in the 2.20 tarball ==== GTK+ ==== @@ -606,7 +606,7 @@ * Updated Spanish translation === Transmission 2.20 (2011/02/06) === -[http://trac.transmissionbt.com/query?milestone=2.20&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.20&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Remember downloaded files when a drive is unplugged * File re-verification is no longer needed in some situations @@ -643,7 +643,7 @@ * Webseeds are now displayed in transmission-show === Transmission 2.13 (2010/12/09) === -[http://trac.transmissionbt.com/query?milestone=2.13&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.13&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix "No Announce Scheduled" tracker error * Fix build error on Solaris 10 @@ -662,7 +662,7 @@ * Add Spanish (LAC) Translation === Transmission 2.12 (2010/11/14) === -[http://trac.transmissionbt.com/query?milestone=2.12&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.12&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Make the blocklist URL user-configurable * Several minor bug fixes and CPU speed improvements @@ -684,7 +684,7 @@ * Fix 2.11 regression when using the web client on IE7 or IE8 === Transmission 2.11 (2010/10/16) === -[http://trac.transmissionbt.com/query?milestone=2.11&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.11&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix a 2.10 crash * Fix minor build issues on various platforms, particularly embedded systems @@ -704,7 +704,7 @@ * Add Transmission website links to the action menu === Transmission 2.10 (2010/10/07) === -[http://trac.transmissionbt.com/query?milestone=2.10&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.10&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Support for automatically stopping idle seeding torrents * Small memory cache to reduce disk IO @@ -738,7 +738,7 @@ * New command-line utility "transmission-create" for creating torrent files === Transmission 2.04 (2010/08/06) === -[http://trac.transmissionbt.com/query?milestone=2.04&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.04&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Improved shutdown time in some situations * Fix display bug in tr_truncd() @@ -753,12 +753,12 @@ * Fix bad redirect === Transmission 2.03 (2010/07/21) === -[http://trac.transmissionbt.com/query?milestone=2.03&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.03&group=component&order=severity All tickets closed by this release] ==== Mac ==== * Fix 2.02 bug where new transfers could not be added and the inspector would not appear === Transmission 2.02 (2010/07/19) === -[http://trac.transmissionbt.com/query?milestone=2.02&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.02&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix NAT-PMP port forwarding issue on some systems * Fix filename errors for torrents whose files are encoded in ISO-8859-1 @@ -777,7 +777,7 @@ * Fix compilation issue with Qt < 4.5 === Transmission 2.01 (2010/06/26) === -[http://trac.transmissionbt.com/query?milestone=2.01&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.01&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Better tracker announce management when completed torrents are moved from the incomplete directory * Speed up moving local data from one disk to another @@ -803,7 +803,7 @@ * Fix display bug caused by removal of a torrent hidden by the current filter === Transmission 2.00 (2010/06/15) === -[http://trac.transmissionbt.com/query?milestone=2.00&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=2.00&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * "Local Peer Discovery" for finding peers on the local network * Optimize download requests for the bandwidth available @@ -846,7 +846,7 @@ * Show ETA for seeding torrents that have a seed ratio set === Transmission 1.93 (2010/05/01) === -[http://trac.transmissionbt.com/query?milestone=1.93&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.93&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix rare crash when some peers disconnected unexpectedly * Fix bug which didn't parse scheduled speed limit dates correctly @@ -873,7 +873,7 @@ * Fix bug that broke the "reverse sort order" menu checkbox === Transmission 1.92 (2010/03/14) === -[http://trac.transmissionbt.com/query?milestone=1.92&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.92&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix possible data corruption issue caused by data sent by bad peers during endgame * Fix potential buffer overflow when adding maliciously-crafted magnet links @@ -896,7 +896,7 @@ * Update to jQuery 1.4.2 === Transmission 1.91 (2010/02/21) === -[http://trac.transmissionbt.com/query?milestone=1.91&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.91&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix 1.90 crash-on-startup bug that affected some users * Fix 1.90 bug that caused the "turtle mode" state to be forgotten between sessions @@ -906,7 +906,7 @@ * Fix 1.90 bug when removing trackers === Transmission 1.90 (2010/02/16) === -[http://trac.transmissionbt.com/query?milestone=1.90&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.90&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Add an option to disable the .part suffix for incomplete files * Add priority selector to GUI clients' add torrent windows @@ -942,7 +942,7 @@ * Fix bug that prevented torrents from being added via web browsers === Transmission 1.83 (2010/01/28) === -[http://trac.transmissionbt.com/query?milestone=1.83&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.83&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix 1.80 announce error that caused uploads and downloads to periodically freeze * Fix 1.80 announce timeout error that caused "no response from tracker" message @@ -952,12 +952,12 @@ * Fix 1.82 error when updating the blocklist === Transmission 1.82 (2010/01/23) === -[http://trac.transmissionbt.com/query?milestone=1.82&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.82&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * The 1.81 announce's "Host" HTTP header didn't contain the host's port number === Transmission 1.81 (2010/01/22) === -[http://trac.transmissionbt.com/query?milestone=1.81&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.81&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix 1.80 bug that misparsed some magnet links * Fix 1.80 bug that caused startup to be very sluggish for some people @@ -966,7 +966,7 @@ * Fix auto-grouping by file name === Transmission 1.80 (2010/01/20) === -[http://trac.transmissionbt.com/query?milestone=1.80&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.80&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Add support for magnet links * Add support for trackerless torrents @@ -1019,7 +1019,7 @@ * Fix bug that obscured part of the context menu === Transmission 1.77 (2010/01/04) === -[http://trac.transmissionbt.com/query?milestone=1.77&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.77&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Protect against potential data loss by maliciously-crafted torrent files * Fix minor build issues and packaging issues on various platforms @@ -1030,7 +1030,7 @@ * Fix GIcon memory leak === Transmission 1.76 (2009/10/24) === -[http://trac.transmissionbt.com/query?milestone=1.76&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.76&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix potential data loss when moving torrents to where they already are * Fix minor protocol error that didn't send a port message to some peers @@ -1056,7 +1056,7 @@ * Cannot open a torrent in KDE4 with right-clicking === Transmission 1.75 (2009/09/13) === -[http://trac.transmissionbt.com/query?milestone=1.75&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.75&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Don't wait so long on unresponsive trackers if there are other trackers to try * Adding corrupt/invalid torrents could crash Transmission @@ -1076,7 +1076,7 @@ * Fix clang build issue === Transmission 1.74 (2009/08/24) === -[http://trac.transmissionbt.com/query?milestone=1.74&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.74&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Better data recovery in the case of an OS or Transmission crash * If a data file is moved, stop the torrent instead of redownloading it @@ -1097,7 +1097,7 @@ * Synchronize the statusbar's and torrent list's speeds * Fix the Properties dialog's "Origin" field for multiple torrents ==== Qt ==== - * New Russian Translation + * New Russian Translation * If Transmission was minimized, clicking on it the icon tray didn't raise it ==== Daemon ==== * Speed Limit mode support added to transmission-remote @@ -1108,7 +1108,7 @@ * "Pause All" only appeared to pause torrents with peers until refresh === Transmission 1.73 (2009/07/18) === -[http://trac.transmissionbt.com/query?milestone=1.73&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.73&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix bug where user-configured peer limits could be exceeded * Use less memory in some high-peer situations @@ -1130,7 +1130,7 @@ * Some torrent files created with transmission-cli were invalid === Transmission 1.72 (2009/06/16) === -[http://trac.transmissionbt.com/query?milestone=1.72&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.72&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix 1.70 crash with assertion "tv->tv_usec >= 0" * Fix 1.70 crash with assertion "tr_peerIoSupportsFEXT( msgs->peer->io )" @@ -1149,7 +1149,7 @@ * Remote didn't always send the right Encoding header in requests === Transmission 1.71 (2009/06/07) === -[http://trac.transmissionbt.com/query?milestone=1.71&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.71&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix 1.70 bug that caused high CPU use in high-peer swarms * Fix 1.70 build problems with DHT and libevent @@ -1157,13 +1157,13 @@ * Fix watchdir issue on OSes that don't have inotify ==== GTK+ ==== * Fix 1.70 intltool build problem - * Fix crash when the OS's stock mime-type icons are misconfigured + * Fix crash when the OS's stock mime-type icons are misconfigured * Handle very long torrent file lists faster ==== Web Client ==== * Fix 1.70 bug where some torrents appeared to be duplicates === Transmission 1.70 (2009/06/04) === -[http://trac.transmissionbt.com/query?milestone=1.70&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.70&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Distributed hash table (DHT) support for public torrents * Add option for moving and finding a torrent's data on the disk @@ -1204,7 +1204,7 @@ * Torrent comment box did not scroll, so long comments were partially hidden === Transmission 1.61 (2009/05/11) === -[http://trac.transmissionbt.com/query?milestone=1.61&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.61&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Close potential CSRF security hole for Web Client users * Fix locale error in the JSON parser @@ -1222,7 +1222,7 @@ * Fix locale error in the JSON parser === Transmission 1.60 (2009/05/04) === -[http://trac.transmissionbt.com/query?milestone=1.60&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.60&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Seed ratio limiting * Transfer prioritization @@ -1250,16 +1250,16 @@ * Watch folder for auto-adding torrents * Many new features in the RPC/JSON interface * Allow users to specify a specific address when listening for peers -==== Web Client ==== +==== Web Client ==== * File selection and prioritization * Add option to verify local data * Fix "Remove Data" bug === Transmission 1.52 (2009/04/12) === -[http://trac.transmissionbt.com/query?milestone=1.52&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.52&group=component&order=severity All tickets closed by this release] ==== Mac ==== * Improve interface responsiveness when downloading -==== GTK+ and Daemon ==== +==== GTK+ and Daemon ==== * Always honor the XDG setting for the download directory ==== GTK+ ==== * Fix formatting error when showing speeds measured in MB/s @@ -1272,9 +1272,9 @@ * Better Internet Explorer support === Transmission 1.51 (2009/02/26) === -[http://trac.transmissionbt.com/query?milestone=1.51&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.51&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== - * Fix configure script issues with non-gcc compilers and user-defined CFLAGS environment variables + * Fix configure script issues with non-gcc compilers and user-defined CFLAGS environment variables * Decrease CPU usage in some situations * Close a rare race condition on startup * More efficient use of libcurl when curl 7.18.0 or newer is present @@ -1286,19 +1286,19 @@ * Layout fixes when viewed on an iPhone/iPod touch === Transmission 1.50 (2009/02/13) === -[http://trac.transmissionbt.com/query?milestone=1.50&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.50&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * IPv6 support for peers, and for trackers with explicit IPv6 addresses * Improved connectivity for encrypted peers * Fix 1.42 error that made tracker announces slower over time * Fix a Mac-centric peer connection bug from 1.41 * Use less CPU cycles when managing very fast peers - * Better handling of non-UTF-8 torrent files + * Better handling of non-UTF-8 torrent files * When removing local data, only remove data from the torrent * Close potential DoS vulnerability in 1.41 * Many other bug fixes ==== GTK+ ==== - * Various usability improvements + * Various usability improvements * Better Gnome HIG compliance in the statusbar, properties dialog, and more ==== Daemon ==== * Lots of new options added to transmission-remote @@ -1306,17 +1306,17 @@ * Make i18n support optional for cli and daemon clients ==== CLI ==== * Support session.json settings, just as the Daemon and GTK+ clients do -==== Web Client ==== +==== Web Client ==== * Torrents can now be added by URL * Add the ability to "remove local data" from the web client === Transmission 1.42 (2008/12/24) === -[http://trac.transmissionbt.com/query?milestone=1.42&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.42&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix 1.41 lockup issue === Transmission 1.41 (2008/12/23) === -[http://trac.transmissionbt.com/query?milestone=1.41&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.41&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Better peer management in large swarms * Support BitTorrent Enhancement Proposal (BEP) #21 "Extension for Partial Seeds" @@ -1343,7 +1343,7 @@ * Fix minor free-memory-read bug === Transmission 1.40 (2008/11/09) === -[http://trac.transmissionbt.com/query?milestone=1.40&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.40&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Tracker communication uses fewer resources * More accurate bandwidth limits @@ -1376,7 +1376,7 @@ * Windows portability === Transmission 1.34 (2008/09/16) === -[http://trac.transmissionbt.com/query?milestone=1.34&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.34&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Don't reconnect too frequently to the same peer * Webseed bug fix @@ -1397,7 +1397,7 @@ * Fix crash when creating a torrent file === Transmission 1.33 (2008/08/30) === -[http://trac.transmissionbt.com/query?milestone=1.33&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.33&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix crash from malicious torrent files with a piece size of zero * When creating new torrent files, change behavior that caused "Multi tracker torrents are not allowed" warning on one tracker @@ -1414,7 +1414,7 @@ * Fix error where some torrents opened via a web browser didn't appear === Transmission 1.32 (2008/08/08) === -[http://trac.transmissionbt.com/query?milestone=1.32&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.32&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix bug introduced in 1.30 that caused poor tracker communication * Creating torrent files for files >= 2 GB will result in 2 MB pieces @@ -1422,12 +1422,12 @@ * Fix bug where the proxy type was changed from SOCKS5 to SOCKS4 on launch === Transmission 1.31 (2008/08/06) === -[http://trac.transmissionbt.com/query?milestone=1.31&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.31&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix a crash caused by certain torrent files === Transmission 1.30 (2008/08/05) === -[http://trac.transmissionbt.com/query?milestone=1.30&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.30&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * The "Clutch" web interface is now bundled with Transmission (as a beta) * Ability to add and remove tracker addresses @@ -1449,11 +1449,11 @@ * Turkish localization ==== GTK+ ==== * Add options to inhibit hibernation and to toggle the tray icon - * Lots of small bug fixes and usability improvements + * Lots of small bug fixes and usability improvements * Dozens of updated translations === Transmission 1.22 (2008/06/13) === -[http://trac.transmissionbt.com/query?milestone=1.22&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.22&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix two separate BitTorrent unchoke bugs that could affect performance * Transmission now builds correctly on Sun Studio @@ -1470,7 +1470,7 @@ * Fix scraping torrents with the -s command-line argument === Transmission 1.21 (2008/05/21) === -[http://trac.transmissionbt.com/query?milestone=1.21&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.21&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Fix rare crash-on-startup bug * Handle corrupt announce URLs in torrent files more gracefully @@ -1483,7 +1483,7 @@ Polish, Romanian, Thai, Turkish, and Traditional Chinese translations === Transmission 1.20 (2008/05/09) === -[http://trac.transmissionbt.com/query?milestone=1.20&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.20&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Support https tracker connections * IP blocking using the Bluetack Level1 blocklist @@ -1501,7 +1501,7 @@ * Vastly improved translations thanks to the Ubuntu translation team === Transmission 1.11 (2008/04/04) === -[http://trac.transmissionbt.com/query?milestone=1.11&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.11&group=component&order=severity All tickets closed by this release] ==== Mac ==== * Fix scrape address visual glitch with the tracker inspector tab * Only make the progress status string clickable on multi-file torrents @@ -1510,7 +1510,7 @@ * Fix a couple of minor display issues === Transmission 1.10 (2008/03/28) === -[http://trac.transmissionbt.com/query?milestone=1.10&group=component&order=severity All tickets closed by this release] +[https://trac.transmissionbt.com/query?milestone=1.10&group=component&order=severity All tickets closed by this release] ==== All Platforms ==== * Stop torrents when downloading and the disk becomes full * Removing a torrent also removes it from the cache diff --git a/README b/README deleted file mode 100644 index 395136fb34f..00000000000 --- a/README +++ /dev/null @@ -1,55 +0,0 @@ -ABOUT - - Transmission is a fast, easy, and free BitTorrent client. - It comes in several flavors: - - * A native Mac OS X GUI application - * GTK+ and Qt GUI applications for Linux, BSD, etc. - * A headless daemon for servers and routers - * A web UI for remote controlling any of the above - - Visit http://www.transmissionbt.com/ for more information. - -BUILDING - - Transmission has an Xcode project file (Transmission.xcodeproj) - for building in Xcode. - - For a more detailed description, and dependancies, visit: - http://trac.transmissionbt.com/wiki/ - - Building a Transmission release from the command line: - - $ xz -d -c transmission-2.11.tar.xz | tar xf - - $ cd transmission-2.11 - $ ./configure - $ make - $ sudo make install - - Building Transmission from the nightly builds: - - Download a tarball from http://build.transmissionbt.com/job/trunk-linux-inc/ - and follow the steps from the previous section. - - If you're new to building programs from source code, this is typically - easier than building from SVN. - - Building Transmission from SVN (First Time): - - $ svn co svn://svn.transmissionbt.com/Transmission/trunk Transmission - $ cd Transmission - $ ./autogen.sh - $ make - $ sudo make install - - Building Transmission from SVN (Updating): - - $ cd Transmission - $ make clean - $ svn up - $ ./update-version-h.sh - $ make - $ sudo make install - - Notes for building on Solaris' C compiler: User av reports success with - this invocation: ./configure CC=c99 CXX=CC CFLAGS='-D__EXTENSIONS__ -mt' diff --git a/README.md b/README.md new file mode 100644 index 00000000000..2addcaa2ea0 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +## About + +Transmission is a fast, easy, and free BitTorrent client. It comes in several flavors: + * A native Mac OS X GUI application + * GTK+ and Qt GUI applications for Linux, BSD, etc. + * A headless daemon for servers and routers + * A web UI for remote controlling any of the above + +Visit https://transmissionbt.com/ for more information. + +## Building + +Transmission has an Xcode project file (Transmission.xcodeproj) for building in Xcode. + +For a more detailed description, and dependencies, visit: https://github.com/transmission/transmission/wiki + +### Building a Transmission release from the command line + + $ tar xf transmission-2.92.tar.xz + $ cd transmission-2.92 + $ mkdir build + $ cmake .. + $ make + $ sudo make install + +### Building Transmission from the nightly builds + +Download a tarball from https://build.transmissionbt.com/job/trunk-linux/ and follow the steps from the previous section. + +If you're new to building programs from source code, this is typically easier than building from Git. + +### Building Transmission from Git (first time) + + $ git clone https://github.com/transmission/transmission Transmission + $ cd Transmission + $ git submodule update --init + $ mkdir build + $ cd build + $ cmake .. + $ make + $ sudo make install + +### Building Transmission from Git (updating) + + $ cd Transmission/build + $ make clean + $ git pull --rebase --prune + $ git submodule update + $ cmake .. + $ make + $ sudo make install diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 4827a68a6bb..6f639aaffe9 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -3,14 +3,12 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 48; objects = { /* Begin PBXBuildFile section */ 0A6169A70FE5C9A200C66CE6 /* bitfield.c in Sources */ = {isa = PBXBuildFile; fileRef = 0A6169A50FE5C9A200C66CE6 /* bitfield.c */; }; 0A6169A80FE5C9A200C66CE6 /* bitfield.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A6169A60FE5C9A200C66CE6 /* bitfield.h */; }; - 35B038130AC5B6EB00A10FDF /* ResumeNoWaitOn.png in Resources */ = {isa = PBXBuildFile; fileRef = 35B037F90AC5B53800A10FDF /* ResumeNoWaitOn.png */; }; - 35B038140AC5B6EC00A10FDF /* ResumeNoWaitOff.png in Resources */ = {isa = PBXBuildFile; fileRef = 35B037FA0AC5B53800A10FDF /* ResumeNoWaitOff.png */; }; 35F373030C2DA89000DAA8F2 /* FilePriorityCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 35F373010C2DA88F00DAA8F2 /* FilePriorityCell.m */; }; 3C7A11970D0B2EE300B5701F /* getgateway.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C7A11910D0B2EE300B5701F /* getgateway.c */; }; 3C7A11980D0B2EE300B5701F /* getgateway.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C7A11920D0B2EE300B5701F /* getgateway.h */; }; @@ -34,37 +32,22 @@ 4D36BA7B0CA2F00800A63CA5 /* ptrarray.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D36BA6C0CA2F00800A63CA5 /* ptrarray.h */; }; 4D3EA0AA08AE13C600EA10C2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D3EA0A908AE13C600EA10C2 /* IOKit.framework */; }; 4D4ADFC70DA1631500A68297 /* blocklist.c in Sources */ = {isa = PBXBuildFile; fileRef = A2D3078E0D9EC45F0051FD27 /* blocklist.c */; }; - 4D6DAAC6090CE00500F43C22 /* RevealOff.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D6DAAC4090CE00500F43C22 /* RevealOff.png */; }; - 4D6DAAC7090CE00500F43C22 /* RevealOn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D6DAAC5090CE00500F43C22 /* RevealOn.png */; }; 4D8017EA10BBC073008A4AF2 /* torrent-magnet.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D8017E810BBC073008A4AF2 /* torrent-magnet.c */; }; 4D8017EB10BBC073008A4AF2 /* torrent-magnet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D8017E910BBC073008A4AF2 /* torrent-magnet.h */; }; 4D80185910BBC0B0008A4AF2 /* magnet.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D80185710BBC0B0008A4AF2 /* magnet.c */; }; 4D80185A10BBC0B0008A4AF2 /* magnet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D80185810BBC0B0008A4AF2 /* magnet.h */; }; 4D9A2BF009E16D21002D0FF9 /* libtransmission.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D18389709DEC0030047D688 /* libtransmission.a */; }; - 4DA6FDBA0911233800450CB1 /* PauseOn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DA6FDB80911233800450CB1 /* PauseOn.png */; }; - 4DA6FDBB0911233800450CB1 /* PauseOff.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DA6FDB90911233800450CB1 /* PauseOff.png */; }; - 4DA6FDC5091141AD00450CB1 /* ResumeOff.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DA6FDC3091141AD00450CB1 /* ResumeOff.png */; }; - 4DA6FDC6091141AD00450CB1 /* ResumeOn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DA6FDC4091141AD00450CB1 /* ResumeOn.png */; }; 4DB74F080E8CD75100AEB1A8 /* wildmat.c in Sources */ = {isa = PBXBuildFile; fileRef = 4DB74F070E8CD75100AEB1A8 /* wildmat.c */; }; 4DCCBB3E09C3D71100D3CABF /* TorrentCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DCCBB3C09C3D71100D3CABF /* TorrentCell.m */; }; - 4DDFDD22099A5D8E00189D81 /* DownloadBadge.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DDFDD20099A5D8E00189D81 /* DownloadBadge.png */; }; - 4DDFDD23099A5D8E00189D81 /* UploadBadge.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DDFDD21099A5D8E00189D81 /* UploadBadge.png */; }; 4DE5CC9D0980656F00BE280E /* NSStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DE5CC9C0980656F00BE280E /* NSStringAdditions.m */; }; 4DE5CCA70980735700BE280E /* Badger.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DE5CCA60980735700BE280E /* Badger.m */; }; - 4DE5CCBA0981D27700BE280E /* ToolbarResumeAllTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DE5CCB80981D27700BE280E /* ToolbarResumeAllTemplate.png */; }; - 4DE5CCBB0981D27700BE280E /* ToolbarPauseAllTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DE5CCB90981D27700BE280E /* ToolbarPauseAllTemplate.png */; }; 4DE5CCCB0981D9BE00BE280E /* Defaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4DE5CCCA0981D9BE00BE280E /* Defaults.plist */; }; 4DF0C5AB0899190500DD8943 /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DF0C5A90899190500DD8943 /* Controller.m */; }; - 4DF7500C08A103AD007B0D70 /* ToolbarOpenTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DF7500708A103AD007B0D70 /* ToolbarOpenTemplate.png */; }; - 4DF7500D08A103AD007B0D70 /* ToolbarInfoTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DF7500808A103AD007B0D70 /* ToolbarInfoTemplate.png */; }; - 4DF7500E08A103AD007B0D70 /* ToolbarRemoveTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DF7500908A103AD007B0D70 /* ToolbarRemoveTemplate.png */; }; 4DFBC2DF09C0970D00D5C571 /* Torrent.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DFBC2DE09C0970D00D5C571 /* Torrent.m */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; A200B9200A22798F007BBB1E /* InfoWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A200B83A0A2263BA007BBB1E /* InfoWindowController.m */; }; - A2012AE20D77151D0056FD71 /* YingYangGroupTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A2012AE10D77151D0056FD71 /* YingYangGroupTemplate.png */; }; - A20152640D1C1BE70081714F /* PinTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A20152630D1C1BE70081714F /* PinTemplate.png */; }; A201527E0D1C270F0081714F /* torrent-ctor.c in Sources */ = {isa = PBXBuildFile; fileRef = A20152790D1C26EB0081714F /* torrent-ctor.c */; }; A20162C913DE48BF00E15488 /* receivedata.c in Sources */ = {isa = PBXBuildFile; fileRef = A20162C713DE48BF00E15488 /* receivedata.c */; }; A20162CA13DE48BF00E15488 /* receivedata.h in Headers */ = {isa = PBXBuildFile; fileRef = A20162C813DE48BF00E15488 /* receivedata.h */; }; @@ -105,16 +88,12 @@ A209ECA2114319C3002B02D1 /* InfoWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A209ECA1114319C3002B02D1 /* InfoWindow.xib */; }; A209EE5C1144B51E002B02D1 /* history.c in Sources */ = {isa = PBXBuildFile; fileRef = A209EE5A1144B51E002B02D1 /* history.c */; }; A209EE5D1144B51E002B02D1 /* history.h in Headers */ = {isa = PBXBuildFile; fileRef = A209EE5B1144B51E002B02D1 /* history.h */; }; - A20B6F6B0C4D842B0034AB1D /* PriorityLowTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6F6A0C4D842B0034AB1D /* PriorityLowTemplate.png */; }; - A20B6F830C4D8A610034AB1D /* PriorityHighTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6F820C4D8A610034AB1D /* PriorityHighTemplate.png */; }; - A20B6FAE0C4D9B040034AB1D /* PriorityNormalTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6FAD0C4D9B040034AB1D /* PriorityNormalTemplate.png */; }; A20BFFB70D091CC700CE5D2B /* ToolbarSegmentedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A20BFFB60D091CC700CE5D2B /* ToolbarSegmentedCell.m */; }; A21282A80CA6C66800EAEE0F /* StatusBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = A21282A60CA6C66800EAEE0F /* StatusBarView.m */; }; A215BF5C0F02EBB800350CDB /* GroupRules.xib in Resources */ = {isa = PBXBuildFile; fileRef = A215BF5B0F02EBB800350CDB /* GroupRules.xib */; }; A219798B0D07B78400438EA7 /* GroupToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = A219798A0D07B78400438EA7 /* GroupToolbarItem.m */; }; A21A9BE2106D86A800F1C3C1 /* TrackerNode.m in Sources */ = {isa = PBXBuildFile; fileRef = A21A9BE1106D86A800F1C3C1 /* TrackerNode.m */; }; A21A9D41106EC2E800F1C3C1 /* TrackerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A21A9D40106EC2E800F1C3C1 /* TrackerCell.m */; }; - A21DFF100A292B2B007C5F76 /* Transfers.png in Resources */ = {isa = PBXBuildFile; fileRef = A21DFF0F0A292B2B007C5F76 /* Transfers.png */; }; A21F15AC11729A8B00CF5A9C /* AddMagnetWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A21F15AA11729A8B00CF5A9C /* AddMagnetWindowController.m */; }; A21F15AD11729A9F00CF5A9C /* AddMagnetWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A21F1538117299F100CF5A9C /* AddMagnetWindow.xib */; }; A21FBBAB0EDA78C300BC3C51 /* bandwidth.h in Headers */ = {isa = PBXBuildFile; fileRef = A21FBBA90EDA78C300BC3C51 /* bandwidth.h */; }; @@ -129,10 +108,10 @@ A225A4C0187E369C00CDE823 /* ShareToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = A225A4BF187E369C00CDE823 /* ShareToolbarItem.m */; }; A2265F420B5EF5F40093DDA5 /* FileNameCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2265F400B5EF5F40093DDA5 /* FileNameCell.m */; }; A226FDAC0D0CDF20005A7F71 /* libnatpmp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C7A118D0D0B2EB800B5701F /* libnatpmp.a */; }; - A2290D1E14421CC100B95A09 /* libcrypto.0.9.8.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */; }; - A2290D2014421CD000B95A09 /* libcrypto.0.9.8.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */; }; - A2290D2214421CD800B95A09 /* libcrypto.0.9.8.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */; }; - A2290D2514421D1A00B95A09 /* libcrypto.0.9.8.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */; }; + A2290D1E14421CC100B95A09 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.dylib */; }; + A2290D2014421CD000B95A09 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.dylib */; }; + A2290D2214421CD800B95A09 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.dylib */; }; + A2290D2514421D1A00B95A09 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.dylib */; }; A2290D2E1442B23200B95A09 /* libcurl.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2290D2D1442B23200B95A09 /* libcurl.4.dylib */; }; A2290D2F1442B23200B95A09 /* libcurl.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2290D2D1442B23200B95A09 /* libcurl.4.dylib */; }; A2290D301442B23200B95A09 /* libcurl.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2290D2D1442B23200B95A09 /* libcurl.4.dylib */; }; @@ -148,10 +127,8 @@ A22CFCC30FC24F890009BD3E /* dht.c in Sources */ = {isa = PBXBuildFile; fileRef = A22CFCC10FC24F890009BD3E /* dht.c */; }; A22CFCCB0FC24FDA0009BD3E /* libdht.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A22CFCBA0FC24F710009BD3E /* libdht.a */; }; A22CFCCD0FC250480009BD3E /* libevent.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE75C3490C729E9500DBEFE0 /* libevent.a */; }; - A22D3AA60D00D1790079CFED /* TurtleTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A22D3AA30D00D1790079CFED /* TurtleTemplate.png */; }; A22F1E550E7DA8030065DB9D /* sparkle_dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = A22F1E540E7DA8030065DB9D /* sparkle_dsa_pub.pem */; }; A231274C0D11D0B7003F9AFF /* AboutWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A231274B0D11D0B7003F9AFF /* AboutWindow.xib */; }; - A232D29E0A70903E00973B12 /* ToolbarFilterTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A232D29D0A70903E00973B12 /* ToolbarFilterTemplate.png */; }; A232F07E0EEA034A00041646 /* BonjourController.m in Sources */ = {isa = PBXBuildFile; fileRef = A232F07D0EEA034A00041646 /* BonjourController.m */; }; A233BD330D8C6585007EE7B4 /* MessageWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A233BD320D8C6585007EE7B4 /* MessageWindow.xib */; }; A233BD690D8CF2C7007EE7B4 /* StatsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A233BD680D8CF2C7007EE7B4 /* StatsWindow.xib */; }; @@ -159,7 +136,6 @@ A23547E211CD0B090046EAE6 /* cache.c in Sources */ = {isa = PBXBuildFile; fileRef = A23547E011CD0B090046EAE6 /* cache.c */; }; A23547E311CD0B090046EAE6 /* cache.h in Headers */ = {isa = PBXBuildFile; fileRef = A23547E111CD0B090046EAE6 /* cache.h */; }; A2385DD40BFE06C800B24EF6 /* DragOverlayWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A2385DD20BFE06C800B24EF6 /* DragOverlayWindow.m */; }; - A23D5DA71320570800E422BA /* CleanupTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A23D5DA61320570800E422BA /* CleanupTemplate.png */; }; A23F29A1132A447400E9A83B /* announcer-common.h in Headers */ = {isa = PBXBuildFile; fileRef = A23F299F132A447400E9A83B /* announcer-common.h */; }; A23F29A2132A447400E9A83B /* announcer-http.c in Sources */ = {isa = PBXBuildFile; fileRef = A23F29A0132A447400E9A83B /* announcer-http.c */; }; A23F4FF20D1D98AD002FCB97 /* PrefsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A23F4FF00D1D98AD002FCB97 /* PrefsWindow.xib */; }; @@ -167,16 +143,12 @@ A23F526F0F14395900AA02E3 /* PredicateEditorRowTemplateAny.m in Sources */ = {isa = PBXBuildFile; fileRef = A23F526E0F14395900AA02E3 /* PredicateEditorRowTemplateAny.m */; }; A23FAE54178BC2950053DC5B /* platform-quota.c in Sources */ = {isa = PBXBuildFile; fileRef = A23FAE52178BC2950053DC5B /* platform-quota.c */; }; A23FAE55178BC2950053DC5B /* platform-quota.h in Headers */ = {isa = PBXBuildFile; fileRef = A23FAE53178BC2950053DC5B /* platform-quota.h */; }; - A241528B0C0261B8007DD3B4 /* Globe.png in Resources */ = {isa = PBXBuildFile; fileRef = A2FB06950BFF484A0095564D /* Globe.png */; }; A242AD9315F05D23002B3A6C /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A242AD9115F05D23002B3A6C /* Localizable.strings */; }; - A245030C0D6A1FB000B49D00 /* UpArrowGroupTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A245030B0D6A1FB000B49D00 /* UpArrowGroupTemplate.png */; }; - A245030E0D6A1FBC00B49D00 /* DownArrowGroupTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A245030D0D6A1FBC00B49D00 /* DownArrowGroupTemplate.png */; }; A2451E6916ACE4EB00586E0E /* FileRenameSheetController.m in Sources */ = {isa = PBXBuildFile; fileRef = A2451E6716ACE4EB00586E0E /* FileRenameSheetController.m */; }; A2451E6A16ACE4EB00586E0E /* FileRenameSheetController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A2451E6816ACE4EB00586E0E /* FileRenameSheetController.xib */; }; A24621410C769D0900088E81 /* trevent.h in Headers */ = {isa = PBXBuildFile; fileRef = A24621350C769CF400088E81 /* trevent.h */; }; A24621420C769D0900088E81 /* trevent.c in Sources */ = {isa = PBXBuildFile; fileRef = A24621360C769CF400088E81 /* trevent.c */; }; A247A443114C701800547DFC /* InfoViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = A247A442114C701800547DFC /* InfoViewController.h */; }; - A24B65600D3F30870079EA4D /* QuitBadge.png in Resources */ = {isa = PBXBuildFile; fileRef = A24B655F0D3F30870079EA4D /* QuitBadge.png */; }; A24F19080A3A790800C9C145 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A24F19070A3A790800C9C145 /* Sparkle.framework */; }; A24F19210A3A796800C9C145 /* Sparkle.framework in Copy Files */ = {isa = PBXBuildFile; fileRef = A24F19070A3A790800C9C145 /* Sparkle.framework */; }; A250EEB60E2ED87B00A688E6 /* web in Resources */ = {isa = PBXBuildFile; fileRef = A250EE800E2ED87B00A688E6 /* web */; }; @@ -185,7 +157,6 @@ A257C1820CAD3003004E121C /* PeerTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A257C1800CAD3003004E121C /* PeerTableView.m */; }; A25892640CF1F7E800CCCDDF /* StatsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A25892630CF1F7E800CCCDDF /* StatsWindowController.m */; }; A259317E0A73B2CC002F4FE7 /* TransmissionHelp in Resources */ = {isa = PBXBuildFile; fileRef = A259316A0A73B2CC002F4FE7 /* TransmissionHelp */; }; - A25963E11068376200453B31 /* FavIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = A25963E01068376200453B31 /* FavIcon.png */; }; A25964A6106D73A800453B31 /* announcer.c in Sources */ = {isa = PBXBuildFile; fileRef = A25964A4106D73A800453B31 /* announcer.c */; }; A25964A7106D73A800453B31 /* announcer.h in Headers */ = {isa = PBXBuildFile; fileRef = A25964A5106D73A800453B31 /* announcer.h */; }; A25BB02A12F4F517004B724E /* InfoTabButtonBack.m in Sources */ = {isa = PBXBuildFile; fileRef = A25BB02912F4F517004B724E /* InfoTabButtonBack.m */; }; @@ -201,21 +172,9 @@ A25E03E30E4015380086C225 /* tr-getopt.c in Sources */ = {isa = PBXBuildFile; fileRef = A25E03E10E4015380086C225 /* tr-getopt.c */; }; A25E74650AF5097C006F11AE /* ExpandedPathToPathTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = A25E74440AF5089E006F11AE /* ExpandedPathToPathTransformer.m */; }; A25E74660AF5097D006F11AE /* ExpandedPathToIconTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = A25E74460AF5089E006F11AE /* ExpandedPathToIconTransformer.m */; }; - A25FCDEF0A3769A6002BCBBE /* ToolbarPauseSelectedTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A25FCDDD0A37695F002BCBBE /* ToolbarPauseSelectedTemplate.png */; }; - A25FCDF00A3769AC002BCBBE /* ToolbarResumeSelectedTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A25FCDDE0A37695F002BCBBE /* ToolbarResumeSelectedTemplate.png */; }; - A26146E10DD4A0160060F033 /* GroupsNoneTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A26146E00DD4A0160060F033 /* GroupsNoneTemplate.png */; }; A261F1DC0A69A1610002815A /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A261F1DB0A69A1610002815A /* Growl.framework */; }; A261F1E40A69A1B10002815A /* Growl.framework in Copy Files */ = {isa = PBXBuildFile; fileRef = A261F1DB0A69A1610002815A /* Growl.framework */; }; - A2623B2F0D3DC2EF0045D19A /* PriorityControlNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = A2623B2C0D3DC2EF0045D19A /* PriorityControlNormal.png */; }; - A2623B300D3DC2EF0045D19A /* PriorityControlLow.png in Resources */ = {isa = PBXBuildFile; fileRef = A2623B2D0D3DC2EF0045D19A /* PriorityControlLow.png */; }; - A2623B310D3DC2EF0045D19A /* PriorityControlHigh.png in Resources */ = {isa = PBXBuildFile; fileRef = A2623B2E0D3DC2EF0045D19A /* PriorityControlHigh.png */; }; - A2623B3F0D3DC5930045D19A /* ResumeNoWaitHover.png in Resources */ = {isa = PBXBuildFile; fileRef = A2623B3B0D3DC5930045D19A /* ResumeNoWaitHover.png */; }; - A2623B400D3DC5930045D19A /* RevealHover.png in Resources */ = {isa = PBXBuildFile; fileRef = A2623B3C0D3DC5930045D19A /* RevealHover.png */; }; - A2623B410D3DC5930045D19A /* ResumeHover.png in Resources */ = {isa = PBXBuildFile; fileRef = A2623B3D0D3DC5930045D19A /* ResumeHover.png */; }; - A2623B420D3DC5930045D19A /* PauseHover.png in Resources */ = {isa = PBXBuildFile; fileRef = A2623B3E0D3DC5930045D19A /* PauseHover.png */; }; - A2623B4E0D3DC6DF0045D19A /* ActionHover.png in Resources */ = {isa = PBXBuildFile; fileRef = A2623B4D0D3DC6DF0045D19A /* ActionHover.png */; }; A263CFC010DD67670038DE27 /* InfoTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = A263CFBF10DD67670038DE27 /* InfoTextField.m */; }; - A263D03E10DE6F010038DE27 /* Magnet.png in Resources */ = {isa = PBXBuildFile; fileRef = A263D03D10DE6F010038DE27 /* Magnet.png */; }; A2661D6112D0E8D9004F69D5 /* FilterBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2661D3B12D0E51B004F69D5 /* FilterBarView.m */; }; A267927C130DFF2700CB7464 /* libutp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A2E38544130DFEE3001F501B /* libutp.a */; }; A2679294130E00A000CB7464 /* tr-utp.c in Sources */ = {isa = PBXBuildFile; fileRef = A2679292130E00A000CB7464 /* tr-utp.c */; }; @@ -223,12 +182,9 @@ A26AF21A0D2DA35A00FF7140 /* FileOutlineController.m in Sources */ = {isa = PBXBuildFile; fileRef = A26AF2190D2DA35A00FF7140 /* FileOutlineController.m */; }; A26AF27E0D2DBDDF00FF7140 /* AddWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A26AF27C0D2DBDDF00FF7140 /* AddWindow.xib */; }; A26AF2840D2DC27C00FF7140 /* AddWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A26AF2830D2DC27C00FF7140 /* AddWindowController.m */; }; - A26E75880CB6AA7500226674 /* InfoOptions.png in Resources */ = {isa = PBXBuildFile; fileRef = A26E75870CB6AA7500226674 /* InfoOptions.png */; }; - A26E75960CB6AB4800226674 /* InfoGeneral.png in Resources */ = {isa = PBXBuildFile; fileRef = A26E75950CB6AB4800226674 /* InfoGeneral.png */; }; A2710E770A86796000CE4F7D /* PrefsWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A2710E750A86796000CE4F7D /* PrefsWindow.m */; }; A2725B6E0DE5C4F5003445E7 /* FileListNode.m in Sources */ = {isa = PBXBuildFile; fileRef = A2725B6D0DE5C4F5003445E7 /* FileListNode.m */; }; A2725D5D0DE7507C003445E7 /* TrackerTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2725D5C0DE7507C003445E7 /* TrackerTableView.m */; }; - A277DA0B0C693D9C00DA2CD4 /* ActionOn.png in Resources */ = {isa = PBXBuildFile; fileRef = A277DA090C693D9C00DA2CD4 /* ActionOn.png */; }; A27F0F330E19AD9800B2DB97 /* TorrentGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = A27F0F320E19AD9800B2DB97 /* TorrentGroup.m */; }; A284214412DA663E00FBDDBB /* tr-udp.c in Sources */ = {isa = PBXBuildFile; fileRef = A284214212DA663E00FBDDBB /* tr-udp.c */; }; A284214512DA663E00FBDDBB /* tr-udp.h in Headers */ = {isa = PBXBuildFile; fileRef = A284214312DA663E00FBDDBB /* tr-udp.h */; }; @@ -242,8 +198,6 @@ A296EF3C11E560BD004A2781 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A296EF3411E5605E004A2781 /* libiconv.dylib */; }; A296EF3D11E560C3004A2781 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A296EF3411E5605E004A2781 /* libiconv.dylib */; }; A296EF3E11E560D1004A2781 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A296EF3411E5605E004A2781 /* libiconv.dylib */; }; - A29AF4F70D01BADC00D097EC /* DownArrowTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A29AF4F60D01BADC00D097EC /* DownArrowTemplate.png */; }; - A29AF4F90D01BAEB00D097EC /* UpArrowTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A29AF4F80D01BAEB00D097EC /* UpArrowTemplate.png */; }; A29B0C270BD15FEF0006F230 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = A2F8951E0A2D4BA500ED2127 /* Credits.rtf */; }; A29C8B370ACC6EB3000ED9F9 /* PortChecker.m in Sources */ = {isa = PBXBuildFile; fileRef = A29C8B350ACC6EB3000ED9F9 /* PortChecker.m */; }; A29D84041049C25600D1987A /* NSApplicationAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A29D84031049C25600D1987A /* NSApplicationAdditions.m */; }; @@ -281,14 +235,10 @@ A2B6141D1395B0E3000E0975 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2B6141B1395ADE9000E0975 /* libz.dylib */; }; A2B6141E1395B0EC000E0975 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2B6141B1395ADE9000E0975 /* libz.dylib */; }; A2B6141F1395B0F5000E0975 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2B6141B1395ADE9000E0975 /* libz.dylib */; }; - A2BB67790D5BA74600AB0618 /* ToolbarOpenWebTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A2BB67780D5BA74600AB0618 /* ToolbarOpenWebTemplate.png */; }; - A2BC19850CA9AF5A00DD302A /* CompleteCheck.png in Resources */ = {isa = PBXBuildFile; fileRef = A2BC19840CA9AF5A00DD302A /* CompleteCheck.png */; }; A2BE9C520C1E4AF5002D16E6 /* makemeta.c in Sources */ = {isa = PBXBuildFile; fileRef = A2BE9C4E0C1E4ADA002D16E6 /* makemeta.c */; }; A2BE9C530C1E4AF7002D16E6 /* makemeta.h in Headers */ = {isa = PBXBuildFile; fileRef = A2BE9C4F0C1E4ADA002D16E6 /* makemeta.h */; }; - A2C0C5030E02CB6100D95339 /* Remote.png in Resources */ = {isa = PBXBuildFile; fileRef = A2C0C5020E02CB6100D95339 /* Remote.png */; }; A2C89D600CFCBF57004CC2BC /* ButtonToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = A2C89D5F0CFCBF57004CC2BC /* ButtonToolbarItem.m */; }; A2CB38AF0E1E6896002B514C /* COPYING in Resources */ = {isa = PBXBuildFile; fileRef = A2CB38AE0E1E6896002B514C /* COPYING */; }; - A2D0E0490A54A97C003C72CF /* Bandwidth.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D0E0480A54A97C003C72CF /* Bandwidth.png */; }; A2D22A130D65EEE700007D5F /* verify.c in Sources */ = {isa = PBXBuildFile; fileRef = A2D22A100D65EED100007D5F /* verify.c */; }; A2D307A40D9EC6870051FD27 /* BlocklistDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = A2D307A30D9EC6870051FD27 /* BlocklistDownloader.m */; }; A2D307B10D9EC9F50051FD27 /* BlocklistStatusWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A2D307B00D9EC9F50051FD27 /* BlocklistStatusWindow.xib */; }; @@ -297,72 +247,8 @@ A2D77453154CC72B00A62B93 /* WebSeedTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2D77450154CC25700A62B93 /* WebSeedTableView.m */; }; A2D8CFBA15F82DFA0056E93D /* NSApplicationAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A29D84031049C25600D1987A /* NSApplicationAdditions.m */; }; A2D8CFBB15F82E030056E93D /* NSStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DE5CC9C0980656F00BE280E /* NSStringAdditions.m */; }; - A2DA362A0CBC674900C2ED41 /* InfoActivity.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DA36270CBC674900C2ED41 /* InfoActivity.png */; }; - A2DA362B0CBC674900C2ED41 /* InfoFiles.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DA36280CBC674900C2ED41 /* InfoFiles.png */; }; - A2DA362C0CBC674900C2ED41 /* InfoPeers.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DA36290CBC674900C2ED41 /* InfoPeers.png */; }; - A2DC494815842ABE00758FF1 /* ActionHover@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC494715842ABD00758FF1 /* ActionHover@2x.png */; }; - A2DC494A15842BE900758FF1 /* ActionOn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC494915842BE900758FF1 /* ActionOn@2x.png */; }; - A2DC494C15842BF700758FF1 /* Bandwidth@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC494B15842BF700758FF1 /* Bandwidth@2x.png */; }; - A2DC494E15842C1000758FF1 /* CleanupTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC494D15842C1000758FF1 /* CleanupTemplate@2x.png */; }; - A2DC495015842C1C00758FF1 /* CompleteCheck@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC494F15842C1C00758FF1 /* CompleteCheck@2x.png */; }; - A2DC495215842C2700758FF1 /* CreateLarge@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC495115842C2700758FF1 /* CreateLarge@2x.png */; }; - A2DC495415842C3300758FF1 /* DownArrowGroupTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC495315842C3300758FF1 /* DownArrowGroupTemplate@2x.png */; }; - A2DC495615842C4600758FF1 /* DownArrowTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC495515842C4600758FF1 /* DownArrowTemplate@2x.png */; }; - A2DC495815842C7700758FF1 /* FavIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC495715842C7700758FF1 /* FavIcon@2x.png */; }; - A2DC495A15842C9500758FF1 /* Globe@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC495915842C9500758FF1 /* Globe@2x.png */; }; - A2DC495C15842CA000758FF1 /* GreenDot@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC495B15842CA000758FF1 /* GreenDot@2x.png */; }; - A2DC495E15842CB400758FF1 /* Groups@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC495D15842CB400758FF1 /* Groups@2x.png */; }; - A2DC496015842CD300758FF1 /* GroupsNoneTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC495F15842CD300758FF1 /* GroupsNoneTemplate@2x.png */; }; - A2DC496215842CE800758FF1 /* InfoActivity@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC496115842CE800758FF1 /* InfoActivity@2x.png */; }; - A2DC496415842CF200758FF1 /* InfoFiles@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC496315842CF200758FF1 /* InfoFiles@2x.png */; }; - A2DC496615842CFE00758FF1 /* InfoGeneral@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC496515842CFE00758FF1 /* InfoGeneral@2x.png */; }; - A2DC496815842D1B00758FF1 /* InfoOptions@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC496715842D1B00758FF1 /* InfoOptions@2x.png */; }; - A2DC496A15842D2C00758FF1 /* InfoPeers@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC496915842D2C00758FF1 /* InfoPeers@2x.png */; }; - A2DC496C15842D3F00758FF1 /* InfoTracker@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC496B15842D3E00758FF1 /* InfoTracker@2x.png */; }; - A2DC496E15842D5200758FF1 /* Lock@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC496D15842D5200758FF1 /* Lock@2x.png */; }; - A2DC497015842D5C00758FF1 /* Magnet@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC496F15842D5C00758FF1 /* Magnet@2x.png */; }; - A2DC497215842D8000758FF1 /* PauseHover@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC497115842D8000758FF1 /* PauseHover@2x.png */; }; - A2DC497615842D9700758FF1 /* PauseOff@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC497515842D9700758FF1 /* PauseOff@2x.png */; }; - A2DC497815842D9C00758FF1 /* PauseOn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC497715842D9C00758FF1 /* PauseOn@2x.png */; }; - A2DC497A15842DC100758FF1 /* PinTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC497915842DC000758FF1 /* PinTemplate@2x.png */; }; - A2DC497E15842DDC00758FF1 /* PriorityControlLow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC497B15842DDC00758FF1 /* PriorityControlLow@2x.png */; }; - A2DC497F15842DDC00758FF1 /* PriorityControlNormal@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC497C15842DDC00758FF1 /* PriorityControlNormal@2x.png */; }; - A2DC498415842E8A00758FF1 /* PriorityControlHigh@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC498115842E8A00758FF1 /* PriorityControlHigh@2x.png */; }; - A2DC498A15842ECC00758FF1 /* PriorityHighTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC498715842ECC00758FF1 /* PriorityHighTemplate@2x.png */; }; - A2DC498B15842ECC00758FF1 /* PriorityLowTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC498815842ECC00758FF1 /* PriorityLowTemplate@2x.png */; }; - A2DC498C15842ECC00758FF1 /* PriorityNormalTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC498915842ECC00758FF1 /* PriorityNormalTemplate@2x.png */; }; - A2DC498E15842EEA00758FF1 /* PurpleDot@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC498D15842EEA00758FF1 /* PurpleDot@2x.png */; }; - A2DC499015842EF000758FF1 /* RedDot@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC498F15842EF000758FF1 /* RedDot@2x.png */; }; - A2DC499215842F0000758FF1 /* Remote@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC499115842F0000758FF1 /* Remote@2x.png */; }; - A2DC499915842F5800758FF1 /* ResumeHover@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC499315842F5700758FF1 /* ResumeHover@2x.png */; }; - A2DC499A15842F5800758FF1 /* ResumeNoWaitHover@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC499415842F5800758FF1 /* ResumeNoWaitHover@2x.png */; }; - A2DC499B15842F5800758FF1 /* ResumeNoWaitOff@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC499515842F5800758FF1 /* ResumeNoWaitOff@2x.png */; }; - A2DC499C15842F5800758FF1 /* ResumeNoWaitOn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC499615842F5800758FF1 /* ResumeNoWaitOn@2x.png */; }; - A2DC499D15842F5800758FF1 /* ResumeOff@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC499715842F5800758FF1 /* ResumeOff@2x.png */; }; - A2DC499E15842F5800758FF1 /* ResumeOn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC499815842F5800758FF1 /* ResumeOn@2x.png */; }; - A2DC49A215842F9E00758FF1 /* RevealHover@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC499F15842F9D00758FF1 /* RevealHover@2x.png */; }; - A2DC49A315842F9E00758FF1 /* RevealOff@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49A015842F9D00758FF1 /* RevealOff@2x.png */; }; - A2DC49A415842F9E00758FF1 /* RevealOn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49A115842F9D00758FF1 /* RevealOn@2x.png */; }; - A2DC49A815842FC300758FF1 /* ToolbarCreateTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49A515842FC300758FF1 /* ToolbarCreateTemplate@2x.png */; }; - A2DC49A915842FC300758FF1 /* ToolbarFilterTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49A615842FC300758FF1 /* ToolbarFilterTemplate@2x.png */; }; - A2DC49AA15842FC300758FF1 /* ToolbarInfoTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49A715842FC300758FF1 /* ToolbarInfoTemplate@2x.png */; }; - A2DC49AD15842FF200758FF1 /* ToolbarOpenTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49AB15842FF200758FF1 /* ToolbarOpenTemplate@2x.png */; }; - A2DC49AE15842FF200758FF1 /* ToolbarOpenWebTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49AC15842FF200758FF1 /* ToolbarOpenWebTemplate@2x.png */; }; - A2DC49B11584300D00758FF1 /* ToolbarPauseAllTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49AF1584300D00758FF1 /* ToolbarPauseAllTemplate@2x.png */; }; - A2DC49B21584300D00758FF1 /* ToolbarPauseSelectedTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49B01584300D00758FF1 /* ToolbarPauseSelectedTemplate@2x.png */; }; - A2DC49B61584303A00758FF1 /* ToolbarRemoveTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49B31584303A00758FF1 /* ToolbarRemoveTemplate@2x.png */; }; - A2DC49B71584303A00758FF1 /* ToolbarResumeAllTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49B41584303A00758FF1 /* ToolbarResumeAllTemplate@2x.png */; }; - A2DC49B81584303A00758FF1 /* ToolbarResumeSelectedTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49B51584303A00758FF1 /* ToolbarResumeSelectedTemplate@2x.png */; }; - A2DC49BA1584307300758FF1 /* Transfers@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49B91584307300758FF1 /* Transfers@2x.png */; }; - A2DC49BC1584309F00758FF1 /* TurtleTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49BB1584309F00758FF1 /* TurtleTemplate@2x.png */; }; - A2DC49BF158430B300758FF1 /* UpArrowGroupTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49BD158430B300758FF1 /* UpArrowGroupTemplate@2x.png */; }; - A2DC49C0158430B300758FF1 /* UpArrowTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49BE158430B300758FF1 /* UpArrowTemplate@2x.png */; }; - A2DC49C2158430CB00758FF1 /* YellowDot@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49C1158430CA00758FF1 /* YellowDot@2x.png */; }; - A2DC49C4158430E200758FF1 /* YingYangGroupTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49C3158430E200758FF1 /* YingYangGroupTemplate@2x.png */; }; - A2DC49C6158430FB00758FF1 /* YingYangTemplate@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DC49C5158430FB00758FF1 /* YingYangTemplate@2x.png */; }; A2DF37070C220D03006523C1 /* CreatorWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A2DF37050C220D03006523C1 /* CreatorWindowController.m */; }; A2E23AC60CB5E1930002BB25 /* InfoTabButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2E23AC40CB5E1930002BB25 /* InfoTabButtonCell.m */; }; - A2E2EA920EE321C200EB6308 /* Groups.png in Resources */ = {isa = PBXBuildFile; fileRef = A2E2EA910EE321C200EB6308 /* Groups.png */; }; A2E384DA130DFB3A001F501B /* templates.h in Headers */ = {isa = PBXBuildFile; fileRef = A2E384D2130DFB3A001F501B /* templates.h */; }; A2E384DC130DFB3A001F501B /* utp_config.h in Headers */ = {isa = PBXBuildFile; fileRef = A2E384D4130DFB3A001F501B /* utp_config.h */; }; A2E384DD130DFB3A001F501B /* utp_utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A2E384D5130DFB3A001F501B /* utp_utils.cpp */; }; @@ -376,37 +262,27 @@ A2E57B9C13109DC200A7DAB1 /* FilterBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = A2E57B9B13109DC200A7DAB1 /* FilterBar.xib */; }; A2E57BA713109E6B00A7DAB1 /* FilterBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = A2E57BA613109E6B00A7DAB1 /* FilterBarController.m */; }; A2E669790F5B8E5A00B4251A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2E669780F5B8E5A00B4251A /* Security.framework */; }; - A2E9AA760C249AF400085DCF /* ToolbarCreateTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A2E9AA750C249AF400085DCF /* ToolbarCreateTemplate.png */; }; A2EA52311686AC0D00180493 /* quark.c in Sources */ = {isa = PBXBuildFile; fileRef = A2EA522F1686AC0D00180493 /* quark.c */; }; A2EA52321686AC0D00180493 /* quark.h in Headers */ = {isa = PBXBuildFile; fileRef = A2EA52301686AC0D00180493 /* quark.h */; }; A2EB2E7715C8CF2C00FBD5B4 /* QuickLookPlugin.qlgenerator in CopyFiles */ = {isa = PBXBuildFile; fileRef = A2F35BB915C5A0A100EBF632 /* QuickLookPlugin.qlgenerator */; }; A2ED7D8F0CEF431B00970975 /* FilterButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A2ED7D8E0CEF431B00970975 /* FilterButton.m */; }; A2EE726F14DCCC950093C99A /* natpmp_local.h in Headers */ = {isa = PBXBuildFile; fileRef = A2EE726E14DCCC950093C99A /* natpmp_local.h */; }; - A2EF7DEC0C96297400FA9811 /* PurpleDot.png in Resources */ = {isa = PBXBuildFile; fileRef = A2EF7DEB0C96297400FA9811 /* PurpleDot.png */; }; - A2F011990C27418800576FC0 /* CreateLarge.png in Resources */ = {isa = PBXBuildFile; fileRef = A2F011980C27418800576FC0 /* CreateLarge.png */; }; - A2F151180CD438A4001F3B0E /* YellowDot.png in Resources */ = {isa = PBXBuildFile; fileRef = A2F151150CD438A4001F3B0E /* YellowDot.png */; }; - A2F151190CD438A4001F3B0E /* RedDot.png in Resources */ = {isa = PBXBuildFile; fileRef = A2F151160CD438A4001F3B0E /* RedDot.png */; }; - A2F1511A0CD438A4001F3B0E /* GreenDot.png in Resources */ = {isa = PBXBuildFile; fileRef = A2F151170CD438A4001F3B0E /* GreenDot.png */; }; - A2F151200CD438BA001F3B0E /* Lock.png in Resources */ = {isa = PBXBuildFile; fileRef = A2F1511F0CD438BA001F3B0E /* Lock.png */; }; A2F35BBC15C5A0A100EBF632 /* QuickLook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2F35BBB15C5A0A100EBF632 /* QuickLook.framework */; }; A2F35BC815C5A0A100EBF632 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A2F35BC615C5A0A100EBF632 /* InfoPlist.strings */; }; A2F35BCA15C5A0A100EBF632 /* GenerateThumbnailForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = A2F35BC915C5A0A100EBF632 /* GenerateThumbnailForURL.m */; }; A2F35BCC15C5A0A100EBF632 /* GeneratePreviewForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = A2F35BCB15C5A0A100EBF632 /* GeneratePreviewForURL.m */; }; A2F35BD415C5A19A00EBF632 /* libtransmission.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D18389709DEC0030047D688 /* libtransmission.a */; }; - A2F35BD715C5A46D00EBF632 /* libcrypto.0.9.8.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */; }; + A2F35BD715C5A46D00EBF632 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A27653A714369C5C009D3CCF /* libcrypto.dylib */; }; A2F35BDA15C5A49200EBF632 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A2B6141B1395ADE9000E0975 /* libz.dylib */; }; A2F35BDB15C5A4A000EBF632 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A296EF3411E5605E004A2781 /* libiconv.dylib */; }; A2F35BE115C5A7ED00EBF632 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2F35BE015C5A7ED00EBF632 /* Cocoa.framework */; }; A2F35BE315C5A7F900EBF632 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2F35BE215C5A7F900EBF632 /* Foundation.framework */; }; A2F40AE40A361C00006B8288 /* Transmission.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4D2784360905709500687951 /* Transmission.icns */; }; - A2F41DAB0D0B916B006CE378 /* YingYangTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A2F41DAA0D0B916B006CE378 /* YingYangTemplate.png */; }; - A2F41F8E0D73595100B82116 /* InfoTracker.png in Resources */ = {isa = PBXBuildFile; fileRef = A2F41F8D0D73595100B82116 /* InfoTracker.png */; }; A2F7CF5513035F7B0016FF10 /* URLSheetWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A2F7CF5413035F7B0016FF10 /* URLSheetWindow.xib */; }; A2F7CF5F13035FFD0016FF10 /* URLSheetWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A2F7CF5E13035FFD0016FF10 /* URLSheetWindowController.m */; }; A2F8CD430F3D0F4A00DB356A /* miniupnpcstrings.h in Headers */ = {isa = PBXBuildFile; fileRef = A2F8CD420F3D0F4A00DB356A /* miniupnpcstrings.h */; }; A2FB057F0BFEB6800095564D /* DragOverlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2FB057D0BFEB6800095564D /* DragOverlayView.m */; }; A2FB701C0D95CAEA0001F331 /* GroupsController.m in Sources */ = {isa = PBXBuildFile; fileRef = A2FB701B0D95CAEA0001F331 /* GroupsController.m */; }; - BE1183570CE160C50002D0F3 /* bsdqueue.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11834D0CE160C50002D0F3 /* bsdqueue.h */; }; BE1183580CE160C50002D0F3 /* declspec.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11834E0CE160C50002D0F3 /* declspec.h */; }; BE1183590CE160C50002D0F3 /* igd_desc_parse.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11834F0CE160C50002D0F3 /* igd_desc_parse.h */; }; BE11835A0CE160C50002D0F3 /* minixml.h in Headers */ = {isa = PBXBuildFile; fileRef = BE1183500CE160C50002D0F3 /* minixml.h */; }; @@ -463,8 +339,12 @@ C1077A4F183EB29600634C22 /* error.h in Headers */ = {isa = PBXBuildFile; fileRef = C1077A4B183EB29600634C22 /* error.h */; }; C1077A50183EB29600634C22 /* file-posix.c in Sources */ = {isa = PBXBuildFile; fileRef = C1077A4C183EB29600634C22 /* file-posix.c */; }; C1077A51183EB29600634C22 /* file.h in Headers */ = {isa = PBXBuildFile; fileRef = C1077A4D183EB29600634C22 /* file.h */; }; + C10C644D1D9AF328003C1B4C /* session-id.c in Sources */ = {isa = PBXBuildFile; fileRef = C10C644B1D9AF328003C1B4C /* session-id.c */; }; + C10C644E1D9AF328003C1B4C /* session-id.h in Headers */ = {isa = PBXBuildFile; fileRef = C10C644C1D9AF328003C1B4C /* session-id.h */; }; + C12F19781E1AE3C30005E93F /* upnpc.c in Sources */ = {isa = PBXBuildFile; fileRef = C12F19761E1AE3C30005E93F /* upnpc.c */; }; + C12F19791E1AE3C30005E93F /* upnperrors.c in Sources */ = {isa = PBXBuildFile; fileRef = C12F19771E1AE3C30005E93F /* upnperrors.c */; }; + C12F197B1E1AE4460005E93F /* upnperrors.h in Headers */ = {isa = PBXBuildFile; fileRef = C12F197A1E1AE4460005E93F /* upnperrors.h */; }; C1305EBE186A13B100F03351 /* file.c in Sources */ = {isa = PBXBuildFile; fileRef = C1305EB8186A134000F03351 /* file.c */; }; - C15320211C82602500CC21E2 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8D1107310486CEB800E47090 /* Info.plist */; }; C1639A741A55F4E000E42033 /* libb64.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C1639A6F1A55F4D600E42033 /* libb64.a */; }; C1639A781A55F56600E42033 /* cdecode.c in Sources */ = {isa = PBXBuildFile; fileRef = C1639A761A55F56600E42033 /* cdecode.c */; }; C1639A791A55F56600E42033 /* cencode.c in Sources */ = {isa = PBXBuildFile; fileRef = C1639A771A55F56600E42033 /* cencode.c */; }; @@ -479,6 +359,7 @@ D4AF3B2F0C41F7A500D46B6B /* list.c in Sources */ = {isa = PBXBuildFile; fileRef = D4AF3B2D0C41F7A500D46B6B /* list.c */; }; D4AF3B300C41F7A600D46B6B /* list.h in Headers */ = {isa = PBXBuildFile; fileRef = D4AF3B2E0C41F7A500D46B6B /* list.h */; }; E138A9780C04D88F00C5426C /* ProgressGradients.m in Sources */ = {isa = PBXBuildFile; fileRef = E138A9760C04D88F00C5426C /* ProgressGradients.m */; }; + F63480631E1D7274005B9E09 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F63480621E1D7274005B9E09 /* Images.xcassets */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -602,8 +483,6 @@ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* Transmission_Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Transmission_Prefix.pch; path = macosx/Transmission_Prefix.pch; sourceTree = ""; }; - 35B037F90AC5B53800A10FDF /* ResumeNoWaitOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeNoWaitOn.png; path = macosx/Images/ResumeNoWaitOn.png; sourceTree = ""; }; - 35B037FA0AC5B53800A10FDF /* ResumeNoWaitOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeNoWaitOff.png; path = macosx/Images/ResumeNoWaitOff.png; sourceTree = ""; }; 35F373000C2DA88F00DAA8F2 /* FilePriorityCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FilePriorityCell.h; path = macosx/FilePriorityCell.h; sourceTree = ""; }; 35F373010C2DA88F00DAA8F2 /* FilePriorityCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FilePriorityCell.m; path = macosx/FilePriorityCell.m; sourceTree = ""; }; 3C7A118D0D0B2EB800B5701F /* libnatpmp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libnatpmp.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -631,48 +510,33 @@ 4D36BA6B0CA2F00800A63CA5 /* peer-msgs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "peer-msgs.h"; path = "libtransmission/peer-msgs.h"; sourceTree = ""; }; 4D36BA6C0CA2F00800A63CA5 /* ptrarray.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ptrarray.h; path = libtransmission/ptrarray.h; sourceTree = ""; }; 4D3EA0A908AE13C600EA10C2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; - 4D6DAAC4090CE00500F43C22 /* RevealOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = RevealOff.png; path = macosx/Images/RevealOff.png; sourceTree = ""; }; - 4D6DAAC5090CE00500F43C22 /* RevealOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = RevealOn.png; path = macosx/Images/RevealOn.png; sourceTree = ""; }; 4D8017E810BBC073008A4AF2 /* torrent-magnet.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "torrent-magnet.c"; path = "libtransmission/torrent-magnet.c"; sourceTree = ""; }; 4D8017E910BBC073008A4AF2 /* torrent-magnet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "torrent-magnet.h"; path = "libtransmission/torrent-magnet.h"; sourceTree = ""; }; 4D80185710BBC0B0008A4AF2 /* magnet.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = magnet.c; path = libtransmission/magnet.c; sourceTree = ""; }; 4D80185810BBC0B0008A4AF2 /* magnet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = magnet.h; path = libtransmission/magnet.h; sourceTree = ""; }; - 4DA6FDB80911233800450CB1 /* PauseOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PauseOn.png; path = macosx/Images/PauseOn.png; sourceTree = ""; }; - 4DA6FDB90911233800450CB1 /* PauseOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PauseOff.png; path = macosx/Images/PauseOff.png; sourceTree = ""; }; - 4DA6FDC3091141AD00450CB1 /* ResumeOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeOff.png; path = macosx/Images/ResumeOff.png; sourceTree = ""; }; - 4DA6FDC4091141AD00450CB1 /* ResumeOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeOn.png; path = macosx/Images/ResumeOn.png; sourceTree = ""; }; 4DB74F070E8CD75100AEB1A8 /* wildmat.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = wildmat.c; path = libtransmission/wildmat.c; sourceTree = ""; }; 4DCCBB3C09C3D71100D3CABF /* TorrentCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = TorrentCell.m; path = macosx/TorrentCell.m; sourceTree = ""; }; 4DCCBB3D09C3D71100D3CABF /* TorrentCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TorrentCell.h; path = macosx/TorrentCell.h; sourceTree = ""; }; 4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; }; - 4DDFDD20099A5D8E00189D81 /* DownloadBadge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DownloadBadge.png; path = macosx/Images/DownloadBadge.png; sourceTree = ""; }; - 4DDFDD21099A5D8E00189D81 /* UploadBadge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = UploadBadge.png; path = macosx/Images/UploadBadge.png; sourceTree = ""; }; 4DE5CC9B0980656F00BE280E /* NSStringAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSStringAdditions.h; path = macosx/NSStringAdditions.h; sourceTree = ""; }; 4DE5CC9C0980656F00BE280E /* NSStringAdditions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = NSStringAdditions.m; path = macosx/NSStringAdditions.m; sourceTree = ""; }; 4DE5CCA50980735700BE280E /* Badger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Badger.h; path = macosx/Badger.h; sourceTree = ""; }; 4DE5CCA60980735700BE280E /* Badger.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = Badger.m; path = macosx/Badger.m; sourceTree = ""; }; - 4DE5CCB80981D27700BE280E /* ToolbarResumeAllTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ToolbarResumeAllTemplate.png; path = macosx/Images/ToolbarResumeAllTemplate.png; sourceTree = ""; }; - 4DE5CCB90981D27700BE280E /* ToolbarPauseAllTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ToolbarPauseAllTemplate.png; path = macosx/Images/ToolbarPauseAllTemplate.png; sourceTree = ""; }; 4DE5CCCA0981D9BE00BE280E /* Defaults.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Defaults.plist; path = macosx/Defaults.plist; sourceTree = ""; }; 4DF0C5A90899190500DD8943 /* Controller.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = Controller.m; path = macosx/Controller.m; sourceTree = ""; }; 4DF0C5AA0899190500DD8943 /* Controller.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Controller.h; path = macosx/Controller.h; sourceTree = ""; }; - 4DF7500708A103AD007B0D70 /* ToolbarOpenTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ToolbarOpenTemplate.png; path = macosx/Images/ToolbarOpenTemplate.png; sourceTree = ""; }; - 4DF7500808A103AD007B0D70 /* ToolbarInfoTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ToolbarInfoTemplate.png; path = macosx/Images/ToolbarInfoTemplate.png; sourceTree = ""; }; - 4DF7500908A103AD007B0D70 /* ToolbarRemoveTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ToolbarRemoveTemplate.png; path = macosx/Images/ToolbarRemoveTemplate.png; sourceTree = ""; }; 4DFBC2DD09C0970D00D5C571 /* Torrent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Torrent.h; path = macosx/Torrent.h; sourceTree = ""; }; 4DFBC2DE09C0970D00D5C571 /* Torrent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = Torrent.m; path = macosx/Torrent.m; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = Info.plist; path = macosx/Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* Transmission.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Transmission.app; sourceTree = BUILT_PRODUCTS_DIR; }; A200B8390A2263BA007BBB1E /* InfoWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InfoWindowController.h; path = macosx/InfoWindowController.h; sourceTree = ""; }; A200B83A0A2263BA007BBB1E /* InfoWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = InfoWindowController.m; path = macosx/InfoWindowController.m; sourceTree = ""; }; - A2012AE10D77151D0056FD71 /* YingYangGroupTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = YingYangGroupTemplate.png; path = macosx/Images/YingYangGroupTemplate.png; sourceTree = ""; }; - A20152630D1C1BE70081714F /* PinTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PinTemplate.png; path = macosx/Images/PinTemplate.png; sourceTree = ""; }; A20152790D1C26EB0081714F /* torrent-ctor.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "torrent-ctor.c"; path = "libtransmission/torrent-ctor.c"; sourceTree = ""; }; - A20162C713DE48BF00E15488 /* receivedata.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = receivedata.c; path = "third-party/miniupnp/receivedata.c"; sourceTree = ""; }; - A20162C813DE48BF00E15488 /* receivedata.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = receivedata.h; path = "third-party/miniupnp/receivedata.h"; sourceTree = ""; }; - A20162CB13DE497000E15488 /* portlistingparse.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = portlistingparse.c; path = "third-party/miniupnp/portlistingparse.c"; sourceTree = ""; }; - A20162CC13DE497000E15488 /* portlistingparse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = portlistingparse.h; path = "third-party/miniupnp/portlistingparse.h"; sourceTree = ""; }; - A20162CF13DE49E500E15488 /* miniupnpctypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = miniupnpctypes.h; path = "third-party/miniupnp/miniupnpctypes.h"; sourceTree = ""; }; + A20162C713DE48BF00E15488 /* receivedata.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = receivedata.c; path = "third-party/miniupnpc/receivedata.c"; sourceTree = ""; }; + A20162C813DE48BF00E15488 /* receivedata.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = receivedata.h; path = "third-party/miniupnpc/receivedata.h"; sourceTree = ""; }; + A20162CB13DE497000E15488 /* portlistingparse.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = portlistingparse.c; path = "third-party/miniupnpc/portlistingparse.c"; sourceTree = ""; }; + A20162CC13DE497000E15488 /* portlistingparse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = portlistingparse.h; path = "third-party/miniupnpc/portlistingparse.h"; sourceTree = ""; }; + A20162CF13DE49E500E15488 /* miniupnpctypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = miniupnpctypes.h; path = "third-party/miniupnpc/miniupnpctypes.h"; sourceTree = ""; }; A202FF5B0DDA9275009938FF /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = macosx/it.lproj/AddWindow.xib; sourceTree = ""; }; A202FF5C0DDA9275009938FF /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = macosx/it.lproj/Creator.xib; sourceTree = ""; }; A202FF5D0DDA9275009938FF /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = macosx/it.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -719,9 +583,6 @@ A209ECA1114319C3002B02D1 /* InfoWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = InfoWindow.xib; path = macosx/InfoWindow.xib; sourceTree = ""; }; A209EE5A1144B51E002B02D1 /* history.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = history.c; path = libtransmission/history.c; sourceTree = ""; }; A209EE5B1144B51E002B02D1 /* history.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = history.h; path = libtransmission/history.h; sourceTree = ""; }; - A20B6F6A0C4D842B0034AB1D /* PriorityLowTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityLowTemplate.png; path = macosx/Images/PriorityLowTemplate.png; sourceTree = ""; }; - A20B6F820C4D8A610034AB1D /* PriorityHighTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityHighTemplate.png; path = macosx/Images/PriorityHighTemplate.png; sourceTree = ""; }; - A20B6FAD0C4D9B040034AB1D /* PriorityNormalTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityNormalTemplate.png; path = macosx/Images/PriorityNormalTemplate.png; sourceTree = ""; }; A20BFFB50D091CC700CE5D2B /* ToolbarSegmentedCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ToolbarSegmentedCell.h; path = macosx/ToolbarSegmentedCell.h; sourceTree = ""; }; A20BFFB60D091CC700CE5D2B /* ToolbarSegmentedCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ToolbarSegmentedCell.m; path = macosx/ToolbarSegmentedCell.m; sourceTree = ""; }; A21282A50CA6C66800EAEE0F /* StatusBarView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StatusBarView.h; path = macosx/StatusBarView.h; sourceTree = ""; }; @@ -733,7 +594,6 @@ A21A9BE1106D86A800F1C3C1 /* TrackerNode.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = TrackerNode.m; path = macosx/TrackerNode.m; sourceTree = ""; }; A21A9D3F106EC2E800F1C3C1 /* TrackerCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TrackerCell.h; path = macosx/TrackerCell.h; sourceTree = ""; }; A21A9D40106EC2E800F1C3C1 /* TrackerCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = TrackerCell.m; path = macosx/TrackerCell.m; sourceTree = ""; }; - A21DFF0F0A292B2B007C5F76 /* Transfers.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Transfers.png; path = macosx/Images/Transfers.png; sourceTree = ""; }; A21F1539117299F100CF5A9C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = macosx/en.lproj/AddMagnetWindow.xib; sourceTree = ""; }; A21F15AA11729A8B00CF5A9C /* AddMagnetWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AddMagnetWindowController.m; path = macosx/AddMagnetWindowController.m; sourceTree = ""; }; A21F15AB11729A8B00CF5A9C /* AddMagnetWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AddMagnetWindowController.h; path = macosx/AddMagnetWindowController.h; sourceTree = ""; }; @@ -776,8 +636,8 @@ A2265F3F0B5EF5F40093DDA5 /* FileNameCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FileNameCell.h; path = macosx/FileNameCell.h; sourceTree = ""; }; A2265F400B5EF5F40093DDA5 /* FileNameCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FileNameCell.m; path = macosx/FileNameCell.m; sourceTree = ""; }; A2290D2D1442B23200B95A09 /* libcurl.4.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.4.dylib; path = "third-party/curl/lib/libcurl.4.dylib"; sourceTree = ""; }; - A22B00AE116A9E90003315FC /* connecthostport.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = connecthostport.c; path = "third-party/miniupnp/connecthostport.c"; sourceTree = ""; }; - A22B00AF116A9E90003315FC /* connecthostport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = connecthostport.h; path = "third-party/miniupnp/connecthostport.h"; sourceTree = ""; }; + A22B00AE116A9E90003315FC /* connecthostport.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = connecthostport.c; path = "third-party/miniupnpc/connecthostport.c"; sourceTree = ""; }; + A22B00AF116A9E90003315FC /* connecthostport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = connecthostport.h; path = "third-party/miniupnpc/connecthostport.h"; sourceTree = ""; }; A22BAE261388040500FB022F /* NSMutableArrayAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSMutableArrayAdditions.h; path = macosx/NSMutableArrayAdditions.h; sourceTree = ""; }; A22BAE271388040500FB022F /* NSMutableArrayAdditions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = NSMutableArrayAdditions.m; path = macosx/NSMutableArrayAdditions.m; sourceTree = ""; }; A22CF7AC0FA3505F0009BD3E /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = macosx/it.lproj/GroupRules.xib; sourceTree = ""; }; @@ -791,10 +651,8 @@ A22CFCBA0FC24F710009BD3E /* libdht.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libdht.a; sourceTree = BUILT_PRODUCTS_DIR; }; A22CFCC00FC24F890009BD3E /* dht.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = dht.h; path = "third-party/dht/dht.h"; sourceTree = ""; }; A22CFCC10FC24F890009BD3E /* dht.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = dht.c; path = "third-party/dht/dht.c"; sourceTree = ""; }; - A22D3AA30D00D1790079CFED /* TurtleTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TurtleTemplate.png; path = macosx/Images/TurtleTemplate.png; sourceTree = ""; }; A22F1E540E7DA8030065DB9D /* sparkle_dsa_pub.pem */ = {isa = PBXFileReference; lastKnownFileType = text; name = sparkle_dsa_pub.pem; path = macosx/sparkle_dsa_pub.pem; sourceTree = ""; }; A231274B0D11D0B7003F9AFF /* AboutWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = AboutWindow.xib; path = macosx/AboutWindow.xib; sourceTree = ""; }; - A232D29D0A70903E00973B12 /* ToolbarFilterTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ToolbarFilterTemplate.png; path = macosx/Images/ToolbarFilterTemplate.png; sourceTree = ""; }; A232F07C0EEA034A00041646 /* BonjourController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = BonjourController.h; path = macosx/BonjourController.h; sourceTree = ""; }; A232F07D0EEA034A00041646 /* BonjourController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = BonjourController.m; path = macosx/BonjourController.m; sourceTree = ""; }; A233BD320D8C6585007EE7B4 /* MessageWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MessageWindow.xib; path = macosx/MessageWindow.xib; sourceTree = ""; }; @@ -808,7 +666,6 @@ A236D19615F6BD9C000C3DD4 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = macosx/QuickLookPlugin/it.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; A2385DD20BFE06C800B24EF6 /* DragOverlayWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DragOverlayWindow.m; path = macosx/DragOverlayWindow.m; sourceTree = ""; }; A2385DD30BFE06C800B24EF6 /* DragOverlayWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DragOverlayWindow.h; path = macosx/DragOverlayWindow.h; sourceTree = ""; }; - A23D5DA61320570800E422BA /* CleanupTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CleanupTemplate.png; path = macosx/Images/CleanupTemplate.png; sourceTree = ""; }; A23F299F132A447400E9A83B /* announcer-common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "announcer-common.h"; path = "libtransmission/announcer-common.h"; sourceTree = ""; }; A23F29A0132A447400E9A83B /* announcer-http.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "announcer-http.c"; path = "libtransmission/announcer-http.c"; sourceTree = ""; }; A23F526D0F14395900AA02E3 /* PredicateEditorRowTemplateAny.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PredicateEditorRowTemplateAny.h; path = macosx/PredicateEditorRowTemplateAny.h; sourceTree = ""; }; @@ -816,18 +673,15 @@ A23FAE52178BC2950053DC5B /* platform-quota.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "platform-quota.c"; path = "libtransmission/platform-quota.c"; sourceTree = ""; }; A23FAE53178BC2950053DC5B /* platform-quota.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "platform-quota.h"; path = "libtransmission/platform-quota.h"; sourceTree = ""; }; A242AD9215F05D23002B3A6C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = macosx/QuickLookPlugin/en.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; - A245030B0D6A1FB000B49D00 /* UpArrowGroupTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = UpArrowGroupTemplate.png; path = macosx/Images/UpArrowGroupTemplate.png; sourceTree = ""; }; - A245030D0D6A1FBC00B49D00 /* DownArrowGroupTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DownArrowGroupTemplate.png; path = macosx/Images/DownArrowGroupTemplate.png; sourceTree = ""; }; A2451E6616ACE4EB00586E0E /* FileRenameSheetController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FileRenameSheetController.h; path = macosx/FileRenameSheetController.h; sourceTree = ""; }; A2451E6716ACE4EB00586E0E /* FileRenameSheetController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FileRenameSheetController.m; path = macosx/FileRenameSheetController.m; sourceTree = ""; }; A2451E6816ACE4EB00586E0E /* FileRenameSheetController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = FileRenameSheetController.xib; path = macosx/FileRenameSheetController.xib; sourceTree = ""; }; A24621350C769CF400088E81 /* trevent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = trevent.h; path = libtransmission/trevent.h; sourceTree = ""; }; A24621360C769CF400088E81 /* trevent.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = trevent.c; path = libtransmission/trevent.c; sourceTree = ""; }; A247A442114C701800547DFC /* InfoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InfoViewController.h; path = macosx/InfoViewController.h; sourceTree = ""; }; - A24B655F0D3F30870079EA4D /* QuitBadge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = QuitBadge.png; path = macosx/Images/QuitBadge.png; sourceTree = ""; }; A24F19070A3A790800C9C145 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = macosx/Sparkle.framework; sourceTree = ""; }; A250EE800E2ED87B00A688E6 /* web */ = {isa = PBXFileReference; lastKnownFileType = folder; path = web; sourceTree = ""; }; - A25485390EB66CBB004539DA /* codelength.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = codelength.h; path = "third-party/miniupnp/codelength.h"; sourceTree = ""; }; + A25485390EB66CBB004539DA /* codelength.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = codelength.h; path = "third-party/miniupnpc/codelength.h"; sourceTree = ""; }; A256588A0A9A695400E8A03B /* MessageWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MessageWindowController.h; path = macosx/MessageWindowController.h; sourceTree = ""; }; A256588B0A9A695400E8A03B /* MessageWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MessageWindowController.m; path = macosx/MessageWindowController.m; sourceTree = ""; }; A257C17F0CAD3003004E121C /* PeerTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PeerTableView.h; path = macosx/PeerTableView.h; sourceTree = ""; }; @@ -835,7 +689,6 @@ A25892620CF1F7E800CCCDDF /* StatsWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StatsWindowController.h; path = macosx/StatsWindowController.h; sourceTree = ""; }; A25892630CF1F7E800CCCDDF /* StatsWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = StatsWindowController.m; path = macosx/StatsWindowController.m; sourceTree = ""; }; A259316A0A73B2CC002F4FE7 /* TransmissionHelp */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TransmissionHelp; path = macosx/TransmissionHelp; sourceTree = ""; }; - A25963E01068376200453B31 /* FavIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FavIcon.png; path = macosx/Images/FavIcon.png; sourceTree = ""; }; A25964A4106D73A800453B31 /* announcer.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = announcer.c; path = libtransmission/announcer.c; sourceTree = ""; }; A25964A5106D73A800453B31 /* announcer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = announcer.h; path = libtransmission/announcer.h; sourceTree = ""; }; A25BB02812F4F517004B724E /* InfoTabButtonBack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InfoTabButtonBack.h; path = macosx/InfoTabButtonBack.h; sourceTree = ""; }; @@ -853,8 +706,6 @@ A25E74450AF5089E006F11AE /* ExpandedPathToPathTransformer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ExpandedPathToPathTransformer.h; path = macosx/ExpandedPathToPathTransformer.h; sourceTree = ""; }; A25E74460AF5089E006F11AE /* ExpandedPathToIconTransformer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ExpandedPathToIconTransformer.m; path = macosx/ExpandedPathToIconTransformer.m; sourceTree = ""; }; A25E74470AF5089E006F11AE /* ExpandedPathToIconTransformer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ExpandedPathToIconTransformer.h; path = macosx/ExpandedPathToIconTransformer.h; sourceTree = ""; }; - A25FCDDD0A37695F002BCBBE /* ToolbarPauseSelectedTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ToolbarPauseSelectedTemplate.png; path = macosx/Images/ToolbarPauseSelectedTemplate.png; sourceTree = ""; }; - A25FCDDE0A37695F002BCBBE /* ToolbarResumeSelectedTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ToolbarResumeSelectedTemplate.png; path = macosx/Images/ToolbarResumeSelectedTemplate.png; sourceTree = ""; }; A2613F9111B3383200472893 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_PT; path = macosx/pt_PT.lproj/AddMagnetWindow.xib; sourceTree = ""; }; A2613F9211B3383200472893 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_PT; path = macosx/pt_PT.lproj/AddWindow.xib; sourceTree = ""; }; A2613F9311B3383200472893 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_PT; path = macosx/pt_PT.lproj/Creator.xib; sourceTree = ""; }; @@ -866,16 +717,7 @@ A2613F9911B3383200472893 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_PT; path = macosx/pt_PT.lproj/Localizable.strings; sourceTree = ""; }; A2613F9A11B3383200472893 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_PT; path = macosx/pt_PT.lproj/MainMenu.xib; sourceTree = ""; }; A2613F9B11B3383200472893 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_PT; path = macosx/pt_PT.lproj/PrefsWindow.xib; sourceTree = ""; }; - A26146E00DD4A0160060F033 /* GroupsNoneTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = GroupsNoneTemplate.png; path = macosx/Images/GroupsNoneTemplate.png; sourceTree = ""; }; A261F1DB0A69A1610002815A /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = macosx/Growl.framework; sourceTree = ""; }; - A2623B2C0D3DC2EF0045D19A /* PriorityControlNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityControlNormal.png; path = macosx/Images/PriorityControlNormal.png; sourceTree = ""; }; - A2623B2D0D3DC2EF0045D19A /* PriorityControlLow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityControlLow.png; path = macosx/Images/PriorityControlLow.png; sourceTree = ""; }; - A2623B2E0D3DC2EF0045D19A /* PriorityControlHigh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityControlHigh.png; path = macosx/Images/PriorityControlHigh.png; sourceTree = ""; }; - A2623B3B0D3DC5930045D19A /* ResumeNoWaitHover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeNoWaitHover.png; path = macosx/Images/ResumeNoWaitHover.png; sourceTree = ""; }; - A2623B3C0D3DC5930045D19A /* RevealHover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = RevealHover.png; path = macosx/Images/RevealHover.png; sourceTree = ""; }; - A2623B3D0D3DC5930045D19A /* ResumeHover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeHover.png; path = macosx/Images/ResumeHover.png; sourceTree = ""; }; - A2623B3E0D3DC5930045D19A /* PauseHover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PauseHover.png; path = macosx/Images/PauseHover.png; sourceTree = ""; }; - A2623B4D0D3DC6DF0045D19A /* ActionHover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ActionHover.png; path = macosx/Images/ActionHover.png; sourceTree = ""; }; A263C5651560A35B0082A3D1 /* da */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = da; path = macosx/da.lproj/MainMenu.xib; sourceTree = ""; }; A263C5661560A3CF0082A3D1 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = macosx/da.lproj/Localizable.strings; sourceTree = ""; }; A263C5671560A4210082A3D1 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = macosx/da.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -890,7 +732,6 @@ A263C5701560A44F0082A3D1 /* da */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = da; path = macosx/da.lproj/GlobalOptionsPopover.xib; sourceTree = ""; }; A263CFBE10DD67670038DE27 /* InfoTextField.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InfoTextField.h; path = macosx/InfoTextField.h; sourceTree = ""; }; A263CFBF10DD67670038DE27 /* InfoTextField.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = InfoTextField.m; path = macosx/InfoTextField.m; sourceTree = ""; }; - A263D03D10DE6F010038DE27 /* Magnet.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Magnet.png; path = macosx/Images/Magnet.png; sourceTree = ""; }; A265A32E0D25767700198AC8 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/Creator.xib; sourceTree = ""; }; A265A3300D25767700198AC8 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/MainMenu.xib; sourceTree = ""; }; A265A3320D25767700198AC8 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/PrefsWindow.xib; sourceTree = ""; }; @@ -910,8 +751,6 @@ A26AF2190D2DA35A00FF7140 /* FileOutlineController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FileOutlineController.m; path = macosx/FileOutlineController.m; sourceTree = ""; }; A26AF2820D2DC27C00FF7140 /* AddWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AddWindowController.h; path = macosx/AddWindowController.h; sourceTree = ""; }; A26AF2830D2DC27C00FF7140 /* AddWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AddWindowController.m; path = macosx/AddWindowController.m; sourceTree = ""; }; - A26E75870CB6AA7500226674 /* InfoOptions.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = InfoOptions.png; path = macosx/Images/InfoOptions.png; sourceTree = ""; }; - A26E75950CB6AB4800226674 /* InfoGeneral.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = InfoGeneral.png; path = macosx/Images/InfoGeneral.png; sourceTree = ""; }; A2710E740A86796000CE4F7D /* PrefsWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PrefsWindow.h; path = macosx/PrefsWindow.h; sourceTree = ""; }; A2710E750A86796000CE4F7D /* PrefsWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PrefsWindow.m; path = macosx/PrefsWindow.m; sourceTree = ""; }; A2725B6C0DE5C4F5003445E7 /* FileListNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FileListNode.h; path = macosx/FileListNode.h; sourceTree = ""; }; @@ -920,8 +759,7 @@ A2725D5C0DE7507C003445E7 /* TrackerTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = TrackerTableView.m; path = macosx/TrackerTableView.m; sourceTree = ""; }; A27476FF0CC38EE6003CC76D /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = macosx/es.lproj/InfoPlist.strings; sourceTree = ""; }; A27477010CC38EE6003CC76D /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = macosx/es.lproj/Localizable.strings; sourceTree = ""; }; - A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.0.9.8.dylib; path = "third-party/openssl/lib/libcrypto.0.9.8.dylib"; sourceTree = ""; }; - A277DA090C693D9C00DA2CD4 /* ActionOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ActionOn.png; path = macosx/Images/ActionOn.png; sourceTree = ""; }; + A27653A714369C5C009D3CCF /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = "third-party/openssl/lib/libcrypto.dylib"; sourceTree = ""; }; A279E3D011C3BDC300D48B1F /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = macosx/nl.lproj/AddMagnetWindow.xib; sourceTree = ""; }; A279E3D111C3BDC300D48B1F /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = macosx/nl.lproj/InfoActivityView.xib; sourceTree = ""; }; A279E3D211C3BDC300D48B1F /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = macosx/nl.lproj/InfoGeneralView.xib; sourceTree = ""; }; @@ -961,8 +799,6 @@ A2966E8513DAF74C007B52DF /* GlobalOptionsPopoverViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GlobalOptionsPopoverViewController.h; path = macosx/GlobalOptionsPopoverViewController.h; sourceTree = ""; }; A2966E8613DAF74C007B52DF /* GlobalOptionsPopoverViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = GlobalOptionsPopoverViewController.m; path = macosx/GlobalOptionsPopoverViewController.m; sourceTree = ""; }; A296EF3411E5605E004A2781 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = usr/lib/libiconv.dylib; sourceTree = SDKROOT; }; - A29AF4F60D01BADC00D097EC /* DownArrowTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DownArrowTemplate.png; path = macosx/Images/DownArrowTemplate.png; sourceTree = ""; }; - A29AF4F80D01BAEB00D097EC /* UpArrowTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = UpArrowTemplate.png; path = macosx/Images/UpArrowTemplate.png; sourceTree = ""; }; A29C8B340ACC6EB3000ED9F9 /* PortChecker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PortChecker.h; path = macosx/PortChecker.h; sourceTree = ""; }; A29C8B350ACC6EB3000ED9F9 /* PortChecker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PortChecker.m; path = macosx/PortChecker.m; sourceTree = ""; }; A29D84021049C25600D1987A /* NSApplicationAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSApplicationAdditions.h; path = macosx/NSApplicationAdditions.h; sourceTree = ""; }; @@ -1019,17 +855,13 @@ A2B9F90411BD10BE003FC8CA /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/InfoActivityView.xib; sourceTree = ""; }; A2B9F90511BD10BE003FC8CA /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/InfoGeneralView.xib; sourceTree = ""; }; A2B9F90611BD10BE003FC8CA /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/InfoOptionsView.xib; sourceTree = ""; }; - A2BB67780D5BA74600AB0618 /* ToolbarOpenWebTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ToolbarOpenWebTemplate.png; path = macosx/Images/ToolbarOpenWebTemplate.png; sourceTree = ""; }; - A2BC19840CA9AF5A00DD302A /* CompleteCheck.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CompleteCheck.png; path = macosx/Images/CompleteCheck.png; sourceTree = ""; }; A2BE9C4E0C1E4ADA002D16E6 /* makemeta.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = makemeta.c; path = libtransmission/makemeta.c; sourceTree = ""; }; A2BE9C4F0C1E4ADA002D16E6 /* makemeta.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = makemeta.h; path = libtransmission/makemeta.h; sourceTree = ""; }; - A2C0C5020E02CB6100D95339 /* Remote.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Remote.png; path = macosx/Images/Remote.png; sourceTree = ""; }; A2C89D5F0CFCBF57004CC2BC /* ButtonToolbarItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ButtonToolbarItem.m; path = macosx/ButtonToolbarItem.m; sourceTree = ""; }; A2CA772B187F063A00154956 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = macosx/QuickLookPlugin/tr.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; A2CB38AE0E1E6896002B514C /* COPYING */ = {isa = PBXFileReference; lastKnownFileType = text; path = COPYING; sourceTree = ""; }; A2CBDED80D993E4500BB22BC /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/AddWindow.xib; sourceTree = ""; }; A2CBDF9E0D9AD08100BB22BC /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = macosx/ru.lproj/AddWindow.xib; sourceTree = ""; }; - A2D0E0480A54A97C003C72CF /* Bandwidth.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Bandwidth.png; path = macosx/Images/Bandwidth.png; sourceTree = ""; }; A2D22A100D65EED100007D5F /* verify.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = verify.c; path = libtransmission/verify.c; sourceTree = ""; }; A2D22A110D65EED100007D5F /* verify.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = verify.h; path = libtransmission/verify.h; sourceTree = ""; }; A2D3078E0D9EC45F0051FD27 /* blocklist.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = blocklist.c; path = libtransmission/blocklist.c; sourceTree = ""; }; @@ -1040,74 +872,10 @@ A2D7744F154CC25700A62B93 /* WebSeedTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WebSeedTableView.h; path = macosx/WebSeedTableView.h; sourceTree = ""; }; A2D77450154CC25700A62B93 /* WebSeedTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = WebSeedTableView.m; path = macosx/WebSeedTableView.m; sourceTree = ""; }; A2D8CFBF15FA177A0056E93D /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = macosx/QuickLookPlugin/ru.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; - A2DA36270CBC674900C2ED41 /* InfoActivity.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = InfoActivity.png; path = macosx/Images/InfoActivity.png; sourceTree = ""; }; - A2DA36280CBC674900C2ED41 /* InfoFiles.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = InfoFiles.png; path = macosx/Images/InfoFiles.png; sourceTree = ""; }; - A2DA36290CBC674900C2ED41 /* InfoPeers.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = InfoPeers.png; path = macosx/Images/InfoPeers.png; sourceTree = ""; }; - A2DC494715842ABD00758FF1 /* ActionHover@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ActionHover@2x.png"; path = "macosx/Images/ActionHover@2x.png"; sourceTree = ""; }; - A2DC494915842BE900758FF1 /* ActionOn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ActionOn@2x.png"; path = "macosx/Images/ActionOn@2x.png"; sourceTree = ""; }; - A2DC494B15842BF700758FF1 /* Bandwidth@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Bandwidth@2x.png"; path = "macosx/Images/Bandwidth@2x.png"; sourceTree = ""; }; - A2DC494D15842C1000758FF1 /* CleanupTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "CleanupTemplate@2x.png"; path = "macosx/Images/CleanupTemplate@2x.png"; sourceTree = ""; }; - A2DC494F15842C1C00758FF1 /* CompleteCheck@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "CompleteCheck@2x.png"; path = "macosx/Images/CompleteCheck@2x.png"; sourceTree = ""; }; - A2DC495115842C2700758FF1 /* CreateLarge@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "CreateLarge@2x.png"; path = "macosx/Images/CreateLarge@2x.png"; sourceTree = ""; }; - A2DC495315842C3300758FF1 /* DownArrowGroupTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "DownArrowGroupTemplate@2x.png"; path = "macosx/Images/DownArrowGroupTemplate@2x.png"; sourceTree = ""; }; - A2DC495515842C4600758FF1 /* DownArrowTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "DownArrowTemplate@2x.png"; path = "macosx/Images/DownArrowTemplate@2x.png"; sourceTree = ""; }; - A2DC495715842C7700758FF1 /* FavIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "FavIcon@2x.png"; path = "macosx/Images/FavIcon@2x.png"; sourceTree = ""; }; - A2DC495915842C9500758FF1 /* Globe@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Globe@2x.png"; path = "macosx/Images/Globe@2x.png"; sourceTree = ""; }; - A2DC495B15842CA000758FF1 /* GreenDot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "GreenDot@2x.png"; path = "macosx/Images/GreenDot@2x.png"; sourceTree = ""; }; - A2DC495D15842CB400758FF1 /* Groups@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Groups@2x.png"; path = "macosx/Images/Groups@2x.png"; sourceTree = ""; }; - A2DC495F15842CD300758FF1 /* GroupsNoneTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "GroupsNoneTemplate@2x.png"; path = "macosx/Images/GroupsNoneTemplate@2x.png"; sourceTree = ""; }; - A2DC496115842CE800758FF1 /* InfoActivity@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "InfoActivity@2x.png"; path = "macosx/Images/InfoActivity@2x.png"; sourceTree = ""; }; - A2DC496315842CF200758FF1 /* InfoFiles@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "InfoFiles@2x.png"; path = "macosx/Images/InfoFiles@2x.png"; sourceTree = ""; }; - A2DC496515842CFE00758FF1 /* InfoGeneral@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "InfoGeneral@2x.png"; path = "macosx/Images/InfoGeneral@2x.png"; sourceTree = ""; }; - A2DC496715842D1B00758FF1 /* InfoOptions@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "InfoOptions@2x.png"; path = "macosx/Images/InfoOptions@2x.png"; sourceTree = ""; }; - A2DC496915842D2C00758FF1 /* InfoPeers@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "InfoPeers@2x.png"; path = "macosx/Images/InfoPeers@2x.png"; sourceTree = ""; }; - A2DC496B15842D3E00758FF1 /* InfoTracker@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "InfoTracker@2x.png"; path = "macosx/Images/InfoTracker@2x.png"; sourceTree = ""; }; - A2DC496D15842D5200758FF1 /* Lock@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Lock@2x.png"; path = "macosx/Images/Lock@2x.png"; sourceTree = ""; }; - A2DC496F15842D5C00758FF1 /* Magnet@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Magnet@2x.png"; path = "macosx/Images/Magnet@2x.png"; sourceTree = ""; }; - A2DC497115842D8000758FF1 /* PauseHover@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PauseHover@2x.png"; path = "macosx/Images/PauseHover@2x.png"; sourceTree = ""; }; - A2DC497515842D9700758FF1 /* PauseOff@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PauseOff@2x.png"; path = "macosx/Images/PauseOff@2x.png"; sourceTree = ""; }; - A2DC497715842D9C00758FF1 /* PauseOn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PauseOn@2x.png"; path = "macosx/Images/PauseOn@2x.png"; sourceTree = ""; }; - A2DC497915842DC000758FF1 /* PinTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PinTemplate@2x.png"; path = "macosx/Images/PinTemplate@2x.png"; sourceTree = ""; }; - A2DC497B15842DDC00758FF1 /* PriorityControlLow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PriorityControlLow@2x.png"; path = "macosx/Images/PriorityControlLow@2x.png"; sourceTree = ""; }; - A2DC497C15842DDC00758FF1 /* PriorityControlNormal@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PriorityControlNormal@2x.png"; path = "macosx/Images/PriorityControlNormal@2x.png"; sourceTree = ""; }; - A2DC498115842E8A00758FF1 /* PriorityControlHigh@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PriorityControlHigh@2x.png"; path = "macosx/Images/PriorityControlHigh@2x.png"; sourceTree = ""; }; - A2DC498715842ECC00758FF1 /* PriorityHighTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PriorityHighTemplate@2x.png"; path = "macosx/Images/PriorityHighTemplate@2x.png"; sourceTree = ""; }; - A2DC498815842ECC00758FF1 /* PriorityLowTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PriorityLowTemplate@2x.png"; path = "macosx/Images/PriorityLowTemplate@2x.png"; sourceTree = ""; }; - A2DC498915842ECC00758FF1 /* PriorityNormalTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PriorityNormalTemplate@2x.png"; path = "macosx/Images/PriorityNormalTemplate@2x.png"; sourceTree = ""; }; - A2DC498D15842EEA00758FF1 /* PurpleDot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "PurpleDot@2x.png"; path = "macosx/Images/PurpleDot@2x.png"; sourceTree = ""; }; - A2DC498F15842EF000758FF1 /* RedDot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "RedDot@2x.png"; path = "macosx/Images/RedDot@2x.png"; sourceTree = ""; }; - A2DC499115842F0000758FF1 /* Remote@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Remote@2x.png"; path = "macosx/Images/Remote@2x.png"; sourceTree = ""; }; - A2DC499315842F5700758FF1 /* ResumeHover@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ResumeHover@2x.png"; path = "macosx/Images/ResumeHover@2x.png"; sourceTree = ""; }; - A2DC499415842F5800758FF1 /* ResumeNoWaitHover@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ResumeNoWaitHover@2x.png"; path = "macosx/Images/ResumeNoWaitHover@2x.png"; sourceTree = ""; }; - A2DC499515842F5800758FF1 /* ResumeNoWaitOff@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ResumeNoWaitOff@2x.png"; path = "macosx/Images/ResumeNoWaitOff@2x.png"; sourceTree = ""; }; - A2DC499615842F5800758FF1 /* ResumeNoWaitOn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ResumeNoWaitOn@2x.png"; path = "macosx/Images/ResumeNoWaitOn@2x.png"; sourceTree = ""; }; - A2DC499715842F5800758FF1 /* ResumeOff@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ResumeOff@2x.png"; path = "macosx/Images/ResumeOff@2x.png"; sourceTree = ""; }; - A2DC499815842F5800758FF1 /* ResumeOn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ResumeOn@2x.png"; path = "macosx/Images/ResumeOn@2x.png"; sourceTree = ""; }; - A2DC499F15842F9D00758FF1 /* RevealHover@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "RevealHover@2x.png"; path = "macosx/Images/RevealHover@2x.png"; sourceTree = ""; }; - A2DC49A015842F9D00758FF1 /* RevealOff@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "RevealOff@2x.png"; path = "macosx/Images/RevealOff@2x.png"; sourceTree = ""; }; - A2DC49A115842F9D00758FF1 /* RevealOn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "RevealOn@2x.png"; path = "macosx/Images/RevealOn@2x.png"; sourceTree = ""; }; - A2DC49A515842FC300758FF1 /* ToolbarCreateTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ToolbarCreateTemplate@2x.png"; path = "macosx/Images/ToolbarCreateTemplate@2x.png"; sourceTree = ""; }; - A2DC49A615842FC300758FF1 /* ToolbarFilterTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ToolbarFilterTemplate@2x.png"; path = "macosx/Images/ToolbarFilterTemplate@2x.png"; sourceTree = ""; }; - A2DC49A715842FC300758FF1 /* ToolbarInfoTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ToolbarInfoTemplate@2x.png"; path = "macosx/Images/ToolbarInfoTemplate@2x.png"; sourceTree = ""; }; - A2DC49AB15842FF200758FF1 /* ToolbarOpenTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ToolbarOpenTemplate@2x.png"; path = "macosx/Images/ToolbarOpenTemplate@2x.png"; sourceTree = ""; }; - A2DC49AC15842FF200758FF1 /* ToolbarOpenWebTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ToolbarOpenWebTemplate@2x.png"; path = "macosx/Images/ToolbarOpenWebTemplate@2x.png"; sourceTree = ""; }; - A2DC49AF1584300D00758FF1 /* ToolbarPauseAllTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ToolbarPauseAllTemplate@2x.png"; path = "macosx/Images/ToolbarPauseAllTemplate@2x.png"; sourceTree = ""; }; - A2DC49B01584300D00758FF1 /* ToolbarPauseSelectedTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ToolbarPauseSelectedTemplate@2x.png"; path = "macosx/Images/ToolbarPauseSelectedTemplate@2x.png"; sourceTree = ""; }; - A2DC49B31584303A00758FF1 /* ToolbarRemoveTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ToolbarRemoveTemplate@2x.png"; path = "macosx/Images/ToolbarRemoveTemplate@2x.png"; sourceTree = ""; }; - A2DC49B41584303A00758FF1 /* ToolbarResumeAllTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ToolbarResumeAllTemplate@2x.png"; path = "macosx/Images/ToolbarResumeAllTemplate@2x.png"; sourceTree = ""; }; - A2DC49B51584303A00758FF1 /* ToolbarResumeSelectedTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ToolbarResumeSelectedTemplate@2x.png"; path = "macosx/Images/ToolbarResumeSelectedTemplate@2x.png"; sourceTree = ""; }; - A2DC49B91584307300758FF1 /* Transfers@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Transfers@2x.png"; path = "macosx/Images/Transfers@2x.png"; sourceTree = ""; }; - A2DC49BB1584309F00758FF1 /* TurtleTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TurtleTemplate@2x.png"; path = "macosx/Images/TurtleTemplate@2x.png"; sourceTree = ""; }; - A2DC49BD158430B300758FF1 /* UpArrowGroupTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "UpArrowGroupTemplate@2x.png"; path = "macosx/Images/UpArrowGroupTemplate@2x.png"; sourceTree = ""; }; - A2DC49BE158430B300758FF1 /* UpArrowTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "UpArrowTemplate@2x.png"; path = "macosx/Images/UpArrowTemplate@2x.png"; sourceTree = ""; }; - A2DC49C1158430CA00758FF1 /* YellowDot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "YellowDot@2x.png"; path = "macosx/Images/YellowDot@2x.png"; sourceTree = ""; }; - A2DC49C3158430E200758FF1 /* YingYangGroupTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "YingYangGroupTemplate@2x.png"; path = "macosx/Images/YingYangGroupTemplate@2x.png"; sourceTree = ""; }; - A2DC49C5158430FB00758FF1 /* YingYangTemplate@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "YingYangTemplate@2x.png"; path = "macosx/Images/YingYangTemplate@2x.png"; sourceTree = ""; }; A2DF37040C220D03006523C1 /* CreatorWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CreatorWindowController.h; path = macosx/CreatorWindowController.h; sourceTree = ""; }; A2DF37050C220D03006523C1 /* CreatorWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CreatorWindowController.m; path = macosx/CreatorWindowController.m; sourceTree = ""; }; A2E23AC30CB5E1930002BB25 /* InfoTabButtonCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InfoTabButtonCell.h; path = macosx/InfoTabButtonCell.h; sourceTree = ""; }; A2E23AC40CB5E1930002BB25 /* InfoTabButtonCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = InfoTabButtonCell.m; path = macosx/InfoTabButtonCell.m; sourceTree = ""; }; - A2E2EA910EE321C200EB6308 /* Groups.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Groups.png; path = macosx/Images/Groups.png; sourceTree = ""; }; A2E384D2130DFB3A001F501B /* templates.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = templates.h; path = "third-party/libutp/templates.h"; sourceTree = ""; }; A2E384D3130DFB3A001F501B /* utp_config_example.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = utp_config_example.h; path = "third-party/libutp/utp_config_example.h"; sourceTree = ""; }; A2E384D4130DFB3A001F501B /* utp_config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = utp_config.h; path = "third-party/libutp/utp_config.h"; sourceTree = ""; }; @@ -1125,7 +893,6 @@ A2E57BA513109E6B00A7DAB1 /* FilterBarController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FilterBarController.h; path = macosx/FilterBarController.h; sourceTree = ""; }; A2E57BA613109E6B00A7DAB1 /* FilterBarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FilterBarController.m; path = macosx/FilterBarController.m; sourceTree = ""; }; A2E669780F5B8E5A00B4251A /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = ""; }; - A2E9AA750C249AF400085DCF /* ToolbarCreateTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ToolbarCreateTemplate.png; path = macosx/Images/ToolbarCreateTemplate.png; sourceTree = ""; }; A2EA522F1686AC0D00180493 /* quark.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = quark.c; path = libtransmission/quark.c; sourceTree = ""; }; A2EA52301686AC0D00180493 /* quark.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = quark.h; path = libtransmission/quark.h; sourceTree = ""; }; A2EA8E3C0CC3C9830081201C /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = macosx/fr.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -1133,12 +900,6 @@ A2ED7D8D0CEF431B00970975 /* FilterButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FilterButton.h; path = macosx/FilterButton.h; sourceTree = ""; }; A2ED7D8E0CEF431B00970975 /* FilterButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FilterButton.m; path = macosx/FilterButton.m; sourceTree = ""; }; A2EE726E14DCCC950093C99A /* natpmp_local.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = natpmp_local.h; path = libtransmission/natpmp_local.h; sourceTree = ""; }; - A2EF7DEB0C96297400FA9811 /* PurpleDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PurpleDot.png; path = macosx/Images/PurpleDot.png; sourceTree = ""; }; - A2F011980C27418800576FC0 /* CreateLarge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CreateLarge.png; path = macosx/Images/CreateLarge.png; sourceTree = ""; }; - A2F151150CD438A4001F3B0E /* YellowDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = YellowDot.png; path = macosx/Images/YellowDot.png; sourceTree = ""; }; - A2F151160CD438A4001F3B0E /* RedDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = RedDot.png; path = macosx/Images/RedDot.png; sourceTree = ""; }; - A2F151170CD438A4001F3B0E /* GreenDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = GreenDot.png; path = macosx/Images/GreenDot.png; sourceTree = ""; }; - A2F1511F0CD438BA001F3B0E /* Lock.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Lock.png; path = macosx/Images/Lock.png; sourceTree = ""; }; A2F35BB915C5A0A100EBF632 /* QuickLookPlugin.qlgenerator */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = QuickLookPlugin.qlgenerator; sourceTree = BUILT_PRODUCTS_DIR; }; A2F35BBB15C5A0A100EBF632 /* QuickLook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickLook.framework; path = System/Library/Frameworks/QuickLook.framework; sourceTree = SDKROOT; }; A2F35BBD15C5A0A100EBF632 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = System/Library/Frameworks/ApplicationServices.framework; sourceTree = SDKROOT; }; @@ -1152,38 +913,34 @@ A2F35BCF15C5A0A100EBF632 /* QuickLookPlugin-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "QuickLookPlugin-Prefix.pch"; path = "macosx/QuickLookPlugin/QuickLookPlugin-Prefix.pch"; sourceTree = SOURCE_ROOT; }; A2F35BE015C5A7ED00EBF632 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; A2F35BE215C5A7F900EBF632 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - A2F41DAA0D0B916B006CE378 /* YingYangTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = YingYangTemplate.png; path = macosx/Images/YingYangTemplate.png; sourceTree = ""; }; - A2F41F8D0D73595100B82116 /* InfoTracker.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = InfoTracker.png; path = macosx/Images/InfoTracker.png; sourceTree = ""; }; A2F7CF5413035F7B0016FF10 /* URLSheetWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = URLSheetWindow.xib; path = macosx/URLSheetWindow.xib; sourceTree = ""; }; A2F7CF5D13035FFD0016FF10 /* URLSheetWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = URLSheetWindowController.h; path = macosx/URLSheetWindowController.h; sourceTree = ""; }; A2F7CF5E13035FFD0016FF10 /* URLSheetWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = URLSheetWindowController.m; path = macosx/URLSheetWindowController.m; sourceTree = ""; }; A2F8951E0A2D4BA500ED2127 /* Credits.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = Credits.rtf; path = macosx/Credits.rtf; sourceTree = ""; }; - A2F8CD420F3D0F4A00DB356A /* miniupnpcstrings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = miniupnpcstrings.h; path = "third-party/miniupnp/miniupnpcstrings.h"; sourceTree = ""; }; + A2F8CD420F3D0F4A00DB356A /* miniupnpcstrings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = miniupnpcstrings.h; path = "third-party/miniupnpc/miniupnpcstrings.h"; sourceTree = ""; }; A2FB057C0BFEB6800095564D /* DragOverlayView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DragOverlayView.h; path = macosx/DragOverlayView.h; sourceTree = ""; }; A2FB057D0BFEB6800095564D /* DragOverlayView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DragOverlayView.m; path = macosx/DragOverlayView.m; sourceTree = ""; }; - A2FB06950BFF484A0095564D /* Globe.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Globe.png; path = macosx/Images/Globe.png; sourceTree = ""; }; A2FB07F115F8208300933543 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = macosx/QuickLookPlugin/nl.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; A2FB701A0D95CAEA0001F331 /* GroupsController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GroupsController.h; path = macosx/GroupsController.h; sourceTree = ""; }; A2FB701B0D95CAEA0001F331 /* GroupsController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = GroupsController.m; path = macosx/GroupsController.m; sourceTree = ""; }; BE1183480CE160960002D0F3 /* libminiupnp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libminiupnp.a; sourceTree = BUILT_PRODUCTS_DIR; }; - BE11834D0CE160C50002D0F3 /* bsdqueue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = bsdqueue.h; path = "third-party/miniupnp/bsdqueue.h"; sourceTree = ""; }; - BE11834E0CE160C50002D0F3 /* declspec.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = declspec.h; path = "third-party/miniupnp/declspec.h"; sourceTree = ""; }; - BE11834F0CE160C50002D0F3 /* igd_desc_parse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = igd_desc_parse.h; path = "third-party/miniupnp/igd_desc_parse.h"; sourceTree = ""; }; - BE1183500CE160C50002D0F3 /* minixml.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = minixml.h; path = "third-party/miniupnp/minixml.h"; sourceTree = ""; }; - BE1183510CE160C50002D0F3 /* miniwget.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = miniwget.h; path = "third-party/miniupnp/miniwget.h"; sourceTree = ""; }; - BE1183520CE160C50002D0F3 /* minisoap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = minisoap.h; path = "third-party/miniupnp/minisoap.h"; sourceTree = ""; }; - BE1183530CE160C50002D0F3 /* upnpreplyparse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = upnpreplyparse.h; path = "third-party/miniupnp/upnpreplyparse.h"; sourceTree = ""; }; - BE1183540CE160C50002D0F3 /* upnpcommands.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = upnpcommands.h; path = "third-party/miniupnp/upnpcommands.h"; sourceTree = ""; }; - BE1183550CE160C50002D0F3 /* miniupnpc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = miniupnpc.h; path = "third-party/miniupnp/miniupnpc.h"; sourceTree = ""; }; - BE1183560CE160C50002D0F3 /* minissdpc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = minissdpc.h; path = "third-party/miniupnp/minissdpc.h"; sourceTree = ""; }; - BE1183610CE160D50002D0F3 /* igd_desc_parse.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = igd_desc_parse.c; path = "third-party/miniupnp/igd_desc_parse.c"; sourceTree = ""; }; - BE1183620CE160D50002D0F3 /* minixml.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = minixml.c; path = "third-party/miniupnp/minixml.c"; sourceTree = ""; }; - BE1183630CE160D50002D0F3 /* miniwget.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = miniwget.c; path = "third-party/miniupnp/miniwget.c"; sourceTree = ""; }; - BE1183640CE160D50002D0F3 /* minissdpc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = minissdpc.c; path = "third-party/miniupnp/minissdpc.c"; sourceTree = ""; }; - BE1183650CE160D50002D0F3 /* minisoap.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = minisoap.c; path = "third-party/miniupnp/minisoap.c"; sourceTree = ""; }; - BE1183660CE160D50002D0F3 /* upnpreplyparse.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = upnpreplyparse.c; path = "third-party/miniupnp/upnpreplyparse.c"; sourceTree = ""; }; - BE1183670CE160D50002D0F3 /* upnpcommands.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = upnpcommands.c; path = "third-party/miniupnp/upnpcommands.c"; sourceTree = ""; }; - BE1183680CE160D50002D0F3 /* miniupnpc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = miniupnpc.c; path = "third-party/miniupnp/miniupnpc.c"; sourceTree = ""; }; + BE11834E0CE160C50002D0F3 /* declspec.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = declspec.h; path = "third-party/miniupnpc/declspec.h"; sourceTree = ""; }; + BE11834F0CE160C50002D0F3 /* igd_desc_parse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = igd_desc_parse.h; path = "third-party/miniupnpc/igd_desc_parse.h"; sourceTree = ""; }; + BE1183500CE160C50002D0F3 /* minixml.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = minixml.h; path = "third-party/miniupnpc/minixml.h"; sourceTree = ""; }; + BE1183510CE160C50002D0F3 /* miniwget.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = miniwget.h; path = "third-party/miniupnpc/miniwget.h"; sourceTree = ""; }; + BE1183520CE160C50002D0F3 /* minisoap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = minisoap.h; path = "third-party/miniupnpc/minisoap.h"; sourceTree = ""; }; + BE1183530CE160C50002D0F3 /* upnpreplyparse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = upnpreplyparse.h; path = "third-party/miniupnpc/upnpreplyparse.h"; sourceTree = ""; }; + BE1183540CE160C50002D0F3 /* upnpcommands.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = upnpcommands.h; path = "third-party/miniupnpc/upnpcommands.h"; sourceTree = ""; }; + BE1183550CE160C50002D0F3 /* miniupnpc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = miniupnpc.h; path = "third-party/miniupnpc/miniupnpc.h"; sourceTree = ""; }; + BE1183560CE160C50002D0F3 /* minissdpc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = minissdpc.h; path = "third-party/miniupnpc/minissdpc.h"; sourceTree = ""; }; + BE1183610CE160D50002D0F3 /* igd_desc_parse.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = igd_desc_parse.c; path = "third-party/miniupnpc/igd_desc_parse.c"; sourceTree = ""; }; + BE1183620CE160D50002D0F3 /* minixml.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = minixml.c; path = "third-party/miniupnpc/minixml.c"; sourceTree = ""; }; + BE1183630CE160D50002D0F3 /* miniwget.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = miniwget.c; path = "third-party/miniupnpc/miniwget.c"; sourceTree = ""; }; + BE1183640CE160D50002D0F3 /* minissdpc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = minissdpc.c; path = "third-party/miniupnpc/minissdpc.c"; sourceTree = ""; }; + BE1183650CE160D50002D0F3 /* minisoap.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = minisoap.c; path = "third-party/miniupnpc/minisoap.c"; sourceTree = ""; }; + BE1183660CE160D50002D0F3 /* upnpreplyparse.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = upnpreplyparse.c; path = "third-party/miniupnpc/upnpreplyparse.c"; sourceTree = ""; }; + BE1183670CE160D50002D0F3 /* upnpcommands.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = upnpcommands.c; path = "third-party/miniupnpc/upnpcommands.c"; sourceTree = ""; }; + BE1183680CE160D50002D0F3 /* miniupnpc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = miniupnpc.c; path = "third-party/miniupnpc/miniupnpc.c"; sourceTree = ""; }; BE75C3490C729E9500DBEFE0 /* libevent.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libevent.a; sourceTree = BUILT_PRODUCTS_DIR; }; BEFC1C000C07750000B0BB3C /* transmission-daemon */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "transmission-daemon"; sourceTree = BUILT_PRODUCTS_DIR; }; BEFC1C0E0C07756200B0BB3C /* daemon.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = daemon.c; path = daemon/daemon.c; sourceTree = ""; }; @@ -1223,12 +980,17 @@ C1077A4B183EB29600634C22 /* error.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = error.h; path = libtransmission/error.h; sourceTree = ""; }; C1077A4C183EB29600634C22 /* file-posix.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "file-posix.c"; path = "libtransmission/file-posix.c"; sourceTree = ""; }; C1077A4D183EB29600634C22 /* file.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = file.h; path = libtransmission/file.h; sourceTree = ""; }; + C10C644B1D9AF328003C1B4C /* session-id.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "session-id.c"; path = "libtransmission/session-id.c"; sourceTree = ""; }; + C10C644C1D9AF328003C1B4C /* session-id.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "session-id.h"; path = "libtransmission/session-id.h"; sourceTree = ""; }; + C12F19761E1AE3C30005E93F /* upnpc.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = upnpc.c; path = "third-party/miniupnpc/upnpc.c"; sourceTree = ""; }; + C12F19771E1AE3C30005E93F /* upnperrors.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = upnperrors.c; path = "third-party/miniupnpc/upnperrors.c"; sourceTree = ""; }; + C12F197A1E1AE4460005E93F /* upnperrors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = upnperrors.h; path = "third-party/miniupnpc/upnperrors.h"; sourceTree = ""; }; C1305EB8186A134000F03351 /* file.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = file.c; path = libtransmission/file.c; sourceTree = ""; }; C1639A6F1A55F4D600E42033 /* libb64.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libb64.a; sourceTree = BUILT_PRODUCTS_DIR; }; - C1639A761A55F56600E42033 /* cdecode.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = cdecode.c; path = "third-party/libb64/cdecode.c"; sourceTree = ""; }; - C1639A771A55F56600E42033 /* cencode.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = cencode.c; path = "third-party/libb64/cencode.c"; sourceTree = ""; }; - C1639A7A1A55F57200E42033 /* cdecode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = cdecode.h; path = "third-party/libb64/b64/cdecode.h"; sourceTree = ""; }; - C1639A7B1A55F57200E42033 /* cencode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = cencode.h; path = "third-party/libb64/b64/cencode.h"; sourceTree = ""; }; + C1639A761A55F56600E42033 /* cdecode.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = cdecode.c; path = "third-party/libb64/src/cdecode.c"; sourceTree = ""; }; + C1639A771A55F56600E42033 /* cencode.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = cencode.c; path = "third-party/libb64/src/cencode.c"; sourceTree = ""; }; + C1639A7A1A55F57200E42033 /* cdecode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = cdecode.h; path = "third-party/libb64/include/b64/cdecode.h"; sourceTree = ""; }; + C1639A7B1A55F57200E42033 /* cencode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = cencode.h; path = "third-party/libb64/include/b64/cencode.h"; sourceTree = ""; }; C1F690FC1AD0627500D95CF0 /* daemon-posix.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "daemon-posix.c"; path = "daemon/daemon-posix.c"; sourceTree = ""; }; C1F690FE1AD0628400D95CF0 /* daemon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = daemon.h; path = daemon/daemon.h; sourceTree = ""; }; C1FEE5721C3223CC00D62832 /* watchdir-common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "watchdir-common.h"; path = "libtransmission/watchdir-common.h"; sourceTree = ""; }; @@ -1240,6 +1002,7 @@ D4AF3B2E0C41F7A500D46B6B /* list.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = list.h; path = libtransmission/list.h; sourceTree = ""; }; E138A9750C04D88F00C5426C /* ProgressGradients.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ProgressGradients.h; path = macosx/ProgressGradients.h; sourceTree = ""; }; E138A9760C04D88F00C5426C /* ProgressGradients.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ProgressGradients.m; path = macosx/ProgressGradients.m; sourceTree = ""; }; + F63480621E1D7274005B9E09 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = macosx/Images/Images.xcassets; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1256,7 +1019,7 @@ files = ( 4D9A2BF009E16D21002D0FF9 /* libtransmission.a in Frameworks */, A296EF3C11E560BD004A2781 /* libiconv.dylib in Frameworks */, - A2290D1E14421CC100B95A09 /* libcrypto.0.9.8.dylib in Frameworks */, + A2290D1E14421CC100B95A09 /* libcrypto.dylib in Frameworks */, A2290D2F1442B23200B95A09 /* libcurl.4.dylib in Frameworks */, A2B6141E1395B0EC000E0975 /* libz.dylib in Frameworks */, A2B3FB4C0E59023000FF78FB /* Cocoa.framework in Frameworks */, @@ -1273,7 +1036,7 @@ A24F19080A3A790800C9C145 /* Sparkle.framework in Frameworks */, A261F1DC0A69A1610002815A /* Growl.framework in Frameworks */, A296EF3B11E560A7004A2781 /* libiconv.dylib in Frameworks */, - A2290D2514421D1A00B95A09 /* libcrypto.0.9.8.dylib in Frameworks */, + A2290D2514421D1A00B95A09 /* libcrypto.dylib in Frameworks */, A2290D2E1442B23200B95A09 /* libcurl.4.dylib in Frameworks */, A2B6141F1395B0F5000E0975 /* libz.dylib in Frameworks */, A2E669790F5B8E5A00B4251A /* Security.framework in Frameworks */, @@ -1307,7 +1070,7 @@ A2F35BD415C5A19A00EBF632 /* libtransmission.a in Frameworks */, A2F35BDB15C5A4A000EBF632 /* libiconv.dylib in Frameworks */, A2F35BDA15C5A49200EBF632 /* libz.dylib in Frameworks */, - A2F35BD715C5A46D00EBF632 /* libcrypto.0.9.8.dylib in Frameworks */, + A2F35BD715C5A46D00EBF632 /* libcrypto.dylib in Frameworks */, A2AB76EA15D8130B009EFC95 /* libcurl.4.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1345,7 +1108,7 @@ files = ( BEFC1C050C07753500B0BB3C /* libtransmission.a in Frameworks */, A296EF3D11E560C3004A2781 /* libiconv.dylib in Frameworks */, - A2290D2014421CD000B95A09 /* libcrypto.0.9.8.dylib in Frameworks */, + A2290D2014421CD000B95A09 /* libcrypto.dylib in Frameworks */, A2290D301442B23200B95A09 /* libcurl.4.dylib in Frameworks */, A2B6141D1395B0E3000E0975 /* libz.dylib in Frameworks */, A2B3FB530E59027100FF78FB /* Cocoa.framework in Frameworks */, @@ -1358,7 +1121,7 @@ files = ( BEFC1D2D0C0783D900B0BB3C /* libtransmission.a in Frameworks */, A296EF3E11E560D1004A2781 /* libiconv.dylib in Frameworks */, - A2290D2214421CD800B95A09 /* libcrypto.0.9.8.dylib in Frameworks */, + A2290D2214421CD800B95A09 /* libcrypto.dylib in Frameworks */, A2290D311442B23200B95A09 /* libcurl.4.dylib in Frameworks */, A2B6141C1395ADE9000E0975 /* libz.dylib in Frameworks */, A25E03D90E4015100086C225 /* Cocoa.framework in Frameworks */, @@ -1505,6 +1268,7 @@ ); name = Transmission; sourceTree = ""; + usesTabs = 0; }; 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; @@ -1540,131 +1304,9 @@ A209EC11114301C6002B02D1 /* InfoOptionsView.xib */, A220AF7913D7CC460035C512 /* GlobalOptionsPopover.xib */, A2451E6816ACE4EB00586E0E /* FileRenameSheetController.xib */, - A20B6FAD0C4D9B040034AB1D /* PriorityNormalTemplate.png */, - A2DC498915842ECC00758FF1 /* PriorityNormalTemplate@2x.png */, - A20B6F6A0C4D842B0034AB1D /* PriorityLowTemplate.png */, - A2DC498815842ECC00758FF1 /* PriorityLowTemplate@2x.png */, - A20B6F820C4D8A610034AB1D /* PriorityHighTemplate.png */, - A2DC498715842ECC00758FF1 /* PriorityHighTemplate@2x.png */, - A2623B2C0D3DC2EF0045D19A /* PriorityControlNormal.png */, - A2DC497C15842DDC00758FF1 /* PriorityControlNormal@2x.png */, - A2623B2D0D3DC2EF0045D19A /* PriorityControlLow.png */, - A2DC497B15842DDC00758FF1 /* PriorityControlLow@2x.png */, - A2623B2E0D3DC2EF0045D19A /* PriorityControlHigh.png */, - A2DC498115842E8A00758FF1 /* PriorityControlHigh@2x.png */, - A2FB06950BFF484A0095564D /* Globe.png */, - A2DC495915842C9500758FF1 /* Globe@2x.png */, - A263D03D10DE6F010038DE27 /* Magnet.png */, - A2DC496F15842D5C00758FF1 /* Magnet@2x.png */, - A2F1511F0CD438BA001F3B0E /* Lock.png */, - A2DC496D15842D5200758FF1 /* Lock@2x.png */, - A245030B0D6A1FB000B49D00 /* UpArrowGroupTemplate.png */, - A2DC49BD158430B300758FF1 /* UpArrowGroupTemplate@2x.png */, - A245030D0D6A1FBC00B49D00 /* DownArrowGroupTemplate.png */, - A2DC495315842C3300758FF1 /* DownArrowGroupTemplate@2x.png */, - A2012AE10D77151D0056FD71 /* YingYangGroupTemplate.png */, - A2DC49C3158430E200758FF1 /* YingYangGroupTemplate@2x.png */, - A29AF4F80D01BAEB00D097EC /* UpArrowTemplate.png */, - A2DC49BE158430B300758FF1 /* UpArrowTemplate@2x.png */, - A29AF4F60D01BADC00D097EC /* DownArrowTemplate.png */, - A2DC495515842C4600758FF1 /* DownArrowTemplate@2x.png */, - A2F41DAA0D0B916B006CE378 /* YingYangTemplate.png */, - A2DC49C5158430FB00758FF1 /* YingYangTemplate@2x.png */, - A20152630D1C1BE70081714F /* PinTemplate.png */, - A2DC497915842DC000758FF1 /* PinTemplate@2x.png */, - A2F151150CD438A4001F3B0E /* YellowDot.png */, - A2DC49C1158430CA00758FF1 /* YellowDot@2x.png */, - A2F151160CD438A4001F3B0E /* RedDot.png */, - A2DC498F15842EF000758FF1 /* RedDot@2x.png */, - A2F151170CD438A4001F3B0E /* GreenDot.png */, - A2DC495B15842CA000758FF1 /* GreenDot@2x.png */, - A2EF7DEB0C96297400FA9811 /* PurpleDot.png */, - A2DC498D15842EEA00758FF1 /* PurpleDot@2x.png */, - A2BC19840CA9AF5A00DD302A /* CompleteCheck.png */, - A2DC494F15842C1C00758FF1 /* CompleteCheck@2x.png */, - A21DFF0F0A292B2B007C5F76 /* Transfers.png */, - A2DC49B91584307300758FF1 /* Transfers@2x.png */, - A2E2EA910EE321C200EB6308 /* Groups.png */, - A2DC495D15842CB400758FF1 /* Groups@2x.png */, - A2D0E0480A54A97C003C72CF /* Bandwidth.png */, - A2DC494B15842BF700758FF1 /* Bandwidth@2x.png */, - A2C0C5020E02CB6100D95339 /* Remote.png */, - A2DC499115842F0000758FF1 /* Remote@2x.png */, + F63480621E1D7274005B9E09 /* Images.xcassets */, 4D2784360905709500687951 /* Transmission.icns */, 4D043A7E090AE979009FEDA8 /* TransmissionDocument.icns */, - A26146E00DD4A0160060F033 /* GroupsNoneTemplate.png */, - A2DC495F15842CD300758FF1 /* GroupsNoneTemplate@2x.png */, - A2F011980C27418800576FC0 /* CreateLarge.png */, - A2DC495115842C2700758FF1 /* CreateLarge@2x.png */, - A22D3AA30D00D1790079CFED /* TurtleTemplate.png */, - A2DC49BB1584309F00758FF1 /* TurtleTemplate@2x.png */, - A23D5DA61320570800E422BA /* CleanupTemplate.png */, - A2DC494D15842C1000758FF1 /* CleanupTemplate@2x.png */, - A277DA090C693D9C00DA2CD4 /* ActionOn.png */, - A2DC494915842BE900758FF1 /* ActionOn@2x.png */, - A2623B4D0D3DC6DF0045D19A /* ActionHover.png */, - A2DC494715842ABD00758FF1 /* ActionHover@2x.png */, - 35B037F90AC5B53800A10FDF /* ResumeNoWaitOn.png */, - A2DC499615842F5800758FF1 /* ResumeNoWaitOn@2x.png */, - 35B037FA0AC5B53800A10FDF /* ResumeNoWaitOff.png */, - A2DC499515842F5800758FF1 /* ResumeNoWaitOff@2x.png */, - A2623B3B0D3DC5930045D19A /* ResumeNoWaitHover.png */, - A2DC499415842F5800758FF1 /* ResumeNoWaitHover@2x.png */, - 4D6DAAC4090CE00500F43C22 /* RevealOff.png */, - A2DC49A015842F9D00758FF1 /* RevealOff@2x.png */, - 4D6DAAC5090CE00500F43C22 /* RevealOn.png */, - A2DC49A115842F9D00758FF1 /* RevealOn@2x.png */, - A2623B3C0D3DC5930045D19A /* RevealHover.png */, - A2DC499F15842F9D00758FF1 /* RevealHover@2x.png */, - 4DA6FDB80911233800450CB1 /* PauseOn.png */, - A2DC497715842D9C00758FF1 /* PauseOn@2x.png */, - A2623B3E0D3DC5930045D19A /* PauseHover.png */, - A2DC497115842D8000758FF1 /* PauseHover@2x.png */, - 4DA6FDB90911233800450CB1 /* PauseOff.png */, - A2DC497515842D9700758FF1 /* PauseOff@2x.png */, - 4DA6FDC3091141AD00450CB1 /* ResumeOff.png */, - A2DC499715842F5800758FF1 /* ResumeOff@2x.png */, - 4DA6FDC4091141AD00450CB1 /* ResumeOn.png */, - A2DC499815842F5800758FF1 /* ResumeOn@2x.png */, - A2623B3D0D3DC5930045D19A /* ResumeHover.png */, - A2DC499315842F5700758FF1 /* ResumeHover@2x.png */, - A25963E01068376200453B31 /* FavIcon.png */, - A2DC495715842C7700758FF1 /* FavIcon@2x.png */, - 4DDFDD20099A5D8E00189D81 /* DownloadBadge.png */, - 4DDFDD21099A5D8E00189D81 /* UploadBadge.png */, - A24B655F0D3F30870079EA4D /* QuitBadge.png */, - A232D29D0A70903E00973B12 /* ToolbarFilterTemplate.png */, - A2DC49A615842FC300758FF1 /* ToolbarFilterTemplate@2x.png */, - 4DF7500808A103AD007B0D70 /* ToolbarInfoTemplate.png */, - A2DC49A715842FC300758FF1 /* ToolbarInfoTemplate@2x.png */, - 4DF7500708A103AD007B0D70 /* ToolbarOpenTemplate.png */, - A2DC49AB15842FF200758FF1 /* ToolbarOpenTemplate@2x.png */, - A2BB67780D5BA74600AB0618 /* ToolbarOpenWebTemplate.png */, - A2DC49AC15842FF200758FF1 /* ToolbarOpenWebTemplate@2x.png */, - 4DF7500908A103AD007B0D70 /* ToolbarRemoveTemplate.png */, - A2DC49B31584303A00758FF1 /* ToolbarRemoveTemplate@2x.png */, - A2E9AA750C249AF400085DCF /* ToolbarCreateTemplate.png */, - A2DC49A515842FC300758FF1 /* ToolbarCreateTemplate@2x.png */, - 4DE5CCB80981D27700BE280E /* ToolbarResumeAllTemplate.png */, - A2DC49B41584303A00758FF1 /* ToolbarResumeAllTemplate@2x.png */, - A25FCDDE0A37695F002BCBBE /* ToolbarResumeSelectedTemplate.png */, - A2DC49B51584303A00758FF1 /* ToolbarResumeSelectedTemplate@2x.png */, - 4DE5CCB90981D27700BE280E /* ToolbarPauseAllTemplate.png */, - A2DC49AF1584300D00758FF1 /* ToolbarPauseAllTemplate@2x.png */, - A25FCDDD0A37695F002BCBBE /* ToolbarPauseSelectedTemplate.png */, - A2DC49B01584300D00758FF1 /* ToolbarPauseSelectedTemplate@2x.png */, - A26E75950CB6AB4800226674 /* InfoGeneral.png */, - A2DC496515842CFE00758FF1 /* InfoGeneral@2x.png */, - A26E75870CB6AA7500226674 /* InfoOptions.png */, - A2DC496715842D1B00758FF1 /* InfoOptions@2x.png */, - A2DA36270CBC674900C2ED41 /* InfoActivity.png */, - A2DC496115842CE800758FF1 /* InfoActivity@2x.png */, - A2DA36280CBC674900C2ED41 /* InfoFiles.png */, - A2DC496315842CF200758FF1 /* InfoFiles@2x.png */, - A2DA36290CBC674900C2ED41 /* InfoPeers.png */, - A2DC496915842D2C00758FF1 /* InfoPeers@2x.png */, - A2F41F8D0D73595100B82116 /* InfoTracker.png */, - A2DC496B15842D3E00758FF1 /* InfoTracker@2x.png */, ); name = Resources; sourceTree = ""; @@ -1759,6 +1401,8 @@ BEFC1DF50C07861A00B0BB3C /* transmission.h */, BEFC1DF60C07861A00B0BB3C /* session.c */, BEFC1E140C07861A00B0BB3C /* session.h */, + C10C644B1D9AF328003C1B4C /* session-id.c */, + C10C644C1D9AF328003C1B4C /* session-id.h */, A20152790D1C26EB0081714F /* torrent-ctor.c */, A23F299F132A447400E9A83B /* announcer-common.h */, A25964A4106D73A800453B31 /* announcer.c */, @@ -1838,7 +1482,7 @@ 4DDBB71509E16B3F00284745 /* Libraries */ = { isa = PBXGroup; children = ( - A27653A714369C5C009D3CCF /* libcrypto.0.9.8.dylib */, + A27653A714369C5C009D3CCF /* libcrypto.dylib */, A2290D2D1442B23200B95A09 /* libcurl.4.dylib */, A296EF3411E5605E004A2781 /* libiconv.dylib */, A2B6141B1395ADE9000E0975 /* libz.dylib */, @@ -1969,7 +1613,8 @@ BE1183680CE160D50002D0F3 /* miniupnpc.c */, A20162CB13DE497000E15488 /* portlistingparse.c */, A20162C713DE48BF00E15488 /* receivedata.c */, - BE11834D0CE160C50002D0F3 /* bsdqueue.h */, + C12F19761E1AE3C30005E93F /* upnpc.c */, + C12F19771E1AE3C30005E93F /* upnperrors.c */, A22B00AF116A9E90003315FC /* connecthostport.h */, BE11834E0CE160C50002D0F3 /* declspec.h */, BE11834F0CE160C50002D0F3 /* igd_desc_parse.h */, @@ -1985,6 +1630,7 @@ A25485390EB66CBB004539DA /* codelength.h */, A20162CC13DE497000E15488 /* portlistingparse.h */, A20162C813DE48BF00E15488 /* receivedata.h */, + C12F197A1E1AE4460005E93F /* upnperrors.h */, ); name = libminiupnp; sourceTree = ""; @@ -2140,6 +1786,7 @@ D4AF3B300C41F7A600D46B6B /* list.h in Headers */, A24621410C769D0900088E81 /* trevent.h in Headers */, 4D36BA700CA2F00800A63CA5 /* crypto.h in Headers */, + C10C644E1D9AF328003C1B4C /* session-id.h in Headers */, 4D36BA730CA2F00800A63CA5 /* handshake.h in Headers */, 4D36BA750CA2F00800A63CA5 /* peer-io.h in Headers */, 4D36BA780CA2F00800A63CA5 /* peer-mgr.h in Headers */, @@ -2205,12 +1852,12 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - BE1183570CE160C50002D0F3 /* bsdqueue.h in Headers */, BE1183580CE160C50002D0F3 /* declspec.h in Headers */, BE1183590CE160C50002D0F3 /* igd_desc_parse.h in Headers */, BE11835A0CE160C50002D0F3 /* minixml.h in Headers */, BE11835B0CE160C50002D0F3 /* miniwget.h in Headers */, BE11835C0CE160C50002D0F3 /* minisoap.h in Headers */, + C12F197B1E1AE4460005E93F /* upnperrors.h in Headers */, BE11835D0CE160C50002D0F3 /* upnpreplyparse.h in Headers */, BE11835E0CE160C50002D0F3 /* upnpcommands.h in Headers */, BE11835F0CE160C50002D0F3 /* miniupnpc.h in Headers */, @@ -2327,6 +1974,7 @@ isa = PBXNativeTarget; buildConfigurationList = A22CFCC40FC24F8A0009BD3E /* Build configuration list for PBXNativeTarget "dht" */; buildPhases = ( + C12F197E1E1AE6D50005E93F /* ShellScript */, A22CFCB60FC24F710009BD3E /* Headers */, A22CFCB70FC24F710009BD3E /* Sources */, A22CFCB80FC24F710009BD3E /* Frameworks */, @@ -2344,6 +1992,7 @@ isa = PBXNativeTarget; buildConfigurationList = A2E384E2130DFB3A001F501B /* Build configuration list for PBXNativeTarget "utp" */; buildPhases = ( + C12F197D1E1AE6830005E93F /* ShellScript */, A2E384CA130DFB1D001F501B /* Headers */, A2E384CB130DFB1D001F501B /* Sources */, A2E384CC130DFB1D001F501B /* Frameworks */, @@ -2380,6 +2029,7 @@ buildConfigurationList = BE11834C0CE160A80002D0F3 /* Build configuration list for PBXNativeTarget "miniupnp" */; buildPhases = ( A2305097100C0293003FDB0C /* ShellScript */, + C12F197C1E1AE55A0005E93F /* ShellScript */, BE1183440CE160960002D0F3 /* Headers */, BE1183450CE160960002D0F3 /* Sources */, BE1183460CE160960002D0F3 /* Frameworks */, @@ -2478,7 +2128,7 @@ }; }; buildConfigurationList = 4DF0C59A089918A300DD8943 /* Build configuration list for PBXProject "Transmission" */; - compatibilityVersion = "Xcode 3.2"; + compatibilityVersion = "Xcode 8.0"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -2519,86 +2169,24 @@ buildActionMask = 2147483647; files = ( 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - 4DF7500C08A103AD007B0D70 /* ToolbarOpenTemplate.png in Resources */, - 4DF7500D08A103AD007B0D70 /* ToolbarInfoTemplate.png in Resources */, - 4DF7500E08A103AD007B0D70 /* ToolbarRemoveTemplate.png in Resources */, 4D043A7F090AE979009FEDA8 /* TransmissionDocument.icns in Resources */, - 4D6DAAC6090CE00500F43C22 /* RevealOff.png in Resources */, - 4D6DAAC7090CE00500F43C22 /* RevealOn.png in Resources */, - 4DA6FDBA0911233800450CB1 /* PauseOn.png in Resources */, - 4DA6FDBB0911233800450CB1 /* PauseOff.png in Resources */, - 4DA6FDC5091141AD00450CB1 /* ResumeOff.png in Resources */, - 4DA6FDC6091141AD00450CB1 /* ResumeOn.png in Resources */, - 4DE5CCBA0981D27700BE280E /* ToolbarResumeAllTemplate.png in Resources */, - 4DE5CCBB0981D27700BE280E /* ToolbarPauseAllTemplate.png in Resources */, 4DE5CCCB0981D9BE00BE280E /* Defaults.plist in Resources */, - 4DDFDD22099A5D8E00189D81 /* DownloadBadge.png in Resources */, - 4DDFDD23099A5D8E00189D81 /* UploadBadge.png in Resources */, - A21DFF100A292B2B007C5F76 /* Transfers.png in Resources */, A29B0C270BD15FEF0006F230 /* Credits.rtf in Resources */, A2F40AE40A361C00006B8288 /* Transmission.icns in Resources */, - A25FCDEF0A3769A6002BCBBE /* ToolbarPauseSelectedTemplate.png in Resources */, - A25FCDF00A3769AC002BCBBE /* ToolbarResumeSelectedTemplate.png in Resources */, - A2D0E0490A54A97C003C72CF /* Bandwidth.png in Resources */, - A232D29E0A70903E00973B12 /* ToolbarFilterTemplate.png in Resources */, A259317E0A73B2CC002F4FE7 /* TransmissionHelp in Resources */, - 35B038130AC5B6EB00A10FDF /* ResumeNoWaitOn.png in Resources */, - 35B038140AC5B6EC00A10FDF /* ResumeNoWaitOff.png in Resources */, A22A8D560AEEAFA5007E9CB9 /* Localizable.strings in Resources */, - A241528B0C0261B8007DD3B4 /* Globe.png in Resources */, - A2E9AA760C249AF400085DCF /* ToolbarCreateTemplate.png in Resources */, - A2F011990C27418800576FC0 /* CreateLarge.png in Resources */, - A20B6F6B0C4D842B0034AB1D /* PriorityLowTemplate.png in Resources */, - A20B6F830C4D8A610034AB1D /* PriorityHighTemplate.png in Resources */, - A20B6FAE0C4D9B040034AB1D /* PriorityNormalTemplate.png in Resources */, - A277DA0B0C693D9C00DA2CD4 /* ActionOn.png in Resources */, - A2EF7DEC0C96297400FA9811 /* PurpleDot.png in Resources */, - A2BC19850CA9AF5A00DD302A /* CompleteCheck.png in Resources */, - A26E75880CB6AA7500226674 /* InfoOptions.png in Resources */, - A26E75960CB6AB4800226674 /* InfoGeneral.png in Resources */, - A2DA362A0CBC674900C2ED41 /* InfoActivity.png in Resources */, - A2DA362B0CBC674900C2ED41 /* InfoFiles.png in Resources */, - A2DA362C0CBC674900C2ED41 /* InfoPeers.png in Resources */, - A2F151180CD438A4001F3B0E /* YellowDot.png in Resources */, - A2F151190CD438A4001F3B0E /* RedDot.png in Resources */, - A2F1511A0CD438A4001F3B0E /* GreenDot.png in Resources */, - A2F151200CD438BA001F3B0E /* Lock.png in Resources */, - A22D3AA60D00D1790079CFED /* TurtleTemplate.png in Resources */, - A29AF4F70D01BADC00D097EC /* DownArrowTemplate.png in Resources */, - A29AF4F90D01BAEB00D097EC /* UpArrowTemplate.png in Resources */, - A2F41DAB0D0B916B006CE378 /* YingYangTemplate.png in Resources */, A231274C0D11D0B7003F9AFF /* AboutWindow.xib in Resources */, A29576030D11D63C0093B167 /* Creator.xib in Resources */, - A20152640D1C1BE70081714F /* PinTemplate.png in Resources */, A23F4FF20D1D98AD002FCB97 /* PrefsWindow.xib in Resources */, A23F50020D1D99D7002FCB97 /* MainMenu.xib in Resources */, A26AF27E0D2DBDDF00FF7140 /* AddWindow.xib in Resources */, - A2623B2F0D3DC2EF0045D19A /* PriorityControlNormal.png in Resources */, - A2623B300D3DC2EF0045D19A /* PriorityControlLow.png in Resources */, - A2623B310D3DC2EF0045D19A /* PriorityControlHigh.png in Resources */, - A2623B3F0D3DC5930045D19A /* ResumeNoWaitHover.png in Resources */, - A2623B400D3DC5930045D19A /* RevealHover.png in Resources */, - A2623B410D3DC5930045D19A /* ResumeHover.png in Resources */, - A2623B420D3DC5930045D19A /* PauseHover.png in Resources */, - A2623B4E0D3DC6DF0045D19A /* ActionHover.png in Resources */, - A24B65600D3F30870079EA4D /* QuitBadge.png in Resources */, - A2BB67790D5BA74600AB0618 /* ToolbarOpenWebTemplate.png in Resources */, - A245030C0D6A1FB000B49D00 /* UpArrowGroupTemplate.png in Resources */, - A245030E0D6A1FBC00B49D00 /* DownArrowGroupTemplate.png in Resources */, - A2F41F8E0D73595100B82116 /* InfoTracker.png in Resources */, - A2012AE20D77151D0056FD71 /* YingYangGroupTemplate.png in Resources */, A233BD330D8C6585007EE7B4 /* MessageWindow.xib in Resources */, A233BD690D8CF2C7007EE7B4 /* StatsWindow.xib in Resources */, A2D307B10D9EC9F50051FD27 /* BlocklistStatusWindow.xib in Resources */, - A26146E10DD4A0160060F033 /* GroupsNoneTemplate.png in Resources */, - A2C0C5030E02CB6100D95339 /* Remote.png in Resources */, A2CB38AF0E1E6896002B514C /* COPYING in Resources */, A250EEB60E2ED87B00A688E6 /* web in Resources */, A22F1E550E7DA8030065DB9D /* sparkle_dsa_pub.pem in Resources */, - A2E2EA920EE321C200EB6308 /* Groups.png in Resources */, A215BF5C0F02EBB800350CDB /* GroupRules.xib in Resources */, - A25963E11068376200453B31 /* FavIcon.png in Resources */, - A263D03E10DE6F010038DE27 /* Magnet.png in Resources */, A209EAEC1142D294002B02D1 /* InfoActivityView.xib in Resources */, A209EAED1142D294002B02D1 /* InfoGeneralView.xib in Resources */, A209EB201142DD85002B02D1 /* InfoTrackersView.xib in Resources */, @@ -2610,69 +2198,8 @@ A2F7CF5513035F7B0016FF10 /* URLSheetWindow.xib in Resources */, A2E57AC61310831400A7DAB1 /* StatusBar.xib in Resources */, A2E57B9C13109DC200A7DAB1 /* FilterBar.xib in Resources */, - A23D5DA71320570800E422BA /* CleanupTemplate.png in Resources */, A220AF7B13D7CC460035C512 /* GlobalOptionsPopover.xib in Resources */, - A2DC494815842ABE00758FF1 /* ActionHover@2x.png in Resources */, - A2DC494A15842BE900758FF1 /* ActionOn@2x.png in Resources */, - A2DC494C15842BF700758FF1 /* Bandwidth@2x.png in Resources */, - A2DC494E15842C1000758FF1 /* CleanupTemplate@2x.png in Resources */, - A2DC495015842C1C00758FF1 /* CompleteCheck@2x.png in Resources */, - A2DC495215842C2700758FF1 /* CreateLarge@2x.png in Resources */, - A2DC495415842C3300758FF1 /* DownArrowGroupTemplate@2x.png in Resources */, - A2DC495615842C4600758FF1 /* DownArrowTemplate@2x.png in Resources */, - A2DC495815842C7700758FF1 /* FavIcon@2x.png in Resources */, - A2DC495A15842C9500758FF1 /* Globe@2x.png in Resources */, - A2DC495C15842CA000758FF1 /* GreenDot@2x.png in Resources */, - A2DC495E15842CB400758FF1 /* Groups@2x.png in Resources */, - A2DC496015842CD300758FF1 /* GroupsNoneTemplate@2x.png in Resources */, - A2DC496215842CE800758FF1 /* InfoActivity@2x.png in Resources */, - A2DC496415842CF200758FF1 /* InfoFiles@2x.png in Resources */, - A2DC496615842CFE00758FF1 /* InfoGeneral@2x.png in Resources */, - A2DC496815842D1B00758FF1 /* InfoOptions@2x.png in Resources */, - A2DC496A15842D2C00758FF1 /* InfoPeers@2x.png in Resources */, - A2DC496C15842D3F00758FF1 /* InfoTracker@2x.png in Resources */, - A2DC496E15842D5200758FF1 /* Lock@2x.png in Resources */, - A2DC497015842D5C00758FF1 /* Magnet@2x.png in Resources */, - A2DC497215842D8000758FF1 /* PauseHover@2x.png in Resources */, - C15320211C82602500CC21E2 /* Info.plist in Resources */, - A2DC497615842D9700758FF1 /* PauseOff@2x.png in Resources */, - A2DC497815842D9C00758FF1 /* PauseOn@2x.png in Resources */, - A2DC497A15842DC100758FF1 /* PinTemplate@2x.png in Resources */, - A2DC497E15842DDC00758FF1 /* PriorityControlLow@2x.png in Resources */, - A2DC497F15842DDC00758FF1 /* PriorityControlNormal@2x.png in Resources */, - A2DC498415842E8A00758FF1 /* PriorityControlHigh@2x.png in Resources */, - A2DC498A15842ECC00758FF1 /* PriorityHighTemplate@2x.png in Resources */, - A2DC498B15842ECC00758FF1 /* PriorityLowTemplate@2x.png in Resources */, - A2DC498C15842ECC00758FF1 /* PriorityNormalTemplate@2x.png in Resources */, - A2DC498E15842EEA00758FF1 /* PurpleDot@2x.png in Resources */, - A2DC499015842EF000758FF1 /* RedDot@2x.png in Resources */, - A2DC499215842F0000758FF1 /* Remote@2x.png in Resources */, - A2DC499915842F5800758FF1 /* ResumeHover@2x.png in Resources */, - A2DC499A15842F5800758FF1 /* ResumeNoWaitHover@2x.png in Resources */, - A2DC499B15842F5800758FF1 /* ResumeNoWaitOff@2x.png in Resources */, - A2DC499C15842F5800758FF1 /* ResumeNoWaitOn@2x.png in Resources */, - A2DC499D15842F5800758FF1 /* ResumeOff@2x.png in Resources */, - A2DC499E15842F5800758FF1 /* ResumeOn@2x.png in Resources */, - A2DC49A215842F9E00758FF1 /* RevealHover@2x.png in Resources */, - A2DC49A315842F9E00758FF1 /* RevealOff@2x.png in Resources */, - A2DC49A415842F9E00758FF1 /* RevealOn@2x.png in Resources */, - A2DC49A815842FC300758FF1 /* ToolbarCreateTemplate@2x.png in Resources */, - A2DC49A915842FC300758FF1 /* ToolbarFilterTemplate@2x.png in Resources */, - A2DC49AA15842FC300758FF1 /* ToolbarInfoTemplate@2x.png in Resources */, - A2DC49AD15842FF200758FF1 /* ToolbarOpenTemplate@2x.png in Resources */, - A2DC49AE15842FF200758FF1 /* ToolbarOpenWebTemplate@2x.png in Resources */, - A2DC49B11584300D00758FF1 /* ToolbarPauseAllTemplate@2x.png in Resources */, - A2DC49B21584300D00758FF1 /* ToolbarPauseSelectedTemplate@2x.png in Resources */, - A2DC49B61584303A00758FF1 /* ToolbarRemoveTemplate@2x.png in Resources */, - A2DC49B71584303A00758FF1 /* ToolbarResumeAllTemplate@2x.png in Resources */, - A2DC49B81584303A00758FF1 /* ToolbarResumeSelectedTemplate@2x.png in Resources */, - A2DC49BA1584307300758FF1 /* Transfers@2x.png in Resources */, - A2DC49BC1584309F00758FF1 /* TurtleTemplate@2x.png in Resources */, - A2DC49BF158430B300758FF1 /* UpArrowGroupTemplate@2x.png in Resources */, - A2DC49C0158430B300758FF1 /* UpArrowTemplate@2x.png in Resources */, - A2DC49C2158430CB00758FF1 /* YellowDot@2x.png in Resources */, - A2DC49C4158430E200758FF1 /* YingYangGroupTemplate@2x.png in Resources */, - A2DC49C6158430FB00758FF1 /* YingYangTemplate@2x.png in Resources */, + F63480631E1D7274005B9E09 /* Images.xcassets in Resources */, A2451E6A16ACE4EB00586E0E /* FileRenameSheetController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -2709,15 +2236,15 @@ files = ( ); inputPaths = ( - "$(SRCROOT)/third-party/miniupnp/VERSION", - "$(SRCROOT)/third-party/miniupnp/miniupnpcstrings.h.in", + "$(SRCROOT)/third-party/miniupnpc/VERSION", + "$(SRCROOT)/third-party/miniupnpc/miniupnpcstrings.h.in", ); outputPaths = ( - "$(SRCROOT)/third-party/miniupnp/miniupnpcstrings.h", + "$(SRCROOT)/third-party/miniupnpc/miniupnpcstrings.h", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "sh third-party/miniupnp/updateminiupnpcstrings.sh \"$SCRIPT_INPUT_FILE_0\" \"$SCRIPT_INPUT_FILE_1\" \"$SCRIPT_OUTPUT_FILE_0\""; + shellScript = "cd third-party/miniupnpc\nsh updateminiupnpcstrings.sh \"$SCRIPT_INPUT_FILE_0\" \"$SCRIPT_INPUT_FILE_1\" \"$SCRIPT_OUTPUT_FILE_0\""; }; BE75C3510C729EE100DBEFE0 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -2732,6 +2259,48 @@ shellPath = /bin/bash; shellScript = "if [ ! -e ./third-party/libevent/include/event2/config.h -a ! ./third-party/macosx-libevent-config.h -ef ./third-party/libevent/include/event2/config.h ]; then ln -s ../../../macosx-libevent-config.h ./third-party/libevent/include/event2/config.h; fi\n\nif [ ! -e ./third-party/libevent/include/event2/event-config.h -a ! ./third-party/macosx-libevent-event-config.h -ef ./third-party/libevent/include/event2/event-config.h ]; then ln -s ../../../macosx-libevent-event-config.h ./third-party/libevent/include/event2/event-config.h; fi"; }; + C12F197C1E1AE55A0005E93F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + "$(SRCROOT)/third-party/miniupnpc/miniupnp", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd third-party/miniupnpc && rm -f miniupnp && ln -s . miniupnp"; + }; + C12F197D1E1AE6830005E93F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + "$(SRCROOT)/third-party/libutp/libutp", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd third-party/libutp && rm -f libutp && ln -s . libutp"; + }; + C12F197E1E1AE6D50005E93F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + "$(SRCROOT)/third-party/dht/dht", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd third-party/dht && rm -f dht && ln -s . dht"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -2774,6 +2343,7 @@ 4D36BA720CA2F00800A63CA5 /* handshake.c in Sources */, 4D36BA740CA2F00800A63CA5 /* peer-io.c in Sources */, C1033E071A3279B800EF44D8 /* crypto-utils-fallback.c in Sources */, + C10C644D1D9AF328003C1B4C /* session-id.c in Sources */, 4D36BA770CA2F00800A63CA5 /* peer-mgr.c in Sources */, C1077A50183EB29600634C22 /* file-posix.c in Sources */, 4D36BA790CA2F00800A63CA5 /* peer-msgs.c in Sources */, @@ -2938,6 +2508,8 @@ BE11836B0CE160D50002D0F3 /* miniwget.c in Sources */, BE11836C0CE160D50002D0F3 /* minissdpc.c in Sources */, BE11836D0CE160D50002D0F3 /* minisoap.c in Sources */, + C12F19781E1AE3C30005E93F /* upnpc.c in Sources */, + C12F19791E1AE3C30005E93F /* upnperrors.c in Sources */, BE11836E0CE160D50002D0F3 /* upnpreplyparse.c in Sources */, BE11836F0CE160D50002D0F3 /* upnpcommands.c in Sources */, BE1183700CE160D50002D0F3 /* miniupnpc.c in Sources */, @@ -3313,9 +2885,12 @@ buildSettings = { HEADER_SEARCH_PATHS = ( "$(inherited)", - "third-party", + "third-party/dht", + "third-party/libb64/include", "third-party/libevent/include", - "third-party/libb64", + "third-party/libnatpmp", + "third-party/libutp", + "third-party/miniupnpc", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -3344,6 +2919,7 @@ buildSettings = { FRAMEWORK_SEARCH_PATHS = macosx; GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/third-party/curl/lib\"", @@ -3442,7 +3018,7 @@ "third-party/curl/lib", "third-party/openssl/lib", ); - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; STRIP_INSTALLED_PRODUCT = NO; @@ -3478,9 +3054,12 @@ buildSettings = { HEADER_SEARCH_PATHS = ( "$(inherited)", - "third-party", + "third-party/dht", + "third-party/libb64/include", "third-party/libevent/include", - "third-party/libb64", + "third-party/libnatpmp", + "third-party/libutp", + "third-party/miniupnpc", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -3520,6 +3099,7 @@ buildSettings = { FRAMEWORK_SEARCH_PATHS = macosx; GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/third-party/curl/lib\"", @@ -3578,7 +3158,7 @@ "third-party/curl/lib", "third-party/openssl/lib", ); - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.9; OTHER_CFLAGS = "-DNDEBUG"; SDKROOT = macosx; }; @@ -3655,7 +3235,7 @@ "third-party/curl/lib", "third-party/openssl/lib", ); - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; STRIP_INSTALLED_PRODUCT = NO; @@ -3667,6 +3247,7 @@ buildSettings = { FRAMEWORK_SEARCH_PATHS = macosx; GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/third-party/curl/lib\"", @@ -3692,9 +3273,12 @@ buildSettings = { HEADER_SEARCH_PATHS = ( "$(inherited)", - "third-party", + "third-party/dht", + "third-party/libb64/include", "third-party/libevent/include", - "third-party/libb64", + "third-party/libnatpmp", + "third-party/libutp", + "third-party/miniupnpc", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", diff --git a/cli/cli.c b/cli/cli.c index 3028ae0b57a..2f6c943d6f9 100644 --- a/cli/cli.c +++ b/cli/cli.c @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/cli/transmission-cli.1 b/cli/transmission-cli.1 index 677ffc0e6da..37760ae302e 100644 --- a/cli/transmission-cli.1 +++ b/cli/transmission-cli.1 @@ -65,7 +65,7 @@ Prefer unencrypted peer connections. Set a script to run when the torrent finishes .It Fl g, Fl -config-dir Ar directory Where to look for configuration files. This can be used to swap between using the cli, daemon, gtk, and qt clients. -See http://trac.transmissionbt.com/wiki/ConfigFiles for more information. +See https://trac.transmissionbt.com/wiki/ConfigFiles for more information. .It Fl h, Fl -help Prints a short usage summary. .It Fl m, Fl -portmap @@ -122,8 +122,9 @@ program was written by .An Eric Petit , .An Josh Elsasser , .An Jordan Lee , +.An Mitchell Livingston , and -.An Mitchell Livingston . +.An Mike Gelfand . .Sh SEE ALSO .Xr transmission-create 1 , .Xr transmission-daemon 1 , @@ -133,4 +134,4 @@ and .Xr transmission-remote 1 , .Xr transmission-show 1 .Pp -http://www.transmissionbt.com/ +https://transmissionbt.com/ diff --git a/cmake/FindEVENT2.cmake b/cmake/FindEVENT2.cmake index 254a8a14663..b1b9492b124 100644 --- a/cmake/FindEVENT2.cmake +++ b/cmake/FindEVENT2.cmake @@ -13,7 +13,7 @@ if(UNIX) endif() find_path(EVENT2_INCLUDE_DIR NAMES event2/event.h HINTS ${_EVENT2_INCLUDEDIR}) -find_library(EVENT2_LIBRARY NAMES event HINTS ${_EVENT2_LIBDIR}) +find_library(EVENT2_LIBRARY NAMES event-2.1 event-2.0 event HINTS ${_EVENT2_LIBDIR}) if(EVENT2_INCLUDE_DIR) if(_EVENT2_VERSION) diff --git a/cmake/FindPolarSSL.cmake b/cmake/FindPolarSSL.cmake index 0a958e00869..cd36c48ab25 100644 --- a/cmake/FindPolarSSL.cmake +++ b/cmake/FindPolarSSL.cmake @@ -8,21 +8,41 @@ if(POLARSSL_PREFER_STATIC_LIB) endif() if(UNIX) - find_package(PkgConfig QUIET) - pkg_check_modules(_POLARSSL QUIET polarssl) + find_package(PkgConfig QUIET) + pkg_check_modules(_MBEDTLS QUIET mbedtls) endif() -find_path(POLARSSL_INCLUDE_DIR NAMES polarssl/version.h HINTS ${_POLARSSL_INCLUDEDIR}) -find_library(POLARSSL_LIBRARY NAMES polarssl HINTS ${_POLARSSL_LIBDIR}) +find_path(MBEDTLS_INCLUDE_DIR NAMES mbedtls/version.h HINTS ${_MBEDTLS_INCLUDEDIR}) +find_library(MBEDTLS_LIBRARY NAMES mbedtls HINTS ${_MBEDTLS_LIBDIR}) +find_library(MBEDCRYPTO_LIBRARY NAMES mbedcrypto HINTS ${_MBEDTLS_LIBDIR}) +if(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY) + set(POLARSSL_INCLUDE_DIR ${MBEDTLS_INCLUDE_DIR}) + if(MBEDCRYPTO_LIBRARY) + set(POLARSSL_LIBRARY ${MBEDTLS_LIBRARY} ${MBEDCRYPTO_LIBRARY}) + else() + set(POLARSSL_LIBRARY ${MBEDTLS_LIBRARY}) + endif() + set(POLARSSL_VERSION ${_MBEDTLS_VERSION}) + set(POLARSSL_IS_MBEDTLS ON) +else() + if(UNIX) + pkg_check_modules(_POLARSSL QUIET polarssl) + endif() -if(POLARSSL_INCLUDE_DIR) - if(_POLARSSL_VERSION) - set(POLARSSL_VERSION ${_POLARSSL_VERSION}) + find_path(POLARSSL_INCLUDE_DIR NAMES polarssl/version.h HINTS ${_POLARSSL_INCLUDEDIR}) + find_library(POLARSSL_LIBRARY NAMES polarssl HINTS ${_POLARSSL_LIBDIR}) + set(POLARSSL_VERSION ${_POLARSSL_VERSION}) + set(POLARSSL_IS_MBEDTLS OFF) +endif() + +if(NOT POLARSSL_VERSION AND POLARSSL_INCLUDE_DIR) + if(POLARSSL_IS_MBEDTLS) + file(STRINGS "${POLARSSL_INCLUDE_DIR}/mbedtls/version.h" POLARSSL_VERSION_STR REGEX "^#define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"[^\"]+\"") else() file(STRINGS "${POLARSSL_INCLUDE_DIR}/polarssl/version.h" POLARSSL_VERSION_STR REGEX "^#define[\t ]+POLARSSL_VERSION_STRING[\t ]+\"[^\"]+\"") - if(POLARSSL_VERSION_STR MATCHES "\"([^\"]+)\"") - set(POLARSSL_VERSION "${CMAKE_MATCH_1}") - endif() + endif() + if(POLARSSL_VERSION_STR MATCHES "\"([^\"]+)\"") + set(POLARSSL_VERSION "${CMAKE_MATCH_1}") endif() endif() @@ -39,7 +59,7 @@ find_package_handle_standard_args(PolarSSL POLARSSL_VERSION ) -mark_as_advanced(POLARSSL_INCLUDE_DIR POLARSSL_LIBRARY) +mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDCRYPTO_LIBRARY POLARSSL_INCLUDE_DIR POLARSSL_LIBRARY) if(POLARSSL_PREFER_STATIC_LIB) set(CMAKE_FIND_LIBRARY_SUFFIXES ${POLARSSL_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) diff --git a/cmake/FindSYSTEMD.cmake b/cmake/FindSYSTEMD.cmake new file mode 100644 index 00000000000..c5dfb3dc86f --- /dev/null +++ b/cmake/FindSYSTEMD.cmake @@ -0,0 +1,20 @@ +if(UNIX) + find_package(PkgConfig QUIET) + pkg_check_modules(PC_SYSTEMD QUIET libsystemd) +endif() + +find_path(SYSTEMD_INCLUDE_DIR NAMES systemd/sd-daemon.h HINTS ${PC_SYSTEMD_INCLUDE_DIRS}) +find_library(SYSTEMD_LIBRARY NAMES systemd HINTS ${PC_SYSTEMD_LIBRARY_DIRS}) + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(SYSTEMD + REQUIRED_VARS + SYSTEMD_LIBRARY + SYSTEMD_INCLUDE_DIR +) + +mark_as_advanced(SYSTEMD_INCLUDE_DIR SYSTEMD_LIBRARY) + +set(SYSTEMD_INCLUDE_DIRS ${SYSTEMD_INCLUDE_DIR}) +set(SYSTEMD_LIBRARIES ${SYSTEMD_LIBRARY}) diff --git a/cmake/TrMacros.cmake b/cmake/TrMacros.cmake index 360392cf857..3c89782a390 100644 --- a/cmake/TrMacros.cmake +++ b/cmake/TrMacros.cmake @@ -69,15 +69,7 @@ function(tr_make_id INPUT OVAR) set(${OVAR} "${ID}" PARENT_SCOPE) endfunction() -macro(tr_github_upstream ID REPOID RELID RELMD5) - set(${ID}_RELEASE "${RELID}") - set(${ID}_UPSTREAM URL "https://github.com/${REPOID}/archive/${RELID}.tar.gz") - if(NOT SKIP_UPSTREAM_CHECKSUM) - list(APPEND ${ID}_UPSTREAM URL_MD5 "${RELMD5}") - endif() -endmacro() - -macro(tr_add_external_auto_library ID LIBNAME) +macro(tr_add_external_auto_library ID DIRNAME LIBNAME) if(USE_SYSTEM_${ID}) tr_get_required_flag(USE_SYSTEM_${ID} SYSTEM_${ID}_IS_REQUIRED) find_package(${ID} ${${ID}_MINIMUM} ${SYSTEM_${ID}_IS_REQUIRED}) @@ -87,30 +79,32 @@ macro(tr_add_external_auto_library ID LIBNAME) if(USE_SYSTEM_${ID}) unset(${ID}_UPSTREAM_TARGET) else() - set(${ID}_UPSTREAM_TARGET ${LIBNAME}-${${ID}_RELEASE}) + set(${ID}_UPSTREAM_TARGET ${LIBNAME}) set(${ID}_PREFIX "${CMAKE_BINARY_DIR}/third-party/${${ID}_UPSTREAM_TARGET}") + set(${ID}_INCLUDE_DIR "${${ID}_PREFIX}/include" CACHE INTERNAL "") + set(${ID}_LIBRARY "${${ID}_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${LIBNAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE INTERNAL "") + + set(${ID}_INCLUDE_DIRS ${${ID}_INCLUDE_DIR}) + set(${ID}_LIBRARIES ${${ID}_LIBRARY}) + ExternalProject_Add( ${${ID}_UPSTREAM_TARGET} - ${${ID}_UPSTREAM} + URL "${CMAKE_SOURCE_DIR}/third-party/${DIRNAME}" ${ARGN} PREFIX "${${ID}_PREFIX}" CMAKE_ARGS -Wno-dev # We don't want to be warned over unused variables "-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}" + "-DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE}" "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}" "-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}" "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}" "-DCMAKE_INSTALL_PREFIX:PATH=" + BUILD_BYPRODUCTS "${${ID}_LIBRARY}" ) set_property(TARGET ${${ID}_UPSTREAM_TARGET} PROPERTY FOLDER "ThirdParty") - - set(${ID}_INCLUDE_DIR "${${ID}_PREFIX}/include" CACHE INTERNAL "") - set(${ID}_LIBRARY "${${ID}_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${LIBNAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE INTERNAL "") - - set(${ID}_INCLUDE_DIRS ${${ID}_INCLUDE_DIR}) - set(${ID}_LIBRARIES ${${ID}_LIBRARY}) endif() endmacro() @@ -138,3 +132,67 @@ function(tr_win32_app_info OVAR DESCR INTNAME ORIGFNAME) set(${OVAR} "${CMAKE_CURRENT_BINARY_DIR}/${INTNAME}-app-info.rc" PARENT_SCOPE) endfunction() + +function(tr_select_library LIBNAMES FUNCNAME DIRS OVAR) + set(LIBNAME) + foreach(X ${LIBNAMES}) + set(VAR_NAME "HAVE_${FUNCNAME}_IN_LIB${X}") + string(TOUPPER "${VAR_NAME}" VAR_NAME) + check_library_exists("${X}" "${FUNCNAME}" "${DIRS}" ${VAR_NAME}) + if(${VAR_NAME}) + set(LIBNAME "${X}") + break() + endif() + endforeach() + set(${OVAR} "${LIBNAME}" PARENT_SCOPE) +endfunction() + +function(tr_fixup_bundle_item BUNDLE_DIR BUNDLE_ITEMS DEP_DIRS) + while(BUNDLE_ITEMS) + list(GET BUNDLE_ITEMS 0 ITEM) + list(REMOVE_AT BUNDLE_ITEMS 0) + + set(ITEM_FULL_BUNDLE_PATH "${BUNDLE_DIR}/${ITEM}") + get_filename_component(ITEM_FULL_BUNDLE_DIR "${ITEM_FULL_BUNDLE_PATH}" PATH) + + unset(ITEM_DEPS) + get_prerequisites("${ITEM_FULL_BUNDLE_PATH}" ITEM_DEPS 1 0 "${ITEM_FULL_BUNDLE_PATH}" "${DEP_DIRS}") + + foreach(DEP IN LISTS ITEM_DEPS) + gp_resolve_item("${ITEM_FULL_BUNDLE_PATH}" "${DEP}" "${ITEM_FULL_BUNDLE_DIR}" "${DEP_DIRS}" DEP_FULL_PATH) + + if(DEP_FULL_PATH MATCHES "[.]dylib$") + get_filename_component(DEP_NAME "${DEP_FULL_PATH}" NAME) + file(COPY "${DEP_FULL_PATH}" DESTINATION "${BUNDLE_DIR}/Contents/MacOS/") + set(DEP_BUNDLE_PATH "Contents/MacOS/${DEP_NAME}") + elseif(DEP_FULL_PATH MATCHES "^(.+)/(([^/]+[.]framework)/.+)$") + set(DEP_NAME "${CMAKE_MATCH_2}") + file(COPY "${CMAKE_MATCH_1}/${CMAKE_MATCH_3}" DESTINATION "${BUNDLE_DIR}/Contents/Frameworks/" PATTERN "Headers" EXCLUDE) + set(DEP_BUNDLE_PATH "Contents/Frameworks/${DEP_NAME}") + else() + message(FATAL_ERROR "Don't know how to fixup '${DEP_FULL_PATH}'") + endif() + + execute_process(COMMAND install_name_tool -change "${DEP}" "@rpath/${DEP_NAME}" "${ITEM_FULL_BUNDLE_PATH}") + + set(DEP_FULL_BUNDLE_PATH "${BUNDLE_DIR}/${DEP_BUNDLE_PATH}") + execute_process(COMMAND chmod u+w "${DEP_FULL_BUNDLE_PATH}") + execute_process(COMMAND install_name_tool -id "@rpath/${DEP_NAME}" "${DEP_FULL_BUNDLE_PATH}") + + list(REMOVE_ITEM BUNDLE_ITEMS "${DEP_BUNDLE_PATH}") + list(APPEND BUNDLE_ITEMS "${DEP_BUNDLE_PATH}") + endforeach() + endwhile() +endfunction() + +macro(tr_qt_wrap_ui) + qt5_wrap_ui(${ARGN}) +endmacro() + +macro(tr_qt_add_resources) + qt5_add_resources(${ARGN}) +endmacro() + +macro(tr_qt_add_translation) + qt5_add_translation(${ARGN}) +endmacro() diff --git a/configure.ac b/configure.ac index b64f2a39500..18200e76abd 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ dnl these should be the only two lines you need to change m4_define([user_agent_prefix],[2.92+]) m4_define([peer_id_prefix],[-TR292Z-]) -AC_INIT([transmission],[user_agent_prefix],[http://trac.transmissionbt.com/newticket]) +AC_INIT([transmission],[user_agent_prefix],[https://trac.transmissionbt.com/newticket]) AC_SUBST(USERAGENT_PREFIX,[user_agent_prefix]) AC_SUBST(PEERID_PREFIX,[peer_id_prefix]) @@ -16,7 +16,7 @@ AC_CONFIG_MACRO_DIR([m4]) dnl AM_CONFIG_HEADER(config.h) AC_CONFIG_SRCDIR(libtransmission/transmission.h) -AM_INIT_AUTOMAKE([1.9 tar-pax no-dist-gzip dist-xz]) +AM_INIT_AUTOMAKE([1.9 tar-pax no-dist-gzip dist-xz foreign]) LT_INIT LT_LIB_M @@ -103,6 +103,9 @@ if test "x$GCC" = "xyes" ; then fi fi +AC_PROG_LN_S +AC_PROG_MKDIR_P + AC_HEADER_STDC AC_HEADER_TIME @@ -139,7 +142,7 @@ AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xopenssl"], [ ]) AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xcyassl"], [ PKG_CHECK_MODULES(WOLFSSL, [wolfssl >= $CYASSL_MINIMUM], - [want_crypto="cyassl"; CRYPTO_PKG="cyassl"; CRYPTO_CFLAGS="$WOLFSSL_CFLAGS"; CRYPTO_LIBS="$WOLFSSL_LIBS"], + [want_crypto="cyassl"; CRYPTO_PKG="cyassl"; CRYPTO_CFLAGS="$WOLFSSL_CFLAGS"; CRYPTO_LIBS="$WOLFSSL_LIBS"; CYASSL_IS_WOLFSSL=yes], [PKG_CHECK_MODULES(CYASSL, [cyassl >= $CYASSL_MINIMUM], [want_crypto="cyassl"; CRYPTO_PKG="cyassl"; CRYPTO_CFLAGS="$CYASSL_CFLAGS"; CRYPTO_LIBS="$CYASSL_LIBS"], [AS_IF([test "x$want_crypto" = "xcyassl"], @@ -149,23 +152,26 @@ AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xcyassl"], [ ) ]) AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xpolarssl"], [ - AC_CHECK_HEADER([polarssl/version.h], - [AC_EGREP_CPP([version_ok], [#include - #if defined (POLARSSL_VERSION_NUMBER) && POLARSSL_VERSION_NUMBER >= $POLARSSL_MINIMUM - version_ok - #endif], - [AC_CHECK_LIB([polarssl], [dhm_calc_secret], - [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS=""; CRYPTO_LIBS="-lpolarssl"], + PKG_CHECK_MODULES(MBEDTLS, [mbedtls >= $POLARSSL_MINIMUM], + [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS="$MBEDTLS_CFLAGS"; CRYPTO_LIBS="$MBEDTLS_LIBS"; POLARSSL_IS_MBEDTLS=yes], + [AC_CHECK_HEADER([polarssl/version.h], + [AC_EGREP_CPP([version_ok], [#include + #if defined (POLARSSL_VERSION_NUMBER) && POLARSSL_VERSION_NUMBER >= $POLARSSL_MINIMUM + version_ok + #endif], + [AC_CHECK_LIB([polarssl], [dhm_calc_secret], + [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS=""; CRYPTO_LIBS="-lpolarssl"], + [AS_IF([test "x$want_crypto" = "xpolarssl"], + [AC_MSG_ERROR([PolarSSL support requested, but library not found.])] + )] + )], [AS_IF([test "x$want_crypto" = "xpolarssl"], - [AC_MSG_ERROR([PolarSSL support requested, but library not found.])] + [AC_MSG_ERROR([PolarSSL support requested, but version not suitable.])] )] )], [AS_IF([test "x$want_crypto" = "xpolarssl"], - [AC_MSG_ERROR([PolarSSL support requested, but version not suitable.])] + [AC_MSG_ERROR([PolarSSL support requested, but headers not found.])] )] - )], - [AS_IF([test "x$want_crypto" = "xpolarssl"], - [AC_MSG_ERROR([PolarSSL support requested, but headers not found.])] )] ) ]) @@ -179,7 +185,9 @@ AS_IF([test "x$CRYPTO_PKG" = "x"], [ AM_CONDITIONAL([CRYPTO_USE_OPENSSL],[test "x$CRYPTO_PKG" = "xopenssl"]) AM_CONDITIONAL([CRYPTO_USE_CYASSL],[test "x$CRYPTO_PKG" = "xcyassl"]) +AM_CONDITIONAL([CYASSL_IS_WOLFSSL],[test "x$CYASSL_IS_WOLFSSL" = "xyes"]) AM_CONDITIONAL([CRYPTO_USE_POLARSSL],[test "x$CRYPTO_PKG" = "xpolarssl"]) +AM_CONDITIONAL([POLARSSL_IS_MBEDTLS],[test "x$POLARSSL_IS_MBEDTLS" = "xyes"]) AC_SUBST(CRYPTO_PKG) AC_SUBST(CRYPTO_CFLAGS) AC_SUBST(CRYPTO_LIBS) @@ -258,7 +266,7 @@ dnl ---------------------------------------------------------------------------- dnl dnl dht -DHT_CFLAGS="-I\$(top_srcdir)/third-party/dht" +DHT_CFLAGS="-I\$(top_builddir)/third-party/dht/include" DHT_LIBS="\$(top_builddir)/third-party/dht/libdht.a" DHT_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/dht/libdht.a" build_bundled_dht="yes" @@ -284,7 +292,7 @@ dnl ---------------------------------------------------------------------------- dnl dnl libb64 -LIBB64_CFLAGS="-I\$(top_srcdir)/third-party/libb64" +LIBB64_CFLAGS="-I\$(top_srcdir)/third-party/libb64/include" LIBB64_LIBS="\$(top_builddir)/third-party/libb64/libb64.a" LIBB64_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/libb64/libb64.a" build_bundled_b64="yes" @@ -346,7 +354,7 @@ if test "x$want_utp" = "xyes"; then AC_DEFINE([WITH_UTP],[1]) build_utp="system" elif test "x$CXX" != "x"; then - LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/" + LIBUTP_CFLAGS="-I\$(top_builddir)/third-party/libutp/include" LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a" LIBUTP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/libutp/libutp.a" if test "x$libutp_extra_libs" != "x" ; then @@ -452,9 +460,9 @@ LIBS="$ac_save_LIBS" AC_MSG_RESULT([$upnp_version]) AM_CONDITIONAL([BUILD_MINIUPNP],[test "x$upnp_version" = "xnone"]) if test "x$upnp_version" = "xnone" ; then - LIBUPNP_CFLAGS="-I\$(top_srcdir)/third-party/" - LIBUPNP_LIBS="\$(top_builddir)/third-party/miniupnp/libminiupnp.a" - LIBUPNP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a" + LIBUPNP_CFLAGS="-I\$(top_builddir)/third-party/miniupnpc/include" + LIBUPNP_LIBS="\$(top_builddir)/third-party/miniupnpc/libminiupnp.a" + LIBUPNP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/miniupnpc/libminiupnp.a" else AC_DEFINE([SYSTEM_MINIUPNP]) LIBUPNP_CFLAGS="" @@ -654,7 +662,7 @@ AC_CONFIG_FILES([Makefile third-party/libb64/Makefile third-party/libutp/Makefile third-party/libnatpmp/Makefile - third-party/miniupnp/Makefile + third-party/miniupnpc/Makefile macosx/Makefile gtk/Makefile gtk/icons/Makefile diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 8ec3b95580c..2ecf83dc31c 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -36,17 +36,16 @@ add_executable(${TR_NAME}-daemon ${${PROJECT_NAME}_HEADERS} ${${PROJECT_NAME}_WIN32_RC_FILE}) -set_target_properties(${TR_NAME}-daemon PROPERTIES - COMPILE_FLAGS "${SYSTEMD_CFLAGS}" - LINK_FLAGS "${SYSTEMD_LDFLAGS}" -) - target_link_libraries(${TR_NAME}-daemon ${TR_NAME} ${EVENT2_LIBRARIES} - ${SYSTEMD_LIBRARIES} ) +if(WITH_SYSTEMD) + target_include_directories(${TR_NAME}-daemon PRIVATE ${SYSTEMD_INCLUDE_DIRS}) + target_link_libraries(${TR_NAME}-daemon ${SYSTEMD_LIBRARIES}) +endif() + tr_win32_app_info(${PROJECT_NAME}_remote_WIN32_RC_FILE "Transmission Utility ('remote')" "${TR_NAME}-remote" diff --git a/daemon/daemon-posix.c b/daemon/daemon-posix.c index fdae6dd9515..486afdd9017 100644 --- a/daemon/daemon-posix.c +++ b/daemon/daemon-posix.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/daemon/daemon-win32.c b/daemon/daemon-win32.c index b9138c812e9..3e957eaef48 100644 --- a/daemon/daemon-win32.c +++ b/daemon/daemon-win32.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* _beginthreadex () */ diff --git a/daemon/daemon.c b/daemon/daemon.c index 62ac7153c78..96a56cdee03 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -80,7 +79,7 @@ static const char * getUsage (void) { return "Transmission " LONG_VERSION_STRING - " http://www.transmissionbt.com/\n" + " https://transmissionbt.com/\n" "A fast and easy BitTorrent client\n" "\n" MY_NAME " is a headless Transmission session\n" diff --git a/daemon/daemon.h b/daemon/daemon.h index fa3897f6f1e..042acb2ced6 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/daemon/remote.c b/daemon/remote.c index 0ec7b49899b..c171d98608b 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -198,7 +197,7 @@ getUsage (void) return MY_NAME" "LONG_VERSION_STRING"\n" "A fast and easy BitTorrent client\n" - "http://www.transmissionbt.com/\n" + "https://transmissionbt.com/\n" "\n" "Usage: " MY_NAME " [host] [options]\n" diff --git a/daemon/transmission-daemon.1 b/daemon/transmission-daemon.1 index ce44c087b2c..0a32ae6131c 100644 --- a/daemon/transmission-daemon.1 +++ b/daemon/transmission-daemon.1 @@ -59,7 +59,7 @@ Dump transmission-daemon's settings to stderr. Run in the foreground and print errors to stderr. .It Fl g Fl -config-dir Ar directory Where to look for configuration files. This can be used to swap between using the cli, daemon, gtk, and qt clients. -See http://trac.transmissionbt.com/wiki/ConfigFiles for more information. +See https://trac.transmissionbt.com/wiki/ConfigFiles for more information. .It Fl er Fl -encryption-required Encrypt all peer connections. .It Fl ep Fl -encryption-preferred @@ -148,15 +148,16 @@ The config-dir used when neither nor .Op Fl g is specified. -See http://trac.transmissionbt.com/wiki/ConfigFiles for more information. +See https://trac.transmissionbt.com/wiki/ConfigFiles for more information. .El .Sh AUTHORS .An -nosplit .An Jordan Lee , .An Josh Elsasser , .An Eric Petit , +.An Mitchell Livingston , and -.An Mitchell Livingston . +.An Mike Gelfand . .Sh SEE ALSO .Xr transmission-create 1 , .Xr transmission-daemon 1 , @@ -166,4 +167,4 @@ and .Xr transmission-remote 1 , .Xr transmission-show 1 .Pp -http://www.transmissionbt.com/ +https://transmissionbt.com/ diff --git a/daemon/transmission-remote.1 b/daemon/transmission-remote.1 index 8e05de1649d..ee135f2e3a5 100644 --- a/daemon/transmission-remote.1 +++ b/daemon/transmission-remote.1 @@ -397,8 +397,9 @@ Sets the proxy to use for http tracker announces. .An Jordan Lee , .An Josh Elsasser , .An Eric Petit , +.An Mitchell Livingston , and -.An Mitchell Livingston . +.An Mike Gelfand . .Sh SEE ALSO .Xr transmission-create 1 , .Xr transmission-daemon 1 , @@ -408,4 +409,4 @@ and .Xr transmission-remote 1 , .Xr transmission-show 1 .Pp -http://www.transmissionbt.com/ +https://transmissionbt.com/ diff --git a/dist/msi/CMakeLists.txt b/dist/msi/CMakeLists.txt index 64a95d1b120..49aa53bdd1d 100644 --- a/dist/msi/CMakeLists.txt +++ b/dist/msi/CMakeLists.txt @@ -10,18 +10,14 @@ endif() set(VERSION "${TR_USER_AGENT_PREFIX}") set(VERSION_MSI "${TR_VERSION_MAJOR}.${TR_VERSION_MINOR}.0") -set(VERSION_FULL "${TR_USER_AGENT_PREFIX} (${TR_SCM_REVISION})") +set(VERSION_FULL "${TR_USER_AGENT_PREFIX} (${TR_VCS_REVISION})") if(NOT TR_THIRD_PARTY_DIR) set(TR_THIRD_PARTY_DIR "$/..") endif() if(NOT TR_QT_DIR) - if(USE_QT5) - set(TR_QT_DIR "$/..") - else() - set(TR_QT_DIR "$/..") - endif() + set(TR_QT_DIR "$/..") endif() set(ICONS_DIR "${CMAKE_SOURCE_DIR}/qt/icons/hicolor") @@ -76,7 +72,7 @@ wix_candle(${PROJECT_NAME}_OBJS wix_light(${PROJECT_NAME}_OUTPUT NAME - transmission-${VERSION}-r${TR_SCM_REVISION}-${ARCH} + transmission-${VERSION}-r${TR_VCS_REVISION}-${ARCH} OBJECTS ${${PROJECT_NAME}_OBJS} EXTENSIONS diff --git a/dist/msi/Transmission.wxs b/dist/msi/Transmission.wxs index c19be56ca60..d8208145055 100644 --- a/dist/msi/Transmission.wxs +++ b/dist/msi/Transmission.wxs @@ -6,9 +6,11 @@ + + @@ -27,6 +29,15 @@ NOT TRQTWINSTALLDIR + + + + + + + UCRTINSTALLED + + @@ -70,7 +81,7 @@ - + diff --git a/dist/msi/components/QtClient.wxs b/dist/msi/components/QtClient.wxs index 74e8f78d9d7..383faeeafb9 100644 --- a/dist/msi/components/QtClient.wxs +++ b/dist/msi/components/QtClient.wxs @@ -100,6 +100,9 @@ + + + @@ -132,6 +135,7 @@ + diff --git a/extras/encryption.txt b/extras/encryption.txt index b59a2f7f9d2..5843982da7e 100644 --- a/extras/encryption.txt +++ b/extras/encryption.txt @@ -35,7 +35,7 @@ B is the receiver Prime P is a 768 bit safe prime, "0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563" Generator G is "2" -Xa and Xb are a variable size random integers. +Xa and Xb are a variable size random integers. They are the private key for each side and have to be discarded after the DH handshake is done. Minimum length is 128 bit. Anything beyond 180 bit is not believed to add any further security and only increases the necessary @@ -116,7 +116,7 @@ ENCRYPT() is RC4, that uses one of the following keys to send data: The first 1024 bytes of the RC4 output are discarded. consecutive calls to ENCRYPT() by one side continue the encryption stream (no reinitialization, no keychange). They are only used to distinguish -semantically seperate content. +semantically seperate content. ENCRYPT2() is the negotiated crypto method. @@ -155,7 +155,7 @@ are met the handshake can be considered as invalid. 2 (termination by B) if A sent less than 96 Bytes within 30 seconds -if A sent more than 608 bytes +if A sent more than 608 bytes 3 (termination by A) if B sent less than 96 Bytes within 30 seconds diff --git a/extras/extended-messaging.txt b/extras/extended-messaging.txt index 7a46dd400d0..11eaa4c7a1d 100644 --- a/extras/extended-messaging.txt +++ b/extras/extended-messaging.txt @@ -46,7 +46,7 @@ bencoded dictionary with the following keys: added.f string, one byte of flags for each peer in the above added string. according to libtorrent's ut_pex.c: - + 1: encryption 2: seed/upload_only 4: uTP support diff --git a/extras/properties.txt b/extras/properties.txt deleted file mode 100644 index a221209e64d..00000000000 --- a/extras/properties.txt +++ /dev/null @@ -1,5 +0,0 @@ -This file is here because I can never remember these commands... - -svn propset svn:keywords 'Date Rev Author Id' filename - -find . -type f \! -path \*.svn\* | xargs grep '\$Id\$' diff --git a/extras/rpc-spec.txt b/extras/rpc-spec.txt index abe491fb6e2..593aac23295 100644 --- a/extras/rpc-spec.txt +++ b/extras/rpc-spec.txt @@ -18,7 +18,7 @@ The command-line utility "transmission-remote" uses this RPC API. Several developers have reported using its --debug JSON output as a reference when developing/debugging their own code. - + 2. Message Format Messages are formatted as objects. There are two types: @@ -145,7 +145,7 @@ in libtransmission/transmission.h. The "source" column here corresponds to the data structure there. - key | type | source + key | type | source ----------------------------+-----------------------------+--------- activityDate | number | tr_stat addedDate | number | tr_stat @@ -320,7 +320,7 @@ Say we want to get the name and total size of torrents #7 and #10. - Request: + Request: { "arguments": { @@ -336,8 +336,8 @@ { "arguments": { - "torrents": [ - { + "torrents": [ + { "id": 10, "name": "Fedora x86_64 DVD", "totalSize": 34983493932, @@ -346,7 +346,7 @@ "id": 7, "name": "Ubuntu x86_64 DVD", "totalSize", 9923890123, - } + } ] }, "result": "success", @@ -367,7 +367,7 @@ "metainfo" | string base64-encoded .torrent content "paused" | boolean if true, don't start the torrent "peer-limit" | number maximum number of peers - "bandwidthPriority" | number torrent's bandwidth tr_priority_t + "bandwidthPriority" | number torrent's bandwidth tr_priority_t "files-wanted" | array indices of file(s) to download "files-unwanted" | array indices of file(s) to not download "priority-high" | array indices of high-priority file(s) @@ -379,7 +379,7 @@ The format of the "cookies" should be NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie should contain. - Set multiple cookies like this: "name1=content1; name2=content2;" etc. + Set multiple cookies like this: "name1=content1; name2=content2;" etc. Response arguments: On success, a "torrent-added" object in the @@ -518,15 +518,16 @@ Method name: "session-set" Request arguments: one or more of 4.1's arguments, except: "blocklist-size", - "config-dir", "rpc-version", "rpc-version-minimum", and - "version" + "config-dir", "rpc-version", "rpc-version-minimum", + "version", and "session-id" Response arguments: none 4.1.2. Accessors Method name: "session-get" - Request arguments: none - Response arguments: all of 4.1's arguments + Request arguments: an optional "fields" array of keys (see 4.1) + Response arguments: key/value pairs matching the request's "fields" + argument if present, or all supported fields (see 4.1) otherwise. 4.2. Session Statistics @@ -670,12 +671,12 @@ | | | | | | yes | torrent-set | new arg "bandwidthPriority" | | yes | torrent-set | new arg "honorsSessionLimits" - | | yes | torrent-set | new arg "seedRatioLimit" - | | yes | torrent-set | new arg "seedRatioLimited" - | | NO | torrent-set | renamed "speed-limit-down" to "downloadLimit" - | | NO | torrent-set | renamed "speed-limit-down-enabled" to "downloadLimited" - | | NO | torrent-set | renamed "speed-limit-up" to "uploadLimit" - | | NO | torrent-set | renamed "speed-limit-up-enabled" to "uploadLimited" + | | yes | torrent-set | new arg "seedRatioLimit" + | | yes | torrent-set | new arg "seedRatioLimited" + | | NO | torrent-set | renamed "speed-limit-down" to "downloadLimit" + | | NO | torrent-set | renamed "speed-limit-down-enabled" to "downloadLimited" + | | NO | torrent-set | renamed "speed-limit-up" to "uploadLimit" + | | NO | torrent-set | renamed "speed-limit-up-enabled" to "uploadLimited" | | | | | | yes | torrent-get | new arg "bandwidthPriority" | | yes | torrent-get | new arg "fileStats" @@ -743,7 +744,7 @@ 13 | 2.30 | yes | session-get | new arg "isUTP" to the "peers" list | | yes | torrent-add | new arg "cookies" | | NO | torrent-get | removed arg "peersKnown" - ------+---------+-----------+--------------------------+------------------------------- + ------+---------+-----------+----------------------+------------------------------- 14 | 2.40 | NO | torrent-get | values of "status" field changed | | yes | torrent-get | new arg "queuePosition" | | yes | torrent-get | new arg "isStalled" @@ -760,11 +761,14 @@ | | yes | | new method "queue-move-down" | | yes | | new method "queue-move-bottom" | | yes | | new method "torrent-start-now" - ------+---------+-----------+--------------------------+------------------------------- + ------+---------+-----------+----------------------+------------------------------- 15 | 2.80 | yes | torrent-get | new arg "etaIdle" | | yes | torrent-rename-path | new method | | yes | free-space | new method - | | yes | torrent-add | new return return arg "torrent-duplicate" + | | yes | torrent-add | new return arg "torrent-duplicate" + ------+---------+-----------+----------------------+------------------------------- + 16 | 3.00 | yes | session-get | new request arg "fields" + | | yes | session-get | new arg "session-id" 5.1. Upcoming Breakage diff --git a/gtk/actions.c b/gtk/actions.c index 3d1c59c080e..5a4d8240eba 100644 --- a/gtk/actions.c +++ b/gtk/actions.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/gtk/actions.h b/gtk/actions.h index 711b02fe6c0..d5abdd060f9 100644 --- a/gtk/actions.h +++ b/gtk/actions.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/conf.c b/gtk/conf.c index ae47b426a22..9ac8d7148d8 100644 --- a/gtk/conf.c +++ b/gtk/conf.c @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/gtk/conf.h b/gtk/conf.h index 01cbc8c371f..df5d66f8469 100644 --- a/gtk/conf.h +++ b/gtk/conf.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/gtk/details.c b/gtk/details.c index 7c3a89cfcc3..eedc6a71414 100644 --- a/gtk/details.c +++ b/gtk/details.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* INT_MAX */ diff --git a/gtk/details.h b/gtk/details.h index 478f2102afe..48284f91afc 100644 --- a/gtk/details.h +++ b/gtk/details.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/dialogs.c b/gtk/dialogs.c index 84756b1332c..53902140008 100644 --- a/gtk/dialogs.c +++ b/gtk/dialogs.c @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/gtk/dialogs.h b/gtk/dialogs.h index 35d71ab79b0..931a56d5aef 100644 --- a/gtk/dialogs.h +++ b/gtk/dialogs.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/gtk/favicon.c b/gtk/favicon.c index efdf8c24463..10606bb0a64 100644 --- a/gtk/favicon.c +++ b/gtk/favicon.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* g_remove () */ diff --git a/gtk/favicon.h b/gtk/favicon.h index 157198f7f64..b00a5af691b 100644 --- a/gtk/favicon.h +++ b/gtk/favicon.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/file-list.c b/gtk/file-list.c index da8fb82eb94..39fb40e2d0e 100644 --- a/gtk/file-list.c +++ b/gtk/file-list.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* INT_MAX */ @@ -802,7 +801,17 @@ on_rename_done_idle (struct rename_data * data) GtkTreeIter iter; if (gtk_tree_model_get_iter_from_string (data->file_data->model, &iter, data->path_string)) - gtk_tree_store_set (data->file_data->store, &iter, FC_LABEL, data->newname, -1); + { + const gboolean isLeaf = !gtk_tree_model_iter_has_child (data->file_data->model, &iter); + const char * mime_type = isLeaf ? gtr_get_mime_type_from_filename (data->newname) : DIRECTORY_MIME_TYPE; + GdkPixbuf * icon = gtr_get_mime_type_icon (mime_type, GTK_ICON_SIZE_MENU, data->file_data->view); + + gtk_tree_store_set (data->file_data->store, &iter, FC_LABEL, data->newname, FC_ICON, icon, -1); + + GtkTreeIter parent; + if (!gtk_tree_model_iter_parent (data->file_data->model, &parent, &iter)) + gtr_core_torrent_changed (data->file_data->core, data->file_data->torrentId); + } } else { diff --git a/gtk/file-list.h b/gtk/file-list.h index 29ab339907e..5ff5ce486dc 100644 --- a/gtk/file-list.h +++ b/gtk/file-list.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/filter.c b/gtk/filter.c index abeb2804fe6..94e884b2018 100644 --- a/gtk/filter.c +++ b/gtk/filter.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* qsort () */ diff --git a/gtk/filter.h b/gtk/filter.h index 73abcb138c1..00b6fe101f4 100644 --- a/gtk/filter.h +++ b/gtk/filter.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/hig.c b/gtk/hig.c index 105740083ed..c5058f2bed8 100644 --- a/gtk/hig.c +++ b/gtk/hig.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/gtk/hig.h b/gtk/hig.h index 6211635bc7f..7548b3c893e 100644 --- a/gtk/hig.h +++ b/gtk/hig.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/icons.c b/gtk/icons.c index 7cfbf4beb71..7d5b4efee0e 100644 --- a/gtk/icons.c +++ b/gtk/icons.c @@ -3,7 +3,6 @@ * "There is no problem for me, you can license my code * under whatever licence you wish :)" * - * $Id$ */ #include diff --git a/gtk/icons.h b/gtk/icons.h index 4362d194446..bda99ef35c4 100644 --- a/gtk/icons.h +++ b/gtk/icons.h @@ -3,7 +3,6 @@ * "There is no problem for me, you can license * my code under whatever licence you wish :)" * - * $Id$ */ #pragma once diff --git a/gtk/main.c b/gtk/main.c index 00604bf28fe..5fada537723 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -1363,9 +1361,10 @@ update_model_loop (gpointer gdata) static void show_about_dialog (GtkWindow * parent) { - const char * uri = "http://www.transmissionbt.com/"; + const char * uri = "https://transmissionbt.com/"; const char * authors[] = { "Jordan Lee (Backend; GTK+)", "Mitchell Livingston (Backend; OS X)", + "Mike Gelfand", NULL }; gtk_show_about_dialog (parent, @@ -1547,7 +1546,7 @@ gtr_actions_handler (const char * action_name, gpointer user_data) } else if (g_strcmp0 (action_name, "donate") == 0) { - gtr_open_uri ("http://www.transmissionbt.com/donate.php"); + gtr_open_uri ("https://transmissionbt.com/donate/"); } else if (g_strcmp0 (action_name, "pause-all-torrents") == 0) { diff --git a/gtk/makemeta-ui.c b/gtk/makemeta-ui.c index 02c9fb6d2f9..50d7047fbf7 100644 --- a/gtk/makemeta-ui.c +++ b/gtk/makemeta-ui.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/gtk/makemeta-ui.h b/gtk/makemeta-ui.h index c359b072a86..18f6a8994d1 100644 --- a/gtk/makemeta-ui.h +++ b/gtk/makemeta-ui.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/msgwin.c b/gtk/msgwin.c index fbe1d98df28..c049ff68ffd 100644 --- a/gtk/msgwin.c +++ b/gtk/msgwin.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/gtk/msgwin.h b/gtk/msgwin.h index 566b0a9aecb..19b71f26e88 100644 --- a/gtk/msgwin.h +++ b/gtk/msgwin.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ diff --git a/gtk/notify.c b/gtk/notify.c index a6ba9f90468..e7eb485a618 100644 --- a/gtk/notify.c +++ b/gtk/notify.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/gtk/notify.h b/gtk/notify.h index 84046521061..f3bc6167afd 100644 --- a/gtk/notify.h +++ b/gtk/notify.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/open-dialog.c b/gtk/open-dialog.c index 2c7bcfd257a..731d7b18140 100644 --- a/gtk/open-dialog.c +++ b/gtk/open-dialog.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/gtk/open-dialog.h b/gtk/open-dialog.h index d463a49482e..54439898617 100644 --- a/gtk/open-dialog.h +++ b/gtk/open-dialog.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/relocate.c b/gtk/relocate.c index cb73a70cb07..32e96c87183 100644 --- a/gtk/relocate.c +++ b/gtk/relocate.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/gtk/relocate.h b/gtk/relocate.h index ea516afab7a..deeb29d4992 100644 --- a/gtk/relocate.h +++ b/gtk/relocate.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/stats.c b/gtk/stats.c index 6d1433cd924..19c31fdd357 100644 --- a/gtk/stats.c +++ b/gtk/stats.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/gtk/stats.h b/gtk/stats.h index 0745cd259ae..f1eaac6cad5 100644 --- a/gtk/stats.h +++ b/gtk/stats.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/torrent-cell-renderer.c b/gtk/torrent-cell-renderer.c index f5b55b24c5a..b07ae4a9fd6 100644 --- a/gtk/torrent-cell-renderer.c +++ b/gtk/torrent-cell-renderer.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* INT_MAX */ diff --git a/gtk/torrent-cell-renderer.h b/gtk/torrent-cell-renderer.h index 4391ccc97eb..a20d58e5582 100644 --- a/gtk/torrent-cell-renderer.h +++ b/gtk/torrent-cell-renderer.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/tr-core.c b/gtk/tr-core.c index e186638752c..add185a8440 100644 --- a/gtk/tr-core.c +++ b/gtk/tr-core.c @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -1356,6 +1354,19 @@ gtr_core_torrents_added (TrCore * self) core_emit_err (self, TR_CORE_ERR_NO_MORE_TORRENTS, NULL); } +void +gtr_core_torrent_changed (TrCore * self, int id) +{ + GtkTreeIter iter; + GtkTreeModel * model = core_raw_model (self); + + if (find_row_from_torrent_id (model, id, &iter)) + { + GtkTreePath * path = gtk_tree_model_get_path (model, &iter); + gtk_tree_model_row_changed (model, path, &iter); + } +} + void gtr_core_remove_torrent (TrCore * core, int id, gboolean delete_local_data) { diff --git a/gtk/tr-core.h b/gtk/tr-core.h index 150bc749d5f..f0946e70709 100644 --- a/gtk/tr-core.h +++ b/gtk/tr-core.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -127,6 +125,8 @@ void gtr_core_add_torrent (TrCore*, tr_torrent*, gboolean do_notify); */ void gtr_core_torrents_added (TrCore * self); +void gtr_core_torrent_changed (TrCore * self, int id); + /****** ******* ******/ diff --git a/gtk/tr-icon.c b/gtk/tr-icon.c index a8911b8ca23..41dcdd0fdad 100644 --- a/gtk/tr-icon.c +++ b/gtk/tr-icon.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ diff --git a/gtk/tr-icon.h b/gtk/tr-icon.h index 5e00b4f7075..24cd3caf270 100644 --- a/gtk/tr-icon.h +++ b/gtk/tr-icon.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/tr-prefs.c b/gtk/tr-prefs.c index 51d42da290f..f473ed251f8 100644 --- a/gtk/tr-prefs.c +++ b/gtk/tr-prefs.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* isspace */ diff --git a/gtk/tr-prefs.h b/gtk/tr-prefs.h index 604e3df589d..46bfb0cd734 100644 --- a/gtk/tr-prefs.h +++ b/gtk/tr-prefs.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/gtk/tr-window.c b/gtk/tr-window.c index f08967459cf..67f27c1c13e 100644 --- a/gtk/tr-window.c +++ b/gtk/tr-window.c @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/gtk/tr-window.h b/gtk/tr-window.h index 728a4fda964..6ed401424a0 100644 --- a/gtk/tr-window.h +++ b/gtk/tr-window.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/gtk/transmission-gtk.1 b/gtk/transmission-gtk.1 index a03f5411f4f..d1639b90b9d 100644 --- a/gtk/transmission-gtk.1 +++ b/gtk/transmission-gtk.1 @@ -1,5 +1,3 @@ -.\" $Id$ -.\" .\" Copyright (c) 2007 Joshua Elsasser .\" .\" Permission is hereby granted, free of charge, to any person obtaining a @@ -49,7 +47,7 @@ Start with all torrents paused Start minimized in notification area .It Fl g, Fl -config-dir Ar directory Where to look for configuration files. This can be used to swap between using the cli, daemon, gtk, and qt clients. -See http://trac.transmissionbt.com/wiki/ConfigFiles for more information. +See https://trac.transmissionbt.com/wiki/ConfigFiles for more information. .El .Pp Multiple .torrent files may be added at startup @@ -80,8 +78,9 @@ was written by .An Jordan Lee , .An Josh Elsasser , .An Eric Petit , +.An Mitchell Livingston , and -.An Mitchell Livingston . +.An Mike Gelfand . .Sh SEE ALSO .Xr transmission-create 1 , .Xr transmission-daemon 1 , @@ -91,4 +90,4 @@ and .Xr transmission-remote 1 , .Xr transmission-show 1 .Pp -http://www.transmissionbt.com/ +https://transmissionbt.com/ diff --git a/gtk/transmission-gtk.desktop.in b/gtk/transmission-gtk.desktop.in index 51ee8b771e9..3e606264f6e 100644 --- a/gtk/transmission-gtk.desktop.in +++ b/gtk/transmission-gtk.desktop.in @@ -1,8 +1,9 @@ [Desktop Entry] _Name=Transmission _GenericName=BitTorrent Client -_X-GNOME-FullName=Transmission BitTorrent Client _Comment=Download and share files over BitTorrent +# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! +_Keywords=torrents;downloading;uploading;share;sharing; Exec=transmission-gtk %U Icon=transmission Terminal=false diff --git a/gtk/util.c b/gtk/util.c index 2df5960f2df..a8ed8401cc8 100644 --- a/gtk/util.c +++ b/gtk/util.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* isxdigit () */ @@ -353,7 +352,7 @@ gtr_get_help_uri (void) if (!uri) { - const char * fmt = "http://www.transmissionbt.com/help/gtk/%d.%dx"; + const char * fmt = "https://transmissionbt.com/help/gtk/%d.%dx"; uri = g_strdup_printf (fmt, MAJOR_VERSION, MINOR_VERSION / 10); } diff --git a/gtk/util.h b/gtk/util.h index ac5a9fdfe78..46e18b828c6 100644 --- a/gtk/util.h +++ b/gtk/util.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/libtransmission/CMakeLists.txt b/libtransmission/CMakeLists.txt index 4865dee8f2b..20e92768c1d 100644 --- a/libtransmission/CMakeLists.txt +++ b/libtransmission/CMakeLists.txt @@ -46,6 +46,7 @@ set(${PROJECT_NAME}_SOURCES rpcimpl.c rpc-server.c session.c + session-id.c stats.c torrent.c torrent-ctor.c @@ -105,6 +106,7 @@ set(${PROJECT_NAME}_PUBLIC_HEADERS makemeta.h quark.h rpcimpl.h + session-id.h tr-getopt.h transmission.h utils.h @@ -194,6 +196,14 @@ if(USE_SYSTEM_B64) add_definitions(-DUSE_SYSTEM_B64) endif() +if(CYASSL_IS_WOLFSSL) + add_definitions(-DCYASSL_IS_WOLFSSL) +endif() + +if(POLARSSL_IS_MBEDTLS) + add_definitions(-DPOLARSSL_IS_MBEDTLS) +endif() + include_directories( ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR} @@ -244,16 +254,13 @@ target_link_libraries(${TR_NAME} ${B64_LIBRARIES} ${LIBINTL_LIBRARY} ${LIBM_LIBRARY} + ${TR_NETWORK_LIBRARIES} ) if(ICONV_FOUND) target_link_libraries(${TR_NAME} ${ICONV_LIBRARIES}) endif() -if(WIN32) - target_link_libraries(${TR_NAME} iphlpapi ws2_32) -endif() - if(ENABLE_TESTS) add_library(${TR_NAME}-test STATIC libtransmission-test.c diff --git a/libtransmission/Makefile.am b/libtransmission/Makefile.am index f91769a9594..ba4696104d7 100644 --- a/libtransmission/Makefile.am +++ b/libtransmission/Makefile.am @@ -56,6 +56,7 @@ libtransmission_a_SOURCES = \ rpcimpl.c \ rpc-server.c \ session.c \ + session-id.c \ stats.c \ torrent.c \ torrent-ctor.c \ @@ -99,9 +100,15 @@ libtransmission_a_SOURCES += crypto-utils-openssl.c endif if CRYPTO_USE_CYASSL libtransmission_a_SOURCES += crypto-utils-cyassl.c +if CYASSL_IS_WOLFSSL +AM_CPPFLAGS += -DCYASSL_IS_WOLFSSL +endif endif if CRYPTO_USE_POLARSSL libtransmission_a_SOURCES += crypto-utils-polarssl.c +if POLARSSL_IS_MBEDTLS +AM_CPPFLAGS += -DPOLARSSL_IS_MBEDTLS +endif endif noinst_HEADERS = \ @@ -146,6 +153,7 @@ noinst_HEADERS = \ rpcimpl.h \ rpc-server.h \ session.h \ + session-id.h \ stats.h \ torrent.h \ torrent-magnet.h \ diff --git a/libtransmission/announcer-common.h b/libtransmission/announcer-common.h index 820b9159ca6..1a2d3e8bbbf 100644 --- a/libtransmission/announcer-common.h +++ b/libtransmission/announcer-common.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __LIBTRANSMISSION_ANNOUNCER_MODULE__ diff --git a/libtransmission/announcer-http.c b/libtransmission/announcer-http.c index cb3ad56c5ca..70e0b41a9d9 100644 --- a/libtransmission/announcer-http.c +++ b/libtransmission/announcer-http.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* USHRT_MAX */ diff --git a/libtransmission/announcer-udp.c b/libtransmission/announcer-udp.c index 1a8bf7c8738..68d1be322ba 100644 --- a/libtransmission/announcer-udp.c +++ b/libtransmission/announcer-udp.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #define __LIBTRANSMISSION_ANNOUNCER_MODULE__ diff --git a/libtransmission/announcer.c b/libtransmission/announcer.c index b11d17ceb87..9edc30afc2e 100644 --- a/libtransmission/announcer.c +++ b/libtransmission/announcer.c @@ -4,14 +4,13 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include #include /* INT_MAX */ #include #include /* qsort () */ -#include /* strcmp (), memcpy () */ +#include /* strcmp (), memcpy (), strncmp () */ #include #include /* evtimer */ @@ -1220,9 +1219,9 @@ announce_request_delegate (tr_announcer * announcer, request->peer_id); #endif - if (memcmp (request->url, "http", 4) == 0) + if (strncmp (request->url, "http", 4) == 0) tr_tracker_http_announce (session, request, callback, callback_data); - else if (memcmp (request->url, "udp://", 6) == 0) + else if (strncmp (request->url, "udp://", 6) == 0) tr_tracker_udp_announce (session, request, callback, callback_data); else tr_logAddError ("Unsupported url: %s", request->url); @@ -1399,9 +1398,9 @@ scrape_request_delegate (tr_announcer * announcer, { tr_session * session = announcer->session; - if (memcmp (request->url, "http", 4) == 0) + if (strncmp (request->url, "http", 4) == 0) tr_tracker_http_scrape (session, request, callback, callback_data); - else if (memcmp (request->url, "udp://", 6) == 0) + else if (strncmp (request->url, "udp://", 6) == 0) tr_tracker_udp_scrape (session, request, callback, callback_data); else tr_logAddError ("Unsupported url: %s", request->url); diff --git a/libtransmission/announcer.h b/libtransmission/announcer.h index 134d842e67e..18290cd5113 100644 --- a/libtransmission/announcer.h +++ b/libtransmission/announcer.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/bandwidth.c b/libtransmission/bandwidth.c index 5eaa580c46a..33cc7cd70a2 100644 --- a/libtransmission/bandwidth.c +++ b/libtransmission/bandwidth.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/bandwidth.h b/libtransmission/bandwidth.h index f630bbf1270..ef4eb1d6cb5 100644 --- a/libtransmission/bandwidth.h +++ b/libtransmission/bandwidth.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/bitfield-test.c b/libtransmission/bitfield-test.c index 7d05e2e99ab..9a958edbd23 100644 --- a/libtransmission/bitfield-test.c +++ b/libtransmission/bitfield-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* strlen () */ diff --git a/libtransmission/bitfield.c b/libtransmission/bitfield.c index 4abfb1e1398..5453b3be961 100644 --- a/libtransmission/bitfield.c +++ b/libtransmission/bitfield.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/bitfield.h b/libtransmission/bitfield.h index 7a4af6adcb7..ad43e072a0c 100644 --- a/libtransmission/bitfield.h +++ b/libtransmission/bitfield.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/blocklist-test.c b/libtransmission/blocklist-test.c index 3fd72346d6c..14cdef5b876 100644 --- a/libtransmission/blocklist-test.c +++ b/libtransmission/blocklist-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/blocklist.c b/libtransmission/blocklist.c index cb13f9797aa..cd607e69426 100644 --- a/libtransmission/blocklist.c +++ b/libtransmission/blocklist.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/blocklist.h b/libtransmission/blocklist.h index 7b194cff1cb..e313c15ed82 100644 --- a/libtransmission/blocklist.h +++ b/libtransmission/blocklist.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/cache.c b/libtransmission/cache.c index 80efb7bc6fc..15dc5046c9e 100644 --- a/libtransmission/cache.c +++ b/libtransmission/cache.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* qsort () */ diff --git a/libtransmission/cache.h b/libtransmission/cache.h index 0a419f2a9e9..bf72e4051c0 100644 --- a/libtransmission/cache.h +++ b/libtransmission/cache.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/clients-test.c b/libtransmission/clients-test.c index 53b2871f35f..9eaf828cafd 100644 --- a/libtransmission/clients-test.c +++ b/libtransmission/clients-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include "transmission.h" diff --git a/libtransmission/clients.c b/libtransmission/clients.c index cd701549004..95ddc1a00b4 100644 --- a/libtransmission/clients.c +++ b/libtransmission/clients.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ /* thanks amc1! */ @@ -113,17 +112,18 @@ isMainlineStyle (const uint8_t * peer_id) static bool decodeBitCometClient (char * buf, size_t buflen, const uint8_t * id) { + const char * chid = (char *)id; bool is_bitlord; int major, minor; const char * name; const char * mod = NULL; - if (memcmp (id, "exbc", 4) == 0) mod = ""; - else if (memcmp (id, "FUTB", 4) == 0) mod = " (Solidox Mod) "; - else if (memcmp (id, "xUTB", 4) == 0) mod = " (Mod 2) "; + if (strncmp (chid, "exbc", 4) == 0) mod = ""; + else if (strncmp (chid, "FUTB", 4) == 0) mod = " (Solidox Mod) "; + else if (strncmp (chid, "xUTB", 4) == 0) mod = " (Mod 2) "; else return false; - is_bitlord = memcmp (id+6, "LORD", 4) == 0; + is_bitlord = strncmp (chid+6, "LORD", 4) == 0; name = (is_bitlord) ? "BitLord " : "BitComet "; major = id[4]; minor = id[5]; @@ -144,6 +144,7 @@ char * tr_clientForId (char * buf, size_t buflen, const void * id_in) { const uint8_t * id = id_in; + const char * chid = (char *)id; *buf = '\0'; @@ -153,38 +154,38 @@ tr_clientForId (char * buf, size_t buflen, const void * id_in) /* Azureus-style */ if (id[0] == '-' && id[7] == '-') { - if (memcmp (id+1, "TR", 2) == 0) + if (strncmp (chid+1, "TR", 2) == 0) { - if (memcmp (id+3, "000", 3) == 0) /* very old client style: -TR0006- is 0.6 */ + if (strncmp (chid+3, "000", 3) == 0) /* very old client style: -TR0006- is 0.6 */ tr_snprintf (buf, buflen, "Transmission 0.%c", id[6]); - else if (memcmp (id+3, "00", 2) == 0) /* previous client style: -TR0072- is 0.72 */ + else if (strncmp (chid+3, "00", 2) == 0) /* previous client style: -TR0072- is 0.72 */ tr_snprintf (buf, buflen, "Transmission 0.%02d", strint (id+5,2)); else /* current client style: -TR111Z- is 1.11+ */ tr_snprintf (buf, buflen, "Transmission %d.%02d%s", strint (id+3,1), strint (id+4,2), id[6]=='Z' || id[6]=='X' ? "+" : ""); } - else if (memcmp (id+1, "UT", 2) == 0) + else if (strncmp (chid+1, "UT", 2) == 0) { tr_snprintf (buf, buflen, "\xc2\xb5Torrent %d.%d.%d%s", strint (id+3,1), strint (id+4,1), strint (id+5,1), getMnemonicEnd (id[6])); } - else if (memcmp (id+1, "BT", 2) == 0) + else if (strncmp (chid+1, "BT", 2) == 0) { tr_snprintf (buf, buflen, "BitTorrent %d.%d.%d%s", strint (id+3,1), strint (id+4,1), strint (id+5,1), getMnemonicEnd (id[6])); } - else if (memcmp (id+1, "UM", 2) == 0) + else if (strncmp (chid+1, "UM", 2) == 0) { tr_snprintf (buf, buflen, "\xc2\xb5Torrent Mac %d.%d.%d%s", strint (id+3,1), strint (id+4,1), strint (id+5,1), getMnemonicEnd (id[6])); } - else if (memcmp (id+1, "UE", 2) == 0) + else if (strncmp (chid+1, "UE", 2) == 0) { tr_snprintf (buf, buflen, "\xc2\xb5Torrent Embedded %d.%d.%d%s", strint (id+3,1), strint (id+4,1), strint (id+5,1), getMnemonicEnd (id[6])); } - else if (memcmp (id+1, "AZ", 2) == 0) + else if (strncmp (chid+1, "AZ", 2) == 0) { if (id[3] > '3' || (id[3] == '3' && id[4] >= '1')) /* Vuze starts at version 3.1.0.0 */ four_digits (buf, buflen, "Vuze", id+3); @@ -192,7 +193,7 @@ tr_clientForId (char * buf, size_t buflen, const void * id_in) four_digits (buf, buflen, "Azureus", id+3); } - else if (memcmp (id+1, "KT", 2) == 0) + else if (strncmp (chid+1, "KT", 2) == 0) { if (id[5] == 'D') tr_snprintf (buf, buflen, "KTorrent %d.%d Dev %d", charint (id[3]), charint (id[4]), charint (id[6])); @@ -202,108 +203,108 @@ tr_clientForId (char * buf, size_t buflen, const void * id_in) three_digits (buf, buflen, "KTorrent", id+3); } - else if (memcmp (id+1, "AG", 2) == 0) four_digits (buf, buflen, "Ares", id+3); - else if (memcmp (id+1, "AR", 2) == 0) four_digits (buf, buflen, "Arctic", id+3); - else if (memcmp (id+1, "AT", 2) == 0) four_digits (buf, buflen, "Artemis", id+3); - else if (memcmp (id+1, "AV", 2) == 0) four_digits (buf, buflen, "Avicora", id+3); - else if (memcmp (id+1, "BB", 2) == 0) four_digits (buf, buflen, "BitBuddy", id+3); - else if (memcmp (id+1, "BE", 2) == 0) four_digits (buf, buflen, "BitTorrent SDK", id+3); - else if (memcmp (id+1, "BG", 2) == 0) four_digits (buf, buflen, "BTGetit", id+3); - else if (memcmp (id+1, "BH", 2) == 0) four_digits (buf, buflen, "BitZilla", id+3); - else if (memcmp (id+1, "BM", 2) == 0) four_digits (buf, buflen, "BitMagnet", id+3); - else if (memcmp (id+1, "BP", 2) == 0) four_digits (buf, buflen, "BitTorrent Pro (Azureus + Spyware)", id+3); - else if (memcmp (id+1, "BX", 2) == 0) four_digits (buf, buflen, "BittorrentX", id+3); - else if (memcmp (id+1, "bk", 2) == 0) four_digits (buf, buflen, "BitKitten (libtorrent)", id+3); - else if (memcmp (id+1, "BS", 2) == 0) four_digits (buf, buflen, "BTSlave", id+3); - else if (memcmp (id+1, "BW", 2) == 0) four_digits (buf, buflen, "BitWombat", id+3); - else if (memcmp (id+1, "BX", 2) == 0) four_digits (buf, buflen, "BittorrentX", id+3); - else if (memcmp (id+1, "EB", 2) == 0) four_digits (buf, buflen, "EBit", id+3); - else if (memcmp (id+1, "DE", 2) == 0) four_digits (buf, buflen, "Deluge", id+3); - else if (memcmp (id+1, "DP", 2) == 0) four_digits (buf, buflen, "Propogate Data Client", id+3); - else if (memcmp (id+1, "FC", 2) == 0) four_digits (buf, buflen, "FileCroc", id+3); - else if (memcmp (id+1, "FT", 2) == 0) four_digits (buf, buflen, "FoxTorrent/RedSwoosh", id+3); - else if (memcmp (id+1, "GR", 2) == 0) four_digits (buf, buflen, "GetRight", id+3); - else if (memcmp (id+1, "GS", 2) == 0) four_digits (buf, buflen, "GSTorrent", id+3); - else if (memcmp (id+1, "HK", 2) == 0) four_digits (buf, buflen, "Hekate", id+3); - else if (memcmp (id+1, "HN", 2) == 0) four_digits (buf, buflen, "Hydranode", id+3); - else if (memcmp (id+1, "KG", 2) == 0) four_digits (buf, buflen, "KGet", id+3); - else if (memcmp (id+1, "LC", 2) == 0) four_digits (buf, buflen, "LeechCraft", id+3); - else if (memcmp (id+1, "LH", 2) == 0) four_digits (buf, buflen, "LH-ABC", id+3); - else if (memcmp (id+1, "NX", 2) == 0) four_digits (buf, buflen, "Net Transport", id+3); - else if (memcmp (id+1, "MK", 2) == 0) four_digits (buf, buflen, "Meerkat", id+3); - else if (memcmp (id+1, "MO", 2) == 0) four_digits (buf, buflen, "MonoTorrent", id+3); - else if (memcmp (id+1, "MR", 2) == 0) four_digits (buf, buflen, "Miro", id+3); - else if (memcmp (id+1, "MT", 2) == 0) four_digits (buf, buflen, "Moonlight", id+3); - else if (memcmp (id+1, "OS", 2) == 0) four_digits (buf, buflen, "OneSwarm", id+3); - else if (memcmp (id+1, "OT", 2) == 0) four_digits (buf, buflen, "OmegaTorrent", id+3); - else if (memcmp (id+1, "PD", 2) == 0) four_digits (buf, buflen, "Pando", id+3); - else if (memcmp (id+1, "QD", 2) == 0) four_digits (buf, buflen, "QQDownload", id+3); - else if (memcmp (id+1, "RS", 2) == 0) four_digits (buf, buflen, "Rufus", id+3); - else if (memcmp (id+1, "RT", 2) == 0) four_digits (buf, buflen, "Retriever", id+3); - else if (memcmp (id+1, "RZ", 2) == 0) four_digits (buf, buflen, "RezTorrent", id+3); - else if (memcmp (id+1, "SD", 2) == 0) four_digits (buf, buflen, "Thunder", id+3); - else if (memcmp (id+1, "SM", 2) == 0) four_digits (buf, buflen, "SoMud", id+3); - else if (memcmp (id+1, "SS", 2) == 0) four_digits (buf, buflen, "SwarmScope", id+3); - else if (memcmp (id+1, "ST", 2) == 0) four_digits (buf, buflen, "SymTorrent", id+3); - else if (memcmp (id+1, "SZ", 2) == 0) four_digits (buf, buflen, "Shareaza", id+3); - else if (memcmp (id+1, "S~", 2) == 0) four_digits (buf, buflen, "Shareaza", id+3); - else if (memcmp (id+1, "st", 2) == 0) four_digits (buf, buflen, "SharkTorrent", id+3); - else if (memcmp (id+1, "TN", 2) == 0) four_digits (buf, buflen, "Torrent .NET", id+3); - else if (memcmp (id+1, "TS", 2) == 0) four_digits (buf, buflen, "TorrentStorm", id+3); - else if (memcmp (id+1, "TT", 2) == 0) four_digits (buf, buflen, "TuoTu", id+3); - else if (memcmp (id+1, "UL", 2) == 0) four_digits (buf, buflen, "uLeecher!", id+3); - else if (memcmp (id+1, "VG", 2) == 0) four_digits (buf, buflen, "Vagaa", id+3); - else if (memcmp (id+1, "WT", 2) == 0) four_digits (buf, buflen, "BitLet", id+3); - else if (memcmp (id+1, "WY", 2) == 0) four_digits (buf, buflen, "FireTorrent", id+3); - else if (memcmp (id+1, "XL", 2) == 0) four_digits (buf, buflen, "Xunlei", id+3); - else if (memcmp (id+1, "XS", 2) == 0) four_digits (buf, buflen, "XSwifter", id+3); - else if (memcmp (id+1, "XT", 2) == 0) four_digits (buf, buflen, "XanTorrent", id+3); - else if (memcmp (id+1, "XX", 2) == 0) four_digits (buf, buflen, "Xtorrent", id+3); - else if (memcmp (id+1, "ZT", 2) == 0) four_digits (buf, buflen, "Zip Torrent", id+3); - else if (memcmp (id+1, "ZO", 2) == 0) four_digits (buf, buflen, "Zona", id+3); - - else if (memcmp (id+1, "AG", 2) == 0) three_digits (buf, buflen, "Ares", id+3); - else if (memcmp (id+1, "A~", 2) == 0) three_digits (buf, buflen, "Ares", id+3); - else if (memcmp (id+1, "ES", 2) == 0) three_digits (buf, buflen, "Electric Sheep", id+3); - else if (memcmp (id+1, "HL", 2) == 0) three_digits (buf, buflen, "Halite", id+3); - else if (memcmp (id+1, "LT", 2) == 0) three_digits (buf, buflen, "libtorrent (Rasterbar)", id+3); - else if (memcmp (id+1, "lt", 2) == 0) three_digits (buf, buflen, "libTorrent (Rakshasa)", id+3); - else if (memcmp (id+1, "MP", 2) == 0) three_digits (buf, buflen, "MooPolice", id+3); - else if (memcmp (id+1, "pb", 2) == 0) three_digits (buf, buflen, "pbTorrent", id+3); - else if (memcmp (id+1, "TT", 2) == 0) three_digits (buf, buflen, "TuoTu", id+3); - else if (memcmp (id+1, "qB", 2) == 0) three_digits (buf, buflen, "qBittorrent", id+3); - - else if (memcmp (id+1, "AX", 2) == 0) two_major_two_minor (buf, buflen, "BitPump", id+3); - else if (memcmp (id+1, "BC", 2) == 0) two_major_two_minor (buf, buflen, "BitComet", id+3); - else if (memcmp (id+1, "CD", 2) == 0) two_major_two_minor (buf, buflen, "Enhanced CTorrent", id+3); - else if (memcmp (id+1, "LP", 2) == 0) two_major_two_minor (buf, buflen, "Lphant", id+3); - - else if (memcmp (id+1, "BF", 2) == 0) no_version (buf, buflen, "BitFlu"); - else if (memcmp (id+1, "LW", 2) == 0) no_version (buf, buflen, "LimeWire"); - - else if (memcmp (id+1, "BB", 2) == 0) + else if (strncmp (chid+1, "AG", 2) == 0) four_digits (buf, buflen, "Ares", id+3); + else if (strncmp (chid+1, "AR", 2) == 0) four_digits (buf, buflen, "Arctic", id+3); + else if (strncmp (chid+1, "AT", 2) == 0) four_digits (buf, buflen, "Artemis", id+3); + else if (strncmp (chid+1, "AV", 2) == 0) four_digits (buf, buflen, "Avicora", id+3); + else if (strncmp (chid+1, "BB", 2) == 0) four_digits (buf, buflen, "BitBuddy", id+3); + else if (strncmp (chid+1, "BE", 2) == 0) four_digits (buf, buflen, "BitTorrent SDK", id+3); + else if (strncmp (chid+1, "BG", 2) == 0) four_digits (buf, buflen, "BTGetit", id+3); + else if (strncmp (chid+1, "BH", 2) == 0) four_digits (buf, buflen, "BitZilla", id+3); + else if (strncmp (chid+1, "BM", 2) == 0) four_digits (buf, buflen, "BitMagnet", id+3); + else if (strncmp (chid+1, "BP", 2) == 0) four_digits (buf, buflen, "BitTorrent Pro (Azureus + Spyware)", id+3); + else if (strncmp (chid+1, "BX", 2) == 0) four_digits (buf, buflen, "BittorrentX", id+3); + else if (strncmp (chid+1, "bk", 2) == 0) four_digits (buf, buflen, "BitKitten (libtorrent)", id+3); + else if (strncmp (chid+1, "BS", 2) == 0) four_digits (buf, buflen, "BTSlave", id+3); + else if (strncmp (chid+1, "BW", 2) == 0) four_digits (buf, buflen, "BitWombat", id+3); + else if (strncmp (chid+1, "BX", 2) == 0) four_digits (buf, buflen, "BittorrentX", id+3); + else if (strncmp (chid+1, "EB", 2) == 0) four_digits (buf, buflen, "EBit", id+3); + else if (strncmp (chid+1, "DE", 2) == 0) four_digits (buf, buflen, "Deluge", id+3); + else if (strncmp (chid+1, "DP", 2) == 0) four_digits (buf, buflen, "Propagate Data Client", id+3); + else if (strncmp (chid+1, "FC", 2) == 0) four_digits (buf, buflen, "FileCroc", id+3); + else if (strncmp (chid+1, "FT", 2) == 0) four_digits (buf, buflen, "FoxTorrent/RedSwoosh", id+3); + else if (strncmp (chid+1, "GR", 2) == 0) four_digits (buf, buflen, "GetRight", id+3); + else if (strncmp (chid+1, "GS", 2) == 0) four_digits (buf, buflen, "GSTorrent", id+3); + else if (strncmp (chid+1, "HK", 2) == 0) four_digits (buf, buflen, "Hekate", id+3); + else if (strncmp (chid+1, "HN", 2) == 0) four_digits (buf, buflen, "Hydranode", id+3); + else if (strncmp (chid+1, "KG", 2) == 0) four_digits (buf, buflen, "KGet", id+3); + else if (strncmp (chid+1, "LC", 2) == 0) four_digits (buf, buflen, "LeechCraft", id+3); + else if (strncmp (chid+1, "LH", 2) == 0) four_digits (buf, buflen, "LH-ABC", id+3); + else if (strncmp (chid+1, "NX", 2) == 0) four_digits (buf, buflen, "Net Transport", id+3); + else if (strncmp (chid+1, "MK", 2) == 0) four_digits (buf, buflen, "Meerkat", id+3); + else if (strncmp (chid+1, "MO", 2) == 0) four_digits (buf, buflen, "MonoTorrent", id+3); + else if (strncmp (chid+1, "MR", 2) == 0) four_digits (buf, buflen, "Miro", id+3); + else if (strncmp (chid+1, "MT", 2) == 0) four_digits (buf, buflen, "Moonlight", id+3); + else if (strncmp (chid+1, "OS", 2) == 0) four_digits (buf, buflen, "OneSwarm", id+3); + else if (strncmp (chid+1, "OT", 2) == 0) four_digits (buf, buflen, "OmegaTorrent", id+3); + else if (strncmp (chid+1, "PD", 2) == 0) four_digits (buf, buflen, "Pando", id+3); + else if (strncmp (chid+1, "QD", 2) == 0) four_digits (buf, buflen, "QQDownload", id+3); + else if (strncmp (chid+1, "RS", 2) == 0) four_digits (buf, buflen, "Rufus", id+3); + else if (strncmp (chid+1, "RT", 2) == 0) four_digits (buf, buflen, "Retriever", id+3); + else if (strncmp (chid+1, "RZ", 2) == 0) four_digits (buf, buflen, "RezTorrent", id+3); + else if (strncmp (chid+1, "SD", 2) == 0) four_digits (buf, buflen, "Thunder", id+3); + else if (strncmp (chid+1, "SM", 2) == 0) four_digits (buf, buflen, "SoMud", id+3); + else if (strncmp (chid+1, "SS", 2) == 0) four_digits (buf, buflen, "SwarmScope", id+3); + else if (strncmp (chid+1, "ST", 2) == 0) four_digits (buf, buflen, "SymTorrent", id+3); + else if (strncmp (chid+1, "SZ", 2) == 0) four_digits (buf, buflen, "Shareaza", id+3); + else if (strncmp (chid+1, "S~", 2) == 0) four_digits (buf, buflen, "Shareaza", id+3); + else if (strncmp (chid+1, "st", 2) == 0) four_digits (buf, buflen, "SharkTorrent", id+3); + else if (strncmp (chid+1, "TN", 2) == 0) four_digits (buf, buflen, "Torrent .NET", id+3); + else if (strncmp (chid+1, "TS", 2) == 0) four_digits (buf, buflen, "TorrentStorm", id+3); + else if (strncmp (chid+1, "TT", 2) == 0) four_digits (buf, buflen, "TuoTu", id+3); + else if (strncmp (chid+1, "UL", 2) == 0) four_digits (buf, buflen, "uLeecher!", id+3); + else if (strncmp (chid+1, "VG", 2) == 0) four_digits (buf, buflen, "Vagaa", id+3); + else if (strncmp (chid+1, "WT", 2) == 0) four_digits (buf, buflen, "BitLet", id+3); + else if (strncmp (chid+1, "WY", 2) == 0) four_digits (buf, buflen, "FireTorrent", id+3); + else if (strncmp (chid+1, "XL", 2) == 0) four_digits (buf, buflen, "Xunlei", id+3); + else if (strncmp (chid+1, "XS", 2) == 0) four_digits (buf, buflen, "XSwifter", id+3); + else if (strncmp (chid+1, "XT", 2) == 0) four_digits (buf, buflen, "XanTorrent", id+3); + else if (strncmp (chid+1, "XX", 2) == 0) four_digits (buf, buflen, "Xtorrent", id+3); + else if (strncmp (chid+1, "ZT", 2) == 0) four_digits (buf, buflen, "Zip Torrent", id+3); + else if (strncmp (chid+1, "ZO", 2) == 0) four_digits (buf, buflen, "Zona", id+3); + + else if (strncmp (chid+1, "AG", 2) == 0) three_digits (buf, buflen, "Ares", id+3); + else if (strncmp (chid+1, "A~", 2) == 0) three_digits (buf, buflen, "Ares", id+3); + else if (strncmp (chid+1, "ES", 2) == 0) three_digits (buf, buflen, "Electric Sheep", id+3); + else if (strncmp (chid+1, "HL", 2) == 0) three_digits (buf, buflen, "Halite", id+3); + else if (strncmp (chid+1, "LT", 2) == 0) three_digits (buf, buflen, "libtorrent (Rasterbar)", id+3); + else if (strncmp (chid+1, "lt", 2) == 0) three_digits (buf, buflen, "libTorrent (Rakshasa)", id+3); + else if (strncmp (chid+1, "MP", 2) == 0) three_digits (buf, buflen, "MooPolice", id+3); + else if (strncmp (chid+1, "pb", 2) == 0) three_digits (buf, buflen, "pbTorrent", id+3); + else if (strncmp (chid+1, "TT", 2) == 0) three_digits (buf, buflen, "TuoTu", id+3); + else if (strncmp (chid+1, "qB", 2) == 0) three_digits (buf, buflen, "qBittorrent", id+3); + + else if (strncmp (chid+1, "AX", 2) == 0) two_major_two_minor (buf, buflen, "BitPump", id+3); + else if (strncmp (chid+1, "BC", 2) == 0) two_major_two_minor (buf, buflen, "BitComet", id+3); + else if (strncmp (chid+1, "CD", 2) == 0) two_major_two_minor (buf, buflen, "Enhanced CTorrent", id+3); + else if (strncmp (chid+1, "LP", 2) == 0) two_major_two_minor (buf, buflen, "Lphant", id+3); + + else if (strncmp (chid+1, "BF", 2) == 0) no_version (buf, buflen, "BitFlu"); + else if (strncmp (chid+1, "LW", 2) == 0) no_version (buf, buflen, "LimeWire"); + + else if (strncmp (chid+1, "BB", 2) == 0) { tr_snprintf (buf, buflen, "BitBuddy %c.%c%c%c", id[3], id[4], id[5], id[6]); } - else if (memcmp (id+1, "BR", 2) == 0) + else if (strncmp (chid+1, "BR", 2) == 0) { tr_snprintf (buf, buflen, "BitRocket %c.%c (%c%c)", id[3], id[4], id[5], id[6]); } - else if (memcmp (id+1, "CT", 2) == 0) + else if (strncmp (chid+1, "CT", 2) == 0) { tr_snprintf (buf, buflen, "CTorrent %d.%d.%02d", charint (id[3]), charint (id[4]), strint (id+5,2)); } - else if (memcmp (id+1, "XC", 2) == 0 || memcmp (id+1, "XX", 2) == 0) + else if (strncmp (chid+1, "XC", 2) == 0 || strncmp (chid+1, "XX", 2) == 0) { tr_snprintf (buf, buflen, "Xtorrent %d.%d (%d)", charint (id[3]), charint (id[4]), strint (id+5,2)); } - else if (memcmp (id+1, "BOW", 3) == 0) + else if (strncmp (chid+1, "BOW", 3) == 0) { - if (memcmp (&id[4], "A0B", 3) == 0) tr_snprintf (buf, buflen, "Bits on Wheels 1.0.5"); - else if (memcmp (&id[4], "A0C", 3) == 0) tr_snprintf (buf, buflen, "Bits on Wheels 1.0.6"); + if (strncmp (&chid[4], "A0B", 3) == 0) tr_snprintf (buf, buflen, "Bits on Wheels 1.0.5"); + else if (strncmp (&chid[4], "A0C", 3) == 0) tr_snprintf (buf, buflen, "Bits on Wheels 1.0.6"); else tr_snprintf (buf, buflen, "Bits on Wheels %c.%c.%c", id[4], id[5], id[5]); } - else if (memcmp (id+1, "MG", 2) == 0) + else if (strncmp (chid+1, "MG", 2) == 0) { tr_snprintf (buf, buflen, "MediaGet %d.%02d", charint (id[3]), charint (id[4])); } @@ -315,17 +316,17 @@ tr_clientForId (char * buf, size_t buflen, const void * id_in) /* uTorrent will replace the trailing dash with an extra digit for longer version numbers */ if (id[0] == '-') { - if (memcmp (id+1, "UT", 2) == 0) + if (strncmp (chid+1, "UT", 2) == 0) { tr_snprintf (buf, buflen, "\xc2\xb5Torrent %d.%d.%d%s", strint (id+3,1), strint (id+4,1), strint (id+5,2), getMnemonicEnd (id[7])); } - else if (memcmp (id+1, "UM", 2) == 0) + else if (strncmp (chid+1, "UM", 2) == 0) { tr_snprintf (buf, buflen, "\xc2\xb5Torrent Mac %d.%d.%d%s", strint (id+3,1), strint (id+4,1), strint (id+5,2), getMnemonicEnd (id[7])); } - else if (memcmp (id+1, "UE", 2) == 0) + else if (strncmp (chid+1, "UE", 2) == 0) { tr_snprintf (buf, buflen, "\xc2\xb5Torrent Embedded %d.%d.%d%s", strint (id+3,1), strint (id+4,1), strint (id+5,2), getMnemonicEnd (id[7])); @@ -347,76 +348,76 @@ tr_clientForId (char * buf, size_t buflen, const void * id_in) return buf; /* Clients with no version */ - if (memcmp (id, "AZ2500BT", 8) == 0) no_version (buf, buflen, "BitTyrant (Azureus Mod)"); - else if (memcmp (id, "LIME", 4) == 0) no_version (buf, buflen, "Limewire"); - else if (memcmp (id, "martini", 7) == 0) no_version (buf, buflen, "Martini Man"); - else if (memcmp (id, "Pando", 5) == 0) no_version (buf, buflen, "Pando"); - else if (memcmp (id, "a00---0", 7) == 0) no_version (buf, buflen, "Swarmy"); - else if (memcmp (id, "a02---0", 7) == 0) no_version (buf, buflen, "Swarmy"); - else if (memcmp (id, "-G3", 3) == 0) no_version (buf, buflen, "G3 Torrent"); - else if (memcmp (id, "10-------", 9) == 0) no_version (buf, buflen, "JVtorrent"); - else if (memcmp (id, "346-", 4) == 0) no_version (buf, buflen, "TorrentTopia"); - else if (memcmp (id, "eX", 2) == 0) no_version (buf, buflen, "eXeem"); - else if (memcmp (id, "aria2-", 6) == 0) no_version (buf, buflen, "aria2"); - else if (memcmp (id, "-WT-", 4) == 0) no_version (buf, buflen, "BitLet"); - else if (memcmp (id, "-FG", 3) == 0) two_major_two_minor (buf, buflen, "FlashGet", id+3); + if (strncmp (chid, "AZ2500BT", 8) == 0) no_version (buf, buflen, "BitTyrant (Azureus Mod)"); + else if (strncmp (chid, "LIME", 4) == 0) no_version (buf, buflen, "Limewire"); + else if (strncmp (chid, "martini", 7) == 0) no_version (buf, buflen, "Martini Man"); + else if (strncmp (chid, "Pando", 5) == 0) no_version (buf, buflen, "Pando"); + else if (strncmp (chid, "a00---0", 7) == 0) no_version (buf, buflen, "Swarmy"); + else if (strncmp (chid, "a02---0", 7) == 0) no_version (buf, buflen, "Swarmy"); + else if (strncmp (chid, "-G3", 3) == 0) no_version (buf, buflen, "G3 Torrent"); + else if (strncmp (chid, "10-------", 9) == 0) no_version (buf, buflen, "JVtorrent"); + else if (strncmp (chid, "346-", 4) == 0) no_version (buf, buflen, "TorrentTopia"); + else if (strncmp (chid, "eX", 2) == 0) no_version (buf, buflen, "eXeem"); + else if (strncmp (chid, "aria2-", 6) == 0) no_version (buf, buflen, "aria2"); + else if (strncmp (chid, "-WT-", 4) == 0) no_version (buf, buflen, "BitLet"); + else if (strncmp (chid, "-FG", 3) == 0) two_major_two_minor (buf, buflen, "FlashGet", id+3); /* Everything else */ - else if (memcmp (id, "S3", 2) == 0 && id[2] == '-' && id[4] == '-' && id[6] == '-') + else if (strncmp (chid, "S3", 2) == 0 && id[2] == '-' && id[4] == '-' && id[6] == '-') { tr_snprintf (buf, buflen, "Amazon S3 %c.%c.%c", id[3], id[5], id[7]); } - else if (memcmp (id, "OP", 2) == 0) + else if (strncmp (chid, "OP", 2) == 0) { tr_snprintf (buf, buflen, "Opera (Build %c%c%c%c)", id[2], id[3], id[4], id[5]); } - else if (memcmp (id, "-ML", 3) == 0) + else if (strncmp (chid, "-ML", 3) == 0) { tr_snprintf (buf, buflen, "MLDonkey %c%c%c%c%c", id[3], id[4], id[5], id[6], id[7]); } - else if (memcmp (id, "DNA", 3) == 0) + else if (strncmp (chid, "DNA", 3) == 0) { tr_snprintf (buf, buflen, "BitTorrent DNA %d.%d.%d", strint (id+3,2), strint (id+5,2), strint (id+7,2)); } - else if (memcmp (id, "Plus", 4) == 0) + else if (strncmp (chid, "Plus", 4) == 0) { tr_snprintf (buf, buflen, "Plus! v2 %c.%c%c", id[4], id[5], id[6]); } - else if (memcmp (id, "XBT", 3) == 0) + else if (strncmp (chid, "XBT", 3) == 0) { tr_snprintf (buf, buflen, "XBT Client %c.%c.%c%s", id[3], id[4], id[5], getMnemonicEnd (id[6])); } - else if (memcmp (id, "Mbrst", 5) == 0) + else if (strncmp (chid, "Mbrst", 5) == 0) { tr_snprintf (buf, buflen, "burst! %c.%c.%c", id[5], id[7], id[9]); } - else if (memcmp (id, "btpd", 4) == 0) + else if (strncmp (chid, "btpd", 4) == 0) { tr_snprintf (buf, buflen, "BT Protocol Daemon %c%c%c", id[5], id[6], id[7]); } - else if (memcmp (id, "BLZ", 3) == 0) + else if (strncmp (chid, "BLZ", 3) == 0) { tr_snprintf (buf, buflen, "Blizzard Downloader %d.%d", id[3]+1, id[4]); } - else if (memcmp (id, "-SP", 3) == 0) + else if (strncmp (chid, "-SP", 3) == 0) { three_digits (buf, buflen, "BitSpirit", id+3); } - else if ('\0' == id[0] && memcmp (id+2, "BS", 2) == 0) + else if ('\0' == id[0] && strncmp (chid+2, "BS", 2) == 0) { tr_snprintf (buf, buflen, "BitSpirit %u", (id[1] == 0 ? 1 : id[1])); } - else if (memcmp (id, "QVOD", 4) == 0) + else if (strncmp (chid, "QVOD", 4) == 0) { four_digits (buf, buflen, "QVOD", id+4); } - else if (memcmp (id, "-NE", 3) == 0) + else if (strncmp (chid, "-NE", 3) == 0) { four_digits (buf, buflen, "BT Next Evolution", id+3); } - else if (memcmp (id, "TIX", 3) == 0) + else if (strncmp (chid, "TIX", 3) == 0) { two_major_two_minor (buf, buflen, "Tixati", id+3); } diff --git a/libtransmission/clients.h b/libtransmission/clients.h index 90684d12046..0026f18db3a 100644 --- a/libtransmission/clients.h +++ b/libtransmission/clients.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/completion.c b/libtransmission/completion.c index 1ed6e68534d..7ce936a9286 100644 --- a/libtransmission/completion.c +++ b/libtransmission/completion.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/completion.h b/libtransmission/completion.h index f85506340e6..fbfdc84b6fc 100644 --- a/libtransmission/completion.h +++ b/libtransmission/completion.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/crypto-test-ref.h b/libtransmission/crypto-test-ref.h index 843f3fbc35b..8cf10567498 100644 --- a/libtransmission/crypto-test-ref.h +++ b/libtransmission/crypto-test-ref.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef TR_CRYPTO_TEST_REF_H diff --git a/libtransmission/crypto-test.c b/libtransmission/crypto-test.c index e2a145e56a1..f4252f2c247 100644 --- a/libtransmission/crypto-test.c +++ b/libtransmission/crypto-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -117,22 +116,30 @@ test_sha1 (void) static int test_ssha1 (void) { - const char * const test_data[] = - { - "test", - "QNY)(*#$B)!_X$B !_B#($^!)*&$%CV!#)&$C!@$(P*)" - }; + struct + { + const char * const plain_text; + const char * const ssha1; + } + test_data[] = + { + { "test", "{15ad0621b259a84d24dcd4e75b09004e98a3627bAMbyRHJy" }, + { "QNY)(*#$B)!_X$B !_B#($^!)*&$%CV!#)&$C!@$(P*)", "{10e2d7acbb104d970514a147cd16d51dfa40fb3c0OSwJtOL" } + }; size_t i; -#define HASH_COUNT (16 * 1024) +#define HASH_COUNT (4 * 1024) for (i = 0; i < sizeof (test_data) / sizeof (*test_data); ++i) { - char * const phrase = tr_strdup (test_data[i]); + char * const phrase = tr_strdup (test_data[i].plain_text); char ** hashes = tr_new (char *, HASH_COUNT); size_t j; + check (tr_ssha1_matches (test_data[i].ssha1, phrase)); + check (tr_ssha1_matches_ (test_data[i].ssha1, phrase)); + for (j = 0; j < HASH_COUNT; ++j) { hashes[j] = j % 2 == 0 ? tr_ssha1 (phrase) : tr_ssha1_ (phrase); @@ -174,6 +181,10 @@ test_ssha1 (void) #undef HASH_COUNT + /* should work with different salt lengths as well */ + check (tr_ssha1_matches ("{a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "test")); + check (tr_ssha1_matches ("{d209a21d3bc4f8fc4f8faf347e69f3def597eb170pySy4ai1ZPMjeU1", "test")); + return 0; } diff --git a/libtransmission/crypto-utils-cyassl.c b/libtransmission/crypto-utils-cyassl.c index 8794af49b79..e22f6395164 100644 --- a/libtransmission/crypto-utils-cyassl.c +++ b/libtransmission/crypto-utils-cyassl.c @@ -4,17 +4,28 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ +#if defined (CYASSL_IS_WOLFSSL) + #define API_HEADER(x) + #define API_HEADER_CRYPT(x) API_HEADER (wolfcrypt/x) + #define API(x) wc_##x + #define API_VERSION_HEX LIBWOLFSSL_VERSION_HEX +#else + #define API_HEADER(x) + #define API_HEADER_CRYPT(x) API_HEADER (ctaocrypt/x) + #define API(x) x + #define API_VERSION_HEX LIBCYASSL_VERSION_HEX +#endif + #include -#include -#include -#include -#include -#include -#include +#include API_HEADER_CRYPT (arc4.h) +#include API_HEADER_CRYPT (dh.h) +#include API_HEADER_CRYPT (error-crypt.h) +#include API_HEADER_CRYPT (random.h) +#include API_HEADER_CRYPT (sha.h) +#include API_HEADER (version.h) #include "transmission.h" #include "crypto-utils.h" @@ -46,7 +57,9 @@ log_cyassl_error (int error_code, { if (tr_logLevelIsActive (TR_LOG_ERROR)) { -#if LIBCYASSL_VERSION_HEX >= 0x03000002 +#if API_VERSION_HEX >= 0x03004000 + const char * error_message = API (GetErrorString) (error_code); +#elif API_VERSION_HEX >= 0x03000002 const char * error_message = CTaoCryptGetErrorString (error_code); #else char error_message[CYASSL_MAX_ERROR_SZ]; @@ -82,7 +95,7 @@ get_rng (void) if (!rng_initialized) { - if (!check_result (InitRng (&rng))) + if (!check_result (API (InitRng) (&rng))) return NULL; rng_initialized = true; } @@ -110,7 +123,7 @@ tr_sha1_init (void) { Sha * handle = tr_new (Sha, 1); - if (check_result (InitSha (handle))) + if (check_result (API (InitSha) (handle))) return handle; tr_free (handle); @@ -129,7 +142,7 @@ tr_sha1_update (tr_sha1_ctx_t handle, assert (data != NULL); - return check_result (ShaUpdate (handle, data, data_length)); + return check_result (API (ShaUpdate) (handle, data, data_length)); } bool @@ -142,7 +155,7 @@ tr_sha1_final (tr_sha1_ctx_t handle, { assert (handle != NULL); - ret = check_result (ShaFinal (handle, hash)); + ret = check_result (API (ShaFinal) (handle, hash)); } tr_free (handle); @@ -173,7 +186,7 @@ tr_rc4_set_key (tr_rc4_ctx_t handle, assert (handle != NULL); assert (key != NULL); - Arc4SetKey (handle, key, key_length); + API (Arc4SetKey) (handle, key, key_length); } void @@ -190,7 +203,7 @@ tr_rc4_process (tr_rc4_ctx_t handle, assert (input != NULL); assert (output != NULL); - Arc4Process (handle, output, input, length); + API (Arc4Process) (handle, output, input, length); } /*** @@ -208,10 +221,10 @@ tr_dh_new (const uint8_t * prime_num, assert (prime_num != NULL); assert (generator_num != NULL); - InitDhKey (&handle->dh); - if (!check_result (DhSetKey (&handle->dh, - prime_num, prime_num_length, - generator_num, generator_num_length))) + API (InitDhKey) (&handle->dh); + if (!check_result (API (DhSetKey) (&handle->dh, + prime_num, prime_num_length, + generator_num, generator_num_length))) { tr_free (handle); return NULL; @@ -230,7 +243,7 @@ tr_dh_free (tr_dh_ctx_t raw_handle) if (handle == NULL) return; - FreeDhKey (&handle->dh); + API (FreeDhKey) (&handle->dh); tr_free (handle->private_key); tr_free (handle); } @@ -253,9 +266,9 @@ tr_dh_make_key (tr_dh_ctx_t raw_handle, tr_lockLock (rng_lock); - if (!check_result (DhGenerateKeyPair (&handle->dh, get_rng (), - handle->private_key, &my_private_key_length, - public_key, &my_public_key_length))) + if (!check_result (API (DhGenerateKeyPair) (&handle->dh, get_rng (), + handle->private_key, &my_private_key_length, + public_key, &my_public_key_length))) { tr_lockUnlock (rng_lock); return false; @@ -287,10 +300,10 @@ tr_dh_agree (tr_dh_ctx_t raw_handle, ret = tr_dh_secret_new (handle->key_length); - if (check_result (DhAgree (&handle->dh, - ret->key, &my_secret_key_length, - handle->private_key, handle->private_key_length, - other_public_key, other_public_key_length))) + if (check_result (API (DhAgree) (&handle->dh, + ret->key, &my_secret_key_length, + handle->private_key, handle->private_key_length, + other_public_key, other_public_key_length))) { tr_dh_secret_align (ret, my_secret_key_length); } @@ -317,7 +330,7 @@ tr_rand_buffer (void * buffer, assert (buffer != NULL); tr_lockLock (rng_lock); - ret = check_result (RNG_GenerateBlock (get_rng (), buffer, length)); + ret = check_result (API (RNG_GenerateBlock) (get_rng (), buffer, length)); tr_lockUnlock (rng_lock); return ret; diff --git a/libtransmission/crypto-utils-fallback.c b/libtransmission/crypto-utils-fallback.c index 0ca1ad75eb4..c9ca8036d42 100644 --- a/libtransmission/crypto-utils-fallback.c +++ b/libtransmission/crypto-utils-fallback.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ /* This file is designed specifically to be included by other source files to diff --git a/libtransmission/crypto-utils-openssl.c b/libtransmission/crypto-utils-openssl.c index 77a628bea5c..9fd2c58a5ca 100644 --- a/libtransmission/crypto-utils-openssl.c +++ b/libtransmission/crypto-utils-openssl.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifdef __APPLE__ @@ -15,6 +14,7 @@ #include #include +#include #include #include #include @@ -49,7 +49,12 @@ log_openssl_error (const char * file, static bool strings_loaded = false; if (!strings_loaded) { +#if OPENSSL_VERSION_NUMBER < 0x10100000 ERR_load_crypto_strings (); +#else + OPENSSL_init_crypto (OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL); +#endif + strings_loaded = true; } #endif @@ -230,6 +235,63 @@ tr_rc4_process (tr_rc4_ctx_t handle, **** ***/ +#if OPENSSL_VERSION_NUMBER < 0x10100000 + +static inline int +DH_set0_pqg (DH * dh, + BIGNUM * p, + BIGNUM * q, + BIGNUM * g) +{ + /* If the fields p and g in d are NULL, the corresponding input + * parameters MUST be non-NULL. q may remain NULL. + */ + if ((dh->p == NULL && p == NULL) || (dh->g == NULL && g == NULL)) + return 0; + + if (p != NULL) + { + BN_free (dh->p); + dh->p = p; + } + if (q != NULL) + { + BN_free (dh->q); + dh->q = q; + } + if (g != NULL) + { + BN_free (dh->g); + dh->g = g; + } + + if (q != NULL) + dh->length = BN_num_bits (q); + + return 1; +} + +static inline int +DH_set_length (DH * dh, + long length) +{ + dh->length = length; + return 1; +} + +static inline void +DH_get0_key(const DH * dh, + const BIGNUM ** pub_key, + const BIGNUM ** priv_key) +{ + if (pub_key != NULL) + *pub_key = dh->pub_key; + if (priv_key != NULL) + *priv_key = dh->priv_key; +} + +#endif + tr_dh_ctx_t tr_dh_new (const uint8_t * prime_num, size_t prime_num_length, @@ -237,13 +299,18 @@ tr_dh_new (const uint8_t * prime_num, size_t generator_num_length) { DH * handle = DH_new (); + BIGNUM * p, * g; assert (prime_num != NULL); assert (generator_num != NULL); - if (!check_pointer (handle->p = BN_bin2bn (prime_num, prime_num_length, NULL)) || - !check_pointer (handle->g = BN_bin2bn (generator_num, generator_num_length, NULL))) + p = BN_bin2bn (prime_num, prime_num_length, NULL); + g = BN_bin2bn (generator_num, generator_num_length, NULL); + + if (!check_pointer (p) || !check_pointer (g) || !DH_set0_pqg (handle, p, NULL, g)) { + BN_free (p); + BN_free (g); DH_free (handle); handle = NULL; } @@ -268,16 +335,19 @@ tr_dh_make_key (tr_dh_ctx_t raw_handle, { DH * handle = raw_handle; int dh_size, my_public_key_length; + const BIGNUM * my_public_key; assert (handle != NULL); assert (public_key != NULL); - handle->length = private_key_length * 8; + DH_set_length(handle, private_key_length * 8); if (!check_result (DH_generate_key (handle))) return false; - my_public_key_length = BN_bn2bin (handle->pub_key, public_key); + DH_get0_key (handle, &my_public_key, NULL); + + my_public_key_length = BN_bn2bin (my_public_key, public_key); dh_size = DH_size (handle); tr_dh_align_key (public_key, my_public_key_length, dh_size); diff --git a/libtransmission/crypto-utils-polarssl.c b/libtransmission/crypto-utils-polarssl.c index 1c59a7f6ed4..d3d796ea1ce 100644 --- a/libtransmission/crypto-utils-polarssl.c +++ b/libtransmission/crypto-utils-polarssl.c @@ -1,21 +1,30 @@ /* - * This file Copyright (C) 2014-2015 Mnemosyne LLC + * This file Copyright (C) 2014-2016 Mnemosyne LLC * * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ +#if defined (POLARSSL_IS_MBEDTLS) + #define API_HEADER(x) + #define API(x) mbedtls_##x + #define API_VERSION_NUMBER MBEDTLS_VERSION_NUMBER +#else + #define API_HEADER(x) + #define API(x) x + #define API_VERSION_NUMBER POLARSSL_VERSION_NUMBER +#endif + #include -#include -#include -#include -#include -#include -#include -#include +#include API_HEADER (arc4.h) +#include API_HEADER (base64.h) +#include API_HEADER (ctr_drbg.h) +#include API_HEADER (dhm.h) +#include API_HEADER (error.h) +#include API_HEADER (sha1.h) +#include API_HEADER (version.h) #include "transmission.h" #include "crypto-utils.h" @@ -41,7 +50,9 @@ log_polarssl_error (int error_code, { char error_message[256]; -#if POLARSSL_VERSION_NUMBER >= 0x01030000 +#if defined (POLARSSL_IS_MBEDTLS) + mbedtls_strerror (error_code, error_message, sizeof (error_message)); +#elif API_VERSION_NUMBER >= 0x01030000 polarssl_strerror (error_code, error_message, sizeof (error_message)); #else error_strerror (error_code, error_message, sizeof (error_message)); @@ -51,7 +62,7 @@ log_polarssl_error (int error_code, } } -#define log_error(error_code) log_polarssl_error(error_code, __FILE__, __LINE__) +#define log_error(error_code) log_polarssl_error ((error_code), __FILE__, __LINE__) static bool check_polarssl_result (int result, @@ -83,15 +94,20 @@ my_rand (void * context UNUSED, unsigned char * buffer, size_t buffer_size) return 0; } -static ctr_drbg_context * +static API (ctr_drbg_context) * get_rng (void) { - static ctr_drbg_context rng; + static API (ctr_drbg_context) rng; static bool rng_initialized = false; if (!rng_initialized) { - if (!check_result (ctr_drbg_init (&rng, &my_rand, NULL, NULL, 0))) +#if API_VERSION_NUMBER >= 0x02000000 + API (ctr_drbg_init) (&rng); + if (!check_result (API (ctr_drbg_seed) (&rng, &my_rand, NULL, NULL, 0))) +#else + if (!check_result (API (ctr_drbg_init) (&rng, &my_rand, NULL, NULL, 0))) +#endif return NULL; rng_initialized = true; } @@ -117,13 +133,13 @@ get_rng_lock (void) tr_sha1_ctx_t tr_sha1_init (void) { - sha1_context * handle = tr_new0 (sha1_context, 1); + API (sha1_context) * handle = tr_new0 (API (sha1_context), 1); -#if POLARSSL_VERSION_NUMBER >= 0x01030800 - sha1_init (handle); +#if API_VERSION_NUMBER >= 0x01030800 + API (sha1_init) (handle); #endif - sha1_starts (handle); + API (sha1_starts) (handle); return handle; } @@ -139,7 +155,7 @@ tr_sha1_update (tr_sha1_ctx_t handle, assert (data != NULL); - sha1_update (handle, data, data_length); + API (sha1_update) (handle, data, data_length); return true; } @@ -151,11 +167,11 @@ tr_sha1_final (tr_sha1_ctx_t handle, { assert (handle != NULL); - sha1_finish (handle, hash); + API (sha1_finish) (handle, hash); } -#if POLARSSL_VERSION_NUMBER >= 0x01030800 - sha1_free (handle); +#if API_VERSION_NUMBER >= 0x01030800 + API (sha1_free) (handle); #endif tr_free (handle); @@ -169,10 +185,10 @@ tr_sha1_final (tr_sha1_ctx_t handle, tr_rc4_ctx_t tr_rc4_new (void) { - arc4_context * handle = tr_new0 (arc4_context, 1); + API (arc4_context) * handle = tr_new0 (API (arc4_context), 1); -#if POLARSSL_VERSION_NUMBER >= 0x01030800 - arc4_init (handle); +#if API_VERSION_NUMBER >= 0x01030800 + API (arc4_init) (handle); #endif return handle; @@ -181,8 +197,8 @@ tr_rc4_new (void) void tr_rc4_free (tr_rc4_ctx_t handle) { -#if POLARSSL_VERSION_NUMBER >= 0x01030800 - arc4_free (handle); +#if API_VERSION_NUMBER >= 0x01030800 + API (arc4_free) (handle); #endif tr_free (handle); @@ -196,7 +212,7 @@ tr_rc4_set_key (tr_rc4_ctx_t handle, assert (handle != NULL); assert (key != NULL); - arc4_setup (handle, key, key_length); + API (arc4_setup) (handle, key, key_length); } void @@ -213,7 +229,7 @@ tr_rc4_process (tr_rc4_ctx_t handle, assert (input != NULL); assert (output != NULL); - arc4_crypt (handle, length, input, output); + API (arc4_crypt) (handle, length, input, output); } /*** @@ -226,19 +242,19 @@ tr_dh_new (const uint8_t * prime_num, const uint8_t * generator_num, size_t generator_num_length) { - dhm_context * handle = tr_new0 (dhm_context, 1); + API (dhm_context) * handle = tr_new0 (API (dhm_context), 1); assert (prime_num != NULL); assert (generator_num != NULL); -#if POLARSSL_VERSION_NUMBER >= 0x01030800 - dhm_init (handle); +#if API_VERSION_NUMBER >= 0x01030800 + API (dhm_init) (handle); #endif - if (!check_result (mpi_read_binary (&handle->P, prime_num, prime_num_length)) || - !check_result (mpi_read_binary (&handle->G, generator_num, generator_num_length))) + if (!check_result (API (mpi_read_binary) (&handle->P, prime_num, prime_num_length)) || + !check_result (API (mpi_read_binary) (&handle->G, generator_num, generator_num_length))) { - dhm_free (handle); + API (dhm_free) (handle); return NULL; } @@ -253,7 +269,7 @@ tr_dh_free (tr_dh_ctx_t handle) if (handle == NULL) return; - dhm_free (handle); + API (dhm_free) (handle); } bool @@ -262,7 +278,7 @@ tr_dh_make_key (tr_dh_ctx_t raw_handle, uint8_t * public_key, size_t * public_key_length) { - dhm_context * handle = raw_handle; + API (dhm_context) * handle = raw_handle; assert (handle != NULL); assert (public_key != NULL); @@ -270,8 +286,8 @@ tr_dh_make_key (tr_dh_ctx_t raw_handle, if (public_key_length != NULL) *public_key_length = handle->len; - return check_result (dhm_make_public (handle, private_key_length, public_key, - handle->len, my_rand, NULL)); + return check_result (API (dhm_make_public) (handle, private_key_length, public_key, + handle->len, my_rand, NULL)); } tr_dh_secret_t @@ -279,26 +295,29 @@ tr_dh_agree (tr_dh_ctx_t raw_handle, const uint8_t * other_public_key, size_t other_public_key_length) { - dhm_context * handle = raw_handle; + API (dhm_context) * handle = raw_handle; struct tr_dh_secret * ret; size_t secret_key_length; assert (handle != NULL); assert (other_public_key != NULL); - if (!check_result (dhm_read_public (handle, other_public_key, - other_public_key_length))) + if (!check_result (API (dhm_read_public )(handle, other_public_key, + other_public_key_length))) return NULL; ret = tr_dh_secret_new (handle->len); secret_key_length = handle->len; -#if POLARSSL_VERSION_NUMBER >= 0x01030000 - if (!check_result (dhm_calc_secret (handle, ret->key, - &secret_key_length, my_rand, NULL))) +#if API_VERSION_NUMBER >= 0x02000000 + if (!check_result (API (dhm_calc_secret) (handle, ret->key, secret_key_length, + &secret_key_length, my_rand, NULL))) +#elif API_VERSION_NUMBER >= 0x01030000 + if (!check_result (API (dhm_calc_secret) (handle, ret->key, + &secret_key_length, my_rand, NULL))) #else - if (!check_result (dhm_calc_secret (handle, ret->key, &secret_key_length))) + if (!check_result (API (dhm_calc_secret) (handle, ret->key, &secret_key_length))) #endif { tr_dh_secret_free (ret); @@ -324,7 +343,7 @@ tr_rand_buffer (void * buffer, assert (buffer != NULL); tr_lockLock (rng_lock); - ret = check_result (ctr_drbg_random (get_rng (), buffer, length)); + ret = check_result (API (ctr_drbg_random) (get_rng (), buffer, length)); tr_lockUnlock (rng_lock); return ret; diff --git a/libtransmission/crypto-utils.c b/libtransmission/crypto-utils.c index 99279732fd9..34ca86af1da 100644 --- a/libtransmission/crypto-utils.c +++ b/libtransmission/crypto-utils.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -133,6 +132,8 @@ tr_ssha1 (const char * plain_text) "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "./"; + assert (plain_text != NULL); + size_t i; unsigned char salt[saltval_len]; uint8_t sha[SHA_DIGEST_LENGTH]; @@ -142,7 +143,7 @@ tr_ssha1 (const char * plain_text) for (i = 0; i < saltval_len; ++i) salt[i] = salter[salt[i] % salter_len]; - tr_sha1 (sha, plain_text, strlen (plain_text), salt, (size_t) saltval_len, NULL); + tr_sha1 (sha, plain_text, (int) strlen (plain_text), salt, saltval_len, NULL); tr_sha1_to_hex (&buf[1], sha); memcpy (&buf[1 + 2 * SHA_DIGEST_LENGTH], &salt, saltval_len); buf[1 + 2 * SHA_DIGEST_LENGTH + saltval_len] = '\0'; @@ -155,34 +156,27 @@ bool tr_ssha1_matches (const char * ssha1, const char * plain_text) { - char * salt; - size_t saltlen; - char * my_ssha1; - uint8_t buf[SHA_DIGEST_LENGTH]; - bool result; - const size_t sourcelen = strlen (ssha1); + assert (ssha1 != NULL); + assert (plain_text != NULL); - /* extract the salt */ - if (sourcelen < 2 * SHA_DIGEST_LENGTH - 1) + const size_t brace_len = 1; + const size_t brace_and_hash_len = brace_len + 2 * SHA_DIGEST_LENGTH; + + const size_t source_len = strlen (ssha1); + if (source_len < brace_and_hash_len || ssha1[0] != '{') return false; - saltlen = sourcelen - 2 * SHA_DIGEST_LENGTH - 1; - salt = tr_malloc (saltlen); - memcpy (salt, ssha1 + 2 * SHA_DIGEST_LENGTH + 1, saltlen); - /* hash pass + salt */ - my_ssha1 = tr_malloc (2 * SHA_DIGEST_LENGTH + saltlen + 2); - tr_sha1 (buf, plain_text, strlen (plain_text), salt, saltlen, NULL); - tr_sha1_to_hex (&my_ssha1[1], buf); - memcpy (my_ssha1 + 1 + 2 * SHA_DIGEST_LENGTH, salt, saltlen); - my_ssha1[1 + 2 * SHA_DIGEST_LENGTH + saltlen] = '\0'; - my_ssha1[0] = '{'; + /* extract the salt */ + const char * const salt = ssha1 + brace_and_hash_len; + const size_t salt_len = source_len - brace_and_hash_len; - result = strcmp (ssha1, my_ssha1) == 0; + uint8_t buf[SHA_DIGEST_LENGTH * 2 + 1]; - tr_free (my_ssha1); - tr_free (salt); + /* hash pass + salt */ + tr_sha1 (buf, plain_text, (int) strlen (plain_text), salt, (int) salt_len, NULL); + tr_sha1_to_hex ((char *) buf, buf); - return result; + return strncmp (ssha1 + brace_len, (const char *) buf, SHA_DIGEST_LENGTH * 2) == 0; } /*** diff --git a/libtransmission/crypto-utils.h b/libtransmission/crypto-utils.h index d4dc9ecb349..02edbc628b0 100644 --- a/libtransmission/crypto-utils.h +++ b/libtransmission/crypto-utils.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef TR_CRYPTO_UTILS_H diff --git a/libtransmission/crypto.c b/libtransmission/crypto.c index 0321c25235a..f4fc9392f2b 100644 --- a/libtransmission/crypto.c +++ b/libtransmission/crypto.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/crypto.h b/libtransmission/crypto.h index ca54a42fedb..a4e4e0a1771 100644 --- a/libtransmission/crypto.h +++ b/libtransmission/crypto.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/error-test.c b/libtransmission/error-test.c index 60dc5ea414f..2429a6c5e79 100644 --- a/libtransmission/error-test.c +++ b/libtransmission/error-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include "transmission.h" diff --git a/libtransmission/error-types.h b/libtransmission/error-types.h index 5aaebc61986..9cd31f06e0a 100644 --- a/libtransmission/error-types.h +++ b/libtransmission/error-types.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/libtransmission/error.c b/libtransmission/error.c index 0bc92687001..0c8ff92f211 100644 --- a/libtransmission/error.c +++ b/libtransmission/error.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/error.h b/libtransmission/error.h index e3cb4e081d2..3e343139a58 100644 --- a/libtransmission/error.h +++ b/libtransmission/error.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/libtransmission/fdlimit.c b/libtransmission/fdlimit.c index 5c4a5eb31d4..9801c4a0312 100644 --- a/libtransmission/fdlimit.c +++ b/libtransmission/fdlimit.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -228,7 +227,7 @@ cached_file_open (struct tr_cached_file * o, /* If the file already exists and it's too large, truncate it. * This is a fringe case that happens if a torrent's been updated * and one of the updated torrent's files is smaller. - * http://trac.transmissionbt.com/ticket/2228 + * https://trac.transmissionbt.com/ticket/2228 * https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/318249 */ if (resize_needed && !tr_sys_file_truncate (fd, file_size, &error)) diff --git a/libtransmission/fdlimit.h b/libtransmission/fdlimit.h index 90aa40de11e..051043d7178 100644 --- a/libtransmission/fdlimit.h +++ b/libtransmission/fdlimit.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/file-posix.c b/libtransmission/file-posix.c index b83509e435c..610afa89a29 100644 --- a/libtransmission/file-posix.c +++ b/libtransmission/file-posix.c @@ -4,24 +4,10 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ -#if defined (HAVE_MKDTEMP) && (!defined (_XOPEN_SOURCE) || _XOPEN_SOURCE < 700) - #undef _XOPEN_SOURCE - #define _XOPEN_SOURCE 700 -#elif (defined (HAVE_POSIX_FADVISE) || defined (HAVE_POSIX_FALLOCATE)) && (!defined (_XOPEN_SOURCE) || _XOPEN_SOURCE < 600) - #undef _XOPEN_SOURCE - #define _XOPEN_SOURCE 600 -#endif - -#if (defined (HAVE_FALLOCATE64) || defined (HAVE_CANONICALIZE_FILE_NAME)) && !defined (_GNU_SOURCE) - #define _GNU_SOURCE -#endif - -#if defined (__APPLE__) && !defined (_DARWIN_C_SOURCE) - #define _DARWIN_C_SOURCE -#endif +#undef _GNU_SOURCE +#define _GNU_SOURCE #include #include @@ -32,8 +18,9 @@ #include #include #include -#include /* mmap (), munmap () */ #include +#include /* flock () */ +#include /* mmap (), munmap () */ #include #include /* lseek (), write (), ftruncate (), pread (), pwrite (), pathconf (), etc */ @@ -921,6 +908,35 @@ tr_sys_file_unmap (const void * address, return ret; } +bool +tr_sys_file_lock (tr_sys_file_t handle, + int operation, + tr_error ** error) +{ + bool ret; + int native_operation = 0; + + assert (handle != TR_BAD_SYS_FILE); + assert ((operation & ~(TR_SYS_FILE_LOCK_SH | TR_SYS_FILE_LOCK_EX | TR_SYS_FILE_LOCK_NB | TR_SYS_FILE_LOCK_UN)) == 0); + assert (!!(operation & TR_SYS_FILE_LOCK_SH) + !!(operation & TR_SYS_FILE_LOCK_EX) + !!(operation & TR_SYS_FILE_LOCK_UN) == 1); + + if ((operation & TR_SYS_FILE_LOCK_SH) != 0) + native_operation |= LOCK_SH; + if ((operation & TR_SYS_FILE_LOCK_EX) != 0) + native_operation |= LOCK_EX; + if ((operation & TR_SYS_FILE_LOCK_NB) != 0) + native_operation |= LOCK_NB; + if ((operation & TR_SYS_FILE_LOCK_UN) != 0) + native_operation |= LOCK_UN; + + ret = flock (handle, native_operation) != -1; + + if (!ret) + set_system_error (error, errno); + + return ret; +} + char * tr_sys_dir_get_current (tr_error ** error) { diff --git a/libtransmission/file-test.c b/libtransmission/file-test.c index dc82b5a1469..c0c339a43e6 100644 --- a/libtransmission/file-test.c +++ b/libtransmission/file-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/file-win32.c b/libtransmission/file-win32.c index 90db9a508f2..3699d16e91b 100644 --- a/libtransmission/file-win32.c +++ b/libtransmission/file-win32.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -1145,6 +1144,40 @@ tr_sys_file_unmap (const void * address, return ret; } +bool +tr_sys_file_lock (tr_sys_file_t handle, + int operation, + tr_error ** error) +{ + bool ret; + OVERLAPPED overlapped = { .Pointer = 0, .hEvent = NULL }; + + assert (handle != TR_BAD_SYS_FILE); + assert ((operation & ~(TR_SYS_FILE_LOCK_SH | TR_SYS_FILE_LOCK_EX | TR_SYS_FILE_LOCK_NB | TR_SYS_FILE_LOCK_UN)) == 0); + assert (!!(operation & TR_SYS_FILE_LOCK_SH) + !!(operation & TR_SYS_FILE_LOCK_EX) + !!(operation & TR_SYS_FILE_LOCK_UN) == 1); + + if ((operation & TR_SYS_FILE_LOCK_UN) == 0) + { + DWORD native_flags = 0; + + if ((operation & TR_SYS_FILE_LOCK_EX) != 0) + native_flags |= LOCKFILE_EXCLUSIVE_LOCK; + if ((operation & TR_SYS_FILE_LOCK_NB) != 0) + native_flags |= LOCKFILE_FAIL_IMMEDIATELY; + + ret = LockFileEx (handle, native_flags, 0, MAXDWORD, MAXDWORD, &overlapped) != FALSE; + } + else + { + ret = UnlockFileEx (handle, 0, MAXDWORD, MAXDWORD, &overlapped) != FALSE; + } + + if (!ret) + set_system_error (error, GetLastError ()); + + return ret; +} + char * tr_sys_dir_get_current (tr_error ** error) { diff --git a/libtransmission/file.c b/libtransmission/file.c index d7f4abb9844..ecdcdbffb9b 100644 --- a/libtransmission/file.c +++ b/libtransmission/file.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/file.h b/libtransmission/file.h index ea4dbe728b2..6133deb0527 100644 --- a/libtransmission/file.h +++ b/libtransmission/file.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once @@ -77,6 +76,15 @@ typedef enum } tr_seek_origin_t; +typedef enum +{ + TR_SYS_FILE_LOCK_SH = 1 << 0, + TR_SYS_FILE_LOCK_EX = 1 << 1, + TR_SYS_FILE_LOCK_NB = 1 << 2, + TR_SYS_FILE_LOCK_UN = 1 << 3 +} +tr_sys_file_lock_flags_t; + typedef enum { TR_SYS_PATH_NO_FOLLOW = 1 << 0 @@ -525,6 +533,23 @@ bool tr_sys_file_unmap (const void * address, uint64_t size, struct tr_error ** error); +/** + * @brief Portability wrapper for `flock ()`. + * + * Don't try to upgrade or downgrade the lock unless you know what you are + * doing, as behavior varies a bit between platforms. + * + * @param[in] handle Valid file descriptor. + * @param[in] operation Combination of @ref tr_sys_file_lock_flags_t values. + * @param[out] error Pointer to error object. Optional, pass `NULL` if you + * are not interested in error details. + * + * @return `True` on success, `false` otherwise (with `error` set accordingly). + */ +bool tr_sys_file_lock (tr_sys_file_t handle, + int operation, + struct tr_error ** error); + /* File-related wrappers (utility) */ /** diff --git a/libtransmission/handshake.c b/libtransmission/handshake.c index 7dbb24dfdcf..625484fcfc0 100644 --- a/libtransmission/handshake.c +++ b/libtransmission/handshake.c @@ -4,12 +4,11 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include #include -#include /* strcmp (), strlen () */ +#include /* strcmp (), strlen (), strncmp () */ #include #include @@ -426,7 +425,8 @@ readYb (tr_handshake * handshake, struct evbuffer * inbuf) /* compute the secret */ evbuffer_remove (inbuf, yb, KEY_LEN); - tr_cryptoComputeSecret (handshake->crypto, yb); + if (!tr_cryptoComputeSecret (handshake->crypto, yb)) + return tr_handshakeDone (handshake, false); /* now send these: HASH ('req1', S), HASH ('req2', SKEY) xor HASH ('req3', S), * ENCRYPT (VC, crypto_provide, len (PadC), PadC, len (IA)), ENCRYPT (IA) */ @@ -642,7 +642,7 @@ readHandshake (tr_handshake * handshake, assert (pstrlen == 19); tr_peerIoReadBytes (handshake->io, inbuf, pstr, pstrlen); pstr[pstrlen] = '\0'; - if (memcmp (pstr, "BitTorrent protocol", 19) != 0) + if (strncmp ((const char *)pstr, "BitTorrent protocol", 19) != 0) return tr_handshakeDone (handshake, false); /* reserved bytes */ @@ -742,7 +742,9 @@ readYa (tr_handshake * handshake, /* read the incoming peer's public key */ evbuffer_remove (inbuf, ya, KEY_LEN); - tr_cryptoComputeSecret (handshake->crypto, ya); + if (!tr_cryptoComputeSecret (handshake->crypto, ya)) + return tr_handshakeDone (handshake, false); + computeRequestHash (handshake, "req1", handshake->myReq1); /* send our public key to the peer */ diff --git a/libtransmission/handshake.h b/libtransmission/handshake.h index 3725aee1a36..e1bd9a70d08 100644 --- a/libtransmission/handshake.h +++ b/libtransmission/handshake.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/history-test.c b/libtransmission/history-test.c index 8bd9e70ade5..d4f69dfbae4 100644 --- a/libtransmission/history-test.c +++ b/libtransmission/history-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* memset () */ diff --git a/libtransmission/history.c b/libtransmission/history.c index 8ca8e8b85cc..617455a2bbf 100644 --- a/libtransmission/history.c +++ b/libtransmission/history.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/history.h b/libtransmission/history.h index 2f4799eccc1..06ec3022c9d 100644 --- a/libtransmission/history.h +++ b/libtransmission/history.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/inout.c b/libtransmission/inout.c index 5ed54aa60bd..58891cdb193 100644 --- a/libtransmission/inout.c +++ b/libtransmission/inout.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/inout.h b/libtransmission/inout.h index 24c9f121102..79a9ff5602f 100644 --- a/libtransmission/inout.h +++ b/libtransmission/inout.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/json-test.c b/libtransmission/json-test.c index b7c2ae46ea8..3e1fb803edb 100644 --- a/libtransmission/json-test.c +++ b/libtransmission/json-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* strlen () */ diff --git a/libtransmission/libtransmission-test.c b/libtransmission/libtransmission-test.c index efe6d982e83..69b96181217 100644 --- a/libtransmission/libtransmission-test.c +++ b/libtransmission/libtransmission-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/libtransmission-test.h b/libtransmission/libtransmission-test.h index 49f63d6377d..9afe7081e3d 100644 --- a/libtransmission/libtransmission-test.h +++ b/libtransmission/libtransmission-test.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ /* Note VERBOSE needs to be (un)defined before including this file */ diff --git a/libtransmission/list.c b/libtransmission/list.c index 9386752546d..be3db595cdb 100644 --- a/libtransmission/list.c +++ b/libtransmission/list.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include "transmission.h" diff --git a/libtransmission/list.h b/libtransmission/list.h index 05dde8ddbb7..660284ac9b7 100644 --- a/libtransmission/list.h +++ b/libtransmission/list.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/log.c b/libtransmission/log.c index e0c66dad8d8..1a955745991 100644 --- a/libtransmission/log.c +++ b/libtransmission/log.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/log.h b/libtransmission/log.h index 166df039092..a544eafe5d0 100644 --- a/libtransmission/log.h +++ b/libtransmission/log.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/libtransmission/magnet-test.c b/libtransmission/magnet-test.c index 56511b316e0..606fed705e9 100644 --- a/libtransmission/magnet-test.c +++ b/libtransmission/magnet-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include "transmission.h" diff --git a/libtransmission/magnet.c b/libtransmission/magnet.c index d24191e5451..bdda893c5ab 100644 --- a/libtransmission/magnet.c +++ b/libtransmission/magnet.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -111,7 +110,7 @@ tr_magnetParse (const char * uri) uint8_t sha1[SHA_DIGEST_LENGTH]; tr_magnet_info * info = NULL; - if (uri != NULL && memcmp (uri, "magnet:?", 8) == 0) + if (uri != NULL && strncmp (uri, "magnet:?", 8) == 0) { const char * walk; @@ -137,7 +136,7 @@ tr_magnetParse (const char * uri) else vallen = strlen (val); - if (keylen == 2 && memcmp (key, "xt", 2) == 0 && val != NULL && memcmp (val, "urn:btih:", 9) == 0) + if (keylen == 2 && memcmp (key, "xt", 2) == 0 && val != NULL && strncmp (val, "urn:btih:", 9) == 0) { const char * hash = val + 9; const size_t hashlen = vallen - 9; diff --git a/libtransmission/magnet.h b/libtransmission/magnet.h index f5ad6c1e589..d4b9aa97c56 100644 --- a/libtransmission/magnet.h +++ b/libtransmission/magnet.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/makemeta-test.c b/libtransmission/makemeta-test.c index 76e26c81aae..1629223143e 100644 --- a/libtransmission/makemeta-test.c +++ b/libtransmission/makemeta-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include "libtransmission-test.h" diff --git a/libtransmission/makemeta.c b/libtransmission/makemeta.c index ceb7e5ac7c1..589b12c5299 100644 --- a/libtransmission/makemeta.c +++ b/libtransmission/makemeta.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -294,7 +293,7 @@ getHashInfo (tr_metainfo_builder * b) assert (bufptr - buf == (int)thisPieceSize); assert (leftInPiece == 0); - tr_sha1 (walk, buf, thisPieceSize, NULL); + tr_sha1 (walk, buf, (int) thisPieceSize, NULL); walk += SHA_DIGEST_LENGTH; if (b->abortFlag) diff --git a/libtransmission/makemeta.h b/libtransmission/makemeta.h index a4c33240f03..996c16c84ee 100644 --- a/libtransmission/makemeta.h +++ b/libtransmission/makemeta.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/libtransmission/metainfo-test.c b/libtransmission/metainfo-test.c index 82804fdec8a..fad232fc021 100644 --- a/libtransmission/metainfo-test.c +++ b/libtransmission/metainfo-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include "libtransmission-test.h" diff --git a/libtransmission/metainfo.c b/libtransmission/metainfo.c index 62d71869bb3..7b9caffdf79 100644 --- a/libtransmission/metainfo.c +++ b/libtransmission/metainfo.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -470,7 +469,7 @@ tr_metainfoParseImpl (const tr_session * session, { size_t len; char * bstr = tr_variantToStr (infoDict, TR_VARIANT_FMT_BENC, &len); - tr_sha1 (inf->hash, bstr, len, NULL); + tr_sha1 (inf->hash, bstr, (int) len, NULL); tr_sha1_to_hex (inf->hashString, inf->hash); if (infoDictLength != NULL) diff --git a/libtransmission/metainfo.h b/libtransmission/metainfo.h index eff5bbf8e84..b508ba0b3cb 100644 --- a/libtransmission/metainfo.h +++ b/libtransmission/metainfo.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/move-test.c b/libtransmission/move-test.c index 07f3ed150ba..6abb4d3d905 100644 --- a/libtransmission/move-test.c +++ b/libtransmission/move-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/natpmp.c b/libtransmission/natpmp.c index d5ec7c343b3..65170988239 100644 --- a/libtransmission/natpmp.c +++ b/libtransmission/natpmp.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/natpmp_local.h b/libtransmission/natpmp_local.h index aa26c732295..d09d299c95f 100644 --- a/libtransmission/natpmp_local.h +++ b/libtransmission/natpmp_local.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/net.c b/libtransmission/net.c index 6de0c58ef32..ae1faf80f81 100644 --- a/libtransmission/net.c +++ b/libtransmission/net.c @@ -1,7 +1,4 @@ /****************************************************************************** - * - * $Id$ - * * Copyright (c) Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -250,7 +247,7 @@ tr_netOpenPeerSocket (tr_session * session, if (clientIsSeed) { int n = 8192; if (setsockopt (s, SOL_SOCKET, SO_RCVBUF, (const void *) &n, sizeof (n))) - tr_logAddInfo ("Unable to set SO_RCVBUF on socket %"TR_PRI_SOCK": %s", s, + tr_logAddInfo ("Unable to set SO_RCVBUF on socket %" PRIdMAX ": %s", (intmax_t) s, tr_net_strerror (err_buf, sizeof (err_buf), sockerrno)); } @@ -267,8 +264,8 @@ tr_netOpenPeerSocket (tr_session * session, sourcelen = setup_sockaddr (source_addr, 0, &source_sock); if (bind (s, (struct sockaddr *) &source_sock, sourcelen)) { - tr_logAddError (_("Couldn't set source address %s on %"TR_PRI_SOCK": %s"), - tr_address_to_string (source_addr), s, + tr_logAddError (_("Couldn't set source address %s on %" PRIdMAX ": %s"), + tr_address_to_string (source_addr), (intmax_t) s, tr_net_strerror (err_buf, sizeof (err_buf), sockerrno)); tr_netClose (session, s); return TR_BAD_SOCKET; /* -errno */ @@ -285,16 +282,16 @@ tr_netOpenPeerSocket (tr_session * session, tmperrno = sockerrno; if ((tmperrno != ENETUNREACH && tmperrno != EHOSTUNREACH) || addr->type == TR_AF_INET) { - tr_logAddError (_("Couldn't connect socket %"TR_PRI_SOCK" to %s, port %d (errno %d - %s)"), - s, tr_address_to_string (addr), (int)ntohs (port), tmperrno, + tr_logAddError (_("Couldn't connect socket %" PRIdMAX " to %s, port %d (errno %d - %s)"), + (intmax_t) s, tr_address_to_string (addr), (int)ntohs (port), tmperrno, tr_net_strerror (err_buf, sizeof (err_buf), tmperrno)); } tr_netClose (session, s); s = TR_BAD_SOCKET; /* -tmperrno */ } - tr_logAddDeep (__FILE__, __LINE__, NULL, "New OUTGOING connection %"TR_PRI_SOCK" (%s)", - s, tr_peerIoAddrStr (addr, port)); + tr_logAddDeep (__FILE__, __LINE__, NULL, "New OUTGOING connection %" PRIdMAX " (%s)", + (intmax_t) s, tr_peerIoAddrStr (addr, port)); return s; } @@ -385,7 +382,18 @@ tr_netBindTCPImpl (const tr_address * addr, } if (!suppressMsgs) - tr_logAddDebug ("Bound socket %"TR_PRI_SOCK" to port %d on %s", fd, port, tr_address_to_string (addr)); + tr_logAddDebug ("Bound socket %" PRIdMAX " to port %d on %s", (intmax_t) fd, port, tr_address_to_string (addr)); + +#ifdef TCP_FASTOPEN + +#ifndef SOL_TCP +#define SOL_TCP IPPROTO_TCP +#endif + + optval = 5; + setsockopt (fd, SOL_TCP, TCP_FASTOPEN, (const void *) &optval, sizeof (optval)); + +#endif if (listen (fd, 128) == -1) { *errOut = sockerrno; diff --git a/libtransmission/net.h b/libtransmission/net.h index fe58b9cacce..9cd6711c788 100644 --- a/libtransmission/net.h +++ b/libtransmission/net.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -40,7 +38,6 @@ #ifdef _WIN32 typedef SOCKET tr_socket_t; #define TR_BAD_SOCKET INVALID_SOCKET - #define TR_PRI_SOCK "Id" /* intentionally signed to print -1 nicely. */ #undef EADDRINUSE #define EADDRINUSE WSAEADDRINUSE @@ -67,7 +64,6 @@ typedef int tr_socket_t; /** @brief Platform-specific invalid socket descriptor constant. */ #define TR_BAD_SOCKET (-1) - #define TR_PRI_SOCK "d" #define sockerrno errno #endif diff --git a/libtransmission/peer-common.h b/libtransmission/peer-common.h index 60db6dbea15..31c502c0ae0 100644 --- a/libtransmission/peer-common.h +++ b/libtransmission/peer-common.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index fb031051901..22b8f624208 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -626,7 +625,7 @@ tr_peerIoNew (tr_session * session, tr_bandwidthConstruct (&io->bandwidth, session, parent); tr_bandwidthSetPeer (&io->bandwidth, io); dbgmsg (io, "bandwidth is %p; its parent is %p", (void*)&io->bandwidth, (void*)parent); - dbgmsg (io, "socket is %"TR_PRI_SOCK", utp_socket is %p", socket, (void*)utp_socket); + dbgmsg (io, "socket is %" PRIdMAX ", utp_socket is %p", (intmax_t) socket, (void*)utp_socket); if (io->socket != TR_BAD_SOCKET) { io->event_read = event_new (session->event_base, @@ -687,7 +686,7 @@ tr_peerIoNewOutgoing (tr_session * session, if (!utp_socket) { fd = tr_netOpenPeerSocket (session, addr, port, isSeed); - dbgmsg (NULL, "tr_netOpenPeerSocket returned fd %"TR_PRI_SOCK, fd); + dbgmsg (NULL, "tr_netOpenPeerSocket returned fd %" PRIdMAX, (intmax_t) fd); } if (fd == TR_BAD_SOCKET && utp_socket == NULL) diff --git a/libtransmission/peer-io.h b/libtransmission/peer-io.h index 22fb8c9a8bf..1b241b0b665 100644 --- a/libtransmission/peer-io.h +++ b/libtransmission/peer-io.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 30e9036f9b6..5ead786d976 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/peer-mgr.h b/libtransmission/peer-mgr.h index 6758c2efdab..68eece3a5e9 100644 --- a/libtransmission/peer-mgr.h +++ b/libtransmission/peer-mgr.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/peer-msgs-test.c b/libtransmission/peer-msgs-test.c index a1403414c1f..c1b3cce1f36 100644 --- a/libtransmission/peer-msgs-test.c +++ b/libtransmission/peer-msgs-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index 759688ac7fa..6861ad65958 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/peer-msgs.h b/libtransmission/peer-msgs.h index 99d5cdf0d53..7c868e81d93 100644 --- a/libtransmission/peer-msgs.h +++ b/libtransmission/peer-msgs.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/platform-quota.c b/libtransmission/platform-quota.c index 46d011dde75..67a1653de46 100644 --- a/libtransmission/platform-quota.c +++ b/libtransmission/platform-quota.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -285,7 +284,7 @@ getquota (const char * device) spaceused = (int64_t) dq.dqb_curblocks >> 1; #elif defined(__APPLE__) spaceused = (int64_t) dq.dqb_curbytes; -#elif defined(__UCLIBC__) +#elif defined (__UCLIBC__) && !TR_UCLIBC_CHECK_VERSION (1, 0, 18) spaceused = (int64_t) btodb(dq.dqb_curblocks); #elif defined(__sun) || (defined(_LINUX_QUOTA_VERSION) && _LINUX_QUOTA_VERSION < 2) spaceused = (int64_t) dq.dqb_curblocks >> 1; diff --git a/libtransmission/platform-quota.h b/libtransmission/platform-quota.h index aa79ba84c66..71b05583bbc 100644 --- a/libtransmission/platform-quota.h +++ b/libtransmission/platform-quota.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/platform.c b/libtransmission/platform.c index 673ca70cda3..1db580e722e 100644 --- a/libtransmission/platform.c +++ b/libtransmission/platform.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #define _XOPEN_SOURCE 600 /* needed for recursive locks. */ @@ -99,11 +98,16 @@ tr_amInThread (const tr_thread * t) static ThreadFuncReturnType ThreadFunc (void * _t) { +#ifndef _WIN32 + pthread_detach (pthread_self ()); +#endif + tr_thread * t = _t; t->func (t->arg); tr_free (t); + #ifdef _WIN32 _endthreadex (0); return 0; @@ -126,7 +130,6 @@ tr_threadNew (void (*func)(void *), void * arg) } #else pthread_create (&t->thread, NULL, (void* (*)(void*))ThreadFunc, t); - pthread_detach (t->thread); #endif return t; @@ -225,13 +228,12 @@ tr_lockUnlock (tr_lock * l) #ifdef _WIN32 static char * -win32_get_known_folder (REFKNOWNFOLDERID folder_id) +win32_get_known_folder_ex (REFKNOWNFOLDERID folder_id, DWORD flags) { char * ret = NULL; PWSTR path; - if (SHGetKnownFolderPath (folder_id, KF_FLAG_DONT_UNEXPAND | KF_FLAG_DONT_VERIFY, - NULL, &path) == S_OK) + if (SHGetKnownFolderPath (folder_id, flags | KF_FLAG_DONT_UNEXPAND, NULL, &path) == S_OK) { ret = tr_win32_native_to_utf8 (path, -1); CoTaskMemFree (path); @@ -240,6 +242,12 @@ win32_get_known_folder (REFKNOWNFOLDERID folder_id) return ret; } +static char * +win32_get_known_folder (REFKNOWNFOLDERID folder_id) +{ + return win32_get_known_folder_ex (folder_id, KF_FLAG_DONT_VERIFY); +} + #endif static const char * @@ -389,7 +397,7 @@ tr_getDefaultDownloadDir (void) { *end = '\0'; - if (memcmp (value, "$HOME/", 6) == 0) + if (strncmp (value, "$HOME/", 6) == 0) user_dir = tr_buildPath (getHomeDir (), value+6, NULL); else if (strcmp (value, "$HOME") == 0) user_dir = tr_strdup (getHomeDir ()); @@ -512,12 +520,15 @@ tr_getWebClientDir (const tr_session * session UNUSED) module_path = tr_win32_native_to_utf8 (wide_module_path, -1); dir = tr_sys_path_dirname (module_path, NULL); tr_free (module_path); - s = tr_buildPath (dir, "Web", NULL); - tr_free (dir); - if (!isWebClientDir (s)) + if (dir != NULL) { - tr_free (s); - s = NULL; + s = tr_buildPath (dir, "Web", NULL); + tr_free (dir); + if (!isWebClientDir (s)) + { + tr_free (s); + s = NULL; + } } } @@ -587,3 +598,21 @@ tr_getWebClientDir (const tr_session * session UNUSED) return s; } + +char * +tr_getSessionIdDir (void) +{ +#ifndef _WIN32 + + return tr_strdup ("/tmp"); + +#else + + char * program_data_dir = win32_get_known_folder_ex (&FOLDERID_ProgramData, KF_FLAG_CREATE); + char * result = tr_buildPath (program_data_dir, "Transmission", NULL); + tr_free (program_data_dir); + tr_sys_dir_create (result, 0, 0, NULL); + return result; + +#endif +} diff --git a/libtransmission/platform.h b/libtransmission/platform.h index e7dc34cf581..a1badc8d376 100644 --- a/libtransmission/platform.h +++ b/libtransmission/platform.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ @@ -38,6 +37,9 @@ const char * tr_getTorrentDir (const tr_session *); /** @brief return the directory where the Web Client's web ui files are kept */ const char * tr_getWebClientDir (const tr_session *); +/** @brief return the directory where session id lock files are stored */ +char * tr_getSessionIdDir (void); + /** @} */ diff --git a/libtransmission/port-forwarding.c b/libtransmission/port-forwarding.c index 5f6c223cfd3..d05eefbf16a 100644 --- a/libtransmission/port-forwarding.c +++ b/libtransmission/port-forwarding.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/port-forwarding.h b/libtransmission/port-forwarding.h index 6c6d49182d8..7b1b30b9d7a 100644 --- a/libtransmission/port-forwarding.h +++ b/libtransmission/port-forwarding.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/ptrarray.c b/libtransmission/ptrarray.c index 26e806fe85b..ce7d5c60d82 100644 --- a/libtransmission/ptrarray.c +++ b/libtransmission/ptrarray.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/ptrarray.h b/libtransmission/ptrarray.h index f22ec6d0624..3ebe580412f 100644 --- a/libtransmission/ptrarray.h +++ b/libtransmission/ptrarray.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/quark-test.c b/libtransmission/quark-test.c index aaafd8b2d10..14a476fbab5 100644 --- a/libtransmission/quark-test.c +++ b/libtransmission/quark-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* strlen() */ diff --git a/libtransmission/quark.c b/libtransmission/quark.c index a591ec43581..1fa0ffad8d4 100644 --- a/libtransmission/quark.c +++ b/libtransmission/quark.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -281,6 +280,8 @@ static const struct tr_key_struct my_static[] = { "remote-session-password", 23 }, { "remote-session-port", 19 }, { "remote-session-requres-authentication", 37 }, + { "remote-session-use-any-cert", 27 }, + { "remote-session-use-ssl", 22 }, { "remote-session-username", 23 }, { "removed", 7 }, { "rename-partial-files", 20 }, @@ -316,6 +317,7 @@ static const struct tr_key_struct my_static[] = { "seederCount", 11 }, { "seeding-time-seconds", 20 }, { "session-count", 13 }, + { "session-id", 10 }, { "sessionCount", 12 }, { "show-backup-trackers", 20 }, { "show-extra-peer-details", 23 }, diff --git a/libtransmission/quark.h b/libtransmission/quark.h index 3f328fc1387..7dfecf7ee9b 100644 --- a/libtransmission/quark.h +++ b/libtransmission/quark.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once @@ -282,6 +281,8 @@ enum TR_KEY_remote_session_password, TR_KEY_remote_session_port, TR_KEY_remote_session_requres_authentication, + TR_KEY_remote_session_use_any_cert, + TR_KEY_remote_session_use_ssl, TR_KEY_remote_session_username, TR_KEY_removed, TR_KEY_rename_partial_files, @@ -317,6 +318,7 @@ enum TR_KEY_seederCount, TR_KEY_seeding_time_seconds, TR_KEY_session_count, + TR_KEY_session_id, TR_KEY_sessionCount, TR_KEY_show_backup_trackers, TR_KEY_show_extra_peer_details, diff --git a/libtransmission/rename-test.c b/libtransmission/rename-test.c index 18a7d9aa3f3..3fcf6954da5 100644 --- a/libtransmission/rename-test.c +++ b/libtransmission/rename-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -85,6 +84,16 @@ torrentRenameAndWait (tr_torrent * tor, return error; } +static void +torrentRemoveAndWait (tr_torrent * tor, + int expected_torrent_count) +{ + tr_torrentRemove (tor, false, NULL); + + while (tr_sessionCountTorrents (session) != expected_torrent_count) + tr_wait_msec (10); +} + /*** **** ***/ @@ -222,7 +231,7 @@ test_single_filename_torrent (void) /* cleanup */ tr_ctorFree (ctor); - tr_torrentRemove (tor, false, NULL); + torrentRemoveAndWait (tor, 0); return 0; } @@ -436,15 +445,13 @@ test_multifile_torrent (void) testFileExistsAndConsistsOfThisString (tor, i, expected_contents[i]); } + tr_ctorFree (ctor); + torrentRemoveAndWait (tor, 0); + /** *** Test renaming prefixes (shouldn't work) **/ - tr_ctorFree (ctor); - tr_torrentRemove (tor, false, NULL); - do { - tr_wait_msec (10); - } while (0); ctor = tr_ctorNew (session); tor = create_torrent_from_base64_metainfo (ctor, "ZDEwOmNyZWF0ZWQgYnkyNTpUcmFuc21pc3Npb24vMi42MSAoMTM0MDcpMTM6Y3JlYXRpb24gZGF0" @@ -480,7 +487,7 @@ test_multifile_torrent (void) /* cleanup */ tr_ctorFree (ctor); - tr_torrentRemove (tor, false, NULL); + torrentRemoveAndWait (tor, 0); return 0; } @@ -547,7 +554,7 @@ test_partial_file (void) tr_free (expected); } - tr_torrentRemove (tor, false, NULL); + torrentRemoveAndWait (tor, 0); return 0; } diff --git a/libtransmission/resume.c b/libtransmission/resume.c index 57153e976ab..2aa277bac41 100644 --- a/libtransmission/resume.c +++ b/libtransmission/resume.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/resume.h b/libtransmission/resume.h index e128436f354..1a917781ff9 100644 --- a/libtransmission/resume.h +++ b/libtransmission/resume.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/rpc-server.c b/libtransmission/rpc-server.c index a94e16a9d73..e86a4a333d1 100644 --- a/libtransmission/rpc-server.c +++ b/libtransmission/rpc-server.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -31,6 +30,7 @@ #include "rpcimpl.h" #include "rpc-server.h" #include "session.h" +#include "session-id.h" #include "trevent.h" #include "utils.h" #include "variant.h" @@ -64,9 +64,6 @@ struct tr_rpc_server char * whitelistStr; tr_list * whitelist; - char * sessionId; - time_t sessionIdExpiresAt; - bool isStreamInitialized; z_stream stream; }; @@ -82,33 +79,12 @@ struct tr_rpc_server **** ***/ -static char* +static const char * get_current_session_id (struct tr_rpc_server * server) { - const time_t now = tr_time (); - - if (!server->sessionId || (now >= server->sessionIdExpiresAt)) - { - int i; - const int n = 48; - const char * pool = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - const size_t pool_size = strlen (pool); - unsigned char * buf = tr_new (unsigned char, n+1); - - tr_rand_buffer (buf, n); - for (i=0; isessionId); - server->sessionId = (char*) buf; - server->sessionIdExpiresAt = now + (60*60); /* expire in an hour */ - } - - return server->sessionId; + return tr_session_id_get_current (server->session->session_id); } - /** *** **/ @@ -1005,7 +981,6 @@ closeServer (void * vserver) if (s->isStreamInitialized) deflateEnd (&s->stream); tr_free (s->url); - tr_free (s->sessionId); tr_free (s->whitelistStr); tr_free (s->username); tr_free (s->password); diff --git a/libtransmission/rpc-server.h b/libtransmission/rpc-server.h index b49b07acf82..a16d4c18f9e 100644 --- a/libtransmission/rpc-server.h +++ b/libtransmission/rpc-server.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/rpc-test.c b/libtransmission/rpc-test.c index a02506f5180..63506dcb3e9 100644 --- a/libtransmission/rpc-test.c +++ b/libtransmission/rpc-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include "transmission.h" diff --git a/libtransmission/rpcimpl.c b/libtransmission/rpcimpl.c index a576487d9c8..f13ff90acfe 100644 --- a/libtransmission/rpcimpl.c +++ b/libtransmission/rpcimpl.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -27,13 +26,14 @@ #include "platform-quota.h" /* tr_device_info_get_free_space() */ #include "rpcimpl.h" #include "session.h" +#include "session-id.h" #include "torrent.h" #include "utils.h" #include "variant.h" #include "version.h" #include "web.h" -#define RPC_VERSION 15 +#define RPC_VERSION 16 #define RPC_VERSION_MIN 1 #define RECENTLY_ACTIVE_SECONDS 60 @@ -1455,7 +1455,7 @@ portTest (tr_session * session, struct tr_rpc_idle_data * idle_data) { const int port = tr_sessionGetPeerPort (session); - char * url = tr_strdup_printf ("http://portcheck.transmissionbt.com/%d", port); + char * url = tr_strdup_printf ("https://portcheck.transmissionbt.com/%d", port); tr_webRun (session, url, portTested, idle_data); tr_free (url); return NULL; @@ -2040,71 +2040,268 @@ sessionStats (tr_session * session, return NULL; } +static void +addSessionField (tr_session * s, + tr_variant * d, + tr_quark key) +{ + switch (key) + { + case TR_KEY_alt_speed_up: + tr_variantDictAddInt (d, key, tr_sessionGetAltSpeed_KBps (s, TR_UP)); + break; + + case TR_KEY_alt_speed_down: + tr_variantDictAddInt (d, key, tr_sessionGetAltSpeed_KBps (s, TR_DOWN)); + break; + + case TR_KEY_alt_speed_enabled: + tr_variantDictAddBool (d, key, tr_sessionUsesAltSpeed (s)); + break; + + case TR_KEY_alt_speed_time_begin: + tr_variantDictAddInt (d, key, tr_sessionGetAltSpeedBegin (s)); + break; + + case TR_KEY_alt_speed_time_end: + tr_variantDictAddInt (d, key,tr_sessionGetAltSpeedEnd (s)); + break; + + case TR_KEY_alt_speed_time_day: + tr_variantDictAddInt (d, key,tr_sessionGetAltSpeedDay (s)); + break; + + case TR_KEY_alt_speed_time_enabled: + tr_variantDictAddBool (d, key, tr_sessionUsesAltSpeedTime (s)); + break; + + case TR_KEY_blocklist_enabled: + tr_variantDictAddBool (d, key, tr_blocklistIsEnabled (s)); + break; + + case TR_KEY_blocklist_url: + tr_variantDictAddStr (d, key, tr_blocklistGetURL (s)); + break; + + case TR_KEY_cache_size_mb: + tr_variantDictAddInt (d, key, tr_sessionGetCacheLimit_MB (s)); + break; + + case TR_KEY_blocklist_size: + tr_variantDictAddInt (d, key, tr_blocklistGetRuleCount (s)); + break; + + case TR_KEY_config_dir: + tr_variantDictAddStr (d, key, tr_sessionGetConfigDir (s)); + break; + + case TR_KEY_download_dir: + tr_variantDictAddStr (d, key, tr_sessionGetDownloadDir (s)); + break; + + case TR_KEY_download_dir_free_space: + tr_variantDictAddInt (d, key, tr_device_info_get_free_space (s->downloadDir)); + break; + + case TR_KEY_download_queue_enabled: + tr_variantDictAddBool (d, key, tr_sessionGetQueueEnabled (s, TR_DOWN)); + break; + + case TR_KEY_download_queue_size: + tr_variantDictAddInt (d, key, tr_sessionGetQueueSize (s, TR_DOWN)); + break; + + case TR_KEY_peer_limit_global: + tr_variantDictAddInt (d, key, tr_sessionGetPeerLimit (s)); + break; + + case TR_KEY_peer_limit_per_torrent: + tr_variantDictAddInt (d, key, tr_sessionGetPeerLimitPerTorrent (s)); + break; + + case TR_KEY_incomplete_dir: + tr_variantDictAddStr (d, key, tr_sessionGetIncompleteDir (s)); + break; + + case TR_KEY_incomplete_dir_enabled: + tr_variantDictAddBool (d, key, tr_sessionIsIncompleteDirEnabled (s)); + break; + + case TR_KEY_pex_enabled: + tr_variantDictAddBool (d, key, tr_sessionIsPexEnabled (s)); + break; + + case TR_KEY_utp_enabled: + tr_variantDictAddBool (d, key, tr_sessionIsUTPEnabled (s)); + break; + + case TR_KEY_dht_enabled: + tr_variantDictAddBool (d, key, tr_sessionIsDHTEnabled (s)); + break; + + case TR_KEY_lpd_enabled: + tr_variantDictAddBool (d, key, tr_sessionIsLPDEnabled (s)); + break; + + case TR_KEY_peer_port: + tr_variantDictAddInt (d, key, tr_sessionGetPeerPort (s)); + break; + + case TR_KEY_peer_port_random_on_start: + tr_variantDictAddBool (d, key, tr_sessionGetPeerPortRandomOnStart (s)); + break; + + case TR_KEY_port_forwarding_enabled: + tr_variantDictAddBool (d, key, tr_sessionIsPortForwardingEnabled (s)); + break; + + case TR_KEY_rename_partial_files: + tr_variantDictAddBool (d, key, tr_sessionIsIncompleteFileNamingEnabled (s)); + break; + + case TR_KEY_rpc_version: + tr_variantDictAddInt (d, key, RPC_VERSION); + break; + + case TR_KEY_rpc_version_minimum: + tr_variantDictAddInt (d, key, RPC_VERSION_MIN); + break; + + case TR_KEY_seedRatioLimit: + tr_variantDictAddReal (d, key, tr_sessionGetRatioLimit (s)); + break; + + case TR_KEY_seedRatioLimited: + tr_variantDictAddBool (d, key, tr_sessionIsRatioLimited (s)); + break; + + case TR_KEY_idle_seeding_limit: + tr_variantDictAddInt (d, key, tr_sessionGetIdleLimit (s)); + break; + + case TR_KEY_idle_seeding_limit_enabled: + tr_variantDictAddBool (d, key, tr_sessionIsIdleLimited (s)); + break; + + case TR_KEY_seed_queue_enabled: + tr_variantDictAddBool (d, key, tr_sessionGetQueueEnabled (s, TR_UP)); + break; + + case TR_KEY_seed_queue_size: + tr_variantDictAddInt (d, key, tr_sessionGetQueueSize (s, TR_UP)); + break; + + case TR_KEY_start_added_torrents: + tr_variantDictAddBool (d, key, !tr_sessionGetPaused (s)); + break; + + case TR_KEY_trash_original_torrent_files: + tr_variantDictAddBool (d, key, tr_sessionGetDeleteSource (s)); + break; + + case TR_KEY_speed_limit_up: + tr_variantDictAddInt (d, key, tr_sessionGetSpeedLimit_KBps (s, TR_UP)); + break; + + case TR_KEY_speed_limit_up_enabled: + tr_variantDictAddBool (d, key, tr_sessionIsSpeedLimited (s, TR_UP)); + break; + + case TR_KEY_speed_limit_down: + tr_variantDictAddInt (d, key, tr_sessionGetSpeedLimit_KBps (s, TR_DOWN)); + break; + + case TR_KEY_speed_limit_down_enabled: + tr_variantDictAddBool (d, key, tr_sessionIsSpeedLimited (s, TR_DOWN)); + break; + + case TR_KEY_script_torrent_done_filename: + tr_variantDictAddStr (d, key, tr_sessionGetTorrentDoneScript (s)); + break; + + case TR_KEY_script_torrent_done_enabled: + tr_variantDictAddBool (d, key, tr_sessionIsTorrentDoneScriptEnabled (s)); + break; + + case TR_KEY_queue_stalled_enabled: + tr_variantDictAddBool (d, key, tr_sessionGetQueueStalledEnabled (s)); + break; + + case TR_KEY_queue_stalled_minutes: + tr_variantDictAddInt (d, key, tr_sessionGetQueueStalledMinutes (s)); + break; + + case TR_KEY_units: + tr_formatter_get_units (tr_variantDictAddDict (d, key, 0)); + break; + + case TR_KEY_version: + tr_variantDictAddStr (d, key, LONG_VERSION_STRING); + break; + + case TR_KEY_encryption: + { + const char * str; + + switch (tr_sessionGetEncryption (s)) + { + case TR_CLEAR_PREFERRED: + str = "tolerated"; + break; + + case TR_ENCRYPTION_REQUIRED: + str = "required"; + break; + + default: + str = "preferred"; + break; + } + + tr_variantDictAddStr (d, key, str); + break; + } + + case TR_KEY_session_id: + tr_variantDictAddStr (d, key, tr_session_id_get_current (s->session_id)); + break; + } +} + static const char* sessionGet (tr_session * s, - tr_variant * args_in UNUSED, + tr_variant * args_in, tr_variant * args_out, struct tr_rpc_idle_data * idle_data UNUSED) { - const char * str; - tr_variant * d = args_out; + tr_variant * fields; assert (idle_data == NULL); - tr_variantDictAddInt (d, TR_KEY_alt_speed_up, tr_sessionGetAltSpeed_KBps (s,TR_UP)); - tr_variantDictAddInt (d, TR_KEY_alt_speed_down, tr_sessionGetAltSpeed_KBps (s,TR_DOWN)); - tr_variantDictAddBool (d, TR_KEY_alt_speed_enabled, tr_sessionUsesAltSpeed (s)); - tr_variantDictAddInt (d, TR_KEY_alt_speed_time_begin, tr_sessionGetAltSpeedBegin (s)); - tr_variantDictAddInt (d, TR_KEY_alt_speed_time_end,tr_sessionGetAltSpeedEnd (s)); - tr_variantDictAddInt (d, TR_KEY_alt_speed_time_day,tr_sessionGetAltSpeedDay (s)); - tr_variantDictAddBool (d, TR_KEY_alt_speed_time_enabled, tr_sessionUsesAltSpeedTime (s)); - tr_variantDictAddBool (d, TR_KEY_blocklist_enabled, tr_blocklistIsEnabled (s)); - tr_variantDictAddStr (d, TR_KEY_blocklist_url, tr_blocklistGetURL (s)); - tr_variantDictAddInt (d, TR_KEY_cache_size_mb, tr_sessionGetCacheLimit_MB (s)); - tr_variantDictAddInt (d, TR_KEY_blocklist_size, tr_blocklistGetRuleCount (s)); - tr_variantDictAddStr (d, TR_KEY_config_dir, tr_sessionGetConfigDir (s)); - tr_variantDictAddStr (d, TR_KEY_download_dir, tr_sessionGetDownloadDir (s)); - tr_variantDictAddInt (d, TR_KEY_download_dir_free_space, tr_device_info_get_free_space (s->downloadDir)); - tr_variantDictAddBool (d, TR_KEY_download_queue_enabled, tr_sessionGetQueueEnabled (s, TR_DOWN)); - tr_variantDictAddInt (d, TR_KEY_download_queue_size, tr_sessionGetQueueSize (s, TR_DOWN)); - tr_variantDictAddInt (d, TR_KEY_peer_limit_global, tr_sessionGetPeerLimit (s)); - tr_variantDictAddInt (d, TR_KEY_peer_limit_per_torrent, tr_sessionGetPeerLimitPerTorrent (s)); - tr_variantDictAddStr (d, TR_KEY_incomplete_dir, tr_sessionGetIncompleteDir (s)); - tr_variantDictAddBool (d, TR_KEY_incomplete_dir_enabled, tr_sessionIsIncompleteDirEnabled (s)); - tr_variantDictAddBool (d, TR_KEY_pex_enabled, tr_sessionIsPexEnabled (s)); - tr_variantDictAddBool (d, TR_KEY_utp_enabled, tr_sessionIsUTPEnabled (s)); - tr_variantDictAddBool (d, TR_KEY_dht_enabled, tr_sessionIsDHTEnabled (s)); - tr_variantDictAddBool (d, TR_KEY_lpd_enabled, tr_sessionIsLPDEnabled (s)); - tr_variantDictAddInt (d, TR_KEY_peer_port, tr_sessionGetPeerPort (s)); - tr_variantDictAddBool (d, TR_KEY_peer_port_random_on_start, tr_sessionGetPeerPortRandomOnStart (s)); - tr_variantDictAddBool (d, TR_KEY_port_forwarding_enabled, tr_sessionIsPortForwardingEnabled (s)); - tr_variantDictAddBool (d, TR_KEY_rename_partial_files, tr_sessionIsIncompleteFileNamingEnabled (s)); - tr_variantDictAddInt (d, TR_KEY_rpc_version, RPC_VERSION); - tr_variantDictAddInt (d, TR_KEY_rpc_version_minimum, RPC_VERSION_MIN); - tr_variantDictAddReal (d, TR_KEY_seedRatioLimit, tr_sessionGetRatioLimit (s)); - tr_variantDictAddBool (d, TR_KEY_seedRatioLimited, tr_sessionIsRatioLimited (s)); - tr_variantDictAddInt (d, TR_KEY_idle_seeding_limit, tr_sessionGetIdleLimit (s)); - tr_variantDictAddBool (d, TR_KEY_idle_seeding_limit_enabled, tr_sessionIsIdleLimited (s)); - tr_variantDictAddBool (d, TR_KEY_seed_queue_enabled, tr_sessionGetQueueEnabled (s, TR_UP)); - tr_variantDictAddInt (d, TR_KEY_seed_queue_size, tr_sessionGetQueueSize (s, TR_UP)); - tr_variantDictAddBool (d, TR_KEY_start_added_torrents, !tr_sessionGetPaused (s)); - tr_variantDictAddBool (d, TR_KEY_trash_original_torrent_files, tr_sessionGetDeleteSource (s)); - tr_variantDictAddInt (d, TR_KEY_speed_limit_up, tr_sessionGetSpeedLimit_KBps (s, TR_UP)); - tr_variantDictAddBool (d, TR_KEY_speed_limit_up_enabled, tr_sessionIsSpeedLimited (s, TR_UP)); - tr_variantDictAddInt (d, TR_KEY_speed_limit_down, tr_sessionGetSpeedLimit_KBps (s, TR_DOWN)); - tr_variantDictAddBool (d, TR_KEY_speed_limit_down_enabled, tr_sessionIsSpeedLimited (s, TR_DOWN)); - tr_variantDictAddStr (d, TR_KEY_script_torrent_done_filename, tr_sessionGetTorrentDoneScript (s)); - tr_variantDictAddBool (d, TR_KEY_script_torrent_done_enabled, tr_sessionIsTorrentDoneScriptEnabled (s)); - tr_variantDictAddBool (d, TR_KEY_queue_stalled_enabled, tr_sessionGetQueueStalledEnabled (s)); - tr_variantDictAddInt (d, TR_KEY_queue_stalled_minutes, tr_sessionGetQueueStalledMinutes (s)); - tr_formatter_get_units (tr_variantDictAddDict (d, TR_KEY_units, 0)); - tr_variantDictAddStr (d, TR_KEY_version, LONG_VERSION_STRING); - switch (tr_sessionGetEncryption (s)) - { - case TR_CLEAR_PREFERRED: str = "tolerated"; break; - case TR_ENCRYPTION_REQUIRED: str = "required"; break; - default: str = "preferred"; break; - } - tr_variantDictAddStr (d, TR_KEY_encryption, str); + + if (tr_variantDictFindList (args_in, TR_KEY_fields, &fields)) + { + const size_t field_count = tr_variantListSize (fields); + + for (size_t i = 0; i < field_count; ++i) + { + const char * field_name; + size_t field_name_len; + tr_quark field_id; + + if (!tr_variantGetStr (tr_variantListChild (fields, i), &field_name, &field_name_len)) + continue; + + if (!tr_quark_lookup (field_name, field_name_len, &field_id)) + continue; + + addSessionField (s, args_out, field_id); + } + } + else + { + for (tr_quark field_id = TR_KEY_NONE + 1; field_id < TR_N_KEYS; ++field_id) + addSessionField (s, args_out, field_id); + } return NULL; } diff --git a/libtransmission/rpcimpl.h b/libtransmission/rpcimpl.h index fff5d8ce990..ba0ffe83c34 100644 --- a/libtransmission/rpcimpl.h +++ b/libtransmission/rpcimpl.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/libtransmission/session-id.c b/libtransmission/session-id.c new file mode 100644 index 00000000000..cdfa07c74ed --- /dev/null +++ b/libtransmission/session-id.c @@ -0,0 +1,210 @@ +/* + * This file Copyright (C) 2016 Mnemosyne LLC + * + * It may be used under the GNU GPL versions 2 or 3 + * or any future license endorsed by Mnemosyne LLC. + * + */ + +#include +#include + +#ifndef _WIN32 + #include +#endif + +#include "transmission.h" +#include "crypto-utils.h" +#include "error.h" +#include "error-types.h" +#include "file.h" +#include "log.h" +#include "platform.h" +#include "session-id.h" +#include "utils.h" + +#define SESSION_ID_SIZE 48 +#define SESSION_ID_DURATION_SEC (60 * 60) /* expire in an hour */ + +struct tr_session_id +{ + char * current_value; + char * previous_value; + tr_sys_file_t current_lock_file; + tr_sys_file_t previous_lock_file; + time_t expires_at; +}; + +static char * +generate_new_session_id_value (void) +{ + const char pool[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + const size_t pool_size = sizeof (pool) - 1; + + char * buf = tr_new (char, SESSION_ID_SIZE + 1); + + tr_rand_buffer (buf, SESSION_ID_SIZE); + for (size_t i = 0; i < SESSION_ID_SIZE; ++i) + buf[i] = pool[(unsigned char) buf[i] % pool_size]; + buf[SESSION_ID_SIZE] = '\0'; + + return buf; +} + +static char * +get_session_id_lock_file_path (const char * session_id) +{ + char * lock_file_dir = tr_getSessionIdDir (); + char * lock_file_path = tr_strdup_printf ("%s/tr_session_id_%s", lock_file_dir, session_id); + tr_free (lock_file_dir); + return lock_file_path; +} + +static tr_sys_file_t +create_session_id_lock_file (const char * session_id) +{ + if (session_id == NULL) + return TR_BAD_SYS_FILE; + + char * lock_file_path = get_session_id_lock_file_path (session_id); + tr_sys_file_t lock_file; + tr_error * error = NULL; + + lock_file = tr_sys_file_open (lock_file_path, TR_SYS_FILE_READ | TR_SYS_FILE_WRITE | TR_SYS_FILE_CREATE, 0600, &error); + + if (lock_file != TR_BAD_SYS_FILE) + { + if (tr_sys_file_lock (lock_file, TR_SYS_FILE_LOCK_EX | TR_SYS_FILE_LOCK_NB, &error)) + { +#ifndef _WIN32 + /* Allow any user to lock the file regardless of current umask */ + fchmod (lock_file, 0644); +#endif + } + else + { + tr_sys_file_close (lock_file, NULL); + lock_file = TR_BAD_SYS_FILE; + } + } + + if (error != NULL) + { + tr_logAddError ("Unable to create session lock file (%d): %s", error->code, error->message); + tr_error_free (error); + } + + tr_free (lock_file_path); + return lock_file; +} + +static void +destroy_session_id_lock_file (tr_sys_file_t lock_file, + const char * session_id) +{ + if (lock_file != TR_BAD_SYS_FILE) + tr_sys_file_close (lock_file, NULL); + + if (session_id != NULL) + { + char * lock_file_path = get_session_id_lock_file_path (session_id); + tr_sys_path_remove (lock_file_path, NULL); + tr_free (lock_file_path); + } +} + +tr_session_id_t +tr_session_id_new (void) +{ + const tr_session_id_t session_id = tr_new0 (struct tr_session_id, 1); + + session_id->current_lock_file = TR_BAD_SYS_FILE; + session_id->previous_lock_file = TR_BAD_SYS_FILE; + + return session_id; +} + +void +tr_session_id_free (tr_session_id_t session_id) +{ + if (session_id == NULL) + return; + + destroy_session_id_lock_file (session_id->previous_lock_file, session_id->previous_value); + destroy_session_id_lock_file (session_id->current_lock_file, session_id->current_value); + + tr_free (session_id->previous_value); + tr_free (session_id->current_value); + + tr_free (session_id); +} + +const char * +tr_session_id_get_current (tr_session_id_t session_id) +{ + const time_t now = tr_time (); + + if (session_id->current_value == NULL || now >= session_id->expires_at) + { + destroy_session_id_lock_file (session_id->previous_lock_file, session_id->previous_value); + tr_free (session_id->previous_value); + + session_id->previous_value = session_id->current_value; + session_id->current_value = generate_new_session_id_value (); + + session_id->previous_lock_file = session_id->current_lock_file; + session_id->current_lock_file = create_session_id_lock_file (session_id->current_value); + + session_id->expires_at = now + SESSION_ID_DURATION_SEC; + } + + return session_id->current_value; +} + +bool +tr_session_id_is_local (const char * session_id) +{ + bool ret = false; + + if (session_id != NULL) + { + char * lock_file_path = get_session_id_lock_file_path (session_id); + tr_sys_file_t lock_file; + tr_error * error = NULL; + + lock_file = tr_sys_file_open (lock_file_path, TR_SYS_FILE_READ, 0, &error); + + if (lock_file == TR_BAD_SYS_FILE) + { + if (TR_ERROR_IS_ENOENT (error->code)) + tr_error_clear (&error); + } + else + { + if (!tr_sys_file_lock (lock_file, TR_SYS_FILE_LOCK_SH | TR_SYS_FILE_LOCK_NB, &error)) + { +#ifndef _WIN32 + if (error->code == EWOULDBLOCK) +#else + if (error->code == ERROR_LOCK_VIOLATION) +#endif + { + ret = true; + tr_error_clear (&error); + } + } + + tr_sys_file_close (lock_file, NULL); + } + + if (error != NULL) + { + tr_logAddError ("Unable to open session lock file (%d): %s", error->code, error->message); + tr_error_free (error); + } + + tr_free (lock_file_path); + } + + return ret; +} diff --git a/libtransmission/session-id.h b/libtransmission/session-id.h new file mode 100644 index 00000000000..6563009b5c5 --- /dev/null +++ b/libtransmission/session-id.h @@ -0,0 +1,57 @@ +/* + * This file Copyright (C) 2016 Mnemosyne LLC + * + * It may be used under the GNU GPL versions 2 or 3 + * or any future license endorsed by Mnemosyne LLC. + * + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct tr_session_id * tr_session_id_t; + +/** + * Create new session identifier object. + * + * @return New session identifier object. + */ +tr_session_id_t tr_session_id_new (void); + +/** + * Free session identifier object. + * + * @param[in] session_id Session identifier object. + */ +void tr_session_id_free (tr_session_id_t session_id); + +/** + * Get current session identifier as string. + * + * @param[in] session_id Session identifier object. + * + * @return String representation of current session identifier. + */ +const char * tr_session_id_get_current (tr_session_id_t session_id); + +/** + * Check if session ID corresponds to session running on the same machine as + * the caller. + * + * This is useful for various behavior alterations, such as transforming + * relative paths to absolute before passing through RPC, or presenting + * different UI for local and remote sessions. + * + * @param[in] session_id String representation of session identifier object. + * + * @return `True` if session is valid and local, `false` otherwise. + */ +bool tr_session_id_is_local (const char * session_id); + +#ifdef __cplusplus +} +#endif + diff --git a/libtransmission/session-test.c b/libtransmission/session-test.c index 0bda2c058cb..4d9bc11ee63 100644 --- a/libtransmission/session-test.c +++ b/libtransmission/session-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -12,6 +11,7 @@ #include #include "transmission.h" #include "session.h" +#include "session-id.h" #include "utils.h" #include "version.h" @@ -46,4 +46,96 @@ testPeerId (void) return 0; } -MAIN_SINGLE_TEST (testPeerId) +static int +test_session_id (void) +{ + tr_session_id_t session_id; + const char * session_id_str_1 = NULL; + const char * session_id_str_2 = NULL; + const char * session_id_str_3 = NULL; + + check (!tr_session_id_is_local (NULL)); + check (!tr_session_id_is_local ("")); + check (!tr_session_id_is_local ("test")); + + session_id = tr_session_id_new (); + check (session_id != NULL); + + tr_timeUpdate (0); + + session_id_str_1 = tr_session_id_get_current (session_id); + check (session_id_str_1 != NULL); + check (strlen (session_id_str_1) == 48); + session_id_str_1 = tr_strdup (session_id_str_1); + + check (tr_session_id_is_local (session_id_str_1)); + + tr_timeUpdate (60 * 60 - 1); + + check (tr_session_id_is_local (session_id_str_1)); + + session_id_str_2 = tr_session_id_get_current (session_id); + check (session_id_str_2 != NULL); + check (strlen (session_id_str_2) == 48); + check (strcmp (session_id_str_2, session_id_str_1) == 0); + + tr_timeUpdate (60 * 60); + + check (tr_session_id_is_local (session_id_str_1)); + + session_id_str_2 = tr_session_id_get_current (session_id); + check (session_id_str_2 != NULL); + check (strlen (session_id_str_2) == 48); + check (strcmp (session_id_str_2, session_id_str_1) != 0); + session_id_str_2 = tr_strdup (session_id_str_2); + + check (tr_session_id_is_local (session_id_str_2)); + check (tr_session_id_is_local (session_id_str_1)); + + tr_timeUpdate (60 * 60 * 2); + + check (tr_session_id_is_local (session_id_str_2)); + check (tr_session_id_is_local (session_id_str_1)); + + session_id_str_3 = tr_session_id_get_current (session_id); + check (session_id_str_3 != NULL); + check (strlen (session_id_str_3) == 48); + check (strcmp (session_id_str_3, session_id_str_2) != 0); + check (strcmp (session_id_str_3, session_id_str_1) != 0); + session_id_str_3 = tr_strdup (session_id_str_3); + + check (tr_session_id_is_local (session_id_str_3)); + check (tr_session_id_is_local (session_id_str_2)); + check (!tr_session_id_is_local (session_id_str_1)); + + tr_timeUpdate (60 * 60 * 10); + + check (tr_session_id_is_local (session_id_str_3)); + check (tr_session_id_is_local (session_id_str_2)); + check (!tr_session_id_is_local (session_id_str_1)); + + check (!tr_session_id_is_local (NULL)); + check (!tr_session_id_is_local ("")); + check (!tr_session_id_is_local ("test")); + + tr_session_id_free (session_id); + + check (!tr_session_id_is_local (session_id_str_3)); + check (!tr_session_id_is_local (session_id_str_2)); + check (!tr_session_id_is_local (session_id_str_1)); + + tr_free (session_id_str_3); + tr_free (session_id_str_2); + tr_free (session_id_str_1); + + return 0; +} + +int +main (void) +{ + const testFunc tests[] = { testPeerId, + test_session_id }; + + return runTests (tests, NUM_TESTS (tests)); +} diff --git a/libtransmission/session.c b/libtransmission/session.c index 18983280bdf..c25b90f50c8 100644 --- a/libtransmission/session.c +++ b/libtransmission/session.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -46,6 +45,7 @@ #include "port-forwarding.h" #include "rpc-server.h" #include "session.h" +#include "session-id.h" #include "stats.h" #include "torrent.h" #include "tr-dht.h" /* tr_dhtUpkeep () */ @@ -191,8 +191,8 @@ accept_incoming_peer (evutil_socket_t fd, short what UNUSED, void * vsession) clientSocket = tr_netAccept (session, fd, &clientAddr, &clientPort); if (clientSocket != TR_BAD_SOCKET) { - tr_logAddDeep (__FILE__, __LINE__, NULL, "new incoming connection %"TR_PRI_SOCK" (%s)", - clientSocket, tr_peerIoAddrStr (&clientAddr, clientPort)); + tr_logAddDeep (__FILE__, __LINE__, NULL, "new incoming connection %" PRIdMAX " (%s)", + (intmax_t) clientSocket, tr_peerIoAddrStr (&clientAddr, clientPort)); tr_peerMgrAddIncoming (session->peerMgr, &clientAddr, clientPort, clientSocket, NULL); } @@ -600,6 +600,7 @@ tr_sessionInit (const char * configDir, session->lock = tr_lockNew (); session->cache = tr_cacheNew (1024*1024*2); session->magicNumber = SESSION_MAGIC_NUMBER; + session->session_id = tr_session_id_new (); tr_bandwidthConstruct (&session->bandwidth, session, NULL); tr_variantInitList (&session->removedTorrents, 0); @@ -1865,6 +1866,9 @@ sessionCloseImplWaitForIdleUdp (evutil_socket_t foo UNUSED, static void sessionCloseImplFinish (tr_session * session) { + event_free (session->saveTimer); + session->saveTimer = NULL; + /* we had to wait until UDP trackers were closed before closing these: */ evdns_base_free (session->evdns_base, 0); session->evdns_base = NULL; @@ -1956,6 +1960,7 @@ tr_sessionClose (tr_session * session) tr_variantFree (&session->removedTorrents); tr_bandwidthDestruct (&session->bandwidth); tr_bitfieldDestruct (&session->turtle.minutes); + tr_session_id_free (session->session_id); tr_lockFree (session->lock); if (session->metainfoLookup) { @@ -2302,12 +2307,10 @@ loadBlocklists (tr_session * session) else { char * binname; - char * basename; tr_sys_path_info path_info; tr_sys_path_info binname_info; - basename = tr_sys_path_basename (name, NULL); - binname = tr_strdup_printf ("%s" TR_PATH_DELIMITER_STR "%s.bin", dirname, basename); + binname = tr_strdup_printf ("%s" TR_PATH_DELIMITER_STR "%s.bin", dirname, name); if (!tr_sys_path_get_info (binname, 0, &binname_info, NULL)) /* create it */ { @@ -2342,7 +2345,6 @@ loadBlocklists (tr_session * session) tr_free (old); } - tr_free (basename); tr_free (binname); } diff --git a/libtransmission/session.h b/libtransmission/session.h index 1fe4cec618e..b0e9af52740 100644 --- a/libtransmission/session.h +++ b/libtransmission/session.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ @@ -197,6 +196,7 @@ struct tr_session struct tr_web * web; + struct tr_session_id * session_id; struct tr_rpc_server * rpcServer; tr_rpc_func rpc_func; void * rpc_func_user_data; diff --git a/libtransmission/stats.c b/libtransmission/stats.c index bf4f763d79a..f73184c05b7 100644 --- a/libtransmission/stats.c +++ b/libtransmission/stats.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include "transmission.h" diff --git a/libtransmission/torrent-ctor.c b/libtransmission/torrent-ctor.c index db8815346dc..c950d08cbad 100644 --- a/libtransmission/torrent-ctor.c +++ b/libtransmission/torrent-ctor.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* EINVAL */ diff --git a/libtransmission/torrent-magnet.c b/libtransmission/torrent-magnet.c index b1f1e6eff6f..99780e20bd4 100644 --- a/libtransmission/torrent-magnet.c +++ b/libtransmission/torrent-magnet.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -295,6 +294,7 @@ tr_torrentSetMetadataPiece (tr_torrent * tor, int piece, const void * data, in if (success && !tr_getBlockSize (info.pieceSize)) { tr_torrentSetLocalError (tor, "%s", _("Magnet torrent's metadata is not usable")); + tr_metainfoFree (&info); success = false; } diff --git a/libtransmission/torrent-magnet.h b/libtransmission/torrent-magnet.h index cfd21fed429..81400a7ade3 100644 --- a/libtransmission/torrent-magnet.h +++ b/libtransmission/torrent-magnet.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index e0e50673122..c2890cfbb37 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* EINVAL */ @@ -1774,6 +1773,9 @@ onVerifyDoneThreadFunc (void * vdata) struct verify_data * data = vdata; tr_torrent * tor = data->tor; + if (tor->isDeleting) + goto cleanup; + if (!data->aborted) tr_torrentRecheckCompleteness (tor); @@ -1786,6 +1788,7 @@ onVerifyDoneThreadFunc (void * vdata) torrentStart (tor, false); } +cleanup: tr_free (data); } @@ -1794,6 +1797,13 @@ onVerifyDone (tr_torrent * tor, bool aborted, void * vdata) { struct verify_data * data = vdata; assert (data->tor == tor); + + if (tor->isDeleting) + { + tr_free (data); + return; + } + data->aborted = aborted; tr_runInEventThread (tor->session, onVerifyDoneThreadFunc, data); } @@ -1806,6 +1816,12 @@ verifyTorrent (void * vdata) tr_torrent * tor = data->tor; tr_sessionLock (tor->session); + if (tor->isDeleting) + { + tr_free (data); + goto unlock; + } + /* if the torrent's already being verified, stop it */ tr_verifyRemove (tor); @@ -1819,6 +1835,7 @@ verifyTorrent (void * vdata) else tr_verifyAdd (tor, onVerifyDone, data); +unlock: tr_sessionUnlock (tor->session); } diff --git a/libtransmission/torrent.h b/libtransmission/torrent.h index f3f1b04516e..b8427b630bf 100644 --- a/libtransmission/torrent.h +++ b/libtransmission/torrent.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/tr-dht.c b/libtransmission/tr-dht.c index 243429f6495..e3c985fce48 100644 --- a/libtransmission/tr-dht.c +++ b/libtransmission/tr-dht.c @@ -19,7 +19,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * - * $Id$ * */ diff --git a/libtransmission/tr-dht.h b/libtransmission/tr-dht.h index a6b101264c0..b536a89208b 100644 --- a/libtransmission/tr-dht.h +++ b/libtransmission/tr-dht.h @@ -19,7 +19,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * - * $Id$ * */ diff --git a/libtransmission/tr-getopt-test.c b/libtransmission/tr-getopt-test.c index ba128685c10..9dce5fc13dd 100644 --- a/libtransmission/tr-getopt-test.c +++ b/libtransmission/tr-getopt-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include "transmission.h" diff --git a/libtransmission/tr-getopt.c b/libtransmission/tr-getopt.c index 761409f55f7..673d42cc221 100644 --- a/libtransmission/tr-getopt.c +++ b/libtransmission/tr-getopt.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* isspace () */ diff --git a/libtransmission/tr-getopt.h b/libtransmission/tr-getopt.h index 3c56d3ac1d3..d86da734674 100644 --- a/libtransmission/tr-getopt.h +++ b/libtransmission/tr-getopt.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/libtransmission/tr-lpd.c b/libtransmission/tr-lpd.c index ba6a38741db..1719e7b4fad 100644 --- a/libtransmission/tr-lpd.c +++ b/libtransmission/tr-lpd.c @@ -63,7 +63,6 @@ THE SOFTWARE. * This module implements the Local Peer Discovery (LPD) protocol as supported by the * uTorrent client application. A typical LPD datagram is 119 bytes long. * -* $Id$ */ static void event_callback (evutil_socket_t, short, void*); diff --git a/libtransmission/tr-lpd.h b/libtransmission/tr-lpd.h index 0ba55fe79fc..95398c77117 100644 --- a/libtransmission/tr-lpd.h +++ b/libtransmission/tr-lpd.h @@ -26,8 +26,6 @@ THE SOFTWARE. #pragma once -/* $Id$ */ - int tr_lpdInit (tr_session*, tr_address*); void tr_lpdUninit (tr_session*); bool tr_lpdEnabled (const tr_session*); diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index 234011273af..dd8add849de 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -4,7 +4,6 @@ * It may be used under the 3-Clause BSD License, the GNU Public License v2, * or v3, or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ /* diff --git a/libtransmission/trevent.c b/libtransmission/trevent.c index 8fc0d06c8a9..432992a721e 100644 --- a/libtransmission/trevent.c +++ b/libtransmission/trevent.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/trevent.h b/libtransmission/trevent.h index 291250b1d02..cc3edd4f535 100644 --- a/libtransmission/trevent.h +++ b/libtransmission/trevent.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/upnp.c b/libtransmission/upnp.c index 6a5e571f31e..417afb7fc46 100644 --- a/libtransmission/upnp.c +++ b/libtransmission/upnp.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/upnp.h b/libtransmission/upnp.h index 678c2c98f7d..b769e467543 100644 --- a/libtransmission/upnp.h +++ b/libtransmission/upnp.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/utils-test.c b/libtransmission/utils-test.c index 83d7a74a95d..b371a6d7cc9 100644 --- a/libtransmission/utils-test.c +++ b/libtransmission/utils-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* INT_MAX */ @@ -398,7 +397,7 @@ test_truncd (void) #if !(defined (_MSC_VER) || (defined (__MINGW32__) && defined (__MSVCRT__))) /* FIXME: MSCVRT behaves differently in case of nan */ tr_snprintf (buf, sizeof (buf), "%.2f", tr_truncd (nan, 2)); - check (strstr (buf, "nan") != NULL); + check (strstr (buf, "nan") != NULL || strstr (buf, "NaN") != NULL); #else (void) nan; #endif diff --git a/libtransmission/utils.c b/libtransmission/utils.c index 4fc7a610b55..8dfd6328048 100644 --- a/libtransmission/utils.c +++ b/libtransmission/utils.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifdef HAVE_MEMMEM @@ -636,16 +635,19 @@ tr_binary_to_hex (const void * input, { static const char hex[] = "0123456789abcdef"; const uint8_t * input_octets = input; - size_t i; - for (i = 0; i < byte_length; ++i) - { - const unsigned int val = *input_octets++; - *output++ = hex[val >> 4]; - *output++ = hex[val & 0xf]; - } + /* go from back to front to allow for in-place conversion */ + input_octets += byte_length; + output += byte_length * 2; *output = '\0'; + + while (byte_length-- > 0) + { + const unsigned int val = *(--input_octets); + *(--output) = hex[val & 0xf]; + *(--output) = hex[val >> 4]; + } } void diff --git a/libtransmission/utils.h b/libtransmission/utils.h index 668d59c1dc6..a87c54ba8c3 100644 --- a/libtransmission/utils.h +++ b/libtransmission/utils.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/libtransmission/variant-benc.c b/libtransmission/variant-benc.c index dd2b5f088ae..519e40497ac 100644 --- a/libtransmission/variant-benc.c +++ b/libtransmission/variant-benc.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -258,11 +257,19 @@ tr_variantParseBenc (const void * buf_in, break; } - if (!err && (!top->type || !tr_ptrArrayEmpty(&stack))) + if (err == 0 && (top->type == 0 || !tr_ptrArrayEmpty(&stack))) err = EILSEQ; - if (!err && setme_end) - *setme_end = (const char*) buf; + if (err == 0) + { + if (setme_end != NULL) + *setme_end = (const char*) buf; + } + else if (top->type != 0) + { + tr_variantFree (top); + tr_variantInit (top, 0); + } tr_ptrArrayDestruct (&stack, NULL); return err; diff --git a/libtransmission/variant-common.h b/libtransmission/variant-common.h index 47fb96ceda7..ce86274ef4b 100644 --- a/libtransmission/variant-common.h +++ b/libtransmission/variant-common.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __LIBTRANSMISSION_VARIANT_MODULE__ diff --git a/libtransmission/variant-json.c b/libtransmission/variant-json.c index 2bf93666208..af7d6814c0f 100644 --- a/libtransmission/variant-json.c +++ b/libtransmission/variant-json.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/variant-test.c b/libtransmission/variant-test.c index bd983b1ae48..4f7895afbc1 100644 --- a/libtransmission/variant-test.c +++ b/libtransmission/variant-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* isspace () */ diff --git a/libtransmission/variant.c b/libtransmission/variant.c index 775c5f6510d..ca09749d679 100644 --- a/libtransmission/variant.c +++ b/libtransmission/variant.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #if defined (HAVE_USELOCALE) && (!defined (_XOPEN_SOURCE) || _XOPEN_SOURCE < 700) diff --git a/libtransmission/variant.h b/libtransmission/variant.h index 1bf45b1576a..d8fdebe393a 100644 --- a/libtransmission/variant.h +++ b/libtransmission/variant.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/libtransmission/verify.c b/libtransmission/verify.c index fdbf9c81015..e6811839bb5 100644 --- a/libtransmission/verify.c +++ b/libtransmission/verify.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #if defined (HAVE_POSIX_FADVISE) && (!defined (_XOPEN_SOURCE) || _XOPEN_SOURCE < 600) diff --git a/libtransmission/verify.h b/libtransmission/verify.h index c5e64e3d0a2..80062b75c7a 100644 --- a/libtransmission/verify.h +++ b/libtransmission/verify.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/libtransmission/version.h.in b/libtransmission/version.h.in index 78d3e183209..db4b5be232d 100644 --- a/libtransmission/version.h.in +++ b/libtransmission/version.h.in @@ -1,12 +1,11 @@ -#ifndef TR_VERSION_H -#define TR_VERSION_H +#pragma once #define PEERID_PREFIX "${TR_PEER_ID_PREFIX}" #define USERAGENT_PREFIX "${TR_USER_AGENT_PREFIX}" -#define SVN_REVISION "${TR_SCM_REVISION}" -#define SVN_REVISION_NUM ${TR_SCM_REVISION} +#define VCS_REVISION "${TR_VCS_REVISION}" +#define VCS_REVISION_NUM ${TR_VCS_REVISION} #define SHORT_VERSION_STRING "${TR_USER_AGENT_PREFIX}" -#define LONG_VERSION_STRING "${TR_USER_AGENT_PREFIX} (${TR_SCM_REVISION})" +#define LONG_VERSION_STRING "${TR_USER_AGENT_PREFIX} (${TR_VCS_REVISION})" #define VERSION_STRING_INFOPLIST ${TR_USER_AGENT_PREFIX} #define MAJOR_VERSION ${TR_VERSION_MAJOR} #define MINOR_VERSION ${TR_VERSION_MINOR} @@ -14,5 +13,3 @@ #cmakedefine TR_BETA_RELEASE 1 #cmakedefine TR_NIGHTLY_RELEASE 1 #cmakedefine TR_STABLE_RELEASE 1 - -#endif /* TR_VERSION_H */ diff --git a/libtransmission/watchdir-common.h b/libtransmission/watchdir-common.h index d3a3d1df9e9..0ecca896af6 100644 --- a/libtransmission/watchdir-common.h +++ b/libtransmission/watchdir-common.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/libtransmission/watchdir-generic.c b/libtransmission/watchdir-generic.c index 275bdd08a93..9a368d614ac 100644 --- a/libtransmission/watchdir-generic.c +++ b/libtransmission/watchdir-generic.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/watchdir-inotify.c b/libtransmission/watchdir-inotify.c index a7a25154927..c153ce2de53 100644 --- a/libtransmission/watchdir-inotify.c +++ b/libtransmission/watchdir-inotify.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/watchdir-kqueue.c b/libtransmission/watchdir-kqueue.c index bf4f418e143..4902823548e 100644 --- a/libtransmission/watchdir-kqueue.c +++ b/libtransmission/watchdir-kqueue.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/watchdir-test.c b/libtransmission/watchdir-test.c index ae23b5604fc..2bb2de68155 100644 --- a/libtransmission/watchdir-test.c +++ b/libtransmission/watchdir-test.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include @@ -128,6 +127,8 @@ test_construct (void) check (wd != NULL); check (tr_sys_path_is_same (test_dir, tr_watchdir_get_path (wd), NULL)); + process_events (); + tr_watchdir_free (wd); event_base_free (ev_base); diff --git a/libtransmission/watchdir-win32.c b/libtransmission/watchdir-win32.c index 04613fb44da..5cad3903994 100644 --- a/libtransmission/watchdir-win32.c +++ b/libtransmission/watchdir-win32.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/watchdir.c b/libtransmission/watchdir.c index a774a7a64b2..577b075b895 100644 --- a/libtransmission/watchdir.c +++ b/libtransmission/watchdir.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/watchdir.h b/libtransmission/watchdir.h index 95b92de2310..1d292b028f6 100644 --- a/libtransmission/watchdir.h +++ b/libtransmission/watchdir.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/libtransmission/web.c b/libtransmission/web.c index ee495e9fcb1..b7468615005 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include diff --git a/libtransmission/web.h b/libtransmission/web.h index 7fe7cf02ed7..cda5e5fad95 100644 --- a/libtransmission/web.h +++ b/libtransmission/web.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #pragma once diff --git a/libtransmission/webseed.c b/libtransmission/webseed.c index e813ec769d0..b0b86062fec 100644 --- a/libtransmission/webseed.c +++ b/libtransmission/webseed.c @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #include /* strlen () */ diff --git a/libtransmission/webseed.h b/libtransmission/webseed.h index 1526169db04..f5756be1c46 100644 --- a/libtransmission/webseed.h +++ b/libtransmission/webseed.h @@ -4,7 +4,6 @@ * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * - * $Id$ */ #ifndef __TRANSMISSION__ diff --git a/m4/glib-gettext.m4 b/m4/glib-gettext.m4 index 01db6de1384..cb0ddfad057 100644 --- a/m4/glib-gettext.m4 +++ b/m4/glib-gettext.m4 @@ -36,8 +36,8 @@ dnl We go to great lengths to make sure that aclocal won't dnl try to pull in the installed version of these macros dnl when running aclocal in the glib directory. dnl -m4_copy([AC_DEFUN],[glib_DEFUN]) -m4_copy([AC_REQUIRE],[glib_REQUIRE]) +m4_copy_force([AC_DEFUN],[glib_DEFUN]) +m4_copy_force([AC_REQUIRE],[glib_REQUIRE]) dnl dnl At the end, if we're not within glib, we'll define the public dnl definitions in terms of our private definitions. diff --git a/macosx/AboutWindow.xib b/macosx/AboutWindow.xib index 6d091bf77a3..e54c1f600ed 100644 --- a/macosx/AboutWindow.xib +++ b/macosx/AboutWindow.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -75,15 +76,13 @@ - + - - @@ -141,17 +140,15 @@ - + - + - - diff --git a/macosx/AboutWindowController.h b/macosx/AboutWindowController.h index a00534a3e01..610be4b742f 100644 --- a/macosx/AboutWindowController.h +++ b/macosx/AboutWindowController.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -26,7 +24,7 @@ @interface AboutWindowController : NSWindowController { - IBOutlet NSTextView * fTextView, * fLicenseView; + IBOutlet NSTextView * fTextView, * fLicenseView; IBOutlet NSTextField * fVersionField, * fCopyrightField; IBOutlet NSButton * fLicenseButton, * fLicenseCloseButton; IBOutlet NSPanel * fLicenseSheet; diff --git a/macosx/AboutWindowController.m b/macosx/AboutWindowController.m index f16003bbc70..d8db4420ed8 100644 --- a/macosx/AboutWindowController.m +++ b/macosx/AboutWindowController.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -39,19 +37,19 @@ - (void) awakeFromNib NSDictionary * info = [[NSBundle mainBundle] infoDictionary]; [fVersionField setStringValue: [NSString stringWithFormat: @"%@ (%@)", [info objectForKey: @"CFBundleShortVersionString"], [info objectForKey: (NSString *)kCFBundleVersionKey]]]; - + [fCopyrightField setStringValue: [[NSBundle mainBundle] localizedStringForKey: @"NSHumanReadableCopyright" value: nil table: @"InfoPlist"]]; - + [[fTextView textStorage] setAttributedString: [[[NSAttributedString alloc] initWithPath: [[NSBundle mainBundle] pathForResource: @"Credits" ofType: @"rtf"] documentAttributes: nil] autorelease]]; - + //size license button const CGFloat oldButtonWidth = NSWidth([fLicenseButton frame]); - + [fLicenseButton setTitle: NSLocalizedString(@"License", "About window -> license button")]; [fLicenseButton sizeToFit]; - + NSRect buttonFrame = [fLicenseButton frame]; buttonFrame.size.width += 10.0; buttonFrame.origin.x -= NSWidth(buttonFrame) - oldButtonWidth; @@ -65,7 +63,7 @@ - (void) windowDidLoad - (void) windowWillClose: (id) sender { - [fAboutBoxInstance autorelease]; + [fAboutBoxInstance autorelease]; fAboutBoxInstance = nil; } @@ -75,8 +73,8 @@ - (IBAction) showLicense: (id) sender usedEncoding: nil error: NULL]; [fLicenseView setString: licenseText]; [fLicenseCloseButton setTitle: NSLocalizedString(@"OK", "About window -> license close button")]; - - [NSApp beginSheet: fLicenseSheet modalForWindow: [self window] modalDelegate: nil didEndSelector: nil contextInfo: nil]; + + [NSApp beginSheet: fLicenseSheet modalForWindow: [self window] modalDelegate: nil didEndSelector: nil contextInfo: nil]; } - (IBAction) hideLicense: (id) sender diff --git a/macosx/AddMagnetWindowController.h b/macosx/AddMagnetWindowController.h index ea408d74fbc..eae9431491b 100644 --- a/macosx/AddMagnetWindowController.h +++ b/macosx/AddMagnetWindowController.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2010-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -34,19 +32,19 @@ IBOutlet NSTextField * fNameField, * fLocationField; IBOutlet NSButton * fStartCheck; IBOutlet NSPopUpButton * fGroupPopUp, * fPriorityPopUp; - + //remove these when switching to auto layout IBOutlet NSTextField * fMagnetLinkLabel; IBOutlet NSTextField * fDownloadToLabel, * fGroupLabel, * fPriorityLabel; IBOutlet NSButton * fChangeDestinationButton; IBOutlet NSBox * fDownloadToBox; IBOutlet NSButton * fAddButton, * fCancelButton; - + Controller * fController; - + Torrent * fTorrent; NSString * fDestination; - + NSInteger fGroupValue; TorrentDeterminationType fGroupDeterminationType; } diff --git a/macosx/AddMagnetWindowController.m b/macosx/AddMagnetWindowController.m index 491e81a917e..fe7d5d5f653 100644 --- a/macosx/AddMagnetWindowController.m +++ b/macosx/AddMagnetWindowController.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2010-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -54,9 +52,9 @@ - (id) initWithTorrent: (Torrent *) torrent destination: (NSString *) path contr { fTorrent = torrent; fDestination = [[path stringByExpandingTildeInPath] retain]; - + fController = controller; - + fGroupValue = [torrent groupValue]; fGroupDeterminationType = TorrentDeterminationAutomatic; } @@ -67,27 +65,29 @@ - (void) awakeFromNib { [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateGroupMenu:) name: @"UpdateGroups" object: nil]; - + NSString * name = [fTorrent name]; [[self window] setTitle: name]; [fNameField setStringValue: name]; [fNameField setToolTip: name]; - + [self setGroupsMenu]; [fGroupPopUp selectItemWithTag: fGroupValue]; - + NSInteger priorityIndex; switch ([fTorrent priority]) { case TR_PRI_HIGH: priorityIndex = POPUP_PRIORITY_HIGH; break; case TR_PRI_NORMAL: priorityIndex = POPUP_PRIORITY_NORMAL; break; case TR_PRI_LOW: priorityIndex = POPUP_PRIORITY_LOW; break; - default: NSAssert1(NO, @"Unknown priority for adding torrent: %d", [fTorrent priority]); + default: + NSAssert1(NO, @"Unknown priority for adding torrent: %d", [fTorrent priority]); + priorityIndex = POPUP_PRIORITY_NORMAL; } [fPriorityPopUp selectItemAtIndex: priorityIndex]; - + [fStartCheck setState: [[NSUserDefaults standardUserDefaults] boolForKey: @"AutoStartDownload"] ? NSOnState : NSOffState]; - + if (fDestination) [self setDestinationPath: fDestination determinationType: TorrentDeterminationAutomatic]; else @@ -95,10 +95,10 @@ - (void) awakeFromNib [fLocationField setStringValue: @""]; [fLocationImageView setImage: nil]; } - + #warning when 10.7-only, switch to auto layout [fMagnetLinkLabel sizeToFit]; - + const CGFloat downloadToLabelOldWidth = [fDownloadToLabel frame].size.width; [fDownloadToLabel sizeToFit]; const CGFloat changeDestOldWidth = [fChangeDestinationButton frame].size.width; @@ -106,13 +106,13 @@ - (void) awakeFromNib NSRect changeDestFrame = [fChangeDestinationButton frame]; changeDestFrame.origin.x -= changeDestFrame.size.width - changeDestOldWidth; [fChangeDestinationButton setFrame: changeDestFrame]; - + NSRect downloadToBoxFrame = [fDownloadToBox frame]; const CGFloat downloadToBoxSizeDiff = ([fDownloadToLabel frame].size.width - downloadToLabelOldWidth) + (changeDestFrame.size.width - changeDestOldWidth); downloadToBoxFrame.size.width -= downloadToBoxSizeDiff; downloadToBoxFrame.origin.x -= downloadToLabelOldWidth - [fDownloadToLabel frame].size.width; [fDownloadToBox setFrame: downloadToBoxFrame]; - + NSRect groupPopUpFrame = [fGroupPopUp frame]; NSRect priorityPopUpFrame = [fPriorityPopUp frame]; const CGFloat popUpOffset = groupPopUpFrame.origin.x - NSMaxX([fGroupLabel frame]); @@ -133,7 +133,7 @@ - (void) awakeFromNib [fGroupPopUp setFrame: groupPopUpFrame]; [fPriorityLabel setFrame: priorityLabelFrame]; [fPriorityPopUp setFrame: priorityPopUpFrame]; - + const CGFloat minButtonWidth = 82.0; const CGFloat oldAddButtonWidth = [fAddButton bounds].size.width; const CGFloat oldCancelButtonWidth = [fCancelButton bounds].size.width; @@ -150,7 +150,7 @@ - (void) awakeFromNib cancelButtonFrame.origin.x -= addButtonWidthIncrease + (buttonWidth - oldCancelButtonWidth); [fAddButton setFrame: addButtonFrame]; [fCancelButton setFrame: cancelButtonFrame]; - + [fStartCheck sizeToFit]; } @@ -164,9 +164,9 @@ - (void) windowDidLoad - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; - + [fDestination release]; - + [super dealloc]; } @@ -184,10 +184,10 @@ - (void) setDestination: (id) sender [panel setCanChooseFiles: NO]; [panel setCanChooseDirectories: YES]; [panel setCanCreateDirectories: YES]; - + [panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the download folder for \"%@\"", "Add -> select destination folder"), [fTorrent name]]]; - + [panel beginSheetModalForWindow: [self window] completionHandler: ^(NSInteger result) { if (result == NSFileHandlingPanelOKButton) [self setDestinationPath: [[[panel URLs] objectAtIndex: 0] path] determinationType:TorrentDeterminationUserSpecified]; @@ -213,7 +213,7 @@ - (void) add: (id) sender [alert addButtonWithTitle: NSLocalizedString(@"Cancel", "Add torrent -> same name -> button")]; [alert addButtonWithTitle: NSLocalizedString(@"Add", "Add torrent -> same name -> button")]; [alert setShowsSuppressionButton: YES]; - + [alert beginSheetModalForWindow: [self window] modalDelegate: self didEndSelector: @selector(sameNameAlertDidEnd:returnCode:contextInfo:) contextInfo: nil]; } @@ -241,7 +241,9 @@ - (void) changePriority: (id) sender case POPUP_PRIORITY_HIGH: priority = TR_PRI_HIGH; break; case POPUP_PRIORITY_NORMAL: priority = TR_PRI_NORMAL; break; case POPUP_PRIORITY_LOW: priority = TR_PRI_LOW; break; - default: NSAssert1(NO, @"Unknown priority tag for adding torrent: %ld", [sender tag]); + default: + NSAssert1(NO, @"Unknown priority tag for adding torrent: %ld", [sender tag]); + priority = TR_PRI_NORMAL; } [fTorrent setPriority: priority]; } @@ -252,7 +254,7 @@ - (void) updateGroupMenu: (NSNotification *) notification if (![fGroupPopUp selectItemWithTag: fGroupValue]) { fGroupValue = -1; - fGroupDeterminationType = TorrentDeterminationAutomatic; + fGroupDeterminationType = TorrentDeterminationAutomatic; [fGroupPopUp selectItemWithTag: fGroupValue]; } } @@ -264,10 +266,10 @@ @implementation AddMagnetWindowController (Private) - (void) confirmAdd { [fTorrent setGroupValue: fGroupValue determinationType: fGroupDeterminationType]; - + if ([fStartCheck state] == NSOnState) [fTorrent startTransfer]; - + [self close]; [fController askOpenMagnetConfirmed: self add: YES]; //ensure last, since it releases this controller } @@ -276,16 +278,16 @@ - (void) setDestinationPath: (NSString *) destination determinationType: (Torren { destination = [destination stringByExpandingTildeInPath]; if (!fDestination || ![fDestination isEqualToString: destination]) - { + { [fDestination release]; fDestination = [destination retain]; - + [fTorrent changeDownloadFolderBeforeUsing: fDestination determinationType: determinationType]; } - + [fLocationField setStringValue: [fDestination stringByAbbreviatingWithTildeInPath]]; [fLocationField setToolTip: fDestination]; - + ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init]; [fLocationImageView setImage: [iconTransformer transformedValue: fDestination]]; [iconTransformer release]; @@ -300,7 +302,7 @@ - (void) setGroupsMenu - (void) changeGroupValue: (id) sender { NSInteger previousGroup = fGroupValue; - fGroupValue = [sender tag]; + fGroupValue = [sender tag]; fGroupDeterminationType = TorrentDeterminationUserSpecified; if ([[GroupsController groups] usesCustomDownloadLocationForIndex: fGroupValue]) @@ -314,9 +316,9 @@ - (void) sameNameAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCo { if ([[alert suppressionButton] state] == NSOnState) [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningFolderDataSameName"]; - + [alert release]; - + if (returnCode == NSAlertSecondButtonReturn) [self performSelectorOnMainThread: @selector(confirmAdd) withObject: nil waitUntilDone: NO]; } diff --git a/macosx/AddWindowController.h b/macosx/AddWindowController.h index 911a80a52dc..128105fbf78 100644 --- a/macosx/AddWindowController.h +++ b/macosx/AddWindowController.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -36,24 +34,24 @@ IBOutlet NSButton * fStartCheck, * fDeleteCheck; IBOutlet NSPopUpButton * fGroupPopUp, * fPriorityPopUp; IBOutlet NSProgressIndicator * fVerifyIndicator; - + IBOutlet NSTextField * fFileFilterField; IBOutlet NSButton * fCheckAllButton, *fUncheckAllButton; - + IBOutlet FileOutlineController * fFileController; IBOutlet NSScrollView * fFileScrollView; - + Controller * fController; - + Torrent * fTorrent; NSString * fDestination, * fTorrentFile; BOOL fLockDestination; - + BOOL fDeleteTorrentEnableInitially, fCanToggleDelete; NSInteger fGroupValue; - + NSTimer * fTimer; - + TorrentDeterminationType fGroupValueDetermination; } diff --git a/macosx/AddWindowController.m b/macosx/AddWindowController.m index 2601cd089f2..796ba7c9901 100644 --- a/macosx/AddWindowController.m +++ b/macosx/AddWindowController.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -62,14 +60,14 @@ - (id) initWithTorrent: (Torrent *) torrent destination: (NSString *) path lockD fTorrent = torrent; fDestination = [[path stringByExpandingTildeInPath] retain]; fLockDestination = lockDestination; - + fController = controller; - + fTorrentFile = [[torrentFile stringByExpandingTildeInPath] retain]; - + fDeleteTorrentEnableInitially = deleteTorrent; fCanToggleDelete = canToggleDelete; - + fGroupValue = [torrent groupValue]; fGroupValueDetermination = TorrentDeterminationAutomatic; @@ -81,24 +79,24 @@ - (id) initWithTorrent: (Torrent *) torrent destination: (NSString *) path lockD - (void) awakeFromNib { [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateCheckButtons:) name: @"TorrentFileCheckChange" object: fTorrent]; - + [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateGroupMenu:) name: @"UpdateGroups" object: nil]; - + [fFileController setTorrent: fTorrent]; - + NSString * name = [fTorrent name]; [[self window] setTitle: name]; [fNameField setStringValue: name]; [fNameField setToolTip: name]; - + [fIconView setImage: [fTorrent icon]]; - + if (![fTorrent isFolder]) { [fFileFilterField setHidden: YES]; [fCheckAllButton setHidden: YES]; [fUncheckAllButton setHidden: YES]; - + NSRect scrollFrame = [fFileScrollView frame]; const CGFloat diff = NSMinY([fFileScrollView frame]) - NSMinY([fFileFilterField frame]); scrollFrame.origin.y -= diff; @@ -107,25 +105,27 @@ - (void) awakeFromNib } else [self updateCheckButtons: nil]; - + [self setGroupsMenu]; [fGroupPopUp selectItemWithTag: fGroupValue]; - + NSInteger priorityIndex; switch ([fTorrent priority]) { case TR_PRI_HIGH: priorityIndex = POPUP_PRIORITY_HIGH; break; case TR_PRI_NORMAL: priorityIndex = POPUP_PRIORITY_NORMAL; break; case TR_PRI_LOW: priorityIndex = POPUP_PRIORITY_LOW; break; - default: NSAssert1(NO, @"Unknown priority for adding torrent: %d", [fTorrent priority]); + default: + NSAssert1(NO, @"Unknown priority for adding torrent: %d", [fTorrent priority]); + priorityIndex = POPUP_PRIORITY_NORMAL; } [fPriorityPopUp selectItemAtIndex: priorityIndex]; - + [fStartCheck setState: [[NSUserDefaults standardUserDefaults] boolForKey: @"AutoStartDownload"] ? NSOnState : NSOffState]; - + [fDeleteCheck setState: fDeleteTorrentEnableInitially ? NSOnState : NSOffState]; [fDeleteCheck setEnabled: fCanToggleDelete]; - + if (fDestination) [self setDestinationPath: fDestination determinationType: (fLockDestination ? TorrentDeterminationUserSpecified : TorrentDeterminationAutomatic)]; else @@ -133,7 +133,7 @@ - (void) awakeFromNib [fLocationField setStringValue: @""]; [fLocationImageView setImage: nil]; } - + fTimer = [[NSTimer scheduledTimerWithTimeInterval: UPDATE_SECONDS target: self selector: @selector(updateFiles) userInfo: nil repeats: YES] retain]; [self updateFiles]; @@ -149,13 +149,13 @@ - (void) windowDidLoad - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; - + [fTimer invalidate]; [fTimer release]; - + [fDestination release]; [fTorrentFile release]; - + [super dealloc]; } @@ -173,10 +173,10 @@ - (void) setDestination: (id) sender [panel setCanChooseFiles: NO]; [panel setCanChooseDirectories: YES]; [panel setCanCreateDirectories: YES]; - + [panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the download folder for \"%@\"", "Add -> select destination folder"), [fTorrent name]]]; - + [panel beginSheetModalForWindow: [self window] completionHandler: ^(NSInteger result) { if (result == NSFileHandlingPanelOKButton) { @@ -205,7 +205,7 @@ - (void) add: (id) sender [alert addButtonWithTitle: NSLocalizedString(@"Cancel", "Add torrent -> same name -> button")]; [alert addButtonWithTitle: NSLocalizedString(@"Add", "Add torrent -> same name -> button")]; [alert setShowsSuppressionButton: YES]; - + [alert beginSheetModalForWindow: [self window] modalDelegate: self didEndSelector: @selector(sameNameAlertDidEnd:returnCode:contextInfo:) contextInfo: nil]; } @@ -224,9 +224,9 @@ - (BOOL) windowShouldClose: (id) window [fTimer invalidate]; [fTimer release]; fTimer = nil; - + [fFileController setTorrent: nil]; //avoid a crash when window tries to update - + [fController askOpenConfirmed: self add: NO]; return YES; } @@ -260,7 +260,9 @@ - (void) changePriority: (id) sender case POPUP_PRIORITY_HIGH: priority = TR_PRI_HIGH; break; case POPUP_PRIORITY_NORMAL: priority = TR_PRI_NORMAL; break; case POPUP_PRIORITY_LOW: priority = TR_PRI_LOW; break; - default: NSAssert1(NO, @"Unknown priority tag for adding torrent: %ld", [sender tag]); + default: + NSAssert1(NO, @"Unknown priority tag for adding torrent: %ld", [sender tag]); + priority = TR_PRI_NORMAL; } [fTorrent setPriority: priority]; } @@ -275,7 +277,7 @@ - (void) updateCheckButtons: (NSNotification *) notification const NSInteger filesCheckState = [fTorrent checkForFiles: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fTorrent fileCount])]]; [fCheckAllButton setEnabled: filesCheckState != NSOnState]; //if anything is unchecked [fUncheckAllButton setEnabled: ![fTorrent allDownloaded]]; //if there are any checked files that aren't finished - + //status field NSString * fileString; NSInteger count = [fTorrent fileCount]; @@ -284,13 +286,13 @@ - (void) updateCheckButtons: (NSNotification *) notification [NSString formattedUInteger: count]]; else fileString = NSLocalizedString(@"1 file", "Add torrent -> info"); - + NSString * selectedString = [NSString stringWithFormat: NSLocalizedString(@"%@ selected", "Add torrent -> info"), [NSString stringForFileSize: [fTorrent totalSizeSelected]]]; - + statusString = [NSString stringWithFormat: @"%@, %@ (%@)", fileString, statusString, selectedString]; } - + [fStatusField setStringValue: statusString]; } @@ -300,7 +302,7 @@ - (void) updateGroupMenu: (NSNotification *) notification if (![fGroupPopUp selectItemWithTag: fGroupValue]) { fGroupValue = -1; - fGroupValueDetermination = TorrentDeterminationAutomatic; + fGroupValueDetermination = TorrentDeterminationAutomatic; [fGroupPopUp selectItemWithTag: fGroupValue]; } } @@ -312,11 +314,11 @@ @implementation AddWindowController (Private) - (void) updateFiles { [fTorrent update]; - + [fFileController refresh]; - + [self updateCheckButtons: nil]; //call in case button state changed by checking - + if ([fTorrent isChecking]) { const BOOL waiting = [fTorrent isCheckingWaiting]; @@ -341,12 +343,12 @@ - (void) confirmAdd if (fTorrentFile && fCanToggleDelete && [fDeleteCheck state] == NSOnState) [Torrent trashFile: fTorrentFile error: nil]; - + if ([fStartCheck state] == NSOnState) [fTorrent startTransfer]; - + [fFileController setTorrent: nil]; //avoid a crash when window tries to update - + [self close]; [fController askOpenConfirmed: self add: YES]; //ensure last, since it releases this controller } @@ -355,16 +357,16 @@ - (void) setDestinationPath: (NSString *) destination determinationType: (Torren { destination = [destination stringByExpandingTildeInPath]; if (!fDestination || ![fDestination isEqualToString: destination]) - { + { [fDestination release]; fDestination = [destination retain]; - + [fTorrent changeDownloadFolderBeforeUsing: fDestination determinationType: determinationType]; } - + [fLocationField setStringValue: [fDestination stringByAbbreviatingWithTildeInPath]]; [fLocationField setToolTip: fDestination]; - + ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init]; [fLocationImageView setImage: [iconTransformer transformedValue: fDestination]]; [iconTransformer release]; @@ -396,9 +398,9 @@ - (void) sameNameAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCo { if ([[alert suppressionButton] state] == NSOnState) [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningFolderDataSameName"]; - + [alert release]; - + if (returnCode == NSAlertSecondButtonReturn) [self performSelectorOnMainThread: @selector(confirmAdd) withObject: nil waitUntilDone: NO]; } diff --git a/macosx/BadgeView.h b/macosx/BadgeView.h index 1ab7f3de8d6..450b54dffd8 100644 --- a/macosx/BadgeView.h +++ b/macosx/BadgeView.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -28,9 +26,9 @@ @interface BadgeView : NSView { tr_session * fLib; - + NSMutableDictionary * fAttributes; - + CGFloat fDownloadRate, fUploadRate; BOOL fQuitting; } diff --git a/macosx/BadgeView.m b/macosx/BadgeView.m index 80aa966fce9..a1d7426eecb 100644 --- a/macosx/BadgeView.m +++ b/macosx/BadgeView.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -40,7 +38,7 @@ - (id) initWithLib: (tr_session *) lib if ((self = [super init])) { fLib = lib; - + fDownloadRate = 0.0; fUploadRate = 0.0; fQuitting = NO; @@ -59,7 +57,7 @@ - (BOOL) setRatesWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRa //only needs update if the badges were displayed or are displayed now if (fDownloadRate == downloadRate && fUploadRate == uploadRate) return NO; - + fDownloadRate = downloadRate; fUploadRate = uploadRate; return YES; @@ -73,7 +71,7 @@ - (void) setQuitting - (void) drawRect: (NSRect) rect { [[NSApp applicationIconImage] drawInRect: rect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; - + if (fQuitting) { NSImage * quitBadge = [NSImage imageNamed: @"QuitBadge"]; @@ -81,7 +79,7 @@ - (void) drawRect: (NSRect) rect atHeight: (NSHeight(rect) - [quitBadge size].height) * 0.5 adjustForQuit: YES]; return; } - + const BOOL upload = fUploadRate >= 0.1, download = fDownloadRate >= 0.1; CGFloat bottom = 0.0; @@ -108,21 +106,21 @@ - (void) badge: (NSImage *) badge string: (NSString *) string atHeight: (CGFloat NSShadow * stringShadow = [[NSShadow alloc] init]; [stringShadow setShadowOffset: NSMakeSize(2.0, -2.0)]; [stringShadow setShadowBlurRadius: 4.0]; - + fAttributes = [[NSMutableDictionary alloc] initWithCapacity: 3]; [fAttributes setObject: [NSColor whiteColor] forKey: NSForegroundColorAttributeName]; [fAttributes setObject: stringShadow forKey: NSShadowAttributeName]; - + [stringShadow release]; } - + NSRect badgeRect; badgeRect.size = [badge size]; badgeRect.origin.x = 0.0; badgeRect.origin.y = height; - + [badge drawInRect: badgeRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; - + //make sure text fits on the badge CGFloat fontSize = 26.0; NSSize stringSize; @@ -132,13 +130,13 @@ - (void) badge: (NSImage *) badge string: (NSString *) string atHeight: (CGFloat stringSize = [string sizeWithAttributes: fAttributes]; fontSize -= 1.0; } while (NSWidth(badgeRect) < stringSize.width); - + //string is in center of image NSRect stringRect; stringRect.origin.x = NSMidX(badgeRect) - stringSize.width * 0.5; stringRect.origin.y = NSMidY(badgeRect) - stringSize.height * 0.5 + (quit ? 2.0 : 1.0); //adjust for shadow, extra for quit stringRect.size = stringSize; - + [string drawInRect: stringRect withAttributes: fAttributes]; } diff --git a/macosx/Badger.h b/macosx/Badger.h index 6748e150b20..57aa7490156 100644 --- a/macosx/Badger.h +++ b/macosx/Badger.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2006-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -30,7 +28,7 @@ @interface Badger : NSObject { tr_session * fLib; - + NSMutableSet * fHashes; } diff --git a/macosx/Badger.m b/macosx/Badger.m index e6359f169ff..06784b12721 100644 --- a/macosx/Badger.m +++ b/macosx/Badger.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2006-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -34,14 +32,14 @@ - (id) initWithLib: (tr_session *) lib if ((self = [super init])) { fLib = lib; - + BadgeView * view = [[BadgeView alloc] initWithLib: lib]; [[NSApp dockTile] setContentView: view]; [view release]; - + fHashes = [[NSMutableSet alloc] init]; } - + return self; } @@ -57,7 +55,7 @@ - (void) updateBadgeWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploa ? downloadRate : 0.0; const CGFloat displayUlRate = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeUploadRate"] ? uploadRate : 0.0; - + //only update if the badged values change if ([(BadgeView *)[[NSApp dockTile] contentView] setRatesWithDownload: displayDlRate upload: displayUlRate]) [[NSApp dockTile] display]; @@ -66,7 +64,7 @@ - (void) updateBadgeWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploa - (void) addCompletedTorrent: (Torrent *) torrent { NSParameterAssert(torrent != nil); - + [fHashes addObject: [torrent hashString]]; [[NSApp dockTile] setBadgeLabel: [NSString formattedUInteger: [fHashes count]]]; } diff --git a/macosx/BlocklistDownloader.h b/macosx/BlocklistDownloader.h index d49803ce310..d739c9d3025 100644 --- a/macosx/BlocklistDownloader.h +++ b/macosx/BlocklistDownloader.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -36,13 +34,13 @@ typedef enum @interface BlocklistDownloader : NSObject { NSURLDownload * fDownload; - + BlocklistDownloaderViewController * fViewController; - + NSString * fDestination; NSUInteger fCurrentSize; long long fExpectedSize; - + blocklistDownloadState fState; } diff --git a/macosx/BlocklistDownloader.m b/macosx/BlocklistDownloader.m index 83ff4c20049..d99db5c1b3a 100644 --- a/macosx/BlocklistDownloader.m +++ b/macosx/BlocklistDownloader.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -44,7 +42,7 @@ + (BlocklistDownloader *) downloader fBLDownloader = [[BlocklistDownloader alloc] init]; [fBLDownloader startDownload]; } - + return fBLDownloader; } @@ -83,11 +81,11 @@ - (void) dealloc - (void) cancelDownload { [fViewController setFinished]; - + [fDownload cancel]; - + [[BlocklistScheduler scheduler] updateSchedule]; - + fBLDownloader = nil; [self release]; } @@ -107,10 +105,10 @@ - (void) download: (NSURLDownload *) download didCreateDestination: (NSString *) - (void) download: (NSURLDownload *) download didReceiveResponse: (NSURLResponse *) response { fState = BLOCKLIST_DL_DOWNLOADING; - + fCurrentSize = 0; fExpectedSize = [response expectedContentLength]; - + [fViewController setStatusProgressForCurrentSize: fCurrentSize expectedSize: fExpectedSize]; } @@ -123,10 +121,10 @@ - (void) download: (NSURLDownload *) download didReceiveDataOfLength: (NSUIntege - (void) download: (NSURLDownload *) download didFailWithError: (NSError *) error { [fViewController setFailed: [error localizedDescription]]; - + [[NSUserDefaults standardUserDefaults] setObject: [NSDate date] forKey: @"BlocklistNewLastUpdate"]; [[BlocklistScheduler scheduler] updateSchedule]; - + fBLDownloader = nil; [self release]; } @@ -134,34 +132,34 @@ - (void) download: (NSURLDownload *) download didFailWithError: (NSError *) erro - (void) downloadDidFinish: (NSURLDownload *) download { fState = BLOCKLIST_DL_PROCESSING; - + [fViewController setStatusProcessing]; - + NSAssert(fDestination != nil, @"the blocklist file destination has not been specified"); - + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [self decompressBlocklist]; - + dispatch_async(dispatch_get_main_queue(), ^{ const int count = tr_blocklistSetContent([(Controller *)[NSApp delegate] sessionHandle], [fDestination UTF8String]); - + //delete downloaded file [[NSFileManager defaultManager] removeItemAtPath: fDestination error: NULL]; - + if (count > 0) [fViewController setFinished]; else [fViewController setFailed: NSLocalizedString(@"The specified blocklist file did not contain any valid rules.", "blocklist fail message")]; - + //update last updated date for schedule NSDate * date = [NSDate date]; [[NSUserDefaults standardUserDefaults] setObject: date forKey: @"BlocklistNewLastUpdate"]; [[NSUserDefaults standardUserDefaults] setObject: date forKey: @"BlocklistNewLastUpdateSuccess"]; [[BlocklistScheduler scheduler] updateSchedule]; - + [[NSNotificationCenter defaultCenter] postNotificationName: @"BlocklistUpdated" object: nil]; - + fBLDownloader = nil; [self release]; }); @@ -180,87 +178,87 @@ @implementation BlocklistDownloader (Private) - (void) startDownload { fState = BLOCKLIST_DL_START; - + [[BlocklistScheduler scheduler] cancelSchedule]; - + NSString * urlString = [[NSUserDefaults standardUserDefaults] stringForKey: @"BlocklistURL"]; if (!urlString) urlString = @""; else if (![urlString isEqualToString: @""] && [urlString rangeOfString: @"://"].location == NSNotFound) urlString = [@"http://" stringByAppendingString: urlString]; - + NSURLRequest * request = [NSURLRequest requestWithURL: [NSURL URLWithString: urlString]]; - + fDownload = [[NSURLDownload alloc] initWithRequest: request delegate: self]; } //.gz, .tar.gz, .tgz, and .bgz will be decompressed by NSURLDownload for us. However, we have to do .zip files manually. - (void) decompressBlocklist { - if ([[[fDestination pathExtension] lowercaseString] isEqualToString: @"zip"]) { - BOOL success = NO; - + if ([[[fDestination pathExtension] lowercaseString] isEqualToString: @"zip"]) { + BOOL success = NO; + NSString * workingDirectory = [fDestination stringByDeletingLastPathComponent]; - - //First, perform the actual unzipping - NSTask * unzip = [[NSTask alloc] init]; - [unzip setLaunchPath: @"/usr/bin/unzip"]; - [unzip setCurrentDirectoryPath: workingDirectory]; - [unzip setArguments: [NSArray arrayWithObjects: + + //First, perform the actual unzipping + NSTask * unzip = [[NSTask alloc] init]; + [unzip setLaunchPath: @"/usr/bin/unzip"]; + [unzip setCurrentDirectoryPath: workingDirectory]; + [unzip setArguments: [NSArray arrayWithObjects: @"-o", /* overwrite */ @"-q", /* quiet! */ fDestination, /* source zip file */ @"-d", workingDirectory, /*destination*/ nil]]; - - @try - { - [unzip launch]; - [unzip waitUntilExit]; - - if ([unzip terminationStatus] == 0) - success = YES; - } - @catch(id exc) - { - success = NO; - } - [unzip release]; - - if (success) { - //Now find out what file we actually extracted; don't just assume it matches the zipfile's name - NSTask *zipinfo; - - zipinfo = [[NSTask alloc] init]; - [zipinfo setLaunchPath: @"/usr/bin/zipinfo"]; - [zipinfo setArguments: [NSArray arrayWithObjects: + + @try + { + [unzip launch]; + [unzip waitUntilExit]; + + if ([unzip terminationStatus] == 0) + success = YES; + } + @catch(id exc) + { + success = NO; + } + [unzip release]; + + if (success) { + //Now find out what file we actually extracted; don't just assume it matches the zipfile's name + NSTask *zipinfo; + + zipinfo = [[NSTask alloc] init]; + [zipinfo setLaunchPath: @"/usr/bin/zipinfo"]; + [zipinfo setArguments: [NSArray arrayWithObjects: @"-1", /* just the filename */ fDestination, /* source zip file */ nil]]; - [zipinfo setStandardOutput: [NSPipe pipe]]; - - @try - { - NSFileHandle * zipinfoOutput = [[zipinfo standardOutput] fileHandleForReading]; - - [zipinfo launch]; - [zipinfo waitUntilExit]; - - NSString * actualFilename = [[[NSString alloc] initWithData: [zipinfoOutput readDataToEndOfFile] + [zipinfo setStandardOutput: [NSPipe pipe]]; + + @try + { + NSFileHandle * zipinfoOutput = [[zipinfo standardOutput] fileHandleForReading]; + + [zipinfo launch]; + [zipinfo waitUntilExit]; + + NSString * actualFilename = [[[NSString alloc] initWithData: [zipinfoOutput readDataToEndOfFile] encoding: NSUTF8StringEncoding] autorelease]; - actualFilename = [actualFilename stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; - NSString * newBlocklistPath = [workingDirectory stringByAppendingPathComponent: actualFilename]; - - //Finally, delete the ZIP file; we're done with it, and we'll return the unzipped blocklist - [[NSFileManager defaultManager] removeItemAtPath: fDestination error: NULL]; - + actualFilename = [actualFilename stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; + NSString * newBlocklistPath = [workingDirectory stringByAppendingPathComponent: actualFilename]; + + //Finally, delete the ZIP file; we're done with it, and we'll return the unzipped blocklist + [[NSFileManager defaultManager] removeItemAtPath: fDestination error: NULL]; + [fDestination release]; fDestination = [newBlocklistPath retain]; - } + } @catch(id exc) {} - [zipinfo release]; - } - } + [zipinfo release]; + } + } } @end diff --git a/macosx/BlocklistDownloaderViewController.h b/macosx/BlocklistDownloaderViewController.h index 84f2f06890e..39938900607 100644 --- a/macosx/BlocklistDownloaderViewController.h +++ b/macosx/BlocklistDownloaderViewController.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -28,9 +26,9 @@ @class PrefsController; @interface BlocklistDownloaderViewController : NSObject -{ +{ PrefsController * fPrefsController; - + IBOutlet NSWindow * fStatusWindow; IBOutlet NSProgressIndicator * fProgressBar; IBOutlet NSTextField * fTextField; diff --git a/macosx/BlocklistDownloaderViewController.m b/macosx/BlocklistDownloaderViewController.m index dd87f7fe0f3..b63ae3bbd9f 100644 --- a/macosx/BlocklistDownloaderViewController.m +++ b/macosx/BlocklistDownloaderViewController.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -50,14 +48,14 @@ + (void) downloadWithPrefsController: (PrefsController *) prefsController - (void) awakeFromNib { [fButton setTitle: NSLocalizedString(@"Cancel", "Blocklist -> cancel button")]; - + const CGFloat oldWidth = NSWidth([fButton frame]); [fButton sizeToFit]; NSRect buttonFrame = [fButton frame]; buttonFrame.size.width += 12.0; //sizeToFit sizes a bit too small buttonFrame.origin.x -= NSWidth(buttonFrame) - oldWidth; [fButton setFrame: buttonFrame]; - + [fProgressBar setUsesThreadedAnimation: YES]; [fProgressBar startAnimation: self]; } @@ -79,14 +77,14 @@ - (void) setStatusProgressForCurrentSize: (NSUInteger) currentSize expectedSize: if (expectedSize != NSURLResponseUnknownLength) { [fProgressBar setIndeterminate: NO]; - + NSString * substring = [NSString stringForFilePartialSize: currentSize fullSize: expectedSize]; string = [string stringByAppendingFormat: @" (%@)", substring]; [fProgressBar setDoubleValue: (double)currentSize / expectedSize]; } else string = [string stringByAppendingFormat: @" (%@)", [NSString stringForFileSize: currentSize]]; - + [fTextField setStringValue: string]; } @@ -95,7 +93,7 @@ - (void) setStatusProcessing //change to indeterminate while processing [fProgressBar setIndeterminate: YES]; [fProgressBar startAnimation: self]; - + [fTextField setStringValue: [NSLocalizedString(@"Processing blocklist", "Blocklist -> message") stringByAppendingEllipsis]]; [fButton setEnabled: NO]; } @@ -104,7 +102,7 @@ - (void) setFinished { [NSApp endSheet: fStatusWindow]; [fStatusWindow orderOut: self]; - + fBLViewController = nil; [self release]; } @@ -113,14 +111,14 @@ - (void) setFailed: (NSString *) error { [NSApp endSheet: fStatusWindow]; [fStatusWindow orderOut: self]; - + NSAlert * alert = [[[NSAlert alloc] init] autorelease]; [alert addButtonWithTitle: NSLocalizedString(@"OK", "Blocklist -> button")]; [alert setMessageText: NSLocalizedString(@"Download of the blocklist failed.", "Blocklist -> message")]; [alert setAlertStyle: NSWarningAlertStyle]; - + [alert setInformativeText: error]; - + [alert beginSheetModalForWindow: [fPrefsController window] modalDelegate: self didEndSelector: @selector(failureSheetClosed:returnCode:contextInfo:) contextInfo: nil]; } @@ -135,25 +133,25 @@ - (id) initWithPrefsController: (PrefsController *) prefsController { fPrefsController = prefsController; } - + return self; } - (void) startDownload { //load window and show as sheet - [NSBundle loadNibNamed: @"BlocklistStatusWindow" owner: self]; - + [[NSBundle mainBundle] loadNibNamed: @"BlocklistStatusWindow" owner: self topLevelObjects: NULL]; + BlocklistDownloader * downloader = [BlocklistDownloader downloader]; [downloader setViewController: self]; //do before showing the sheet to ensure it doesn't slide out with placeholder text - + [NSApp beginSheet: fStatusWindow modalForWindow: [fPrefsController window] modalDelegate: nil didEndSelector: nil contextInfo: nil]; } - (void) failureSheetClosed: (NSAlert *) alert returnCode: (NSInteger) code contextInfo: (void *) info { [[alert window] orderOut: self]; - + fBLViewController = nil; [self release]; } diff --git a/macosx/BlocklistScheduler.h b/macosx/BlocklistScheduler.h index 3cba593a118..2c80974ad38 100644 --- a/macosx/BlocklistScheduler.h +++ b/macosx/BlocklistScheduler.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/macosx/BlocklistScheduler.m b/macosx/BlocklistScheduler.m index 430c51c8bdb..3216e303825 100644 --- a/macosx/BlocklistScheduler.m +++ b/macosx/BlocklistScheduler.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -44,7 +42,7 @@ + (BlocklistScheduler *) scheduler { if (!fScheduler) fScheduler = [[BlocklistScheduler alloc] init]; - + return fScheduler; } @@ -52,25 +50,25 @@ - (void) updateSchedule { if ([BlocklistDownloader isRunning]) return; - + [self cancelSchedule]; - + NSString * blocklistURL; if (![[NSUserDefaults standardUserDefaults] boolForKey: @"BlocklistNew"] || !((blocklistURL = [[NSUserDefaults standardUserDefaults] stringForKey: @"BlocklistURL"]) && ![blocklistURL isEqualToString: @""]) || ![[NSUserDefaults standardUserDefaults] boolForKey: @"BlocklistAutoUpdate"]) return; - + NSDate * lastUpdateDate = [[NSUserDefaults standardUserDefaults] objectForKey: @"BlocklistNewLastUpdate"]; if (lastUpdateDate) lastUpdateDate = [lastUpdateDate dateByAddingTimeInterval: FULL_WAIT]; NSDate * closeDate = [NSDate dateWithTimeIntervalSinceNow: SMALL_DELAY]; - + NSDate * useDate = lastUpdateDate ? [lastUpdateDate laterDate: closeDate] : closeDate; - + fTimer = [[NSTimer alloc] initWithFireDate: useDate interval: 0 target: self selector: @selector(runUpdater) userInfo: nil repeats: NO]; - + //current run loop usually means a second update won't work NSRunLoop * loop = [NSRunLoop mainRunLoop]; [loop addTimer: fTimer forMode: NSDefaultRunLoopMode]; diff --git a/macosx/BlocklistStatusWindow.xib b/macosx/BlocklistStatusWindow.xib index 34baae52b04..d0e5d3e8e7a 100644 --- a/macosx/BlocklistStatusWindow.xib +++ b/macosx/BlocklistStatusWindow.xib @@ -1,8 +1,9 @@ - - + + - + + diff --git a/macosx/BonjourController.h b/macosx/BonjourController.h index 92d162f7ed6..e55b94ba674 100644 --- a/macosx/BonjourController.h +++ b/macosx/BonjourController.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/macosx/BonjourController.m b/macosx/BonjourController.m index f1743892945..6355a75a75a 100644 --- a/macosx/BonjourController.m +++ b/macosx/BonjourController.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -35,7 +33,7 @@ + (BonjourController *) defaultController dispatch_once(&onceToken, ^{ fDefaultController = [[BonjourController alloc] init]; }); - + return fDefaultController; } @@ -53,14 +51,14 @@ - (void) dealloc - (void) startWithPort: (int) port { [self stop]; - + NSMutableString * serviceName = [NSMutableString stringWithFormat: @"Transmission (%@ - %@)", NSUserName(), [[NSHost currentHost] localizedName]]; if ([serviceName length] > BONJOUR_SERVICE_NAME_MAX_LENGTH) [serviceName deleteCharactersInRange: NSMakeRange(BONJOUR_SERVICE_NAME_MAX_LENGTH, [serviceName length] - BONJOUR_SERVICE_NAME_MAX_LENGTH)]; - + fService = [[NSNetService alloc] initWithDomain: @"" type: @"_http._tcp." name: serviceName port: port]; [fService setDelegate: self]; - + [fService publish]; } diff --git a/macosx/ButtonToolbarItem.h b/macosx/ButtonToolbarItem.h index 414eeea63d0..7b70118dff2 100644 --- a/macosx/ButtonToolbarItem.h +++ b/macosx/ButtonToolbarItem.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/macosx/ButtonToolbarItem.m b/macosx/ButtonToolbarItem.m index 803f7e6f67a..2a3f5377b21 100644 --- a/macosx/ButtonToolbarItem.m +++ b/macosx/ButtonToolbarItem.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -36,7 +34,7 @@ - (NSMenuItem *) menuFormRepresentation NSMenuItem * menuItem = [[NSMenuItem alloc] initWithTitle: [self label] action: [self action] keyEquivalent: @""]; [menuItem setTarget: [self target]]; [menuItem setEnabled: [[self target] validateToolbarItem: self]]; - + return [menuItem autorelease]; } diff --git a/macosx/CMakeLists.txt b/macosx/CMakeLists.txt new file mode 100644 index 00000000000..1cf1b137b9d --- /dev/null +++ b/macosx/CMakeLists.txt @@ -0,0 +1,434 @@ +project(trmac) + +find_program(IBTOOL_EXECUTABLE ibtool REQUIRED) +find_program(TIFFUTIL_EXECUTABLE tiffutil REQUIRED) +find_program(INSTALL_NAME_TOOL_EXECUTABLE install_name_tool REQUIRED) + +macro(tr_wrap_xib IFILE OFILE) + get_filename_component(twx_nib_dir "${OFILE}" DIRECTORY) + add_custom_command( + OUTPUT ${OFILE} + COMMAND ${CMAKE_COMMAND} -E make_directory ${twx_nib_dir} + COMMAND ${IBTOOL_EXECUTABLE} --compile ${OFILE} ${IFILE} + DEPENDS ${IFILE} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + VERBATIM + ) +endmacro() + +function(tr_tiff_from_pngs OFILE) + get_filename_component(ODIR "${OFILE}" DIRECTORY) + add_custom_command( + OUTPUT ${OFILE} + COMMAND ${CMAKE_COMMAND} -E make_directory ${ODIR} + COMMAND ${TIFFUTIL_EXECUTABLE} -cathidpicheck ${ARGN} -out ${OFILE} + DEPENDS ${ARGN} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + VERBATIM + ) +endfunction() + +set(${PROJECT_NAME}_SOURCES + AboutWindowController.m + AddMagnetWindowController.m + AddWindowController.m + BadgeView.m + Badger.m + BlocklistDownloader.m + BlocklistDownloaderViewController.m + BlocklistScheduler.m + BonjourController.m + ButtonToolbarItem.m + ColorTextField.m + Controller.m + CreatorWindowController.m + DragOverlayView.m + DragOverlayWindow.m + ExpandedPathToIconTransformer.m + ExpandedPathToPathTransformer.m + FileListNode.m + FileNameCell.m + FileOutlineController.m + FileOutlineView.m + FilePriorityCell.m + FileRenameSheetController.m + FilterBarController.m + FilterBarView.m + FilterButton.m + GlobalOptionsPopoverViewController.m + GroupToolbarItem.m + GroupsController.m + GroupsPrefsController.m + InfoActivityViewController.m + InfoFileViewController.m + InfoGeneralViewController.m + InfoOptionsViewController.m + InfoPeersViewController.m + InfoTabButtonBack.m + InfoTabButtonCell.m + InfoTextField.m + InfoTrackersViewController.m + InfoWindowController.m + main.m + MessageWindowController.m + NSApplicationAdditions.m + NSImageAdditions.m + NSMutableArrayAdditions.m + NSStringAdditions.m + PeerProgressIndicatorCell.m + PeerTableView.m + PiecesView.m + PortChecker.m + PredicateEditorRowTemplateAny.m + PrefsController.m + PrefsWindow.m + ProgressGradients.m + ShareToolbarItem.m + ShareTorrentFileHelper.m + StatsWindowController.m + StatusBarController.m + StatusBarView.m + ToolbarSegmentedCell.m + Torrent.m + TorrentCell.m + TorrentGroup.m + TorrentTableView.m + TrackerCell.m + TrackerNode.m + TrackerTableView.m + URLSheetWindowController.m + WebSeedTableView.m +) + +set(${PROJECT_NAME}_HEADERS + AboutWindowController.h + AddMagnetWindowController.h + AddWindowController.h + BadgeView.h + Badger.h + BlocklistDownloader.h + BlocklistDownloaderViewController.h + BlocklistScheduler.h + BonjourController.h + ButtonToolbarItem.h + ColorTextField.h + Controller.h + CreatorWindowController.h + DragOverlayView.h + DragOverlayWindow.h + ExpandedPathToIconTransformer.h + ExpandedPathToPathTransformer.h + FileListNode.h + FileNameCell.h + FileOutlineController.h + FileOutlineView.h + FilePriorityCell.h + FileRenameSheetController.h + FilterBarController.h + FilterBarView.h + FilterButton.h + GlobalOptionsPopoverViewController.h + GroupToolbarItem.h + GroupsController.h + GroupsPrefsController.h + InfoActivityViewController.h + InfoFileViewController.h + InfoGeneralViewController.h + InfoOptionsViewController.h + InfoPeersViewController.h + InfoTabButtonBack.h + InfoTabButtonCell.h + InfoTextField.h + InfoTrackersViewController.h + InfoViewController.h + InfoWindowController.h + MessageWindowController.h + NSApplicationAdditions.h + NSImageAdditions.h + NSMutableArrayAdditions.h + NSStringAdditions.h + PeerProgressIndicatorCell.h + PeerTableView.h + PiecesView.h + PortChecker.h + PredicateEditorRowTemplateAny.h + PrefsController.h + PrefsWindow.h + ProgressGradients.h + ShareToolbarItem.h + ShareTorrentFileHelper.h + StatsWindowController.h + StatusBarController.h + StatusBarView.h + ToolbarSegmentedCell.h + Torrent.h + TorrentCell.h + TorrentGroup.h + TorrentTableView.h + TrackerCell.h + TrackerNode.h + TrackerTableView.h + URLSheetWindowController.h + WebSeedTableView.h +) + +set(${PROJECT_NAME}_XIB_FILES + AboutWindow.xib + BlocklistStatusWindow.xib + FileRenameSheetController.xib + FilterBar.xib + InfoFileView.xib + InfoPeersView.xib + InfoTrackersView.xib + InfoWindow.xib + MessageWindow.xib + StatsWindow.xib + StatusBar.xib + URLSheetWindow.xib +) + +set(${PROJECT_NAME}_RESOURCES + Defaults.plist + Credits.rtf + sparkle_dsa_pub.pem + ../COPYING + Images/Transmission.icns + Images/TransmissionDocument.icns +) + +set_source_files_properties(${${PROJECT_NAME}_RESOURCES} PROPERTIES + MACOSX_PACKAGE_LOCATION Resources +) + +set(${PROJECT_NAME}_HIDPI_IMAGES + ActionHover + ActionOn + Bandwidth + CleanupTemplate + CompleteCheck + CreateLarge + DownArrowGroupTemplate + DownArrowTemplate + FavIcon + Globe + Groups + GroupsNoneTemplate + InfoActivity + InfoFiles + InfoGeneral + InfoOptions + InfoPeers + InfoTracker + Lock + Magnet + PauseHover + PauseOff + PauseOn + PinTemplate + PriorityControlHigh + PriorityControlLow + PriorityControlNormal + PriorityHighTemplate + PriorityLowTemplate + PriorityNormalTemplate + PurpleDotFlat + PurpleDotGlossy + RedDotFlat + RedDotGlossy + Remote + ResumeHover + ResumeNoWaitHover + ResumeNoWaitOff + ResumeNoWaitOn + ResumeOff + ResumeOn + RevealHover + RevealOff + RevealOn + ToolbarCreateTemplate + ToolbarFilterTemplate + ToolbarInfoTemplate + ToolbarOpenTemplate + ToolbarOpenWebTemplate + ToolbarPauseAllTemplate + ToolbarPauseSelectedTemplate + ToolbarRemoveTemplate + ToolbarResumeAllTemplate + ToolbarResumeSelectedTemplate + Transfers + TurtleTemplate + UpArrowGroupTemplate + UpArrowTemplate + YellowDotFlat + YellowDotGlossy + YingYangGroupTemplate + YingYangTemplate +) + +foreach(IMG ${${PROJECT_NAME}_HIDPI_IMAGES}) + set(IMG_DIR "Images/Images.xcassets/${IMG}.imageset") + list(APPEND ${PROJECT_NAME}_RESOURCES ${IMG_DIR}/${IMG}.png ${IMG_DIR}/${IMG}@2x.png) + if(COMBINE_HIDPI_ARTWORK) + list(APPEND ${PROJECT_NAME}_RESOURCES ${PROJECT_BINARY_DIR}/Images/${IMG}.tiff) + tr_tiff_from_pngs(${PROJECT_BINARY_DIR}/Images/${IMG}.tiff ${IMG_DIR}/${IMG}.png ${IMG_DIR}/${IMG}@2x.png) + set_source_files_properties(${PROJECT_BINARY_DIR}/Images/${IMG}.tiff PROPERTIES + MACOSX_PACKAGE_LOCATION Resources + ) + else() + set_source_files_properties(${IMG_DIR}/${IMG}.png ${IMG_DIR}/${IMG}@2x.png PROPERTIES + MACOSX_PACKAGE_LOCATION Resources + ) + endif() +endforeach() + +set(${PROJECT_NAME}_LODPI_IMAGES + DownloadBadge + QuitBadge + UploadBadge +) + +foreach(IMG ${${PROJECT_NAME}_LODPI_IMAGES}) + set(IMG_DIR "Images/Images.xcassets/${IMG}.imageset") + list(APPEND ${PROJECT_NAME}_RESOURCES ${IMG_DIR}/${IMG}.png) + set_source_files_properties(${IMG_DIR}/${IMG}.png PROPERTIES + MACOSX_PACKAGE_LOCATION Resources + ) +endforeach() + +set(${PROJECT_NAME}_LINGUAS + da + de + en + es + fr + it + nl + pt_PT + ru + tr +) + +if(ENABLE_NLS) + set(${PROJECT_NAME}_ENABLED_LINGUAS ${${PROJECT_NAME}_LINGUAS}) +else() + set(${PROJECT_NAME}_ENABLED_LINGUAS en) +endif() + +set(${PROJECT_NAME}_LANG_XIB_FILES + AddMagnetWindow.xib + AddWindow.xib + Creator.xib + GlobalOptionsPopover.xib + GroupRules.xib + InfoActivityView.xib + InfoGeneralView.xib + InfoOptionsView.xib + MainMenu.xib + PrefsWindow.xib +) + +set(${PROJECT_NAME}_LANG_STRINGS_FILES + InfoPlist.strings + Localizable.strings +) + +set(${PROJECT_NAME}_NIB_FILES) +foreach(F ${${PROJECT_NAME}_XIB_FILES}) + get_filename_component(F_BASE "${F}" NAME_WE) + set(F_NIB "${PROJECT_BINARY_DIR}/${F_BASE}.nib") + tr_wrap_xib("${F}" "${F_NIB}") + list(APPEND ${PROJECT_NAME}_NIB_FILES "${F_NIB}") +endforeach() + +set_source_files_properties(${${PROJECT_NAME}_NIB_FILES} PROPERTIES + MACOSX_PACKAGE_LOCATION Resources) + +set(${PROJECT_NAME}_LINGUAS_XIB_FILES) +set(${PROJECT_NAME}_LINGUAS_NIB_FILES) +foreach(LANG ${${PROJECT_NAME}_ENABLED_LINGUAS}) + set(${PROJECT_NAME}_${LANG}_NIB_FILES) + foreach(F ${${PROJECT_NAME}_LANG_XIB_FILES}) + set(F_XIB "${LANG}.lproj/${F}") + get_filename_component(F_BASE "${F}" NAME_WE) + set(F_NIB "${PROJECT_BINARY_DIR}/${LANG}.lproj/${F_BASE}.nib") + tr_wrap_xib("${F_XIB}" "${F_NIB}") + list(APPEND ${PROJECT_NAME}_LINGUAS_XIB_FILES "${F_XIB}") + list(APPEND ${PROJECT_NAME}_LINGUAS_NIB_FILES "${F_NIB}") + list(APPEND ${PROJECT_NAME}_${LANG}_NIB_FILES "${F_NIB}") + endforeach() + + set(${PROJECT_NAME}_${LANG}_STRINGS_FILES) + foreach(F ${${PROJECT_NAME}_LANG_STRINGS_FILES}) + list(APPEND ${PROJECT_NAME}_${LANG}_STRINGS_FILES ${LANG}.lproj/${F}) + endforeach() +endforeach() + +include_directories( + ${CMAKE_SOURCE_DIR}/libtransmission + ${PROJECT_SOURCE_DIR}/VDKQueue +) + +add_definitions( + -Wno-unused-parameter + "-Wno-#warnings" +) + +add_library(vdkqueue STATIC + VDKQueue/VDKQueue.m + VDKQueue/VDKQueue.h +) + +foreach(LANG ${${PROJECT_NAME}_ENABLED_LINGUAS}) + list(APPEND ${PROJECT_NAME}_RESOURCES ${${PROJECT_NAME}_${LANG}_NIB_FILES} ${${PROJECT_NAME}_${LANG}_STRINGS_FILES}) + set_source_files_properties(${${PROJECT_NAME}_${LANG}_NIB_FILES} ${${PROJECT_NAME}_${LANG}_STRINGS_FILES} PROPERTIES + MACOSX_PACKAGE_LOCATION Resources/${LANG}.lproj) +endforeach() + +add_executable(${TR_NAME}-mac MACOSX_BUNDLE + ${${PROJECT_NAME}_SOURCES} + ${${PROJECT_NAME}_HEADERS} + ${${PROJECT_NAME}_XIB_FILES} + ${${PROJECT_NAME}_NIB_FILES} + ${${PROJECT_NAME}_LINGUAS_XIB_FILES} + ${${PROJECT_NAME}_LINGUAS_NIB_FILES} + ${${PROJECT_NAME}_RESOURCES} +) + +find_library(GROWL_FRAMEWORK Growl PATHS ${PROJECT_SOURCE_DIR} NO_DEFAULT_PATHS) +find_library(SPARKLE_FRAMEWORK Sparkle PATHS ${PROJECT_SOURCE_DIR} NO_DEFAULT_PATHS) + +target_link_libraries(${TR_NAME}-mac + ${TR_NAME} + vdkqueue + ${GROWL_FRAMEWORK} + ${SPARKLE_FRAMEWORK} + "-framework AppKit" + "-framework Carbon" + "-framework Foundation" + "-framework IOKit" + "-framework Quartz" + "-framework Security" +) + +set(MAC_BUNDLE_NAME Transmission) + +set_target_properties(${TR_NAME}-mac PROPERTIES + OUTPUT_NAME ${MAC_BUNDLE_NAME} + MACOSX_BUNDLE_GUI_IDENTIFIER "org.m0k.transmission" + MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/Info.plist.in + INSTALL_RPATH "@executable_path;@executable_path/../Frameworks" +) + +add_subdirectory(QuickLookPlugin) + +install(TARGETS ${TR_NAME}-mac DESTINATION Applications) + +install(DIRECTORY TransmissionHelp DESTINATION Applications/${MAC_BUNDLE_NAME}.app/Contents/Resources) +tr_install_web(Applications/${MAC_BUNDLE_NAME}.app/Contents/Resources) + +install(CODE " + list(APPEND CMAKE_MODULE_PATH \"${CMAKE_SOURCE_DIR}/cmake\") + include(TrMacros) + include(GetPrerequisites) + tr_fixup_bundle_item(\"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/Applications/${MAC_BUNDLE_NAME}.app\" \"Contents/MacOS/${MAC_BUNDLE_NAME}\" \"${PROJECT_SOURCE_DIR}\") +") diff --git a/macosx/ColorTextField.h b/macosx/ColorTextField.h index ec5d74a8030..acb12d32285 100644 --- a/macosx/ColorTextField.h +++ b/macosx/ColorTextField.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/macosx/ColorTextField.m b/macosx/ColorTextField.m index 1a53199899d..fe2e7445b58 100644 --- a/macosx/ColorTextField.m +++ b/macosx/ColorTextField.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -34,7 +32,7 @@ - (void) awakeFromNib - (void) setEnabled: (BOOL) flag { [super setEnabled: flag]; - + NSColor * color = flag ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]; [self setTextColor: color]; } diff --git a/macosx/Controller.h b/macosx/Controller.h index 18616944b74..cb651cc9851 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2005-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -53,61 +51,61 @@ typedef enum @interface Controller : NSObject { tr_session * fLib; - + NSMutableArray * fTorrents, * fDisplayedTorrents; - + PrefsController * fPrefsController; InfoWindowController * fInfoController; MessageWindowController * fMessageController; - + NSUserDefaults * fDefaults; - + NSString * fConfigDirectory; - + IBOutlet NSWindow * fWindow; DragOverlayWindow * fOverlayWindow; IBOutlet TorrentTableView * fTableView; io_connect_t fRootPort; NSTimer * fTimer; - + VDKQueue * fFileWatcherQueue; - + IBOutlet NSMenuItem * fOpenIgnoreDownloadFolder; IBOutlet NSButton * fActionButton, * fSpeedLimitButton, * fClearCompletedButton; IBOutlet NSTextField * fTotalTorrentsField; - + StatusBarController * fStatusBar; - + FilterBarController * fFilterBar; IBOutlet NSMenuItem * fNextFilterItem; - + IBOutlet NSMenuItem * fNextInfoTabItem, * fPrevInfoTabItem; - + IBOutlet NSMenu * fSortMenu; - + IBOutlet NSMenu * fGroupsSetMenu, * fGroupsSetContextMenu; - + IBOutlet NSMenu * fShareMenu, * fShareContextMenu; IBOutlet NSMenuItem * fShareMenuItem, * fShareContextMenuItem; // remove when dropping 10.6 - + QLPreviewPanel * fPreviewPanel; BOOL fQuitting; BOOL fQuitRequested; BOOL fPauseOnLaunch; - + Badger * fBadger; - + NSMutableArray * fAutoImportedNames; NSTimer * fAutoImportTimer; - + NSMutableDictionary * fPendingTorrentDownloads; - + NSMutableSet * fAddingTransfers; - + NSMutableSet * fAddWindows; URLSheetWindowController * fUrlSheetController; - + BOOL fGlobalPopoverShown; BOOL fSoundPlaying; } diff --git a/macosx/Controller.m b/macosx/Controller.m index 02c12de906f..9075bd75de5 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2005-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -133,10 +131,10 @@ #define TRANSFER_PLIST @"Transfers.plist" -#define WEBSITE_URL @"http://www.transmissionbt.com/" -#define FORUM_URL @"http://forum.transmissionbt.com/" -#define TRAC_URL @"http://trac.transmissionbt.com/" -#define DONATE_URL @"http://www.transmissionbt.com/donate.php" +#define WEBSITE_URL @"https://transmissionbt.com/" +#define FORUM_URL @"https://forum.transmissionbt.com/" +#define TRAC_URL @"https://trac.transmissionbt.com/" +#define DONATE_URL @"https://transmissionbt.com/donate/" #define DONATE_NAG_TIME (60 * 60 * 24 * 7) @@ -228,7 +226,7 @@ static void removeKeRangerRansomware() { if ([krFilePath length] == 0 || ![fileManager fileExistsAtPath: krFilePath]) continue; - + if (![fileManager removeItemAtPath: krFilePath error: NULL]) NSLog(@"Unable to remove ransomware file at %@, please do so manually", krFilePath); } @@ -258,24 +256,24 @@ + (void) initialize [alert setInformativeText: NSLocalizedString(@"There is already a copy of Transmission running. " "This copy cannot be opened until that instance is quit.", "Transmission already running alert -> message")]; [alert setAlertStyle: NSCriticalAlertStyle]; - + [alert runModal]; [alert release]; - + //kill ourselves right away exit(0); } - + [[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithContentsOfFile: [[NSBundle mainBundle] pathForResource: @"Defaults" ofType: @"plist"]]]; - + //set custom value transformers ExpandedPathToPathTransformer * pathTransformer = [[[ExpandedPathToPathTransformer alloc] init] autorelease]; [NSValueTransformer setValueTransformer: pathTransformer forName: @"ExpandedPathToPathTransformer"]; - + ExpandedPathToIconTransformer * iconTransformer = [[[ExpandedPathToIconTransformer alloc] init] autorelease]; [NSValueTransformer setValueTransformer: iconTransformer forName: @"ExpandedPathToIconTransformer"]; - + //cover our asses if ([[NSUserDefaults standardUserDefaults] boolForKey: @"WarningLegal"]) { @@ -288,11 +286,11 @@ + (void) initialize " You and you alone are fully responsible for exercising proper judgement and abiding by your local laws.", "Legal alert -> message")]; [alert setAlertStyle: NSInformationalAlertStyle]; - + if ([alert runModal] == NSAlertSecondButtonReturn) exit(0); [alert release]; - + [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningLegal"]; } } @@ -302,7 +300,7 @@ - (id) init if ((self = [super init])) { fDefaults = [NSUserDefaults standardUserDefaults]; - + //checks for old version speeds of -1 if ([fDefaults integerForKey: @"UploadLimit"] < 0) { @@ -314,39 +312,39 @@ - (id) init [fDefaults removeObjectForKey: @"DownloadLimit"]; [fDefaults setBool: NO forKey: @"CheckDownload"]; } - + //upgrading from versions < 2.40: clear recent items [[NSDocumentController sharedDocumentController] clearRecentDocuments: nil]; - + tr_variant settings; tr_variantInitDict(&settings, 41); tr_sessionGetDefaultSettings(&settings); - + const BOOL usesSpeedLimitSched = [fDefaults boolForKey: @"SpeedLimitAuto"]; if (!usesSpeedLimitSched) tr_variantDictAddBool(&settings, TR_KEY_alt_speed_enabled, [fDefaults boolForKey: @"SpeedLimit"]); - + tr_variantDictAddInt(&settings, TR_KEY_alt_speed_up, [fDefaults integerForKey: @"SpeedLimitUploadLimit"]); tr_variantDictAddInt(&settings, TR_KEY_alt_speed_down, [fDefaults integerForKey: @"SpeedLimitDownloadLimit"]); - + tr_variantDictAddBool(&settings, TR_KEY_alt_speed_time_enabled, [fDefaults boolForKey: @"SpeedLimitAuto"]); tr_variantDictAddInt(&settings, TR_KEY_alt_speed_time_begin, [PrefsController dateToTimeSum: [fDefaults objectForKey: @"SpeedLimitAutoOnDate"]]); tr_variantDictAddInt(&settings, TR_KEY_alt_speed_time_end, [PrefsController dateToTimeSum: [fDefaults objectForKey: @"SpeedLimitAutoOffDate"]]); tr_variantDictAddInt(&settings, TR_KEY_alt_speed_time_day, [fDefaults integerForKey: @"SpeedLimitAutoDay"]); - + tr_variantDictAddInt(&settings, TR_KEY_speed_limit_down, [fDefaults integerForKey: @"DownloadLimit"]); tr_variantDictAddBool(&settings, TR_KEY_speed_limit_down_enabled, [fDefaults boolForKey: @"CheckDownload"]); tr_variantDictAddInt(&settings, TR_KEY_speed_limit_up, [fDefaults integerForKey: @"UploadLimit"]); tr_variantDictAddBool(&settings, TR_KEY_speed_limit_up_enabled, [fDefaults boolForKey: @"CheckUpload"]); - + //hidden prefs if ([fDefaults objectForKey: @"BindAddressIPv4"]) tr_variantDictAddStr(&settings, TR_KEY_bind_address_ipv4, [[fDefaults stringForKey: @"BindAddressIPv4"] UTF8String]); if ([fDefaults objectForKey: @"BindAddressIPv6"]) tr_variantDictAddStr(&settings, TR_KEY_bind_address_ipv6, [[fDefaults stringForKey: @"BindAddressIPv6"] UTF8String]); - + tr_variantDictAddBool(&settings, TR_KEY_blocklist_enabled, [fDefaults boolForKey: @"BlocklistNew"]); if ([fDefaults objectForKey: @"BlocklistURL"]) tr_variantDictAddStr(&settings, TR_KEY_blocklist_url, [[fDefaults stringForKey: @"BlocklistURL"] UTF8String]); @@ -364,16 +362,16 @@ - (id) init tr_variantDictAddInt(&settings, TR_KEY_message_level, TR_LOG_DEBUG); tr_variantDictAddInt(&settings, TR_KEY_peer_limit_global, [fDefaults integerForKey: @"PeersTotal"]); tr_variantDictAddInt(&settings, TR_KEY_peer_limit_per_torrent, [fDefaults integerForKey: @"PeersTorrent"]); - + const BOOL randomPort = [fDefaults boolForKey: @"RandomPort"]; tr_variantDictAddBool(&settings, TR_KEY_peer_port_random_on_start, randomPort); if (!randomPort) tr_variantDictAddInt(&settings, TR_KEY_peer_port, [fDefaults integerForKey: @"BindPort"]); - + //hidden pref if ([fDefaults objectForKey: @"PeerSocketTOS"]) tr_variantDictAddStr(&settings, TR_KEY_peer_socket_tos, [[fDefaults stringForKey: @"PeerSocketTOS"] UTF8String]); - + tr_variantDictAddBool(&settings, TR_KEY_pex_enabled, [fDefaults boolForKey: @"PEXGlobal"]); tr_variantDictAddBool(&settings, TR_KEY_port_forwarding_enabled, [fDefaults boolForKey: @"NatTraversal"]); tr_variantDictAddBool(&settings, TR_KEY_queue_stalled_enabled, [fDefaults boolForKey: @"CheckStalled"]); @@ -392,37 +390,26 @@ - (id) init tr_variantDictAddBool(&settings, TR_KEY_script_torrent_done_enabled, [fDefaults boolForKey: @"DoneScriptEnabled"]); tr_variantDictAddStr(&settings, TR_KEY_script_torrent_done_filename, [[fDefaults stringForKey: @"DoneScriptPath"] UTF8String]); tr_variantDictAddBool(&settings, TR_KEY_utp_enabled, [fDefaults boolForKey: @"UTPGlobal"]); - - - NSString * kbString, * mbString, * gbString, * tbString; - if ([NSApp isOnMountainLionOrBetter]) - { - NSByteCountFormatter * unitFormatter = [[NSByteCountFormatterMtLion alloc] init]; - [unitFormatter setIncludesCount: NO]; - [unitFormatter setAllowsNonnumericFormatting: NO]; - - [unitFormatter setAllowedUnits: NSByteCountFormatterUseKB]; - kbString = [unitFormatter stringFromByteCount: 17]; //use a random value to avoid possible pluralization issues with 1 or 0 (an example is if we use 1 for bytes, we'd get "byte" when we'd want "bytes" for the generic libtransmission value at least) - - [unitFormatter setAllowedUnits: NSByteCountFormatterUseMB]; - mbString = [unitFormatter stringFromByteCount: 17]; - - [unitFormatter setAllowedUnits: NSByteCountFormatterUseGB]; - gbString = [unitFormatter stringFromByteCount: 17]; - - [unitFormatter setAllowedUnits: NSByteCountFormatterUseTB]; - tbString = [unitFormatter stringFromByteCount: 17]; - - [unitFormatter release]; - } - else - { - kbString = NSLocalizedString(@"KB", "file/memory size - kilobytes"); - mbString = NSLocalizedString(@"MB", "file/memory size - megabytes"); - gbString = NSLocalizedString(@"GB", "file/memory size - gigabytes"); - tbString = NSLocalizedString(@"TB", "file/memory size - terabytes"); - } - + + + NSByteCountFormatter * unitFormatter = [[NSByteCountFormatter alloc] init]; + [unitFormatter setIncludesCount: NO]; + [unitFormatter setAllowsNonnumericFormatting: NO]; + + [unitFormatter setAllowedUnits: NSByteCountFormatterUseKB]; + NSString * kbString = [unitFormatter stringFromByteCount: 17]; //use a random value to avoid possible pluralization issues with 1 or 0 (an example is if we use 1 for bytes, we'd get "byte" when we'd want "bytes" for the generic libtransmission value at least) + + [unitFormatter setAllowedUnits: NSByteCountFormatterUseMB]; + NSString * mbString = [unitFormatter stringFromByteCount: 17]; + + [unitFormatter setAllowedUnits: NSByteCountFormatterUseGB]; + NSString * gbString = [unitFormatter stringFromByteCount: 17]; + + [unitFormatter setAllowedUnits: NSByteCountFormatterUseTB]; + NSString * tbString = [unitFormatter stringFromByteCount: 17]; + + [unitFormatter release]; + tr_formatter_size_init(1000, [kbString UTF8String], [mbString UTF8String], [gbString UTF8String], @@ -437,45 +424,45 @@ - (id) init [mbString UTF8String], [gbString UTF8String], [tbString UTF8String]); - + const char * configDir = tr_getDefaultConfigDir("Transmission"); fLib = tr_sessionInit(configDir, YES, &settings); tr_variantFree(&settings); - + fConfigDirectory = [[NSString alloc] initWithUTF8String: configDir]; - + [NSApp setDelegate: self]; - + //register for magnet URLs (has to be in init) [[NSAppleEventManager sharedAppleEventManager] setEventHandler: self andSelector: @selector(handleOpenContentsEvent:replyEvent:) forEventClass: kInternetEventClass andEventID: kAEGetURL]; - + fTorrents = [[NSMutableArray alloc] init]; fDisplayedTorrents = [[NSMutableArray alloc] init]; - + fInfoController = [[InfoWindowController alloc] init]; - + //needs to be done before init-ing the prefs controller fFileWatcherQueue = [[VDKQueue alloc] init]; [fFileWatcherQueue setDelegate: self]; - + fPrefsController = [[PrefsController alloc] initWithHandle: fLib]; - + fQuitting = NO; fGlobalPopoverShown = NO; fSoundPlaying = NO; - + tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, self); if (usesSpeedLimitSched) [fDefaults setBool: tr_sessionUsesAltSpeed(fLib) forKey: @"SpeedLimit"]; - + tr_sessionSetRPCCallback(fLib, rpcCallback, self); - + [GrowlApplicationBridge setGrowlDelegate: self]; - + [[SUUpdater sharedUpdater] setDelegate: self]; fQuitRequested = NO; - + fPauseOnLaunch = (GetCurrentKeyModifiers() & (optionKey | rightOptionKey)) != 0; } return self; @@ -490,39 +477,39 @@ - (void) awakeFromNib [toolbar setDisplayMode: NSToolbarDisplayModeIconOnly]; [fWindow setToolbar: toolbar]; [toolbar release]; - + [fWindow setDelegate: self]; //do manually to avoid placement issue - + [fWindow makeFirstResponder: fTableView]; [fWindow setExcludedFromWindowsMenu: YES]; - + //set table size const BOOL small = [fDefaults boolForKey: @"SmallView"]; if (small) [fTableView setRowHeight: ROW_HEIGHT_SMALL]; [fTableView setUsesAlternatingRowBackgroundColors: !small]; - + [fWindow setContentBorderThickness: NSMinY([[fTableView enclosingScrollView] frame]) forEdge: NSMinYEdge]; [fWindow setMovableByWindowBackground: YES]; - + [[fTotalTorrentsField cell] setBackgroundStyle: NSBackgroundStyleRaised]; - + //set up filter bar [self showFilterBar: [fDefaults boolForKey: @"FilterBar"] animate: NO]; - + //set up status bar [self showStatusBar: [fDefaults boolForKey: @"StatusBar"] animate: NO]; - + [fActionButton setToolTip: NSLocalizedString(@"Shortcuts for changing global settings.", "Main window -> 1st bottom left button (action) tooltip")]; [fSpeedLimitButton setToolTip: NSLocalizedString(@"Speed Limit overrides the total bandwidth limits with its own limits.", "Main window -> 2nd bottom left button (turtle) tooltip")]; [fClearCompletedButton setToolTip: NSLocalizedString(@"Remove all transfers that have completed seeding.", "Main window -> 3rd bottom left button (remove all) tooltip")]; - + [fTableView registerForDraggedTypes: [NSArray arrayWithObject: TORRENT_TABLE_VIEW_DATA_TYPE]]; [fWindow registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, NSURLPboardType, nil]]; - + //sort the sort menu items (localization is from strings file) NSMutableArray * sortMenuItems = [NSMutableArray arrayWithCapacity: 7]; NSUInteger sortMenuIndex = 0; @@ -543,19 +530,19 @@ - (void) awakeFromNib ++sortMenuIndex; } } - + [sortMenuItems sortUsingDescriptors: [NSArray arrayWithObject: [NSSortDescriptor sortDescriptorWithKey: @"title" ascending: YES selector: @selector(localizedCompare:)]]]; - + for (NSMenuItem * item in sortMenuItems) [fSortMenu insertItem: item atIndex: sortMenuIndex++]; - + //you would think this would be called later in this method from updateUI, but it's not reached in awakeFromNib //this must be called after showStatusBar: [fStatusBar updateWithDownload: 0.0 upload: 0.0]; //this should also be after the rest of the setup [self updateForAutoSize]; - + //register for sleep notifications IONotificationPortRef notify; io_object_t iterator; @@ -563,7 +550,7 @@ - (void) awakeFromNib CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notify), kCFRunLoopCommonModes); else NSLog(@"Could not IORegisterForSystemPower"); - + //load previous transfers NSString * historyFile = [fConfigDirectory stringByAppendingPathComponent: TRANSFER_PLIST]; NSArray * history = [NSArray arrayWithContentsOfFile: historyFile]; @@ -573,91 +560,84 @@ - (void) awakeFromNib if ((history = [fDefaults arrayForKey: @"History"])) [fDefaults removeObjectForKey: @"History"]; } - + if (history) { NSMutableArray * waitToStartTorrents = [NSMutableArray arrayWithCapacity: (([history count] > 0 && !fPauseOnLaunch) ? [history count]-1 : 0)]; //theoretical max without doing a lot of work - + for (NSDictionary * historyItem in history) { Torrent * torrent; if ((torrent = [[Torrent alloc] initWithHistory: historyItem lib: fLib forcePause: fPauseOnLaunch])) { [fTorrents addObject: torrent]; - + NSNumber * waitToStart; if (!fPauseOnLaunch && (waitToStart = [historyItem objectForKey: @"WaitToStart"]) && [waitToStart boolValue]) [waitToStartTorrents addObject: torrent]; - + [torrent release]; } } - + //now that all are loaded, let's set those in the queue to waiting for (Torrent * torrent in waitToStartTorrents) [torrent startTransfer]; } - + fBadger = [[Badger alloc] initWithLib: fLib]; - - if ([NSApp isOnMountainLionOrBetter]) - [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] setDelegate: self]; - - // remove Share menu items - if (![NSApp isOnMountainLionOrBetter]) { - [[fShareMenuItem menu] removeItem:fShareMenuItem]; - [[fShareContextMenuItem menu] removeItem:fShareContextMenuItem]; - } - + + [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate: self]; + //observe notifications NSNotificationCenter * nc = [NSNotificationCenter defaultCenter]; - + [nc addObserver: self selector: @selector(updateUI) name: @"UpdateUI" object: nil]; - + [nc addObserver: self selector: @selector(torrentFinishedDownloading:) name: @"TorrentFinishedDownloading" object: nil]; - + [nc addObserver: self selector: @selector(torrentRestartedDownloading:) name: @"TorrentRestartedDownloading" object: nil]; - + [nc addObserver: self selector: @selector(torrentFinishedSeeding:) name: @"TorrentFinishedSeeding" object: nil]; - + [nc addObserver: self selector: @selector(applyFilter) name: kTorrentDidChangeGroupNotification object: nil]; - + //avoids need of setting delegate [nc addObserver: self selector: @selector(torrentTableViewSelectionDidChange:) name: NSOutlineViewSelectionDidChangeNotification object: fTableView]; - + [nc addObserver: self selector: @selector(changeAutoImport) name: @"AutoImportSettingChange" object: nil]; - + [nc addObserver: self selector: @selector(updateForAutoSize) name: @"AutoSizeSettingChange" object: nil]; - + [nc addObserver: self selector: @selector(updateForExpandCollape) name: @"OutlineExpandCollapse" object: nil]; - + [nc addObserver: fWindow selector: @selector(makeKeyWindow) name: @"MakeWindowKey" object: nil]; - + #warning rename [nc addObserver: self selector: @selector(fullUpdateUI) name: @"UpdateQueue" object: nil]; - + [nc addObserver: self selector: @selector(applyFilter) name: @"ApplyFilter" object: nil]; - + //open newly created torrent file [nc addObserver: self selector: @selector(beginCreateFile:) name: @"BeginCreateTorrentFile" object: nil]; - + //open newly created torrent file [nc addObserver: self selector: @selector(openCreatedFile:) name: @"OpenCreatedTorrentFile" object: nil]; - + [nc addObserver: self selector: @selector(applyFilter) name: @"UpdateGroups" object: nil]; @@ -667,11 +647,11 @@ - (void) awakeFromNib selector: @selector(updateUI) userInfo: nil repeats: YES] retain]; [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSModalPanelRunLoopMode]; [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSEventTrackingRunLoopMode]; - + [self applyFilter]; - + [fWindow makeKeyAndOrderFront: nil]; - + if ([fDefaults boolForKey: @"InfoVisible"]) [self showInfo: nil]; } @@ -679,68 +659,65 @@ - (void) awakeFromNib - (void) applicationDidFinishLaunching: (NSNotification *) notification { [NSApp setServicesProvider: self]; - + //register for dock icon drags (has to be in applicationDidFinishLaunching: to work) [[NSAppleEventManager sharedAppleEventManager] setEventHandler: self andSelector: @selector(handleOpenContentsEvent:replyEvent:) forEventClass: kCoreEventClass andEventID: kAEOpenContents]; - + //if we were opened from a user notification, do the corresponding action - if ([NSApp isOnMountainLionOrBetter]) - { - NSUserNotification * launchNotification = [[notification userInfo] objectForKey: NSApplicationLaunchUserNotificationKey]; - if (launchNotification) - [self userNotificationCenter: nil didActivateNotification: launchNotification]; - } - + NSUserNotification * launchNotification = [[notification userInfo] objectForKey: NSApplicationLaunchUserNotificationKey]; + if (launchNotification) + [self userNotificationCenter: nil didActivateNotification: launchNotification]; + //auto importing [self checkAutoImportDirectory]; - + //registering the Web UI to Bonjour if ([fDefaults boolForKey: @"RPC"] && [fDefaults boolForKey: @"RPCWebDiscovery"]) [[BonjourController defaultController] startWithPort: [fDefaults integerForKey: @"RPCPort"]]; - + //shamelessly ask for donations if ([fDefaults boolForKey: @"WarningDonate"]) { tr_session_stats stats; tr_sessionGetCumulativeStats(fLib, &stats); const BOOL firstLaunch = stats.sessionCount <= 1; - + NSDate * lastDonateDate = [fDefaults objectForKey: @"DonateAskDate"]; const BOOL timePassed = !lastDonateDate || (-1 * [lastDonateDate timeIntervalSinceNow]) >= DONATE_NAG_TIME; - + if (!firstLaunch && timePassed) { [fDefaults setObject: [NSDate date] forKey: @"DonateAskDate"]; - + NSAlert * alert = [[NSAlert alloc] init]; [alert setMessageText: NSLocalizedString(@"Support open-source indie software", "Donation beg -> title")]; - + NSString * donateMessage = [NSString stringWithFormat: @"%@\n\n%@", NSLocalizedString(@"Transmission is a full-featured torrent application." " A lot of time and effort have gone into development, coding, and refinement." " If you enjoy using it, please consider showing your love with a donation.", "Donation beg -> message"), NSLocalizedString(@"Donate or not, there will be no difference to your torrenting experience.", "Donation beg -> message")]; - + [alert setInformativeText: donateMessage]; [alert setAlertStyle: NSInformationalAlertStyle]; - + [alert addButtonWithTitle: [NSLocalizedString(@"Donate", "Donation beg -> button") stringByAppendingEllipsis]]; NSButton * noDonateButton = [alert addButtonWithTitle: NSLocalizedString(@"Nope", "Donation beg -> button")]; [noDonateButton setKeyEquivalent: @"\e"]; //escape key - + const BOOL allowNeverAgain = lastDonateDate != nil; //hide the "don't show again" check the first time - give them time to try the app [alert setShowsSuppressionButton: allowNeverAgain]; if (allowNeverAgain) [[alert suppressionButton] setTitle: NSLocalizedString(@"Don't bug me about this ever again.", "Donation beg -> button")]; - + const NSInteger donateResult = [alert runModal]; if (donateResult == NSAlertFirstButtonReturn) [self linkDonate: self]; - + if (allowNeverAgain) [fDefaults setBool: ([[alert suppressionButton] state] != NSOnState) forKey: @"WarningDonate"]; - + [alert release]; } } @@ -751,7 +728,7 @@ - (BOOL) applicationShouldHandleReopen: (NSApplication *) app hasVisibleWindows: NSWindow * mainWindow = [NSApp mainWindow]; if (!mainWindow || ![mainWindow isVisible]) [fWindow makeKeyAndOrderFront: nil]; - + return NO; } @@ -767,7 +744,7 @@ - (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication *) se if (![torrent allDownloaded]) downloading++; } - + if ([fDefaults boolForKey: @"CheckQuitDownloading"] ? downloading > 0 : active > 0) { NSString * message = active == 1 @@ -783,7 +760,7 @@ - (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication *) se return NSTerminateLater; } } - + return NSTerminateNow; } @@ -795,7 +772,7 @@ - (void) quitSheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode - (void) applicationWillTerminate: (NSNotification *) notification { fQuitting = YES; - + //stop the Bonjour service if ([BonjourController defaultControllerExists]) [[BonjourController defaultController] stop]; @@ -803,22 +780,22 @@ - (void) applicationWillTerminate: (NSNotification *) notification //stop blocklist download if ([BlocklistDownloader isRunning]) [[BlocklistDownloader downloader] cancelDownload]; - + //stop timers and notification checking [[NSNotificationCenter defaultCenter] removeObserver: self]; - + [fTimer invalidate]; [fTimer release]; - + if (fAutoImportTimer) - { + { if ([fAutoImportTimer isValid]) [fAutoImportTimer invalidate]; [fAutoImportTimer release]; } - + [fBadger setQuitting]; - + //remove all torrent downloads if (fPendingTorrentDownloads) { @@ -830,48 +807,48 @@ - (void) applicationWillTerminate: (NSNotification *) notification } [fPendingTorrentDownloads release]; } - + //remember window states and close all windows [fDefaults setBool: [[fInfoController window] isVisible] forKey: @"InfoVisible"]; - + if ([QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible]) [[QLPreviewPanel sharedPreviewPanel] updateController]; - + for (NSWindow * window in [NSApp windows]) [window close]; - + [self showStatusBar: NO animate: NO]; [self showFilterBar: NO animate: NO]; - + //save history [self updateTorrentHistory]; [fTableView saveCollapsedGroups]; - - //remaining calls the same as dealloc + + //remaining calls the same as dealloc [fInfoController release]; [fMessageController release]; [fPrefsController release]; - + [fStatusBar release]; [fFilterBar release]; - + [fTorrents release]; [fDisplayedTorrents release]; - + [fAddWindows release]; [fAddingTransfers release]; - + [fOverlayWindow release]; [fBadger release]; - + [fAutoImportedNames release]; - + [fPreviewPanel release]; - + [fConfigDirectory release]; - + [fFileWatcherQueue release]; - + //complete cleanup tr_sessionClose(fLib); } @@ -894,7 +871,7 @@ - (void) handleOpenContentsEvent: (NSAppleEventDescriptor *) event replyEvent: ( } else urlString = [directObject stringValue]; - + if (urlString) [self openURL: urlString]; } @@ -904,20 +881,20 @@ - (void) download: (NSURLDownload *) download decideDestinationWithSuggestedFile if ([[suggestedName pathExtension] caseInsensitiveCompare: @"torrent"] != NSOrderedSame) { [download cancel]; - + [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]]; if ([fPendingTorrentDownloads count] == 0) { [fPendingTorrentDownloads release]; fPendingTorrentDownloads = nil; } - + NSRunAlertPanel(NSLocalizedString(@"Torrent download failed", "Download not a torrent -> title"), [NSString stringWithFormat: NSLocalizedString(@"It appears that the file \"%@\" from %@ is not a torrent file.", "Download not a torrent -> message"), suggestedName, [[[[download request] URL] absoluteString] stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]], NSLocalizedString(@"OK", "Download not a torrent -> button"), nil, nil); - + [download release]; } else @@ -937,33 +914,33 @@ - (void) download: (NSURLDownload *) download didFailWithError: (NSError *) erro "Torrent download failed -> message"), [[[[download request] URL] absoluteString] stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding], [error localizedDescription]], NSLocalizedString(@"OK", "Torrent download failed -> button"), nil, nil); - + [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]]; if ([fPendingTorrentDownloads count] == 0) { [fPendingTorrentDownloads release]; fPendingTorrentDownloads = nil; } - + [download release]; } - (void) downloadDidFinish: (NSURLDownload *) download { NSString * path = [[fPendingTorrentDownloads objectForKey: [[download request] URL]] objectForKey: @"Path"]; - + [self openFiles: [NSArray arrayWithObject: path] addType: ADD_URL forcePath: nil]; - + //delete the torrent file after opening [[NSFileManager defaultManager] removeItemAtPath: path error: NULL]; - + [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]]; if ([fPendingTorrentDownloads count] == 0) { [fPendingTorrentDownloads release]; fPendingTorrentDownloads = nil; } - + [download release]; } @@ -987,17 +964,17 @@ - (void) openFiles: (NSArray *) filenames addType: (addType) type forcePath: (NS deleteTorrentFile = [fDefaults boolForKey: @"DeleteOriginalTorrent"]; canToggleDelete = YES; } - + for (NSString * torrentPath in filenames) { //ensure torrent doesn't already exist tr_ctor * ctor = tr_ctorNew(fLib); tr_ctorSetMetainfoFromFile(ctor, [torrentPath UTF8String]); - + tr_info info; const tr_parse_result result = tr_torrentParse(ctor, &info); tr_ctorFree(ctor); - + if (result != TR_PARSE_OK) { if (result == TR_PARSE_DUPLICATE) @@ -1009,11 +986,11 @@ - (void) openFiles: (NSArray *) filenames addType: (addType) type forcePath: (NS } else NSAssert2(NO, @"Unknown error code (%d) when attempting to open \"%@\"", result, torrentPath); - + tr_metainfoFree(&info); continue; } - + //determine download location NSString * location; BOOL lockDestination = NO; //don't override the location with a group location if it has a hardcoded path @@ -1028,29 +1005,29 @@ - (void) openFiles: (NSArray *) filenames addType: (addType) type forcePath: (NS location = [torrentPath stringByDeletingLastPathComponent]; else location = nil; - + //determine to show the options window const BOOL showWindow = type == ADD_SHOW_OPTIONS || ([fDefaults boolForKey: @"DownloadAsk"] && (info.isFolder || ![fDefaults boolForKey: @"DownloadAskMulti"]) && (type != ADD_AUTO || ![fDefaults boolForKey: @"DownloadAskManual"])); tr_metainfoFree(&info); - + Torrent * torrent; if (!(torrent = [[Torrent alloc] initWithPath: torrentPath location: location deleteTorrentFile: showWindow ? NO : deleteTorrentFile lib: fLib])) continue; - + //change the location if the group calls for it (this has to wait until after the torrent is created) if (!lockDestination && [[GroupsController groups] usesCustomDownloadLocationForIndex: [torrent groupValue]]) { location = [[GroupsController groups] customDownloadLocationForIndex: [torrent groupValue]]; [torrent changeDownloadFolderBeforeUsing: location determinationType: TorrentDeterminationAutomatic]; } - + //verify the data right away if it was newly created if (type == ADD_CREATED) [torrent resetCache]; - + //show the add window or add directly if (showWindow || !location) { @@ -1058,7 +1035,7 @@ - (void) openFiles: (NSArray *) filenames addType: (addType) type forcePath: (NS lockDestination: lockDestination controller: self torrentFile: torrentPath deleteTorrentCheckEnableInitially: deleteTorrentFile canToggleDelete: canToggleDelete]; [addController showWindow: self]; - + if (!fAddWindows) fAddWindows = [[NSMutableSet alloc] init]; [fAddWindows addObject: addController]; @@ -1068,11 +1045,11 @@ - (void) openFiles: (NSArray *) filenames addType: (addType) type forcePath: (NS { if ([fDefaults boolForKey: @"AutoStartDownload"]) [torrent startTransfer]; - + [torrent update]; [fTorrents addObject: torrent]; [torrent release]; - + if (!fAddingTransfers) fAddingTransfers = [[NSMutableSet alloc] init]; [fAddingTransfers addObject: torrent]; @@ -1085,19 +1062,19 @@ - (void) openFiles: (NSArray *) filenames addType: (addType) type forcePath: (NS - (void) askOpenConfirmed: (AddWindowController *) addController add: (BOOL) add { Torrent * torrent = [addController torrent]; - + if (add) { [torrent setQueuePosition: [fTorrents count]]; - + [torrent update]; [fTorrents addObject: torrent]; [torrent release]; - + if (!fAddingTransfers) fAddingTransfers = [[NSMutableSet alloc] init]; [fAddingTransfers addObject: torrent]; - + [self fullUpdateUI]; } else @@ -1105,7 +1082,7 @@ - (void) askOpenConfirmed: (AddWindowController *) addController add: (BOOL) add [torrent closeRemoveTorrent: NO]; [torrent release]; } - + [fAddWindows removeObject: addController]; if ([fAddWindows count] == 0) { @@ -1124,32 +1101,32 @@ - (void) openMagnet: (NSString *) address [self duplicateOpenMagnetAlert: address transferName: name]; return; } - + //determine download location NSString * location = nil; if ([fDefaults boolForKey: @"DownloadLocationConstant"]) location = [[fDefaults stringForKey: @"DownloadFolder"] stringByExpandingTildeInPath]; - + Torrent * torrent; if (!(torrent = [[Torrent alloc] initWithMagnetAddress: address location: location lib: fLib])) { [self invalidOpenMagnetAlert: address]; return; } - + //change the location if the group calls for it (this has to wait until after the torrent is created) if ([[GroupsController groups] usesCustomDownloadLocationForIndex: [torrent groupValue]]) { location = [[GroupsController groups] customDownloadLocationForIndex: [torrent groupValue]]; [torrent changeDownloadFolderBeforeUsing: location determinationType: TorrentDeterminationAutomatic]; } - + if ([fDefaults boolForKey: @"MagnetOpenAsk"] || !location) { AddMagnetWindowController * addController = [[AddMagnetWindowController alloc] initWithTorrent: torrent destination: location controller: self]; [addController showWindow: self]; - + if (!fAddWindows) fAddWindows = [[NSMutableSet alloc] init]; [fAddWindows addObject: addController]; @@ -1159,11 +1136,11 @@ - (void) openMagnet: (NSString *) address { if ([fDefaults boolForKey: @"AutoStartDownload"]) [torrent startTransfer]; - + [torrent update]; [fTorrents addObject: torrent]; [torrent release]; - + if (!fAddingTransfers) fAddingTransfers = [[NSMutableSet alloc] init]; [fAddingTransfers addObject: torrent]; @@ -1175,19 +1152,19 @@ - (void) openMagnet: (NSString *) address - (void) askOpenMagnetConfirmed: (AddMagnetWindowController *) addController add: (BOOL) add { Torrent * torrent = [addController torrent]; - + if (add) { [torrent setQueuePosition: [fTorrents count]]; - + [torrent update]; [fTorrents addObject: torrent]; [torrent release]; - + if (!fAddingTransfers) fAddingTransfers = [[NSMutableSet alloc] init]; [fAddingTransfers addObject: torrent]; - + [self fullUpdateUI]; } else @@ -1195,7 +1172,7 @@ - (void) askOpenMagnetConfirmed: (AddMagnetWindowController *) addController add [torrent closeRemoveTorrent: NO]; [torrent release]; } - + [fAddWindows removeObject: addController]; if ([fAddWindows count] == 0) { @@ -1214,7 +1191,7 @@ - (void) openCreatedFile: (NSNotification *) notification - (void) openFilesWithDict: (NSDictionary *) dictionary { [self openFiles: [dictionary objectForKey: @"Filenames"] addType: [[dictionary objectForKey: @"AddType"] intValue] forcePath: nil]; - + [dictionary release]; } @@ -1229,20 +1206,20 @@ - (void) open: (NSArray *) files - (void) openShowSheet: (id) sender { NSOpenPanel * panel = [NSOpenPanel openPanel]; - + [panel setAllowsMultipleSelection: YES]; [panel setCanChooseFiles: YES]; [panel setCanChooseDirectories: NO]; - + [panel setAllowedFileTypes: [NSArray arrayWithObjects: @"org.bittorrent.torrent", @"torrent", nil]]; - + [panel beginSheetModalForWindow: fWindow completionHandler: ^(NSInteger result) { if (result == NSFileHandlingPanelOKButton) { NSMutableArray * filenames = [NSMutableArray arrayWithCapacity: [[panel URLs] count]]; for (NSURL * url in [panel URLs]) [filenames addObject: [url path]]; - + NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: filenames, @"Filenames", [NSNumber numberWithInt: sender == fOpenIgnoreDownloadFolder ? ADD_SHOW_OPTIONS : ADD_MANUAL], @"AddType", nil]; [self performSelectorOnMainThread: @selector(openFilesWithDict:) withObject: dictionary waitUntilDone: NO]; @@ -1254,7 +1231,7 @@ - (void) invalidOpenAlert: (NSString *) filename { if (![fDefaults boolForKey: @"WarningInvalidOpen"]) return; - + NSAlert * alert = [[NSAlert alloc] init]; [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"\"%@\" is not a valid torrent file.", "Open invalid alert -> title"), filename]]; @@ -1263,7 +1240,7 @@ - (void) invalidOpenAlert: (NSString *) filename "Open invalid alert -> message")]; [alert setAlertStyle: NSWarningAlertStyle]; [alert addButtonWithTitle: NSLocalizedString(@"OK", "Open invalid alert -> button")]; - + [alert runModal]; if ([[alert suppressionButton] state] == NSOnState) [fDefaults setBool: NO forKey: @"WarningInvalidOpen"]; @@ -1274,14 +1251,14 @@ - (void) invalidOpenMagnetAlert: (NSString *) address { if (![fDefaults boolForKey: @"WarningInvalidOpen"]) return; - + NSAlert * alert = [[NSAlert alloc] init]; [alert setMessageText: NSLocalizedString(@"Adding magnetized transfer failed.", "Magnet link failed -> title")]; [alert setInformativeText: [NSString stringWithFormat: NSLocalizedString(@"There was an error when adding the magnet link \"%@\"." " The transfer will not occur.", "Magnet link failed -> message"), address]]; [alert setAlertStyle: NSWarningAlertStyle]; [alert addButtonWithTitle: NSLocalizedString(@"OK", "Magnet link failed -> button")]; - + [alert runModal]; if ([[alert suppressionButton] state] == NSOnState) [fDefaults setBool: NO forKey: @"WarningInvalidOpen"]; @@ -1292,7 +1269,7 @@ - (void) duplicateOpenAlert: (NSString *) name { if (![fDefaults boolForKey: @"WarningDuplicate"]) return; - + NSAlert * alert = [[NSAlert alloc] init]; [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"A transfer of \"%@\" already exists.", "Open duplicate alert -> title"), name]]; @@ -1302,7 +1279,7 @@ - (void) duplicateOpenAlert: (NSString *) name [alert setAlertStyle: NSWarningAlertStyle]; [alert addButtonWithTitle: NSLocalizedString(@"OK", "Open duplicate alert -> button")]; [alert setShowsSuppressionButton: YES]; - + [alert runModal]; if ([[alert suppressionButton] state]) [fDefaults setBool: NO forKey: @"WarningDuplicate"]; @@ -1313,7 +1290,7 @@ - (void) duplicateOpenMagnetAlert: (NSString *) address transferName: (NSString { if (![fDefaults boolForKey: @"WarningDuplicate"]) return; - + NSAlert * alert = [[NSAlert alloc] init]; if (name) [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"A transfer of \"%@\" already exists.", @@ -1327,7 +1304,7 @@ - (void) duplicateOpenMagnetAlert: (NSString *) address transferName: (NSString [alert setAlertStyle: NSWarningAlertStyle]; [alert addButtonWithTitle: NSLocalizedString(@"OK", "Open duplicate magnet alert -> button")]; [alert setShowsSuppressionButton: YES]; - + [alert runModal]; if ([[alert suppressionButton] state]) [fDefaults setBool: NO forKey: @"WarningDuplicate"]; @@ -1355,18 +1332,18 @@ - (void) openURL: (NSString *) urlString else urlString = [@"http://" stringByAppendingString: urlString]; } - + NSURLRequest * request = [NSURLRequest requestWithURL: [NSURL URLWithString: urlString] cachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval: 60]; - + if ([fPendingTorrentDownloads objectForKey: [request URL]]) { NSLog(@"Already downloading %@", [request URL]); return; } - + NSURLDownload * download = [[NSURLDownload alloc] initWithRequest: request delegate: self]; - + if (!fPendingTorrentDownloads) fPendingTorrentDownloads = [[NSMutableDictionary alloc] init]; [fPendingTorrentDownloads setObject: [NSMutableDictionary dictionaryWithObject: download forKey: @"Download"] forKey: [request URL]]; @@ -1378,7 +1355,7 @@ - (void) openURLShowSheet: (id) sender if (!fUrlSheetController) { fUrlSheetController = [[URLSheetWindowController alloc] initWithController: self]; - + [NSApp beginSheet: [fUrlSheetController window] modalForWindow: fWindow modalDelegate: self didEndSelector: @selector(urlSheetDidEnd:returnCode:contextInfo:) contextInfo: nil]; } } @@ -1390,7 +1367,7 @@ - (void) urlSheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode c NSString * urlString = [fUrlSheetController urlString]; [self performSelectorOnMainThread: @selector(openURL:) withObject: urlString waitUntilDone: NO]; } - + [fUrlSheetController release]; fUrlSheetController = nil; } @@ -1408,11 +1385,11 @@ - (void) resumeSelectedTorrents: (id) sender - (void) resumeAllTorrents: (id) sender { NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [fTorrents count]]; - + for (Torrent * torrent in fTorrents) if (![torrent isFinishedSeeding]) [torrents addObject: torrent]; - + [self resumeTorrents: torrents]; } @@ -1420,7 +1397,7 @@ - (void) resumeTorrents: (NSArray *) torrents { for (Torrent * torrent in torrents) [torrent startTransfer]; - + [self fullUpdateUI]; } @@ -1432,11 +1409,11 @@ - (void) resumeSelectedTorrentsNoWait: (id) sender - (void) resumeWaitingTorrents: (id) sender { NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [fTorrents count]]; - + for (Torrent * torrent in fTorrents) if ([torrent waitingToStart]) [torrents addObject: torrent]; - + [self resumeTorrentsNoWait: torrents]; } @@ -1445,7 +1422,7 @@ - (void) resumeTorrentsNoWait: (NSArray *) torrents //iterate through instead of all at once to ensure no conflicts for (Torrent * torrent in torrents) [torrent startTransferNoQueue]; - + [self fullUpdateUI]; } @@ -1465,10 +1442,10 @@ - (void) stopTorrents: (NSArray *) torrents for (Torrent * torrent in torrents) if ([torrent waitingToStart]) [torrent stopTransfer]; - + for (Torrent * torrent in torrents) [torrent stopTransfer]; - + [self fullUpdateUI]; } @@ -1489,14 +1466,14 @@ - (void) removeTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData { NSDictionary * dict = @{ @"Torrents" : torrents, @"DeleteData" : @(deleteData) }; - + NSString * title, * message; - - const NSInteger selected = [torrents count]; + + const NSUInteger selected = [torrents count]; if (selected == 1) { NSString * torrentName = [(Torrent *)[torrents objectAtIndex: 0] name]; - + if (deleteData) title = [NSString stringWithFormat: NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list" @@ -1505,7 +1482,7 @@ - (void) removeTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData title = [NSString stringWithFormat: NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list?", "Removal confirm panel -> title"), torrentName]; - + message = NSLocalizedString(@"This transfer is active." " Once removed, continuing the transfer will require the torrent file or magnet link.", "Removal confirm panel -> message"); @@ -1520,7 +1497,7 @@ - (void) removeTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData title = [NSString stringWithFormat: NSLocalizedString(@"Are you sure you want to remove %@ transfers from the transfer list?", "Removal confirm panel -> title"), [NSString formattedUInteger: selected]]; - + if (selected == active) message = [NSString stringWithFormat: NSLocalizedString(@"There are %@ active transfers.", "Removal confirm panel -> message part 1"), [NSString formattedUInteger: active]]; @@ -1531,14 +1508,14 @@ - (void) removeTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData NSLocalizedString(@"Once removed, continuing the transfers will require the torrent files or magnet links.", "Removal confirm panel -> message part 2")]; } - + NSBeginAlertSheet(title, NSLocalizedString(@"Remove", "Removal confirm panel -> button"), NSLocalizedString(@"Cancel", "Removal confirm panel -> button"), nil, fWindow, self, nil, @selector(removeSheetDidEnd:returnCode:contextInfo:), [dict retain], @"%@", message); return; } } - + [self confirmRemoveTorrents: torrents deleteData: deleteData]; } @@ -1558,14 +1535,14 @@ - (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteDa //don't want any of these starting then stopping if ([torrent waitingToStart]) [torrent stopTransfer]; - + //let's expand all groups that have removed items - they either don't exist anymore, are already expanded, or are collapsed (rpc) [fTableView removeCollapsedGroup: [torrent groupValue]]; - + //we can't assume the window is active - RPC removal, for example [fBadger removeTorrent: torrent]; } - + //#5106 - don't try to remove torrents that have already been removed (fix for a bug, but better safe than crash anyway) NSIndexSet * indexesToRemove = [torrents indexesOfObjectsWithOptions: NSEnumerationConcurrent passingTest: ^BOOL(Torrent * torrent, NSUInteger idx, BOOL * stop) { return [fTorrents indexOfObjectIdenticalTo: torrent] != NSNotFound; @@ -1574,46 +1551,46 @@ - (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteDa { NSLog(@"trying to remove %ld transfers, but %ld have already been removed", [torrents count], [torrents count] - [indexesToRemove count]); torrents = [torrents objectsAtIndexes: indexesToRemove]; - + if ([indexesToRemove count] == 0) { [self fullUpdateUI]; return; } } - + [fTorrents removeObjectsInArray: torrents]; - + //set up helpers to remove from the table __block BOOL beganUpdate = NO; - + void (^doTableRemoval)(NSMutableArray *, id) = ^(NSMutableArray * displayedTorrents, id parent) { NSIndexSet * indexes = [displayedTorrents indexesOfObjectsWithOptions: NSEnumerationConcurrent passingTest: ^(id obj, NSUInteger idx, BOOL * stop) { return [torrents containsObject: obj]; }]; - + if ([indexes count] > 0) { if (!beganUpdate) { [NSAnimationContext beginGrouping]; //this has to be before we set the completion handler (#4874) - + //we can't closeRemoveTorrent: until it's no longer in the GUI at all [[NSAnimationContext currentContext] setCompletionHandler: ^{ for (Torrent * torrent in torrents) [torrent closeRemoveTorrent: deleteData]; }]; - + [fTableView beginUpdates]; beganUpdate = YES; } - + [fTableView removeItemsAtIndexes: indexes inParent: parent withAnimation: NSTableViewAnimationSlideLeft]; [displayedTorrents removeObjectsAtIndexes: indexes]; } }; - + //if not removed from the displayed torrents here, fullUpdateUI might cause a crash if ([fDisplayedTorrents count] > 0) { @@ -1624,21 +1601,21 @@ - (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteDa } else doTableRemoval(fDisplayedTorrents, nil); - + if (beganUpdate) { [fTableView endUpdates]; [NSAnimationContext endGrouping]; } } - + if (!beganUpdate) { //do here if we're not doing it at the end of the animation for (Torrent * torrent in torrents) [torrent closeRemoveTorrent: deleteData]; } - + [self fullUpdateUI]; } @@ -1655,11 +1632,11 @@ - (void) removeDeleteData: (id) sender - (void) clearCompleted: (id) sender { NSMutableArray * torrents = [NSMutableArray array]; - + for (Torrent * torrent in fTorrents) if ([torrent isFinishedSeeding]) [torrents addObject: torrent]; - + if ([fDefaults boolForKey: @"WarningRemoveCompleted"]) { NSString * message, * info; @@ -1668,7 +1645,7 @@ - (void) clearCompleted: (id) sender NSString * torrentName = [(Torrent *)[torrents objectAtIndex: 0] name]; message = [NSString stringWithFormat: NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list?", "Remove completed confirm panel -> title"), torrentName]; - + info = NSLocalizedString(@"Once removed, continuing the transfer will require the torrent file or magnet link.", "Remove completed confirm panel -> message"); } @@ -1676,11 +1653,11 @@ - (void) clearCompleted: (id) sender { message = [NSString stringWithFormat: NSLocalizedString(@"Are you sure you want to remove %@ completed transfers from the transfer list?", "Remove completed confirm panel -> title"), [NSString formattedUInteger: [torrents count]]]; - + info = NSLocalizedString(@"Once removed, continuing the transfers will require the torrent files or magnet links.", "Remove completed confirm panel -> message"); } - + NSAlert * alert = [[[NSAlert alloc] init] autorelease]; [alert setMessageText: message]; [alert setInformativeText: info]; @@ -1688,15 +1665,15 @@ - (void) clearCompleted: (id) sender [alert addButtonWithTitle: NSLocalizedString(@"Remove", "Remove completed confirm panel -> button")]; [alert addButtonWithTitle: NSLocalizedString(@"Cancel", "Remove completed confirm panel -> button")]; [alert setShowsSuppressionButton: YES]; - + const NSInteger returnCode = [alert runModal]; if ([[alert suppressionButton] state]) [fDefaults setBool: NO forKey: @"WarningRemoveCompleted"]; - + if (returnCode != NSAlertFirstButtonReturn) return; } - + [self confirmRemoveTorrents: torrents deleteData: NO]; } @@ -1713,7 +1690,7 @@ - (void) moveDataFiles: (NSArray *) torrents [panel setCanChooseFiles: NO]; [panel setCanChooseDirectories: YES]; [panel setCanCreateDirectories: YES]; - + NSInteger count = [torrents count]; if (count == 1) [panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the new folder for \"%@\".", @@ -1721,7 +1698,7 @@ - (void) moveDataFiles: (NSArray *) torrents else [panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the new folder for %d data files.", "Move torrent -> select destination folder"), count]]; - + [panel beginSheetModalForWindow: fWindow completionHandler: ^(NSInteger result) { if (result == NSFileHandlingPanelOKButton) { @@ -1743,22 +1720,22 @@ - (void) copyTorrentFileForTorrents: (NSMutableArray *) torrents [torrents release]; return; } - + Torrent * torrent = [torrents objectAtIndex: 0]; - + if (![torrent isMagnet] && [[NSFileManager defaultManager] fileExistsAtPath: [torrent torrentLocation]]) { NSSavePanel * panel = [NSSavePanel savePanel]; [panel setAllowedFileTypes: [NSArray arrayWithObjects: @"org.bittorrent.torrent", @"torrent", nil]]; [panel setExtensionHidden: NO]; - + [panel setNameFieldStringValue: [torrent name]]; - + [panel beginSheetModalForWindow: fWindow completionHandler: ^(NSInteger result) { //copy torrent to new location with name of data file if (result == NSFileHandlingPanelOKButton) [torrent copyTorrentFileTo: [[panel URL] path]]; - + [torrents removeObjectAtIndex: 0]; [self performSelectorOnMainThread: @selector(copyTorrentFileForTorrents:) withObject: torrents waitUntilDone: NO]; }]; @@ -1771,15 +1748,15 @@ - (void) copyTorrentFileForTorrents: (NSMutableArray *) torrents [alert addButtonWithTitle: NSLocalizedString(@"OK", "Torrent file copy alert -> button")]; [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Copy of \"%@\" Cannot Be Created", "Torrent file copy alert -> title"), [torrent name]]]; - [alert setInformativeText: [NSString stringWithFormat: + [alert setInformativeText: [NSString stringWithFormat: NSLocalizedString(@"The torrent file (%@) cannot be found.", "Torrent file copy alert -> message"), [torrent torrentLocation]]]; [alert setAlertStyle: NSWarningAlertStyle]; - + [alert runModal]; [alert release]; } - + [torrents removeObjectAtIndex: 0]; [self copyTorrentFileForTorrents: torrents]; } @@ -1788,16 +1765,16 @@ - (void) copyTorrentFileForTorrents: (NSMutableArray *) torrents - (void) copyMagnetLinks: (id) sender { NSArray * torrents = [fTableView selectedTorrents]; - + if ([torrents count] <= 0) return; - + NSMutableArray * links = [NSMutableArray arrayWithCapacity: [torrents count]]; for (Torrent * torrent in torrents) [links addObject: [torrent magnetLink]]; - + NSString * text = [links componentsJoinedByString: @"\n"]; - + NSPasteboard * pb = [NSPasteboard generalPasteboard]; [pb clearContents]; [pb writeObjects: [NSArray arrayWithObject: text]]; @@ -1813,7 +1790,7 @@ - (void) revealFile: (id) sender if (location) [paths addObject: [NSURL fileURLWithPath: location]]; } - + if ([paths count] > 0) [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs: paths]; } @@ -1823,13 +1800,13 @@ - (IBAction) renameSelected: (id) sender NSArray * selected = [fTableView selectedTorrents]; NSAssert([selected count] == 1, @"1 transfer needs to be selected to rename, but %ld are selected", [selected count]); Torrent * torrent = [selected objectAtIndex:0]; - + [FileRenameSheetController presentSheetForTorrent:torrent modalForWindow: fWindow completionHandler: ^(BOOL didRename) { if (didRename) { dispatch_async(dispatch_get_main_queue(), ^{ [self fullUpdateUI]; - + [[NSNotificationCenter defaultCenter] postNotificationName: @"ResetInspector" object: self userInfo: @{ @"Torrent" : torrent }]; }); } @@ -1854,7 +1831,7 @@ - (void) verifyTorrents: (NSArray *) torrents { for (Torrent * torrent in torrents) [torrent resetCache]; - + [self applyFilter]; } @@ -1885,18 +1862,18 @@ - (void) showInfo: (id) sender { [fInfoController updateInfoStats]; [[fInfoController window] orderFront: nil]; - + if ([fInfoController canQuickLook] && [QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible]) [[QLPreviewPanel sharedPreviewPanel] reloadData]; } - + [[fWindow toolbar] validateVisibleItems]; } - (void) resetInfo { [fInfoController setInfoForTorrents: [fTableView selectedTorrents]]; - + if ([QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible]) [[QLPreviewPanel sharedPreviewPanel] reloadData]; } @@ -1913,7 +1890,7 @@ - (MessageWindowController *) messageWindowController { if (!fMessageController) fMessageController = [[MessageWindowController alloc] init]; - + return fMessageController; } @@ -1934,22 +1911,22 @@ - (void) updateUI for (Torrent * torrent in fTorrents) { [torrent update]; - + //pull the upload and download speeds - most consistent by using current stats dlRate += [torrent downloadRate]; ulRate += [torrent uploadRate]; - + anyCompleted |= [torrent isFinishedSeeding]; } - + if (![NSApp isHidden]) { if ([fWindow isVisible]) { [self sortTorrents: NO]; - + [fStatusBar updateWithDownload: dlRate upload: ulRate]; - + [fClearCompletedButton setHidden: !anyCompleted]; } @@ -1957,7 +1934,7 @@ - (void) updateUI if ([[fInfoController window] isVisible]) [fInfoController updateInfoStats]; } - + //badge dock [fBadger updateBadgeWithDownload: dlRate upload: ulRate]; } @@ -1980,17 +1957,17 @@ - (void) setBottomCountText: (BOOL) filtering [NSString formattedUInteger: totalCount]]; else totalTorrentsString = NSLocalizedString(@"1 transfer", "Status bar transfer count"); - + if (filtering) { NSUInteger count = [fTableView numberOfRows]; //have to factor in collapsed rows if (count > 0 && ![[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [Torrent class]]) count -= [fDisplayedTorrents count]; - + totalTorrentsString = [NSString stringWithFormat: NSLocalizedString(@"%@ of %@", "Status bar transfer count"), [NSString formattedUInteger: count], totalTorrentsString]; } - + [fTotalTorrentsField setStringValue: totalTorrentsString]; } @@ -2003,7 +1980,7 @@ - (void) userNotificationCenter: (NSUserNotificationCenter *) center didActivate { if (![notification userInfo]) return; - + if ([notification activationType] == NSUserNotificationActivationTypeActionButtonClicked) //reveal { Torrent * torrent = [self torrentForHash: [[notification userInfo] objectForKey: @"Hash"]]; @@ -2039,15 +2016,15 @@ - (void) userNotificationCenter: (NSUserNotificationCenter *) center didActivate row = [fTableView rowForItem: torrent]; } } - + if (row == -1) { //not found - must be filtering NSAssert([fDefaults boolForKey: @"FilterBar"], @"expected the filter to be enabled"); [fFilterBar reset: YES]; - + row = [fTableView rowForItem: torrent]; - + //if it's not shown, it has to be in a collapsed row...again if ([fDefaults boolForKey: @"SortByGroup"]) { @@ -2067,7 +2044,7 @@ - (void) userNotificationCenter: (NSUserNotificationCenter *) center didActivate } } } - + NSAssert1(row != -1, @"expected a row to be found for torrent %@", torrent); [self showMainWindow: nil]; @@ -2079,7 +2056,7 @@ - (void) userNotificationCenter: (NSUserNotificationCenter *) center didActivate - (Torrent *) torrentForHash: (NSString *) hash { NSParameterAssert(hash != nil); - + __block Torrent * torrent = nil; [fTorrents enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: ^(id obj, NSUInteger idx, BOOL * stop) { if ([[(Torrent *)obj hashString] isEqualToString: hash]) @@ -2094,7 +2071,7 @@ - (Torrent *) torrentForHash: (NSString *) hash - (void) torrentFinishedDownloading: (NSNotification *) notification { Torrent * torrent = [notification object]; - + if ([[[notification userInfo] objectForKey: @"WasRunning"] boolValue]) { if (!fSoundPlaying && [fDefaults boolForKey: @"PlayDownloadSound"]) @@ -2107,48 +2084,43 @@ - (void) torrentFinishedDownloading: (NSNotification *) notification [sound play]; } } - + NSString * location = [torrent dataLocation]; - + NSString * notificationTitle = NSLocalizedString(@"Download Complete", "notification title"); - if ([NSApp isOnMountainLionOrBetter]) - { - NSUserNotification * notification = [[NSUserNotificationMtLion alloc] init]; - [notification setTitle: notificationTitle]; - [notification setInformativeText: [torrent name]]; - - [notification setHasActionButton: YES]; - [notification setActionButtonTitle: NSLocalizedString(@"Show", "notification button")]; - - NSMutableDictionary * userInfo = [NSMutableDictionary dictionaryWithObject: [torrent hashString] forKey: @"Hash"]; - if (location) - [userInfo setObject: location forKey: @"Location"]; - [notification setUserInfo: userInfo]; - - [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] deliverNotification: notification]; - [notification release]; - } - + NSUserNotification * notification = [[NSUserNotification alloc] init]; + [notification setTitle: notificationTitle]; + [notification setInformativeText: [torrent name]]; + + [notification setHasActionButton: YES]; + [notification setActionButtonTitle: NSLocalizedString(@"Show", "notification button")]; + + NSMutableDictionary * userInfo = [NSMutableDictionary dictionaryWithObject: [torrent hashString] forKey: @"Hash"]; + if (location) + [userInfo setObject: location forKey: @"Location"]; + [notification setUserInfo: userInfo]; + + [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification: notification]; + [notification release]; + NSMutableDictionary * clickContext = [NSMutableDictionary dictionaryWithObjectsAndKeys: GROWL_DOWNLOAD_COMPLETE, @"Type", nil]; - + if (location) [clickContext setObject: location forKey: @"Location"]; - + [GrowlApplicationBridge notifyWithTitle: notificationTitle description: [torrent name] notificationName: GROWL_DOWNLOAD_COMPLETE iconData: nil priority: 0 isSticky: NO clickContext: clickContext]; - - //NSLog(@"delegate: %@", [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] delegate]); - + if (![fWindow isMainWindow]) [fBadger addCompletedTorrent: torrent]; - + //bounce download stack [[NSDistributedNotificationCenter defaultCenter] postNotificationName: @"com.apple.DownloadFileFinished" object: [torrent dataLocation]]; } - + [self fullUpdateUI]; } @@ -2160,7 +2132,7 @@ - (void) torrentRestartedDownloading: (NSNotification *) notification - (void) torrentFinishedSeeding: (NSNotification *) notification { Torrent * torrent = [notification object]; - + if (!fSoundPlaying && [fDefaults boolForKey: @"PlaySeedingSound"]) { NSSound * sound; @@ -2171,37 +2143,34 @@ - (void) torrentFinishedSeeding: (NSNotification *) notification [sound play]; } } - + NSString * location = [torrent dataLocation]; - + NSString * notificationTitle = NSLocalizedString(@"Seeding Complete", "notification title"); - if ([NSApp isOnMountainLionOrBetter]) - { - NSUserNotification * notification = [[NSUserNotificationMtLion alloc] init]; - [notification setTitle: notificationTitle]; - [notification setInformativeText: [torrent name]]; - - [notification setHasActionButton: YES]; - [notification setActionButtonTitle: NSLocalizedString(@"Show", "notification button")]; - - NSMutableDictionary * userInfo = [NSMutableDictionary dictionaryWithObject: [torrent hashString] forKey: @"Hash"]; - if (location) - [userInfo setObject: location forKey: @"Location"]; - [notification setUserInfo: userInfo]; - - [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] deliverNotification: notification]; - [notification release]; - } - + NSUserNotification * userNotification = [[NSUserNotification alloc] init]; + [userNotification setTitle: notificationTitle]; + [userNotification setInformativeText: [torrent name]]; + + [userNotification setHasActionButton: YES]; + [userNotification setActionButtonTitle: NSLocalizedString(@"Show", "notification button")]; + + NSMutableDictionary * userInfo = [NSMutableDictionary dictionaryWithObject: [torrent hashString] forKey: @"Hash"]; + if (location) + [userInfo setObject: location forKey: @"Location"]; + [userNotification setUserInfo: userInfo]; + + [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification: userNotification]; + [userNotification release]; + NSMutableDictionary * clickContext = [NSMutableDictionary dictionaryWithObject: GROWL_SEEDING_COMPLETE forKey: @"Type"]; - + if (location) [clickContext setObject: location forKey: @"Location"]; - + [GrowlApplicationBridge notifyWithTitle: notificationTitle description: [torrent name] notificationName: GROWL_SEEDING_COMPLETE iconData: nil priority: 0 isSticky: NO clickContext: clickContext]; - + //removing from the list calls fullUpdateUI if ([torrent removeWhenFinishSeeding]) [self confirmRemoveTorrents: @[ torrent ] deleteData: NO]; @@ -2209,9 +2178,9 @@ - (void) torrentFinishedSeeding: (NSNotification *) notification { if (![fWindow isMainWindow]) [fBadger addCompletedTorrent: torrent]; - + [self fullUpdateUI]; - + if ([[fTableView selectedTorrents] containsObject: torrent]) { [fInfoController updateInfoStats]; @@ -2223,10 +2192,10 @@ - (void) torrentFinishedSeeding: (NSNotification *) notification - (void) updateTorrentHistory { NSMutableArray * history = [NSMutableArray arrayWithCapacity: [fTorrents count]]; - + for (Torrent * torrent in fTorrents) [history addObject: [torrent history]]; - + NSString * historyFile = [fConfigDirectory stringByAppendingPathComponent: TRANSFER_PLIST]; [history writeToFile: historyFile atomically: YES]; } @@ -2265,9 +2234,9 @@ - (void) setSort: (id) sender NSAssert1(NO, @"Unknown sort tag received: %ld", [(NSMenuItem *)sender tag]); return; } - + [fDefaults setObject: sortType forKey: @"Sort"]; - + [self sortTorrents: YES]; } @@ -2275,7 +2244,7 @@ - (void) setSortByGroup: (id) sender { BOOL sortByGroup = ![fDefaults boolForKey: @"SortByGroup"]; [fDefaults setBool: sortByGroup forKey: @"SortByGroup"]; - + [self applyFilter]; } @@ -2299,17 +2268,17 @@ - (void) sortTorrents: (BOOL) includeQueueOrder - (void) sortTorrentsCallUpdates: (BOOL) callUpdates includeQueueOrder: (BOOL) includeQueueOrder { const BOOL asc = ![fDefaults boolForKey: @"SortReverse"]; - + NSArray * descriptors; NSSortDescriptor * nameDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"name" ascending: asc selector: @selector(localizedStandardCompare:)]; - + NSString * sortType = [fDefaults stringForKey: @"Sort"]; if ([sortType isEqualToString: SORT_STATE]) { NSSortDescriptor * stateDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"stateSortKey" ascending: !asc], * progressDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"progress" ascending: !asc], * ratioDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"ratio" ascending: !asc]; - + descriptors = [NSArray arrayWithObjects: stateDescriptor, progressDescriptor, ratioDescriptor, nameDescriptor, nil]; } else if ([sortType isEqualToString: SORT_PROGRESS]) @@ -2317,32 +2286,32 @@ - (void) sortTorrentsCallUpdates: (BOOL) callUpdates includeQueueOrder: (BOOL) i NSSortDescriptor * progressDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"progress" ascending: asc], * ratioProgressDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"progressStopRatio" ascending: asc], * ratioDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"ratio" ascending: asc]; - + descriptors = [NSArray arrayWithObjects: progressDescriptor, ratioProgressDescriptor, ratioDescriptor, nameDescriptor, nil]; } else if ([sortType isEqualToString: SORT_TRACKER]) { NSSortDescriptor * trackerDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"trackerSortKey" ascending: asc selector: @selector(localizedCaseInsensitiveCompare:)]; - + descriptors = [NSArray arrayWithObjects: trackerDescriptor, nameDescriptor, nil]; } else if ([sortType isEqualToString: SORT_ACTIVITY]) { NSSortDescriptor * rateDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"totalRate" ascending: !asc]; NSSortDescriptor * activityDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"dateActivityOrAdd" ascending: !asc]; - + descriptors = [NSArray arrayWithObjects: rateDescriptor, activityDescriptor, nameDescriptor, nil]; } else if ([sortType isEqualToString: SORT_DATE]) { NSSortDescriptor * dateDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"dateAdded" ascending: asc]; - + descriptors = [NSArray arrayWithObjects: dateDescriptor, nameDescriptor, nil]; } else if ([sortType isEqualToString: SORT_SIZE]) { NSSortDescriptor * sizeDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"size" ascending: asc]; - + descriptors = [NSArray arrayWithObjects: sizeDescriptor, nameDescriptor, nil]; } else if ([sortType isEqualToString: SORT_NAME]) @@ -2352,17 +2321,17 @@ - (void) sortTorrentsCallUpdates: (BOOL) callUpdates includeQueueOrder: (BOOL) i else { NSAssert1([sortType isEqualToString: SORT_ORDER], @"Unknown sort type received: %@", sortType); - + if (!includeQueueOrder) return; - + NSSortDescriptor * orderDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"queuePosition" ascending: asc]; - + descriptors = [NSArray arrayWithObject: orderDescriptor]; } - + BOOL beganTableUpdate = !callUpdates; - + //actually sort if ([fDefaults boolForKey: @"SortByGroup"]) { @@ -2371,7 +2340,7 @@ - (void) sortTorrentsCallUpdates: (BOOL) callUpdates includeQueueOrder: (BOOL) i } else [self rearrangeTorrentTableArray: fDisplayedTorrents forParent: nil withSortDescriptors: descriptors beganTableUpdate: &beganTableUpdate]; - + if (beganTableUpdate && callUpdates) { [fTableView endUpdates]; @@ -2391,10 +2360,10 @@ - (void) rearrangeTorrentTableArray: (NSMutableArray *) rearrangeArray forParent if (result != NSOrderedSame) return result; } - + return NSOrderedSame; }]; - + if (insertIndex != currentIndex) { if (!*beganTableUpdate) @@ -2402,12 +2371,12 @@ - (void) rearrangeTorrentTableArray: (NSMutableArray *) rearrangeArray forParent *beganTableUpdate = YES; [fTableView beginUpdates]; } - + [rearrangeArray moveObjectAtIndex: currentIndex toIndex: insertIndex]; [fTableView moveItemAtIndex: currentIndex inParent: parent toIndex: insertIndex inParent: parent]; } } - + NSAssert2([rearrangeArray isEqualToArray: [rearrangeArray sortedArrayUsingDescriptors: descriptors]], @"Torrent rearranging didn't work! %@ %@", rearrangeArray, [rearrangeArray sortedArrayUsingDescriptors: descriptors]); } @@ -2426,15 +2395,15 @@ - (void) applyFilter filterPause = YES; else filterStatus = NO; - + const NSInteger groupFilterValue = [fDefaults integerForKey: @"FilterGroup"]; const BOOL filterGroup = groupFilterValue != GROUP_FILTER_ALL_TAG; - + NSArray * searchStrings = [fFilterBar searchStrings]; if (searchStrings && [searchStrings count] == 0) searchStrings = nil; const BOOL filterTracker = searchStrings && [[fDefaults stringForKey: @"FilterSearchType"] isEqualToString: FILTER_TYPE_TRACKER]; - + //filter & get counts of each type NSIndexSet * indexesOfNonFilteredTorrents = [fTorrents indexesOfObjectsWithOptions: NSEnumerationConcurrent passingTest: ^BOOL(Torrent * torrent, NSUInteger idx, BOOL * stop) { //check status @@ -2443,7 +2412,7 @@ - (void) applyFilter const BOOL isActive = ![torrent isStalled]; if (isActive) OSAtomicIncrement32(&active); - + if ([torrent isSeeding]) { OSAtomicIncrement32(&seeding); @@ -2463,12 +2432,12 @@ - (void) applyFilter if (filterStatus && !filterPause) return NO; } - + //checkGroup if (filterGroup) if ([torrent groupValue] != groupFilterValue) return NO; - + //check text field if (searchStrings) { @@ -2476,7 +2445,7 @@ - (void) applyFilter if (filterTracker) { NSArray * trackers = [torrent allTrackersFlat]; - + //to count, we need each string in at least 1 tracker [searchStrings enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: ^(id searchString, NSUInteger idx, BOOL * stop) { __block BOOL found = NO; @@ -2504,24 +2473,24 @@ - (void) applyFilter } }]; } - + if (removeTextField) return NO; } - + return YES; }]; - + NSArray * allTorrents = [fTorrents objectsAtIndexes: indexesOfNonFilteredTorrents]; - + //set button tooltips if (fFilterBar) [fFilterBar setCountAll: [fTorrents count] active: active downloading: downloading seeding: seeding paused: paused]; - + //if either the previous or current lists are blank, set its value to the other const BOOL groupRows = [allTorrents count] > 0 ? [fDefaults boolForKey: @"SortByGroup"] : ([fDisplayedTorrents count] > 0 && [[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [TorrentGroup class]]); const BOOL wasGroupRows = [fDisplayedTorrents count] > 0 ? [[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [TorrentGroup class]] : groupRows; - + #warning could probably be merged with later code somehow //clear display cache for not-shown torrents if ([fDisplayedTorrents count] > 0) @@ -2532,7 +2501,7 @@ - (void) applyFilter if (![allTorrents containsObject: torrent]) [torrent setPreviousFinishedPieces: nil]; }; - + if (wasGroupRows) [fDisplayedTorrents enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: ^(id obj, NSUInteger idx, BOOL * stop) { [[(TorrentGroup *)obj torrents] enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: removePreviousFinishedPieces]; @@ -2540,7 +2509,7 @@ - (void) applyFilter else [fDisplayedTorrents enumerateObjectsWithOptions: NSEnumerationConcurrent usingBlock: removePreviousFinishedPieces]; } - + BOOL beganUpdates = NO; //don't animate torrents when first launching @@ -2549,13 +2518,13 @@ - (void) applyFilter [[NSAnimationContext currentContext] setDuration: 0]; }); [NSAnimationContext beginGrouping]; - + //add/remove torrents (and rearrange for groups), one by one if (!groupRows && !wasGroupRows) { NSMutableIndexSet * addIndexes = [NSMutableIndexSet indexSet], * removePreviousIndexes = [NSMutableIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])]; - + //for each of the torrents to add, find if it already exists (and keep track of those we've already added & those we need to remove) [allTorrents enumerateObjectsWithOptions: 0 usingBlock: ^(id objAll, NSUInteger previousIndex, BOOL * stop) { const NSUInteger currentIndex = [fDisplayedTorrents indexOfObjectAtIndexes: removePreviousIndexes options: NSEnumerationConcurrent passingTest: ^(id objDisplay, NSUInteger idx, BOOL *stop) { @@ -2566,19 +2535,19 @@ - (void) applyFilter else [removePreviousIndexes removeIndex: currentIndex]; }]; - + if ([addIndexes count] > 0 || [removePreviousIndexes count] > 0) { beganUpdates = YES; [fTableView beginUpdates]; - + //remove torrents we didn't find if ([removePreviousIndexes count] > 0) { [fDisplayedTorrents removeObjectsAtIndexes: removePreviousIndexes]; [fTableView removeItemsAtIndexes: removePreviousIndexes inParent: nil withAnimation: NSTableViewAnimationSlideDown]; } - + //add new torrents if ([addIndexes count] > 0) { @@ -2588,13 +2557,13 @@ - (void) applyFilter NSIndexSet * newAddIndexes = [allTorrents indexesOfObjectsAtIndexes: addIndexes options: NSEnumerationConcurrent passingTest: ^BOOL(id obj, NSUInteger idx, BOOL * stop) { return [fAddingTransfers containsObject: obj]; }]; - + [addIndexes removeIndexes: newAddIndexes]; - + [fDisplayedTorrents addObjectsFromArray: [allTorrents objectsAtIndexes: newAddIndexes]]; [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange([fDisplayedTorrents count] - [newAddIndexes count], [newAddIndexes count])] inParent: nil withAnimation: NSTableViewAnimationSlideLeft]; } - + [fDisplayedTorrents addObjectsFromArray: [allTorrents objectsAtIndexes: addIndexes]]; [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange([fDisplayedTorrents count] - [addIndexes count], [addIndexes count])] inParent: nil withAnimation: NSTableViewAnimationSlideDown]; } @@ -2603,26 +2572,26 @@ - (void) applyFilter else if (groupRows && wasGroupRows) { NSAssert(groupRows && wasGroupRows, @"Should have had group rows and should remain with group rows"); - + #warning don't always do? beganUpdates = YES; [fTableView beginUpdates]; - + NSMutableIndexSet * unusedAllTorrentsIndexes = [NSMutableIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [allTorrents count])]; - + NSMutableDictionary * groupsByIndex = [NSMutableDictionary dictionaryWithCapacity: [fDisplayedTorrents count]]; for (TorrentGroup * group in fDisplayedTorrents) [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: [group groupIndex]]]; - + const NSUInteger originalGroupCount = [fDisplayedTorrents count]; for (NSUInteger index = 0; index < originalGroupCount; ++index) { TorrentGroup * group = [fDisplayedTorrents objectAtIndex: index]; - + NSMutableIndexSet * removeIndexes = [NSMutableIndexSet indexSet]; - + //needs to be a signed integer - for (NSInteger indexInGroup = 0; indexInGroup < [[group torrents] count]; ++indexInGroup) + for (NSUInteger indexInGroup = 0; indexInGroup < [[group torrents] count]; ++indexInGroup) { Torrent * torrent = [[group torrents] objectAtIndex: indexInGroup]; const NSUInteger allIndex = [allTorrents indexOfObjectAtIndexes: unusedAllTorrentsIndexes options: NSEnumerationConcurrent passingTest: ^(id obj, NSUInteger idx, BOOL * stop) { @@ -2633,7 +2602,7 @@ - (void) applyFilter else { BOOL markTorrentAsUsed = YES; - + const NSInteger groupValue = [torrent groupValue]; if (groupValue != [group groupIndex]) { @@ -2653,27 +2622,27 @@ - (void) applyFilter if ([fDisplayedTorrents indexOfObject: newGroup inRange: NSMakeRange(index+1, originalGroupCount-(index+1))] != NSNotFound) markTorrentAsUsed = NO; } - + [[group torrents] removeObjectAtIndex: indexInGroup]; [[newGroup torrents] addObject: torrent]; [fTableView moveItemAtIndex: indexInGroup inParent: group toIndex: [[newGroup torrents] count]-1 inParent: newGroup]; - + --indexInGroup; } - + if (markTorrentAsUsed) [unusedAllTorrentsIndexes removeIndex: allIndex]; } } - + if ([removeIndexes count] > 0) { [[group torrents] removeObjectsAtIndexes: removeIndexes]; [fTableView removeItemsAtIndexes: removeIndexes inParent: group withAnimation: NSTableViewAnimationEffectFade]; } } - + //add remaining new torrents for (Torrent * torrent in [allTorrents objectsAtIndexes: unusedAllTorrentsIndexes]) { @@ -2688,24 +2657,24 @@ - (void) applyFilter [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndex: [fDisplayedTorrents count]-1] inParent: nil withAnimation: NSTableViewAnimationEffectFade]; [fTableView isGroupCollapsed: groupValue] ? [fTableView collapseItem: group] : [fTableView expandItem: group]; } - + [[group torrents] addObject: torrent]; const BOOL newTorrent = fAddingTransfers && [fAddingTransfers containsObject: torrent]; [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndex: [[group torrents] count]-1] inParent: group withAnimation: newTorrent ? NSTableViewAnimationSlideLeft : NSTableViewAnimationSlideDown]; } - + //remove empty groups NSIndexSet * removeGroupIndexes = [fDisplayedTorrents indexesOfObjectsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, originalGroupCount)] options: NSEnumerationConcurrent passingTest: ^BOOL(id obj, NSUInteger idx, BOOL * stop) { return [[(TorrentGroup *)obj torrents] count] == 0; }]; - + if ([removeGroupIndexes count] > 0) { [fDisplayedTorrents removeObjectsAtIndexes: removeGroupIndexes]; [fTableView removeItemsAtIndexes: removeGroupIndexes inParent: nil withAnimation: NSTableViewAnimationEffectFade]; } - + //now that all groups are there, sort them - don't insert on the fly in case groups were reordered in prefs NSSortDescriptor * groupDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"groupOrderValue" ascending: YES]; [self rearrangeTorrentTableArray: fDisplayedTorrents forParent: nil withSortDescriptors: [NSArray arrayWithObject: groupDescriptor] beganTableUpdate: &beganUpdates]; @@ -2713,19 +2682,19 @@ - (void) applyFilter else { NSAssert(groupRows != wasGroupRows, @"Trying toggling group-torrent reordering when we weren't expecting to."); - + //set all groups as expanded [fTableView removeAllCollapsedGroups]; - + //since we're not doing this the right way (boo buggy animation), we need to remember selected values #warning when Lion-only and using views instead of cells, this likely won't be needed NSArray * selectedValues = [fTableView selectedValues]; - + beganUpdates = YES; [fTableView beginUpdates]; [fTableView removeItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])] inParent: nil withAnimation: NSTableViewAnimationSlideDown]; - + if (groupRows) { //a map for quickly finding groups @@ -2739,12 +2708,12 @@ - (void) applyFilter group = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease]; [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: groupValue]]; } - + [[group torrents] addObject: torrent]; } - + [fDisplayedTorrents setArray: [groupsByIndex allValues]]; - + //we need the groups to be sorted, and we can do it without moving items in the table, too! NSSortDescriptor * groupDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"groupOrderValue" ascending: YES]; [fDisplayedTorrents sortUsingDescriptors: [NSArray arrayWithObject: groupDescriptor]]; @@ -2753,33 +2722,33 @@ - (void) applyFilter [fDisplayedTorrents setArray: allTorrents]; [fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])] inParent: nil withAnimation: NSTableViewAnimationEffectFade]; - - if (groupRows) - { - //actually expand group rows - for (TorrentGroup * group in fDisplayedTorrents) - [fTableView expandItem: group]; - } - + + if (groupRows) + { + //actually expand group rows + for (TorrentGroup * group in fDisplayedTorrents) + [fTableView expandItem: group]; + } + if (selectedValues) [fTableView selectValues: selectedValues]; } - + //sort the torrents (won't sort the groups, though) [self sortTorrentsCallUpdates: !beganUpdates includeQueueOrder: YES]; if (beganUpdates) [fTableView endUpdates]; [fTableView setNeedsDisplay: YES]; - + [NSAnimationContext endGrouping]; [self resetInfo]; //if group is already selected, but the torrents in it change - + [self setBottomCountText: groupRows || filterStatus || filterGroup || searchStrings]; - + [self setWindowSizeToFit]; - + if (fAddingTransfers) { [fAddingTransfers release]; @@ -2796,15 +2765,15 @@ - (IBAction) showGlobalPopover: (id) sender { if (fGlobalPopoverShown) return; - + NSPopover * popover = [[NSPopover alloc] init]; [popover setBehavior: NSPopoverBehaviorTransient]; GlobalOptionsPopoverViewController * viewController = [[GlobalOptionsPopoverViewController alloc] initWithHandle: fLib]; [popover setContentViewController: viewController]; [popover setDelegate: self]; - + [popover showRelativeToRect: [sender frame] ofView: sender preferredEdge: NSMaxYEdge]; - + [viewController release]; [popover release]; } @@ -2826,9 +2795,9 @@ - (void) menuNeedsUpdate: (NSMenu *) menu { for (NSInteger i = [menu numberOfItems]-1; i >= 0; i--) [menu removeItemAtIndex: i]; - + NSMenu * groupMenu = [[GroupsController groups] groupMenuWithTarget: self action: @selector(setGroup:) isSmall: NO]; - + const NSInteger groupMenuCount = [groupMenu numberOfItems]; for (NSInteger i = 0; i < groupMenuCount; i++) { @@ -2840,7 +2809,7 @@ - (void) menuNeedsUpdate: (NSMenu *) menu } else if (menu == fShareMenu || menu == fShareContextMenu) { [menu removeAllItems]; - + for (NSMenuItem * item in [[ShareTorrentFileHelper sharedHelper] menuItems]) { [menu addItem:item]; @@ -2854,10 +2823,10 @@ - (void) setGroup: (id) sender for (Torrent * torrent in [fTableView selectedTorrents]) { [fTableView removeCollapsedGroup: [torrent groupValue]]; //remove old collapsed group - + [torrent setGroupValue: [(NSMenuItem *)sender tag] determinationType: TorrentDeterminationUserSpecified]; } - + [self applyFilter]; [self updateUI]; [self updateTorrentHistory]; @@ -2882,7 +2851,7 @@ - (void) altSpeedToggledCallbackIsLimited: (NSDictionary *) dict [fDefaults setBool: isLimited forKey: @"SpeedLimit"]; [fStatusBar updateSpeedFieldsToolTips]; - + if (![[dict objectForKey: @"ByUser"] boolValue]) [GrowlApplicationBridge notifyWithTitle: isLimited ? NSLocalizedString(@"Speed Limit Auto Enabled", "Growl notification title") : NSLocalizedString(@"Speed Limit Auto Disabled", "Growl notification title") description: NSLocalizedString(@"Bandwidth settings changed", "Growl notification description") @@ -2892,7 +2861,7 @@ - (void) altSpeedToggledCallbackIsLimited: (NSDictionary *) dict isSticky: NO clickContext: nil identifier: GROWL_AUTO_SPEED_LIMIT]; - + [dict release]; } @@ -2904,18 +2873,18 @@ - (void) sound: (NSSound *) sound didFinishPlaying: (BOOL) finishedPlaying -(void) VDKQueue: (VDKQueue *) queue receivedNotification: (NSString*) notification forPath: (NSString*) fpath { //don't assume that just because we're watching for write notification, we'll only receive write notifications - + if (![fDefaults boolForKey: @"AutoImport"] || ![fDefaults stringForKey: @"AutoImportDirectory"]) return; - + if ([fAutoImportTimer isValid]) [fAutoImportTimer invalidate]; [fAutoImportTimer release]; - + //check again in 10 seconds in case torrent file wasn't complete - fAutoImportTimer = [[NSTimer scheduledTimerWithTimeInterval: 10.0 target: self + fAutoImportTimer = [[NSTimer scheduledTimerWithTimeInterval: 10.0 target: self selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO] retain]; - + [self checkAutoImportDirectory]; } @@ -2925,10 +2894,10 @@ - (void) changeAutoImport [fAutoImportTimer invalidate]; [fAutoImportTimer release]; fAutoImportTimer = nil; - + [fAutoImportedNames release]; fAutoImportedNames = nil; - + [self checkAutoImportDirectory]; } @@ -2937,70 +2906,67 @@ - (void) checkAutoImportDirectory NSString * path; if (![fDefaults boolForKey: @"AutoImport"] || !(path = [fDefaults stringForKey: @"AutoImportDirectory"])) return; - + path = [path stringByExpandingTildeInPath]; - + NSArray * importedNames; if (!(importedNames = [[NSFileManager defaultManager] contentsOfDirectoryAtPath: path error: NULL])) return; - + //only check files that have not been checked yet NSMutableArray * newNames = [importedNames mutableCopy]; - + if (fAutoImportedNames) [newNames removeObjectsInArray: fAutoImportedNames]; else fAutoImportedNames = [[NSMutableArray alloc] init]; [fAutoImportedNames setArray: importedNames]; - + for (NSString * file in newNames) { if ([file hasPrefix: @"."]) continue; - + NSString * fullFile = [path stringByAppendingPathComponent: file]; - + if (!([[[NSWorkspace sharedWorkspace] typeOfFile: fullFile error: NULL] isEqualToString: @"org.bittorrent.torrent"] || [[fullFile pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame)) continue; - + tr_ctor * ctor = tr_ctorNew(fLib); tr_ctorSetMetainfoFromFile(ctor, [fullFile UTF8String]); - + switch (tr_torrentParse(ctor, NULL)) { case TR_PARSE_OK: [self openFiles: [NSArray arrayWithObject: fullFile] addType: ADD_AUTO forcePath: nil]; - + NSString * notificationTitle = NSLocalizedString(@"Torrent File Auto Added", "notification title"); - if ([NSApp isOnMountainLionOrBetter]) - { - NSUserNotification* notification = [[NSUserNotificationMtLion alloc] init]; - [notification setTitle: notificationTitle]; - [notification setInformativeText: file]; - - [notification setHasActionButton: NO]; - - [[NSUserNotificationCenterMtLion defaultUserNotificationCenter] deliverNotification: notification]; - [notification release]; - } - + NSUserNotification* notification = [[NSUserNotification alloc] init]; + [notification setTitle: notificationTitle]; + [notification setInformativeText: file]; + + [notification setHasActionButton: NO]; + + [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification: notification]; + [notification release]; + [GrowlApplicationBridge notifyWithTitle: notificationTitle description: file notificationName: GROWL_AUTO_ADD iconData: nil priority: 0 isSticky: NO clickContext: nil]; break; - + case TR_PARSE_ERR: [fAutoImportedNames removeObject: file]; break; - + case TR_PARSE_DUPLICATE: //let's ignore this (but silence a warning) break; } - + tr_ctorFree(ctor); } - + [newNames release]; } @@ -3008,10 +2974,10 @@ - (void) beginCreateFile: (NSNotification *) notification { if (![fDefaults boolForKey: @"AutoImport"]) return; - + NSString * location = [(NSURL *)[notification object] path], * path = [fDefaults stringForKey: @"AutoImportDirectory"]; - + if (location && path && [[[location stringByDeletingLastPathComponent] stringByExpandingTildeInPath] isEqualToString: [path stringByExpandingTildeInPath]]) [fAutoImportedNames addObject: [location lastPathComponent]]; @@ -3067,7 +3033,7 @@ - (id) outlineView: (NSOutlineView *) outlineView objectValueForTableColumn: (NS else { TorrentGroup * group = (TorrentGroup *)item; - + if ([fDefaults boolForKey: @"DisplayGroupRowRatio"]) return [NSString stringForRatio: [group ratio]]; else @@ -3089,10 +3055,10 @@ - (BOOL) outlineView: (NSOutlineView *) outlineView writeItems: (NSArray *) item { if (![torrent isKindOfClass: [Torrent class]]) return NO; - + [indexSet addIndex: [fTableView rowForItem: torrent]]; } - + [pasteboard declareTypes: [NSArray arrayWithObject: TORRENT_TABLE_VIEW_DATA_TYPE] owner: self]; [pasteboard setData: [NSKeyedArchiver archivedDataWithRootObject: indexSet] forType: TORRENT_TABLE_VIEW_DATA_TYPE]; return YES; @@ -3110,7 +3076,7 @@ - (NSDragOperation) outlineView: (NSOutlineView *) outlineView validateDrop: (id { if (!item) return NSDragOperationNone; - + if ([[fDefaults stringForKey: @"Sort"] isEqualToString: SORT_ORDER]) { if ([item isKindOfClass: [Torrent class]]) @@ -3131,18 +3097,18 @@ - (NSDragOperation) outlineView: (NSOutlineView *) outlineView validateDrop: (id { if (index == NSOutlineViewDropOnItemIndex) return NSDragOperationNone; - + if (item) { index = [fTableView rowForItem: item] + 1; item = nil; } } - + [fTableView setDropItem: item dropChildIndex: index]; return NSDragOperationGeneric; } - + return NSDragOperationNone; } @@ -3152,19 +3118,19 @@ - (BOOL) outlineView: (NSOutlineView *) outlineView acceptDrop: (id < NSDragging if ([[pasteboard types] containsObject: TORRENT_TABLE_VIEW_DATA_TYPE]) { NSIndexSet * indexes = [NSKeyedUnarchiver unarchiveObjectWithData: [pasteboard dataForType: TORRENT_TABLE_VIEW_DATA_TYPE]]; - + //get the torrents to move NSMutableArray * movingTorrents = [NSMutableArray arrayWithCapacity: [indexes count]]; for (NSUInteger i = [indexes firstIndex]; i != NSNotFound; i = [indexes indexGreaterThanIndex: i]) { Torrent * torrent = [fTableView itemAtRow: i]; [movingTorrents addObject: torrent]; - + //change groups if (item) [torrent setGroupValue: [item groupIndex] determinationType: TorrentDeterminationUserSpecified]; } - + //reorder queue order if (newRow != NSOutlineViewDropOnItemIndex) { @@ -3180,15 +3146,15 @@ - (BOOL) outlineView: (NSOutlineView *) outlineView acceptDrop: (id < NSDragging break; } } - + //remove objects to reinsert [fTorrents removeObjectsInArray: movingTorrents]; - + //insert objects at new location const NSUInteger insertIndex = topTorrent ? [fTorrents indexOfObject: topTorrent] + 1 : 0; NSIndexSet * insertIndexes = [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(insertIndex, [movingTorrents count])]; [fTorrents insertObjects: movingTorrents atIndexes: insertIndexes]; - + //we need to make sure the queue order is updated in the Torrent object before we sort - safest to just reset all queue positions NSUInteger i = 0; for (Torrent * torrent in fTorrents) @@ -3196,18 +3162,18 @@ - (BOOL) outlineView: (NSOutlineView *) outlineView acceptDrop: (id < NSDragging [torrent setQueuePosition: i++]; [torrent update]; } - + //do the drag animation here so that the dragged torrents are the ones that are animated as moving, and not the torrents around them [fTableView beginUpdates]; - + NSUInteger insertDisplayIndex = topTorrent ? [groupTorrents indexOfObject: topTorrent] + 1 : 0; - + for (Torrent * torrent in movingTorrents) { TorrentGroup * oldParent = item ? [fTableView parentForItem: torrent] : nil; NSMutableArray * oldTorrents = oldParent ? [oldParent torrents] : fDisplayedTorrents; const NSUInteger oldIndex = [oldTorrents indexOfObject: torrent]; - + if (item == oldParent) { if (oldIndex < insertDisplayIndex) @@ -3217,23 +3183,23 @@ - (BOOL) outlineView: (NSOutlineView *) outlineView acceptDrop: (id < NSDragging else { NSAssert(item && oldParent, @"Expected to be dragging between group rows"); - + NSMutableArray * newTorrents = [(TorrentGroup *)item torrents]; [newTorrents insertObject: torrent atIndex: insertDisplayIndex]; [oldTorrents removeObjectAtIndex: oldIndex]; } [fTableView moveItemAtIndex: oldIndex inParent: oldParent toIndex: insertDisplayIndex inParent: item]; - + ++insertDisplayIndex; } [fTableView endUpdates]; } - + [self applyFilter]; } - + return YES; } @@ -3264,20 +3230,20 @@ - (NSDragOperation) draggingEntered: (id ) info if (!fOverlayWindow) fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow]; [fOverlayWindow setTorrents: files]; - + return NSDragOperationCopy; } tr_ctorFree(ctor); } } - + //create a torrent file if a single file if (!torrent && [files count] == 1) { if (!fOverlayWindow) fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow]; [fOverlayWindow setFile: [[files objectAtIndex: 0] lastPathComponent]]; - + return NSDragOperationCopy; } } @@ -3286,11 +3252,11 @@ - (NSDragOperation) draggingEntered: (id ) info if (!fOverlayWindow) fOverlayWindow = [[DragOverlayWindow alloc] initWithLib: fLib forWindow: fWindow]; [fOverlayWindow setURL: [[NSURL URLFromPasteboard: pasteboard] relativeString]]; - + return NSDragOperationCopy; } else; - + return NSDragOperationNone; } @@ -3304,12 +3270,12 @@ - (BOOL) performDragOperation: (id ) info { if (fOverlayWindow) [fOverlayWindow fadeOut]; - + NSPasteboard * pasteboard = [info draggingPasteboard]; if ([[pasteboard types] containsObject: NSFilenamesPboardType]) { BOOL torrent = NO, accept = YES; - + //create an array of files that can be opened NSArray * files = [pasteboard propertyListForType: NSFilenamesPboardType]; NSMutableArray * filesToOpen = [NSMutableArray arrayWithCapacity: [files count]]; @@ -3326,7 +3292,7 @@ - (BOOL) performDragOperation: (id ) info tr_ctorFree(ctor); } } - + if ([filesToOpen count] > 0) [self application: NSApp openFiles: filesToOpen]; else @@ -3336,7 +3302,7 @@ - (BOOL) performDragOperation: (id ) info else accept = NO; } - + return accept; } else if ([[pasteboard types] containsObject: NSURLPboardType]) @@ -3349,7 +3315,7 @@ - (BOOL) performDragOperation: (id ) info } } else; - + return NO; } @@ -3357,24 +3323,24 @@ - (void) toggleSmallView: (id) sender { BOOL makeSmall = ![fDefaults boolForKey: @"SmallView"]; [fDefaults setBool: makeSmall forKey: @"SmallView"]; - + [fTableView setUsesAlternatingRowBackgroundColors: !makeSmall]; - + [fTableView setRowHeight: makeSmall ? ROW_HEIGHT_SMALL : ROW_HEIGHT_REGULAR]; [fTableView beginUpdates]; [fTableView noteHeightOfRowsWithIndexesChanged: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fTableView numberOfRows])]]; [fTableView endUpdates]; - + //resize for larger min height if not set to auto size if (![fDefaults boolForKey: @"AutoSize"]) { const NSSize contentSize = [[fWindow contentView] frame].size; - + NSSize contentMinSize = [fWindow contentMinSize]; contentMinSize.height = [self minWindowContentSizeAllowed]; [fWindow setContentMinSize: contentMinSize]; - + //make sure the window already isn't too small if (!makeSmall && contentSize.height < contentMinSize.height) { @@ -3382,7 +3348,7 @@ - (void) toggleSmallView: (id) sender CGFloat heightChange = contentMinSize.height - contentSize.height; frame.size.height += heightChange; frame.origin.y -= heightChange; - + [fWindow setFrame: frame display: YES]; } } @@ -3405,18 +3371,18 @@ - (void) toggleAvailabilityBar: (id) sender - (NSRect) windowFrameByAddingHeight: (CGFloat) height checkLimits: (BOOL) check { NSScrollView * scrollView = [fTableView enclosingScrollView]; - + //convert pixels to points NSRect windowFrame = [fWindow frame]; NSSize windowSize = [scrollView convertSize: windowFrame.size fromView: nil]; windowSize.height += height; - + if (check) { //we can't call minSize, since it might be set to the current size (auto size) const CGFloat minHeight = [self minWindowContentSizeAllowed] + (NSHeight([fWindow frame]) - NSHeight([[fWindow contentView] frame])); //contentView to window - + if (windowSize.height <= minHeight) windowSize.height = minHeight; else @@ -3456,31 +3422,31 @@ - (void) showStatusBar: (BOOL) show animate: (BOOL) animate const BOOL prevShown = fStatusBar != nil; if (show == prevShown) return; - + if (show) { fStatusBar = [[StatusBarController alloc] initWithLib: fLib]; - + NSView * contentView = [fWindow contentView]; const NSSize windowSize = [contentView convertSize: [fWindow frame].size fromView: nil]; - + NSRect statusBarFrame = [[fStatusBar view] frame]; statusBarFrame.size.width = windowSize.width; [[fStatusBar view] setFrame: statusBarFrame]; - + [contentView addSubview: [fStatusBar view]]; [[fStatusBar view] setFrameOrigin: NSMakePoint(0.0, NSMaxY([contentView frame]))]; } - + CGFloat heightChange = [[fStatusBar view] frame].size.height; if (!show) heightChange *= -1; - + //allow bar to show even if not enough room if (show && ![fDefaults boolForKey: @"AutoSize"]) { NSRect frame = [self windowFrameByAddingHeight: heightChange checkLimits: NO]; - + NSScreen * screen = [fWindow screen]; if (screen) { @@ -3494,11 +3460,11 @@ - (void) showStatusBar: (BOOL) show animate: (BOOL) animate } } } - + [self updateUI]; - + NSScrollView * scrollView = [fTableView enclosingScrollView]; - + //set views to not autoresize const NSUInteger statsMask = [[fStatusBar view] autoresizingMask]; [[fStatusBar view] setAutoresizingMask: NSViewNotSizable]; @@ -3510,23 +3476,23 @@ - (void) showStatusBar: (BOOL) show animate: (BOOL) animate } const NSUInteger scrollMask = [scrollView autoresizingMask]; [scrollView setAutoresizingMask: NSViewNotSizable]; - + NSRect frame = [self windowFrameByAddingHeight: heightChange checkLimits: NO]; - [fWindow setFrame: frame display: YES animate: animate]; - + [fWindow setFrame: frame display: YES animate: animate]; + //re-enable autoresize [[fStatusBar view] setAutoresizingMask: statsMask]; if (fFilterBar) [[fFilterBar view] setAutoresizingMask: filterMask]; [scrollView setAutoresizingMask: scrollMask]; - + if (!show) { [[fStatusBar view] removeFromSuperviewWithoutNeedingDisplay]; [fStatusBar release]; fStatusBar = nil; } - + if ([fDefaults boolForKey: @"AutoSize"]) [self setWindowMinMaxToCurrent]; else @@ -3541,15 +3507,15 @@ - (void) showStatusBar: (BOOL) show animate: (BOOL) animate - (void) toggleFilterBar: (id) sender { const BOOL show = fFilterBar == nil; - + //disable filtering when hiding (have to do before showFilterBar:animate:) if (!show) [fFilterBar reset: NO]; - + [self showFilterBar: show animate: YES]; [fDefaults setBool: show forKey: @"FilterBar"]; [[fWindow toolbar] validateVisibleItems]; - + [self applyFilter]; //do even if showing to ensure tooltips are updated } @@ -3559,18 +3525,18 @@ - (void) showFilterBar: (BOOL) show animate: (BOOL) animate const BOOL prevShown = fFilterBar != nil; if (show == prevShown) return; - + if (show) { fFilterBar = [[FilterBarController alloc] init]; - + NSView * contentView = [fWindow contentView]; const NSSize windowSize = [contentView convertSize: [fWindow frame].size fromView: nil]; - + NSRect filterBarFrame = [[fFilterBar view] frame]; filterBarFrame.size.width = windowSize.width; [[fFilterBar view] setFrame: filterBarFrame]; - + if (fStatusBar) [contentView addSubview: [fFilterBar view] positioned: NSWindowBelow relativeTo: [fStatusBar view]]; else @@ -3580,16 +3546,16 @@ - (void) showFilterBar: (BOOL) show animate: (BOOL) animate } else [fWindow makeFirstResponder: fTableView]; - + CGFloat heightChange = NSHeight([[fFilterBar view] frame]); if (!show) heightChange *= -1; - + //allow bar to show even if not enough room if (show && ![fDefaults boolForKey: @"AutoSize"]) { NSRect frame = [self windowFrameByAddingHeight: heightChange checkLimits: NO]; - + NSScreen * screen = [fWindow screen]; if (screen) { @@ -3603,7 +3569,7 @@ - (void) showFilterBar: (BOOL) show animate: (BOOL) animate } } } - + NSScrollView * scrollView = [fTableView enclosingScrollView]; //set views to not autoresize @@ -3611,21 +3577,21 @@ - (void) showFilterBar: (BOOL) show animate: (BOOL) animate const NSUInteger scrollMask = [scrollView autoresizingMask]; [[fFilterBar view] setAutoresizingMask: NSViewNotSizable]; [scrollView setAutoresizingMask: NSViewNotSizable]; - + const NSRect frame = [self windowFrameByAddingHeight: heightChange checkLimits: NO]; [fWindow setFrame: frame display: YES animate: animate]; - + //re-enable autoresize [[fFilterBar view] setAutoresizingMask: filterMask]; [scrollView setAutoresizingMask: scrollMask]; - + if (!show) { [[fFilterBar view] removeFromSuperviewWithoutNeedingDisplay]; [fFilterBar release]; fFilterBar = nil; } - + if ([fDefaults boolForKey: @"AutoSize"]) [self setWindowMinMaxToCurrent]; else @@ -3666,11 +3632,11 @@ - (NSArray *) quickLookableTorrents { NSArray * selectedTorrents = [fTableView selectedTorrents]; NSMutableArray * qlArray = [NSMutableArray arrayWithCapacity: [selectedTorrents count]]; - + for (Torrent * torrent in selectedTorrents) if (([torrent isFolder] || [torrent isComplete]) && [torrent dataLocation]) [qlArray addObject: torrent]; - + return qlArray; } @@ -3697,7 +3663,7 @@ - (BOOL) previewPanel: (QLPreviewPanel *) panel handleEvent: (NSEvent *) event [super keyDown: event]; return YES; }*/ - + return NO; } @@ -3709,16 +3675,16 @@ - (NSRect) previewPanel: (QLPreviewPanel *) panel sourceFrameOnScreenForPreviewI { if (![fWindow isVisible]) return NSZeroRect; - + const NSInteger row = [fTableView rowForItem: item]; if (row == -1) return NSZeroRect; - + NSRect frame = [fTableView iconRectForRow: row]; - + if (!NSIntersectsRect([fTableView visibleRect], frame)) return NSZeroRect; - + frame.origin = [fTableView convertPoint: frame.origin toView: nil]; frame = [fWindow convertRectToScreen: frame]; frame.origin.y -= frame.size.height; @@ -3729,10 +3695,10 @@ - (NSRect) previewPanel: (QLPreviewPanel *) panel sourceFrameOnScreenForPreviewI - (void) showToolbarShare: (id) sender { NSParameterAssert([sender isKindOfClass:[NSButton class]]); - + NSSharingServicePicker * picker = [[NSSharingServicePicker alloc] initWithItems: [[ShareTorrentFileHelper sharedHelper] shareTorrentURLs]]; picker.delegate = self; - + [picker showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge]; } @@ -3754,18 +3720,18 @@ - (ButtonToolbarItem *) standardToolbarButtonWithIdentifier: (NSString *) ident - (id) toolbarButtonWithIdentifier: (NSString *) ident forToolbarButtonClass:(Class)class { ButtonToolbarItem * item = [[class alloc] initWithItemIdentifier: ident]; - + NSButton * button = [[NSButton alloc] init]; [button setBezelStyle: NSTexturedRoundedBezelStyle]; [button setStringValue: @""]; - + [item setView: button]; [button release]; - + const NSSize buttonSize = NSMakeSize(36.0, 25.0); [item setMinSize: buttonSize]; [item setMaxSize: buttonSize]; - + return [item autorelease]; } @@ -3774,7 +3740,7 @@ - (NSToolbarItem *) toolbar: (NSToolbar *) toolbar itemForItemIdentifier: (NSStr if ([ident isEqualToString: TOOLBAR_CREATE]) { ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; - + [item setLabel: NSLocalizedString(@"Create", "Create toolbar item -> label")]; [item setPaletteLabel: NSLocalizedString(@"Create Torrent File", "Create toolbar item -> palette label")]; [item setToolTip: NSLocalizedString(@"Create torrent file", "Create toolbar item -> tooltip")]; @@ -3782,13 +3748,13 @@ - (NSToolbarItem *) toolbar: (NSToolbar *) toolbar itemForItemIdentifier: (NSStr [item setTarget: self]; [item setAction: @selector(createFile:)]; [item setAutovalidates: NO]; - + return item; } else if ([ident isEqualToString: TOOLBAR_OPEN_FILE]) { ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; - + [item setLabel: NSLocalizedString(@"Open", "Open toolbar item -> label")]; [item setPaletteLabel: NSLocalizedString(@"Open Torrent Files", "Open toolbar item -> palette label")]; [item setToolTip: NSLocalizedString(@"Open torrent files", "Open toolbar item -> tooltip")]; @@ -3796,13 +3762,13 @@ - (NSToolbarItem *) toolbar: (NSToolbar *) toolbar itemForItemIdentifier: (NSStr [item setTarget: self]; [item setAction: @selector(openShowSheet:)]; [item setAutovalidates: NO]; - + return item; } else if ([ident isEqualToString: TOOLBAR_OPEN_WEB]) { ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; - + [item setLabel: NSLocalizedString(@"Open Address", "Open address toolbar item -> label")]; [item setPaletteLabel: NSLocalizedString(@"Open Torrent Address", "Open address toolbar item -> palette label")]; [item setToolTip: NSLocalizedString(@"Open torrent web address", "Open address toolbar item -> tooltip")]; @@ -3810,13 +3776,13 @@ - (NSToolbarItem *) toolbar: (NSToolbar *) toolbar itemForItemIdentifier: (NSStr [item setTarget: self]; [item setAction: @selector(openURLShowSheet:)]; [item setAutovalidates: NO]; - + return item; } else if ([ident isEqualToString: TOOLBAR_REMOVE]) { ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; - + [item setLabel: NSLocalizedString(@"Remove", "Remove toolbar item -> label")]; [item setPaletteLabel: NSLocalizedString(@"Remove Selected", "Remove toolbar item -> palette label")]; [item setToolTip: NSLocalizedString(@"Remove selected transfers", "Remove toolbar item -> tooltip")]; @@ -3824,134 +3790,134 @@ - (NSToolbarItem *) toolbar: (NSToolbar *) toolbar itemForItemIdentifier: (NSStr [item setTarget: self]; [item setAction: @selector(removeNoDelete:)]; [item setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh]; - + return item; } else if ([ident isEqualToString: TOOLBAR_INFO]) { ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; [[(NSButton *)[item view] cell] setShowsStateBy: NSContentsCellMask]; //blue when enabled - + [item setLabel: NSLocalizedString(@"Inspector", "Inspector toolbar item -> label")]; [item setPaletteLabel: NSLocalizedString(@"Toggle Inspector", "Inspector toolbar item -> palette label")]; [item setToolTip: NSLocalizedString(@"Toggle the torrent inspector", "Inspector toolbar item -> tooltip")]; [item setImage: [NSImage imageNamed: @"ToolbarInfoTemplate"]]; [item setTarget: self]; [item setAction: @selector(showInfo:)]; - + return item; } else if ([ident isEqualToString: TOOLBAR_PAUSE_RESUME_ALL]) { GroupToolbarItem * groupItem = [[GroupToolbarItem alloc] initWithItemIdentifier: ident]; - + NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect]; [segmentedControl setCell: [[[ToolbarSegmentedCell alloc] init] autorelease]]; [groupItem setView: segmentedControl]; NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell]; - + if ([NSApp isOnYosemiteOrBetter]) { segmentedControl.segmentStyle = NSSegmentStyleSeparated; } - + [segmentedControl setSegmentCount: 2]; [segmentedCell setTrackingMode: NSSegmentSwitchTrackingMomentary]; - + const NSSize groupSize = NSMakeSize(72.0, 25.0); [groupItem setMinSize: groupSize]; [groupItem setMaxSize: groupSize]; - + [groupItem setLabel: NSLocalizedString(@"Apply All", "All toolbar item -> label")]; [groupItem setPaletteLabel: NSLocalizedString(@"Pause / Resume All", "All toolbar item -> palette label")]; [groupItem setTarget: self]; [groupItem setAction: @selector(allToolbarClicked:)]; - + [groupItem setIdentifiers: [NSArray arrayWithObjects: TOOLBAR_PAUSE_ALL, TOOLBAR_RESUME_ALL, nil]]; - + [segmentedCell setTag: TOOLBAR_PAUSE_TAG forSegment: TOOLBAR_PAUSE_TAG]; [segmentedControl setImage: [NSImage imageNamed: @"ToolbarPauseAllTemplate"] forSegment: TOOLBAR_PAUSE_TAG]; [segmentedCell setToolTip: NSLocalizedString(@"Pause all transfers", "All toolbar item -> tooltip") forSegment: TOOLBAR_PAUSE_TAG]; - + [segmentedCell setTag: TOOLBAR_RESUME_TAG forSegment: TOOLBAR_RESUME_TAG]; [segmentedControl setImage: [NSImage imageNamed: @"ToolbarResumeAllTemplate"] forSegment: TOOLBAR_RESUME_TAG]; [segmentedCell setToolTip: NSLocalizedString(@"Resume all transfers", "All toolbar item -> tooltip") forSegment: TOOLBAR_RESUME_TAG]; - + [groupItem createMenu: [NSArray arrayWithObjects: NSLocalizedString(@"Pause All", "All toolbar item -> label"), NSLocalizedString(@"Resume All", "All toolbar item -> label"), nil]]; - + [segmentedControl release]; - + [groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh]; - + return [groupItem autorelease]; } else if ([ident isEqualToString: TOOLBAR_PAUSE_RESUME_SELECTED]) { GroupToolbarItem * groupItem = [[GroupToolbarItem alloc] initWithItemIdentifier: ident]; - + NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect]; [segmentedControl setCell: [[[ToolbarSegmentedCell alloc] init] autorelease]]; [groupItem setView: segmentedControl]; NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell]; - + if ([NSApp isOnYosemiteOrBetter]) { segmentedControl.segmentStyle = NSSegmentStyleSeparated; } - + [segmentedControl setSegmentCount: 2]; [segmentedCell setTrackingMode: NSSegmentSwitchTrackingMomentary]; - + const NSSize groupSize = NSMakeSize(72.0, 25.0); [groupItem setMinSize: groupSize]; [groupItem setMaxSize: groupSize]; - + [groupItem setLabel: NSLocalizedString(@"Apply Selected", "Selected toolbar item -> label")]; [groupItem setPaletteLabel: NSLocalizedString(@"Pause / Resume Selected", "Selected toolbar item -> palette label")]; [groupItem setTarget: self]; [groupItem setAction: @selector(selectedToolbarClicked:)]; - + [groupItem setIdentifiers: [NSArray arrayWithObjects: TOOLBAR_PAUSE_SELECTED, TOOLBAR_RESUME_SELECTED, nil]]; - + [segmentedCell setTag: TOOLBAR_PAUSE_TAG forSegment: TOOLBAR_PAUSE_TAG]; [segmentedControl setImage: [NSImage imageNamed: @"ToolbarPauseSelectedTemplate"] forSegment: TOOLBAR_PAUSE_TAG]; [segmentedCell setToolTip: NSLocalizedString(@"Pause selected transfers", "Selected toolbar item -> tooltip") forSegment: TOOLBAR_PAUSE_TAG]; - + [segmentedCell setTag: TOOLBAR_RESUME_TAG forSegment: TOOLBAR_RESUME_TAG]; [segmentedControl setImage: [NSImage imageNamed: @"ToolbarResumeSelectedTemplate"] forSegment: TOOLBAR_RESUME_TAG]; [segmentedCell setToolTip: NSLocalizedString(@"Resume selected transfers", "Selected toolbar item -> tooltip") forSegment: TOOLBAR_RESUME_TAG]; - + [groupItem createMenu: [NSArray arrayWithObjects: NSLocalizedString(@"Pause Selected", "Selected toolbar item -> label"), NSLocalizedString(@"Resume Selected", "Selected toolbar item -> label"), nil]]; - + [segmentedControl release]; - + [groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh]; - + return [groupItem autorelease]; } else if ([ident isEqualToString: TOOLBAR_FILTER]) { ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; [[(NSButton *)[item view] cell] setShowsStateBy: NSContentsCellMask]; //blue when enabled - + [item setLabel: NSLocalizedString(@"Filter", "Filter toolbar item -> label")]; [item setPaletteLabel: NSLocalizedString(@"Toggle Filter", "Filter toolbar item -> palette label")]; [item setToolTip: NSLocalizedString(@"Toggle the filter bar", "Filter toolbar item -> tooltip")]; [item setImage: [NSImage imageNamed: @"ToolbarFilterTemplate"]]; [item setTarget: self]; [item setAction: @selector(toggleFilterBar:)]; - + return item; } else if ([ident isEqualToString: TOOLBAR_QUICKLOOK]) { ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident]; [[(NSButton *)[item view] cell] setShowsStateBy: NSContentsCellMask]; //blue when enabled - + [item setLabel: NSLocalizedString(@"Quick Look", "QuickLook toolbar item -> label")]; [item setPaletteLabel: NSLocalizedString(@"Quick Look", "QuickLook toolbar item -> palette label")]; [item setToolTip: NSLocalizedString(@"Quick Look", "QuickLook toolbar item -> tooltip")]; @@ -3959,24 +3925,24 @@ - (NSToolbarItem *) toolbar: (NSToolbar *) toolbar itemForItemIdentifier: (NSStr [item setTarget: self]; [item setAction: @selector(toggleQuickLook:)]; [item setVisibilityPriority: NSToolbarItemVisibilityPriorityLow]; - + return item; } else if ([ident isEqualToString: TOOLBAR_SHARE]) { ShareToolbarItem * item = [self toolbarButtonWithIdentifier: ident forToolbarButtonClass: [ShareToolbarItem class]]; - + [item setLabel: NSLocalizedString(@"Share", "Share toolbar item -> label")]; [item setPaletteLabel: NSLocalizedString(@"Share", "Share toolbar item -> palette label")]; [item setToolTip: NSLocalizedString(@"Share torrent file", "Share toolbar item -> tooltip")]; [item setImage: [NSImage imageNamed: NSImageNameShareTemplate]]; [item setVisibilityPriority: NSToolbarItemVisibilityPriorityLow]; - + NSButton *itemButton = (NSButton *)[item view]; [itemButton setTarget: self]; [itemButton setAction: @selector(showToolbarShare:)]; [itemButton sendActionOn:NSLeftMouseDownMask]; - + return item; } else @@ -4015,36 +3981,26 @@ - (void) selectedToolbarClicked: (id) sender - (NSArray *) toolbarAllowedItemIdentifiers: (NSToolbar *) toolbar { - NSMutableArray *items = [NSMutableArray arrayWithObjects: - TOOLBAR_CREATE, TOOLBAR_OPEN_FILE, TOOLBAR_OPEN_WEB, TOOLBAR_REMOVE, - TOOLBAR_PAUSE_RESUME_SELECTED, TOOLBAR_PAUSE_RESUME_ALL, - TOOLBAR_SHARE, TOOLBAR_QUICKLOOK, TOOLBAR_FILTER, TOOLBAR_INFO, - NSToolbarSeparatorItemIdentifier, - NSToolbarSpaceItemIdentifier, - NSToolbarFlexibleSpaceItemIdentifier, - NSToolbarCustomizeToolbarItemIdentifier, nil]; - if (![NSApp isOnMountainLionOrBetter]) { - [items removeObject:TOOLBAR_SHARE]; - } - return items; + return @[ TOOLBAR_CREATE, TOOLBAR_OPEN_FILE, TOOLBAR_OPEN_WEB, TOOLBAR_REMOVE, + TOOLBAR_PAUSE_RESUME_SELECTED, TOOLBAR_PAUSE_RESUME_ALL, + TOOLBAR_SHARE, TOOLBAR_QUICKLOOK, TOOLBAR_FILTER, TOOLBAR_INFO, + NSToolbarSeparatorItemIdentifier, + NSToolbarSpaceItemIdentifier, + NSToolbarFlexibleSpaceItemIdentifier, + NSToolbarCustomizeToolbarItemIdentifier ]; } - (NSArray *) toolbarDefaultItemIdentifiers: (NSToolbar *) toolbar { - NSMutableArray *items = [NSMutableArray arrayWithObjects: - TOOLBAR_CREATE, TOOLBAR_OPEN_FILE, TOOLBAR_REMOVE, NSToolbarSpaceItemIdentifier, - TOOLBAR_PAUSE_RESUME_ALL, NSToolbarFlexibleSpaceItemIdentifier, - TOOLBAR_SHARE, TOOLBAR_QUICKLOOK, TOOLBAR_FILTER, TOOLBAR_INFO, nil]; - if (![NSApp isOnMountainLionOrBetter]) { - [items removeObject:TOOLBAR_SHARE]; - } - return items; + return @[ TOOLBAR_CREATE, TOOLBAR_OPEN_FILE, TOOLBAR_REMOVE, NSToolbarSpaceItemIdentifier, + TOOLBAR_PAUSE_RESUME_ALL, NSToolbarFlexibleSpaceItemIdentifier, + TOOLBAR_SHARE, TOOLBAR_QUICKLOOK, TOOLBAR_FILTER, TOOLBAR_INFO ]; } - (BOOL) validateToolbarItem: (NSToolbarItem *) toolbarItem { NSString * ident = [toolbarItem itemIdentifier]; - + //enable remove item if ([ident isEqualToString: TOOLBAR_REMOVE]) return [fTableView numberOfSelectedRows] > 0; @@ -4075,7 +4031,7 @@ - (BOOL) validateToolbarItem: (NSToolbarItem *) toolbarItem return YES; return NO; } - + //enable resume item if ([ident isEqualToString: TOOLBAR_RESUME_SELECTED]) { @@ -4084,52 +4040,52 @@ - (BOOL) validateToolbarItem: (NSToolbarItem *) toolbarItem return YES; return NO; } - + //set info item if ([ident isEqualToString: TOOLBAR_INFO]) { [(NSButton *)[toolbarItem view] setState: [[fInfoController window] isVisible]]; return YES; } - + //set filter item if ([ident isEqualToString: TOOLBAR_FILTER]) { [(NSButton *)[toolbarItem view] setState: fFilterBar != nil]; return YES; } - + //set quick look item if ([ident isEqualToString: TOOLBAR_QUICKLOOK]) { [(NSButton *)[toolbarItem view] setState: [QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible]]; return YES; } - + //enable share item if ([ident isEqualToString: TOOLBAR_SHARE]) return [fTableView numberOfSelectedRows] > 0; - + return YES; } - (BOOL) validateMenuItem: (NSMenuItem *) menuItem { SEL action = [menuItem action]; - + if (action == @selector(toggleSpeedLimit:)) { [menuItem setState: [fDefaults boolForKey: @"SpeedLimit"] ? NSOnState : NSOffState]; return YES; } - + //only enable some items if it is in a context menu or the window is useable BOOL canUseTable = [fWindow isKeyWindow] || [[menuItem menu] supermenu] != [NSApp mainMenu]; //enable open items if (action == @selector(openShowSheet:) || action == @selector(openURLShowSheet:)) return [fWindow attachedSheet] == nil; - + //enable sort options if (action == @selector(setSort:)) { @@ -4162,16 +4118,17 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem break; default: NSAssert1(NO, @"Unknown sort tag received: %ld", [menuItem tag]); + sortType = SORT_ORDER; } - + [menuItem setState: [sortType isEqualToString: [fDefaults stringForKey: @"Sort"]] ? NSOnState : NSOffState]; return [fWindow isVisible]; } - + if (action == @selector(setGroup:)) { BOOL checked = NO; - + NSInteger index = [menuItem tag]; for (Torrent * torrent in [fTableView selectedTorrents]) if (index == [torrent groupValue]) @@ -4179,29 +4136,29 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem checked = YES; break; } - + [menuItem setState: checked ? NSOnState : NSOffState]; return canUseTable && [fTableView numberOfSelectedRows] > 0; } - + if (action == @selector(toggleSmallView:)) { [menuItem setState: [fDefaults boolForKey: @"SmallView"] ? NSOnState : NSOffState]; return [fWindow isVisible]; } - + if (action == @selector(togglePiecesBar:)) { [menuItem setState: [fDefaults boolForKey: @"PiecesBar"] ? NSOnState : NSOffState]; return [fWindow isVisible]; } - + if (action == @selector(toggleAvailabilityBar:)) { [menuItem setState: [fDefaults boolForKey: @"DisplayProgressBarAvailable"] ? NSOnState : NSOffState]; return [fWindow isVisible]; } - + //enable show info if (action == @selector(showInfo:)) { @@ -4211,11 +4168,11 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem return YES; } - + //enable prev/next inspector tab if (action == @selector(setInfoTab:)) return [[fInfoController window] isVisible]; - + //enable toggle status bar if (action == @selector(toggleStatusBar:)) { @@ -4225,7 +4182,7 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem return [fWindow isVisible]; } - + //enable toggle filter bar if (action == @selector(toggleFilterBar:)) { @@ -4235,15 +4192,15 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem return [fWindow isVisible]; } - + //enable prev/next filter button if (action == @selector(switchFilter:)) return [fWindow isVisible] && fFilterBar; - + //enable reveal in finder if (action == @selector(revealFile:)) return canUseTable && [fTableView numberOfSelectedRows] > 0; - + //enable renaming file/folder if (action == @selector(renameSelected:)) return canUseTable && [fTableView numberOfSelectedRows] == 1; @@ -4252,7 +4209,7 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem if (action == @selector(removeNoDelete:) || action == @selector(removeDeleteData:)) { BOOL warning = NO; - + for (Torrent * torrent in [fTableView selectedTorrents]) { if ([torrent isActive]) @@ -4264,7 +4221,7 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem } } } - + //append or remove ellipsis when needed NSString * title = [menuItem title], * ellipsis = [NSString ellipsis]; if (warning && [fDefaults boolForKey: @"CheckRemove"]) @@ -4277,10 +4234,10 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem if ([title hasSuffix: ellipsis]) [menuItem setTitle: [title substringToIndex: [title rangeOfString: ellipsis].location]]; } - + return canUseTable && [fTableView numberOfSelectedRows] > 0; } - + //remove all completed transfers item if (action == @selector(clearCompleted:)) { @@ -4296,7 +4253,7 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem if ([title hasSuffix: ellipsis]) [menuItem setTitle: [title substringToIndex: [title rangeOfString: ellipsis].location]]; } - + for (Torrent * torrent in fTorrents) if ([torrent isFinishedSeeding]) return YES; @@ -4311,7 +4268,7 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem return YES; return NO; } - + //enable resume all item if (action == @selector(resumeAllTorrents:)) { @@ -4320,25 +4277,25 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem return YES; return NO; } - + //enable resume all waiting item if (action == @selector(resumeWaitingTorrents:)) { if (![fDefaults boolForKey: @"Queue"] && ![fDefaults boolForKey: @"QueueSeed"]) return NO; - + for (Torrent * torrent in fTorrents) if ([torrent waitingToStart]) return YES; return NO; } - + //enable resume selected waiting item if (action == @selector(resumeSelectedTorrentsNoWait:)) { if (!canUseTable) return NO; - + for (Torrent * torrent in [fTableView selectedTorrents]) if (![torrent isActive]) return YES; @@ -4350,69 +4307,69 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem { if (!canUseTable) return NO; - + for (Torrent * torrent in [fTableView selectedTorrents]) if ([torrent isActive] || [torrent waitingToStart]) return YES; return NO; } - + //enable resume item if (action == @selector(resumeSelectedTorrents:)) { if (!canUseTable) return NO; - + for (Torrent * torrent in [fTableView selectedTorrents]) if (![torrent isActive] && ![torrent waitingToStart]) return YES; return NO; } - + //enable manual announce item if (action == @selector(announceSelectedTorrents:)) { if (!canUseTable) return NO; - + for (Torrent * torrent in [fTableView selectedTorrents]) if ([torrent canManualAnnounce]) return YES; return NO; } - + //enable reset cache item if (action == @selector(verifySelectedTorrents:)) { if (!canUseTable) return NO; - + for (Torrent * torrent in [fTableView selectedTorrents]) if (![torrent isMagnet]) return YES; return NO; } - + //enable move torrent file item if (action == @selector(moveDataFilesSelected:)) return canUseTable && [fTableView numberOfSelectedRows] > 0; - + //enable copy torrent file item if (action == @selector(copyTorrentFiles:)) { if (!canUseTable) return NO; - + for (Torrent * torrent in [fTableView selectedTorrents]) if (![torrent isMagnet]) return YES; return NO; } - + //enable copy torrent file item if (action == @selector(copyMagnetLinks:)) return canUseTable && [fTableView numberOfSelectedRows] > 0; - + //enable reverse sort item if (action == @selector(setSortReverse:)) { @@ -4420,14 +4377,14 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem [menuItem setState: (isReverse == [fDefaults boolForKey: @"SortReverse"]) ? NSOnState : NSOffState]; return ![[fDefaults stringForKey: @"Sort"] isEqualToString: SORT_ORDER]; } - + //enable group sort item if (action == @selector(setSortByGroup:)) { [menuItem setState: [fDefaults boolForKey: @"SortByGroup"] ? NSOnState : NSOffState]; return YES; } - + if (action == @selector(toggleQuickLook:)) { const BOOL visible =[QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible]; @@ -4435,10 +4392,10 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem NSString * title = !visible ? NSLocalizedString(@"Quick Look", "View menu -> Quick Look") : NSLocalizedString(@"Close Quick Look", "View menu -> Quick Look"); [menuItem setTitle: title]; - + return YES; } - + return YES; } @@ -4456,13 +4413,13 @@ - (void) sleepCallback: (natural_t) messageType argument: (void *) messageArgume anyActive = YES; [torrent sleep]; //have to call on all, regardless if they are active } - + //if there are any running transfers, wait 15 seconds for them to stop if (anyActive) { sleep(15); } - + IOAllowPowerChange(fRootPort, (long) messageArgument); break; } @@ -4478,7 +4435,7 @@ - (void) sleepCallback: (natural_t) messageType argument: (void *) messageArgume return; } } - + IOAllowPowerChange(fRootPort, (long) messageArgument); break; @@ -4494,7 +4451,7 @@ - (NSMenu *) applicationDockMenu: (NSApplication *) sender { if (fQuitting) return nil; - + NSUInteger seeding = 0, downloading = 0; for (Torrent * torrent in fTorrents) { @@ -4504,29 +4461,29 @@ - (NSMenu *) applicationDockMenu: (NSApplication *) sender downloading++; else; } - + NSMenu * menu = [[NSMenu alloc] init]; - + if (seeding > 0) { NSString * title = [NSString stringWithFormat: NSLocalizedString(@"%d Seeding", "Dock item - Seeding"), seeding]; [menu addItemWithTitle: title action: nil keyEquivalent: @""]; } - + if (downloading > 0) { NSString * title = [NSString stringWithFormat: NSLocalizedString(@"%d Downloading", "Dock item - Downloading"), downloading]; [menu addItemWithTitle: title action: nil keyEquivalent: @""]; } - + if (seeding > 0 || downloading > 0) [menu addItem: [NSMenuItem separatorItem]]; - + [menu addItemWithTitle: NSLocalizedString(@"Pause All", "Dock item") action: @selector(stopAllTorrents:) keyEquivalent: @""]; [menu addItemWithTitle: NSLocalizedString(@"Resume All", "Dock item") action: @selector(resumeAllTorrents:) keyEquivalent: @""]; [menu addItem: [NSMenuItem separatorItem]]; [menu addItemWithTitle: NSLocalizedString(@"Speed Limit", "Dock item") action: @selector(toggleSpeedLimit:) keyEquivalent: @""]; - + return [menu autorelease]; } @@ -4534,7 +4491,7 @@ - (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect { //if auto size is enabled, the current frame shouldn't need to change NSRect frame = [fDefaults boolForKey: @"AutoSize"] ? [window frame] : [self sizedWindowFrame]; - + frame.size.width = [fDefaults boolForKey: @"SmallView"] ? [fWindow minSize].width : WINDOW_REGULAR_WIDTH; return frame; } @@ -4544,11 +4501,11 @@ - (void) setWindowSizeToFit if ([fDefaults boolForKey: @"AutoSize"]) { NSScrollView * scrollView = [fTableView enclosingScrollView]; - + [scrollView setHasVerticalScroller: NO]; [fWindow setFrame: [self sizedWindowFrame] display: YES animate: YES]; [scrollView setHasVerticalScroller: YES]; - + [self setWindowMinMaxToCurrent]; } } @@ -4557,11 +4514,11 @@ - (NSRect) sizedWindowFrame { NSUInteger groups = ([fDisplayedTorrents count] > 0 && ![[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [Torrent class]]) ? [fDisplayedTorrents count] : 0; - + CGFloat heightChange = (GROUP_SEPARATOR_HEIGHT + [fTableView intercellSpacing].height) * groups + ([fTableView rowHeight] + [fTableView intercellSpacing].height) * ([fTableView numberOfRows] - groups) - NSHeight([[fTableView enclosingScrollView] frame]); - + return [self windowFrameByAddingHeight: heightChange checkLimits: YES]; } @@ -4573,9 +4530,9 @@ - (void) updateForAutoSize { NSSize contentMinSize = [fWindow contentMinSize]; contentMinSize.height = [self minWindowContentSizeAllowed]; - + [fWindow setContentMinSize: contentMinSize]; - + NSSize contentMaxSize = [fWindow contentMaxSize]; contentMaxSize.height = FLT_MAX; [fWindow setContentMaxSize: contentMaxSize]; @@ -4585,12 +4542,12 @@ - (void) updateForAutoSize - (void) setWindowMinMaxToCurrent { const CGFloat height = NSHeight([[fWindow contentView] frame]); - + NSSize minSize = [fWindow contentMinSize], maxSize = [fWindow contentMaxSize]; minSize.height = height; maxSize.height = height; - + [fWindow setContentMinSize: minSize]; [fWindow setContentMaxSize: maxSize]; } @@ -4660,7 +4617,7 @@ - (void) updaterWillRelaunchApplication: (SUUpdater *) updater - (NSDictionary *) registrationDictionaryForGrowl { NSArray * notifications = @[GROWL_DOWNLOAD_COMPLETE, GROWL_SEEDING_COMPLETE, GROWL_AUTO_ADD, GROWL_AUTO_SPEED_LIMIT]; - + return @{GROWL_NOTIFICATIONS_ALL : notifications, GROWL_NOTIFICATIONS_DEFAULT : notifications }; } @@ -4669,7 +4626,7 @@ - (void) growlNotificationWasClicked: (id) clickContext { if (![clickContext isKindOfClass: [NSDictionary class]]) return; - + NSString * type = [clickContext objectForKey: @"Type"], * location; if (([type isEqualToString: GROWL_DOWNLOAD_COMPLETE] || [type isEqualToString: GROWL_SEEDING_COMPLETE]) && (location = [clickContext objectForKey: @"Location"])) @@ -4694,55 +4651,55 @@ - (void) rpcCallback: (tr_rpc_callback_type) type forTorrentStruct: (struct tr_t *stop = YES; } }]; - + if (!torrent) { NSLog(@"No torrent found matching the given torrent struct from the RPC callback!"); return; } } - + dispatch_async(dispatch_get_main_queue(), ^{ switch (type) { case TR_RPC_TORRENT_ADDED: [self rpcAddTorrentStruct: torrentStruct]; break; - + case TR_RPC_TORRENT_STARTED: case TR_RPC_TORRENT_STOPPED: [self rpcStartedStoppedTorrent: torrent]; break; - + case TR_RPC_TORRENT_REMOVING: [self rpcRemoveTorrent: torrent deleteData: NO]; break; - + case TR_RPC_TORRENT_TRASHING: [self rpcRemoveTorrent: torrent deleteData: YES]; break; - + case TR_RPC_TORRENT_CHANGED: [self rpcChangedTorrent: torrent]; break; - + case TR_RPC_TORRENT_MOVED: [self rpcMovedTorrent: torrent]; break; - + case TR_RPC_SESSION_QUEUE_POSITIONS_CHANGED: [self rpcUpdateQueue]; break; - + case TR_RPC_SESSION_CHANGED: [fPrefsController rpcUpdatePrefs]; break; - + case TR_RPC_SESSION_CLOSE: fQuitRequested = YES; [NSApp terminate: self]; break; - + default: NSAssert1(NO, @"Unknown RPC command received: %d", type); } @@ -4755,24 +4712,24 @@ - (void) rpcAddTorrentStruct: (struct tr_torrent *) torrentStruct NSString * location = nil; if (tr_torrentGetDownloadDir(torrentStruct) != NULL) location = [NSString stringWithUTF8String: tr_torrentGetDownloadDir(torrentStruct)]; - + Torrent * torrent = [[Torrent alloc] initWithTorrentStruct: torrentStruct location: location lib: fLib]; - + //change the location if the group calls for it (this has to wait until after the torrent is created) if ([[GroupsController groups] usesCustomDownloadLocationForIndex: [torrent groupValue]]) { location = [[GroupsController groups] customDownloadLocationForIndex: [torrent groupValue]]; [torrent changeDownloadFolderBeforeUsing: location determinationType: TorrentDeterminationAutomatic]; } - + [torrent update]; [fTorrents addObject: torrent]; [torrent release]; - + if (!fAddingTransfers) fAddingTransfers = [[NSMutableSet alloc] init]; [fAddingTransfers addObject: torrent]; - + [self fullUpdateUI]; } @@ -4784,7 +4741,7 @@ - (void) rpcRemoveTorrent: (Torrent *) torrent deleteData: (BOOL) deleteData - (void) rpcStartedStoppedTorrent: (Torrent *) torrent { [torrent update]; - + [self updateUI]; [self applyFilter]; [self updateTorrentHistory]; @@ -4793,7 +4750,7 @@ - (void) rpcStartedStoppedTorrent: (Torrent *) torrent - (void) rpcChangedTorrent: (Torrent *) torrent { [torrent update]; - + if ([[fTableView selectedTorrents] containsObject: torrent]) { [fInfoController updateInfoStats]; //this will reload the file table @@ -4805,7 +4762,7 @@ - (void) rpcMovedTorrent: (Torrent *) torrent { [torrent update]; [torrent updateTimeMachineExclude]; - + if ([[fTableView selectedTorrents] containsObject: torrent]) [fInfoController updateInfoStats]; } @@ -4814,11 +4771,11 @@ - (void) rpcUpdateQueue { for (Torrent * torrent in fTorrents) [torrent update]; - + NSSortDescriptor * descriptor = [NSSortDescriptor sortDescriptorWithKey: @"queuePosition" ascending: YES]; NSArray * descriptors = [NSArray arrayWithObject: descriptor]; [fTorrents sortUsingDescriptors: descriptors]; - + [self sortTorrents: YES]; } diff --git a/macosx/CreatorWindowController.h b/macosx/CreatorWindowController.h index 80ca150b9fe..73fa66b21da 100644 --- a/macosx/CreatorWindowController.h +++ b/macosx/CreatorWindowController.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -34,17 +32,17 @@ IBOutlet NSSegmentedControl * fTrackerAddRemoveControl; IBOutlet NSTextView * fCommentView; IBOutlet NSButton * fPrivateCheck, * fOpenCheck; - + IBOutlet NSView * fProgressView; IBOutlet NSProgressIndicator * fProgressIndicator; - + tr_metainfo_builder * fInfo; NSURL * fPath, * fLocation; NSMutableArray * fTrackers; - + NSTimer * fTimer; BOOL fStarted, fOpenWhenCreated; - + NSUserDefaults * fDefaults; } diff --git a/macosx/CreatorWindowController.m b/macosx/CreatorWindowController.m index df555293568..4a86248e801 100644 --- a/macosx/CreatorWindowController.m +++ b/macosx/CreatorWindowController.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -53,7 +51,7 @@ + (CreatorWindowController *) createTorrentFile: (tr_session *) handle NSURL * path; if (!(path = [CreatorWindowController chooseFile])) return nil; - + CreatorWindowController * creator = [[self alloc] initWithHandle: handle path: path]; [creator showWindow: nil]; return creator; @@ -71,10 +69,10 @@ - (id) initWithHandle: (tr_session *) handle path: (NSURL *) path if ((self = [super initWithWindowNibName: @"Creator"])) { fStarted = NO; - + fPath = [path retain]; fInfo = tr_metaInfoBuilderCreate([[fPath path] UTF8String]); - + if (fInfo->fileCount == 0) { NSAlert * alert = [[NSAlert alloc] init]; @@ -84,10 +82,10 @@ - (id) initWithHandle: (tr_session *) handle path: (NSURL *) path [alert setInformativeText: NSLocalizedString(@"There must be at least one file in a folder to create a torrent file.", "Create torrent -> no files -> warning")]; [alert setAlertStyle: NSWarningAlertStyle]; - + [alert runModal]; [alert release]; - + [self release]; return nil; } @@ -100,21 +98,21 @@ - (id) initWithHandle: (tr_session *) handle path: (NSURL *) path [alert setInformativeText: NSLocalizedString(@"A torrent file cannot be created for files with no size.", "Create torrent -> zero size -> warning")]; [alert setAlertStyle: NSWarningAlertStyle]; - + [alert runModal]; [alert release]; - + [self release]; return nil; } - + fDefaults = [NSUserDefaults standardUserDefaults]; - + //get list of trackers if (!(fTrackers = [[fDefaults arrayForKey: @"CreatorTrackers"] mutableCopy])) { fTrackers = [[NSMutableArray alloc] init]; - + //check for single tracker from versions before 1.3 NSString * tracker; if ((tracker = [fDefaults stringForKey: @"CreatorTracker"])) @@ -127,7 +125,7 @@ - (id) initWithHandle: (tr_session *) handle path: (NSURL *) path } } } - + //remove potentially invalid addresses for (NSInteger i = [fTrackers count]-1; i >= 0; i--) { @@ -141,21 +139,21 @@ - (id) initWithHandle: (tr_session *) handle path: (NSURL *) path - (void) awakeFromNib { [[self window] setRestorationClass: [self class]]; - + NSString * name = [fPath lastPathComponent]; - + [[self window] setTitle: name]; - + [fNameField setStringValue: name]; [fNameField setToolTip: [fPath path]]; - + const BOOL multifile = fInfo->isFolder; - + NSImage * icon = [[NSWorkspace sharedWorkspace] iconForFileType: multifile ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) : [fPath pathExtension]]; [icon setSize: [fIconView frame].size]; [fIconView setImage: icon]; - + NSString * statusString = [NSString stringForFileSize: fInfo->totalSize]; if (multifile) { @@ -169,14 +167,14 @@ - (void) awakeFromNib statusString = [NSString stringWithFormat: @"%@, %@", fileString, statusString]; } [fStatusField setStringValue: statusString]; - + if (fInfo->pieceCount == 1) [fPiecesField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"1 piece, %@", "Create torrent -> info"), [NSString stringForFileSize: fInfo->pieceSize]]]; else [fPiecesField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d pieces, %@ each", "Create torrent -> info"), fInfo->pieceCount, [NSString stringForFileSize: fInfo->pieceSize]]]; - + fLocation = [[[fDefaults URLForKey: @"CreatorLocationURL"] URLByAppendingPathComponent: [name stringByAppendingPathExtension: @"torrent"]] retain]; if (!fLocation) { @@ -186,11 +184,11 @@ - (void) awakeFromNib fLocation = [[NSURL alloc] initFileURLWithPath: [[location stringByExpandingTildeInPath] stringByAppendingPathComponent: [name stringByAppendingPathExtension: @"torrent"]]]; } [self updateLocationField]; - + //set previously saved values if ([fDefaults objectForKey: @"CreatorPrivate"]) [fPrivateCheck setState: [fDefaults boolForKey: @"CreatorPrivate"] ? NSOnState : NSOffState]; - + [fOpenCheck setState: [fDefaults boolForKey: @"CreatorOpen"] ? NSOnState : NSOffState]; } @@ -198,15 +196,15 @@ - (void) dealloc { [fPath release]; [fLocation release]; - + [fTrackers release]; - + if (fInfo) tr_metaInfoBuilderFree(fInfo); - + [fTimer invalidate]; [fTimer release]; - + [super dealloc]; } @@ -218,7 +216,7 @@ + (void) restoreWindowWithIdentifier: (NSString *) identifier state: (NSCoder *) completionHandler(nil, [NSError errorWithDomain: NSURLErrorDomain code: NSURLErrorCannotOpenFile userInfo: nil]); return; } - + NSWindow * window = [[self createTorrentFile: [(Controller *)[NSApp delegate] sessionHandle] forFile: path] window]; completionHandler(window, nil); } @@ -238,11 +236,11 @@ - (void) window: (NSWindow *) window didDecodeRestorableState: (NSCoder *) coder [fLocation release]; fLocation = [[coder decodeObjectForKey: @"TRCreatorLocation"] retain]; [self updateLocationField]; - + [fTrackers release]; fTrackers = [[coder decodeObjectForKey: @"TRCreatorTrackers"] retain]; [fTrackerTable reloadData]; - + [fOpenCheck setState: [coder decodeIntegerForKey: @"TRCreatorOpenCheck"]]; [fPrivateCheck setState: [coder decodeIntegerForKey: @"TRCreatorPrivateCheck"]]; [fCommentView setString: [coder decodeObjectForKey: @"TRCreatorPrivateComment"]]; @@ -254,14 +252,14 @@ - (IBAction) setLocation: (id) sender [panel setPrompt: NSLocalizedString(@"Select", "Create torrent -> location sheet -> button")]; [panel setMessage: NSLocalizedString(@"Select the name and location for the torrent file.", - "Create torrent -> location sheet -> message")]; - + "Create torrent -> location sheet -> message")]; + [panel setAllowedFileTypes: [NSArray arrayWithObjects: @"org.bittorrent.torrent", @"torrent", nil]]; [panel setCanSelectHiddenExtension: YES]; - + [panel setDirectoryURL: [fLocation URLByDeletingLastPathComponent]]; [panel setNameFieldStringValue: [fLocation lastPathComponent]]; - + [panel beginSheetModalForWindow: [self window] completionHandler: ^(NSInteger result) { if (result == NSFileHandlingPanelOKButton) { @@ -277,14 +275,14 @@ - (IBAction) create: (id) sender //make sure the trackers are no longer being verified if ([fTrackerTable editedRow] != -1) [[self window] endEditingFor: fTrackerTable]; - + const BOOL isPrivate = [fPrivateCheck state] == NSOnState; if ([fTrackers count] == 0 && [fDefaults boolForKey: isPrivate ? @"WarningCreatorPrivateBlankAddress" : @"WarningCreatorBlankAddress"]) { NSAlert * alert = [[NSAlert alloc] init]; [alert setMessageText: NSLocalizedString(@"There are no tracker addresses.", "Create torrent -> blank address -> title")]; - + NSString * infoString = isPrivate ? NSLocalizedString(@"A transfer marked as private with no tracker addresses will be unable to connect to peers." " The torrent file will only be useful if you plan to upload the file to a tracker website" @@ -292,7 +290,7 @@ - (IBAction) create: (id) sender : NSLocalizedString(@"The transfer will not contact trackers for peers, and will have to rely solely on" " non-tracker peer discovery methods such as PEX and DHT to download and seed.", "Create torrent -> blank address -> message"); - + [alert setInformativeText: infoString]; [alert addButtonWithTitle: NSLocalizedString(@"Create", "Create torrent -> blank address -> button")]; [alert addButtonWithTitle: NSLocalizedString(@"Cancel", "Create torrent -> blank address -> button")]; @@ -336,11 +334,11 @@ - (IBAction) addRemoveTracker: (id) sender //don't allow add/remove when currently adding - it leads to weird results if ([fTrackerTable editedRow] != -1) return; - + if ([[sender cell] tagForSegment: [sender selectedSegment]] == TRACKER_REMOVE_TAG) { [fTrackers removeObjectsAtIndexes: [fTrackerTable selectedRowIndexes]]; - + [fTrackerTable deselectAll: self]; [fTrackerTable reloadData]; } @@ -348,7 +346,7 @@ - (IBAction) addRemoveTracker: (id) sender { [fTrackers addObject: @""]; [fTrackerTable reloadData]; - + const NSInteger row = [fTrackers count] - 1; [fTrackerTable selectRowIndexes: [NSIndexSet indexSetWithIndex: row] byExtendingSelection: NO]; [fTrackerTable editColumn: 0 row: row withEvent: nil select: YES]; @@ -359,12 +357,12 @@ - (void) tableView: (NSTableView *) tableView setObjectValue: (id) object forTab row: (NSInteger) row { NSString * tracker = (NSString *)object; - + tracker = [tracker stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; - + if ([tracker rangeOfString: @"://"].location == NSNotFound) tracker = [@"http://" stringByAppendingString: tracker]; - + if (!tr_urlIsValidTracker([tracker UTF8String])) { NSBeep(); @@ -372,7 +370,7 @@ - (void) tableView: (NSTableView *) tableView setObjectValue: (id) object forTab } else [fTrackers replaceObjectAtIndex: row withObject: tracker]; - + [fTrackerTable deselectAll: self]; [fTrackerTable reloadData]; } @@ -386,7 +384,7 @@ - (void) copy: (id) sender { NSArray * addresses = [fTrackers objectsAtIndexes: [fTrackerTable selectedRowIndexes]]; NSString * text = [addresses componentsJoinedByString: @"\n"]; - + NSPasteboard * pb = [NSPasteboard generalPasteboard]; [pb clearContents]; [pb writeObjects: [NSArray arrayWithObject: text]]; @@ -395,46 +393,46 @@ - (void) copy: (id) sender - (BOOL) validateMenuItem: (NSMenuItem *) menuItem { const SEL action = [menuItem action]; - + if (action == @selector(copy:)) return [[self window] firstResponder] == fTrackerTable && [fTrackerTable numberOfSelectedRows] > 0; - + if (action == @selector(paste:)) return [[self window] firstResponder] == fTrackerTable && [[NSPasteboard generalPasteboard] canReadObjectForClasses: [NSArray arrayWithObject: [NSString class]] options: nil]; - + return YES; } - (void) paste: (id) sender { NSMutableArray * tempTrackers = [NSMutableArray array]; - + NSArray * items = [[NSPasteboard generalPasteboard] readObjectsForClasses: [NSArray arrayWithObject: [NSString class]] options: nil]; NSAssert(items != nil, @"no string items to paste; should not be able to call this method"); - + for (NSString * pbItem in items) { for (NSString * tracker in [pbItem componentsSeparatedByString: @"\n"]) [tempTrackers addObject: tracker]; } - + BOOL added = NO; - + for (NSString * tracker in tempTrackers) { tracker = [tracker stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; - + if ([tracker rangeOfString: @"://"].location == NSNotFound) tracker = [@"http://" stringByAppendingString: tracker]; - + if (tr_urlIsValidTracker([tracker UTF8String])) { [fTrackers addObject: tracker]; added = YES; } } - + if (added) { [fTrackerTable deselectAll: self]; @@ -458,7 +456,7 @@ - (void) updateLocationField + (NSURL *) chooseFile { NSOpenPanel * panel = [NSOpenPanel openPanel]; - + [panel setTitle: NSLocalizedString(@"Create Torrent File", "Create torrent -> select file")]; [panel setPrompt: NSLocalizedString(@"Select", "Create torrent -> select file")]; [panel setAllowsMultipleSelection: NO]; @@ -467,7 +465,7 @@ + (NSURL *) chooseFile [panel setCanCreateDirectories: NO]; [panel setMessage: NSLocalizedString(@"Select a file or folder for the torrent file.", "Create torrent -> select file")]; - + BOOL success = [panel runModal] == NSOKButton; return success ? [[panel URLs] objectAtIndex: 0] : nil; } @@ -480,9 +478,9 @@ - (void) createBlankAddressAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger if ([fPrivateCheck state] == NSOnState) [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningCreatorPrivateBlankAddress"]; } - + [alert release]; - + if (returnCode == NSAlertFirstButtonReturn) [self performSelectorOnMainThread: @selector(createReal) withObject: nil waitUntilDone: NO]; } @@ -502,17 +500,17 @@ - (void) createReal "Create torrent -> directory doesn't exist warning -> warning"), [[fLocation URLByDeletingLastPathComponent] path]]]; [alert setAlertStyle: NSWarningAlertStyle]; - + [alert beginSheetModalForWindow: [self window] modalDelegate: self didEndSelector: nil contextInfo: nil]; return; } - + //check if a file with the same name and location already exists if ([fLocation checkResourceIsReachableAndReturnError: NULL]) { NSArray * pathComponents = [fLocation pathComponents]; NSInteger count = [pathComponents count]; - + NSAlert * alert = [[[NSAlert alloc] init] autorelease]; [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> file already exists warning -> button")]; [alert setMessageText: NSLocalizedString(@"A torrent file with this name and directory cannot be created.", @@ -523,20 +521,20 @@ - (void) createReal "Create torrent -> file already exists warning -> warning"), [pathComponents objectAtIndex: count-1], [pathComponents objectAtIndex: count-2]]]; [alert setAlertStyle: NSWarningAlertStyle]; - + [alert beginSheetModalForWindow: [self window] modalDelegate: self didEndSelector: nil contextInfo: nil]; return; } - + //parse non-empty tracker strings tr_tracker_info * trackerInfo = tr_new0(tr_tracker_info, [fTrackers count]); - + for (NSUInteger i = 0; i < [fTrackers count]; i++) { trackerInfo[i].announce = (char *)[[fTrackers objectAtIndex: i] UTF8String]; trackerInfo[i].tier = i; } - + //store values [fDefaults setObject: fTrackers forKey: @"CreatorTrackers"]; [fDefaults setBool: [fPrivateCheck state] == NSOnState forKey: @"CreatorPrivate"]; @@ -545,11 +543,11 @@ - (void) createReal [fDefaults setURL: [fLocation URLByDeletingLastPathComponent] forKey: @"CreatorLocationURL"]; [[self window] setRestorable: NO]; - + [[NSNotificationCenter defaultCenter] postNotificationName: @"BeginCreateTorrentFile" object: fLocation userInfo: nil]; tr_makeMetaInfo(fInfo, [[fLocation path] UTF8String], trackerInfo, [fTrackers count], [[fCommentView string] UTF8String], [fPrivateCheck state] == NSOnState); tr_free(trackerInfo); - + fTimer = [[NSTimer scheduledTimerWithTimeInterval: 0.1 target: self selector: @selector(checkProgress) userInfo: nil repeats: YES] retain]; } @@ -560,7 +558,7 @@ - (void) checkProgress [fTimer invalidate]; [fTimer release]; fTimer = nil; - + NSAlert * alert; switch (fInfo->result) { @@ -571,21 +569,21 @@ - (void) checkProgress [[fPath URLByDeletingLastPathComponent] path], @"Path", nil]; [[NSNotificationCenter defaultCenter] postNotificationName: @"OpenCreatedTorrentFile" object: self userInfo: dict]; } - + [[self window] close]; break; - + case TR_MAKEMETA_CANCELLED: [[self window] close]; break; - + default: alert = [[[NSAlert alloc] init] autorelease]; [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> failed -> button")]; [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Creation of \"%@\" failed.", "Create torrent -> failed -> title"), [fLocation lastPathComponent]]]; [alert setAlertStyle: NSWarningAlertStyle]; - + if (fInfo->result == TR_MAKEMETA_IO_READ) [alert setInformativeText: [NSString stringWithFormat: NSLocalizedString(@"Could not read \"%s\": %s.", "Create torrent -> failed -> warning"), fInfo->errfile, strerror(fInfo->my_errno)]]; @@ -595,7 +593,7 @@ - (void) checkProgress else //invalid url should have been caught before creating [alert setInformativeText: [NSString stringWithFormat: @"%@ (%d)", NSLocalizedString(@"An unknown error has occurred.", "Create torrent -> failed -> warning"), fInfo->result]]; - + [alert beginSheetModalForWindow: [self window] modalDelegate: self didEndSelector: @selector(failureSheetClosed:returnCode:contextInfo:) contextInfo: nil]; } @@ -603,30 +601,30 @@ - (void) checkProgress else { [fProgressIndicator setDoubleValue: (double)fInfo->pieceIndex / fInfo->pieceCount]; - + if (!fStarted) { fStarted = YES; - + [fProgressView setHidden: YES]; - + NSWindow * window = [self window]; [window setFrameAutosaveName: @""]; - + NSRect windowRect = [window frame]; CGFloat difference = [fProgressView frame].size.height - [[window contentView] frame].size.height; windowRect.origin.y -= difference; windowRect.size.height += difference; - + //don't allow vertical resizing CGFloat height = windowRect.size.height; [window setMinSize: NSMakeSize([window minSize].width, height)]; [window setMaxSize: NSMakeSize([window maxSize].width, height)]; - + [window setContentView: fProgressView]; [window setFrame: windowRect display: YES animate: YES]; [fProgressView setHidden: NO]; - + [[window standardWindowButton: NSWindowCloseButton] setEnabled: NO]; } } diff --git a/macosx/Credits.rtf b/macosx/Credits.rtf index 7b2e15a2829..3e7c8e14b46 100644 --- a/macosx/Credits.rtf +++ b/macosx/Credits.rtf @@ -7,8 +7,8 @@ \f0\b\fs28 \cf0 The Transmission Project \fs24 \ \pard\tx440\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li100\slleading40\sb40\qc -{\field{\*\fldinst{HYPERLINK "http://www.transmissionbt.com/"}}{\fldrslt -\b0 \cf0 http://www.transmissionbt.com/}}\ +{\field{\*\fldinst{HYPERLINK "https://transmissionbt.com/"}}{\fldrslt +\b0 \cf0 https://transmissionbt.com/}}\ \pard\tx440\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li100\slleading40\sb40 \cf0 \ Lead Developers @@ -18,6 +18,8 @@ Lead Developers \fs24 \cf0 \ Mitchell Livingston, Digital Ignition LLC <{\field{\*\fldinst{HYPERLINK "mailto:livings124@transmissionbt.com"}}{\fldrslt livings124@transmissionbt.com}}> \fs20 \cf2 (Mac OS X client) +\fs24 \cf0 \ + Mike Gelfand <{\field{\*\fldinst{HYPERLINK "mailto:mike@transmissionbt.com"}}{\fldrslt mike@transmissionbt.com}}> \fs24 \cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural \cf0 \ @@ -149,4 +151,4 @@ Lead Developers Thomas Bernard for MiniUPnP and libnatpmp. <{\field{\*\fldinst{HYPERLINK "http://miniupnp.tuxfamily.org/"}}{\fldrslt http://miniupnp.tuxfamily.org/}}>\ The Growl Development Team for Growl. <{\field{\*\fldinst{HYPERLINK "http://growl.info/"}}{\fldrslt http://growl.info/}}>\ Andy Matuschak for Sparkle. <{\field{\*\fldinst{HYPERLINK "http://sparkle.andymatuschak.org/"}}{\fldrslt http://sparkle.andymatuschak.org/}}>\ - Bryan D K Jones for VDKQueue. <{\field{\*\fldinst{HYPERLINK "https://github.com/bdkjones/VDKQueue"}}{\fldrslt https://github.com/bdkjones/VDKQueue}}>} \ No newline at end of file + Bryan D K Jones for VDKQueue. <{\field{\*\fldinst{HYPERLINK "https://github.com/bdkjones/VDKQueue"}}{\fldrslt https://github.com/bdkjones/VDKQueue}}>} diff --git a/macosx/DragOverlayView.h b/macosx/DragOverlayView.h index c28cec23fed..1f9b3ec4a27 100644 --- a/macosx/DragOverlayView.h +++ b/macosx/DragOverlayView.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -27,7 +25,7 @@ @interface DragOverlayView : NSView { NSImage * fBadge; - + NSDictionary * fMainLineAttributes, * fSubLineAttributes; } diff --git a/macosx/DragOverlayView.m b/macosx/DragOverlayView.m index 3821d967bdc..c21a0829070 100644 --- a/macosx/DragOverlayView.m +++ b/macosx/DragOverlayView.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -37,23 +35,23 @@ - (id) initWithFrame: (NSRect) frame NSShadow * stringShadow = [[NSShadow alloc] init]; [stringShadow setShadowOffset: NSMakeSize(2.0, -2.0)]; [stringShadow setShadowBlurRadius: 4.0]; - + NSFont * bigFont = [NSFont boldSystemFontOfSize: 18.0], * smallFont = [NSFont systemFontOfSize: 14.0]; - + NSMutableParagraphStyle * paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [paragraphStyle setLineBreakMode: NSLineBreakByTruncatingMiddle]; - + fMainLineAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSColor whiteColor], NSForegroundColorAttributeName, bigFont, NSFontAttributeName, stringShadow, NSShadowAttributeName, paragraphStyle, NSParagraphStyleAttributeName, nil]; - + fSubLineAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSColor whiteColor], NSForegroundColorAttributeName, smallFont, NSFontAttributeName, stringShadow, NSShadowAttributeName, paragraphStyle, NSParagraphStyleAttributeName, nil]; - + [stringShadow release]; [paragraphStyle release]; } @@ -63,47 +61,47 @@ - (id) initWithFrame: (NSRect) frame - (void) dealloc { [fBadge release]; - + [fMainLineAttributes release]; [fSubLineAttributes release]; - + [super dealloc]; } - (void) setOverlay: (NSImage *) icon mainLine: (NSString *) mainLine subLine: (NSString *) subLine { [fBadge release]; - + //create badge const NSRect badgeRect = NSMakeRect(0.0, 0.0, 325.0, 84.0); - + fBadge = [[NSImage alloc] initWithSize: badgeRect.size]; [fBadge lockFocus]; - + NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: badgeRect xRadius: 15.0 yRadius: 15.0]; [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.75] set]; [bp fill]; - + //place icon [icon drawInRect: NSMakeRect(PADDING, (NSHeight(badgeRect) - ICON_WIDTH) * 0.5, ICON_WIDTH, ICON_WIDTH) fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; - + //place main text const NSSize mainLineSize = [mainLine sizeWithAttributes: fMainLineAttributes]; const NSSize subLineSize = [subLine sizeWithAttributes: fSubLineAttributes]; - + NSRect lineRect = NSMakeRect(PADDING + ICON_WIDTH + 5.0, (NSHeight(badgeRect) + (subLineSize.height + 2.0 - mainLineSize.height)) * 0.5, NSWidth(badgeRect) - (PADDING + ICON_WIDTH + 2.0) - PADDING, mainLineSize.height); [mainLine drawInRect: lineRect withAttributes: fMainLineAttributes]; - + //place sub text lineRect.origin.y -= subLineSize.height + 2.0; lineRect.size.height = subLineSize.height; [subLine drawInRect: lineRect withAttributes: fSubLineAttributes]; - + [fBadge unlockFocus]; - + [self setNeedsDisplay: YES]; } diff --git a/macosx/DragOverlayWindow.h b/macosx/DragOverlayWindow.h index 1d51523047e..71a4b8ee9f1 100644 --- a/macosx/DragOverlayWindow.h +++ b/macosx/DragOverlayWindow.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -28,7 +26,7 @@ @interface DragOverlayWindow : NSWindow { tr_session * fLib; - + NSViewAnimation * fFadeInAnimation, * fFadeOutAnimation; } diff --git a/macosx/DragOverlayWindow.m b/macosx/DragOverlayWindow.m index 9b87e88dc89..98efe9d5cb5 100644 --- a/macosx/DragOverlayWindow.m +++ b/macosx/DragOverlayWindow.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -40,33 +38,33 @@ - (id) initWithLib: (tr_session *) lib forWindow: (NSWindow *) window backing: NSBackingStoreBuffered defer: NO]))) { fLib = lib; - + [self setBackgroundColor: [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.5]]; [self setAlphaValue: 0.0]; [self setOpaque: NO]; [self setHasShadow: NO]; - + DragOverlayView * view = [[DragOverlayView alloc] initWithFrame: [self frame]]; [self setContentView: view]; [view release]; - + [self setReleasedWhenClosed: NO]; [self setIgnoresMouseEvents: YES]; - + fFadeInAnimation = [[NSViewAnimation alloc] initWithViewAnimations: [NSArray arrayWithObject: [NSDictionary dictionaryWithObjectsAndKeys: self, NSViewAnimationTargetKey, NSViewAnimationFadeInEffect, NSViewAnimationEffectKey, nil]]]; [fFadeInAnimation setDuration: 0.15]; [fFadeInAnimation setAnimationBlockingMode: NSAnimationNonblockingThreaded]; - + fFadeOutAnimation = [[NSViewAnimation alloc] initWithViewAnimations: [NSArray arrayWithObject: [NSDictionary dictionaryWithObjectsAndKeys: self, NSViewAnimationTargetKey, NSViewAnimationFadeOutEffect, NSViewAnimationEffectKey, nil]]]; [fFadeOutAnimation setDuration: 0.5]; [fFadeOutAnimation setAnimationBlockingMode: NSAnimationNonblockingThreaded]; - + [window addChildWindow: self ordered: NSWindowAbove]; - + [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(resizeWindow) name: NSWindowDidResizeNotification object: window]; } @@ -76,10 +74,10 @@ - (id) initWithLib: (tr_session *) lib forWindow: (NSWindow *) window - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; - + [fFadeInAnimation release]; [fFadeOutAnimation release]; - + [super dealloc]; } @@ -87,11 +85,11 @@ - (void) setTorrents: (NSArray *) files { uint64_t size = 0; NSInteger count = 0; - + NSString * name; BOOL folder; NSInteger fileCount = 0; - + for (NSString * file in files) { if ([[[NSWorkspace sharedWorkspace] typeOfFile: file error: NULL] isEqualToString: @"org.bittorrent.torrent"] @@ -105,7 +103,7 @@ - (void) setTorrents: (NSArray *) files count++; size += info.totalSize; fileCount += info.fileCount; - + //only useful when one torrent if (count == 1) { @@ -117,10 +115,10 @@ - (void) setTorrents: (NSArray *) files tr_ctorFree(ctor); } } - + if (count <= 0) return; - + //set strings and icon NSString * secondString = [NSString stringForFileSize: size]; if (count > 1 || folder) @@ -133,7 +131,7 @@ - (void) setTorrents: (NSArray *) files [NSString formattedUInteger: fileCount]]; secondString = [NSString stringWithFormat: @"%@, %@", fileString, secondString]; } - + NSImage * icon; if (count == 1) icon = [[NSWorkspace sharedWorkspace] iconForFileType: folder ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) : [name pathExtension]]; @@ -144,7 +142,7 @@ - (void) setTorrents: (NSArray *) files secondString = [secondString stringByAppendingString: @" total"]; icon = [NSImage imageNamed: @"TransmissionDocument.icns"]; } - + [[self contentView] setOverlay: icon mainLine: name subLine: secondString]; [self fadeIn]; } diff --git a/macosx/ExpandedPathToIconTransformer.h b/macosx/ExpandedPathToIconTransformer.h index 456310fd5f4..bbec7e7f288 100644 --- a/macosx/ExpandedPathToIconTransformer.h +++ b/macosx/ExpandedPathToIconTransformer.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/macosx/ExpandedPathToIconTransformer.m b/macosx/ExpandedPathToIconTransformer.m index d14c918ae99..3dff06aa284 100644 --- a/macosx/ExpandedPathToIconTransformer.m +++ b/macosx/ExpandedPathToIconTransformer.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -22,6 +20,8 @@ * DEALINGS IN THE SOFTWARE. *****************************************************************************/ +#import + #import "ExpandedPathToIconTransformer.h" @implementation ExpandedPathToIconTransformer @@ -40,7 +40,7 @@ - (id) transformedValue: (id) value { if (!value) return nil; - + NSString * path = [value stringByExpandingTildeInPath]; NSImage * icon; //show a folder icon if the folder doesn't exist @@ -48,9 +48,9 @@ - (id) transformedValue: (id) value icon = [[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode(kGenericFolderIcon)]; else icon = [[NSWorkspace sharedWorkspace] iconForFile: path]; - + [icon setSize: NSMakeSize(16.0, 16.0)]; - + return icon; } diff --git a/macosx/ExpandedPathToPathTransformer.h b/macosx/ExpandedPathToPathTransformer.h index dd6c3f512cd..e786759aa4c 100644 --- a/macosx/ExpandedPathToPathTransformer.h +++ b/macosx/ExpandedPathToPathTransformer.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/macosx/ExpandedPathToPathTransformer.m b/macosx/ExpandedPathToPathTransformer.m index 8f729a34004..6d8baa27598 100644 --- a/macosx/ExpandedPathToPathTransformer.m +++ b/macosx/ExpandedPathToPathTransformer.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/macosx/FileListNode.h b/macosx/FileListNode.h index 8e26f48b3f4..bec03331d48 100644 --- a/macosx/FileListNode.h +++ b/macosx/FileListNode.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -29,7 +27,7 @@ @interface FileListNode : NSObject { NSMutableIndexSet * fIndexes; - + NSString * fName; NSString * fPath; Torrent * fTorrent; diff --git a/macosx/FileListNode.m b/macosx/FileListNode.m index 91af2953e5e..b8f0b9aae22 100644 --- a/macosx/FileListNode.m +++ b/macosx/FileListNode.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -49,7 +47,7 @@ - (id) initWithFolderName: (NSString *) name path: (NSString *) path torrent: (T fChildren = [[NSMutableArray alloc] init]; fSize = 0; } - + return self; } @@ -60,21 +58,21 @@ - (id) initWithFileName: (NSString *) name path: (NSString *) path size: (uint64 fSize = size; [fIndexes addIndex: index]; } - + return self; } - (void) insertChild: (FileListNode *) child { NSAssert(fIsFolder, @"method can only be invoked on folders"); - + [fChildren addObject: child]; } - (void) insertIndex: (NSUInteger) index withSize: (uint64_t) size { NSAssert(fIsFolder, @"method can only be invoked on folders"); - + [fIndexes addIndex: index]; fSize += size; } @@ -114,7 +112,7 @@ - (NSImage *) icon - (NSMutableArray *) children { NSAssert(fIsFolder, @"method can only be invoked on folders"); - + return fChildren; } @@ -123,16 +121,18 @@ - (BOOL) updateFromOldName: (NSString *) oldName toNewName: (NSString *) newName NSParameterAssert(oldName != nil); NSParameterAssert(newName != nil); NSParameterAssert(path != nil); - + NSArray * lookupPathComponents = [path pathComponents]; NSArray * thesePathComponents = [self.path pathComponents]; - + if ([lookupPathComponents isEqualToArray: thesePathComponents]) //this node represents what's being renamed { if ([oldName isEqualToString: self.name]) { [fName release]; fName = [newName copy]; + [fIcon release]; + fIcon = nil; return YES; } } @@ -142,18 +142,18 @@ - (BOOL) updateFromOldName: (NSString *) oldName toNewName: (NSString *) newName const BOOL allSame = NSNotFound == [lookupPathComponents indexOfObjectWithOptions: NSEnumerationConcurrent passingTest: ^BOOL(NSString * name, NSUInteger idx, BOOL * stop) { return ![name isEqualToString: [thesePathComponents objectAtIndex: idx]]; }]; - + if (allSame) { NSString * oldPathPrefix = [path stringByAppendingPathComponent: oldName]; NSString * newPathPrefix = [path stringByAppendingPathComponent: newName]; - + [fPath autorelease]; fPath = [[fPath stringByReplacingCharactersInRange: NSMakeRange(0, [oldPathPrefix length]) withString: newPathPrefix] retain]; return YES; } } - + return NO; } @@ -168,12 +168,12 @@ - (id) initWithFolder: (BOOL) isFolder name: (NSString *) name path: (NSString * fIsFolder = isFolder; fName = [name copy]; fPath = [path copy]; - + fIndexes = [[NSMutableIndexSet alloc] init]; - + fTorrent = torrent; } - + return self; } diff --git a/macosx/FileNameCell.h b/macosx/FileNameCell.h index b45e4d2b827..d3c65a3e337 100644 --- a/macosx/FileNameCell.h +++ b/macosx/FileNameCell.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/macosx/FileNameCell.m b/macosx/FileNameCell.m index b28dcf2515e..604eb17d7c0 100644 --- a/macosx/FileNameCell.m +++ b/macosx/FileNameCell.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -58,18 +56,18 @@ - (id) init { NSMutableParagraphStyle * paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [paragraphStyle setLineBreakMode: NSLineBreakByTruncatingMiddle]; - + fTitleAttributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys: [NSFont messageFontOfSize: 12.0], NSFontAttributeName, paragraphStyle, NSParagraphStyleAttributeName, nil]; - + NSMutableParagraphStyle * statusParagraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [statusParagraphStyle setLineBreakMode: NSLineBreakByTruncatingTail]; - + fStatusAttributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys: [NSFont messageFontOfSize: 9.0], NSFontAttributeName, statusParagraphStyle, NSParagraphStyleAttributeName, nil]; - + [paragraphStyle release]; [statusParagraphStyle release]; } @@ -80,17 +78,17 @@ - (void) dealloc { [fTitleAttributes release]; [fStatusAttributes release]; - + [super dealloc]; } - (id) copyWithZone: (NSZone *) zone { FileNameCell * copy = [super copyWithZone: zone]; - + copy->fTitleAttributes = [fTitleAttributes retain]; copy->fStatusAttributes = [fStatusAttributes retain]; - + return copy; } @@ -103,13 +101,13 @@ - (NSImage *) image - (NSRect) imageRectForBounds: (NSRect) bounds { NSRect result = bounds; - + result.origin.x += PADDING_HORIZONAL; - + const CGFloat IMAGE_SIZE = [(FileListNode *)[self objectValue] isFolder] ? IMAGE_FOLDER_SIZE : IMAGE_ICON_SIZE; result.origin.y += (result.size.height - IMAGE_SIZE) * 0.5; result.size = NSMakeSize(IMAGE_SIZE, IMAGE_SIZE); - + return result; } @@ -117,7 +115,7 @@ - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView { //icon [[self image] drawInRect: [self imageRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil]; - + NSColor * titleColor, * statusColor; if ([self backgroundStyle] == NSBackgroundStyleDark) titleColor = statusColor = [NSColor whiteColor]; @@ -128,15 +126,15 @@ - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView titleColor = [NSColor controlTextColor]; statusColor = [NSColor darkGrayColor]; } - + [fTitleAttributes setObject: titleColor forKey: NSForegroundColorAttributeName]; [fStatusAttributes setObject: statusColor forKey: NSForegroundColorAttributeName]; - + //title NSAttributedString * titleString = [self attributedTitle]; NSRect titleRect = [self rectForTitleWithString: titleString inBounds: cellFrame]; [titleString drawInRect: titleRect]; - + //status NSAttributedString * statusString = [self attributedStatus]; NSRect statusRect = [self rectForStatusWithString: statusString withTitleRect: titleRect inBounds: cellFrame]; @@ -147,14 +145,14 @@ - (NSRect) expansionFrameWithFrame: (NSRect) cellFrame inView: (NSView *) view { NSAttributedString * titleString = [self attributedTitle]; NSRect realRect = [self rectForTitleWithString: titleString inBounds: cellFrame]; - + if ([titleString size].width > NSWidth(realRect) && NSMouseInRect([view convertPoint: [[view window] mouseLocationOutsideOfEventStream] fromView: nil], realRect, [view isFlipped])) { realRect.size.width = [titleString size].width; return NSInsetRect(realRect, -PADDING_EXPANSION_FRAME, -PADDING_EXPANSION_FRAME); } - + return NSZeroRect; } @@ -162,7 +160,7 @@ - (void) drawWithExpansionFrame: (NSRect) cellFrame inView: (NSView *)view { cellFrame.origin.x += PADDING_EXPANSION_FRAME; cellFrame.origin.y += PADDING_EXPANSION_FRAME; - + [fTitleAttributes setObject: [NSColor controlTextColor] forKey: NSForegroundColorAttributeName]; NSAttributedString * titleString = [self attributedTitle]; [titleString drawInRect: cellFrame]; @@ -175,7 +173,7 @@ @implementation FileNameCell (Private) - (NSRect) rectForTitleWithString: (NSAttributedString *) string inBounds: (NSRect) bounds { const NSSize titleSize = [string size]; - + //no right padding, so that there's not too much space between this and the priority image NSRect result; if (![(FileListNode *)[self objectValue] isFolder]) @@ -191,14 +189,14 @@ - (NSRect) rectForTitleWithString: (NSAttributedString *) string inBounds: (NSRe result.size.width = MIN(titleSize.width, NSMaxX(bounds) - NSMinX(result)); } result.size.height = titleSize.height; - + return result; } -- (NSRect) rectForStatusWithString: (NSAttributedString *) string withTitleRect: (NSRect) titleRect inBounds: (NSRect) bounds; +- (NSRect) rectForStatusWithString: (NSAttributedString *) string withTitleRect: (NSRect) titleRect inBounds: (NSRect) bounds { const NSSize statusSize = [string size]; - + NSRect result; if (![(FileListNode *)[self objectValue] isFolder]) { @@ -213,7 +211,7 @@ - (NSRect) rectForStatusWithString: (NSAttributedString *) string withTitleRect: result.size.width = NSMaxX(bounds) - NSMaxX(titleRect); } result.size.height = statusSize.height; - + return result; } @@ -227,13 +225,13 @@ - (NSAttributedString *) attributedStatus { FileListNode * node = (FileListNode *)[self objectValue]; Torrent * torrent = [node torrent]; - + const CGFloat progress = [torrent fileProgress: node]; NSString * percentString = [NSString percentString: progress longDecimals: YES]; - + NSString * status = [NSString stringWithFormat: NSLocalizedString(@"%@ of %@", "Inspector -> Files tab -> file status string"), percentString, [NSString stringForFileSize: [node size]]]; - + return [[[NSAttributedString alloc] initWithString: status attributes: fStatusAttributes] autorelease]; } diff --git a/macosx/FileOutlineController.h b/macosx/FileOutlineController.h index 4478ce1a54c..f8882b45a6b 100644 --- a/macosx/FileOutlineController.h +++ b/macosx/FileOutlineController.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -31,9 +29,9 @@ { Torrent * fTorrent; NSMutableArray * fFileList; - + IBOutlet FileOutlineView * fOutline; - + NSString * fFilterText; } diff --git a/macosx/FileOutlineController.m b/macosx/FileOutlineController.m index bfde7a0903c..a0b8c3700e3 100644 --- a/macosx/FileOutlineController.m +++ b/macosx/FileOutlineController.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2008-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -61,16 +59,16 @@ @implementation FileOutlineController - (void) awakeFromNib { fFileList = [[NSMutableArray alloc] init]; - + [fOutline setDoubleAction: @selector(revealFile:)]; [fOutline setTarget: self]; - + //set table header tool tips [[fOutline tableColumnWithIdentifier: @"Check"] setHeaderToolTip: NSLocalizedString(@"Download", "file table -> header tool tip")]; [[fOutline tableColumnWithIdentifier: @"Priority"] setHeaderToolTip: NSLocalizedString(@"Priority", "file table -> header tool tip")]; - + [fOutline setMenu: [self menu]]; - + [self setTorrent: nil]; } @@ -78,7 +76,7 @@ - (void) dealloc { [fFileList release]; [fFilterText release]; - + [super dealloc]; } @@ -90,12 +88,12 @@ - (FileOutlineView *) outlineView - (void) setTorrent: (Torrent *) torrent { fTorrent = torrent; - + [fFileList setArray: [fTorrent fileList]]; - + [fFilterText release]; fFilterText = nil; - + [fOutline reloadData]; [fOutline deselectAll: nil]; //do this after reloading the data #4575 } @@ -108,18 +106,18 @@ - (void) setFilterText: (NSString *) text text = nil; components = nil; } - + if ((!text && !fFilterText) || (text && fFilterText && [text isEqualToString: fFilterText])) return; [fOutline beginUpdates]; - + NSUInteger currentIndex = 0, totalCount = 0; NSMutableArray * itemsToAdd = [NSMutableArray array]; NSMutableIndexSet * itemsToAddIndexes = [NSMutableIndexSet indexSet]; - + NSMutableDictionary * removedIndexesForParents = nil; //ugly, but we can't modify the actual file nodes - + NSArray * tempList = !text ? [fTorrent fileList] : [fTorrent flatFileList]; for (FileListNode * item in tempList) { @@ -134,12 +132,12 @@ - (void) setFilterText: (NSString *) text } }]; } - + if (!filter) { FileListNode * parent = nil; NSUInteger previousIndex = ![item isFolder] ? [self findFileNode: item inList: fFileList atIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(currentIndex, [fFileList count]-currentIndex)] currentParent: nil finalParent: &parent] : NSNotFound; - + if (previousIndex == NSNotFound) { [itemsToAdd addObject: item]; @@ -158,11 +156,11 @@ - (void) setFilterText: (NSString *) text else { [fFileList insertObject: item atIndex: currentIndex]; - + //figure out the index within the semi-edited table - UGLY if (!removedIndexesForParents) removedIndexesForParents = [NSMutableDictionary dictionary]; - + NSMutableIndexSet * removedIndexes = [removedIndexesForParents objectForKey: parent]; if (!removedIndexes) { @@ -175,17 +173,17 @@ - (void) setFilterText: (NSString *) text previousIndex -= [removedIndexes countOfIndexesInRange: NSMakeRange(0, previousIndex)]; } } - + if (move) [fOutline moveItemAtIndex: previousIndex inParent: parent toIndex: currentIndex inParent: nil]; - + ++currentIndex; } - + ++totalCount; } } - + //remove trailing items - those are the unused if (currentIndex < [fFileList count]) { @@ -193,13 +191,13 @@ - (void) setFilterText: (NSString *) text [fFileList removeObjectsInRange: removeRange]; [fOutline removeItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: removeRange] inParent: nil withAnimation: NSTableViewAnimationSlideDown]; } - + //add new items [fFileList insertObjects: itemsToAdd atIndexes: itemsToAddIndexes]; [fOutline insertItemsAtIndexes: itemsToAddIndexes inParent: nil withAnimation: NSTableViewAnimationSlideUp]; [fOutline endUpdates]; - + [fFilterText release]; fFilterText = [text retain]; } @@ -207,7 +205,7 @@ - (void) setFilterText: (NSString *) text - (void) refresh { [fTorrent updateFileStat]; - + [fOutline setNeedsDisplay: YES]; } @@ -228,7 +226,7 @@ - (NSInteger) outlineView: (NSOutlineView *) outlineView numberOfChildrenOfItem: } } -- (BOOL) outlineView: (NSOutlineView *) outlineView isItemExpandable: (id) item +- (BOOL) outlineView: (NSOutlineView *) outlineView isItemExpandable: (id) item { return [(FileListNode *)item isFolder]; } @@ -254,7 +252,7 @@ - (void) outlineView: (NSOutlineView *) outlineView willDisplayCell: (id) cell f else if ([identifier isEqualToString: @"Priority"]) { [cell setRepresentedObject: item]; - + NSInteger hoveredRow = [fOutline hoveredRow]; [(FilePriorityCell *)cell setHovered: hoveredRow != -1 && hoveredRow == [fOutline rowForItem: item]]; } @@ -271,10 +269,10 @@ - (void) outlineView: (NSOutlineView *) outlineView setObjectValue: (id) object indexSet = [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fTorrent fileCount])]; else indexSet = [(FileListNode *)item indexes]; - + [fTorrent setFileCheckState: [object intValue] != NSOffState ? NSOnState : NSOffState forIndexes: indexSet]; [fOutline setNeedsDisplay: YES]; - + [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateUI" object: nil]; } } @@ -330,7 +328,7 @@ - (NSString *) outlineView: (NSOutlineView *) outlineView toolTipForCell: (NSCel } } else; - + return nil; } @@ -345,12 +343,12 @@ - (CGFloat) outlineView: (NSOutlineView *) outlineView heightOfRowByItem: (id) i - (void) setCheck: (id) sender { NSInteger state = [sender tag] == FILE_UNCHECK_TAG ? NSOffState : NSOnState; - + NSIndexSet * indexSet = [fOutline selectedRowIndexes]; NSMutableIndexSet * itemIndexes = [NSMutableIndexSet indexSet]; for (NSInteger i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i]) [itemIndexes addIndexes: [[fOutline itemAtRow: i] indexes]]; - + [fTorrent setFileCheckState: state forIndexes: itemIndexes]; [fOutline setNeedsDisplay: YES]; } @@ -361,13 +359,13 @@ - (void) setOnlySelectedCheck: (id) sender NSMutableIndexSet * itemIndexes = [NSMutableIndexSet indexSet]; for (NSInteger i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i]) [itemIndexes addIndexes: [[fOutline itemAtRow: i] indexes]]; - + [fTorrent setFileCheckState: NSOnState forIndexes: itemIndexes]; - + NSMutableIndexSet * remainingItemIndexes = [NSMutableIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fTorrent fileCount])]; [remainingItemIndexes removeIndexes: itemIndexes]; [fTorrent setFileCheckState: NSOffState forIndexes: remainingItemIndexes]; - + [fOutline setNeedsDisplay: YES]; } @@ -399,12 +397,12 @@ - (void) setPriority: (id) sender case FILE_PRIORITY_LOW_TAG: priority = TR_PRI_LOW; } - + NSIndexSet * indexSet = [fOutline selectedRowIndexes]; NSMutableIndexSet * itemIndexes = [NSMutableIndexSet indexSet]; for (NSInteger i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i]) [itemIndexes addIndexes: [[fOutline itemAtRow: i] indexes]]; - + [fTorrent setFilePriority: priority forIndexes: itemIndexes]; [fOutline setNeedsDisplay: YES]; } @@ -419,7 +417,7 @@ - (void) revealFile: (id) sender if (path) [paths addObject: [NSURL fileURLWithPath: path]]; } - + if ([paths count] > 0) [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs: paths]; } @@ -428,7 +426,7 @@ - (void) renameSelected: (id) sender { NSIndexSet * indexes = [fOutline selectedRowIndexes]; NSAssert([indexes count] == 1, @"1 file needs to be selected to rename, but %ld are selected", [indexes count]); - + FileListNode * node = [fOutline itemAtRow: [indexes firstIndex]]; Torrent * torrent = [node torrent]; if (![torrent isFolder]) @@ -456,9 +454,9 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem { if (!fTorrent) return NO; - + SEL action = [menuItem action]; - + if (action == @selector(revealFile:)) { NSIndexSet * indexSet = [fOutline selectedRowIndexes]; @@ -467,34 +465,34 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem return YES; return NO; } - + if (action == @selector(setCheck:)) { if ([fOutline numberOfSelectedRows] == 0) return NO; - + NSIndexSet * indexSet = [fOutline selectedRowIndexes]; NSMutableIndexSet * itemIndexes = [NSMutableIndexSet indexSet]; for (NSInteger i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i]) [itemIndexes addIndexes: [[fOutline itemAtRow: i] indexes]]; - + NSInteger state = ([menuItem tag] == FILE_CHECK_TAG) ? NSOnState : NSOffState; return [fTorrent checkForFiles: itemIndexes] != state && [fTorrent canChangeDownloadCheckForFiles: itemIndexes]; } - + if (action == @selector(setOnlySelectedCheck:)) { if ([fOutline numberOfSelectedRows] == 0) return NO; - + NSIndexSet * indexSet = [fOutline selectedRowIndexes]; NSMutableIndexSet * itemIndexes = [NSMutableIndexSet indexSet]; for (NSInteger i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i]) [itemIndexes addIndexes: [[fOutline itemAtRow: i] indexes]]; - + return [fTorrent canChangeDownloadCheckForFiles: itemIndexes]; } - + if (action == @selector(setPriority:)) { if ([fOutline numberOfSelectedRows] == 0) @@ -502,7 +500,7 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem [menuItem setState: NSOffState]; return NO; } - + //determine which priorities are checked NSIndexSet * indexSet = [fOutline selectedRowIndexes]; tr_priority_t priority; @@ -518,14 +516,14 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem priority = TR_PRI_LOW; break; } - + BOOL current = NO, canChange = NO; for (NSInteger i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i]) { NSIndexSet * fileIndexSet = [[fOutline itemAtRow: i] indexes]; if (![fTorrent canChangeDownloadCheckForFiles: fileIndexSet]) continue; - + canChange = YES; if ([fTorrent hasFilePriority: priority forIndexes: fileIndexSet]) { @@ -533,16 +531,16 @@ - (BOOL) validateMenuItem: (NSMenuItem *) menuItem break; } } - + [menuItem setState: current ? NSOnState : NSOffState]; return canChange; } - + if (action == @selector(renameSelected:)) { return [fOutline numberOfSelectedRows] == 1; } - + return YES; } @@ -553,7 +551,7 @@ @implementation FileOutlineController (Private) - (NSMenu *) menu { NSMenu * menu = [[NSMenu alloc] initWithTitle: @"File Outline Menu"]; - + //check and uncheck NSMenuItem * item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Check Selected", "File Outline -> Menu") action: @selector(setCheck:) keyEquivalent: @""]; @@ -561,30 +559,30 @@ - (NSMenu *) menu [item setTag: FILE_CHECK_TAG]; [menu addItem: item]; [item release]; - + item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Uncheck Selected", "File Outline -> Menu") action: @selector(setCheck:) keyEquivalent: @""]; [item setTarget: self]; [item setTag: FILE_UNCHECK_TAG]; [menu addItem: item]; [item release]; - + //only check selected item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Only Check Selected", "File Outline -> Menu") action: @selector(setOnlySelectedCheck:) keyEquivalent: @""]; [item setTarget: self]; [menu addItem: item]; [item release]; - + [menu addItem: [NSMenuItem separatorItem]]; - + //priority item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Priority", "File Outline -> Menu") action: NULL keyEquivalent: @""]; NSMenu * priorityMenu = [[NSMenu alloc] initWithTitle: @"File Priority Menu"]; [item setSubmenu: priorityMenu]; [menu addItem: item]; [item release]; - + item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"High", "File Outline -> Priority Menu") action: @selector(setPriority:) keyEquivalent: @""]; [item setTarget: self]; @@ -592,7 +590,7 @@ - (NSMenu *) menu [item setImage: [NSImage imageNamed: @"PriorityHighTemplate"]]; [priorityMenu addItem: item]; [item release]; - + item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Normal", "File Outline -> Priority Menu") action: @selector(setPriority:) keyEquivalent: @""]; [item setTarget: self]; @@ -600,7 +598,7 @@ - (NSMenu *) menu [item setImage: [NSImage imageNamed: @"PriorityNormalTemplate"]]; [priorityMenu addItem: item]; [item release]; - + item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Low", "File Outline -> Priority Menu") action: @selector(setPriority:) keyEquivalent: @""]; [item setTarget: self]; @@ -608,43 +606,43 @@ - (NSMenu *) menu [item setImage: [NSImage imageNamed: @"PriorityLowTemplate"]]; [priorityMenu addItem: item]; [item release]; - + [priorityMenu release]; - + [menu addItem: [NSMenuItem separatorItem]]; - + //reveal in finder item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Show in Finder", "File Outline -> Menu") action: @selector(revealFile:) keyEquivalent: @""]; [item setTarget: self]; [menu addItem: item]; [item release]; - + [menu addItem: [NSMenuItem separatorItem]]; - + //rename item = [[NSMenuItem alloc] initWithTitle: [NSLocalizedString(@"Rename File", "File Outline -> Menu") stringByAppendingEllipsis] action: @selector(renameSelected:) keyEquivalent: @""]; [item setTarget: self]; [menu addItem: item]; [item release]; - + return [menu autorelease]; } - (NSUInteger) findFileNode: (FileListNode *) node inList: (NSArray *) list atIndexes: (NSIndexSet *) indexes currentParent: (FileListNode *) currentParent finalParent: (FileListNode **) parent { NSAssert(![node isFolder], @"Looking up folder node!"); - + __block NSUInteger retIndex = NSNotFound; - + [list enumerateObjectsAtIndexes: indexes options: NSEnumerationConcurrent usingBlock: ^(id checkNode, NSUInteger index, BOOL * stop) { if ([[checkNode indexes] containsIndex: [[node indexes] firstIndex]]) { if (![checkNode isFolder]) { NSAssert2([checkNode isEqualTo: node], @"Expected file nodes to be equal: %@ %@", checkNode, node); - + *parent = currentParent; retIndex = index; } @@ -654,11 +652,11 @@ - (NSUInteger) findFileNode: (FileListNode *) node inList: (NSArray *) list atIn NSAssert(subIndex != NSNotFound, @"We didn't find an expected file node."); retIndex = subIndex; } - + *stop = YES; } }]; - + return retIndex; } diff --git a/macosx/FileOutlineView.h b/macosx/FileOutlineView.h index 0686a3daf16..5ba9c33b618 100644 --- a/macosx/FileOutlineView.h +++ b/macosx/FileOutlineView.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/macosx/FileOutlineView.m b/macosx/FileOutlineView.m index 3f866f5cb2f..e7fd0337379 100644 --- a/macosx/FileOutlineView.m +++ b/macosx/FileOutlineView.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -36,14 +34,14 @@ - (void) awakeFromNib FileNameCell * nameCell = [[FileNameCell alloc] init]; [[self tableColumnWithIdentifier: @"Name"] setDataCell: nameCell]; [nameCell release]; - + FilePriorityCell * priorityCell = [[FilePriorityCell alloc] init]; [[self tableColumnWithIdentifier: @"Priority"] setDataCell: priorityCell]; [priorityCell release]; - + [self setAutoresizesOutlineColumn: NO]; [self setIndentationPerLevel: 14.0]; - + fMouseRow = -1; } @@ -61,7 +59,7 @@ - (void) mouseDown: (NSEvent *) event - (NSMenu *) menuForEvent: (NSEvent *) event { const NSInteger row = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]]; - + if (row >= 0) { if (![self isRowSelected: row]) @@ -69,7 +67,7 @@ - (NSMenu *) menuForEvent: (NSEvent *) event } else [self deselectAll: self]; - + return [self menu]; } @@ -77,7 +75,7 @@ - (NSRect) iconRectForRow: (int) row { FileNameCell * cell = (FileNameCell *)[self preparedCellAtColumn: [self columnWithIdentifier: @"Name"] row: row]; NSRect iconRect = [cell imageRectForBounds: [self rectOfRow: row]]; - + iconRect.origin.x += [self indentationPerLevel] * (CGFloat)([self levelForRow: row] + 1); return iconRect; } @@ -85,23 +83,23 @@ - (NSRect) iconRectForRow: (int) row - (void) updateTrackingAreas { [super updateTrackingAreas]; - + for (NSTrackingArea * area in [self trackingAreas]) { if ([area owner] == self && [[area userInfo] objectForKey: @"Row"]) [self removeTrackingArea: area]; } - + NSRange visibleRows = [self rowsInRect: [self visibleRect]]; if (visibleRows.length == 0) return; - + NSPoint mouseLocation = [self convertPoint: [[self window] mouseLocationOutsideOfEventStream] fromView: nil]; - - for (NSInteger row = visibleRows.location, col = [self columnWithIdentifier: @"Priority"]; row < NSMaxRange(visibleRows); row++) + + for (NSInteger row = visibleRows.location, col = [self columnWithIdentifier: @"Priority"]; (NSUInteger)row < NSMaxRange(visibleRows); row++) { FilePriorityCell * cell = (FilePriorityCell *)[self preparedCellAtColumn: col row: row]; - + NSDictionary * userInfo = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: row] forKey: @"Row"]; [cell addTrackingAreasForView: self inRect: [self frameOfCellAtColumn: col row: row] withUserInfo: userInfo mouseLocation: mouseLocation]; diff --git a/macosx/FilePriorityCell.h b/macosx/FilePriorityCell.h index 58c23446084..0c297f18a8b 100644 --- a/macosx/FilePriorityCell.h +++ b/macosx/FilePriorityCell.h @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/macosx/FilePriorityCell.m b/macosx/FilePriorityCell.m index 015619c610b..b1a9f7c95e3 100644 --- a/macosx/FilePriorityCell.m +++ b/macosx/FilePriorityCell.m @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Copyright (c) 2007-2012 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a @@ -39,17 +37,17 @@ - (id) init [self setTrackingMode: NSSegmentSwitchTrackingSelectAny]; [self setControlSize: NSMiniControlSize]; [self setSegmentCount: 3]; - + for (NSInteger i = 0; i < [self segmentCount]; i++) { [self setLabel: @"" forSegment: i]; [self setWidth: 9.0f forSegment: i]; //9 is minimum size to get proper look } - + [self setImage: [NSImage imageNamed: @"PriorityControlLow"] forSegment: 0]; [self setImage: [NSImage imageNamed: @"PriorityControlNormal"] forSegment: 1]; [self setImage: [NSImage imageNamed: @"PriorityControlHigh"] forSegment: 2]; - + fHoverRow = NO; } return self; @@ -65,7 +63,7 @@ - (id) copyWithZone: (NSZone *) zone - (void) setSelected: (BOOL) flag forSegment: (NSInteger) segment { [super setSelected: flag forSegment: segment]; - + //only for when clicking manually NSInteger priority; switch (segment) @@ -80,10 +78,10 @@ - (void) setSelected: (BOOL) flag forSegment: (NSInteger) segment priority = TR_PRI_HIGH; break; } - + Torrent * torrent = [(FileListNode *)[self representedObject] torrent]; [torrent setFilePriority: priority forIndexes: [(FileListNode *)[self representedObject] indexes]]; - + FileOutlineView * controlView = (FileOutlineView *)[self controlView]; [controlView setNeedsDisplay: YES]; } @@ -92,13 +90,13 @@ - (void) addTrackingAreasForView: (NSView *) controlView inRect: (NSRect) cellFr mouseLocation: (NSPoint) mouseLocation { NSTrackingAreaOptions options = NSTrackingEnabledDuringMouseDrag | NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways; - + if (NSMouseInRect(mouseLocation, cellFrame, [controlView isFlipped])) { options |= NSTrackingAssumeInside; [controlView setNeedsDisplayInRect: cellFrame]; } - + NSTrackingArea * area = [[NSTrackingArea alloc] initWithRect: cellFrame options: options owner: controlView userInfo: userInfo]; [controlView addTrackingArea: area]; [area release]; @@ -114,21 +112,21 @@ - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView FileListNode * node = [self representedObject]; Torrent * torrent = [node torrent]; NSSet * priorities = [torrent filePrioritiesForIndexes: [node indexes]]; - + const NSUInteger count = [priorities count]; if (fHoverRow && count > 0) { [super setSelected: [priorities containsObject: [NSNumber numberWithInteger: TR_PRI_LOW]] forSegment: 0]; [super setSelected: [priorities containsObject: [NSNumber numberWithInteger: TR_PRI_NORMAL]] forSegment: 1]; [super setSelected: [priorities containsObject: [NSNumber numberWithInteger: TR_PRI_HIGH]] forSegment: 2]; - + [super drawWithFrame: cellFrame inView: controlView]; } else { - NSMutableArray * images = [NSMutableArray arrayWithCapacity: MAX(count, 1)]; + NSMutableArray * images = [NSMutableArray arrayWithCapacity: MAX(count, 1u)]; CGFloat totalWidth; - + if (count == 0) { //if ([self backgroundStyle] != NSBackgroundStyleDark) @@ -141,7 +139,7 @@ - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView else { NSColor * priorityColor = [self backgroundStyle] == NSBackgroundStyleDark ? [NSColor whiteColor] : [NSColor darkGrayColor]; - + totalWidth = 0.0; if ([priorities containsObject: [NSNumber numberWithInteger: TR_PRI_LOW]]) { @@ -162,19 +160,19 @@ - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView totalWidth += [image size].width; } } - + if (count > 1) totalWidth -= IMAGE_OVERLAP * (count-1); - + CGFloat currentWidth = floor(NSMidX(cellFrame) - totalWidth * 0.5); - + for (NSImage * image in images) { const NSSize imageSize = [image size]; const NSRect imageRect = NSMakeRect(currentWidth, floor(NSMidY(cellFrame) - imageSize.height * 0.5), imageSize.width, imageSize.height); - + [image drawInRect: imageRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil]; - + currentWidth += imageSize.width - IMAGE_OVERLAP; } } diff --git a/macosx/FileRenameSheetController.h b/macosx/FileRenameSheetController.h index fbd1dc99df7..3bbf0166c78 100644 --- a/macosx/FileRenameSheetController.h +++ b/macosx/FileRenameSheetController.h @@ -17,7 +17,7 @@ FileListNode * _node; void (^_completionHandler)(BOOL); NSString * _originalName; - + IBOutlet NSTextField * _labelField; IBOutlet NSTextField * _inputField; IBOutlet NSButton * _renameButton; diff --git a/macosx/FileRenameSheetController.m b/macosx/FileRenameSheetController.m index 96662809338..19e71ee5aa3 100644 --- a/macosx/FileRenameSheetController.m +++ b/macosx/FileRenameSheetController.m @@ -38,12 +38,12 @@ + (void) presentSheetForTorrent: (Torrent *) torrent modalForWindow: (NSWindow * { NSParameterAssert(torrent != nil); NSParameterAssert(window != nil); - + FileRenameSheetController * renamer = [[FileRenameSheetController alloc] initWithWindowNibName: @"FileRenameSheetController"]; - + renamer.torrent = torrent; renamer.completionHandler = completionHandler; - + [NSApp beginSheet: [renamer window] modalForWindow: window modalDelegate: self didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) contextInfo: renamer]; } @@ -51,13 +51,13 @@ + (void) presentSheetForFileListNode: (FileListNode *) node modalForWindow: (NSW { NSParameterAssert(node != nil); NSParameterAssert(window != nil); - + FileRenameSheetController * renamer = [[FileRenameSheetController alloc] initWithWindowNibName: @"FileRenameSheetController"]; - + renamer.torrent = [node torrent]; renamer.node = node; renamer.completionHandler = completionHandler; - + [NSApp beginSheet: [renamer window] modalForWindow: window modalDelegate: self didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) contextInfo: renamer]; } @@ -65,9 +65,9 @@ + (void) sheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode cont { FileRenameSheetController * renamer = contextInfo; NSParameterAssert([renamer isKindOfClass:[FileRenameSheetController class]]); - + renamer.completionHandler(returnCode == NSOKButton); - + //TODO: retain/release logic needs to be figured out for ARC (when ARC is enabled) [renamer release]; [sheet orderOut: self]; @@ -85,42 +85,42 @@ - (void) dealloc - (void) windowDidLoad { [super windowDidLoad]; - + self.originalName = [self.node name] ?: [self.torrent name]; NSString * label = [NSString stringWithFormat: NSLocalizedString(@"Rename the file \"%@\":", "rename sheet label"), self.originalName]; [self.labelField setStringValue: label]; - + [self.inputField setStringValue: self.originalName]; [self.renameButton setEnabled: NO]; - + //resize the buttons so that they're long enough and the same width const NSRect oldRenameFrame = [self.renameButton frame]; const NSRect oldCancelFrame = [self.cancelButton frame]; - + //get the extra width of the rename button from the English xib - the width from sizeToFit is too squished [self.renameButton sizeToFit]; const CGFloat extra = NSWidth(oldRenameFrame) - NSWidth([self.renameButton frame]); - + [self.renameButton setTitle: NSLocalizedString(@"Rename", "rename sheet button")]; [self.cancelButton setTitle: NSLocalizedString(@"Cancel", "rename sheet button")]; - + [self.renameButton sizeToFit]; [self.cancelButton sizeToFit]; NSRect newRenameFrame = [self.renameButton frame]; NSRect newCancelFrame = [self.cancelButton frame]; newRenameFrame.size.width = MAX(NSWidth(newRenameFrame), NSWidth(newCancelFrame)) + extra; newCancelFrame.size.width = MAX(NSWidth(newRenameFrame), NSWidth(newCancelFrame)) + extra; - + const CGFloat renameWidthIncrease = NSWidth(newRenameFrame) - NSWidth(oldRenameFrame); newRenameFrame.origin.x -= renameWidthIncrease; [self.renameButton setFrame:newRenameFrame]; - + const CGFloat cancelWidthIncrease = NSWidth(newCancelFrame) - NSWidth(oldCancelFrame); newCancelFrame.origin.x -= renameWidthIncrease + cancelWidthIncrease; [self.cancelButton setFrame:newCancelFrame]; } -- (IBAction) rename: (id) sender; +- (IBAction) rename: (id) sender { void (^completionHandler)(BOOL) = ^(BOOL didRename) { if (didRename) @@ -131,7 +131,7 @@ - (IBAction) rename: (id) sender; NSBeep(); } }; - + if (self.node) [self.torrent renameFileNode: self.node withName: [self.inputField stringValue] completionHandler: completionHandler]; else diff --git a/macosx/FileRenameSheetController.xib b/macosx/FileRenameSheetController.xib index a45300fa52a..4568bd63c10 100644 --- a/macosx/FileRenameSheetController.xib +++ b/macosx/FileRenameSheetController.xib @@ -1,8 +1,9 @@ - - + + - + + diff --git a/macosx/FilterBar.xib b/macosx/FilterBar.xib index 61efa0ea64a..155476b5e06 100644 --- a/macosx/FilterBar.xib +++ b/macosx/FilterBar.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -58,12 +59,9 @@ - + - - - - + @@ -311,13 +311,9 @@ Gw - - - - diff --git a/macosx/da.lproj/Creator.xib b/macosx/da.lproj/Creator.xib index 4274b04726f..67d98b72920 100644 --- a/macosx/da.lproj/Creator.xib +++ b/macosx/da.lproj/Creator.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -64,15 +65,13 @@ - + - - @@ -104,12 +103,9 @@ - + - - - - + @@ -312,13 +312,9 @@ Gw - - - - diff --git a/macosx/de.lproj/Creator.xib b/macosx/de.lproj/Creator.xib index dee999d1fd7..8fb21c210a8 100644 --- a/macosx/de.lproj/Creator.xib +++ b/macosx/de.lproj/Creator.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -64,15 +65,13 @@ - + - - @@ -104,12 +103,9 @@ - + - - - - + @@ -311,13 +311,9 @@ Gw - - - - diff --git a/macosx/en.lproj/Creator.xib b/macosx/en.lproj/Creator.xib index 8decb64f25b..8194641ee8c 100644 --- a/macosx/en.lproj/Creator.xib +++ b/macosx/en.lproj/Creator.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -64,15 +65,13 @@ - + - - @@ -104,12 +103,9 @@ - + - - - - + @@ -434,7 +435,7 @@ - + @@ -443,7 +444,7 @@ - + @@ -492,7 +493,7 @@ - + @@ -560,7 +561,7 @@ - + @@ -311,13 +311,9 @@ Gw - - - - diff --git a/macosx/es.lproj/Creator.xib b/macosx/es.lproj/Creator.xib index 82b9bdd0f14..2b179390c70 100644 --- a/macosx/es.lproj/Creator.xib +++ b/macosx/es.lproj/Creator.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -64,15 +65,13 @@ - + - - @@ -104,12 +103,9 @@ - + - - - - + @@ -434,7 +435,7 @@ - + @@ -443,7 +444,7 @@ - + @@ -492,7 +493,7 @@ - + @@ -560,7 +561,7 @@ - + @@ -311,13 +311,9 @@ Gw - - - - diff --git a/macosx/fr.lproj/Creator.xib b/macosx/fr.lproj/Creator.xib index 5f5540f49bd..88cb446249c 100644 --- a/macosx/fr.lproj/Creator.xib +++ b/macosx/fr.lproj/Creator.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -64,15 +65,13 @@ - + - + - - @@ -104,12 +103,9 @@ - + - - - - + @@ -311,13 +311,9 @@ Gw - - - - diff --git a/macosx/it.lproj/Creator.xib b/macosx/it.lproj/Creator.xib index 3613b07897c..9252cae51da 100644 --- a/macosx/it.lproj/Creator.xib +++ b/macosx/it.lproj/Creator.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -64,15 +65,13 @@ - + - - @@ -104,12 +103,9 @@ - + - - - - + @@ -311,13 +311,9 @@ Gw - - - - diff --git a/macosx/nl.lproj/Creator.xib b/macosx/nl.lproj/Creator.xib index 0b585a7d4a6..ff3475433a3 100644 --- a/macosx/nl.lproj/Creator.xib +++ b/macosx/nl.lproj/Creator.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -64,15 +65,13 @@ - + - + - - @@ -104,12 +103,9 @@ - + - - - - + @@ -311,13 +311,9 @@ Gw - - - - diff --git a/macosx/pt_PT.lproj/Creator.xib b/macosx/pt_PT.lproj/Creator.xib index 17d478115d2..8cb7d566674 100644 --- a/macosx/pt_PT.lproj/Creator.xib +++ b/macosx/pt_PT.lproj/Creator.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -64,15 +65,13 @@ - + - - @@ -104,12 +103,9 @@ - + - - - - + @@ -311,13 +311,9 @@ Gw - - - - diff --git a/macosx/ru.lproj/Creator.xib b/macosx/ru.lproj/Creator.xib index bf9804f23fc..bf48bb77c7e 100644 --- a/macosx/ru.lproj/Creator.xib +++ b/macosx/ru.lproj/Creator.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -64,15 +65,13 @@ - + - - @@ -104,12 +103,9 @@ - + - - - - + @@ -311,13 +311,9 @@ Gw - - - - diff --git a/macosx/tr.lproj/Creator.xib b/macosx/tr.lproj/Creator.xib index 5964cb3d367..98a45989172 100644 --- a/macosx/tr.lproj/Creator.xib +++ b/macosx/tr.lproj/Creator.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -64,15 +65,13 @@ - + - - @@ -104,12 +103,9 @@ - + - - -