1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2026-04-04 20:34:17 +02:00

Compare commits

..

109 Commits

Author SHA1 Message Date
Jenkins for ownCloud
a9f1e165b5 [tx-robot] updated from transifex 2014-08-22 01:25:19 -04:00
Daniel Molkentin
c60b433c42 create shellext path 2014-08-21 20:33:25 +02:00
Daniel Molkentin
933c7e36d1 NSIS: fix target path for shell extension 2014-08-21 17:33:22 +02:00
Klaas Freitag
6025b3a91b Bump version to beta1 2014-08-21 14:33:03 +02:00
Klaas Freitag
c473428be6 Merge pull request #2084 from owncloud/contextless_exclude
Contextless exclude, @ogoffart reviewed, I'll merge.
2014-08-21 13:15:18 +02:00
Klaas Freitag
e06e5fe55f Excludes: Fix unit tests for the new exclude load interface.
Also removed some commented lines.
2014-08-21 13:12:05 +02:00
Klaas Freitag
dc8f437b31 Excludes: Add an context free implementation of exclude file loading.
So that we are more thread safe.
2014-08-21 12:43:04 +02:00
Daniel Molkentin
2219d409a4 Update binary submodule 2014-08-21 11:48:59 +02:00
Olivier Goffart
aabcf80774 Sync engine: Take also in account the fact that the instruction can be IGNORE on both tree 2014-08-21 11:33:38 +02:00
Olivier Goffart
1cf956ec21 Discovery phase: clear the callbacks after use 2014-08-21 11:27:25 +02:00
Daniel Molkentin
315c2eb4ca Windows Shell Integration: Ensure precedence 2014-08-21 11:06:10 +02:00
Klaas Freitag
54e2b9345b GUI: on Mac do not call slotUpdateAccountIcon 2014-08-21 11:00:57 +02:00
Jenkins for ownCloud
9743fee8f9 [tx-robot] updated from transifex 2014-08-21 02:06:14 -04:00
Jenkins for ownCloud
696f801df0 [tx-robot] updated from transifex 2014-08-21 01:25:23 -04:00
Klaas Freitag
fef0d0b31c Overlays Nautilus: Handle UNREGISTER_PATH and do proper reconnect.
This is needed to fix #2073
2014-08-20 17:33:48 +02:00
Klaas Freitag
75101a0319 Application: Unload all folders when shutting down.
That sends a proper UNREGISTER message via socket API.
2014-08-20 17:33:48 +02:00
Klaas Freitag
d1a660ce20 SocketAPI: Add parameter to enable wait for the socket write.
This is needed to wait until the UNREGISTER message is sent to the
shell code when mirall shuts down.
2014-08-20 17:33:48 +02:00
Klaas Freitag
4356005c5a FolderMan: Do not remove the folder icon too early from the map.
Otherwise, method unloadFolder can not do important frees.

This is one part of the fix for #2073 because now the socketapi will
send the UNREGISTER_PATH message over the socket.
2014-08-20 17:33:48 +02:00
Daniel Molkentin
86a00eee3f Merge pull request #2079 from owncloud/nsis_use_installlib
Use InstallLib to install the overlay icons
2014-08-20 17:19:40 +02:00
Daniel Molkentin
ccf532672b Use InstallLib to install the overlay icons
This allows for a cleaner expirience
2014-08-20 16:07:22 +02:00
Daniel Molkentin
6b52e9db34 Fix crash in accountsettings 2014-08-20 16:07:06 +02:00
Daniel Molkentin
8fdee79505 Fix crash in accountsettings 2014-08-20 16:06:38 +02:00
Markus Goetz
d9de6e68ad OS X: Optimize Finder icon drawing code
Don't have an intermeditate TIFF.
2014-08-20 14:02:58 +02:00
Klaas Freitag
988fe70771 Merge pull request #2075 from owncloud/use_folder_paused
Rework of the status icons in FolderMan and Folder objects.
2014-08-20 10:50:28 +02:00
Jenkins for ownCloud
132fac86d7 [tx-robot] updated from transifex 2014-08-20 01:25:19 -04:00
Klaas Freitag
d02175210b Status Icon: Set a proper icon if no sync is configured.
This fixes bug #1956
2014-08-19 17:47:28 +02:00
Daniel Molkentin
1dd3d080b8 Update binary submodule 2014-08-19 17:25:59 +02:00
Daniel Molkentin
d171431ac7 Windows Shell Integration: Add version information 2014-08-19 15:52:58 +02:00
Daniel Molkentin
76e0d61b19 Windows Shell Integration: Register icons with well known name 2014-08-19 15:52:47 +02:00
Daniel Molkentin
cc6d83a953 Windows Shell Integration: Adjust port 2014-08-19 15:51:40 +02:00
Klaas Freitag
617887a0c6 Propagator: If the sync was interrupted by pausing, do not show error.
Handle problems which happen because of pausing the sync as soft errors
rather than normal errors which are blacklisted and displayed in the
gui.

This fixes bug #1959
2014-08-19 14:21:59 +02:00
Klaas Freitag
e4fe4cb4d3 Status icons: Display the correct icons after startup connect. 2014-08-19 14:21:59 +02:00
Klaas Freitag
dc0a054d94 Status icons: Set the offline icon at the very beginning.
Otherwise, if the account is signed out and opens the credential popup,
there is a wrong icon displayed. If the account is coming from keychain
this icon is quickly overwritten.
2014-08-19 14:21:51 +02:00
Klaas Freitag
924d9b985f Some minor cleanups. 2014-08-19 14:21:51 +02:00
Klaas Freitag
bb3bd6930a StatusModel: Have another property accountConnected.
With that , make the status model aware of the account connection state.
With that, we can grey out the correct state icon if the account is not
connected and display the normal icon if the account is connected.
2014-08-19 14:21:51 +02:00
Klaas Freitag
1245ed6f06 Status Icons: Let FolderMan only write the folder config files.
Remove the setSyncEnabled() call to individual folders which mistakenly
set the folders to pause. Let the folders keep their pause state on their
own.

If FolderMan is set to be enabled emit a general refresh signal rather
than one for each folder.
2014-08-19 14:21:51 +02:00
Klaas Freitag
01b0ee49de Status Icons: Rename the syncEnable method to isPaused.
Previously, in folder and folderman there have been the syncEnabled
properties, but they confused the semantics: While in FolderMan the
syncEnabled flag represents the network connection and stuff, in
Folder it represented if the user paused or resumed the folder.

This resulted in mixed use of both, which lead to wrong icon states.
This patch renames the folder methods and properties to isPaused to
make more clear about what it is.
2014-08-19 14:21:42 +02:00
Jenkins for ownCloud
2436ef9574 [tx-robot] updated from transifex 2014-08-19 02:06:17 -04:00
Jenkins for ownCloud
94f3a1ab1f [tx-robot] updated from transifex 2014-08-19 01:25:24 -04:00
Olivier Goffart
9c98883bea propagator mkcol: If the server replies with a file-id in the header, use it
Newer server will have a file id directly in the file header.
https://github.com/owncloud/core/issues/9000
2014-08-18 20:42:43 +02:00
Olivier Goffart
2fb19e25b5 Fix clang 3.0 compilation 2014-08-18 19:44:18 +02:00
Daniel Molkentin
6fbbe2d0e4 Create ShellIconOverlayIdentifiers key
It may not exist. Registration fails in that case.
2014-08-18 17:06:26 +02:00
Olivier Goffart
c291eb3db4 Fix compilation error 2014-08-18 15:45:58 +02:00
Olivier Goffart
7f38ce8908 Selective sync: the button should only be enabled while connected 2014-08-18 15:45:38 +02:00
Olivier Goffart
1781400340 fix compilation 2014-08-18 15:28:24 +02:00
Olivier Goffart
3760f14da8 Restore the log window 2014-08-18 15:16:33 +02:00
Olivier Goffart
dc18366111 DiscoveryPhase: put in namespace Mirall 2014-08-18 14:45:48 +02:00
Olivier Goffart
936252765a Merge branch 'master' into selective_sync
Conflicts:
	src/mirall/syncengine.cpp
	src/mirall/syncengine.h
2014-08-18 14:44:43 +02:00
Markus Goetz
b62b87eed3 OS X: Rename LiferayNativity code for shell icons 2014-08-18 12:57:29 +02:00
Klaas Freitag
4b716f3ea6 About page: Fix the translation of developer names. 2014-08-18 12:17:13 +02:00
Klaas Freitag
ddbe181e48 Update phase progress: Check if callback is defined. 2014-08-18 11:51:45 +02:00
Klaas Freitag
27f9d4523b Settings: Display the commit SHA both in branded and unbranded.
Also, do not put the developer names into the translation string.
2014-08-18 11:27:56 +02:00
Jenkins for ownCloud
8a7cfbd8de [tx-robot] updated from transifex 2014-08-18 01:25:25 -04:00
Volkan Gezer
463a9a5485 space 2014-08-17 17:38:33 +02:00
Jenkins for ownCloud
ee7fe4a38a [tx-robot] updated from transifex 2014-08-17 01:25:21 -04:00
Klaas Freitag
dccb9def3a Merge pull request #2067 from owncloud/grammar
subject verb agreement - very good, thanks.
2014-08-16 12:13:01 +02:00
Jenkins for ownCloud
5c5d57a996 [tx-robot] updated from transifex 2014-08-16 02:06:14 -04:00
Jenkins for ownCloud
de2ce5a0a2 [tx-robot] updated from transifex 2014-08-16 01:25:23 -04:00
Sandro Knauß
7b114e2cae Use QStandardPaths for linux if building with qt>=5 2014-08-16 03:12:20 +02:00
Volkan Gezer
25d519fed3 subject verb agreement 2014-08-15 20:49:47 +02:00
Klaas Freitag
8d819956d3 Tests: Fixed the CSync statedb test defined in the mirall module. 2014-08-15 18:33:04 +02:00
Klaas Freitag
4aec783362 Nautilus Overlays: Fix: do not change an dictionary which is iterated.
Also, item.invalidate_extension_info() is sufficient, no need to call
update_file_info afterwards.
2014-08-15 17:16:47 +02:00
Klaas Freitag
b494181764 Nautilus Overlays: Use port 34001 by default. 2014-08-15 17:16:47 +02:00
Olivier Goffart
9575271fcd Selective sync: hide the header 2014-08-15 16:49:22 +02:00
Olivier Goffart
b6eda9076e Selective sync: add a page in the folder wizard 2014-08-15 16:40:11 +02:00
Markus Goetz
88072a985a SyncEngine & UI: Move QElapsedTimer to object
Using a function static is too dangerous when multiple threads are involved.
2014-08-15 16:20:43 +02:00
Markus Goetz
c27f151451 SyncEngine & UI: Make the function part of UpdateJob
That way we can easily emit UploadJob's signals
2014-08-15 16:11:51 +02:00
Markus Goetz
64a7025522 CSync: Add a 30 second connect (not read) timeout 2014-08-15 15:54:13 +02:00
Markus Goetz
ce2741cebc SyncEngine & UI: Progress notifications for update phase
For each directory (local and remote, we have UI update throtting code)
a signal is emitted.
It is used by the settings dialog and the tray menu.
2014-08-15 15:28:35 +02:00
Daniel Molkentin
b40b670639 Remove owncloud_logo_blue.png from mirall.qrc resource
It not used in mirall itself.
2014-08-15 15:12:42 +02:00
Daniel Molkentin
3d6b622879 Merge pull request #2064 from owncloud/fix-1959
Show folder icon a offline when account is offline
2014-08-15 15:11:06 +02:00
Daniel Molkentin
4c67a8812a Show folder icon a offline when account is offline
Fixes #1959
2014-08-15 15:01:01 +02:00
Olivier Goffart
4c4d02c0d0 Selective Sync: refactor the widget in its own class 2014-08-15 14:58:16 +02:00
Olivier Goffart
c1831f4946 Selective sync: use a black list instead of a white list 2014-08-15 12:29:10 +02:00
Olivier Goffart
4b2c1bacd1 Merge remote-tracking branch 'origin/master' into selective_sync 2014-08-15 10:28:50 +02:00
Jenkins for ownCloud
3909102436 [tx-robot] updated from transifex 2014-08-15 01:25:29 -04:00
Klaas Freitag
78e50747e4 Updated the about text for the generic ownCloud Theme. 2014-08-14 17:12:23 +02:00
Klaas Freitag
b09498d852 csync journal: Improve get_below_path query.
Add another index on the pathlen column. Use that column to deselect
all rows that are shorter than the path to search files below. That
shrinks the amount of rows to examine using LIKE tremendously by
a cheaply to query for criteria.
2014-08-14 13:52:44 +02:00
Klaas Freitag
7fcf723039 SyncJournal: Add an index on inode to the journal database. 2014-08-14 13:22:43 +02:00
Klaas Freitag
d27ab8c6ca Revert "FolderMan: Proper singleton implementation."
This reverts commit 0350508b65.
2014-08-14 12:46:01 +02:00
Klaas Freitag
0350508b65 FolderMan: Proper singleton implementation.
The connect in SocketAPI had to be moved because it also uses
FolderMan::instance(). And since SocketAPI is instanciated in
FolderMans constructor, this was a deadlock.

Now the connect is tried on every new socket connection in SocketAPI
but I assume that multiple attempts to connect are not an issue.
2014-08-14 11:32:03 +02:00
Klaas Freitag
32739cc305 SyncEngine: End the journal transaction after update. 2014-08-14 11:32:02 +02:00
Klaas Freitag
f515fe77c4 SyncJournal: Fix logging text. 2014-08-14 11:32:02 +02:00
Klaas Freitag
f6d20cbe55 nautilus overlay: Fix reconnect, create a new socket everytime. 2014-08-14 11:07:31 +02:00
Klaas Freitag
8bc0d9acd3 Updater: Added a bit of useful logging. 2014-08-14 11:07:31 +02:00
Klaas Freitag
73325bcd41 csync statedb: Fixed handling of sqlite reply value. 2014-08-14 11:07:31 +02:00
Klaas Freitag
1b5bbfdad3 csync statedb: Set sqlite3_busy_timeout to 5 seconds. 2014-08-14 11:07:31 +02:00
Klaas Freitag
fcd211b190 overlayNautilus: Better reconnect behaviour if mirall was not running. 2014-08-14 11:07:31 +02:00
Jenkins for ownCloud
55b3eb467f [tx-robot] updated from transifex 2014-08-14 01:25:22 -04:00
Jenkins for ownCloud
192c23bfce [tx-robot] updated from transifex 2014-08-13 02:06:14 -04:00
Jenkins for ownCloud
72e0418e4c [tx-robot] updated from transifex 2014-08-13 01:25:32 -04:00
Daniel Molkentin
1544606bf0 Always handle 401 requests, except for network jobs
It is not enough to only implement it for the QNAM returned
by the ShibbolethCredentials, because we sometimes need it
when we have no valid credentials set (and are using dummy
credentials in the course).  The main use case is the
Webview opened by Shibboleth for FBA.

But as a side-effect, we can use it to handle auth requests
from the updater and other places.
2014-08-12 19:25:59 +02:00
Olivier Goffart
255330d342 Add a "Skip Folder Configuration" button in the wizard
This allow to start owncloud the first time but not automatically sync
everything, but let the user configure sub folders instead
2014-08-12 17:34:54 +02:00
Olivier Goffart
ad139e19ab Fix error reported by address sanitizer
Qt allow to call deleteLater on a null object, but it is an undefined behaviour
2014-08-12 17:34:54 +02:00
Markus Goetz
4c0891a22e Tests: Give a more random name to test directories
Conflicts:
	csync/tests/ownCloud/ownCloud/Test.pm
2014-08-12 16:27:03 +02:00
Markus Goetz
8e6e51f9a6 OS X: Move include to MAC define 2014-08-12 14:58:34 +02:00
Markus Goetz
faa502163e OS X: Finally(?) fix stay-on-top behaviour of settings dialog
Fixes #1795
2014-08-12 14:48:42 +02:00
Olivier Goffart
4ff0e7e0a2 Silent some warnings 2014-08-12 14:03:04 +02:00
Olivier Goffart
12459bf07e selective sync: fix whitelist matching 2014-08-12 11:43:42 +02:00
Olivier Goffart
b25ef28e82 Selective sync: remember the old list when accepting the dialog even if the tree was not expanded 2014-08-12 11:12:58 +02:00
Jenkins for ownCloud
ef6c82ba00 [tx-robot] updated from transifex 2014-08-12 01:25:26 -04:00
Olivier Goffart
7e009667a2 Selective sync: ignore the files that are not in the selective sync white list 2014-08-11 18:42:24 +02:00
Olivier Goffart
1f1eb933d1 Move the update job in a new file named discoveryphase
"Discovery" is a better name than "update"
2014-08-11 18:42:24 +02:00
Olivier Goffart
aa85e875bd Selective sync: Add UI to select paths 2014-08-11 18:42:24 +02:00
Daniel Molkentin
1b4c613fa6 ProtocolWidget: Disable copy button if widget is empty. 2014-08-11 16:38:51 +02:00
Daniel Molkentin
57ef515def Use std=c++0x instead of c++11
Required for compat with Ubuntu 12.04, and possibly RHEL.
2014-08-11 15:46:45 +02:00
Daniel Molkentin
59643177af Updated binary dir 2014-08-11 15:39:47 +02:00
Jenkins for ownCloud
e2d5ae1035 [tx-robot] updated from transifex 2014-08-11 02:06:11 -04:00
Jenkins for ownCloud
cd9f2e5ea5 [tx-robot] updated from transifex 2014-08-09 01:25:23 -04:00
167 changed files with 8874 additions and 10420 deletions

2
.gitignore vendored
View File

@@ -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
View File

@@ -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

View File

@@ -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 "beta1") #e.g. beta1, beta2, rc1
endif( NOT DEFINED MIRALL_VERSION_SUFFIX )
if( NOT DEFINED MIRALL_VERSION_BUILD )

View File

@@ -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>

View 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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -23,3 +23,4 @@
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Farsi"

2
binary

Submodule binary updated: 1645f4df2f...82d72bc62d

View File

@@ -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

View File

@@ -6,11 +6,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?

View File

@@ -660,7 +660,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)

View File

@@ -134,23 +134,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 +186,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.

View File

@@ -40,28 +40,28 @@
#define CSYNC_LOG_CATEGORY_NAME "csync.exclude"
#include "csync_log.h"
static int _csync_exclude_add(CSYNC *ctx, const char *string) {
static 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 +70,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 +119,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 +145,21 @@ 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 );
if (match == CSYNC_NOT_EXCLUDED && ctx->checkBlackListHook) {
if (ctx->checkBlackListHook(ctx->checkBlackListData, path)) {
match = CSYNC_FILE_EXCLUDE_LIST;
}
}
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;
@@ -208,7 +223,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 +241,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 +328,7 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
SAFE_FREE(dname);
}
out:
return match;

View File

@@ -37,7 +37,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 +65,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: */

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;
@@ -144,6 +146,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*);
};

View File

@@ -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;

View File

@@ -342,6 +342,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;
}

View File

@@ -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);

View File

@@ -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:

View File

@@ -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,20 +138,6 @@ 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);
*/
}

View File

@@ -35,6 +35,7 @@ use LWP::Protocol::https;
use HTTP::Request::Common qw( POST GET DELETE );
use File::Basename;
use IO::Handle;
use POSIX qw/strftime/;
use Encode qw(from_to);
use utf8;
@@ -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 =~ /\/$/ );

View File

@@ -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>

View File

@@ -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
xcodebuild -workspace ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/OwnCloud.xcworkspace
-scheme OwnCloudFinder.osax SYMROOT=${CMAKE_CURRENT_BINARY_DIR} archive
COMMENT building Mac Overlay iccons)
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)

View File

@@ -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>

View File

@@ -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>

View File

@@ -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

View File

@@ -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

View File

@@ -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>

View 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>

View File

@@ -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>

View File

@@ -237,7 +237,7 @@ static ContentManager* sharedInstance = nil;
}
else
{
NSLog(@"LiferayNativityFinder: refreshing icon badges failed");
NSLog(@"OwnCloudFinder: refreshing icon badges failed");
return;
}

View File

@@ -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

View File

@@ -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];

View 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

View File

@@ -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

View File

@@ -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];
@@ -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];
@@ -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];

View File

@@ -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>
@@ -42,5 +40,7 @@
</dict>
<key>CFPlugInUnloadFunction</key>
<string></string>
<key>NSPrincipalClass</key>
<string>FinderHook</string>
</dict>
</plist>

View File

@@ -48,7 +48,7 @@
8C37DDB9161594B400016A95 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; };
8C99F6921622D145002D2135 /* IconCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconCache.h; sourceTree = "<group>"; };
8C99F6931622D145002D2135 /* IconCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IconCache.m; sourceTree = "<group>"; };
8D576316048677EA00EA77CD /* LiferayNativityFinder.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LiferayNativityFinder.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
8D576316048677EA00EA77CD /* OwnCloudFinder.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OwnCloudFinder.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
8D576317048677EA00EA77CD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -67,7 +67,7 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
089C166AFE841209C02AAC07 /* LiferayNativityFinder */ = {
089C166AFE841209C02AAC07 /* OwnCloudFinder */ = {
isa = PBXGroup;
children = (
08FB77AFFE84173DC02AAC07 /* Source */,
@@ -75,7 +75,7 @@
089C1671FE841209C02AAC07 /* External Frameworks and Libraries */,
19C28FB6FE9D52B211CA2CBB /* Products */,
);
name = LiferayNativityFinder;
name = OwnCloudFinder;
sourceTree = "<group>";
usesTabs = 1;
};
@@ -152,7 +152,7 @@
19C28FB6FE9D52B211CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D576316048677EA00EA77CD /* LiferayNativityFinder.bundle */,
8D576316048677EA00EA77CD /* OwnCloudFinder.bundle */,
);
name = Products;
sourceTree = "<group>";
@@ -160,9 +160,9 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D57630D048677EA00EA77CD /* LiferayNativityFinder */ = {
8D57630D048677EA00EA77CD /* OwnCloudFinder */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB911A08733D790010E9CD /* Build configuration list for PBXNativeTarget "LiferayNativityFinder" */;
buildConfigurationList = 1DEB911A08733D790010E9CD /* Build configuration list for PBXNativeTarget "OwnCloudFinder" */;
buildPhases = (
8D57630F048677EA00EA77CD /* Resources */,
8D576311048677EA00EA77CD /* Sources */,
@@ -172,10 +172,10 @@
);
dependencies = (
);
name = LiferayNativityFinder;
name = OwnCloudFinder;
productInstallPath = "$(HOME)/Library/Bundles";
productName = LiferayNativityFinder;
productReference = 8D576316048677EA00EA77CD /* LiferayNativityFinder.bundle */;
productName = OwnCloudFinder;
productReference = 8D576316048677EA00EA77CD /* OwnCloudFinder.bundle */;
productType = "com.apple.product-type.bundle";
};
/* End PBXNativeTarget section */
@@ -186,7 +186,7 @@
attributes = {
LastUpgradeCheck = 0460;
};
buildConfigurationList = 1DEB911E08733D790010E9CD /* Build configuration list for PBXProject "LiferayNativityFinder" */;
buildConfigurationList = 1DEB911E08733D790010E9CD /* Build configuration list for PBXProject "OwnCloudFinder" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
@@ -196,11 +196,11 @@
French,
German,
);
mainGroup = 089C166AFE841209C02AAC07 /* LiferayNativityFinder */;
mainGroup = 089C166AFE841209C02AAC07 /* OwnCloudFinder */;
projectDirPath = "";
projectRoot = "";
targets = (
8D57630D048677EA00EA77CD /* LiferayNativityFinder */,
8D57630D048677EA00EA77CD /* OwnCloudFinder */,
);
};
/* End PBXProject section */
@@ -260,7 +260,7 @@
GCC_OPTIMIZATION_LEVEL = 0;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Bundles";
PRODUCT_NAME = LiferayNativityFinder;
PRODUCT_NAME = OwnCloudFinder;
WRAPPER_EXTENSION = bundle;
};
name = Debug;
@@ -277,7 +277,7 @@
GCC_MODEL_TUNING = G5;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Bundles";
PRODUCT_NAME = LiferayNativityFinder;
PRODUCT_NAME = OwnCloudFinder;
WRAPPER_EXTENSION = bundle;
};
name = Release;
@@ -315,7 +315,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB911A08733D790010E9CD /* Build configuration list for PBXNativeTarget "LiferayNativityFinder" */ = {
1DEB911A08733D790010E9CD /* Build configuration list for PBXNativeTarget "OwnCloudFinder" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB911B08733D790010E9CD /* Debug */,
@@ -324,7 +324,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB911E08733D790010E9CD /* Build configuration list for PBXProject "LiferayNativityFinder" */ = {
1DEB911E08733D790010E9CD /* Build configuration list for PBXProject "OwnCloudFinder" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB911F08733D790010E9CD /* Debug */,

View File

@@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:LiferayNativityFinder.xcodeproj">
location = "self:OwnCloudFinder.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -217,7 +217,7 @@ static RequestManager* sharedInstance = nil;
{
NSLog(@"Connect Socket!");
NSError *err = nil;
if (![_socket connectToHost:@"localhost" onPort:33001 withTimeout:5 error:&err]) // Asynchronous!
if (![_socket connectToHost:@"localhost" onPort:34001 withTimeout:5 error:&err]) // Asynchronous!
{
// If there was an error, it's likely something like "already connected" or "no delegate set"
NSLog(@"I goofed: %@", err);

View File

@@ -7,51 +7,51 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.liferay.nativity</string>
<string>com.owncloud.injector</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>LiferayNativityInjector</string>
<string>OwnCloudInjector</string>
<key>CFBundlePackageType</key>
<string>osax</string>
<key>CFBundleShortVersionString</key>
<string>1.0.2</string>
<key>CFBundleSignature</key>
<string>NVTY</string>
<string>OWNC</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<key>OSAScriptingDefinition</key>
<string>LiferayNativityInjector.sdef</string>
<string>OwnCloudInjector.sdef</string>
<key>OSAXHandlers</key>
<dict>
<key>Events</key>
<dict>
<key>NVTYload</key>
<dict>
<key>Handler</key>
<string>HandleLoadEvent</string>
<key>ThreadSafe</key>
<false/>
<key>Context</key>
<string>Process</string>
</dict>
<key>NVTYunld</key>
<dict>
<key>Handler</key>
<string>HandleUnloadEvent</string>
<key>ThreadSafe</key>
<false/>
<key>Context</key>
<string>Process</string>
</dict>
<key>NVTYlded</key>
<dict>
<key>Context</key>
<string>Process</string>
<key>Handler</key>
<string>HandleLoadedEvent</string>
<key>ThreadSafe</key>
<false/>
</dict>
<key>NVTYload</key>
<dict>
<key>Context</key>
<string>Process</string>
<key>Handler</key>
<string>HandleLoadEvent</string>
<key>ThreadSafe</key>
<false/>
</dict>
<key>NVTYunld</key>
<dict>
<key>Context</key>
<string>Process</string>
<key>Handler</key>
<string>HandleUnloadEvent</string>
<key>ThreadSafe</key>
<false/>
</dict>
</dict>
</dict>

View File

@@ -7,27 +7,27 @@
#define WAIT_FOR_APPLE_EVENT_TO_ENTER_HANDLER_IN_SECONDS 1.0
#define FINDER_MIN_TESTED_VERSION @"10.7"
#define FINDER_MAX_TESTED_VERSION @"10.8.5"
#define LIFERAYNATIVITY_INJECTED_NOTIFICATION @"LiferayNativityInjectedNotification"
#define LIFERAYNATIVITY_INJECTED_NOTIFICATION @"OwnCloudInjectedNotification"
EXPORT OSErr HandleLoadEvent(const AppleEvent* ev, AppleEvent* reply, long refcon);
static NSString* globalLock = @"I'm the global lock to prevent concruent handler executions";
// SIMBL-compatible interface
@interface LiferayNativityShell : NSObject { }
@interface OwnCloudShell : NSObject { }
-(void) install;
-(void) uninstall;
@end
// just a dummy class for locating our bundle
@interface LiferayNativityInjector : NSObject { }
@interface OwnCloudInjector : NSObject { }
@end
@implementation LiferayNativityInjector { }
@implementation OwnCloudInjector { }
@end
static bool liferayNativityLoaded = false;
static NSString* liferayNativityBundleName = @"LiferayNativityFinder";
static NSString* liferayNativityBundleName = @"OwnCloudFinder";
typedef struct {
NSString* location;
@@ -128,7 +128,7 @@ static OSErr loadBundle(LNBundleType type, AppleEvent* reply, long refcon) {
}
}
NSBundle* liferayNativityInjectorBundle = [NSBundle bundleForClass:[LiferayNativityInjector class]];
NSBundle* liferayNativityInjectorBundle = [NSBundle bundleForClass:[OwnCloudInjector class]];
NSString* liferayNativityLocation = [liferayNativityInjectorBundle pathForResource:bundleName ofType:@"bundle"];
NSBundle* pluginBundle = [NSBundle bundleWithPath:liferayNativityLocation];
if (!pluginBundle) {
@@ -182,11 +182,11 @@ static LNBundleType mainBundleType(AppleEvent* reply) {
EXPORT OSErr HandleLoadEvent(const AppleEvent* ev, AppleEvent* reply, long refcon) {
@synchronized(globalLock) {
@autoreleasepool {
NSBundle* injectorBundle = [NSBundle bundleForClass:[LiferayNativityInjector class]];
NSBundle* injectorBundle = [NSBundle bundleForClass:[OwnCloudInjector class]];
NSString* injectorVersion = [injectorBundle objectForInfoDictionaryKey:@"CFBundleVersion"];
if (!injectorVersion || ![injectorVersion isKindOfClass:[NSString class]]) {
reportError(reply, [NSString stringWithFormat:@"Unable to determine LiferayNativityInjector version!"]);
reportError(reply, [NSString stringWithFormat:@"Unable to determine OwnCloudInjector version!"]);
return 7;
}
@@ -206,7 +206,7 @@ EXPORT OSErr HandleLoadEvent(const AppleEvent* ev, AppleEvent* reply, long refco
return noErr;
} @catch (NSException* exception) {
reportError(reply, [NSString stringWithFormat:@"Failed to load LiferayNativity with exception: %@", exception]);
reportError(reply, [NSString stringWithFormat:@"Failed to load OwnCloudFinder with exception: %@", exception]);
}
return 1;
@@ -232,13 +232,13 @@ EXPORT OSErr HandleUnloadEvent(const AppleEvent* ev, AppleEvent* reply, long ref
@autoreleasepool {
@try {
if (!liferayNativityLoaded) {
NSLog(@"LiferayNativityInjector: not loaded.");
NSLog(@"OwnCloudInjector: not loaded.");
return noErr;
}
NSString* bundleName = liferayNativityBundleName;
NSBundle* liferayNativityInjectorBundle = [NSBundle bundleForClass:[LiferayNativityInjector class]];
NSBundle* liferayNativityInjectorBundle = [NSBundle bundleForClass:[OwnCloudInjector class]];
NSString* liferayNativityLocation = [liferayNativityInjectorBundle pathForResource:bundleName ofType:@"bundle"];
NSBundle* pluginBundle = [NSBundle bundleWithPath:liferayNativityLocation];
if (!pluginBundle) {
@@ -261,7 +261,7 @@ EXPORT OSErr HandleUnloadEvent(const AppleEvent* ev, AppleEvent* reply, long ref
return noErr;
} @catch (NSException* exception) {
reportError(reply, [NSString stringWithFormat:@"Failed to unload LiferayNativity with exception: %@", exception]);
reportError(reply, [NSString stringWithFormat:@"Failed to unload OwnCloudFinder with exception: %@", exception]);
}
return 1;

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
<dictionary title="OwnCloudInjector Terminology">
<suite name="OwnCloudInjector Suite" code="OWNC" description="OwnCloud Injector commands">
<command name="install OwnCloud" code="OWNCload" description="Loads OwnCloud into the Finder process"/>
<command name="uninstall OwnCloud" code="OWNCunld" description="Unloads OwnCloud from the Finder process"/>
<command name="check OwnCloud" code="OWNClded" description="Checks if OwnCloud is loaded in Finder process"/>
</suite>
</dictionary>

View File

@@ -7,27 +7,27 @@
objects = {
/* Begin PBXBuildFile section */
0B36CB92182461A10039B237 /* LiferayNativityFinder.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 0B36CB91182461A10039B237 /* LiferayNativityFinder.bundle */; };
0B36CB92182461A10039B237 /* OwnCloudFinder.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 0B36CB91182461A10039B237 /* OwnCloudFinder.bundle */; };
0BD9C38E1778EF450094CF5D /* license.txt in Resources */ = {isa = PBXBuildFile; fileRef = 0BD9C38D1778EF450094CF5D /* license.txt */; };
8D576314048677EA00EA77CD /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */; };
8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8D5B49A704867FD3000E48DA /* InfoPlist.strings */; };
D6ACBEA2117B7D5600F6691C /* LiferayNativityInjector.m in Sources */ = {isa = PBXBuildFile; fileRef = D6ACBE9E117B7D5600F6691C /* LiferayNativityInjector.m */; };
D6ACBEA2117B7D5600F6691C /* OwnCloudInjector.m in Sources */ = {isa = PBXBuildFile; fileRef = D6ACBE9E117B7D5600F6691C /* OwnCloudInjector.m */; };
D6ACBEA3117B7D5600F6691C /* LNStandardVersionComparator.m in Sources */ = {isa = PBXBuildFile; fileRef = D6ACBEA0117B7D5600F6691C /* LNStandardVersionComparator.m */; };
D6ACBEA5117B7D6100F6691C /* LiferayNativityInjector.sdef in Resources */ = {isa = PBXBuildFile; fileRef = D6ACBEA4117B7D6100F6691C /* LiferayNativityInjector.sdef */; };
D6ACBEA5117B7D6100F6691C /* OwnCloudInjector.sdef in Resources */ = {isa = PBXBuildFile; fileRef = D6ACBEA4117B7D6100F6691C /* OwnCloudInjector.sdef */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
0B36CB91182461A10039B237 /* LiferayNativityFinder.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; path = LiferayNativityFinder.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
0B36CB91182461A10039B237 /* OwnCloudFinder.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; path = OwnCloudFinder.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
0BD9C38D1778EF450094CF5D /* license.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = license.txt; sourceTree = "<group>"; };
8D576317048677EA00EA77CD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D60A992314CE37030061AD6D /* LiferayNativity.osax */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LiferayNativity.osax; sourceTree = BUILT_PRODUCTS_DIR; };
D6ACBE9E117B7D5600F6691C /* LiferayNativityInjector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LiferayNativityInjector.m; sourceTree = "<group>"; };
D60A992314CE37030061AD6D /* OwnCloudFinder.osax */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OwnCloudFinder.osax; sourceTree = BUILT_PRODUCTS_DIR; };
D6ACBE9E117B7D5600F6691C /* OwnCloudInjector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OwnCloudInjector.m; sourceTree = "<group>"; };
D6ACBE9F117B7D5600F6691C /* LNVersionComparisonProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNVersionComparisonProtocol.h; sourceTree = "<group>"; };
D6ACBEA0117B7D5600F6691C /* LNStandardVersionComparator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNStandardVersionComparator.m; sourceTree = "<group>"; };
D6ACBEA1117B7D5600F6691C /* LNStandardVersionComparator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNStandardVersionComparator.h; sourceTree = "<group>"; };
D6ACBEA4117B7D6100F6691C /* LiferayNativityInjector.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = LiferayNativityInjector.sdef; sourceTree = "<group>"; };
D6ACBEA4117B7D6100F6691C /* OwnCloudInjector.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = OwnCloudInjector.sdef; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -67,8 +67,8 @@
089C167CFE841241C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
0B36CB91182461A10039B237 /* LiferayNativityFinder.bundle */,
D6ACBEA4117B7D6100F6691C /* LiferayNativityInjector.sdef */,
0B36CB91182461A10039B237 /* OwnCloudFinder.bundle */,
D6ACBEA4117B7D6100F6691C /* OwnCloudInjector.sdef */,
8D576317048677EA00EA77CD /* Info.plist */,
8D5B49A704867FD3000E48DA /* InfoPlist.strings */,
0BD9C38D1778EF450094CF5D /* license.txt */,
@@ -79,7 +79,7 @@
08FB77AFFE84173DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
D6ACBE9E117B7D5600F6691C /* LiferayNativityInjector.m */,
D6ACBE9E117B7D5600F6691C /* OwnCloudInjector.m */,
D6ACBE9F117B7D5600F6691C /* LNVersionComparisonProtocol.h */,
D6ACBEA0117B7D5600F6691C /* LNStandardVersionComparator.m */,
D6ACBEA1117B7D5600F6691C /* LNStandardVersionComparator.h */,
@@ -90,7 +90,7 @@
D60A992414CE37030061AD6D /* Products */ = {
isa = PBXGroup;
children = (
D60A992314CE37030061AD6D /* LiferayNativity.osax */,
D60A992314CE37030061AD6D /* OwnCloudFinder.osax */,
);
name = Products;
sourceTree = "<group>";
@@ -98,9 +98,9 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D57630D048677EA00EA77CD /* LiferayNativity.osax */ = {
8D57630D048677EA00EA77CD /* OwnCloudFinder.osax */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB911A08733D790010E9CD /* Build configuration list for PBXNativeTarget "LiferayNativity.osax" */;
buildConfigurationList = 1DEB911A08733D790010E9CD /* Build configuration list for PBXNativeTarget "OwnCloudFinder.osax" */;
buildPhases = (
8D57630F048677EA00EA77CD /* Resources */,
8D576311048677EA00EA77CD /* Sources */,
@@ -110,10 +110,10 @@
);
dependencies = (
);
name = LiferayNativity.osax;
name = OwnCloudFinder.osax;
productInstallPath = "$(HOME)/Library/Bundles";
productName = "TotalFinder-osax";
productReference = D60A992314CE37030061AD6D /* LiferayNativity.osax */;
productReference = D60A992314CE37030061AD6D /* OwnCloudFinder.osax */;
productType = "com.apple.product-type.bundle";
};
/* End PBXNativeTarget section */
@@ -126,7 +126,7 @@
LastUpgradeCheck = 0460;
ORGANIZATIONNAME = BinaryAge;
};
buildConfigurationList = 1DEB911E08733D790010E9CD /* Build configuration list for PBXProject "LiferayNativityInjector" */;
buildConfigurationList = 1DEB911E08733D790010E9CD /* Build configuration list for PBXProject "OwnCloudInjector" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
@@ -139,7 +139,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
8D57630D048677EA00EA77CD /* LiferayNativity.osax */,
8D57630D048677EA00EA77CD /* OwnCloudFinder.osax */,
);
};
/* End PBXProject section */
@@ -149,9 +149,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0B36CB92182461A10039B237 /* LiferayNativityFinder.bundle in Resources */,
0B36CB92182461A10039B237 /* OwnCloudFinder.bundle in Resources */,
8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */,
D6ACBEA5117B7D6100F6691C /* LiferayNativityInjector.sdef in Resources */,
D6ACBEA5117B7D6100F6691C /* OwnCloudInjector.sdef in Resources */,
0BD9C38E1778EF450094CF5D /* license.txt in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -163,7 +163,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D6ACBEA2117B7D5600F6691C /* LiferayNativityInjector.m in Sources */,
D6ACBEA2117B7D5600F6691C /* OwnCloudInjector.m in Sources */,
D6ACBEA3117B7D5600F6691C /* LNStandardVersionComparator.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -195,7 +195,7 @@
"-framework",
AppKit,
);
PRODUCT_NAME = LiferayNativity;
PRODUCT_NAME = OwnCloudFinder;
SKIP_INSTALL = YES;
WRAPPER_EXTENSION = osax;
};
@@ -214,7 +214,7 @@
"-framework",
AppKit,
);
PRODUCT_NAME = LiferayNativity;
PRODUCT_NAME = OwnCloudFinder;
WRAPPER_EXTENSION = osax;
};
name = Release;
@@ -245,7 +245,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB911A08733D790010E9CD /* Build configuration list for PBXNativeTarget "LiferayNativity.osax" */ = {
1DEB911A08733D790010E9CD /* Build configuration list for PBXNativeTarget "OwnCloudFinder.osax" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB911B08733D790010E9CD /* Debug */,
@@ -254,7 +254,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB911E08733D790010E9CD /* Build configuration list for PBXProject "LiferayNativityInjector" */ = {
1DEB911E08733D790010E9CD /* Build configuration list for PBXProject "OwnCloudInjector" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB911F08733D790010E9CD /* Debug */,

View File

@@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:LiferayNativityInjector.xcodeproj">
location = "self:OwnCloudFinder.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D57630D048677EA00EA77CD"
BuildableName = "LiferayNativityFinder.bundle"
BlueprintName = "LiferayNativityFinder"
ReferencedContainer = "container:../LiferayNativityFinder/LiferayNativityFinder.xcodeproj">
BuildableName = "OwnCloudFinder.bundle"
BlueprintName = "OwnCloudFinder"
ReferencedContainer = "container:../OwnCloudFinder/OwnCloudFinder.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
@@ -29,9 +29,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D57630D048677EA00EA77CD"
BuildableName = "LiferayNativity.osax"
BlueprintName = "LiferayNativity.osax"
ReferencedContainer = "container:LiferayNativityInjector.xcodeproj">
BuildableName = "OwnCloudFinder.osax"
BlueprintName = "OwnCloudFinder.osax"
ReferencedContainer = "container:OwnCloudInjector.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>

View File

@@ -1,8 +1,14 @@
#!/bin/sh
# osascript $HOME/owncloud.com/mirall/shell_integration/MacOSX/unload.scpt
sudo rm -rf /Library/ScriptingAdditions/LiferayNativity.osax
sudo cp -r $HOME/Library/Developer/Xcode/DerivedData/LiferayNativity-gvtginoclfyisuagangtxsfbuztw/Build/Products/Debug/LiferayNativity.osax /Library/ScriptingAdditions/
sudo rm -rf /Library/ScriptingAdditions/OwnCloudFinder.osax
# Klaas' machine
OSAXDIR=$HOME/Library/Developer/Xcode/DerivedData/OwnCloud-*/Build/Products/Debug/OwnCloudFinder.osax
[ -d $OSAXDIR ] ||OSAXDIR=$HOME/Library/Developer/Xcode/DerivedData/OwnCloud-*/Build/Intermediates/ArchiveIntermediates/OwnCloudFinder.osax/IntermediateBuildFilesPath/UninstalledProducts/OwnCloudFinder.osax
# Markus' machine
[ -d $OSAXDIR ] || echo "OSAX does not exist"
[ -d $OSAXDIR ] && sudo cp -rv $OSAXDIR /Library/ScriptingAdditions/
sudo killall Finder
sleep 1

View File

@@ -11,26 +11,47 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP
nautilusVFSFile_table = {}
registered_paths = {}
remainder = ''
connected = False
watch_id = 0
def __init__(self):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect(("localhost", 33001))
self.sock.settimeout(5)
GObject.io_add_watch(self.sock, GObject.IO_IN, self.handle_notify)
self.connectToOwnCloud
if not self.connected:
# try again in 5 seconds - attention, logic inverted!
GObject.timeout_add(5000, self.connectToOwnCloud)
def port(self):
return 34001 # Fixme, read from config file.
def connectToOwnCloud(self):
try:
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect(("localhost", self.port()))
self.sock.settimeout(5)
self.connected = True
self.watch_id = GObject.io_add_watch(self.sock, GObject.IO_IN, self.handle_notify)
except:
print "Connect could not be established, try again later!"
self.sock.close()
return not self.connected
def sendCommand(self, cmd):
self.sock.send(cmd)
if self.connected:
try:
self.sock.send(cmd)
except:
print "Sending failed."
GObject.source_remove( self.watch_id )
self.connected = False
GObject.timeout_add(5000, self.connectToOwnCloud)
def find_item_for_file( self, path ):
if path in self.nautilusVFSFile_table:
return self.nautilusVFSFile_table[path]
else:
return None
def callback_update_file( self, path ):
print "Got an update callback for " + path
def askForOverlay(self, file):
if os.path.isdir(file):
folderStatus = self.sendCommand("RETRIEVE_FOLDER_STATUS:"+file+"\n");
@@ -38,6 +59,17 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP
if os.path.isfile(file):
fileStatus = self.sendCommand("RETRIEVE_FILE_STATUS:"+file+"\n");
def invalidate_items_underneath( self, path ):
update_items = []
for p in self.nautilusVFSFile_table:
if p == path or p.startswith( path ):
item = self.nautilusVFSFile_table[p]
update_items.append(item)
for item in update_items:
item.invalidate_extension_info()
# self.update_file_info(item)
# Handles a single line of server respoonse and sets the emblem
def handle_server_response(self, l):
Emblems = { 'OK' : 'oC_ok',
@@ -66,16 +98,27 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP
item = self.find_item_for_file(parts[2])
if item:
item.add_emblem(emblem)
elif action == 'UPDATE_VIEW':
# Search all items underneath this path and invalidate them
if parts[1] in self.registered_paths:
for p in self.nautilusVFSFile_table:
if p.startswith( parts[1] ):
item = self.nautilusVFSFile_table[p]
item.invalidate_extension_info()
self.update_file_info(item)
self.invalidate_items_underneath( parts[1] )
elif action == 'REGISTER_PATH':
self.registered_paths[parts[1]] = 1
self.invalidate_items_underneath( parts[1] )
elif action == 'UNREGISTER_PATH':
del self.registered_paths[parts[1]]
self.invalidate_items_underneath( parts[1] )
# check if there are non pathes any more, if so, its usual
# that mirall went away. Try reconnect.
if not self.registered_paths:
self.sock.close()
self.connected = False
GObject.source_remove( self.watch_id )
GObject.timeout_add(5000, self.connectToOwnCloud)
else:
# print "We got unknown action " + action
1
@@ -106,8 +149,6 @@ class ownCloudExtension(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoP
def get_local_path(self, path):
return path.replace("file://", "")
def update_file_info(self, item):
if item.get_uri_scheme() != 'file':
return

View File

@@ -108,7 +108,7 @@ HRESULT RegisterCLSID(LPCOLESTR guidStr, PCWSTR overlayStr, PCWSTR szModule)
return hResult;
}
hResult = OCOverlayRegistrationHandler::RegisterCOMObject(szModule, guid);
hResult = OCOverlayRegistrationHandler::RegisterCOMObject(szModule, OVERLAY_GENERIC_NAME, guid);
if (!SUCCEEDED(hResult)) {
return hResult;

View File

@@ -24,7 +24,8 @@ HRESULT OCOverlayRegistrationHandler::MakeRegistryEntries(const CLSID& clsid, PC
{
HRESULT hResult;
HKEY shellOverlayKey = NULL;
hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGISTRY_OVERLAY_KEY, 0, KEY_WRITE, &shellOverlayKey));
// the key may not exist yet
hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(HKEY_LOCAL_MACHINE, REGISTRY_OVERLAY_KEY, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &shellOverlayKey, NULL));
if (!SUCCEEDED(hResult)) {
hResult = RegCreateKey(HKEY_LOCAL_MACHINE, REGISTRY_OVERLAY_KEY, &shellOverlayKey);
if(!SUCCEEDED(hResult)) {
@@ -69,7 +70,7 @@ HRESULT OCOverlayRegistrationHandler::RemoveRegistryEntries(PCWSTR friendlyName)
return hResult;
}
HRESULT OCOverlayRegistrationHandler::RegisterCOMObject(PCWSTR modulePath, const CLSID& clsid)
HRESULT OCOverlayRegistrationHandler::RegisterCOMObject(PCWSTR modulePath, PCWSTR friendlyName, const CLSID& clsid)
{
if (modulePath == NULL) {
return E_FAIL;
@@ -91,14 +92,15 @@ HRESULT OCOverlayRegistrationHandler::RegisterCOMObject(PCWSTR modulePath, const
return hResult;
}
hResult = HRESULT_FROM_WIN32(RegSetValue(clsidKey, NULL, REG_SZ, friendlyName, (DWORD) wcslen(friendlyName)));
HKEY inprocessKey = NULL;
hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(clsidKey, REGISTRY_IN_PROCESS, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &inprocessKey, NULL));
if(!SUCCEEDED(hResult)) {
return hResult;
}
DWORD cbData = lstrlen(modulePath) * sizeof(*modulePath);
hResult = HRESULT_FROM_WIN32(RegSetValue(inprocessKey, NULL, REG_SZ, modulePath, cbData));
hResult = HRESULT_FROM_WIN32(RegSetValue(inprocessKey, NULL, REG_SZ, modulePath, (DWORD) wcslen(modulePath)));
if(!SUCCEEDED(hResult)) {
return hResult;

View File

@@ -23,7 +23,7 @@ class __declspec(dllexport) OCOverlayRegistrationHandler
{
public:
static HRESULT MakeRegistryEntries(const CLSID& clsid, PCWSTR fileType);
static HRESULT RegisterCOMObject(PCWSTR modulePath, const CLSID& clsid);
static HRESULT RegisterCOMObject(PCWSTR modulePath, PCWSTR friendlyName, const CLSID& clsid);
static HRESULT RemoveRegistryEntries(PCWSTR friendlyName);
static HRESULT UnregisterCOMObject(const CLSID& clsid);
};

View File

@@ -22,14 +22,17 @@
#define OVERLAY_GUID_WARNING L"{0960F096-F328-48A3-B746-276B1E3C3722}"
#define OVERLAY_GUID_WARNING_SHARED L"{0960F097-F328-48A3-B746-276B1E3C3722}"
#define OVERLAY_NAME_ERROR L"OCError"
#define OVERLAY_NAME_ERROR_SHARED L"OCErrorShared"
#define OVERLAY_NAME_OK L"OCOK"
#define OVERLAY_NAME_OK_SHARED L"OCOKShared"
#define OVERLAY_NAME_SYNC L"OCSync"
#define OVERLAY_NAME_SYNC_SHARED L"OCSyncShared"
#define OVERLAY_NAME_WARNING L"OCWarning"
#define OVERLAY_NAME_WARNING_SHARED L"OCWarningShared"
#define OVERLAY_GENERIC_NAME L"OC Overlay Handler"
// two spaces to put us a head of the competition :/
#define OVERLAY_NAME_ERROR L" OCError"
#define OVERLAY_NAME_ERROR_SHARED L" OCErrorShared"
#define OVERLAY_NAME_OK L" OCOK"
#define OVERLAY_NAME_OK_SHARED L" OCOKShared"
#define OVERLAY_NAME_SYNC L" OCSync"
#define OVERLAY_NAME_SYNC_SHARED L" OCSyncShared"
#define OVERLAY_NAME_WARNING L" OCWarning"
#define OVERLAY_NAME_WARNING_SHARED L" OCWarningShared"
#define REGISTRY_OVERLAY_KEY L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellIconOverlayIdentifiers"
#define REGISTRY_CLSID L"CLSID"
@@ -44,4 +47,4 @@
#define GET_FILE_OVERLAY_ID L"getFileIconId"
#define PORT 33001
#define PORT 34001

View File

@@ -45,6 +45,7 @@ if (APPLE)
list(APPEND 3rdparty_SRC
3rdparty/qtmacgoodies/src/macpreferenceswindow.mm
3rdparty/qtmacgoodies/src/macstandardicon.mm
3rdparty/qtmacgoodies/src/macwindow.mm
)
endif()
@@ -64,6 +65,7 @@ set(3rdparty_INC
)
set(libsync_SRCS
mirall/authenticationdialog.cpp
mirall/syncresult.cpp
mirall/mirallconfigfile.cpp
mirall/syncengine.cpp
@@ -87,6 +89,7 @@ set(libsync_SRCS
mirall/clientproxy.cpp
mirall/cookiejar.cpp
mirall/syncfilestatus.cpp
mirall/discoveryphase.cpp
creds/dummycredentials.cpp
creds/abstractcredentials.cpp
creds/credentialsfactory.cpp
@@ -106,7 +109,6 @@ else()
creds/shibbolethcredentials.cpp
creds/shibboleth/shibbolethwebview.cpp
creds/shibboleth/shibbolethrefresher.cpp
creds/shibboleth/authenticationdialog.cpp
creds/shibboleth/shibbolethuserjob.cpp
)
endif()
@@ -267,6 +269,7 @@ set(mirall_SRCS
mirall/socketapi.cpp
mirall/sslbutton.cpp
mirall/syncrunfilelog.cpp
mirall/selectivesyncdialog.cpp
)

View File

@@ -20,7 +20,6 @@
#include <QDebug>
#include "creds/shibbolethcredentials.h"
#include "creds/shibboleth/authenticationdialog.h"
#include "creds/shibboleth/shibbolethwebview.h"
#include "creds/shibboleth/shibbolethrefresher.h"
#include "creds/shibbolethcredentials.h"
@@ -173,8 +172,6 @@ QNetworkAccessManager* ShibbolethCredentials::getQNAM() const
QNetworkAccessManager* qnam(new MirallAccessManager);
connect(qnam, SIGNAL(finished(QNetworkReply*)),
this, SLOT(slotReplyFinished(QNetworkReply*)));
connect(qnam, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
SLOT(slotHandleAuthentication(QNetworkReply*,QAuthenticator*)));
return qnam;
}
@@ -319,23 +316,6 @@ void ShibbolethCredentials::invalidateAndFetch(Account* account)
job->start();
}
void ShibbolethCredentials::slotHandleAuthentication(QNetworkReply *reply, QAuthenticator *authenticator)
{
Q_UNUSED(reply)
QUrl url = reply->url();
// show only scheme, host and port
QUrl reducedUrl;
reducedUrl.setScheme(url.scheme());
reducedUrl.setHost(url.host());
reducedUrl.setPort(url.port());
AuthenticationDialog dialog(authenticator->realm(), reducedUrl.toString());
if (dialog.exec() == QDialog::Accepted) {
authenticator->setUser(dialog.user());
authenticator->setPassword(dialog.password());
}
}
void ShibbolethCredentials::slotInvalidateAndFetchInvalidateDone(QKeychain::Job* job)
{
Account *account = qvariant_cast<Account*>(job->property("account"));

View File

@@ -63,7 +63,6 @@ public:
public Q_SLOTS:
void invalidateAndFetch(Account *account) Q_DECL_OVERRIDE;
void slotHandleAuthentication(QNetworkReply*,QAuthenticator*);
private Q_SLOTS:
void onShibbolethCookieReceived(const QNetworkCookie&, Account*);

View File

@@ -26,6 +26,7 @@
#include "mirall/ignorelisteditor.h"
#include "mirall/account.h"
#include "mirall/quotainfo.h"
#include "selectivesyncdialog.h"
#include "creds/abstractcredentials.h"
#include <math.h>
@@ -77,6 +78,7 @@ AccountSettings::AccountSettings(QWidget *parent) :
ui->_buttonRemove->setEnabled(false);
ui->_buttonEnable->setEnabled(false);
ui->_buttonSelectiveSync->setEnabled(false);
ui->_buttonAdd->setEnabled(true);
QAction *resetFolderAction = new QAction(this);
@@ -92,6 +94,7 @@ AccountSettings::AccountSettings(QWidget *parent) :
connect(ui->_buttonRemove, SIGNAL(clicked()), this, SLOT(slotRemoveCurrentFolder()));
connect(ui->_buttonEnable, SIGNAL(clicked()), this, SLOT(slotEnableCurrentFolder()));
connect(ui->_buttonAdd, SIGNAL(clicked()), this, SLOT(slotAddFolder()));
connect(ui->_buttonSelectiveSync, SIGNAL(clicked()), this, SLOT(slotSelectiveSync()));
connect(ui->modifyAccountButton, SIGNAL(clicked()), SLOT(slotOpenAccountWizard()));
connect(ui->ignoredFilesButton, SIGNAL(clicked()), SLOT(slotIgnoreFilesEditor()));;
@@ -111,9 +114,13 @@ AccountSettings::AccountSettings(QWidget *parent) :
this, SLOT(slotAccountChanged(Account*,Account*)));
slotAccountChanged(AccountManager::instance()->account(), 0);
connect(FolderMan::instance(), SIGNAL(folderListLoaded(Folder::Map)),
FolderMan *folderMan = FolderMan::instance();
connect(folderMan, SIGNAL(folderSyncStateChange(QString)),
this, SLOT(slotSyncStateChange(QString)));
connect(folderMan, SIGNAL(folderListLoaded(Folder::Map)),
this, SLOT(setFolderList(Folder::Map)));
setFolderList(FolderMan::instance()->map());
slotSyncStateChange();
}
void AccountSettings::slotAccountChanged(Account *newAccount, Account *oldAccount)
@@ -122,6 +129,7 @@ void AccountSettings::slotAccountChanged(Account *newAccount, Account *oldAccoun
disconnect(oldAccount, SIGNAL(stateChanged(int)), this, SLOT(slotAccountStateChanged(int)));
disconnect(oldAccount->quotaInfo(), SIGNAL(quotaUpdated(qint64,qint64)),
this, SLOT(slotUpdateQuota(qint64,qint64)));
disconnect(oldAccount, SIGNAL(stateChanged(int)), this, SLOT(slotAccountStateChanged(int)));
}
_account = newAccount;
@@ -150,12 +158,14 @@ void AccountSettings::slotFolderActivated( const QModelIndex& indx )
} else {
ui->_buttonAdd->setVisible(true);
}
ui->_buttonAdd->setEnabled(_account && _account->state() == Account::Connected);
bool isConnected = _account && _account->state() == Account::Connected;
ui->_buttonAdd->setEnabled(isConnected);
ui->_buttonEnable->setEnabled( isValid );
ui->_buttonSelectiveSync->setEnabled(isConnected && isValid);
if ( isValid ) {
bool folderEnabled = _model->data( indx, FolderStatusDelegate::FolderSyncEnabled).toBool();
if ( folderEnabled ) {
bool folderPaused = _model->data( indx, FolderStatusDelegate::FolderSyncPaused).toBool();
if ( !folderPaused) {
ui->_buttonEnable->setText( tr( "Pause" ) );
} else {
ui->_buttonEnable->setText( tr( "Resume" ) );
@@ -189,10 +199,13 @@ void AccountSettings::slotFolderWizardAccepted()
QString alias = folderWizard->field(QLatin1String("alias")).toString();
QString sourceFolder = folderWizard->field(QLatin1String("sourceFolder")).toString();
QString targetPath = folderWizard->property("targetPath").toString();
QStringList selectiveSyncBlackList
= folderWizard->property("selectiveSyncBlackList").toStringList();
if (!FolderMan::ensureJournalGone( sourceFolder ))
return;
folderMan->addFolderDefinition(alias, sourceFolder, targetPath );
folderMan->addFolderDefinition(alias, sourceFolder, targetPath, selectiveSyncBlackList );
Folder *f = folderMan->setupFolderFromConfigFile( alias );
slotAddFolder( f );
folderMan->setSyncEnabled(true);
@@ -222,7 +235,11 @@ void AccountSettings::slotAddFolder( Folder *folder )
if( ! folder || folder->alias().isEmpty() ) return;
QStandardItem *item = new QStandardItem();
folderToModelItem( item, folder );
bool isConnected = false;
if (_account) {
isConnected = (_account->state() == Account::Connected);
}
folderToModelItem( item, folder, isConnected);
_model->appendRow( item );
// in order to update the enabled state of the "Sync now" button
connect(folder, SIGNAL(syncStateChange()), this, SLOT(slotFolderSyncStateChange()), Qt::UniqueConnection);
@@ -244,15 +261,15 @@ void AccountSettings::setGeneralErrors( const QStringList& errors )
}
}
void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f, bool accountConnected )
{
if( ! item || !f ) return;
item->setData( f->nativePath(), FolderStatusDelegate::FolderPathRole );
item->setData( f->remotePath(), FolderStatusDelegate::FolderSecondPathRole );
item->setData( f->alias(), FolderStatusDelegate::FolderAliasRole );
item->setData( f->syncEnabled(), FolderStatusDelegate::FolderSyncEnabled );
item->setData( f->syncPaused(), FolderStatusDelegate::FolderSyncPaused );
item->setData( accountConnected, FolderStatusDelegate::FolderAccountConnected );
SyncResult res = f->syncResult();
SyncResult::Status status = res.status();
@@ -260,35 +277,39 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
Theme *theme = Theme::instance();
item->setData( theme->statusHeaderText( status ), Qt::ToolTipRole );
if( f->syncEnabled() ) {
if( status == SyncResult::SyncPrepare ) {
if( _wasDisabledBefore ) {
// if the folder was disabled before, set the sync icon
item->setData( theme->syncStateIcon( SyncResult::SyncRunning), FolderStatusDelegate::FolderStatusIconRole );
} // we keep the previous icon for the SyncPrepare state.
} else if( status == SyncResult::Undefined ) {
// startup, the sync was never done.
qDebug() << "XXX FIRST time sync, setting icon to sync running!";
item->setData( theme->syncStateIcon( SyncResult::SyncRunning), FolderStatusDelegate::FolderStatusIconRole );
if ( accountConnected ) {
if( f->syncPaused() ) {
item->setData( theme->folderDisabledIcon( ), FolderStatusDelegate::FolderStatusIconRole ); // size 48 before
_wasDisabledBefore = false;
} else {
// kepp the previous icon for the prepare phase.
if( status == SyncResult::Problem) {
item->setData( theme->syncStateIcon( SyncResult::Success), FolderStatusDelegate::FolderStatusIconRole );
if( status == SyncResult::SyncPrepare ) {
if( _wasDisabledBefore ) {
// if the folder was disabled before, set the sync icon
item->setData( theme->syncStateIcon( SyncResult::SyncRunning), FolderStatusDelegate::FolderStatusIconRole );
} // we keep the previous icon for the SyncPrepare state.
} else if( status == SyncResult::Undefined ) {
// startup, the sync was never done.
qDebug() << "XXX FIRST time sync, setting icon to sync running!";
item->setData( theme->syncStateIcon( SyncResult::SyncRunning), FolderStatusDelegate::FolderStatusIconRole );
} else {
item->setData( theme->syncStateIcon( status ), FolderStatusDelegate::FolderStatusIconRole );
// kepp the previous icon for the prepare phase.
if( status == SyncResult::Problem) {
item->setData( theme->syncStateIcon( SyncResult::Success), FolderStatusDelegate::FolderStatusIconRole );
} else {
item->setData( theme->syncStateIcon( status ), FolderStatusDelegate::FolderStatusIconRole );
}
}
}
} else {
item->setData( theme->folderDisabledIcon( ), FolderStatusDelegate::FolderStatusIconRole ); // size 48 before
_wasDisabledBefore = false;
item->setData( theme->folderOfflineIcon(), FolderStatusDelegate::FolderStatusIconRole);
}
item->setData( theme->statusHeaderText( status ), FolderStatusDelegate::FolderStatus );
if( errorList.isEmpty() ) {
if( (status == SyncResult::Error ||
status == SyncResult::SetupError ||
status == SyncResult::SyncAbortRequested ||
status == SyncResult::Unavailable)) {
status == SyncResult::SyncAbortRequested )) {
errorList << theme->statusHeaderText(status);
}
}
@@ -369,6 +390,20 @@ void AccountSettings::slotResetCurrentFolder()
}
}
void AccountSettings::slotSelectiveSync()
{
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
if( selected.isValid() ) {
QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
FolderMan *folderMan = FolderMan::instance();
Folder *f = folderMan->folder(alias);
if (f) {
(new SelectiveSyncDialog(f, this))->open();
}
}
}
void AccountSettings::slotDoubleClicked( const QModelIndex& indx )
{
if( ! indx.isValid() ) return;
@@ -422,57 +457,60 @@ void AccountSettings::slotEnableCurrentFolder()
if( selected.isValid() ) {
QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
bool folderEnabled = _model->data( selected, FolderStatusDelegate::FolderSyncEnabled).toBool();
qDebug() << "Toggle enabled/disabled Folder alias " << alias << " - current state: " << folderEnabled;
if( !alias.isEmpty() ) {
FolderMan *folderMan = FolderMan::instance();
qDebug() << "Application: enable folder with alias " << alias;
bool terminate = false;
// this sets the folder status to disabled but does not interrupt it.
Folder *f = folderMan->folder( alias );
if (!f) {
return;
}
if( folderEnabled ) {
// check if a sync is still running and if so, ask if we should terminate.
if( f->isBusy() ) { // its still running
#if defined(Q_OS_MAC)
QWidget *parent = this;
Qt::WindowFlags flags = Qt::Sheet;
#else
QWidget *parent = 0;
Qt::WindowFlags flags = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint; // default flags
#endif
QMessageBox msgbox(QMessageBox::Question, tr("Sync Running"),
tr("The syncing operation is running.<br/>Do you want to terminate it?"),
QMessageBox::Yes | QMessageBox::No, parent, flags);
msgbox.setDefaultButton(QMessageBox::Yes);
int reply = msgbox.exec();
if ( reply == QMessageBox::Yes )
terminate = true;
else
return; // do nothing
}
}
// message box can return at any time while the thread keeps running,
// so better check again after the user has responded.
if ( f->isBusy() && terminate ) {
f->slotTerminateSync();
}
folderMan->slotEnableFolder( alias, !folderEnabled );
// keep state for the icon setting.
if( !folderEnabled ) _wasDisabledBefore = true;
slotUpdateFolderState (f);
// set the button text accordingly.
slotFolderActivated( selected );
if( alias.isEmpty() ) {
qDebug() << "Empty alias to enable.";
return;
}
FolderMan *folderMan = FolderMan::instance();
qDebug() << "Application: enable folder with alias " << alias;
bool terminate = false;
bool currentlyPaused = false;
// this sets the folder status to disabled but does not interrupt it.
Folder *f = folderMan->folder( alias );
if (!f) {
return;
}
currentlyPaused = f->syncPaused();
if( ! currentlyPaused ) {
// check if a sync is still running and if so, ask if we should terminate.
if( f->isBusy() ) { // its still running
#if defined(Q_OS_MAC)
QWidget *parent = this;
Qt::WindowFlags flags = Qt::Sheet;
#else
QWidget *parent = 0;
Qt::WindowFlags flags = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint; // default flags
#endif
QMessageBox msgbox(QMessageBox::Question, tr("Sync Running"),
tr("The syncing operation is running.<br/>Do you want to terminate it?"),
QMessageBox::Yes | QMessageBox::No, parent, flags);
msgbox.setDefaultButton(QMessageBox::Yes);
int reply = msgbox.exec();
if ( reply == QMessageBox::Yes )
terminate = true;
else
return; // do nothing
}
}
// message box can return at any time while the thread keeps running,
// so better check again after the user has responded.
if ( f->isBusy() && terminate ) {
f->slotTerminateSync();
}
f->setSyncPaused(!currentlyPaused); // toggle the pause setting
folderMan->slotSetFolderPaused( alias, !currentlyPaused );
// keep state for the icon setting.
if( currentlyPaused ) _wasDisabledBefore = true;
slotUpdateFolderState (f);
// set the button text accordingly.
slotFolderActivated( selected );
}
}
@@ -505,7 +543,7 @@ void AccountSettings::slotUpdateFolderState( Folder *folder )
}
if( item ) {
folderToModelItem( item, folder );
folderToModelItem( item, folder, _account->state() == Account::Connected );
} else {
// the dialog is not visible.
}
@@ -564,6 +602,14 @@ void AccountSettings::slotSetProgress(const QString& folder, const Progress::Inf
QStandardItem *item = itemForFolder( folder );
if( !item ) return;
// switch on extra space.
item->setData( QVariant(true), FolderStatusDelegate::AddProgressSpace );
if (!progress._currentDiscoveredFolder.isEmpty()) {
item->setData( tr("Discovering %1").arg(progress._currentDiscoveredFolder) , FolderStatusDelegate::SyncProgressItemString );
return;
}
if(!progress._lastCompletedItem.isEmpty()
&& Progress::isWarningKind(progress._lastCompletedItem._status)) {
int warnCount = item->data(FolderStatusDelegate::WarningCount).toInt();
@@ -591,8 +637,7 @@ void AccountSettings::slotSetProgress(const QString& folder, const Progress::Inf
QString itemFileName = shortenFilename(folder, curItem._file);
QString kindString = Progress::asActionString(curItem);
// switch on extra space.
item->setData( QVariant(true), FolderStatusDelegate::AddProgressSpace );
QString fileProgressString;
if (Progress::isSizeDependent(curItem._instruction)) {
@@ -730,6 +775,11 @@ void AccountSettings::slotAccountStateChanged(int state)
QUrl safeUrl(_account->url());
safeUrl.setPassword(QString()); // Remove the password from the URL to avoid showing it in the UI
slotButtonsSetEnabled();
FolderMan *folderMan = FolderMan::instance();
foreach (Folder *folder, folderMan->map().values()) {
slotUpdateFolderState(folder);
}
slotSyncStateChange();
if (state == Account::Connected) {
QString user;
if (AbstractCredentials *cred = _account->credentials()) {
@@ -755,6 +805,21 @@ void AccountSettings::slotAccountStateChanged(int state)
}
}
void AccountSettings::slotSyncStateChange(const QString& alias)
{
Q_UNUSED(alias);
QIcon icon;
if (_account && _account->state() == Account::Connected) {
FolderMan *folderMan = FolderMan::instance();
SyncResult state = folderMan->accountStatus(folderMan->map().values());
icon = Theme::instance()->syncStateIcon(state.status());
} else {
icon = Theme::instance()->folderOfflineIcon();
}
emit accountIconChanged(icon);
}
AccountSettings::~AccountSettings()
{
delete ui;

View File

@@ -54,6 +54,7 @@ signals:
void openProtocol();
void openFolderAlias( const QString& );
void infoFolderAlias( const QString& );
void accountIconChanged( const QIcon& );
public slots:
void slotFolderActivated( const QModelIndex& );
@@ -62,6 +63,7 @@ public slots:
void slotDoubleClicked( const QModelIndex& );
void slotSetProgress(const QString& folder, const Progress::Info& progress);
void slotButtonsSetEnabled();
void slotSyncStateChange(const QString& alias = QString());
void slotUpdateQuota( qint64,qint64 );
void slotIgnoreFilesEditor();
@@ -81,10 +83,11 @@ protected slots:
void slotFolderWizardRejected();
void slotOpenAccountWizard();
void slotHideProgress();
void slotSelectiveSync();
private:
QString shortenFilename( const QString& folder, const QString& file ) const;
void folderToModelItem( QStandardItem *, Folder * );
void folderToModelItem(QStandardItem *, Folder * , bool accountConnected);
QStandardItem* itemForFolder(const QString& );
void showConnectionLabel( const QString& message, const QString& tooltip = QString() );

View File

@@ -70,6 +70,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="_buttonSelectiveSync">
<property name="text">
<string>Selective Sync...</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">

View File

@@ -179,7 +179,6 @@ void Application::slotLogout()
FolderMan *folderMan = FolderMan::instance();
folderMan->setSyncEnabled(false);
folderMan->terminateSyncProcess();
folderMan->unloadAllFolders();
a->setState(Account::SignedOut);
// show result
_gui->slotComputeOverallSyncStatus();
@@ -209,6 +208,8 @@ void Application::slotCleanup()
if (account) {
account->save();
}
FolderMan::instance()->unloadAllFolders();
_gui->slotShutdown();
_gui->deleteLater();
}
@@ -319,6 +320,10 @@ void Application::slotownCloudWizardDone( int res )
qDebug() << "Set up " << cnt << " folders.";
// We have some sort of configuration. Enable autostart
Utility::setLaunchOnStartup(_theme->appName(), _theme->appNameGUI(), true);
if (cnt == 0) {
// The folder configuration was skipped
_gui->slotShowSettings();
}
}
folderMan->setSyncEnabled( true );
if( res == QDialog::Accepted ) {

View File

@@ -0,0 +1,98 @@
/*
* Copyright (C) by Olivier Goffart <ogoffart@woboq.com>
*
* This program 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*/
#include "discoveryphase.h"
#include <csync_private.h>
#include <qdebug.h>
namespace Mirall {
bool DiscoveryJob::isInBlackList(const QString& path) const
{
if (_selectiveSyncBlackList.isEmpty()) {
// If there is no black list, everything is allowed
return false;
}
// If one of the item in the black list is a prefix of the path, it means this path need not to
// be synced.
//
// We know the list is sorted (for it is done in DiscoveryJob::start)
// So we can do a binary search. If the path is a prefix if another item or right after in the lexical order.
QString pathSlash = path + QLatin1Char('/');
auto it = std::lower_bound(_selectiveSyncBlackList.begin(), _selectiveSyncBlackList.end(), pathSlash);
if (it == _selectiveSyncBlackList.begin()) {
return false;
}
--it;
if (pathSlash.startsWith(*it + QLatin1Char('/'))) {
return true;
}
return false;
}
int DiscoveryJob::isInWhiteListCallBack(void *data, const char *path)
{
return static_cast<DiscoveryJob*>(data)->isInBlackList(QString::fromUtf8(path));
}
void DiscoveryJob::update_job_update_callback (bool local,
const char *dirUrl,
void *userdata)
{
DiscoveryJob *updateJob = static_cast<DiscoveryJob*>(userdata);
if (updateJob) {
// Don't wanna overload the UI
if (!updateJob->lastUpdateProgressCallbackCall.isValid()) {
updateJob->lastUpdateProgressCallbackCall.restart(); // first call
} else if (updateJob->lastUpdateProgressCallbackCall.elapsed() < 200) {
return;
} else {
updateJob->lastUpdateProgressCallbackCall.restart();
}
QString path = QString::fromUtf8(dirUrl).section('/', -1);
emit updateJob->folderDiscovered(local, path);
}
}
void DiscoveryJob::start() {
_selectiveSyncBlackList.sort();
_csync_ctx->checkBlackListHook = isInWhiteListCallBack;
_csync_ctx->checkBlackListData = this;
_csync_ctx->callbacks.update_callback = update_job_update_callback;
_csync_ctx->callbacks.update_callback_userdata = this;
csync_set_log_callback(_log_callback);
csync_set_log_level(_log_level);
csync_set_log_userdata(_log_userdata);
lastUpdateProgressCallbackCall.invalidate();
int ret = csync_update(_csync_ctx);
_csync_ctx->checkBlackListHook = 0;
_csync_ctx->checkBlackListData = 0;
_csync_ctx->callbacks.update_callback = 0;
_csync_ctx->callbacks.update_callback_userdata = 0;
emit finished(ret);
deleteLater();
}
}

View File

@@ -0,0 +1,66 @@
/*
* Copyright (C) by Olivier Goffart <ogoffart@woboq.com>
*
* This program 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*/
#pragma once
#include <QObject>
#include <QElapsedTimer>
#include <QStringList>
#include <csync.h>
namespace Mirall {
/**
* The Discovery Phase was once called "update" phase in csync therms.
* Its goal is to look at the files in one of the remote and check comared to the db
* if the files are new, or changed.
*/
class DiscoveryJob : public QObject {
Q_OBJECT
CSYNC *_csync_ctx;
csync_log_callback _log_callback;
int _log_level;
void* _log_userdata;
QElapsedTimer lastUpdateProgressCallbackCall;
/**
* return true if the given path should be synced,
* false if the path should be ignored
*/
bool isInBlackList(const QString &path) const;
static int isInWhiteListCallBack(void *, const char *);
static void update_job_update_callback (bool local,
const char *dirname,
void *userdata);
public:
explicit DiscoveryJob(CSYNC *ctx, QObject* parent = 0)
: QObject(parent), _csync_ctx(ctx) {
// We need to forward the log property as csync uses thread local
// and updates run in another thread
_log_callback = csync_get_log_callback();
_log_level = csync_get_log_level();
_log_userdata = csync_get_log_userdata();
}
QStringList _selectiveSyncBlackList;
Q_INVOKABLE void start();
signals:
void finished(int result);
void folderDiscovered(bool local, QString folderUrl);
};
}

View File

@@ -54,7 +54,7 @@ Folder::Folder(const QString &alias, const QString &path, const QString& secondP
, _path(path)
, _remotePath(secondPath)
, _alias(alias)
, _enabled(true)
, _paused(false)
, _csyncError(false)
, _csyncUnavail(false)
, _wipeDb(false)
@@ -215,14 +215,14 @@ QString Folder::nativePath() const
return QDir::toNativeSeparators(_path);
}
bool Folder::syncEnabled() const
bool Folder::syncPaused() const
{
return _enabled;
return _paused;
}
void Folder::setSyncEnabled( bool doit )
void Folder::setSyncPaused( bool doit )
{
_enabled = doit;
_paused = doit;
if( doit ) {
// qDebug() << "Syncing enabled on folder " << name();
@@ -260,6 +260,7 @@ void Folder::slotPollTimerTimeout()
qDebug() << "** Force Sync now, state is " << _syncResult.statusString();
emit scheduleToSync(alias());
} else {
// do the ordinary etag chech for the root folder.
RequestEtagJob* job = new RequestEtagJob(AccountManager::instance()->account(), remotePath(), this);
// check if the etag is different
QObject::connect(job, SIGNAL(etagRetreived(QString)), this, SLOT(etagRetreived(QString)));
@@ -287,7 +288,6 @@ void Folder::slotNetworkUnavailable()
if (account && account->state() == Account::Connected) {
account->setState(Account::Disconnected);
}
_syncResult.setStatus(SyncResult::Unavailable);
emit syncStateChange();
}
@@ -483,7 +483,7 @@ void Folder::slotTerminateSync()
// Do not display an error message, user knows his own actions.
// _errors.append( tr("The CSync thread terminated.") );
// _csyncError = true;
setSyncEnabled(false);
FolderMan::instance()->slotSetFolderPaused(alias(), true);
setSyncState(SyncResult::SyncAbortRequested);
return;
}
@@ -592,10 +592,12 @@ void Folder::startSync(const QStringList &pathList)
//direct connection so the message box is blocking the sync.
connect(_engine.data(), SIGNAL(aboutToRemoveAllFiles(SyncFileItem::Direction,bool*)),
SLOT(slotAboutToRemoveAllFiles(SyncFileItem::Direction,bool*)));
connect(_engine.data(), SIGNAL(folderDiscovered(bool,QString)), this, SLOT(slotFolderDiscovered(bool,QString)));
connect(_engine.data(), SIGNAL(transmissionProgress(Progress::Info)), this, SLOT(slotTransmissionProgress(Progress::Info)));
connect(_engine.data(), SIGNAL(jobCompleted(SyncFileItem)), this, SLOT(slotJobCompleted(SyncFileItem)));
setDirtyNetworkLimits();
_engine->setSelectiveSyncBlackList(selectiveSyncBlackList());
QMetaObject::invokeMethod(_engine.data(), "startSync", Qt::QueuedConnection);
@@ -662,7 +664,8 @@ void Folder::slotSyncFinished()
_syncResult.setErrorStrings( _errors );
qDebug() << " * owncloud csync thread finished with error";
} else if (_csyncUnavail) {
_syncResult.setStatus(SyncResult::Unavailable);
_syncResult.setStatus(SyncResult::Error);
qDebug() << " ** csync not available.";
} else if( _syncResult.warnCount() > 0 ) {
// there have been warnings on the way.
_syncResult.setStatus(SyncResult::Problem);
@@ -688,6 +691,13 @@ void Folder::slotEmitFinishedDelayed()
}
void Folder::slotFolderDiscovered(bool, QString folderName)
{
Progress::Info pi;
pi._currentDiscoveredFolder = folderName;
ProgressDispatcher::instance()->setProgressInfo(alias(), pi);
}
// the progress comes without a folder and the valid path set. Add that here
// and hand the result over to the progress dispatcher.
@@ -711,7 +721,7 @@ void Folder::slotJobCompleted(const SyncFileItem &item)
}
void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction direction, bool *cancel)
void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool *cancel)
{
QString msg =
tr("This sync would remove all the files in the sync folder '%1'.\n"

View File

@@ -85,9 +85,9 @@ public:
* If the sync is switched off, the startSync method is not going to
* be called.
*/
void setSyncEnabled( bool );
void setSyncPaused( bool );
bool syncEnabled() const;
bool syncPaused() const;
void prepareToSync();
@@ -121,6 +121,10 @@ public:
SyncJournalDb *journalDb() { return &_journal; }
CSYNC *csyncContext() { return _csync_ctx; }
QStringList selectiveSyncBlackList() { return _selectiveSyncBlackList; }
void setSelectiveSyncBlackList(const QStringList &blackList)
{ _selectiveSyncBlackList = blackList; }
signals:
void syncStateChange();
@@ -157,6 +161,7 @@ private slots:
void slotCsyncUnavailable();
void slotSyncFinished();
void slotFolderDiscovered(bool local, QString folderName);
void slotTransmissionProgress(const Progress::Info& pi);
void slotJobCompleted(const SyncFileItem&);
@@ -184,10 +189,11 @@ private:
QString _remotePath;
QString _alias;
QString _configFile;
bool _enabled;
bool _paused;
SyncResult _syncResult;
QScopedPointer<SyncEngine> _engine;
QStringList _errors;
QStringList _selectiveSyncBlackList;
bool _csyncError;
bool _csyncUnavail;
bool _wipeDb;

View File

@@ -53,6 +53,7 @@ FolderMan::FolderMan(QObject *parent) :
_instance = this;
_socketApi = new SocketApi(this);
_socketApi->slotReadExcludes();
}
FolderMan *FolderMan::instance()
@@ -234,7 +235,7 @@ void FolderMan::terminateCurrentSync()
#define PAR_O_TAG QLatin1String("__PAR_OPEN__")
#define PAR_C_TAG QLatin1String("__PAR_CLOSE__")
QString FolderMan::escapeAlias( const QString& alias ) const
QString FolderMan::escapeAlias( const QString& alias )
{
QString a(alias);
@@ -312,6 +313,7 @@ Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
QString backend = settings.value(QLatin1String("backend")).toString();
QString targetPath = settings.value( QLatin1String("targetPath")).toString();
bool paused = settings.value( QLatin1String("paused"), false).toBool();
QStringList blackList = settings.value( QLatin1String("blackList")).toStringList();
// QString connection = settings.value( QLatin1String("connection") ).toString();
QString alias = unescapeAlias( escapedAlias );
@@ -326,11 +328,12 @@ Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
}
folder = new Folder( alias, path, targetPath, this );
folder->setConfigFile(file);
folder->setConfigFile(cfgFile.absoluteFilePath());
folder->setSelectiveSyncBlackList(blackList);
qDebug() << "Adding folder to Folder Map " << folder;
_folderMap[alias] = folder;
if (paused) {
folder->setSyncEnabled(!paused);
folder->setSyncPaused(paused);
_disabledFolders.insert(folder);
}
@@ -346,7 +349,7 @@ Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
return folder;
}
void FolderMan::slotEnableFolder( const QString& alias, bool enable )
void FolderMan::slotSetFolderPaused( const QString& alias, bool paused )
{
if( ! _folderMap.contains( alias ) ) {
qDebug() << "!! Can not enable alias " << alias << ", can not be found in folderMap.";
@@ -355,13 +358,12 @@ void FolderMan::slotEnableFolder( const QString& alias, bool enable )
Folder *f = _folderMap[alias];
if( f ) {
f->setSyncEnabled(enable);
slotScheduleSync(alias);
// FIXME: Use MirallConfigFile
QSettings settings(_folderConfigPath + QLatin1Char('/') + f->configFile(), QSettings::IniFormat);
QSettings settings(f->configFile(), QSettings::IniFormat);
settings.beginGroup(escapeAlias(f->alias()));
if (enable) {
if (!paused) {
settings.remove("paused");
_disabledFolders.remove(f);
} else {
@@ -410,7 +412,7 @@ SyncResult FolderMan::syncResult( const QString& alias )
void FolderMan::slotScheduleAllFolders()
{
foreach( Folder *f, _folderMap.values() ) {
if (f && f->syncEnabled()) {
if (f && ! f->syncPaused()) {
slotScheduleSync( f->alias() );
}
}
@@ -433,7 +435,7 @@ void FolderMan::slotScheduleSync( const QString& alias )
if( ! _scheduleQueue.contains(alias ) && _folderMap.contains(alias) ) {
Folder *f = _folderMap[alias];
if( f ) {
if( f->syncEnabled() ) {
if( !f->syncPaused() ) {
f->prepareToSync();
} else {
qDebug() << "Folder is not enabled, not scheduled!";
@@ -442,7 +444,6 @@ void FolderMan::slotScheduleSync( const QString& alias )
}
}
_scheduleQueue.enqueue(alias);
} else {
qDebug() << " II> Sync for folder " << alias << " already scheduled, do not enqueue!";
}
@@ -450,6 +451,8 @@ void FolderMan::slotScheduleSync( const QString& alias )
QTimer::singleShot(500, this, SLOT(slotScheduleFolderSync()));
}
// only enable or disable foldermans will to schedule and do syncs.
// this is not the same as Pause and Resume of folders.
void FolderMan::setSyncEnabled( bool enabled )
{
if (!_syncEnabled && enabled && !_scheduleQueue.isEmpty()) {
@@ -457,12 +460,8 @@ void FolderMan::setSyncEnabled( bool enabled )
QTimer::singleShot(200, this, SLOT(slotScheduleFolderSync()));
}
_syncEnabled = enabled;
foreach( Folder *f, _folderMap.values() ) {
if(f) { // check for f != 0. That can happen, do not remove the check!
f->setSyncEnabled(enabled && !_disabledFolders.contains(f));
}
}
// force a redraw in case the network connect status changed
emit( folderSyncStateChange(QString::null) );
}
/*
@@ -487,10 +486,15 @@ void FolderMan::slotScheduleFolderSync()
const QString alias = _scheduleQueue.dequeue();
if( _folderMap.contains( alias ) ) {
Folder *f = _folderMap[alias];
if( f && f->syncEnabled() ) {
if( f && !f->syncPaused() ) {
_currentSyncFolder = alias;
f->startSync( QStringList() );
// reread the excludes of the socket api
// FIXME: the excludes need rework.
_socketApi->slotClearExcludesList();
_socketApi->slotReadExcludes();
}
}
}
@@ -514,7 +518,8 @@ void FolderMan::slotFolderSyncFinished( const SyncResult& )
QTimer::singleShot(200, this, SLOT(slotScheduleFolderSync()));
}
void FolderMan::addFolderDefinition(const QString& alias, const QString& sourceFolder, const QString& targetPath )
void FolderMan::addFolderDefinition(const QString& alias, const QString& sourceFolder,
const QString& targetPath, const QStringList &selectiveSyncBlackList )
{
QString escapedAlias = escapeAlias(alias);
// Create a settings file named after the alias
@@ -525,6 +530,7 @@ void FolderMan::addFolderDefinition(const QString& alias, const QString& sourceF
// for compat reasons
settings.setValue(QLatin1String("backend"), "owncloud" );
settings.setValue(QLatin1String("connection"), Theme::instance()->appName());
settings.setValue(QLatin1String("blackList"), selectiveSyncBlackList);
settings.sync();
}
@@ -576,7 +582,7 @@ void FolderMan::removeFolder( const QString& alias )
if( _folderMap.contains( alias )) {
qDebug() << "Removing " << alias;
f = _folderMap.take( alias );
f = _folderMap[alias]; // do not remove from the map, that is done in unloadFolder.
} else {
qDebug() << "!! Can not remove " << alias << ", not in folderMap.";
}
@@ -585,10 +591,10 @@ void FolderMan::removeFolder( const QString& alias )
f->wipe();
// can be removed if we are able to delete the folder object.
f->setSyncEnabled(false);
f->setSyncPaused(true);
// remove the folder configuration
QFile file( _folderConfigPath + QLatin1Char('/') + f->configFile() );
QFile file(f->configFile() );
if( file.exists() ) {
qDebug() << "Remove folder config file " << file.fileName();
file.remove();
@@ -680,42 +686,44 @@ SyncResult FolderMan::accountStatus(const QList<Folder*> &folders)
if( cnt == 1 ) {
Folder *folder = folders.at(0);
if( folder ) {
SyncResult::Status syncStatus = folder->syncResult().status();
if( folder->syncPaused() ) {
overallResult.setStatus(SyncResult::Paused);
} else {
SyncResult::Status syncStatus = folder->syncResult().status();
switch( syncStatus ) {
case SyncResult::Undefined:
overallResult.setStatus(SyncResult::Error);
break;
case SyncResult::NotYetStarted:
overallResult.setStatus( SyncResult::NotYetStarted );
break;
case SyncResult::SyncPrepare:
overallResult.setStatus( SyncResult::SyncPrepare );
break;
case SyncResult::SyncRunning:
overallResult.setStatus( SyncResult::SyncRunning );
break;
case SyncResult::Unavailable:
overallResult.setStatus( SyncResult::Unavailable );
break;
case SyncResult::Problem: // don't show the problem icon in tray.
case SyncResult::Success:
if( overallResult.status() == SyncResult::Undefined )
overallResult.setStatus( SyncResult::Success );
break;
case SyncResult::Error:
overallResult.setStatus( SyncResult::Error );
break;
case SyncResult::SetupError:
if ( overallResult.status() != SyncResult::Error )
overallResult.setStatus( SyncResult::SetupError );
break;
case SyncResult::SyncAbortRequested:
overallResult.setStatus( SyncResult::SyncAbortRequested);
break;
case SyncResult::Paused:
overallResult.setStatus( SyncResult::Paused);
break;
switch( syncStatus ) {
case SyncResult::Undefined:
overallResult.setStatus(SyncResult::Error);
break;
case SyncResult::NotYetStarted:
overallResult.setStatus( SyncResult::NotYetStarted );
break;
case SyncResult::SyncPrepare:
overallResult.setStatus( SyncResult::SyncPrepare );
break;
case SyncResult::SyncRunning:
overallResult.setStatus( SyncResult::SyncRunning );
break;
case SyncResult::Problem: // don't show the problem icon in tray.
case SyncResult::Success:
if( overallResult.status() == SyncResult::Undefined )
overallResult.setStatus( SyncResult::Success );
break;
case SyncResult::Error:
overallResult.setStatus( SyncResult::Error );
break;
case SyncResult::SetupError:
if ( overallResult.status() != SyncResult::Error )
overallResult.setStatus( SyncResult::SetupError );
break;
case SyncResult::SyncAbortRequested:
overallResult.setStatus( SyncResult::SyncAbortRequested);
break;
case SyncResult::Paused:
overallResult.setStatus( SyncResult::Paused);
break;
}
}
}
} else {
@@ -724,36 +732,36 @@ SyncResult FolderMan::accountStatus(const QList<Folder*> &folders)
int abortSeen = 0;
int runSeen = 0;
int various = 0;
int unavail = 0;
foreach ( Folder *folder, folders ) {
SyncResult folderResult = folder->syncResult();
SyncResult::Status syncStatus = folderResult.status();
switch( syncStatus ) {
case SyncResult::Undefined:
case SyncResult::NotYetStarted:
case SyncResult::SyncPrepare:
various++;
break;
case SyncResult::SyncRunning:
runSeen++;
break;
case SyncResult::Unavailable:
unavail++;
break;
case SyncResult::Problem: // don't show the problem icon in tray.
case SyncResult::Success:
goodSeen++;
break;
case SyncResult::Error:
case SyncResult::SetupError:
errorsSeen++;
break;
case SyncResult::SyncAbortRequested:
case SyncResult::Paused:
if( folder->syncPaused() ) {
abortSeen++;
// no default case on purpose, check compiler warnings
} else {
SyncResult folderResult = folder->syncResult();
SyncResult::Status syncStatus = folderResult.status();
switch( syncStatus ) {
case SyncResult::Undefined:
case SyncResult::NotYetStarted:
case SyncResult::SyncPrepare:
various++;
break;
case SyncResult::SyncRunning:
runSeen++;
break;
case SyncResult::Problem: // don't show the problem icon in tray.
case SyncResult::Success:
goodSeen++;
break;
case SyncResult::Error:
case SyncResult::SetupError:
errorsSeen++;
break;
case SyncResult::SyncAbortRequested:
case SyncResult::Paused:
abortSeen++;
// no default case on purpose, check compiler warnings
}
}
}
bool set = false;
@@ -779,7 +787,7 @@ SyncResult FolderMan::accountStatus(const QList<Folder*> &folders)
return overallResult;
}
QString FolderMan::statusToString( SyncResult syncStatus, bool enabled ) const
QString FolderMan::statusToString( SyncResult syncStatus, bool paused ) const
{
QString folderMessage;
switch( syncStatus.status() ) {
@@ -795,9 +803,6 @@ QString FolderMan::statusToString( SyncResult syncStatus, bool enabled ) const
case SyncResult::SyncRunning:
folderMessage = tr( "Sync is running." );
break;
case SyncResult::Unavailable:
folderMessage = tr( "Server is currently not available." );
break;
case SyncResult::Success:
folderMessage = tr( "Last Sync was successful." );
break;
@@ -817,7 +822,7 @@ QString FolderMan::statusToString( SyncResult syncStatus, bool enabled ) const
break;
// no default case on purpose, check compiler warnings
}
if( !enabled ) {
if( paused ) {
// sync is disabled.
folderMessage = tr( "%1 (Sync is paused)" ).arg(folderMessage);
}

View File

@@ -50,7 +50,8 @@ public:
* QString sourceFolder on local machine
* QString targetPath on remote
*/
void addFolderDefinition(const QString&, const QString&, const QString& );
void addFolderDefinition(const QString&, const QString&, const QString& ,
const QStringList &selectiveSyncBlacklist = QStringList() );
/** Returns the folder which the file or directory stored in path is in */
Folder* folderForPath(const QString& path);
@@ -77,17 +78,23 @@ public:
/** Creates a new and empty local directory. */
bool startFromScratch( const QString& );
QString statusToString( SyncResult, bool enabled ) const;
QString statusToString(SyncResult, bool paused ) const;
static SyncResult accountStatus( const QList<Folder*> &folders );
void removeMonitorPath( const QString& alias, const QString& path );
void addMonitorPath( const QString& alias, const QString& path );
// Escaping of the alias which is used in QSettings AND the file
// system, thus need to be escaped.
static QString escapeAlias( const QString& );
signals:
/**
* signal to indicate a folder named by alias has changed its sync state.
* Get the state via the Folder Map or the syncResult and syncState methods.
*
* Attention: The alias string may be zero. Do a general update of the state than.
*/
void folderSyncStateChange( const QString & );
@@ -95,7 +102,7 @@ signals:
public slots:
void slotRemoveFolder( const QString& );
void slotEnableFolder( const QString&, bool );
void slotSetFolderPaused(const QString&, bool paused);
void slotFolderSyncStarted();
void slotFolderSyncFinished( const SyncResult& );
@@ -131,9 +138,6 @@ private:
QString getBackupName( const QString& ) const;
void registerFolderMonitor( Folder *folder );
// Escaping of the alias which is used in QSettings AND the file
// system, thus need to be escaped.
QString escapeAlias( const QString& ) const;
QString unescapeAlias( const QString& ) const;
void removeFolder( const QString& );

Some files were not shown because too many files have changed in this diff Show More