mirror of
https://github.com/chylex/Nextcloud-Desktop.git
synced 2026-04-06 16:34:18 +02:00
Compare commits
327 Commits
v1.7.0-alp
...
v1.7.0beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d8900dc19 | ||
|
|
171fd22d91 | ||
|
|
78d50f4033 | ||
|
|
fee18dd457 | ||
|
|
81d3ce8257 | ||
|
|
5213970c3d | ||
|
|
bcc06af904 | ||
|
|
a98242a2b8 | ||
|
|
5f715ca063 | ||
|
|
0ceeff62d6 | ||
|
|
f53a7c0e4a | ||
|
|
41b07d045a | ||
|
|
0d303f1d1f | ||
|
|
3e982ad34c | ||
|
|
dafd9c308f | ||
|
|
7f836cc01b | ||
|
|
147fa60f81 | ||
|
|
a1b9405e2e | ||
|
|
db02d44c6a | ||
|
|
dff1f77dfa | ||
|
|
1a2fff8ed8 | ||
|
|
52c12b33c3 | ||
|
|
29987ca2aa | ||
|
|
02f971b534 | ||
|
|
479b340d75 | ||
|
|
06c48f58cc | ||
|
|
0ee81a2865 | ||
|
|
e78c251832 | ||
|
|
efbc495f79 | ||
|
|
f8b73eb9d9 | ||
|
|
f25a590af5 | ||
|
|
0539098371 | ||
|
|
788c27bf2f | ||
|
|
a587148c73 | ||
|
|
9acd3a58ee | ||
|
|
449f5adaba | ||
|
|
2380b7af3d | ||
|
|
10989d13e4 | ||
|
|
fe1653ede6 | ||
|
|
b4071cec01 | ||
|
|
b1c842373d | ||
|
|
a3d70b3cf6 | ||
|
|
70912c44de | ||
|
|
98d9f7924d | ||
|
|
172295289e | ||
|
|
8ba08d7e87 | ||
|
|
8915f94931 | ||
|
|
31bf844452 | ||
|
|
0c8b74a025 | ||
|
|
dad8c1c27c | ||
|
|
2e12acdf32 | ||
|
|
d6156dd755 | ||
|
|
2c67a7ca71 | ||
|
|
688b8dcc38 | ||
|
|
280edee1db | ||
|
|
b9ea72f189 | ||
|
|
8f8265b219 | ||
|
|
00ae3c3120 | ||
|
|
1e49f152be | ||
|
|
f72ca4d83e | ||
|
|
5b10a9f3a7 | ||
|
|
d0fb1acebb | ||
|
|
09be4d22ee | ||
|
|
11a64320f0 | ||
|
|
4eac66b84a | ||
|
|
497b7808b6 | ||
|
|
b10c2b5946 | ||
|
|
fa881ba1c7 | ||
|
|
eb1b17e8e4 | ||
|
|
2eec85a97c | ||
|
|
c85b6193d5 | ||
|
|
fc36e7eccf | ||
|
|
0cc2bbf5d9 | ||
|
|
d2669debb9 | ||
|
|
637fb449c6 | ||
|
|
e82b319ee7 | ||
|
|
e9248066df | ||
|
|
819472d366 | ||
|
|
21bbdd6f49 | ||
|
|
a88ac00115 | ||
|
|
30683b38a8 | ||
|
|
45aefeb146 | ||
|
|
580ecbff0c | ||
|
|
db3318886e | ||
|
|
54eb837950 | ||
|
|
0bd73788f4 | ||
|
|
e395282e0e | ||
|
|
1f129d0bcb | ||
|
|
c2ae5e5fd1 | ||
|
|
292a7357bd | ||
|
|
99aa2cdf2a | ||
|
|
0eb9401c62 | ||
|
|
ab14a589c8 | ||
|
|
122fa596b3 | ||
|
|
5406407ed6 | ||
|
|
b72cee2783 | ||
|
|
fe023e2229 | ||
|
|
1dae928a7c | ||
|
|
9b1779bb06 | ||
|
|
97cc05eeea | ||
|
|
20dd3b0a69 | ||
|
|
f348eabf19 | ||
|
|
5870a57002 | ||
|
|
278bc5a8cd | ||
|
|
3c89415df1 | ||
|
|
5981f700f5 | ||
|
|
af5e8ee18c | ||
|
|
52e8343f76 | ||
|
|
a4dbf5942c | ||
|
|
ada1d42ebf | ||
|
|
f27182ae05 | ||
|
|
2fddf05515 | ||
|
|
91d1864840 | ||
|
|
79052ba7c6 | ||
|
|
0edd4d3c02 | ||
|
|
71516c480d | ||
|
|
1304c2c4ab | ||
|
|
a84b7dc27e | ||
|
|
927af0adec | ||
|
|
2dfbc2058f | ||
|
|
79ee6c2f3b | ||
|
|
f59a6862ca | ||
|
|
fa962b7f53 | ||
|
|
71408bab60 | ||
|
|
9e015eb654 | ||
|
|
4ce03e8b61 | ||
|
|
68b7f412b6 | ||
|
|
20011f3a84 | ||
|
|
2d020b5989 | ||
|
|
1909b465dc | ||
|
|
88b7f2e0ee | ||
|
|
531d586460 | ||
|
|
2630a73a1c | ||
|
|
4decd15ca9 | ||
|
|
3a59dd24f3 | ||
|
|
1cf1f6edcb | ||
|
|
5d36a27893 | ||
|
|
da94533647 | ||
|
|
db08d5021e | ||
|
|
69066013c1 | ||
|
|
aef569ee9d | ||
|
|
cf881aa6dc | ||
|
|
a48bf3142c | ||
|
|
33d9f4b882 | ||
|
|
49c40a4b11 | ||
|
|
d1eff0ae24 | ||
|
|
c0131695c5 | ||
|
|
fcbadda40f | ||
|
|
2455faa6fe | ||
|
|
7da8a5e374 | ||
|
|
b3950165c4 | ||
|
|
b8ab859c59 | ||
|
|
99a3cb0eab | ||
|
|
0be4b59cff | ||
|
|
ddfc7c75df | ||
|
|
7618f29657 | ||
|
|
291231c561 | ||
|
|
68792ee9db | ||
|
|
7ce2a93c63 | ||
|
|
4d33773cef | ||
|
|
5d19426930 | ||
|
|
1b51a10b19 | ||
|
|
aab870af32 | ||
|
|
7c70ada423 | ||
|
|
12e2bac16b | ||
|
|
34a27c748a | ||
|
|
a73fbccf8c | ||
|
|
7f1d707d23 | ||
|
|
f1fb36bcb8 | ||
|
|
25c274a0bd | ||
|
|
d4bbd28757 | ||
|
|
98b7248df0 | ||
|
|
0fb0f2c204 | ||
|
|
79d13d9242 | ||
|
|
b6f42a91f4 | ||
|
|
cc5f5cf3a6 | ||
|
|
79f00c2a2a | ||
|
|
e5068e7543 | ||
|
|
858218ac34 | ||
|
|
d69049ce10 | ||
|
|
59a9cc7c12 | ||
|
|
2f34b046d0 | ||
|
|
a73316306d | ||
|
|
928652e4cf | ||
|
|
7950b49cb1 | ||
|
|
f8b1b243c1 | ||
|
|
cc6aa66ab0 | ||
|
|
ea381392a7 | ||
|
|
bb7f63dcfd | ||
|
|
253d65727b | ||
|
|
61138b58bf | ||
|
|
5490063b7e | ||
|
|
d2e1489fe7 | ||
|
|
eb898646bc | ||
|
|
79b547b83b | ||
|
|
2356601bb3 | ||
|
|
9b88c7d3c1 | ||
|
|
302499b483 | ||
|
|
03dc27a327 | ||
|
|
9291ace558 | ||
|
|
15c11ea172 | ||
|
|
cd6950d984 | ||
|
|
de96350bee | ||
|
|
a9f1e165b5 | ||
|
|
c60b433c42 | ||
|
|
933c7e36d1 | ||
|
|
6025b3a91b | ||
|
|
c473428be6 | ||
|
|
e06e5fe55f | ||
|
|
dc8f437b31 | ||
|
|
2219d409a4 | ||
|
|
aabcf80774 | ||
|
|
1cf956ec21 | ||
|
|
315c2eb4ca | ||
|
|
54e2b9345b | ||
|
|
9743fee8f9 | ||
|
|
696f801df0 | ||
|
|
fef0d0b31c | ||
|
|
75101a0319 | ||
|
|
d1a660ce20 | ||
|
|
4356005c5a | ||
|
|
86a00eee3f | ||
|
|
ccf532672b | ||
|
|
6b52e9db34 | ||
|
|
8fdee79505 | ||
|
|
d9de6e68ad | ||
|
|
988fe70771 | ||
|
|
132fac86d7 | ||
|
|
d02175210b | ||
|
|
1dd3d080b8 | ||
|
|
d171431ac7 | ||
|
|
76e0d61b19 | ||
|
|
cc6d83a953 | ||
|
|
617887a0c6 | ||
|
|
e4fe4cb4d3 | ||
|
|
dc0a054d94 | ||
|
|
924d9b985f | ||
|
|
bb3bd6930a | ||
|
|
1245ed6f06 | ||
|
|
01b0ee49de | ||
|
|
2436ef9574 | ||
|
|
94f3a1ab1f | ||
|
|
9c98883bea | ||
|
|
2fb19e25b5 | ||
|
|
6fbbe2d0e4 | ||
|
|
c291eb3db4 | ||
|
|
7f38ce8908 | ||
|
|
1781400340 | ||
|
|
3760f14da8 | ||
|
|
dc18366111 | ||
|
|
936252765a | ||
|
|
b62b87eed3 | ||
|
|
4b716f3ea6 | ||
|
|
ddbe181e48 | ||
|
|
27f9d4523b | ||
|
|
8a7cfbd8de | ||
|
|
463a9a5485 | ||
|
|
ee7fe4a38a | ||
|
|
dccb9def3a | ||
|
|
5c5d57a996 | ||
|
|
de2ce5a0a2 | ||
|
|
7b114e2cae | ||
|
|
25d519fed3 | ||
|
|
8d819956d3 | ||
|
|
4aec783362 | ||
|
|
b494181764 | ||
|
|
9575271fcd | ||
|
|
b6eda9076e | ||
|
|
88072a985a | ||
|
|
c27f151451 | ||
|
|
64a7025522 | ||
|
|
ce2741cebc | ||
|
|
b40b670639 | ||
|
|
3d6b622879 | ||
|
|
4c67a8812a | ||
|
|
4c4d02c0d0 | ||
|
|
c1831f4946 | ||
|
|
4b2c1bacd1 | ||
|
|
3909102436 | ||
|
|
78e50747e4 | ||
|
|
b09498d852 | ||
|
|
7fcf723039 | ||
|
|
d27ab8c6ca | ||
|
|
0350508b65 | ||
|
|
32739cc305 | ||
|
|
f515fe77c4 | ||
|
|
f6d20cbe55 | ||
|
|
8bc0d9acd3 | ||
|
|
73325bcd41 | ||
|
|
1b5bbfdad3 | ||
|
|
fcd211b190 | ||
|
|
55b3eb467f | ||
|
|
192c23bfce | ||
|
|
72e0418e4c | ||
|
|
1544606bf0 | ||
|
|
255330d342 | ||
|
|
ad139e19ab | ||
|
|
4c0891a22e | ||
|
|
8e6e51f9a6 | ||
|
|
faa502163e | ||
|
|
4ff0e7e0a2 | ||
|
|
12459bf07e | ||
|
|
b25ef28e82 | ||
|
|
ef6c82ba00 | ||
|
|
7e009667a2 | ||
|
|
1f1eb933d1 | ||
|
|
aa85e875bd | ||
|
|
1b4c613fa6 | ||
|
|
57ef515def | ||
|
|
59643177af | ||
|
|
e2d5ae1035 | ||
|
|
cd9f2e5ea5 | ||
|
|
753aa9132e | ||
|
|
cfdfd6a860 | ||
|
|
0c9d57228d | ||
|
|
5254c9785c | ||
|
|
0f37484b8a | ||
|
|
e17243bc1f | ||
|
|
0e45dd7a3d | ||
|
|
65f313f1b4 | ||
|
|
da4958c716 | ||
|
|
653b8494f5 | ||
|
|
6ed6f84f6e | ||
|
|
ff0ba56bc3 | ||
|
|
e795d04f30 | ||
|
|
8d3806b080 | ||
|
|
5597ebe455 |
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -2,4 +2,4 @@
|
||||
.gitignore export-ignore
|
||||
.gitattributes export-ignore
|
||||
.commit-template export-ignore
|
||||
/binary export-ignore
|
||||
binary/ export-ignore
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -79,7 +79,7 @@ dlldata.c
|
||||
*.scc
|
||||
|
||||
# Mac OS X specific
|
||||
shell_integration/MacOSX/LiferayNativity.xcworkspace/xcuserdata/
|
||||
shell_integration/MacOSX/*.xcworkspace/xcuserdata/
|
||||
**/.DS_Store
|
||||
|
||||
# Visual C++ cache files
|
||||
|
||||
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -3,7 +3,7 @@
|
||||
url = https://github.com/owncloud/documentation
|
||||
[submodule "src/3rdparty/qtmacgoodies"]
|
||||
path = src/3rdparty/qtmacgoodies
|
||||
url = git://github.com/shadone/qtmacgoodies.git
|
||||
url = git://github.com/guruz/qtmacgoodies.git
|
||||
[submodule "binary"]
|
||||
path = binary
|
||||
url = git://github.com/owncloud/owncloud-client-binary.git
|
||||
|
||||
@@ -128,6 +128,11 @@ configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
|
||||
configure_file(test/test_journal.db "${CMAKE_BINARY_DIR}/test/test_journal.db" COPYONLY)
|
||||
|
||||
# Copy that logo, the installer uses it later
|
||||
if(BUILD_OWNCLOUD_OSX_BUNDLE)
|
||||
install(FILES resources/owncloud_logo_blue.png DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/)
|
||||
endif()
|
||||
|
||||
include(OwnCloudCPack.cmake)
|
||||
|
||||
add_definitions(-DUNICODE)
|
||||
@@ -144,6 +149,7 @@ add_subdirectory(csync)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(shell_integration)
|
||||
add_subdirectory(doc)
|
||||
add_subdirectory(admin)
|
||||
|
||||
if(UNIT_TESTING)
|
||||
include(CTest)
|
||||
@@ -155,4 +161,5 @@ if(BUILD_OWNCLOUD_OSX_BUNDLE)
|
||||
configure_file(sync-exclude.lst ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/sync-exclude.lst COPYONLY)
|
||||
else()
|
||||
install( FILES sync-exclude.lst DESTINATION ${SYSCONFDIR}/${APPLICATION_SHORTNAME} )
|
||||
configure_file(sync-exclude.lst bin/sync-exclude.lst COPYONLY)
|
||||
endif()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
ChangeLog
|
||||
=========
|
||||
version 1.6.2 (release 2014-07-x )
|
||||
version 1.6.2 (release 2014-07-28 )
|
||||
* Limit the HTTP buffer size when downloading to limit memory consumption.
|
||||
* Another small mem leak fixed in HTTP Credentials.
|
||||
* Fix local file name clash detection for MacOSX.
|
||||
* Limit maximum wait time to ten seconds in network limiting.
|
||||
|
||||
@@ -4,7 +4,7 @@ set( MIRALL_VERSION_PATCH 0 )
|
||||
set( MIRALL_SOVERSION 0 )
|
||||
|
||||
if ( NOT DEFINED MIRALL_VERSION_SUFFIX )
|
||||
set( MIRALL_VERSION_SUFFIX "alpha1") #e.g. beta1, beta2, rc1
|
||||
set( MIRALL_VERSION_SUFFIX "beta2") #e.g. beta1, beta2, rc1
|
||||
endif( NOT DEFINED MIRALL_VERSION_SUFFIX )
|
||||
|
||||
if( NOT DEFINED MIRALL_VERSION_BUILD )
|
||||
|
||||
2
admin/CMakeLists.txt
Normal file
2
admin/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
# traverse into osx subdirectory to install and patch the create-pack script
|
||||
add_subdirectory(osx)
|
||||
3
admin/osx/CMakeLists.txt
Normal file
3
admin/osx/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
configure_file(create_mac_pkg.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/create_mac.sh)
|
||||
configure_file(macosx.pkgproj ${CMAKE_CURRENT_BINARY_DIR}/macosx.pkgproj)
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script to create the Mac installer using the packages tool from
|
||||
# http://s.sudre.free.fr/Software/Packages/about.html
|
||||
#
|
||||
|
||||
# the path of installation must be given as parameter
|
||||
if [ -z "$1" ]; then
|
||||
echo "ERROR: Provide the CMAKE_INSTALL_DIR to this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
prjfile="admin/osx/macosx.pkgproj"
|
||||
if [ ! -f $prjfile ]; then
|
||||
echo "ERROR: macosx.pkgproj not in admin dir, start from CMAKE_SOURCE_DIR!"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
pack="admin/ownCloud Installer.pkg"
|
||||
rm -f $pack
|
||||
|
||||
install_path=$1
|
||||
|
||||
# The name of the installer package
|
||||
installer=ownCloud\ Installer.pkg
|
||||
|
||||
# The command line tool of the "Packages" tool, see link above.
|
||||
pkgbuild=/usr/local/bin/packagesbuild
|
||||
|
||||
$pkgbuild -F $install_path $prjfile
|
||||
rc=$?
|
||||
|
||||
if [ $rc == 0 ]; then
|
||||
echo "Successfully created $pack"
|
||||
else
|
||||
echo "Failed to create $pack"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# FIXME: Sign the finished package.
|
||||
# See http://s.sudre.free.fr/Software/documentation/Packages/en/Project_Configuration.html#5
|
||||
# certname=gdbsign
|
||||
# productsign --cert $certname admin/$installer ./$installer
|
||||
|
||||
|
||||
74
admin/osx/create_mac_pkg.sh.cmake
Executable file
74
admin/osx/create_mac_pkg.sh.cmake
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script to create the Mac installer using the packages tool from
|
||||
# http://s.sudre.free.fr/Software/Packages/about.html
|
||||
#
|
||||
|
||||
[ "$#" -lt 2 ] && echo "Usage: create_mac_pkg.sh <CMAKE_INSTALL_DIR> <build dir> <installer sign identity>" && exit
|
||||
|
||||
# the path of installation must be given as parameter
|
||||
if [ -z "$1" ]; then
|
||||
echo "ERROR: Provide the path to CMAKE_INSTALL_DIR to this script as first parameter."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$2" ]; then
|
||||
echo "ERROR: Provide the path to build directory as second parameter."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
install_path="$1"
|
||||
build_path="$2"
|
||||
identity="$3"
|
||||
prjfile=$build_path/admin/osx/macosx.pkgproj
|
||||
|
||||
# The name of the installer package
|
||||
installer="@APPLICATION_NAME@-@MIRALL_VERSION_FULL@@MIRALL_VERSION_SUFFIX@"
|
||||
installer_file="$installer.pkg"
|
||||
installer_file_tar="$installer.pkg.tar"
|
||||
installer_file_tar_bz2="$installer.pkg.tar.bz2"
|
||||
installer_file_tbz="$installer.pkg.tbz"
|
||||
|
||||
# set the installer name to the copied prj config file
|
||||
/usr/local/bin/packagesutil --file $prjfile set project name "$installer"
|
||||
|
||||
# The command line tool of the "Packages" tool, see link above.
|
||||
pkgbuild=/usr/local/bin/packagesbuild
|
||||
|
||||
$pkgbuild -F $install_path $prjfile
|
||||
rc=$?
|
||||
|
||||
if [ $rc == 0 ]; then
|
||||
echo "Successfully created $installer_file"
|
||||
else
|
||||
echo "Failed to create $installer_file"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# Sign the finished package if desired.
|
||||
if [ ! -z "$identity" ]; then
|
||||
echo "Will try to sign the installer"
|
||||
pushd $install_path
|
||||
productsign --sign "$identity" "$installer_file" "$installer_file.new"
|
||||
mv "$installer_file".new $installer_file
|
||||
popd
|
||||
else
|
||||
echo "No certificate given, will not sign the pkg"
|
||||
fi
|
||||
|
||||
# FIXME: OEMs?
|
||||
# they will need to do their own signing..
|
||||
|
||||
|
||||
# Sparkle wants a tbz, it cannot install raw pkg
|
||||
cd $install_path
|
||||
tar cf "$installer_file_tar" "$installer_file"
|
||||
bzip2 -9 "$installer_file_tar"
|
||||
mv "$installer_file_tar_bz2" "$installer_file_tbz"
|
||||
rc=$?
|
||||
if [ $rc == 0 ]; then
|
||||
echo "Successfully created $installer_file"
|
||||
else
|
||||
echo "Failed to create $installer_file"
|
||||
exit 3
|
||||
fi
|
||||
330
admin/osx/macdeployqt.py
Executable file
330
admin/osx/macdeployqt.py
Executable file
@@ -0,0 +1,330 @@
|
||||
#!/usr/bin/python
|
||||
# This file is part of ownCloud.
|
||||
# It was inspired in large part by the macdeploy script in Clementine
|
||||
# and Tomahawk
|
||||
#
|
||||
# ownCloud is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# ownCLoud is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with ownCloud. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import commands
|
||||
import sys
|
||||
from glob import glob
|
||||
|
||||
def QueryQMake(attrib):
|
||||
return subprocess.check_output(['qmake', '-query', attrib]).rstrip('\n')
|
||||
|
||||
FRAMEWORK_SEARCH_PATH=[
|
||||
'/Library/Frameworks',
|
||||
os.path.join(os.environ['HOME'], 'Library/Frameworks')
|
||||
]
|
||||
|
||||
LIBRARY_SEARCH_PATH=['/usr/local/lib', '.']
|
||||
|
||||
QT_PLUGINS = [
|
||||
'accessible/libqtaccessiblewidgets.dylib',
|
||||
'sqldrivers/libqsqlite.dylib',
|
||||
'platforms/libqcocoa.dylib',
|
||||
'imageformats/libqgif.dylib',
|
||||
'imageformats/libqico.dylib',
|
||||
'imageformats/libqjpeg.dylib',
|
||||
'imageformats/libqsvg.dylib',
|
||||
'imageformats/libqmng.dylib',
|
||||
]
|
||||
|
||||
QT_PLUGINS_SEARCH_PATH=[
|
||||
# os.path.join(os.environ['QTDIR'], 'plugins'),
|
||||
'/usr/local/Cellar/qt/5.2.1/plugins',
|
||||
]
|
||||
|
||||
|
||||
class Error(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class CouldNotFindQtPluginErrorFindFrameworkError(Error):
|
||||
pass
|
||||
|
||||
|
||||
class InstallNameToolError(Error):
|
||||
pass
|
||||
|
||||
|
||||
class CouldNotFindQtPluginError(Error):
|
||||
pass
|
||||
|
||||
|
||||
class CouldNotFindScriptPluginError(Error):
|
||||
pass
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print 'Usage: %s <bundle.app>' % sys.argv[0]
|
||||
exit()
|
||||
|
||||
def is_exe(fpath):
|
||||
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
|
||||
|
||||
bundle_dir = sys.argv[1]
|
||||
|
||||
bundle_name = os.path.basename(bundle_dir).split('.')[0]
|
||||
|
||||
commands = []
|
||||
|
||||
binary_dir = os.path.join(bundle_dir, 'Contents', 'MacOS')
|
||||
frameworks_dir = os.path.join(bundle_dir, 'Contents', 'Frameworks')
|
||||
commands.append(['mkdir', '-p', frameworks_dir])
|
||||
resources_dir = os.path.join(bundle_dir, 'Contents', 'Resources')
|
||||
commands.append(['mkdir', '-p', resources_dir])
|
||||
plugins_dir = os.path.join(bundle_dir, 'Contents', 'PlugIns')
|
||||
binaries = [i for i in glob(os.path.join(bundle_dir, 'Contents', 'MacOS', "*")) if is_exe(i)];
|
||||
|
||||
|
||||
fixed_libraries = []
|
||||
fixed_frameworks = []
|
||||
|
||||
def WriteQtConf():
|
||||
print "Writing qt.conf..."
|
||||
with open(os.path.join(resources_dir, 'qt.conf'), 'w') as f:
|
||||
f.write("[Paths]\nPlugins = PlugIns\n");
|
||||
f.close()
|
||||
|
||||
def GetBrokenLibraries(binary):
|
||||
#print "Checking libs for binary: %s" % binary
|
||||
output = subprocess.Popen(['otool', '-L', binary], stdout=subprocess.PIPE).communicate()[0]
|
||||
broken_libs = {
|
||||
'frameworks': [],
|
||||
'libs': []}
|
||||
for line in [x.split(' ')[0].lstrip() for x in output.split('\n')[1:]]:
|
||||
#print "Checking line: %s" % line
|
||||
if not line: # skip empty lines
|
||||
continue
|
||||
if os.path.basename(binary) == os.path.basename(line):
|
||||
#print "mnope %s-%s" % (os.path.basename(binary), os.path.basename(line))
|
||||
continue
|
||||
if re.match(r'^\s*/System/', line):
|
||||
continue # System framework
|
||||
elif re.match(r'^\s*/usr/lib/', line):
|
||||
#print "unix style system lib"
|
||||
continue # unix style system library
|
||||
elif re.match(r'Breakpad', line):
|
||||
continue # Manually added by cmake.
|
||||
elif re.match(r'^\s*@executable_path', line) or re.match(r'^\s*@loader_path', line):
|
||||
# Potentially already fixed library
|
||||
if '.framework' in line:
|
||||
relative_path = os.path.join(*line.split('/')[3:])
|
||||
if not os.path.exists(os.path.join(frameworks_dir, relative_path)):
|
||||
broken_libs['frameworks'].append(relative_path)
|
||||
else:
|
||||
relative_path = os.path.join(*line.split('/')[1:])
|
||||
#print "RELPATH %s %s" % (relative_path, os.path.join(binary_dir, relative_path))
|
||||
if not os.path.exists(os.path.join(binary_dir, relative_path)):
|
||||
broken_libs['libs'].append(relative_path)
|
||||
elif re.search(r'\w+\.framework', line):
|
||||
broken_libs['frameworks'].append(line)
|
||||
else:
|
||||
broken_libs['libs'].append(line)
|
||||
|
||||
return broken_libs
|
||||
|
||||
def FindFramework(path):
|
||||
search_pathes = FRAMEWORK_SEARCH_PATH
|
||||
search_pathes.insert(0, QueryQMake('QT_INSTALL_LIBS'))
|
||||
for search_path in search_pathes:
|
||||
abs_path = os.path.join(search_path, path)
|
||||
if os.path.exists(abs_path):
|
||||
return abs_path
|
||||
|
||||
raise CouldNotFindFrameworkError(path)
|
||||
|
||||
def FindLibrary(path):
|
||||
if os.path.exists(path):
|
||||
return path
|
||||
search_pathes = LIBRARY_SEARCH_PATH
|
||||
search_pathes.insert(0, QueryQMake('QT_INSTALL_LIBS'))
|
||||
for search_path in search_pathes:
|
||||
abs_path = os.path.join(search_path, path)
|
||||
if os.path.exists(abs_path):
|
||||
return abs_path
|
||||
else: # try harder---look for lib name in library folders
|
||||
newpath = os.path.join(search_path,os.path.basename(path))
|
||||
if os.path.exists(newpath):
|
||||
return newpath
|
||||
|
||||
return ""
|
||||
#raise CouldNotFindFrameworkError(path)
|
||||
|
||||
def FixAllLibraries(broken_libs):
|
||||
for framework in broken_libs['frameworks']:
|
||||
FixFramework(framework)
|
||||
for lib in broken_libs['libs']:
|
||||
FixLibrary(lib)
|
||||
|
||||
def FixFramework(path):
|
||||
if path in fixed_libraries:
|
||||
return
|
||||
else:
|
||||
fixed_libraries.append(path)
|
||||
abs_path = FindFramework(path)
|
||||
broken_libs = GetBrokenLibraries(abs_path)
|
||||
FixAllLibraries(broken_libs)
|
||||
|
||||
new_path = CopyFramework(abs_path)
|
||||
id = os.sep.join(new_path.split(os.sep)[3:])
|
||||
FixFrameworkId(new_path, id)
|
||||
for framework in broken_libs['frameworks']:
|
||||
FixFrameworkInstallPath(framework, new_path)
|
||||
for library in broken_libs['libs']:
|
||||
FixLibraryInstallPath(library, new_path)
|
||||
|
||||
def FixLibrary(path):
|
||||
if path in fixed_libraries or FindSystemLibrary(os.path.basename(path)) is not None:
|
||||
return
|
||||
else:
|
||||
fixed_libraries.append(path)
|
||||
abs_path = FindLibrary(path)
|
||||
if abs_path == "":
|
||||
print "Could not resolve %s, not fixing!" % path
|
||||
return
|
||||
broken_libs = GetBrokenLibraries(abs_path)
|
||||
FixAllLibraries(broken_libs)
|
||||
|
||||
new_path = CopyLibrary(abs_path)
|
||||
FixLibraryId(new_path)
|
||||
for framework in broken_libs['frameworks']:
|
||||
FixFrameworkInstallPath(framework, new_path)
|
||||
for library in broken_libs['libs']:
|
||||
FixLibraryInstallPath(library, new_path)
|
||||
|
||||
def FixPlugin(abs_path, subdir):
|
||||
broken_libs = GetBrokenLibraries(abs_path)
|
||||
FixAllLibraries(broken_libs)
|
||||
|
||||
new_path = CopyPlugin(abs_path, subdir)
|
||||
for framework in broken_libs['frameworks']:
|
||||
FixFrameworkInstallPath(framework, new_path)
|
||||
for library in broken_libs['libs']:
|
||||
FixLibraryInstallPath(library, new_path)
|
||||
|
||||
def FixBinary(path):
|
||||
broken_libs = GetBrokenLibraries(path)
|
||||
FixAllLibraries(broken_libs)
|
||||
for framework in broken_libs['frameworks']:
|
||||
FixFrameworkInstallPath(framework, path)
|
||||
for library in broken_libs['libs']:
|
||||
FixLibraryInstallPath(library, path)
|
||||
|
||||
def CopyLibrary(path):
|
||||
new_path = os.path.join(binary_dir, os.path.basename(path))
|
||||
args = ['ditto', '--arch=x86_64', path, new_path]
|
||||
commands.append(args)
|
||||
args = ['chmod', 'u+w', new_path]
|
||||
commands.append(args)
|
||||
return new_path
|
||||
|
||||
def CopyPlugin(path, subdir):
|
||||
new_path = os.path.join(plugins_dir, subdir, os.path.basename(path))
|
||||
args = ['mkdir', '-p', os.path.dirname(new_path)]
|
||||
commands.append(args)
|
||||
args = ['ditto', '--arch=x86_64', path, new_path]
|
||||
commands.append(args)
|
||||
args = ['chmod', 'u+w', new_path]
|
||||
commands.append(args)
|
||||
return new_path
|
||||
|
||||
def CopyFramework(path):
|
||||
parts = path.split(os.sep)
|
||||
print "CopyFramework:", path
|
||||
for i, part in enumerate(parts):
|
||||
if re.match(r'\w+\.framework', part):
|
||||
full_path = os.path.join(frameworks_dir, *parts[i:-1])
|
||||
break
|
||||
args = ['mkdir', '-p', full_path]
|
||||
commands.append(args)
|
||||
args = ['ditto', '--arch=x86_64', path, full_path]
|
||||
commands.append(args)
|
||||
args = ['chmod', 'u+w', os.path.join(full_path, parts[-1])]
|
||||
commands.append(args)
|
||||
|
||||
info_plist = os.path.join(os.path.split(path)[0], '..', '..', 'Contents', 'Info.plist')
|
||||
if os.path.exists(info_plist):
|
||||
args = ['cp', '-r', info_plist, resources_dir]
|
||||
commands.append(args)
|
||||
|
||||
return os.path.join(full_path, parts[-1])
|
||||
|
||||
def FixId(path, library_name):
|
||||
id = '@executable_path/../Frameworks/%s' % library_name
|
||||
args = ['install_name_tool', '-id', id, path]
|
||||
commands.append(args)
|
||||
|
||||
def FixLibraryId(path):
|
||||
library_name = os.path.basename(path)
|
||||
FixId(path, library_name)
|
||||
|
||||
def FixFrameworkId(path, id):
|
||||
FixId(path, id)
|
||||
|
||||
def FixInstallPath(library_path, library, new_path):
|
||||
args = ['install_name_tool', '-change', library_path, new_path, library]
|
||||
commands.append(args)
|
||||
|
||||
def FindSystemLibrary(library_name):
|
||||
for path in ['/lib', '/usr/lib']:
|
||||
full_path = os.path.join(path, library_name)
|
||||
if os.path.exists(full_path):
|
||||
return full_path
|
||||
return None
|
||||
|
||||
def FixLibraryInstallPath(library_path, library):
|
||||
system_library = FindSystemLibrary(os.path.basename(library_path))
|
||||
if system_library is None:
|
||||
new_path = '@executable_path/../MacOS/%s' % os.path.basename(library_path)
|
||||
FixInstallPath(library_path, library, new_path)
|
||||
else:
|
||||
FixInstallPath(library_path, library, system_library)
|
||||
|
||||
def FixFrameworkInstallPath(library_path, library):
|
||||
parts = library_path.split(os.sep)
|
||||
for i, part in enumerate(parts):
|
||||
if re.match(r'\w+\.framework', part):
|
||||
full_path = os.path.join(*parts[i:])
|
||||
break
|
||||
new_path = '@executable_path/../Frameworks/%s' % full_path
|
||||
FixInstallPath(library_path, library, new_path)
|
||||
|
||||
def FindQtPlugin(name):
|
||||
search_path = QT_PLUGINS_SEARCH_PATH
|
||||
search_path.insert(0, QueryQMake('QT_INSTALL_PLUGINS'))
|
||||
for path in search_path:
|
||||
if os.path.exists(path):
|
||||
if os.path.exists(os.path.join(path, name)):
|
||||
return os.path.join(path, name)
|
||||
raise CouldNotFindQtPluginError(name)
|
||||
|
||||
for binary in binaries:
|
||||
FixBinary(binary)
|
||||
|
||||
for plugin in QT_PLUGINS:
|
||||
FixPlugin(FindQtPlugin(plugin), os.path.dirname(plugin))
|
||||
|
||||
if len(sys.argv) <= 2:
|
||||
print 'Will run %d commands:' % len(commands)
|
||||
for command in commands:
|
||||
print ' '.join(command)
|
||||
|
||||
for command in commands:
|
||||
p = subprocess.Popen(command)
|
||||
os.waitpid(p.pid, 0)
|
||||
|
||||
WriteQtConf()
|
||||
@@ -22,7 +22,7 @@
|
||||
<key>GID</key>
|
||||
<integer>80</integer>
|
||||
<key>PATH</key>
|
||||
<string>owncloud.app</string>
|
||||
<string>@APPLICATION_EXECUTABLE@.app</string>
|
||||
<key>PATH_TYPE</key>
|
||||
<integer>3</integer>
|
||||
<key>PERMISSIONS</key>
|
||||
@@ -793,7 +793,7 @@
|
||||
<key>GID</key>
|
||||
<integer>0</integer>
|
||||
<key>PATH</key>
|
||||
<string>Library/ScriptingAdditions/LiferayNativity.osax/Contents</string>
|
||||
<string>Library/ScriptingAdditions/OwnCloudFinder.osax/Contents</string>
|
||||
<key>PATH_TYPE</key>
|
||||
<integer>3</integer>
|
||||
<key>PERMISSIONS</key>
|
||||
@@ -807,7 +807,7 @@
|
||||
<key>GID</key>
|
||||
<integer>0</integer>
|
||||
<key>PATH</key>
|
||||
<string>LiferayNativity.osax</string>
|
||||
<string>OwnCloudFinder.osax</string>
|
||||
<key>PATH_TYPE</key>
|
||||
<integer>0</integer>
|
||||
<key>PERMISSIONS</key>
|
||||
@@ -1054,10 +1054,10 @@
|
||||
<integer>6</integer>
|
||||
<key>BACKGROUND_PATH</key>
|
||||
<dict>
|
||||
<key>PATH</key>
|
||||
<string>/Users/mackie/owncloud.com/mirall/resources/owncloud_logo_blue.png</string>
|
||||
<key>PATH_TYPE</key>
|
||||
<integer>0</integer>
|
||||
<key>PATH</key>
|
||||
<string>./@APPLICATION_EXECUTABLE@.app/Contents/Resources/owncloud_logo_blue.png</string>
|
||||
<key>PATH_TYPE</key>
|
||||
<integer>3</integer>
|
||||
</dict>
|
||||
<key>CUSTOM</key>
|
||||
<integer>1</integer>
|
||||
@@ -1240,9 +1240,9 @@
|
||||
<key>BUILD_PATH</key>
|
||||
<dict>
|
||||
<key>PATH</key>
|
||||
<string>/Users/mackie/owncloud.com/mirall/admin</string>
|
||||
<string>../install/.</string>
|
||||
<key>PATH_TYPE</key>
|
||||
<integer>0</integer>
|
||||
<integer>3</integer>
|
||||
</dict>
|
||||
<key>EXCLUDED_FILES</key>
|
||||
<array>
|
||||
|
||||
32
admin/osx/sign_app.sh
Executable file
32
admin/osx/sign_app.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh -x
|
||||
|
||||
[ "$#" -lt 2 ] && echo "Usage: sign_app.sh <app> <identity>" && exit
|
||||
|
||||
src_app="$1"
|
||||
identity="$2"
|
||||
|
||||
QT_FMWK_VERSION="5"
|
||||
|
||||
fix_frameworks() {
|
||||
TMP_APP=$1
|
||||
QT_FMWK_PATH=$2
|
||||
QT_FMWKS=$3/Qt*.framework
|
||||
|
||||
echo "Patching Qt frameworks..."
|
||||
for FMWK in $QT_FMWKS; do
|
||||
FMWK_NAME=`basename -s .framework $FMWK`
|
||||
FMWK=`basename $FMWK`
|
||||
FMWK_PATH="${TMP_APP}/Contents/Frameworks/${FMWK}"
|
||||
mkdir -p "${FMWK_PATH}/Versions/${QT_FMWK_VERSION}/Resources/"
|
||||
cp -avf "${QT_FMWK_PATH}/${FMWK}/Contents/Info.plist" "${FMWK_PATH}/Versions/${QT_FMWK_VERSION}/Resources"
|
||||
(cd "${FMWK_PATH}" && ln -sf "Versions/${QT_FMWK_VERSION}/Resources" "Resources")
|
||||
perl -pi -e "s/${FMWK_NAME}_debug/${FMWK_NAME}/" "${FMWK_PATH}/Resources/Info.plist"
|
||||
done
|
||||
}
|
||||
|
||||
fix_frameworks "$src_app" `qmake -query QT_INSTALL_LIBS` "$src_app"/Contents/Frameworks
|
||||
codesign -s "$identity" --force --verbose=4 --deep "$src_app"
|
||||
|
||||
# Just for our debug purposes:
|
||||
spctl -a -t exec -vv $src_app
|
||||
codesign -dv $src_app
|
||||
46
admin/win/nsi/l10n/Farsi.nsh
Normal file
46
admin/win/nsi/l10n/Farsi.nsh
Normal file
@@ -0,0 +1,46 @@
|
||||
# Auto-generated - do not modify
|
||||
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "نمایش پادداشت های انتشار نسخه"
|
||||
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "پردازش برای از بین بردن یافت نشد!"
|
||||
StrCpy $PageReinstall_NEW_Field_3 "حذف نکن"
|
||||
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "از قبل نصب شده است"
|
||||
StrCpy $PageReinstall_SAME_Field_2 "افزودن/نصب مجدد اجزا"
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "میانبر دسکتاپ"
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "ایجاد میانبر دسکتاپ"
|
||||
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "میانبر بازکردن سریع"
|
||||
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "بله، این پوشه داده را حذف کن."
|
||||
StrCpy $UNINSTALLER_FILE_Detail "نوشتن حذف کننده"
|
||||
StrCpy $UNINSTALLER_FINISHED_Detail "اتمام"
|
||||
StrCpy $INIT_INSTALLER_RUNNING "نصاب از قبل در حال اجراست."
|
||||
StrCpy $INIT_UNINSTALLER_RUNNING "حذف کننده از قبل در حال اجراست."
|
||||
StrCpy $SectionGroup_Shortcuts "میانبرها"
|
||||
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
|
||||
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Killing ${APPLICATION_EXECUTABLE} processes."
|
||||
StrCpy $PageReinstall_NEW_Field_1 "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
|
||||
StrCpy $PageReinstall_NEW_Field_2 "Uninstall before installing"
|
||||
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Choose how you want to install ${APPLICATION_NAME}."
|
||||
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
|
||||
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
|
||||
StrCpy $PageReinstall_SAME_Field_3 "Uninstall ${APPLICATION_NAME}"
|
||||
StrCpy $UNINSTALLER_APPDATA_TITLE "Uninstall ${APPLICATION_NAME}"
|
||||
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Choose the maintenance option to perform."
|
||||
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start Menu Program Shortcut"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
|
||||
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creating Quick Launch Shortcut"
|
||||
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} shortcut."
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Desktop shortcut for ${APPLICATION_NAME}."
|
||||
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Quick Launch shortcut for ${APPLICATION_NAME}."
|
||||
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remove ${APPLICATION_NAME}'s data folder from your computer."
|
||||
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Do you want to delete ${APPLICATION_NAME}'s data folder?"
|
||||
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
|
||||
StrCpy $UNINSTALLER_REGISTRY_Detail "Writing Installer Registry Keys"
|
||||
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
|
||||
StrCpy $UNINSTALL_ABORT "Uninstall aborted by user"
|
||||
StrCpy $INIT_NO_QUICK_LAUNCH "Quick Launch Shortcut (N/A)"
|
||||
StrCpy $INIT_NO_DESKTOP "Desktop Shortcut (overwrites existing)"
|
||||
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
|
||||
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "This installer requires admin access, try again"
|
||||
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "This uninstaller requires admin access, try again"
|
||||
@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "
|
||||
StrCpy $UNINSTALLER_APPDATA_TITLE "Απεγκατάσταση ${APPLICATION_NAME}"
|
||||
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Επιλέξτε την επιλογή συντήρησης που θα πραγματοποιηθεί."
|
||||
StrCpy $SEC_APPLICATION_DETAILS "Εγκατάσταση βάσης ${APPLICATION_NAME} σε εξέλιξη."
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Εικονίδια κατάστασης για την Εξερεύνηση των Windows"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Εγκατάσταση εικονιδίων κατάστασης στην Εξερεύνηση των Windows"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Συντόμευση στο Αρχικό Μενού"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Προσθήκη συντόμευσης για την ${APPLICATION_NAME} στο Αρχικό Μενού."
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Συντόμευση επιφάνειας εργασίας"
|
||||
@@ -42,5 +44,3 @@ StrCpy $INIT_INSTALLER_RUNNING "
|
||||
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Αυτή η εφαρμογή απεγκατάστασης απαιτεί πρόσβαση διαχειριστή, δοκιμάστε ξανά"
|
||||
StrCpy $INIT_UNINSTALLER_RUNNING "Η εφαρμογή απεγκατάστασης λειτουργεί ήδη."
|
||||
StrCpy $SectionGroup_Shortcuts "Συντομεύσεις"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"
|
||||
|
||||
@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Odinstaluj ${APPLICATION_NAME}"
|
||||
StrCpy $UNINSTALLER_APPDATA_TITLE "Odinstaluj ${APPLICATION_NAME}"
|
||||
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Wybierz sposób utrzymywania."
|
||||
StrCpy $SEC_APPLICATION_DETAILS "Instaluje niezbędne pliki ${APPLICATION_NAME}."
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Ikona statusu dla Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Instaluj ikonę statusu dla Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Skrót w Menu Start"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Dodaję skrót ${APPLICATION_NAME} w Menu Start."
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Skrót na Pulpicie"
|
||||
@@ -42,5 +44,3 @@ StrCpy $INIT_INSTALLER_RUNNING "Instalator już jest uruchomiony."
|
||||
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Ten dezinstalator potrzebuje uprawnień administratora, spróbuj ponownie"
|
||||
StrCpy $INIT_UNINSTALLER_RUNNING "Dezinstalator już jest uruchomiony."
|
||||
StrCpy $SectionGroup_Shortcuts "Skróty"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"
|
||||
|
||||
@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Удалить ${APPLICATION_NAME}"
|
||||
StrCpy $UNINSTALLER_APPDATA_TITLE "Удалить ${APPLICATION_NAME}"
|
||||
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Выберите опцию обслуживания для исполнения."
|
||||
StrCpy $SEC_APPLICATION_DETAILS "Установка зависимостей приложения ${APPLICATION_NAME}"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Значки статуса для проводника Windows"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Установка значков статуса для проводника Windows"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Ярлык в меню Пуск"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Добавление ярлыка ${APPLICATION_NAME} в меню Пуск"
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Ярлык на рабочем столе"
|
||||
@@ -42,5 +44,3 @@ StrCpy $INIT_INSTALLER_RUNNING "Установщик уже запущен."
|
||||
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Этот деинсталятор требует права администратора, попытайтесь ещё"
|
||||
StrCpy $INIT_UNINSTALLER_RUNNING "Программа удаления уже выполняется."
|
||||
StrCpy $SectionGroup_Shortcuts "Ярлыки"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"
|
||||
|
||||
@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Odin
|
||||
StrCpy $UNINSTALLER_APPDATA_TITLE "Odinštalova<EFBFBD> ${APPLICATION_NAME}"
|
||||
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Vyberte možnos<6F> vykona<6E> údržbu."
|
||||
StrCpy $SEC_APPLICATION_DETAILS "Inštalujú sa náležitosti ${APPLICATION_NAME}."
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Stavová ikona pre Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Inštalujem stavovú ikonu pre Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Zástupca programu v menu Štart"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Prida<EFBFBD> zástupcu pre ${APPLICATION_NAME} do menu Štart."
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Zástupca na ploche"
|
||||
@@ -42,5 +44,3 @@ StrCpy $INIT_INSTALLER_RUNNING "In
|
||||
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Tento odinštalátor vyžaduje admin prístup, skúste to znova"
|
||||
StrCpy $INIT_UNINSTALLER_RUNNING "Odinštalátor je už spustený."
|
||||
StrCpy $SectionGroup_Shortcuts "Zástupcovia"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"
|
||||
|
||||
@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Odstrani ${APPLICATION_NAME}"
|
||||
StrCpy $UNINSTALLER_APPDATA_TITLE "Odstrani ${APPLICATION_NAME}"
|
||||
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Izberite možnost vzdrževanja za izvedbo."
|
||||
StrCpy $SEC_APPLICATION_DETAILS "Poteka nameščanje ključnih paketov programa ${APPLICATION_NAME}."
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Ikona stanja za program Raziskovalec"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Nameščanje ikone stanja za Raziskovalca"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Bližnjica programa v programskem meniju"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Poteka dodajanje bližnjice programa ${APPLICATION_NAME} v programski meni."
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Bližnica namizja"
|
||||
@@ -42,5 +44,3 @@ StrCpy $INIT_INSTALLER_RUNNING "Namestilnik je
|
||||
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Program za odstranjevanje namestitve zahteva skrbniška dovoljenja."
|
||||
StrCpy $INIT_UNINSTALLER_RUNNING "Program za odstranjevanje namestitve je že zagnan."
|
||||
StrCpy $SectionGroup_Shortcuts "Bližnjice"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"
|
||||
|
||||
@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Avinstallera ${APPLICATION_NAME}"
|
||||
StrCpy $UNINSTALLER_APPDATA_TITLE "Avinstallera ${APPLICATION_NAME}"
|
||||
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Välj underhålls alternativ att utföra."
|
||||
StrCpy $SEC_APPLICATION_DETAILS "Installerar ${APPLICATION_NAME} väsentligheter."
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Statusikoner för Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installerar statusikoner för Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start-meny program genväg"
|
||||
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Lägger till genväg för ${APPLICATION_NAME} till Start-menyn."
|
||||
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Skrivbordsgenväg"
|
||||
@@ -42,5 +44,3 @@ StrCpy $INIT_INSTALLER_RUNNING "Installationsprogrammet körs redan."
|
||||
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Detta avinstallationsprogram kräver administratörs rättigheter, försök igen"
|
||||
StrCpy $INIT_UNINSTALLER_RUNNING "Avinstallationsprogrammet körs redan."
|
||||
StrCpy $SectionGroup_Shortcuts "Genvägar"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
|
||||
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"
|
||||
|
||||
@@ -23,3 +23,4 @@
|
||||
!insertmacro MUI_LANGUAGE "Slovak"
|
||||
!insertmacro MUI_LANGUAGE "Spanish"
|
||||
!insertmacro MUI_LANGUAGE "Polish"
|
||||
!insertmacro MUI_LANGUAGE "Farsi"
|
||||
|
||||
2
binary
2
binary
Submodule binary updated: 1645f4df2f...82d72bc62d
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
# Always include srcdir and builddir in include path
|
||||
# This saves typing ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY} in
|
||||
# about every subdir
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
# define system dependent compiler flags
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
if (UNIX)
|
||||
# Suffix for Linux
|
||||
SET(LIB_SUFFIX
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
# Set system vars
|
||||
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
# This module defines
|
||||
# INOTIFY_INCLUDE_DIR, where to find inotify.h, etc.
|
||||
# INOTIFY_FOUND, If false, do not try to use inotify.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
# FIND_PACKAGE_VERSION_CHECK(NAME (DEFAULT_MSG|"Custom failure message"))
|
||||
# This function is intended to be used in FindXXX.cmake modules files.
|
||||
# It handles NAME_FIND_VERSION and NAME_VERSION variables in a Module.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
find_program(PDFLATEX_EXECUTABLE NAMES pdflatex
|
||||
HINTS
|
||||
$ENV{PDFLATEX_DIR}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
# - Try to find QtKeychain
|
||||
# Once done this will define
|
||||
# QTKEYCHAIN_FOUND - System has QtKeychain
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
# - Try to find QtKeychain
|
||||
# Once done this will define
|
||||
# QTKEYCHAIN_FOUND - System has QtKeychain
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
find_program(SPHINX_EXECUTABLE NAMES sphinx-build
|
||||
HINTS
|
||||
$ENV{SPHINX_DIR}
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
<string>(C) 2014 @APPLICATION_VENDOR@</string>
|
||||
<key>SUShowReleaseNotes</key>
|
||||
<false/>
|
||||
<key>LSMinimumBundleVersion</key>
|
||||
<string>10.7.0</string>
|
||||
<key>SUPublicDSAKeyFile</key>
|
||||
<string>dsa_pub.pem</string>
|
||||
</dict>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
# - macro_copy_file(_src _dst)
|
||||
# Copies a file to ${_dst} only if ${_src} is different (newer) than ${_dst}
|
||||
#
|
||||
|
||||
@@ -95,6 +95,7 @@ ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
|
||||
!include WordFunc.nsh ;Used by VersionCompare macro function.
|
||||
!include FileFunc.nsh ;Used to read out parameters
|
||||
!include UAC.nsh ;Used by the UAC elevation to install as user or admin.
|
||||
!include Library.nsh ;Used by the COM registration for shell extensions
|
||||
!include x64.nsh ;Used to determine the right arch for the shell extensions
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
@@ -277,50 +278,10 @@ FunctionEnd
|
||||
no_process_${processName}_to_end:
|
||||
!macroend
|
||||
|
||||
!macro StartExplorerAsUserMacro un
|
||||
Function ${un}StartExplorerAsUser
|
||||
Exec "$WINDIR\explorer.exe"
|
||||
FunctionEnd
|
||||
!macroend
|
||||
|
||||
!insertmacro StartExplorerAsUserMacro ""
|
||||
!insertmacro StartExplorerAsUserMacro "un."
|
||||
|
||||
!macro StartExplorer un
|
||||
DetailPrint "Starting Explorer..."
|
||||
${UAC.CallFunctionAsUser} ${un}StartExplorerAsUser
|
||||
!macroend
|
||||
|
||||
!macro StopExplorer
|
||||
DetailPrint "Terminated Explorer..."
|
||||
FindWindow $R0 "Shell_TrayWnd"
|
||||
SendMessage $R0 0x5B4 0 0
|
||||
#Processes::KillProcess explorer.exe
|
||||
Sleep 1500
|
||||
DetailPrint "Continuing..."
|
||||
!macroend
|
||||
|
||||
Function EnsureOwncloudShutdown
|
||||
!insertmacro CheckAndConfirmEndProcess "${APPLICATION_EXECUTABLE}"
|
||||
FunctionEnd
|
||||
|
||||
Function RegisterShellExt
|
||||
SetOutPath "$INSTDIR\shellext"
|
||||
${If} ${RunningX64}
|
||||
ExecWait '"$SYSDIR\regsvr32.exe" /s "$OUTDIR\OCOverlays_x64.dll"'
|
||||
${Else}
|
||||
ExecWait '"$SYSDIR\regsvr32.exe" /s "$OUTDIR\OCOverlays_x86.dll"'
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
Function Un.RegisterShellExt
|
||||
${If} ${RunningX64}
|
||||
ExecWait '"$SYSDIR\regsvr32.exe" /u /s "$INSTDIR\shellext\OCOverlays_x64.dll"'
|
||||
${Else}
|
||||
ExecWait '"$SYSDIR\regsvr32.exe" /u /s "$INSTDIR\shellext\OCOverlays_x86.dll"'
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
Function InstallRedistributables
|
||||
${If} ${RunningX64}
|
||||
ExecWait '"$OUTDIR\vcredist_x64.exe" /install /quiet'
|
||||
@@ -510,17 +471,19 @@ SectionEnd
|
||||
SectionIn 1 2
|
||||
SetDetailsPrint textonly
|
||||
DetailPrint $OPTION_SECTION_SC_SHELL_EXT_DetailPrint
|
||||
SetOutPath "$INSTDIR\shellext"
|
||||
File "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCUtil_x64.dll"
|
||||
File "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCOverlays_x64.dll"
|
||||
File "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCUtil_x86.dll"
|
||||
File "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCOverlays_x86.dll"
|
||||
File "${BUILD_PATH}\vcredist_x86.exe"
|
||||
File "${BUILD_PATH}\vcredist_x64.exe"
|
||||
Call InstallRedistributables
|
||||
Call RegisterShellExt
|
||||
!insertMacro StopExplorer
|
||||
!insertMacro StartExplorer ""
|
||||
CreateDirectory "$INSTDIR\shellext"
|
||||
${If} ${RunningX64}
|
||||
!define LIBRARY_X64
|
||||
!insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCUtil_x64.dll" "$INSTDIR\shellext\OCUtil_x64.dll" "$INSTDIR\shellext"
|
||||
!insertmacro InstallLib REGDLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCOverlays_x64.dll" "$INSTDIR\shellext\OCOverlays_x64.dll" "$INSTDIR\shellext"
|
||||
!undef LIBRARY_X64
|
||||
${Else}
|
||||
!insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCUtil_x86.dll" "$INSTDIR\shellext\OCUtil_x86.dll" "$INSTDIR\shellext"
|
||||
!insertmacro InstallLib REGDLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCOverlays_x86.dll" "$INSTDIR\shellext\OCOverlays_x86.dll" "$INSTDIR\shellext"
|
||||
${Endif}
|
||||
${MementoSectionEnd}
|
||||
!endif
|
||||
|
||||
@@ -673,10 +636,16 @@ Section Uninstall
|
||||
|
||||
;Shell extension
|
||||
!ifdef OPTION_SECTION_SC_SHELL_EXT
|
||||
!define LIBRARY_COM
|
||||
!define LIBRARY_SHELL_EXTENSION
|
||||
${If} ${HasSection} SEC_SHELL_EXT
|
||||
!insertmacro StopExplorer
|
||||
Call Un.RegisterShellExt
|
||||
!insertmacro StartExplorer "Un."
|
||||
!define LIBRARY_X64
|
||||
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_PROTECTED "$INSTDIR/shellext/OCUtil_x64.dll"
|
||||
!insertmacro UnInstallLib REGDLL NOTSHARED REBOOT_PROTECTED "$INSTDIR/shellext/OCOverlays_x64.dll"
|
||||
!undef LIBRARY_X64
|
||||
${Else}
|
||||
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_PROTECTED "$INSTDIR/shellext/OCUtil_x86.dll"
|
||||
!insertmacro UnInstallLib REGDLL NOTSHARED REBOOT_PROTECTED "$INSTDIR/shellext/OCOverlays_x86.dll"
|
||||
${EndIf}
|
||||
!endif
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
include (MacroOptionalFindPackage)
|
||||
include (MacroLogFeature)
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
# -helper macro to add a "doc" target with CMake build system.
|
||||
# and configure doxy.config.in to doxy.config
|
||||
#
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# (c) 2014 Copyright ownCloud, Inc.
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING* file.
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION)
|
||||
@@ -6,11 +10,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
else(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long")
|
||||
endif(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CMAKE_CXX_COMPILER MATCHES "clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
endif(CMAKE_CXX_COMPILER MATCHES "clang")
|
||||
# TODO: handle msvc compilers warnings?
|
||||
|
||||
|
||||
@@ -522,8 +522,6 @@ static void _tree_destructor(void *data) {
|
||||
* used by csync_commit and csync_destroy */
|
||||
static void _csync_clean_ctx(CSYNC *ctx)
|
||||
{
|
||||
c_list_t * walk;
|
||||
|
||||
/* destroy the rbtrees */
|
||||
if (c_rbtree_size(ctx->local.tree) > 0) {
|
||||
c_rbtree_destroy(ctx->local.tree, _tree_destructor);
|
||||
@@ -535,25 +533,14 @@ static void _csync_clean_ctx(CSYNC *ctx)
|
||||
|
||||
csync_rename_destroy(ctx);
|
||||
|
||||
for (walk = c_list_last(ctx->local.ignored_cleanup); walk != NULL; walk = c_list_prev(walk)) {
|
||||
SAFE_FREE(walk->data);
|
||||
}
|
||||
for (walk = c_list_last(ctx->remote.ignored_cleanup); walk != NULL; walk = c_list_prev(walk)) {
|
||||
SAFE_FREE(walk->data);
|
||||
}
|
||||
|
||||
/* free memory */
|
||||
c_rbtree_free(ctx->local.tree);
|
||||
c_list_free(ctx->local.list);
|
||||
c_list_free(ctx->local.ignored_cleanup);
|
||||
c_rbtree_free(ctx->remote.tree);
|
||||
c_list_free(ctx->remote.list);
|
||||
c_list_free(ctx->remote.ignored_cleanup);
|
||||
|
||||
ctx->remote.list = 0;
|
||||
ctx->local.list = 0;
|
||||
ctx->remote.ignored_cleanup = 0;
|
||||
ctx->local.ignored_cleanup = 0;
|
||||
|
||||
SAFE_FREE(ctx->statedb.file);
|
||||
}
|
||||
@@ -660,7 +647,7 @@ int csync_add_exclude_list(CSYNC *ctx, const char *path) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return csync_exclude_load(ctx, path);
|
||||
return csync_exclude_load(path, &ctx->excludes);
|
||||
}
|
||||
|
||||
void csync_clear_exclude_list(CSYNC *ctx)
|
||||
|
||||
@@ -94,6 +94,7 @@ enum csync_status_codes_e {
|
||||
CSYNC_STATUS_ABORTED,
|
||||
/* Codes for file individual status: */
|
||||
CSYNC_STATUS_INDIVIDUAL_IS_SYMLINK,
|
||||
CSYNC_STATUS_INDIVIDUAL_IS_HARDLINK,
|
||||
CSYNC_STATUS_INDIVIDUAL_IGNORE_LIST,
|
||||
CSYNC_STATUS_INDIVIDUAL_IS_INVALID_CHARS,
|
||||
CYSNC_STATUS_FILE_LOCKED_OR_OPEN
|
||||
@@ -134,23 +135,6 @@ enum csync_ftw_type_e {
|
||||
CSYNC_FTW_TYPE_SKIP
|
||||
};
|
||||
|
||||
enum csync_notify_type_e {
|
||||
CSYNC_NOTIFY_INVALID,
|
||||
CSYNC_NOTIFY_START_SYNC_SEQUENCE,
|
||||
CSYNC_NOTIFY_START_DOWNLOAD,
|
||||
CSYNC_NOTIFY_START_UPLOAD,
|
||||
CSYNC_NOTIFY_PROGRESS,
|
||||
CSYNC_NOTIFY_FINISHED_DOWNLOAD,
|
||||
CSYNC_NOTIFY_FINISHED_UPLOAD,
|
||||
CSYNC_NOTIFY_FINISHED_SYNC_SEQUENCE,
|
||||
CSYNC_NOTIFY_START_DELETE,
|
||||
CSYNC_NOTIFY_END_DELETE,
|
||||
CSYNC_NOTIFY_ERROR,
|
||||
CSYNC_NOTIFY_START_LOCAL_UPDATE,
|
||||
CSYNC_NOTIFY_FINISHED_LOCAL_UPDATE,
|
||||
CSYNC_NOTIFY_START_REMOTE_UPDATE,
|
||||
CSYNC_NOTIFY_FINISHED_REMOTE_UPDATE
|
||||
};
|
||||
|
||||
/**
|
||||
* CSync File Traversal structure.
|
||||
@@ -203,6 +187,9 @@ typedef void (*csync_log_callback) (int verbosity,
|
||||
const char *buffer,
|
||||
void *userdata);
|
||||
|
||||
typedef void (*csync_update_callback) (bool local,
|
||||
const char *dirUrl,
|
||||
void *userdata);
|
||||
|
||||
/**
|
||||
* @brief Allocate a csync context.
|
||||
|
||||
@@ -40,28 +40,31 @@
|
||||
#define CSYNC_LOG_CATEGORY_NAME "csync.exclude"
|
||||
#include "csync_log.h"
|
||||
|
||||
static int _csync_exclude_add(CSYNC *ctx, const char *string) {
|
||||
#ifndef NDEBUG
|
||||
static
|
||||
#endif
|
||||
int _csync_exclude_add(c_strlist_t **inList, const char *string) {
|
||||
c_strlist_t *list;
|
||||
|
||||
if (ctx->excludes == NULL) {
|
||||
ctx->excludes = c_strlist_new(32);
|
||||
if (ctx->excludes == NULL) {
|
||||
if (*inList == NULL) {
|
||||
*inList = c_strlist_new(32);
|
||||
if (*inList == NULL) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->excludes->count == ctx->excludes->size) {
|
||||
list = c_strlist_expand(ctx->excludes, 2 * ctx->excludes->size);
|
||||
if ((*inList)->count == (*inList)->size) {
|
||||
list = c_strlist_expand(*inList, 2 * (*inList)->size);
|
||||
if (list == NULL) {
|
||||
return -1;
|
||||
}
|
||||
ctx->excludes = list;
|
||||
*inList = list;
|
||||
}
|
||||
|
||||
return c_strlist_add(ctx->excludes, string);
|
||||
return c_strlist_add(*inList, string);
|
||||
}
|
||||
|
||||
int csync_exclude_load(CSYNC *ctx, const char *fname) {
|
||||
int csync_exclude_load(const char *fname, c_strlist_t **list) {
|
||||
int fd = -1;
|
||||
int i = 0;
|
||||
int rc = -1;
|
||||
@@ -70,7 +73,7 @@ int csync_exclude_load(CSYNC *ctx, const char *fname) {
|
||||
char *entry = NULL;
|
||||
mbchar_t *w_fname;
|
||||
|
||||
if (ctx == NULL || fname == NULL) {
|
||||
if (fname == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -119,7 +122,7 @@ int csync_exclude_load(CSYNC *ctx, const char *fname) {
|
||||
buf[i] = '\0';
|
||||
if (*entry != '#') {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Adding entry: %s", entry);
|
||||
rc = _csync_exclude_add(ctx, entry);
|
||||
rc = _csync_exclude_add(list, entry);
|
||||
if (rc < 0) {
|
||||
goto out;
|
||||
}
|
||||
@@ -145,6 +148,15 @@ void csync_exclude_destroy(CSYNC *ctx) {
|
||||
}
|
||||
|
||||
CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
|
||||
|
||||
CSYNC_EXCLUDE_TYPE match = CSYNC_NOT_EXCLUDED;
|
||||
|
||||
match = csync_excluded_no_ctx( ctx->excludes, path, filetype );
|
||||
|
||||
return match;
|
||||
}
|
||||
|
||||
CSYNC_EXCLUDE_TYPE csync_excluded_no_ctx(c_strlist_t *excludes, const char *path, int filetype) {
|
||||
size_t i = 0;
|
||||
const char *p = NULL;
|
||||
char *bname = NULL;
|
||||
@@ -190,6 +202,20 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
// Windows cannot sync files ending in spaces (#2176). It also cannot
|
||||
// distinguish files ending in '.' from files without an ending,
|
||||
// as '.' is a separator that is not stored internally, so let's
|
||||
// not allow to sync those to avoid file loss/ambiguities (#416)
|
||||
size_t blen = strlen(bname);
|
||||
if (blen > 1 && (bname[blen-1]== ' ' || bname[blen-1]== '.' )) {
|
||||
match = CSYNC_FILE_EXCLUDE_INVALID_CHAR;
|
||||
SAFE_FREE(bname);
|
||||
SAFE_FREE(dname);
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
|
||||
rc = csync_fnmatch(".owncloudsync.log*", bname, 0);
|
||||
if (rc == 0) {
|
||||
match = CSYNC_FILE_SILENTLY_EXCLUDED;
|
||||
@@ -208,7 +234,10 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
|
||||
}
|
||||
|
||||
if (getenv("CSYNC_CONFLICT_FILE_USERNAME")) {
|
||||
asprintf(&conflict, "*_conflict_%s-*", getenv("CSYNC_CONFLICT_FILE_USERNAME"));
|
||||
rc = asprintf(&conflict, "*_conflict_%s-*", getenv("CSYNC_CONFLICT_FILE_USERNAME"));
|
||||
if (rc < 0) {
|
||||
goto out;
|
||||
}
|
||||
rc = csync_fnmatch(conflict, path, 0);
|
||||
if (rc == 0) {
|
||||
match = CSYNC_FILE_SILENTLY_EXCLUDED;
|
||||
@@ -223,14 +252,14 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
|
||||
SAFE_FREE(bname);
|
||||
SAFE_FREE(dname);
|
||||
|
||||
if (ctx == NULL || ctx->excludes == NULL) {
|
||||
if( ! excludes ) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Loop over all exclude patterns and evaluate the given path */
|
||||
for (i = 0; match == CSYNC_NOT_EXCLUDED && i < ctx->excludes->count; i++) {
|
||||
for (i = 0; match == CSYNC_NOT_EXCLUDED && i < excludes->count; i++) {
|
||||
bool match_dirs_only = false;
|
||||
char *pattern_stored = c_strdup(ctx->excludes->vector[i]);
|
||||
char *pattern_stored = c_strdup(excludes->vector[i]);
|
||||
char* pattern = pattern_stored;
|
||||
|
||||
type = CSYNC_FILE_EXCLUDE_LIST;
|
||||
@@ -310,6 +339,7 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
|
||||
SAFE_FREE(dname);
|
||||
}
|
||||
|
||||
|
||||
out:
|
||||
|
||||
return match;
|
||||
|
||||
@@ -29,6 +29,11 @@ enum csync_exclude_type_e {
|
||||
CSYNC_FILE_EXCLUDE_INVALID_CHAR
|
||||
};
|
||||
typedef enum csync_exclude_type_e CSYNC_EXCLUDE_TYPE;
|
||||
|
||||
#ifdef NDEBUG
|
||||
int _csync_exclude_add(c_strlist_t **inList, const char *string);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Load exclude list
|
||||
*
|
||||
@@ -37,7 +42,7 @@ typedef enum csync_exclude_type_e CSYNC_EXCLUDE_TYPE;
|
||||
*
|
||||
* @return 0 on success, -1 if an error occured with errno set.
|
||||
*/
|
||||
int csync_exclude_load(CSYNC *ctx, const char *fname);
|
||||
int csync_exclude_load(const char *fname, c_strlist_t **list);
|
||||
|
||||
/**
|
||||
* @brief Clear the exclude list in memory.
|
||||
@@ -65,6 +70,14 @@ void csync_exclude_destroy(CSYNC *ctx);
|
||||
*/
|
||||
CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype);
|
||||
|
||||
/**
|
||||
* @brief csync_excluded_no_ctx
|
||||
* @param excludes
|
||||
* @param path
|
||||
* @param filetype
|
||||
* @return
|
||||
*/
|
||||
CSYNC_EXCLUDE_TYPE csync_excluded_no_ctx(c_strlist_t *excludes, const char *path, int filetype);
|
||||
#endif /* _CSYNC_EXCLUDE_H */
|
||||
|
||||
/* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "csync_private.h"
|
||||
|
||||
|
||||
/*
|
||||
* helper method to build up a user text for SSL problems, called from the
|
||||
@@ -430,6 +432,8 @@ static int dav_connect(csync_owncloud_ctx_t *ctx, const char *base_url) {
|
||||
ne_set_read_timeout(ctx->dav_session.ctx, ctx->dav_session.read_timeout);
|
||||
DEBUG_WEBDAV("Timeout set to %u seconds", ctx->dav_session.read_timeout );
|
||||
}
|
||||
// Should never take more than some seconds, 30 is really a max.
|
||||
ne_set_connect_timeout(ctx->dav_session.ctx, 30);
|
||||
|
||||
snprintf( uaBuf, sizeof(uaBuf), "Mozilla/5.0 (%s) csyncoC/%s",
|
||||
csync_owncloud_get_platform(), CSYNC_STRINGIFY( LIBCSYNC_VERSION ));
|
||||
@@ -537,6 +541,11 @@ static struct listdir_context *fetch_resource_list(csync_owncloud_ctx_t *ctx, co
|
||||
}
|
||||
}
|
||||
|
||||
if( ctx->csync_ctx->callbacks.update_callback ) {
|
||||
ctx->csync_ctx->callbacks.update_callback(false, curi,
|
||||
ctx->csync_ctx->callbacks.update_callback_userdata);
|
||||
}
|
||||
|
||||
fetchCtx = c_malloc( sizeof( struct listdir_context ));
|
||||
if (!fetchCtx) {
|
||||
errno = ENOMEM;
|
||||
|
||||
@@ -54,6 +54,9 @@ struct listdir_context *get_listdir_context_from_recursive_cache(csync_owncloud_
|
||||
DEBUG_WEBDAV("get_listdir_context_from_recursive_cache No element %s in cache found", curi);
|
||||
return NULL;
|
||||
}
|
||||
if( ctx->csync_ctx->callbacks.update_callback ) {
|
||||
ctx->csync_ctx->callbacks.update_callback(false, curi, ctx->csync_ctx->callbacks.update_callback_userdata);
|
||||
}
|
||||
|
||||
/* Out of the element, create a listdir_context.. if we could be sure that it is immutable, we could ref instead.. need to investigate */
|
||||
fetchCtx = c_malloc( sizeof( struct listdir_context ));
|
||||
@@ -141,6 +144,14 @@ static void propfind_results_recursive_callback(void *userdata,
|
||||
element->parent = NULL;
|
||||
c_rbtree_insert(ctx->propfind_recursive_cache, element);
|
||||
/* DEBUG_WEBDAV("results_recursive Added collection %s", newres->uri); */
|
||||
|
||||
// We do this here and in get_listdir_context_from_recursive_cache because
|
||||
// a recursive PROPFIND might take some time but we still want to
|
||||
// be informed. Later when get_listdir_context_from_recursive_cache is
|
||||
// called the DB queries might be the problem causing slowness, so do it again there then.
|
||||
if( ctx->csync_ctx->callbacks.update_callback ) {
|
||||
ctx->csync_ctx->callbacks.update_callback(false, path, ctx->csync_ctx->callbacks.update_callback_userdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,6 +200,9 @@ void fetch_resource_list_recursive(csync_owncloud_ctx_t *ctx, const char *uri, c
|
||||
int depth = NE_DEPTH_INFINITE;
|
||||
|
||||
DEBUG_WEBDAV("fetch_resource_list_recursive Starting recursive propfind %s %s", uri, curi);
|
||||
if( ctx->csync_ctx->callbacks.update_callback ) {
|
||||
ctx->csync_ctx->callbacks.update_callback(false, curi, ctx->csync_ctx->callbacks.update_callback_userdata);
|
||||
}
|
||||
|
||||
/* do a propfind request and parse the results in the results function, set as callback */
|
||||
hdl = ne_propfind_create(ctx->dav_session.ctx, curi, depth);
|
||||
|
||||
@@ -339,6 +339,8 @@ void fill_webdav_properties_into_resource(struct resource* newres, const ne_prop
|
||||
file_id = ne_propset_value( set, &ls_props[4] );
|
||||
directDownloadUrl = ne_propset_value( set, &ls_props[5] );
|
||||
directDownloadCookies = ne_propset_value( set, &ls_props[6] );
|
||||
|
||||
// permission flags: Defined in https://github.com/owncloud/core/issues/8322
|
||||
perm = ne_propset_value( set, &ls_props[7] );
|
||||
|
||||
if( resourcetype && strncmp( resourcetype, "<DAV:collection>", 16 ) == 0) {
|
||||
|
||||
@@ -87,6 +87,8 @@ struct csync_s {
|
||||
struct {
|
||||
csync_auth_callback auth_function;
|
||||
void *userdata;
|
||||
csync_update_callback update_callback;
|
||||
void *update_callback_userdata;
|
||||
} callbacks;
|
||||
c_strlist_t *excludes;
|
||||
|
||||
@@ -105,7 +107,6 @@ struct csync_s {
|
||||
c_rbtree_t *tree;
|
||||
c_list_t *list;
|
||||
enum csync_replica_e type;
|
||||
c_list_t *ignored_cleanup;
|
||||
} local;
|
||||
|
||||
struct {
|
||||
@@ -114,7 +115,6 @@ struct csync_s {
|
||||
c_list_t *list;
|
||||
enum csync_replica_e type;
|
||||
int read_from_db;
|
||||
c_list_t *ignored_cleanup;
|
||||
} remote;
|
||||
|
||||
#if defined(HAVE_ICONV) && defined(WITH_ICONV)
|
||||
@@ -144,6 +144,10 @@ struct csync_s {
|
||||
int read_from_db_disabled;
|
||||
|
||||
struct csync_owncloud_ctx_s *owncloud_context;
|
||||
|
||||
/* hooks for checking the white list */
|
||||
void *checkBlackListData;
|
||||
int (*checkBlackListHook)(void*, const char*);
|
||||
};
|
||||
|
||||
|
||||
@@ -161,6 +165,7 @@ struct csync_file_stat_s {
|
||||
int type; /* u32 */
|
||||
int child_modified;/*bool*/
|
||||
int should_update_etag; /*bool */
|
||||
int has_ignored_files; /*bool: specify that a directory, or child directory contains ignored files */
|
||||
|
||||
char *destpath; /* for renames */
|
||||
const char *etag;
|
||||
|
||||
@@ -134,6 +134,10 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
|
||||
break;
|
||||
/* file has been removed on the opposite replica */
|
||||
case CSYNC_INSTRUCTION_NONE:
|
||||
if (cur->has_ignored_files) {
|
||||
/* Do not remove a directory that has ignored files */
|
||||
break;
|
||||
}
|
||||
cur->instruction = CSYNC_INSTRUCTION_REMOVE;
|
||||
break;
|
||||
case CSYNC_INSTRUCTION_EVAL_RENAME:
|
||||
|
||||
@@ -222,6 +222,9 @@ int csync_statedb_load(CSYNC *ctx, const char *statedb, sqlite3 **pdb) {
|
||||
result = csync_statedb_query(db, "PRAGMA case_sensitive_like = ON;");
|
||||
c_strlist_destroy(result);
|
||||
|
||||
/* set a busy handler with 5 seconds timeout */
|
||||
sqlite3_busy_timeout(db, 5000);
|
||||
|
||||
#ifndef NDEBUG
|
||||
sqlite3_profile(db, sqlite_profile, 0 );
|
||||
#endif
|
||||
@@ -319,6 +322,10 @@ static int _csync_file_stat_from_metadata_table( csync_file_stat_t **st, sqlite3
|
||||
REMOTE_PERM_BUF_SIZE);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if( rc != SQLITE_DONE ) {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "WARN: Query results in %d", rc);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@@ -350,8 +357,9 @@ csync_file_stat_t *csync_statedb_get_stat_by_hash(CSYNC *ctx,
|
||||
|
||||
sqlite3_bind_int64(ctx->statedb.by_hash_stmt, 1, (long long signed int)phash);
|
||||
|
||||
if( _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_hash_stmt) < 0 ) {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata!");
|
||||
rc = _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_hash_stmt);
|
||||
if( !(rc == SQLITE_ROW || rc == SQLITE_DONE) ) {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata: %d!", rc);
|
||||
}
|
||||
sqlite3_reset(ctx->statedb.by_hash_stmt);
|
||||
|
||||
@@ -387,8 +395,9 @@ csync_file_stat_t *csync_statedb_get_stat_by_file_id(CSYNC *ctx,
|
||||
/* bind the query value */
|
||||
sqlite3_bind_text(ctx->statedb.by_fileid_stmt, 1, file_id, -1, SQLITE_STATIC);
|
||||
|
||||
if( _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_fileid_stmt) < 0 ) {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata!");
|
||||
rc = _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_fileid_stmt);
|
||||
if( !(rc == SQLITE_ROW || rc == SQLITE_DONE) ) {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata: %d!", rc);
|
||||
}
|
||||
// clear the resources used by the statement.
|
||||
sqlite3_reset(ctx->statedb.by_fileid_stmt);
|
||||
@@ -427,8 +436,9 @@ csync_file_stat_t *csync_statedb_get_stat_by_inode(CSYNC *ctx,
|
||||
|
||||
sqlite3_bind_int64(ctx->statedb.by_inode_stmt, 1, (long long signed int)inode);
|
||||
|
||||
if( _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_inode_stmt) < 0 ) {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata by inode!");
|
||||
rc = _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_inode_stmt);
|
||||
if( !(rc == SQLITE_ROW || rc == SQLITE_DONE) ) {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata by inode: %d!", rc);
|
||||
}
|
||||
sqlite3_reset(ctx->statedb.by_inode_stmt);
|
||||
|
||||
@@ -457,7 +467,7 @@ char *csync_statedb_get_etag( CSYNC *ctx, uint64_t jHash ) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define BELOW_PATH_QUERY "SELECT phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5, fileid, remotePerm FROM metadata WHERE path LIKE(?)"
|
||||
#define BELOW_PATH_QUERY "SELECT phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5, fileid, remotePerm FROM metadata WHERE pathlen>? AND path LIKE(?)"
|
||||
|
||||
int csync_statedb_get_below_path( CSYNC *ctx, const char *path ) {
|
||||
int rc;
|
||||
@@ -465,6 +475,7 @@ int csync_statedb_get_below_path( CSYNC *ctx, const char *path ) {
|
||||
int64_t cnt = 0;
|
||||
char *likepath;
|
||||
int asp;
|
||||
int min_path_len;
|
||||
|
||||
if( !path ) {
|
||||
return -1;
|
||||
@@ -476,7 +487,7 @@ int csync_statedb_get_below_path( CSYNC *ctx, const char *path ) {
|
||||
|
||||
rc = sqlite3_prepare_v2(ctx->statedb.db, BELOW_PATH_QUERY, -1, &stmt, NULL);
|
||||
if( rc != SQLITE_OK ) {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Unable to create stmt for hash query.");
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Unable to create stmt for below path query.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -490,7 +501,9 @@ int csync_statedb_get_below_path( CSYNC *ctx, const char *path ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
sqlite3_bind_text(stmt, 1, likepath, -1, SQLITE_STATIC);
|
||||
min_path_len = strlen(path);
|
||||
sqlite3_bind_int(stmt, 1, min_path_len);
|
||||
sqlite3_bind_text(stmt, 2, likepath, -1, SQLITE_STATIC);
|
||||
|
||||
cnt = 0;
|
||||
|
||||
|
||||
@@ -146,21 +146,21 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
|
||||
if (excluded != CSYNC_NOT_EXCLUDED) {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "%s excluded (%d)", path, excluded);
|
||||
if (excluded == CSYNC_FILE_EXCLUDE_AND_REMOVE) {
|
||||
switch (ctx->current) {
|
||||
case LOCAL_REPLICA:
|
||||
ctx->local.ignored_cleanup = c_list_append(ctx->local.ignored_cleanup, c_strdup(path));
|
||||
break;
|
||||
case REMOTE_REPLICA:
|
||||
ctx->remote.ignored_cleanup = c_list_append(ctx->remote.ignored_cleanup, c_strdup(path));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
if (excluded == CSYNC_FILE_SILENTLY_EXCLUDED) {
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ctx->current_fs) {
|
||||
ctx->current_fs->has_ignored_files = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->current == REMOTE_REPLICA && ctx->checkBlackListHook) {
|
||||
if (ctx->checkBlackListHook(ctx->checkBlackListData, path)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
h = _hash_of_file(ctx, file );
|
||||
@@ -179,11 +179,13 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
|
||||
st->instruction = CSYNC_INSTRUCTION_NONE;
|
||||
st->etag = NULL;
|
||||
st->child_modified = 0;
|
||||
st->has_ignored_files = 0;
|
||||
|
||||
/* check hardlink count */
|
||||
if (type == CSYNC_FTW_TYPE_FILE ) {
|
||||
if( fs->nlink > 1) {
|
||||
st->instruction = CSYNC_INSTRUCTION_IGNORE;
|
||||
st->error_status = CSYNC_STATUS_INDIVIDUAL_IS_HARDLINK;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -228,14 +230,16 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
|
||||
|
||||
if(tmp && tmp->phash == h ) { /* there is an entry in the database */
|
||||
/* we have an update! */
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Database entry found, compare: %" PRId64 " <-> %" PRId64 ", etag: %s <-> %s, inode: %" PRId64 " <-> %" PRId64,
|
||||
((int64_t) fs->mtime), ((int64_t) tmp->modtime), fs->etag, tmp->etag, (uint64_t) fs->inode, (uint64_t) tmp->inode);
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Database entry found, compare: %" PRId64 " <-> %" PRId64 ", etag: %s <-> %s, inode: %" PRId64 " <-> %" PRId64 ", size: %" PRId64 " <-> %" PRId64,
|
||||
((int64_t) fs->mtime), ((int64_t) tmp->modtime), fs->etag, tmp->etag, (uint64_t) fs->inode, (uint64_t) tmp->inode, (uint64_t) fs->size, (uint64_t) tmp->size);
|
||||
if( !fs->etag) {
|
||||
st->instruction = CSYNC_INSTRUCTION_EVAL;
|
||||
goto out;
|
||||
}
|
||||
if((ctx->current == REMOTE_REPLICA && !c_streq(fs->etag, tmp->etag ))
|
||||
|| (ctx->current == LOCAL_REPLICA && (fs->mtime != tmp->modtime
|
||||
// zero size in statedb can happen during migration
|
||||
|| (tmp->size != 0 && fs->size != tmp->size)
|
||||
#if 0
|
||||
|| fs->inode != tmp->inode
|
||||
#endif
|
||||
@@ -342,6 +346,7 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "Unable to open statedb, setting inst to NEW" );
|
||||
st->instruction = CSYNC_INSTRUCTION_NEW;
|
||||
}
|
||||
|
||||
@@ -430,11 +435,19 @@ int csync_walker(CSYNC *ctx, const char *file, const csync_vio_file_stat_t *fs,
|
||||
|
||||
switch (flag) {
|
||||
case CSYNC_FTW_FLAG_FILE:
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "file: %s [file_id=%s]", file, fs->file_id);
|
||||
if (ctx->current == REMOTE_REPLICA) {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "file: %s [file_id=%s size=%" PRIu64 "]", file, fs->file_id, fs->size);
|
||||
} else {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "file: %s [inode=%" PRIu64 " size=%" PRIu64 "]", file, fs->inode, fs->size);
|
||||
}
|
||||
type = CSYNC_FTW_TYPE_FILE;
|
||||
break;
|
||||
case CSYNC_FTW_FLAG_DIR: /* enter directory */
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "directory: %s [file_id=%s]", file, fs->file_id);
|
||||
if (ctx->current == REMOTE_REPLICA) {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "directory: %s [file_id=%s]", file, fs->file_id);
|
||||
} else {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "directory: %s [inode=%" PRIu64 "]", file, fs->inode);
|
||||
}
|
||||
type = CSYNC_FTW_TYPE_DIR;
|
||||
break;
|
||||
case CSYNC_FTW_FLAG_NSTAT: /* not statable file */
|
||||
@@ -659,6 +672,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
|
||||
/* this function may update ctx->current and ctx->read_from_db */
|
||||
|
||||
if (ctx->current_fs && previous_fs && ctx->current_fs->child_modified) {
|
||||
/* If a directory has modified files, put the flag on the parent directory as well */
|
||||
previous_fs->child_modified = ctx->current_fs->child_modified;
|
||||
}
|
||||
|
||||
@@ -676,7 +690,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (flag == CSYNC_FTW_FLAG_DIR && depth
|
||||
if (flag == CSYNC_FTW_FLAG_DIR && depth && rc == 0
|
||||
&& (!ctx->current_fs || ctx->current_fs->instruction != CSYNC_INSTRUCTION_IGNORE)) {
|
||||
rc = csync_ftw(ctx, filename, fn, depth - 1);
|
||||
if (rc < 0) {
|
||||
@@ -689,6 +703,11 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
|
||||
ctx->current_fs->instruction = CSYNC_INSTRUCTION_NONE;
|
||||
ctx->current_fs->should_update_etag = true;
|
||||
}
|
||||
|
||||
if (ctx->current_fs && previous_fs && ctx->current_fs->has_ignored_files) {
|
||||
/* If a directory has ignored files, put the flag on the parent directory as well */
|
||||
previous_fs->has_ignored_files = ctx->current_fs->has_ignored_files;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag == CSYNC_FTW_FLAG_DIR && ctx->current_fs
|
||||
|
||||
@@ -140,7 +140,9 @@ bool csync_file_locked_or_open( const char *dir, const char *fname) {
|
||||
if (!csync_file_locked_or_open_ext) {
|
||||
return false;
|
||||
}
|
||||
asprintf(&tmp_uri, "%s/%s", dir, fname);
|
||||
if (asprintf(&tmp_uri, "%s/%s", dir, fname) < 0) {
|
||||
return -1;
|
||||
}
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "csync_file_locked_or_open %s", tmp_uri);
|
||||
ret = csync_file_locked_or_open_ext(tmp_uri);
|
||||
SAFE_FREE(tmp_uri);
|
||||
|
||||
@@ -48,6 +48,9 @@ csync_vio_handle_t *csync_vio_opendir(CSYNC *ctx, const char *name) {
|
||||
return owncloud_opendir(ctx, name);
|
||||
break;
|
||||
case LOCAL_REPLICA:
|
||||
if( ctx->callbacks.update_callback ) {
|
||||
ctx->callbacks.update_callback(ctx->replica, name, ctx->callbacks.update_callback_userdata);
|
||||
}
|
||||
return csync_vio_local_opendir(name);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -237,7 +237,7 @@ int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
|
||||
/* printf("Index: %I64i\n", FileIndex.QuadPart); */
|
||||
buf->inode = FileIndex.QuadPart;
|
||||
|
||||
buf->size = (fileInfo.nFileSizeHigh * (int64_t)(MAXDWORD+1)) + fileInfo.nFileSizeLow;
|
||||
buf->size = (fileInfo.nFileSizeHigh * ((int64_t)(MAXDWORD)+1)) + fileInfo.nFileSizeLow;
|
||||
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_SIZE;
|
||||
|
||||
/* Get the file time with a win32 call rather than through stat. See
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#define CSYNC_TEST 1
|
||||
#include "csync_exclude.c"
|
||||
|
||||
#define EXCLUDE_LIST_FILE SOURCEDIR"/../sync-exclude.lst"
|
||||
|
||||
static void setup(void **state) {
|
||||
CSYNC *csync;
|
||||
int rc;
|
||||
@@ -42,7 +44,7 @@ static void setup_init(void **state) {
|
||||
rc = csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
|
||||
assert_int_equal(rc, 0);
|
||||
|
||||
rc = csync_exclude_load(csync, SOURCEDIR "/../sync-exclude.lst");
|
||||
rc = csync_exclude_load(EXCLUDE_LIST_FILE, &(csync->excludes));
|
||||
assert_int_equal(rc, 0);
|
||||
|
||||
*state = csync;
|
||||
@@ -66,7 +68,7 @@ static void teardown(void **state) {
|
||||
static void check_csync_exclude_add(void **state)
|
||||
{
|
||||
CSYNC *csync = *state;
|
||||
_csync_exclude_add(csync, (const char *) "/tmp/check_csync1/*");
|
||||
_csync_exclude_add(&(csync->excludes), "/tmp/check_csync1/*");
|
||||
assert_string_equal(csync->excludes->vector[0], "/tmp/check_csync1/*");
|
||||
}
|
||||
|
||||
@@ -75,10 +77,11 @@ static void check_csync_exclude_load(void **state)
|
||||
CSYNC *csync = *state;
|
||||
int rc;
|
||||
|
||||
rc = csync_exclude_load(csync, SOURCEDIR "/../sync-exclude.lst");
|
||||
rc = csync_exclude_load(EXCLUDE_LIST_FILE, &(csync->excludes) );
|
||||
assert_int_equal(rc, 0);
|
||||
|
||||
assert_string_equal(csync->excludes->vector[0], "*.filepart");
|
||||
assert_int_not_equal(csync->excludes->count, 0);
|
||||
}
|
||||
|
||||
static void check_csync_excluded(void **state)
|
||||
@@ -106,15 +109,9 @@ static void check_csync_excluded(void **state)
|
||||
rc = csync_excluded(csync, "foo/bar/.apdisk", CSYNC_FTW_TYPE_DIR);
|
||||
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
|
||||
|
||||
/*
|
||||
* Pattern: .java/
|
||||
* A file wont be excluded but a directory .java will be.
|
||||
*/
|
||||
/* rc = csync_excluded(csync, ".java", CSYNC_FTW_TYPE_DIR);
|
||||
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
|
||||
rc = csync_excluded(csync, ".java", CSYNC_FTW_TYPE_FILE);
|
||||
assert_int_equal(rc, CSYNC_NOT_EXCLUDED);
|
||||
*/
|
||||
|
||||
/* Files in the ignored dir .java will also be ignored. */
|
||||
rc = csync_excluded(csync, ".apdisk/totally_amazing.jar", CSYNC_FTW_TYPE_FILE);
|
||||
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
|
||||
@@ -141,23 +138,41 @@ static void check_csync_excluded(void **state)
|
||||
/* Not excluded because the pattern .netscape/cache requires directory. */
|
||||
rc = csync_excluded(csync, ".netscape/cache", CSYNC_FTW_TYPE_FILE);
|
||||
assert_int_equal(rc, CSYNC_NOT_EXCLUDED);
|
||||
/*
|
||||
rc = csync_excluded(csync, ".netscape/cache", CSYNC_FTW_TYPE_DIR);
|
||||
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);*/
|
||||
|
||||
/* Excluded because the parent dir .netscape/cache is ingored. */
|
||||
/* rc = csync_excluded(csync, ".netscape/cache/foo", CSYNC_FTW_TYPE_FILE);
|
||||
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
|
||||
|
||||
rc = csync_excluded(csync, ".netscape/cache/bar.txt", CSYNC_FTW_TYPE_FILE);
|
||||
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
|
||||
|
||||
rc = csync_excluded(csync, ".netscape/cache/longrun", CSYNC_FTW_TYPE_DIR);
|
||||
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
static void check_csync_pathes(void **state)
|
||||
{
|
||||
CSYNC *csync = *state;
|
||||
int rc;
|
||||
|
||||
_csync_exclude_add( &(csync->excludes), "/exclude" );
|
||||
|
||||
/* Check toplevel dir, the pattern only works for toplevel dir. */
|
||||
rc = csync_excluded(csync, "/exclude", CSYNC_FTW_TYPE_DIR);
|
||||
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
|
||||
|
||||
rc = csync_excluded(csync, "/foo/exclude", CSYNC_FTW_TYPE_DIR);
|
||||
assert_int_equal(rc, CSYNC_NOT_EXCLUDED);
|
||||
|
||||
/* check for a file called exclude. Must still work */
|
||||
rc = csync_excluded(csync, "/exclude", CSYNC_FTW_TYPE_FILE);
|
||||
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
|
||||
|
||||
rc = csync_excluded(csync, "/foo/exclude", CSYNC_FTW_TYPE_FILE);
|
||||
assert_int_equal(rc, CSYNC_NOT_EXCLUDED);
|
||||
|
||||
/* Add an exclude for directories only: excl/ */
|
||||
_csync_exclude_add( &(csync->excludes), "excl/" );
|
||||
rc = csync_excluded(csync, "/excl", CSYNC_FTW_TYPE_DIR);
|
||||
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
|
||||
|
||||
rc = csync_excluded(csync, "meep/excl", CSYNC_FTW_TYPE_DIR);
|
||||
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
|
||||
|
||||
rc = csync_excluded(csync, "/excl", CSYNC_FTW_TYPE_FILE);
|
||||
assert_int_equal(rc, CSYNC_NOT_EXCLUDED);
|
||||
}
|
||||
|
||||
int torture_run_tests(void)
|
||||
{
|
||||
@@ -165,6 +180,7 @@ int torture_run_tests(void)
|
||||
unit_test_setup_teardown(check_csync_exclude_add, setup, teardown),
|
||||
unit_test_setup_teardown(check_csync_exclude_load, setup, teardown),
|
||||
unit_test_setup_teardown(check_csync_excluded, setup_init, teardown),
|
||||
unit_test_setup_teardown(check_csync_pathes, setup_init, teardown),
|
||||
};
|
||||
|
||||
return run_tests(tests);
|
||||
|
||||
1
csync/tests/ownCloud/.gitignore
vendored
Normal file
1
csync/tests/ownCloud/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
t1.cfg
|
||||
@@ -1,12 +1,7 @@
|
||||
t1 - an integration test script for csync syncing to ownCloud.
|
||||
|
||||
Note: This test script uses perl HTTP::DAV. This package needs to
|
||||
be in version 0.46 at least. Many distros deliver older versions.
|
||||
A working version is part of the github checkout.
|
||||
|
||||
Note: This test script uses perl HTTP::DAV. This package needs to
|
||||
be in version 0.46 at least. Many distros deliver older versions.
|
||||
Update than.
|
||||
be in version 0.47 at least. Many distros deliver older versions.
|
||||
|
||||
t1 uses a perl WebDAV client lib to sync to an existing instance of
|
||||
ownCloud. For that, various files are copied around, synced and the
|
||||
@@ -20,10 +15,6 @@ First, configure the script. For that, create a file t1.cfg. There
|
||||
is t1.cfg.in as an example. Yeah, this test script is not secure,
|
||||
make sure to run it with a weak account and in a save environment.
|
||||
|
||||
Second, unpack the test file collection with
|
||||
tar xf testfiles.tar.xz
|
||||
in the directory where the tarball can be found.
|
||||
|
||||
To start the script, call ./t1.pl on the commandline. A lot of
|
||||
output is generated. If the script does not fail, everything works.
|
||||
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
*_conflict-*
|
||||
*.part
|
||||
]*.directory
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ use Exporter;
|
||||
use HTTP::DAV 0.47;
|
||||
use Data::Dumper;
|
||||
use File::Glob ':glob';
|
||||
use Carp::Assert;
|
||||
use Digest::MD5;
|
||||
use Unicode::Normalize;
|
||||
use LWP::UserAgent;
|
||||
@@ -35,6 +34,8 @@ use LWP::Protocol::https;
|
||||
use HTTP::Request::Common qw( POST GET DELETE );
|
||||
use File::Basename;
|
||||
use IO::Handle;
|
||||
use POSIX qw/strftime/;
|
||||
use Carp;
|
||||
|
||||
use Encode qw(from_to);
|
||||
use utf8;
|
||||
@@ -65,7 +66,7 @@ our %config;
|
||||
assertLocalDirs assertLocalAndRemoteDir glob_put put_to_dir
|
||||
putToDirLWP localDir remoteDir localCleanup createLocalFile md5OfFile
|
||||
remoteCleanup server initLocalDir initRemoteDir moveRemoteFile
|
||||
printInfo remoteFileId createShare removeShare
|
||||
printInfo remoteFileId createShare removeShare assert
|
||||
configValue testDirUrl getToFileLWP getToFileCurl);
|
||||
|
||||
sub server
|
||||
@@ -129,8 +130,9 @@ sub initTesting(;$)
|
||||
# $d->DebugLevel(3);
|
||||
$prefix = "t1" unless( defined $prefix );
|
||||
|
||||
my $dirId = sprintf("%#.3o", rand(1000));
|
||||
my $dir = sprintf( "%s-%s/", $prefix, $dirId );
|
||||
my $dirId = sprintf("%02d", rand(100));
|
||||
my $dateTime = strftime('%Y%m%d%H%M%S',localtime);
|
||||
my $dir = sprintf( "%s-%s-%s/", $prefix, $dateTime, $dirId );
|
||||
|
||||
$localDir = $dir;
|
||||
$localDir .= "/" unless( $localDir =~ /\/$/ );
|
||||
@@ -303,7 +305,7 @@ sub csync( ;$ )
|
||||
|
||||
print "CSync URL: $url\n";
|
||||
|
||||
my $args = "--trust"; # Trust crappy SSL certificates
|
||||
my $args = "--trust --exclude exclude.cfg"; # Trust crappy SSL certificates
|
||||
my $cmd = "LD_LIBRARY_PATH=$ld_libpath $csync $args $localDir $url";
|
||||
print "Starting: $cmd\n";
|
||||
|
||||
@@ -781,4 +783,12 @@ sub removeShare($$)
|
||||
my $response = $ua->request($req);
|
||||
}
|
||||
|
||||
sub assert($;$)
|
||||
{
|
||||
unless( $_[0] ) {
|
||||
print Carp::confess(@_);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
user => "joe",
|
||||
passwd => "secret",
|
||||
url => "http://localhost/ocm/remote.php/webdav/",
|
||||
ld_libpath => "/home/joe/owncloud/csync/csync-build/modules",
|
||||
csync => "/home/joe/owncloud/csync/csync-build/client/csync",
|
||||
ld_libpath => "/home/joe/owncloud/mirall-install/lib",
|
||||
csync => "/home/joe/owncloud/mirall-install/bin/owncloudcmd",
|
||||
ocs_url => "http://localhost/owncloud/ocs/v1.php/",
|
||||
share_user => "jenny",
|
||||
share_passwd => "also_secret"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
use lib ".";
|
||||
|
||||
use Carp::Assert;
|
||||
use File::Copy;
|
||||
use ownCloud::Test;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
use lib ".";
|
||||
|
||||
use Carp::Assert;
|
||||
|
||||
use File::Copy;
|
||||
use ownCloud::Test;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
use lib ".";
|
||||
|
||||
use Carp::Assert;
|
||||
|
||||
use File::Copy;
|
||||
use ownCloud::Test;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
use lib ".";
|
||||
|
||||
use Carp::Assert;
|
||||
|
||||
use File::Copy;
|
||||
use ownCloud::Test;
|
||||
|
||||
@@ -38,6 +38,10 @@ printInfo( "Copy some files to the remote location" );
|
||||
mkdir( localDir() . 'test_stat' );
|
||||
system( "echo foobar > " . localDir() . 'test_stat/file.txt' );
|
||||
|
||||
mkdir( localDir() . 'test_ignored' );
|
||||
mkdir( localDir() . 'test_ignored/sub' );
|
||||
system( "echo foobarfoo > " . localDir() . 'test_ignored/sub/file.txt' );
|
||||
|
||||
# call csync, sync local t1 to remote t1
|
||||
csync();
|
||||
|
||||
@@ -91,15 +95,25 @@ my $realMD5 = md5OfFile( '/tmp/kernelcrash.txt' );
|
||||
print "MD5 compare $localMD5 <-> $realMD5\n";
|
||||
assert( $localMD5 eq $realMD5 );
|
||||
|
||||
|
||||
printInfo("Added a file that is on the ignore list");
|
||||
# (*.directory is in the ignored list that needs cleanup)
|
||||
# (it is names with _conflict) because i want the conflicft detection of assertLocalAndRemoteDir to work
|
||||
system( "echo dir >> " . localDir() . 'test_stat/file_conflict.directory' );
|
||||
# this one should retain the directory
|
||||
system( "echo foobarfoo > " . localDir() . 'test_ignored/sub/ignored_conflict.part' );
|
||||
csync();
|
||||
# The file_conflict.directory is seen as a conflict
|
||||
assertLocalAndRemoteDir( '', 1 );
|
||||
# TODO: check that the file_conflict.directory is indeed NOT on the server
|
||||
# TODO: check that test_ignored/sub/ignored_conflict.part is NOT on the server
|
||||
assert(-e localDir() . 'test_ignored/sub/ignored_conflict.part');
|
||||
|
||||
printInfo("Remove a directory containing an ignored file that should not be removed\n");
|
||||
remoteCleanup('test_ignored');
|
||||
csync();
|
||||
assert(-e localDir() . 'test_ignored/sub/ignored_conflict.part');
|
||||
#remove the file so next sync allow the directory to be removed
|
||||
system( "rm " . localDir() . 'test_ignored/sub/ignored_conflict.part' );
|
||||
|
||||
printInfo("Remove a directory containing a local file\n");
|
||||
remoteCleanup('test_stat');
|
||||
@@ -150,6 +164,8 @@ printInfo("Now remove the symlink\n");
|
||||
system( "rm -f " . localDir() . 'anotherdir' );
|
||||
csync();
|
||||
assertLocalAndRemoteDir( '', 0 );
|
||||
assert(! -e localDir(). 'anotherdir' );
|
||||
|
||||
|
||||
cleanup();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
use lib ".";
|
||||
|
||||
use Carp::Assert;
|
||||
|
||||
use File::Copy;
|
||||
use ownCloud::Test;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
use lib ".";
|
||||
|
||||
use Carp::Assert;
|
||||
|
||||
use File::Copy;
|
||||
use ownCloud::Test;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
use lib ".";
|
||||
|
||||
use Carp::Assert;
|
||||
|
||||
use File::Copy;
|
||||
use ownCloud::Test;
|
||||
|
||||
@@ -176,8 +176,6 @@ system("sqlite3 " . localDir().'.csync_journal.db .dump');
|
||||
#new directory should be uploaded
|
||||
system("mv " . localDir().'readonlyDirectory_PERM_M_/subdir_PERM_CK_ ' . localDir().'normalDirectory_PERM_CKDNV_/subdir_PERM_CKDNV_' );
|
||||
|
||||
# two syncs may be necessary for now: https://github.com/owncloud/mirall/issues/2038
|
||||
csync();
|
||||
csync();
|
||||
system("sqlite3 " . localDir().'.csync_journal.db .dump');
|
||||
assertCsyncJournalOk(localDir());
|
||||
@@ -209,8 +207,6 @@ system("mv " . localDir().'readonlyDirectory_PERM_M_/subdir_PERM_CK_ ' . localDi
|
||||
#2. move a directory from read to read only (move the directory from previous step)
|
||||
system("mv " . localDir().'normalDirectory_PERM_CKDNV_/subdir_PERM_CKDNV_ ' . localDir().'readonlyDirectory_PERM_M_/moved_PERM_CK_' );
|
||||
|
||||
# two syncs may be necessary for now: https://github.com/owncloud/mirall/issues/2038
|
||||
csync();
|
||||
csync();
|
||||
assertCsyncJournalOk(localDir());
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
use lib ".";
|
||||
|
||||
use Carp::Assert;
|
||||
|
||||
use File::Copy;
|
||||
use ownCloud::Test;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
The ownCloud Client reads a configuration file. You can locate this configuration files as follows:
|
||||
|
||||
- On Linux distributions:
|
||||
On Linux distributions:
|
||||
``$HOME/.local/share/data/ownCloud/owncloud.cfg``
|
||||
|
||||
- In Microsoft Windows systems:
|
||||
On Microsoft Windows systems:
|
||||
``%LOCALAPPDATA%\ownCloud\owncloud.cfg``
|
||||
|
||||
- In MAC OS X systems:
|
||||
On MAC OS X systems:
|
||||
``$HOME/Library/Application Support/ownCloud``
|
||||
|
||||
|
||||
|
||||
@@ -29,12 +29,24 @@ the server URL.
|
||||
|
||||
OPTIONS
|
||||
=======
|
||||
``--confdir`` `PATH`
|
||||
Specifies the configuration directory where `csync.conf` is located.
|
||||
``--user``, ``-u`` ``[user]``
|
||||
Use ``user`` as the login name.
|
||||
|
||||
``--silent``
|
||||
``--password``, ``-p`` ``[password]``
|
||||
Use ``password`` as the password.
|
||||
|
||||
``-n``
|
||||
Use ``netrc (5)`` for login.
|
||||
|
||||
``--non-interactive``
|
||||
Do not prompt for questions.
|
||||
|
||||
``--silent``, ``--s``
|
||||
Inhibits verbose log output.
|
||||
|
||||
``--trust``
|
||||
Trust any SSL certificate, including invalid ones.
|
||||
|
||||
``--httpproxy http://[user@pass:]<server>:<port>``
|
||||
Uses ``server`` as HTTP proxy.
|
||||
|
||||
@@ -48,6 +60,8 @@ the command line would be::
|
||||
$HOME/media/music \
|
||||
https://server/owncloud/remote.php/webdav/Music
|
||||
|
||||
``owncloudcmd`` will enquire user name and password, unless they have
|
||||
been specified on the command line or ``-n`` (see `netrc(5)`) has been passed.
|
||||
|
||||
Using the legacy scheme, it would be::
|
||||
|
||||
|
||||
@@ -22,13 +22,25 @@ the server URL.
|
||||
|
||||
Other comand line switches supported by owncloudcmd include the following:
|
||||
|
||||
- ``--silent``
|
||||
Supresses verbose log output.
|
||||
``--user``, ``-u`` ``[user]``
|
||||
Use ``user`` as the login name.
|
||||
|
||||
- ``--confdir`` `PATH`
|
||||
Fetches or stores configuration in the specified configuration directory.
|
||||
``--password``, ``-p`` ``[password]``
|
||||
Use ``password`` as the password.
|
||||
|
||||
- ``--httpproxy http://[user@pass:]<server>:<port>``
|
||||
``-n``
|
||||
Use ``netrc (5)`` for login.
|
||||
|
||||
``--non-interactive``
|
||||
Do not prompt for questions.
|
||||
|
||||
``--silent``, ``-s``
|
||||
Inhibits verbose log output.
|
||||
|
||||
``--trust``
|
||||
Trust any SSL certificate, including invalid ones.
|
||||
|
||||
``--httpproxy http://[user@pass:]<server>:<port>``
|
||||
Uses the specified ``server`` as the HTTP proxy.
|
||||
|
||||
Credential Handling
|
||||
@@ -41,18 +53,19 @@ setting with the usual URL pattern. For example::
|
||||
|
||||
https://user:secret@192.168.178.2/remote.php/webdav
|
||||
|
||||
|
||||
Example
|
||||
~~~~~~~
|
||||
|
||||
To synchronize the ownCloud directory ``Music`` to the local directory
|
||||
``media/music`, through a proxy listening on port ``8080``, and on a gateway
|
||||
``media/music``, through a proxy listening on port ``8080``, and on a gateway
|
||||
machine using IP address ``192.168.178.1``, the command line would be::
|
||||
|
||||
$ owncloudcmd --httpproxy http://192.168.178.1:8080 \
|
||||
$HOME/media/music \
|
||||
https://server/owncloud/remote.php/webdav/Music
|
||||
|
||||
``owncloudcmd`` will enquire user name and password, unless they have
|
||||
been specified on the command line or ``-n`` has been passed.
|
||||
|
||||
Using the legacy scheme, the command line would be::
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ Categories=Utility;X-SuSE-SyncUtility;
|
||||
Type=Application
|
||||
Exec=@APPLICATION_EXECUTABLE@
|
||||
Name=@APPLICATION_NAME@ desktop sync client
|
||||
Comment=@APPLICATION_NAME@ desktop synchronization client
|
||||
GenericName=Folder Sync
|
||||
Icon=@APPLICATION_EXECUTABLE@
|
||||
Keywords=@APPLICATION_NAME@;syncing;file;sharing;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<file>resources/settings.png</file>
|
||||
<file>resources/activity.png</file>
|
||||
<file>resources/network.png</file>
|
||||
<file>resources/owncloud_logo_blue.png</file>
|
||||
<file>resources/lock-http.png</file>
|
||||
<file>resources/lock-https.png</file>
|
||||
</qresource>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
if(APPLE)
|
||||
add_custom_target( mac_overlayplugin ALL
|
||||
xcodebuild -workspace ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/LiferayNativity.xcworkspace
|
||||
-scheme LiferayNativity.osax SYMROOT=${CMAKE_CURRENT_BINARY_DIR} archive
|
||||
COMMENT building Mac Overlay iccons)
|
||||
xcodebuild -workspace ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/OwnCloud.xcworkspace
|
||||
-scheme OwnCloudFinder.osax SYMROOT=${CMAKE_CURRENT_BINARY_DIR} archive
|
||||
COMMENT building Mac Overlay icons)
|
||||
|
||||
INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Release/LiferayNativity.osax/Contents
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/Library/ScriptingAdditions/LiferayNativity.osax/ )
|
||||
INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Release/OwnCloudFinder.osax/Contents
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/Library/ScriptingAdditions/OwnCloudFinder.osax/ )
|
||||
endif(APPLE)
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:LiferayNativityFinder/LiferayNativityFinder.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:LiferayNativityInjector/LiferayNativityInjector.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
type = "0"
|
||||
version = "1.0">
|
||||
<FileBreakpoints>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "LiferayNativityFinder/ContentManager.m"
|
||||
timestampString = "426161859.780288"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "90"
|
||||
endingLineNumber = "90"
|
||||
landmarkName = "-setResultForPath:result:"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
</FileBreakpoints>
|
||||
</Bucket>
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface NSObject (ContextMenuHandlers)
|
||||
|
||||
struct TFENodeVector;
|
||||
|
||||
+ (void)ContextMenuHandlers_handleContextMenuCommon:(unsigned int)arg1 nodes:(const struct TFENodeVector*)arg2 event:(id)arg3 view:(id)arg4 browserController:(id)arg5 addPlugIns:(BOOL)arg6;
|
||||
+ (void)ContextMenuHandlers_handleContextMenuCommon:(unsigned int)arg1 nodes:(const struct TFENodeVector*)arg2 event:(id)arg3 view:(id)arg4 windowController:(id)arg5 addPlugIns:(BOOL)arg6;
|
||||
+ (void)ContextMenuHandlers_addViewSpecificStuffToMenu:(id)arg1 browserViewController:(id)arg2 context:(unsigned int)arg3;
|
||||
|
||||
- (void)ContextMenuHandlers_configureWithNodes:(const struct TFENodeVector*)arg1 browserController:(id)arg2 container:(BOOL)arg3;
|
||||
- (void)ContextMenuHandlers_configureWithNodes:(const struct TFENodeVector*)arg1 windowController:(id)arg2 container:(BOOL)arg3;
|
||||
|
||||
@end
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,125 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
#import "ContentManager.h"
|
||||
#import "FinderHook.h"
|
||||
#import "IconCache.h"
|
||||
#import "objc/objc-class.h"
|
||||
#import "RequestManager.h"
|
||||
|
||||
static BOOL installed = NO;
|
||||
|
||||
@implementation FinderHook
|
||||
|
||||
+ (void)hookClassMethod:(SEL)oldSelector inClass:(NSString*)className toCallToTheNewMethod:(SEL)newSelector
|
||||
{
|
||||
Class hookedClass = NSClassFromString(className);
|
||||
Method oldMethod = class_getClassMethod(hookedClass, oldSelector);
|
||||
Method newMethod = class_getClassMethod(hookedClass, newSelector);
|
||||
|
||||
method_exchangeImplementations(newMethod, oldMethod);
|
||||
}
|
||||
|
||||
+ (void)hookMethod:(SEL)oldSelector inClass:(NSString*)className toCallToTheNewMethod:(SEL)newSelector
|
||||
{
|
||||
Class hookedClass = NSClassFromString(className);
|
||||
Method oldMethod = class_getInstanceMethod(hookedClass, oldSelector);
|
||||
Method newMethod = class_getInstanceMethod(hookedClass, newSelector);
|
||||
|
||||
method_exchangeImplementations(newMethod, oldMethod);
|
||||
}
|
||||
|
||||
+ (void)install
|
||||
{
|
||||
if (installed)
|
||||
{
|
||||
NSLog(@"LiferayNativityFinder: already installed");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
NSLog(@"LiferayNativityFinder: installing ownCloud Shell extension");
|
||||
|
||||
[RequestManager sharedInstance];
|
||||
|
||||
// Icons
|
||||
[self hookMethod:@selector(drawImage:) inClass:@"IKImageBrowserCell" toCallToTheNewMethod:@selector(IconOverlayHandlers_IKImageBrowserCell_drawImage:)]; // 10.7 & 10.8 & 10.9 (Icon View arrange by name)
|
||||
|
||||
[self hookMethod:@selector(drawImage:) inClass:@"IKFinderReflectiveIconCell" toCallToTheNewMethod:@selector(IconOverlayHandlers_IKFinderReflectiveIconCell_drawImage:)]; // 10.7 & 10.8 & 10.9 (Icon View arrange by everything else)
|
||||
|
||||
[self hookMethod:@selector(drawIconWithFrame:) inClass:@"TListViewIconAndTextCell" toCallToTheNewMethod:@selector(IconOverlayHandlers_drawIconWithFrame:)]; // 10.7 & 10.8 & 10.9 Column View
|
||||
|
||||
[self hookMethod:@selector(drawRect:) inClass:@"TDimmableIconImageView" toCallToTheNewMethod:@selector(IconOverlayHandlers_drawRect:)]; // 10.9 (List and Coverflow Views)
|
||||
|
||||
// Context Menus
|
||||
[self hookClassMethod:@selector(addViewSpecificStuffToMenu:browserViewController:context:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(ContextMenuHandlers_addViewSpecificStuffToMenu:browserViewController:context:)]; // 10.7 & 10.8
|
||||
|
||||
[self hookClassMethod:@selector(addViewSpecificStuffToMenu:clickedView:browserViewController:context:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(ContextMenuHandlers_addViewSpecificStuffToMenu:clickedView:browserViewController:context:)]; // 10.9
|
||||
|
||||
[self hookClassMethod:@selector(handleContextMenuCommon:nodes:event:view:windowController:addPlugIns:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(ContextMenuHandlers_handleContextMenuCommon:nodes:event:view:windowController:addPlugIns:)]; // 10.7
|
||||
|
||||
[self hookClassMethod:@selector(handleContextMenuCommon:nodes:event:view:browserController:addPlugIns:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(ContextMenuHandlers_handleContextMenuCommon:nodes:event:view:browserController:addPlugIns:)]; // 10.8
|
||||
|
||||
[self hookClassMethod:@selector(handleContextMenuCommon:nodes:event:clickedView:browserViewController:addPlugIns:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(ContextMenuHandlers_handleContextMenuCommon:nodes:event:clickedView:browserViewController:addPlugIns:)]; // 10.9
|
||||
|
||||
[self hookMethod:@selector(configureWithNodes:windowController:container:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(ContextMenuHandlers_configureWithNodes:windowController:container:)]; // 10.7
|
||||
|
||||
[self hookMethod:@selector(configureWithNodes:browserController:container:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(ContextMenuHandlers_configureWithNodes:browserController:container:)]; // 10.8
|
||||
|
||||
[self hookMethod:@selector(configureFromMenuNeedsUpdate:clickedView:container:event:selectedNodes:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(ContextMenuHandlers_configureFromMenuNeedsUpdate:clickedView:container:event:selectedNodes:)]; // 10.9
|
||||
|
||||
installed = YES;
|
||||
|
||||
NSLog(@"LiferayNativityFinder: installed");
|
||||
}
|
||||
|
||||
+ (void)uninstall
|
||||
{
|
||||
if (!installed)
|
||||
{
|
||||
NSLog(@"LiferayNativityFinder: not installed");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
NSLog(@"LiferayNativityFinder: uninstalling");
|
||||
|
||||
[[ContentManager sharedInstance] dealloc];
|
||||
|
||||
[[IconCache sharedInstance] dealloc];
|
||||
|
||||
[[RequestManager sharedInstance] dealloc];
|
||||
|
||||
// Icons
|
||||
[self hookMethod:@selector(IconOverlayHandlers_drawImage:) inClass:@"TIconViewCell" toCallToTheNewMethod:@selector(drawImage:)]; // 10.7 & 10.8 & 10.9
|
||||
|
||||
[self hookMethod:@selector(IconOverlayHandlers_drawIconWithFrame:) inClass:@"TListViewIconAndTextCell" toCallToTheNewMethod:@selector(drawIconWithFrame:)]; // 10.7 & 10.8 & 10.9
|
||||
|
||||
// Context Menus
|
||||
[self hookClassMethod:@selector(ContextMenuHandlers_addViewSpecificStuffToMenu:browserViewController:context:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(addViewSpecificStuffToMenu:browserViewController:context:)]; // 10.7 & 10.8
|
||||
|
||||
[self hookClassMethod:@selector(ContextMenuHandlers_handleContextMenuCommon:nodes:event:view:windowController:addPlugIns:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(handleContextMenuCommon:nodes:event:view:windowController:addPlugIns:)]; // 10.7
|
||||
|
||||
[self hookMethod:@selector(ContextMenuHandlers_configureWithNodes:windowController:container:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(configureWithNodes:windowController:container:)]; // 10.7
|
||||
|
||||
[self hookClassMethod:@selector(ContextMenuHandlers_handleContextMenuCommon:nodes:event:view:browserController:addPlugIns:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(handleContextMenuCommon:nodes:event:view:browserController:addPlugIns:)]; // 10.8
|
||||
|
||||
[self hookMethod:@selector(ContextMenuHandlers_configureWithNodes:browserController:container:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(configureWithNodes:browserController:container:)]; // 10.8
|
||||
|
||||
installed = NO;
|
||||
|
||||
NSLog(@"LiferayNativityFinder: uninstalled");
|
||||
}
|
||||
|
||||
@end
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
|
||||
<dictionary title="LiferayNativityInjector Terminology">
|
||||
<suite name="LiferayNativityInjector Suite" code="NVTY" description="LiferayNativity Injector commands">
|
||||
<command name="install LiferayNativity" code="NVTYload" description="Loads LiferayNativity into the Finder process"/>
|
||||
<command name="uninstall LiferayNativity" code="NVTYunld" description="Unloads LiferayNativity from the Finder process"/>
|
||||
<command name="check LiferayNativity" code="NVTYlded" description="Checks if LiferayNativity is loaded in Finder process"/>
|
||||
</suite>
|
||||
</dictionary>
|
||||
10
shell_integration/MacOSX/OwnCloud.xcworkspace/contents.xcworkspacedata
generated
Normal file
10
shell_integration/MacOSX/OwnCloud.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:OwnCloudFinder/OwnCloudFinder.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:OwnCloudInjector/OwnCloudInjector.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
|
||||
<false/>
|
||||
<key>IDESourceControlProjectIdentifier</key>
|
||||
<string>5264E8F5-AB49-45F3-868F-647EEFAB70E0</string>
|
||||
<key>IDESourceControlProjectName</key>
|
||||
<string>OwnCloud</string>
|
||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||
<dict>
|
||||
<key>09EE94AA-F410-4594-AB26-5A0220DEAEC7</key>
|
||||
<string>ssh://github.com/owncloud/mirall.git</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectPath</key>
|
||||
<string>shell_integration/MacOSX/OwnCloud.xcworkspace</string>
|
||||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||
<dict>
|
||||
<key>09EE94AA-F410-4594-AB26-5A0220DEAEC7</key>
|
||||
<string>../../..</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectURL</key>
|
||||
<string>ssh://github.com/owncloud/mirall.git</string>
|
||||
<key>IDESourceControlProjectVersion</key>
|
||||
<integer>110</integer>
|
||||
<key>IDESourceControlProjectWCCIdentifier</key>
|
||||
<string>09EE94AA-F410-4594-AB26-5A0220DEAEC7</string>
|
||||
<key>IDESourceControlProjectWCConfigurations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
||||
<string>public.vcs.git</string>
|
||||
<key>IDESourceControlWCCIdentifierKey</key>
|
||||
<string>09EE94AA-F410-4594-AB26-5A0220DEAEC7</string>
|
||||
<key>IDESourceControlWCCName</key>
|
||||
<string>mirall</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -18,6 +18,7 @@
|
||||
{
|
||||
NSMutableDictionary* _fileNamesCache;
|
||||
BOOL _fileIconsEnabled;
|
||||
BOOL _hasChangedContent;
|
||||
|
||||
NSNumber *_icnOk;
|
||||
NSNumber *_icnSync;
|
||||
@@ -38,6 +39,9 @@
|
||||
- (void)setIcons:(NSDictionary*)iconDictionary filterByFolder:(NSString*)filterFolder;
|
||||
- (void)setResultForPath:(NSString*)path result:(NSString*)result;
|
||||
- (void)clearFileNameCacheForPath:(NSString*)path;
|
||||
- (void)reFetchFileNameCacheForPath:(NSString*)path;
|
||||
- (void)repaintAllWindows;
|
||||
|
||||
- (void)loadIconResourcePath:(NSString*)path;
|
||||
|
||||
@end
|
||||
@@ -31,19 +31,7 @@ static ContentManager* sharedInstance = nil;
|
||||
{
|
||||
_fileNamesCache = [[NSMutableDictionary alloc] init];
|
||||
_fileIconsEnabled = TRUE;
|
||||
|
||||
NSString *base = @"/Applications/owncloud.app/Contents/Resources/icons/";
|
||||
|
||||
_icnOk = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"ok.icns"]];
|
||||
_icnSync = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"sync.icns"]];
|
||||
_icnWarn = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"warning.icns"]];
|
||||
_icnErr = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"error.icns"]];
|
||||
_icnOkSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"ok_swm.icns"]];
|
||||
_icnSyncSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"sync_swm.icns"]];
|
||||
_icnWarnSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"warning_swm.icns"]];
|
||||
_icnErrSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"error_swm.icns"]];
|
||||
|
||||
NSLog(@"Icon ok identifier: %d", [_icnOk intValue]);
|
||||
_hasChangedContent = TRUE;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -71,6 +59,22 @@ static ContentManager* sharedInstance = nil;
|
||||
return sharedInstance;
|
||||
}
|
||||
|
||||
- (void)loadIconResourcePath:(NSString*)path
|
||||
{
|
||||
NSString *base = path;
|
||||
|
||||
_icnOk = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"ok.icns"]];
|
||||
_icnSync = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"sync.icns"]];
|
||||
_icnWarn = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"warning.icns"]];
|
||||
_icnErr = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"error.icns"]];
|
||||
_icnOkSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"ok_swm.icns"]];
|
||||
_icnSyncSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"sync_swm.icns"]];
|
||||
_icnWarnSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"warning_swm.icns"]];
|
||||
_icnErrSwm = [[IconCache sharedInstance] registerIcon:[base stringByAppendingString:@"error_swm.icns"]];
|
||||
|
||||
NSLog(@"Icon ok identifier: %d from %@", [_icnOk intValue], [base stringByAppendingString:@"ok.icns"]);
|
||||
}
|
||||
|
||||
- (void)enableFileIcons:(BOOL)enable
|
||||
{
|
||||
_fileIconsEnabled = enable;
|
||||
@@ -80,6 +84,10 @@ static ContentManager* sharedInstance = nil;
|
||||
|
||||
- (void)setResultForPath:(NSString*)path result:(NSString*)result
|
||||
{
|
||||
if (_icnOk == nil) {
|
||||
// no icon resource path registered yet
|
||||
return;
|
||||
}
|
||||
|
||||
NSNumber *res;
|
||||
res = [NSNumber numberWithInt:0];
|
||||
@@ -107,14 +115,18 @@ static ContentManager* sharedInstance = nil;
|
||||
}
|
||||
|
||||
NSString* normalizedPath = [path decomposedStringWithCanonicalMapping];
|
||||
[_fileNamesCache setObject:res forKey:normalizedPath];
|
||||
// NSLog(@"SET value %d", [res intValue]);
|
||||
|
||||
[self repaintAllWindows];
|
||||
|
||||
if (![_fileNamesCache objectForKey:normalizedPath] || ![[_fileNamesCache objectForKey:normalizedPath] isEqualTo:res]) {
|
||||
[_fileNamesCache setObject:res forKey:normalizedPath];
|
||||
//NSLog(@"SET value %d %@", [res intValue], normalizedPath);
|
||||
_hasChangedContent = YES;
|
||||
[self performSelector:@selector(repaintAllWindowsIfNeeded) withObject:0 afterDelay:1.0]; // 1 sec
|
||||
}
|
||||
}
|
||||
|
||||
- (NSNumber*)iconByPath:(NSString*)path isDirectory:(BOOL)isDir
|
||||
{
|
||||
//NSLog(@"%@ %@", NSStringFromSelector(_cmd), path);
|
||||
if (!_fileIconsEnabled)
|
||||
{
|
||||
NSLog(@"Icons are NOT ENABLED!");
|
||||
@@ -126,9 +138,13 @@ static ContentManager* sharedInstance = nil;
|
||||
return res;
|
||||
}
|
||||
NSString* normalizedPath = [path decomposedStringWithCanonicalMapping];
|
||||
|
||||
if (![[RequestManager sharedInstance] isRegisteredPath:normalizedPath isDirectory:isDir]) {
|
||||
return [NSNumber numberWithInt:0];
|
||||
}
|
||||
|
||||
NSNumber* result = [_fileNamesCache objectForKey:normalizedPath];
|
||||
// NSLog(@"XXXXXXX Asking for icon for path %@ = %d",path, [result intValue]);
|
||||
// NSLog(@"XXXXXXX Asking for icon for path %@ = %d",normalizedPath, [result intValue]);
|
||||
|
||||
if( result == nil ) {
|
||||
// start the async call
|
||||
@@ -151,6 +167,7 @@ static ContentManager* sharedInstance = nil;
|
||||
// it clears the entries from the hash to make it call again home to mirall.
|
||||
- (void)clearFileNameCacheForPath:(NSString*)path
|
||||
{
|
||||
NSLog(@"%@", NSStringFromSelector(_cmd));
|
||||
NSMutableArray *keysToDelete = [NSMutableArray array];
|
||||
|
||||
if( path != nil ) {
|
||||
@@ -170,12 +187,30 @@ static ContentManager* sharedInstance = nil;
|
||||
if( [keysToDelete count] > 0 ) {
|
||||
NSLog( @"Entries to delete: %d", [keysToDelete count]);
|
||||
[_fileNamesCache removeObjectsForKeys:keysToDelete];
|
||||
|
||||
[self repaintAllWindows];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (void)reFetchFileNameCacheForPath:(NSString*)path
|
||||
{
|
||||
NSLog(@"%@", NSStringFromSelector(_cmd));
|
||||
|
||||
for (id p in [_fileNamesCache keyEnumerator]) {
|
||||
if ( path && [p hasPrefix:path] ) {
|
||||
[[RequestManager sharedInstance] askForIcon:p isDirectory:false]; // FIXME isDirectory parameter
|
||||
//[_fileNamesCache setObject:askState forKey:p]; We don't do this since we want to keep the old icon meanwhile
|
||||
//NSLog(@"%@ %@", NSStringFromSelector(_cmd), p);
|
||||
}
|
||||
}
|
||||
|
||||
// Ask for directory itself
|
||||
if ([path hasSuffix:@"/"]) {
|
||||
path = [path substringToIndex:path.length - 1];
|
||||
}
|
||||
[[RequestManager sharedInstance] askForIcon:path isDirectory:true];
|
||||
//NSLog(@"%@ %@", NSStringFromSelector(_cmd), path);
|
||||
}
|
||||
|
||||
|
||||
- (void)removeAllIcons
|
||||
{
|
||||
[_fileNamesCache removeAllObjects];
|
||||
@@ -195,8 +230,20 @@ static ContentManager* sharedInstance = nil;
|
||||
[self repaintAllWindows];
|
||||
}
|
||||
|
||||
- (void)repaintAllWindowsIfNeeded
|
||||
{
|
||||
if (!_hasChangedContent) {
|
||||
NSLog(@"%@ Repaint scheduled but not needed", NSStringFromSelector(_cmd));
|
||||
return;
|
||||
}
|
||||
|
||||
_hasChangedContent = NO;
|
||||
[self repaintAllWindows];
|
||||
}
|
||||
|
||||
- (void)repaintAllWindows
|
||||
{
|
||||
NSLog(@"%@", NSStringFromSelector(_cmd));
|
||||
NSArray* windows = [[NSApplication sharedApplication] windows];
|
||||
|
||||
for (int i = 0; i < [windows count]; i++)
|
||||
@@ -237,7 +284,7 @@ static ContentManager* sharedInstance = nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"LiferayNativityFinder: refreshing icon badges failed");
|
||||
NSLog(@"OwnCloudFinder: refreshing icon badges failed");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -286,7 +333,7 @@ static ContentManager* sharedInstance = nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"LiferayNativityFinder: refreshing icon badges failed");
|
||||
NSLog(@"OwnCloudFinder: refreshing icon badges failed");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -297,6 +344,7 @@ static ContentManager* sharedInstance = nil;
|
||||
|
||||
- (void)setIcons:(NSDictionary*)iconDictionary filterByFolder:(NSString*)filterFolder
|
||||
{
|
||||
NSLog(@"%@", NSStringFromSelector(_cmd));
|
||||
for (NSString* path in iconDictionary)
|
||||
{
|
||||
if (filterFolder && ![path hasPrefix:filterFolder])
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface NSObject (ContextMenuHandlers)
|
||||
|
||||
struct TFENodeVector;
|
||||
|
||||
+ (void)OCContextMenuHandlers_handleContextMenuCommon:(unsigned int)arg1 nodes:(const struct TFENodeVector*)arg2 event:(id)arg3 view:(id)arg4 browserController:(id)arg5 addPlugIns:(BOOL)arg6;
|
||||
+ (void)OCContextMenuHandlers_handleContextMenuCommon:(unsigned int)arg1 nodes:(const struct TFENodeVector*)arg2 event:(id)arg3 view:(id)arg4 windowController:(id)arg5 addPlugIns:(BOOL)arg6;
|
||||
+ (void)OCContextMenuHandlers_addViewSpecificStuffToMenu:(id)arg1 browserViewController:(id)arg2 context:(unsigned int)arg3;
|
||||
|
||||
- (void)OCContextMenuHandlers_configureWithNodes:(const struct TFENodeVector*)arg1 browserController:(id)arg2 container:(BOOL)arg3;
|
||||
- (void)OCContextMenuHandlers_configureWithNodes:(const struct TFENodeVector*)arg1 windowController:(id)arg2 container:(BOOL)arg3;
|
||||
|
||||
@end
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
@implementation NSObject (ContextMenuHandlers)
|
||||
|
||||
+ (void)ContextMenuHandlers_addViewSpecificStuffToMenu:(id)arg1 browserViewController:(id)arg2 context:(unsigned int)arg3 // 10.7 & 10.8
|
||||
+ (void)OCContextMenuHandlers_addViewSpecificStuffToMenu:(id)arg1 browserViewController:(id)arg2 context:(unsigned int)arg3 // 10.7 & 10.8
|
||||
{
|
||||
[self ContextMenuHandlers_addViewSpecificStuffToMenu:arg1 browserViewController:arg2 context:arg3];
|
||||
[self OCContextMenuHandlers_addViewSpecificStuffToMenu:arg1 browserViewController:arg2 context:arg3];
|
||||
|
||||
MenuManager* menuManager = [MenuManager sharedInstance];
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)ContextMenuHandlers_addViewSpecificStuffToMenu:(id)arg1 clickedView:(id)arg2 browserViewController:(id)arg3 context:(unsigned int)arg4 // 10.9
|
||||
+ (void)OCContextMenuHandlers_addViewSpecificStuffToMenu:(id)arg1 clickedView:(id)arg2 browserViewController:(id)arg3 context:(unsigned int)arg4 // 10.9
|
||||
{
|
||||
[self ContextMenuHandlers_addViewSpecificStuffToMenu:arg1 clickedView:arg2 browserViewController:arg3 context:arg4];
|
||||
[self OCContextMenuHandlers_addViewSpecificStuffToMenu:arg1 clickedView:arg2 browserViewController:arg3 context:arg4];
|
||||
|
||||
MenuManager* menuManager = [MenuManager sharedInstance];
|
||||
|
||||
125
shell_integration/MacOSX/OwnCloudFinder/FinderHook.m
Normal file
125
shell_integration/MacOSX/OwnCloudFinder/FinderHook.m
Normal file
@@ -0,0 +1,125 @@
|
||||
/**
|
||||
* Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Lesser General Public License as published by the Free
|
||||
* Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
#import "ContentManager.h"
|
||||
#import "FinderHook.h"
|
||||
#import "IconCache.h"
|
||||
#import "objc/objc-class.h"
|
||||
#import "RequestManager.h"
|
||||
|
||||
static BOOL installed = NO;
|
||||
|
||||
@implementation FinderHook
|
||||
|
||||
+ (void)hookClassMethod:(SEL)oldSelector inClass:(NSString*)className toCallToTheNewMethod:(SEL)newSelector
|
||||
{
|
||||
Class hookedClass = NSClassFromString(className);
|
||||
Method oldMethod = class_getClassMethod(hookedClass, oldSelector);
|
||||
Method newMethod = class_getClassMethod(hookedClass, newSelector);
|
||||
|
||||
method_exchangeImplementations(newMethod, oldMethod);
|
||||
}
|
||||
|
||||
+ (void)hookMethod:(SEL)oldSelector inClass:(NSString*)className toCallToTheNewMethod:(SEL)newSelector
|
||||
{
|
||||
Class hookedClass = NSClassFromString(className);
|
||||
Method oldMethod = class_getInstanceMethod(hookedClass, oldSelector);
|
||||
Method newMethod = class_getInstanceMethod(hookedClass, newSelector);
|
||||
|
||||
method_exchangeImplementations(newMethod, oldMethod);
|
||||
}
|
||||
|
||||
+ (void)install
|
||||
{
|
||||
if (installed)
|
||||
{
|
||||
NSLog(@"OwnCloudFinder: already installed");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
NSLog(@"OwnCloudFinder: installing ownCloud Shell extension");
|
||||
|
||||
[RequestManager sharedInstance];
|
||||
|
||||
// Icons
|
||||
[self hookMethod:@selector(drawImage:) inClass:@"IKImageBrowserCell" toCallToTheNewMethod:@selector(OCIconOverlayHandlers_IKImageBrowserCell_drawImage:)]; // 10.7 & 10.8 & 10.9 (Icon View arrange by name)
|
||||
|
||||
[self hookMethod:@selector(drawImage:) inClass:@"IKFinderReflectiveIconCell" toCallToTheNewMethod:@selector(OCIconOverlayHandlers_IKFinderReflectiveIconCell_drawImage:)]; // 10.7 & 10.8 & 10.9 (Icon View arrange by everything else)
|
||||
|
||||
[self hookMethod:@selector(drawIconWithFrame:) inClass:@"TListViewIconAndTextCell" toCallToTheNewMethod:@selector(OCIconOverlayHandlers_drawIconWithFrame:)]; // 10.7 & 10.8 & 10.9 Column View
|
||||
|
||||
[self hookMethod:@selector(drawRect:) inClass:@"TDimmableIconImageView" toCallToTheNewMethod:@selector(OCIconOverlayHandlers_drawRect:)]; // 10.9 (List and Coverflow Views)
|
||||
|
||||
// Context Menus
|
||||
[self hookClassMethod:@selector(addViewSpecificStuffToMenu:browserViewController:context:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(OCContextMenuHandlers_addViewSpecificStuffToMenu:browserViewController:context:)]; // 10.7 & 10.8
|
||||
|
||||
[self hookClassMethod:@selector(addViewSpecificStuffToMenu:clickedView:browserViewController:context:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(OCContextMenuHandlers_addViewSpecificStuffToMenu:clickedView:browserViewController:context:)]; // 10.9
|
||||
|
||||
[self hookClassMethod:@selector(handleContextMenuCommon:nodes:event:view:windowController:addPlugIns:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(OCContextMenuHandlers_handleContextMenuCommon:nodes:event:view:windowController:addPlugIns:)]; // 10.7
|
||||
|
||||
[self hookClassMethod:@selector(handleContextMenuCommon:nodes:event:view:browserController:addPlugIns:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(OCContextMenuHandlers_handleContextMenuCommon:nodes:event:view:browserController:addPlugIns:)]; // 10.8
|
||||
|
||||
[self hookClassMethod:@selector(handleContextMenuCommon:nodes:event:clickedView:browserViewController:addPlugIns:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(OCContextMenuHandlers_handleContextMenuCommon:nodes:event:clickedView:browserViewController:addPlugIns:)]; // 10.9
|
||||
|
||||
[self hookMethod:@selector(configureWithNodes:windowController:container:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(OCContextMenuHandlers_configureWithNodes:windowController:container:)]; // 10.7
|
||||
|
||||
[self hookMethod:@selector(configureWithNodes:browserController:container:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(OCContextMenuHandlers_configureWithNodes:browserController:container:)]; // 10.8
|
||||
|
||||
[self hookMethod:@selector(configureFromMenuNeedsUpdate:clickedView:container:event:selectedNodes:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(OCContextMenuHandlers_configureFromMenuNeedsUpdate:clickedView:container:event:selectedNodes:)]; // 10.9
|
||||
|
||||
installed = YES;
|
||||
|
||||
NSLog(@"OwnCloudFinder: installed");
|
||||
}
|
||||
|
||||
+ (void)uninstall
|
||||
{
|
||||
if (!installed)
|
||||
{
|
||||
NSLog(@"OwnCloudFinder: not installed");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
NSLog(@"OwnCloudFinder: uninstalling");
|
||||
|
||||
[[ContentManager sharedInstance] dealloc];
|
||||
|
||||
[[IconCache sharedInstance] dealloc];
|
||||
|
||||
[[RequestManager sharedInstance] dealloc];
|
||||
|
||||
// Icons
|
||||
[self hookMethod:@selector(OCIconOverlayHandlers_drawImage:) inClass:@"TIconViewCell" toCallToTheNewMethod:@selector(drawImage:)]; // 10.7 & 10.8 & 10.9
|
||||
|
||||
[self hookMethod:@selector(OCIconOverlayHandlers_drawIconWithFrame:) inClass:@"TListViewIconAndTextCell" toCallToTheNewMethod:@selector(drawIconWithFrame:)]; // 10.7 & 10.8 & 10.9
|
||||
|
||||
// Context Menus
|
||||
[self hookClassMethod:@selector(OCContextMenuHandlers_addViewSpecificStuffToMenu:browserViewController:context:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(addViewSpecificStuffToMenu:browserViewController:context:)]; // 10.7 & 10.8
|
||||
|
||||
[self hookClassMethod:@selector(OCContextMenuHandlers_handleContextMenuCommon:nodes:event:view:windowController:addPlugIns:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(handleContextMenuCommon:nodes:event:view:windowController:addPlugIns:)]; // 10.7
|
||||
|
||||
[self hookMethod:@selector(OCContextMenuHandlers_configureWithNodes:windowController:container:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(configureWithNodes:windowController:container:)]; // 10.7
|
||||
|
||||
[self hookClassMethod:@selector(OCContextMenuHandlers_handleContextMenuCommon:nodes:event:view:browserController:addPlugIns:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(handleContextMenuCommon:nodes:event:view:browserController:addPlugIns:)]; // 10.8
|
||||
|
||||
[self hookMethod:@selector(OCContextMenuHandlers_configureWithNodes:browserController:container:) inClass:@"TContextMenu" toCallToTheNewMethod:@selector(configureWithNodes:browserController:container:)]; // 10.8
|
||||
|
||||
installed = NO;
|
||||
|
||||
NSLog(@"OwnCloudFinder: uninstalled");
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -3,25 +3,77 @@
|
||||
//
|
||||
// This class is in the public domain.
|
||||
// Originally created by Robbie Hanson in Q3 2010.
|
||||
// Updated and maintained by Deusty LLC and the Mac development community.
|
||||
// Updated and maintained by Deusty LLC and the Apple development community.
|
||||
//
|
||||
// http://code.google.com/p/cocoaasyncsocket/
|
||||
// https://github.com/robbiehanson/CocoaAsyncSocket
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Security/Security.h>
|
||||
#import <Security/SecureTransport.h>
|
||||
#import <dispatch/dispatch.h>
|
||||
|
||||
@class GCDAsyncReadPacket;
|
||||
@class GCDAsyncWritePacket;
|
||||
@class GCDAsyncSocketPreBuffer;
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
|
||||
// Compiling for iOS
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 50000 // iOS 5.0 supported
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 50000 // iOS 5.0 supported and required
|
||||
|
||||
#define IS_SECURE_TRANSPORT_AVAILABLE YES
|
||||
#define SECURE_TRANSPORT_MAYBE_AVAILABLE 1
|
||||
#define SECURE_TRANSPORT_MAYBE_UNAVAILABLE 0
|
||||
|
||||
#else // iOS 5.0 supported but not required
|
||||
|
||||
#ifndef NSFoundationVersionNumber_iPhoneOS_5_0
|
||||
#define NSFoundationVersionNumber_iPhoneOS_5_0 881.00
|
||||
#endif
|
||||
|
||||
#define IS_SECURE_TRANSPORT_AVAILABLE (NSFoundationVersionNumber >= NSFoundationVersionNumber_iPhoneOS_5_0)
|
||||
#define SECURE_TRANSPORT_MAYBE_AVAILABLE 1
|
||||
#define SECURE_TRANSPORT_MAYBE_UNAVAILABLE 1
|
||||
|
||||
#endif
|
||||
|
||||
#else // iOS 5.0 not supported
|
||||
|
||||
#define IS_SECURE_TRANSPORT_AVAILABLE NO
|
||||
#define SECURE_TRANSPORT_MAYBE_AVAILABLE 0
|
||||
#define SECURE_TRANSPORT_MAYBE_UNAVAILABLE 1
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
// Compiling for Mac OS X
|
||||
|
||||
#define IS_SECURE_TRANSPORT_AVAILABLE YES
|
||||
#define SECURE_TRANSPORT_MAYBE_AVAILABLE 1
|
||||
#define SECURE_TRANSPORT_MAYBE_UNAVAILABLE 0
|
||||
|
||||
#endif
|
||||
|
||||
extern NSString *const GCDAsyncSocketException;
|
||||
extern NSString *const GCDAsyncSocketErrorDomain;
|
||||
|
||||
#if !TARGET_OS_IPHONE
|
||||
extern NSString *const GCDAsyncSocketQueueName;
|
||||
extern NSString *const GCDAsyncSocketThreadName;
|
||||
|
||||
#if SECURE_TRANSPORT_MAYBE_AVAILABLE
|
||||
extern NSString *const GCDAsyncSocketSSLCipherSuites;
|
||||
#if TARGET_OS_IPHONE
|
||||
extern NSString *const GCDAsyncSocketSSLProtocolVersionMin;
|
||||
extern NSString *const GCDAsyncSocketSSLProtocolVersionMax;
|
||||
#else
|
||||
extern NSString *const GCDAsyncSocketSSLDiffieHellmanParameters;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
enum GCDAsyncSocketError
|
||||
{
|
||||
@@ -42,51 +94,6 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface GCDAsyncSocket : NSObject
|
||||
{
|
||||
uint32_t flags;
|
||||
uint16_t config;
|
||||
|
||||
id delegate;
|
||||
dispatch_queue_t delegateQueue;
|
||||
|
||||
int socket4FD;
|
||||
int socket6FD;
|
||||
int connectIndex;
|
||||
NSData * connectInterface4;
|
||||
NSData * connectInterface6;
|
||||
|
||||
dispatch_queue_t socketQueue;
|
||||
|
||||
dispatch_source_t accept4Source;
|
||||
dispatch_source_t accept6Source;
|
||||
dispatch_source_t connectTimer;
|
||||
dispatch_source_t readSource;
|
||||
dispatch_source_t writeSource;
|
||||
dispatch_source_t readTimer;
|
||||
dispatch_source_t writeTimer;
|
||||
|
||||
NSMutableArray *readQueue;
|
||||
NSMutableArray *writeQueue;
|
||||
|
||||
GCDAsyncReadPacket *currentRead;
|
||||
GCDAsyncWritePacket *currentWrite;
|
||||
|
||||
unsigned long socketFDBytesAvailable;
|
||||
|
||||
NSMutableData *partialReadBuffer;
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
CFStreamClientContext streamContext;
|
||||
CFReadStreamRef readStream;
|
||||
CFWriteStreamRef writeStream;
|
||||
#else
|
||||
SSLContextRef sslContext;
|
||||
NSMutableData *sslReadBuffer;
|
||||
size_t sslWriteCachedLength;
|
||||
#endif
|
||||
|
||||
id userData;
|
||||
}
|
||||
|
||||
/**
|
||||
* GCDAsyncSocket uses the standard delegate paradigm,
|
||||
@@ -99,6 +106,8 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
* The socket queue is optional.
|
||||
* If you pass NULL, GCDAsyncSocket will automatically create it's own socket queue.
|
||||
* If you choose to provide a socket queue, the socket queue must not be a concurrent queue.
|
||||
* If you choose to provide a socket queue, and the socket queue has a configured target queue,
|
||||
* then please see the discussion for the method markSocketQueueTargetQueue.
|
||||
*
|
||||
* The delegate queue and socket queue can optionally be the same.
|
||||
**/
|
||||
@@ -121,39 +130,6 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
- (void)setDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegateQueue;
|
||||
- (void)synchronouslySetDelegate:(id)delegate delegateQueue:(dispatch_queue_t)delegateQueue;
|
||||
|
||||
/**
|
||||
* Traditionally sockets are not closed until the conversation is over.
|
||||
* However, it is technically possible for the remote enpoint to close its write stream.
|
||||
* Our socket would then be notified that there is no more data to be read,
|
||||
* but our socket would still be writeable and the remote endpoint could continue to receive our data.
|
||||
*
|
||||
* The argument for this confusing functionality stems from the idea that a client could shut down its
|
||||
* write stream after sending a request to the server, thus notifying the server there are to be no further requests.
|
||||
* In practice, however, this technique did little to help server developers.
|
||||
*
|
||||
* To make matters worse, from a TCP perspective there is no way to tell the difference from a read stream close
|
||||
* and a full socket close. They both result in the TCP stack receiving a FIN packet. The only way to tell
|
||||
* is by continuing to write to the socket. If it was only a read stream close, then writes will continue to work.
|
||||
* Otherwise an error will be occur shortly (when the remote end sends us a RST packet).
|
||||
*
|
||||
* In addition to the technical challenges and confusion, many high level socket/stream API's provide
|
||||
* no support for dealing with the problem. If the read stream is closed, the API immediately declares the
|
||||
* socket to be closed, and shuts down the write stream as well. In fact, this is what Apple's CFStream API does.
|
||||
* It might sound like poor design at first, but in fact it simplifies development.
|
||||
*
|
||||
* The vast majority of the time if the read stream is closed it's because the remote endpoint closed its socket.
|
||||
* Thus it actually makes sense to close the socket at this point.
|
||||
* And in fact this is what most networking developers want and expect to happen.
|
||||
* However, if you are writing a server that interacts with a plethora of clients,
|
||||
* you might encounter a client that uses the discouraged technique of shutting down its write stream.
|
||||
* If this is the case, you can set this property to NO,
|
||||
* and make use of the socketDidCloseReadStream delegate method.
|
||||
*
|
||||
* The default value is YES.
|
||||
**/
|
||||
- (BOOL)autoDisconnectOnClosedReadStream;
|
||||
- (void)setAutoDisconnectOnClosedReadStream:(BOOL)flag;
|
||||
|
||||
/**
|
||||
* By default, both IPv4 and IPv6 are enabled.
|
||||
*
|
||||
@@ -211,6 +187,15 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
**/
|
||||
- (BOOL)acceptOnInterface:(NSString *)interface port:(uint16_t)port error:(NSError **)errPtr;
|
||||
|
||||
/**
|
||||
* Tells the socket to begin listening and accepting connections on the unix domain at the given url.
|
||||
* When a connection is accepted, a new instance of GCDAsyncSocket will be spawned to handle it,
|
||||
* and the socket:didAcceptNewSocket: delegate method will be invoked.
|
||||
*
|
||||
* The socket will listen on all available interfaces (e.g. wifi, ethernet, etc)
|
||||
**/
|
||||
- (BOOL)acceptOnUrl:(NSURL *)url error:(NSError **)errPtr;
|
||||
|
||||
#pragma mark Connecting
|
||||
|
||||
/**
|
||||
@@ -326,6 +311,10 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
viaInterface:(NSString *)interface
|
||||
withTimeout:(NSTimeInterval)timeout
|
||||
error:(NSError **)errPtr;
|
||||
/**
|
||||
* Connects to the unix domain socket at the given url, using the specified timeout.
|
||||
*/
|
||||
- (BOOL)connectToUrl:(NSURL *)url withTimeout:(NSTimeInterval)timeout error:(NSError **)errPtr;
|
||||
|
||||
#pragma mark Disconnecting
|
||||
|
||||
@@ -389,6 +378,7 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
**/
|
||||
- (NSString *)connectedHost;
|
||||
- (uint16_t)connectedPort;
|
||||
- (NSURL *)connectedUrl;
|
||||
|
||||
- (NSString *)localHost;
|
||||
- (uint16_t)localPort;
|
||||
@@ -646,6 +636,12 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
maxLength:(NSUInteger)length
|
||||
tag:(long)tag;
|
||||
|
||||
/**
|
||||
* Returns progress of the current read, from 0.0 to 1.0, or NaN if no current read (use isnan() to check).
|
||||
* The parameters "tag", "done" and "total" will be filled in if they aren't NULL.
|
||||
**/
|
||||
- (float)progressOfReadReturningTag:(long *)tagPtr bytesDone:(NSUInteger *)donePtr total:(NSUInteger *)totalPtr;
|
||||
|
||||
#pragma mark Writing
|
||||
|
||||
/**
|
||||
@@ -667,6 +663,12 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
**/
|
||||
- (void)writeData:(NSData *)data withTimeout:(NSTimeInterval)timeout tag:(long)tag;
|
||||
|
||||
/**
|
||||
* Returns progress of the current write, from 0.0 to 1.0, or NaN if no current write (use isnan() to check).
|
||||
* The parameters "tag", "done" and "total" will be filled in if they aren't NULL.
|
||||
**/
|
||||
- (float)progressOfWriteReturningTag:(long *)tagPtr bytesDone:(NSUInteger *)donePtr total:(NSUInteger *)totalPtr;
|
||||
|
||||
#pragma mark Security
|
||||
|
||||
/**
|
||||
@@ -678,7 +680,8 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
* Any reads or writes scheduled after this method is called will occur over the secured connection.
|
||||
*
|
||||
* The possible keys and values for the TLS settings are well documented.
|
||||
* Some possible keys are:
|
||||
* Standard keys are:
|
||||
*
|
||||
* - kCFStreamSSLLevel
|
||||
* - kCFStreamSSLAllowsExpiredCertificates
|
||||
* - kCFStreamSSLAllowsExpiredRoots
|
||||
@@ -688,6 +691,18 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
* - kCFStreamSSLCertificates
|
||||
* - kCFStreamSSLIsServer
|
||||
*
|
||||
* If SecureTransport is available on iOS:
|
||||
*
|
||||
* - GCDAsyncSocketSSLCipherSuites
|
||||
* - GCDAsyncSocketSSLProtocolVersionMin
|
||||
* - GCDAsyncSocketSSLProtocolVersionMax
|
||||
*
|
||||
* If SecureTransport is available on Mac OS X:
|
||||
*
|
||||
* - GCDAsyncSocketSSLCipherSuites
|
||||
* - GCDAsyncSocketSSLDiffieHellmanParameters;
|
||||
*
|
||||
*
|
||||
* Please refer to Apple's documentation for associated values, as well as other possible keys.
|
||||
*
|
||||
* If you pass in nil or an empty dictionary, the default settings will be used.
|
||||
@@ -712,6 +727,114 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
|
||||
#pragma mark Advanced
|
||||
|
||||
/**
|
||||
* Traditionally sockets are not closed until the conversation is over.
|
||||
* However, it is technically possible for the remote enpoint to close its write stream.
|
||||
* Our socket would then be notified that there is no more data to be read,
|
||||
* but our socket would still be writeable and the remote endpoint could continue to receive our data.
|
||||
*
|
||||
* The argument for this confusing functionality stems from the idea that a client could shut down its
|
||||
* write stream after sending a request to the server, thus notifying the server there are to be no further requests.
|
||||
* In practice, however, this technique did little to help server developers.
|
||||
*
|
||||
* To make matters worse, from a TCP perspective there is no way to tell the difference from a read stream close
|
||||
* and a full socket close. They both result in the TCP stack receiving a FIN packet. The only way to tell
|
||||
* is by continuing to write to the socket. If it was only a read stream close, then writes will continue to work.
|
||||
* Otherwise an error will be occur shortly (when the remote end sends us a RST packet).
|
||||
*
|
||||
* In addition to the technical challenges and confusion, many high level socket/stream API's provide
|
||||
* no support for dealing with the problem. If the read stream is closed, the API immediately declares the
|
||||
* socket to be closed, and shuts down the write stream as well. In fact, this is what Apple's CFStream API does.
|
||||
* It might sound like poor design at first, but in fact it simplifies development.
|
||||
*
|
||||
* The vast majority of the time if the read stream is closed it's because the remote endpoint closed its socket.
|
||||
* Thus it actually makes sense to close the socket at this point.
|
||||
* And in fact this is what most networking developers want and expect to happen.
|
||||
* However, if you are writing a server that interacts with a plethora of clients,
|
||||
* you might encounter a client that uses the discouraged technique of shutting down its write stream.
|
||||
* If this is the case, you can set this property to NO,
|
||||
* and make use of the socketDidCloseReadStream delegate method.
|
||||
*
|
||||
* The default value is YES.
|
||||
**/
|
||||
- (BOOL)autoDisconnectOnClosedReadStream;
|
||||
- (void)setAutoDisconnectOnClosedReadStream:(BOOL)flag;
|
||||
|
||||
/**
|
||||
* GCDAsyncSocket maintains thread safety by using an internal serial dispatch_queue.
|
||||
* In most cases, the instance creates this queue itself.
|
||||
* However, to allow for maximum flexibility, the internal queue may be passed in the init method.
|
||||
* This allows for some advanced options such as controlling socket priority via target queues.
|
||||
* However, when one begins to use target queues like this, they open the door to some specific deadlock issues.
|
||||
*
|
||||
* For example, imagine there are 2 queues:
|
||||
* dispatch_queue_t socketQueue;
|
||||
* dispatch_queue_t socketTargetQueue;
|
||||
*
|
||||
* If you do this (pseudo-code):
|
||||
* socketQueue.targetQueue = socketTargetQueue;
|
||||
*
|
||||
* Then all socketQueue operations will actually get run on the given socketTargetQueue.
|
||||
* This is fine and works great in most situations.
|
||||
* But if you run code directly from within the socketTargetQueue that accesses the socket,
|
||||
* you could potentially get deadlock. Imagine the following code:
|
||||
*
|
||||
* - (BOOL)socketHasSomething
|
||||
* {
|
||||
* __block BOOL result = NO;
|
||||
* dispatch_block_t block = ^{
|
||||
* result = [self someInternalMethodToBeRunOnlyOnSocketQueue];
|
||||
* }
|
||||
* if (is_executing_on_queue(socketQueue))
|
||||
* block();
|
||||
* else
|
||||
* dispatch_sync(socketQueue, block);
|
||||
*
|
||||
* return result;
|
||||
* }
|
||||
*
|
||||
* What happens if you call this method from the socketTargetQueue? The result is deadlock.
|
||||
* This is because the GCD API offers no mechanism to discover a queue's targetQueue.
|
||||
* Thus we have no idea if our socketQueue is configured with a targetQueue.
|
||||
* If we had this information, we could easily avoid deadlock.
|
||||
* But, since these API's are missing or unfeasible, you'll have to explicitly set it.
|
||||
*
|
||||
* IF you pass a socketQueue via the init method,
|
||||
* AND you've configured the passed socketQueue with a targetQueue,
|
||||
* THEN you should pass the end queue in the target hierarchy.
|
||||
*
|
||||
* For example, consider the following queue hierarchy:
|
||||
* socketQueue -> ipQueue -> moduleQueue
|
||||
*
|
||||
* This example demonstrates priority shaping within some server.
|
||||
* All incoming client connections from the same IP address are executed on the same target queue.
|
||||
* And all connections for a particular module are executed on the same target queue.
|
||||
* Thus, the priority of all networking for the entire module can be changed on the fly.
|
||||
* Additionally, networking traffic from a single IP cannot monopolize the module.
|
||||
*
|
||||
* Here's how you would accomplish something like that:
|
||||
* - (dispatch_queue_t)newSocketQueueForConnectionFromAddress:(NSData *)address onSocket:(GCDAsyncSocket *)sock
|
||||
* {
|
||||
* dispatch_queue_t socketQueue = dispatch_queue_create("", NULL);
|
||||
* dispatch_queue_t ipQueue = [self ipQueueForAddress:address];
|
||||
*
|
||||
* dispatch_set_target_queue(socketQueue, ipQueue);
|
||||
* dispatch_set_target_queue(iqQueue, moduleQueue);
|
||||
*
|
||||
* return socketQueue;
|
||||
* }
|
||||
* - (void)socket:(GCDAsyncSocket *)sock didAcceptNewSocket:(GCDAsyncSocket *)newSocket
|
||||
* {
|
||||
* [clientConnections addObject:newSocket];
|
||||
* [newSocket markSocketQueueTargetQueue:moduleQueue];
|
||||
* }
|
||||
*
|
||||
* Note: This workaround is ONLY needed if you intend to execute code directly on the ipQueue or moduleQueue.
|
||||
* This is often NOT the case, as such queues are used solely for execution shaping.
|
||||
**/
|
||||
- (void)markSocketQueueTargetQueue:(dispatch_queue_t)socketQueuesPreConfiguredTargetQueue;
|
||||
- (void)unmarkSocketQueueTargetQueue:(dispatch_queue_t)socketQueuesPreviouslyConfiguredTargetQueue;
|
||||
|
||||
/**
|
||||
* It's not thread-safe to access certain variables from outside the socket's internal queue.
|
||||
*
|
||||
@@ -805,7 +928,9 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
**/
|
||||
- (BOOL)enableBackgroundingOnSocket;
|
||||
|
||||
#else
|
||||
#endif
|
||||
|
||||
#if SECURE_TRANSPORT_MAYBE_AVAILABLE
|
||||
|
||||
/**
|
||||
* This method is only available from within the context of a performBlock: invocation.
|
||||
@@ -881,6 +1006,12 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
|
||||
**/
|
||||
- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t)port;
|
||||
|
||||
/**
|
||||
* Called when a socket connects and is ready for reading and writing.
|
||||
* The host parameter will be an IP address, not a DNS name.
|
||||
**/
|
||||
- (void)socket:(GCDAsyncSocket *)sock didConnectToUrl:(NSURL *)url;
|
||||
|
||||
/**
|
||||
* Called when a socket has completed reading the requested data into memory.
|
||||
* Not called if there is an error.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -71,6 +71,7 @@ static IconCache* sharedInstance = nil;
|
||||
|
||||
if (image == nil)
|
||||
{
|
||||
NSLog(@"%@ Could not load %@", NSStringFromSelector(_cmd), path);
|
||||
return [NSNumber numberWithInt:-1];
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
@interface NSObject (IconOverlayHandlers)
|
||||
|
||||
- (void)IconOverlayHandlers_drawIconWithFrame:(struct CGRect)arg1;
|
||||
- (void)IconOverlayHandlers_drawImage:(id)arg1;
|
||||
- (void)IconOverlayHandlers_drawRect:(struct CGRect)arg1;
|
||||
- (void)OCIconOverlayHandlers_drawIconWithFrame:(struct CGRect)arg1;
|
||||
- (void)OCIconOverlayHandlers_drawImage:(id)arg1;
|
||||
- (void)OCIconOverlayHandlers_drawRect:(struct CGRect)arg1;
|
||||
|
||||
@end
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
- (void)IconOverlayHandlers_drawIconWithFrame:(struct CGRect)arg1
|
||||
{
|
||||
[self IconOverlayHandlers_drawIconWithFrame:arg1];
|
||||
[self OCIconOverlayHandlers_drawIconWithFrame:arg1];
|
||||
|
||||
NSURL* url = [[NSClassFromString(@"FINode") nodeFromNodeRef:[(TIconAndTextCell*)self node]->fNodeRef] previewItemURL];
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
NSNumber* imageIndex = [[ContentManager sharedInstance] iconByPath:[url path] isDirectory:isDir];
|
||||
|
||||
NSLog(@"1 The icon index is %d", [imageIndex intValue]);
|
||||
//NSLog(@"1 The icon index is %d", [imageIndex intValue]);
|
||||
if ([imageIndex intValue] > 0)
|
||||
{
|
||||
NSImage* image = [[IconCache sharedInstance] getIcon:imageIndex];
|
||||
@@ -48,21 +48,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)IconOverlayHandlers_IKImageBrowserCell_drawImage:(id)arg1
|
||||
- (void)OCIconOverlayHandlers_IKImageBrowserCell_drawImage:(id)arg1
|
||||
{
|
||||
IKImageWrapper*imageWrapper = [self IconOverlayHandlers_imageWrapper:arg1];
|
||||
IKImageWrapper*imageWrapper = [self OCIconOverlayHandlers_imageWrapper:arg1];
|
||||
|
||||
[self IconOverlayHandlers_IKImageBrowserCell_drawImage:imageWrapper];
|
||||
[self OCIconOverlayHandlers_IKImageBrowserCell_drawImage:imageWrapper];
|
||||
}
|
||||
|
||||
- (void)IconOverlayHandlers_IKFinderReflectiveIconCell_drawImage:(id)arg1
|
||||
- (void)OCIconOverlayHandlers_IKFinderReflectiveIconCell_drawImage:(id)arg1
|
||||
{
|
||||
IKImageWrapper*imageWrapper = [self IconOverlayHandlers_imageWrapper:arg1];
|
||||
IKImageWrapper*imageWrapper = [self OCIconOverlayHandlers_imageWrapper:arg1];
|
||||
|
||||
[self IconOverlayHandlers_IKFinderReflectiveIconCell_drawImage:imageWrapper];
|
||||
[self OCIconOverlayHandlers_IKFinderReflectiveIconCell_drawImage:imageWrapper];
|
||||
}
|
||||
|
||||
- (IKImageWrapper*)IconOverlayHandlers_imageWrapper:(id)arg1
|
||||
- (IKImageWrapper*)OCIconOverlayHandlers_imageWrapper:(id)arg1
|
||||
{
|
||||
TIconViewCell* realSelf = (TIconViewCell*)self;
|
||||
FINode* node = (FINode*)[realSelf representedItem];
|
||||
@@ -77,7 +77,7 @@
|
||||
}
|
||||
|
||||
NSNumber* imageIndex = [[ContentManager sharedInstance] iconByPath:[url path] isDirectory:isDir];
|
||||
// NSLog(@"2 The icon index is %d", [imageIndex intValue]);
|
||||
//NSLog(@"2 The icon index is %d %@ %@", [imageIndex intValue], [url path], isDir ? @"isDir" : @"");
|
||||
|
||||
if ([imageIndex intValue] > 0)
|
||||
{
|
||||
@@ -91,14 +91,18 @@
|
||||
|
||||
if (iconimage != nil)
|
||||
{
|
||||
CGImageSourceRef source;
|
||||
NSData* data = [iconimage TIFFRepresentation];
|
||||
CGRect destRect = CGRectMake(0, 0, [icon size].width, [icon size].height);
|
||||
CGImageRef cgImage = [iconimage CGImageForProposedRect:&destRect
|
||||
context:[NSGraphicsContext currentContext]
|
||||
hints:nil];
|
||||
if (cgImage) {
|
||||
CGContextDrawImage(myContext, destRect, cgImage);
|
||||
//CGImageRelease(cgImage); // leak here? if we leave this code in, Finder crashes
|
||||
// But actually i'm not seeing a leak in Activity Monitor.. maybe it is not really leaking?
|
||||
} else {
|
||||
NSLog(@"No image given!!!!!11 %@", [url path]);
|
||||
}
|
||||
|
||||
source = CGImageSourceCreateWithData((CFDataRef)data, NULL);
|
||||
CGImageRef maskRef = CGImageSourceCreateImageAtIndex(source, 0, NULL);
|
||||
CGContextDrawImage(myContext, CGRectMake(0, 0, [icon size].width, [icon size].height), maskRef);
|
||||
CFRelease(source);
|
||||
CFRelease(maskRef);
|
||||
}
|
||||
|
||||
[icon unlockFocus];
|
||||
@@ -111,9 +115,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)IconOverlayHandlers_drawRect:(struct CGRect)arg1
|
||||
- (void)OCIconOverlayHandlers_drawRect:(struct CGRect)arg1
|
||||
{
|
||||
[self IconOverlayHandlers_drawRect:arg1];
|
||||
[self OCIconOverlayHandlers_drawRect:arg1];
|
||||
|
||||
NSView* supersuperview = [[(NSView*)self superview] superview];
|
||||
|
||||
@@ -141,7 +145,7 @@
|
||||
}
|
||||
|
||||
NSNumber* imageIndex = [[ContentManager sharedInstance] iconByPath:[url path] isDirectory:isDir];
|
||||
NSLog(@"3 The icon index is %d", [imageIndex intValue]);
|
||||
//NSLog(@"3 The icon index is %d", [imageIndex intValue]);
|
||||
|
||||
if ([imageIndex intValue] > 0)
|
||||
{
|
||||
@@ -2,8 +2,6 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>FinderHook</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
@@ -11,7 +9,7 @@
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.liferay.nativity</string>
|
||||
<string>com.owncloud.finder</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
@@ -21,7 +19,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>NVTY</string>
|
||||
<string>OWNC</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>CFPlugInDynamicRegisterFunction</key>
|
||||
@@ -42,5 +40,7 @@
|
||||
</dict>
|
||||
<key>CFPlugInUnloadFunction</key>
|
||||
<string></string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>FinderHook</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user