[Pkg-owncloud-commits] [owncloud-client] 288/332: Support for multiple icons

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Aug 14 21:07:13 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 9a1781f613ba84e288d16b30dec0f0b0831e43b1
Author: Daniel Molkentin <danimo at owncloud.com>
Date:   Mon Aug 4 15:40:08 2014 +0200

    Support for multiple icons
---
 .../OCShellExtensions/OCOverlays/DllMain.cpp       | 168 +++++++++++++--------
 .../OCShellExtensions/OCOverlays/OCOverlay.cpp     |  13 +-
 .../OCShellExtensions/OCOverlays/OCOverlay.h       |   3 +-
 .../OCOverlays/OCOverlayFactory.cpp                |  27 +---
 .../OCOverlays/OCOverlayFactory.h                  |  11 +-
 .../OCOverlays/OCOverlayRegistrationHandler.cpp    |   4 +-
 .../OCOverlays/OCOverlayRegistrationHandler.h      |   4 +-
 .../OCOverlays/OverlayConstants.h                  |  21 ++-
 .../OCShellExtensions/OCOverlays/resource.h        | Bin 1626 -> 1536 bytes
 .../OCShellExtensions/OCShellExtensions.sln        |  26 ++--
 .../OCShellExtensions/OCUtil/RemotePathChecker.cpp |  15 +-
 .../OCShellExtensions/OCUtil/RemotePathChecker.h   |   2 +-
 12 files changed, 171 insertions(+), 123 deletions(-)

diff --git a/shell_integration/windows/OCShellExtensions/OCOverlays/DllMain.cpp b/shell_integration/windows/OCShellExtensions/OCOverlays/DllMain.cpp
index 84b128d..a124b95 100644
--- a/shell_integration/windows/OCShellExtensions/OCOverlays/DllMain.cpp
+++ b/shell_integration/windows/OCShellExtensions/OCOverlays/DllMain.cpp
@@ -37,38 +37,57 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
 	return TRUE;
 }
 
+HRESULT CreateFactory(REFIID riid, void **ppv, int state)
+{
+	HRESULT hResult = E_OUTOFMEMORY;
+
+	OCOverlayFactory* ocOverlayFactory = new OCOverlayFactory(state);
+
+	if (ocOverlayFactory) {
+		hResult = ocOverlayFactory->QueryInterface(riid, ppv);
+		ocOverlayFactory->Release();
+	}
+	return hResult;
+}
+
 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
 {
     HRESULT hResult = CLASS_E_CLASSNOTAVAILABLE;
-	GUID guid;  
+	GUID guid;
  
-	hResult = CLSIDFromString(OVERLAY_GUID, (LPCLSID)&guid);
+	hResult = CLSIDFromString(OVERLAY_GUID_ERROR, (LPCLSID)&guid);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	if (IsEqualCLSID(guid, rclsid)) { return CreateFactory(riid, ppv, State_Error); }
 
-	if (hResult != S_OK) { 
-		return hResult;
-	}	 
+	hResult = CLSIDFromString(OVERLAY_GUID_ERROR_SHARED, (LPCLSID)&guid);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	if (IsEqualCLSID(guid, rclsid)) { return CreateFactory(riid, ppv, State_ErrorShared); }
 
-    if (!IsEqualCLSID(guid, rclsid)) {
-		return hResult;
-	}
-     
-	hResult = E_OUTOFMEMORY;
+	hResult = CLSIDFromString(OVERLAY_GUID_OK, (LPCLSID)&guid);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	if (IsEqualCLSID(guid, rclsid)) { return CreateFactory(riid, ppv, State_OK); }
 
-	wchar_t szModule[MAX_PATH];
+	hResult = CLSIDFromString(OVERLAY_GUID_OK_SHARED, (LPCLSID)&guid);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	if (IsEqualCLSID(guid, rclsid)) { return CreateFactory(riid, ppv, State_OKShared); }
 
-	if (GetModuleFileName(instanceHandle, szModule, ARRAYSIZE(szModule)) == 0) {	
-		hResult = HRESULT_FROM_WIN32(GetLastError());
+	hResult = CLSIDFromString(OVERLAY_GUID_SYNC, (LPCLSID)&guid);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	if (IsEqualCLSID(guid, rclsid)) { return CreateFactory(riid, ppv, State_Sync); }
 
-		return hResult;
-	}
+	hResult = CLSIDFromString(OVERLAY_GUID_SYNC_SHARED, (LPCLSID)&guid);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	if (IsEqualCLSID(guid, rclsid)) { return CreateFactory(riid, ppv, State_SyncShared); }
 
-	OCOverlayFactory* ocOverlayFactory = new OCOverlayFactory(szModule);
+	hResult = CLSIDFromString(OVERLAY_GUID_WARNING, (LPCLSID)&guid);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	if (IsEqualCLSID(guid, rclsid)) { return CreateFactory(riid, ppv, State_Warning); }
 
-	if (ocOverlayFactory) {
-		hResult = ocOverlayFactory->QueryInterface(riid, ppv);
-		ocOverlayFactory->Release();
-	}
-    return hResult;
+	hResult = CLSIDFromString(OVERLAY_GUID_WARNING_SHARED, (LPCLSID)&guid);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	if (IsEqualCLSID(guid, rclsid)) { return CreateFactory(riid, ppv, State_WarningShared); }
+	
+	return CLASS_E_CLASSNOTAVAILABLE;
 }
 
 STDAPI DllCanUnloadNow(void)
@@ -78,43 +97,79 @@ STDAPI DllCanUnloadNow(void)
 	return S_FALSE;
 }
 
-HRESULT _stdcall DllRegisterServer(void)
+HRESULT RegisterCLSID(LPCOLESTR guidStr, PCWSTR overlayStr, PCWSTR szModule)
 {
 	HRESULT hResult = S_OK;
 
-	wchar_t szModule[MAX_PATH];
+	GUID guid;
+	hResult = CLSIDFromString(guidStr, (LPCLSID)&guid);
 
-	if (GetModuleFileName(instanceHandle, szModule, ARRAYSIZE(szModule)) == 0)
-	{	
-		hResult = HRESULT_FROM_WIN32(GetLastError());
+	if (hResult != S_OK) {
+		return hResult;
+	}
+
+	hResult = OCOverlayRegistrationHandler::RegisterCOMObject(szModule, guid);
 
+	if (!SUCCEEDED(hResult)) {
 		return hResult;
 	}
 
-	GUID guid;  
- 
-	hResult = CLSIDFromString(OVERLAY_GUID, (LPCLSID)&guid);
+	hResult = OCOverlayRegistrationHandler::MakeRegistryEntries(guid, overlayStr);
 
-	if (hResult != S_OK) 
-	{ 
+	return hResult;
+}
+
+HRESULT _stdcall DllRegisterServer(void)
+{
+	HRESULT hResult = S_OK;
+
+	wchar_t szModule[MAX_PATH];
+
+	if (GetModuleFileName(instanceHandle, szModule, ARRAYSIZE(szModule)) == 0) {	
+		hResult = HRESULT_FROM_WIN32(GetLastError());
 		return hResult;
 	}
 
-	hResult = OCOverlayRegistrationHandler::RegisterCOMObject(szModule, guid);
+	hResult = RegisterCLSID(OVERLAY_GUID_ERROR, OVERLAY_NAME_ERROR, szModule);
+	if (!SUCCEEDED(hResult)) {	return hResult;	}
+	hResult = RegisterCLSID(OVERLAY_GUID_ERROR_SHARED, OVERLAY_NAME_ERROR_SHARED, szModule);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = RegisterCLSID(OVERLAY_GUID_OK, OVERLAY_NAME_OK, szModule);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = RegisterCLSID(OVERLAY_GUID_OK_SHARED, OVERLAY_NAME_OK_SHARED, szModule);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = RegisterCLSID(OVERLAY_GUID_SYNC, OVERLAY_NAME_SYNC, szModule);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = RegisterCLSID(OVERLAY_GUID_SYNC_SHARED, OVERLAY_NAME_SYNC_SHARED,szModule);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = RegisterCLSID(OVERLAY_GUID_WARNING, OVERLAY_NAME_WARNING, szModule);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = RegisterCLSID(OVERLAY_GUID_WARNING_SHARED, OVERLAY_NAME_WARNING_SHARED, szModule);
 
-	if(!SUCCEEDED(hResult))
-	{
+    return hResult;
+}
+
+
+HRESULT UnregisterCLSID(LPCOLESTR guidStr, PCWSTR overlayStr)
+{
+	HRESULT hResult = S_OK;
+	GUID guid;
+
+	hResult = CLSIDFromString(guidStr, (LPCLSID)&guid);
+
+	if (hResult != S_OK) {
 		return hResult;
 	}
 
-	hResult = OCOverlayRegistrationHandler::MakeRegistryEntries(guid, OVERLAY_NAME);
+	hResult = OCOverlayRegistrationHandler::UnregisterCOMObject(guid);
 
-	if(!SUCCEEDED(hResult))
-	{
+	if (!SUCCEEDED(hResult)) {
 		return hResult;
 	}
 
-    return hResult;
+	hResult = OCOverlayRegistrationHandler::RemoveRegistryEntries(overlayStr);
+
+	return hResult;
 }
 
 STDAPI DllUnregisterServer(void)
@@ -128,29 +183,22 @@ STDAPI DllUnregisterServer(void)
         hResult = HRESULT_FROM_WIN32(GetLastError());
         return hResult;
     }
-		
-	GUID guid;  
- 
-	hResult = CLSIDFromString(OVERLAY_GUID, (LPCLSID)&guid);
-
-	if (hResult != S_OK) 
-	{ 
-		return hResult;
-	}
-
-	hResult = OCOverlayRegistrationHandler::UnregisterCOMObject(guid);
 
-	if(!SUCCEEDED(hResult))
-	{
-		return hResult;
-	}
-
-	hResult = OCOverlayRegistrationHandler::RemoveRegistryEntries(OVERLAY_NAME);
-	
-	if (!SUCCEEDED(hResult))
-    {
-		return hResult;
-	}
+	hResult = UnregisterCLSID(OVERLAY_GUID_ERROR, OVERLAY_NAME_ERROR);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = UnregisterCLSID(OVERLAY_GUID_ERROR_SHARED, OVERLAY_NAME_ERROR_SHARED);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = UnregisterCLSID(OVERLAY_GUID_OK, OVERLAY_NAME_OK);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = UnregisterCLSID(OVERLAY_GUID_OK_SHARED, OVERLAY_NAME_OK_SHARED);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = UnregisterCLSID(OVERLAY_GUID_SYNC, OVERLAY_NAME_SYNC);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = UnregisterCLSID(OVERLAY_GUID_SYNC_SHARED, OVERLAY_NAME_SYNC_SHARED);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = UnregisterCLSID(OVERLAY_GUID_WARNING, OVERLAY_NAME_WARNING);
+	if (!SUCCEEDED(hResult)) { return hResult; }
+	hResult = UnregisterCLSID(OVERLAY_GUID_WARNING_SHARED, OVERLAY_NAME_WARNING_SHARED);
 
     return hResult;
 }
diff --git a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlay.cpp b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlay.cpp
index 2fc9471..a8e3689 100644
--- a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlay.cpp
+++ b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlay.cpp
@@ -33,10 +33,11 @@ extern HINSTANCE instanceHandle;
 #define IDM_DISPLAY 0  
 #define IDB_OK 101
 
-OCOverlay::OCOverlay() 
+OCOverlay::OCOverlay(int state) 
 	: _communicationSocket(0)
 	, _referenceCount(1)
 	, _checker(new RemotePathChecker(PORT))
+	, _state(state)
 
 {
 }
@@ -98,20 +99,18 @@ IFACEMETHODIMP OCOverlay::GetPriority(int *pPriority)
 	//	return MAKE_HRESULT(S_FALSE, 0, 0);
 	//}
 
-	bool isDir = dwAttrib & FILE_ATTRIBUTE_DIRECTORY;
-	
-	if (!_checker->IsMonitoredPath(pwszPath, isDir)) {
+	int state = 0;
+	if (!_checker->IsMonitoredPath(pwszPath, &state)) {
 		return MAKE_HRESULT(S_FALSE, 0, 0);
 	}
-
-	return MAKE_HRESULT(S_OK, 0, 0);
+	return MAKE_HRESULT(state == _state ? S_OK : S_FALSE, 0, 0);
 }
 
 IFACEMETHODIMP OCOverlay::GetOverlayInfo(PWSTR pwszIconFile, int cchMax, int *pIndex, DWORD *pdwFlags)
 {
 	*pIndex = 0;
 	*pdwFlags = ISIOI_ICONFILE | ISIOI_ICONINDEX;
-	*pIndex = 2;
+	*pIndex = _state;
 
 	if (GetModuleFileName(instanceHandle, pwszIconFile, cchMax) == 0) {	
 		HRESULT hResult = HRESULT_FROM_WIN32(GetLastError());
diff --git a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlay.h b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlay.h
index 498800a..a84bc45 100644
--- a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlay.h
+++ b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlay.h
@@ -25,7 +25,7 @@ class OCOverlay : public IShellIconOverlayIdentifier
 
 {
 public:
-	OCOverlay();
+	OCOverlay(int state);
 
 	IFACEMETHODIMP_(ULONG) AddRef();
 	IFACEMETHODIMP GetOverlayInfo(PWSTR pwszIconFile, int cchMax, int *pIndex, DWORD *pdwFlags);
@@ -44,6 +44,7 @@ private:
     long _referenceCount;
 	CommunicationSocket* _communicationSocket;
 	RemotePathChecker* _checker;
+	int _state;
 };
 
 #endif
\ No newline at end of file
diff --git a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayFactory.cpp b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayFactory.cpp
index f2d344c..963d7c6 100644
--- a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayFactory.cpp
+++ b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayFactory.cpp
@@ -17,8 +17,8 @@
 
 extern long dllReferenceCount;
 
-OCOverlayFactory::OCOverlayFactory(wchar_t* path)
-	: _referenceCount(1)
+OCOverlayFactory::OCOverlayFactory(int state)
+	: _referenceCount(1), _state(state)
 {
     InterlockedIncrement(&dllReferenceCount);
 }
@@ -68,23 +68,13 @@ IFACEMETHODIMP OCOverlayFactory::CreateInstance(
 {
 	HRESULT hResult = CLASS_E_NOAGGREGATION;
 
-    if (pUnkOuter != NULL)
-    {
-		return hResult;
-	}
+    if (pUnkOuter != NULL) { return hResult; }
 
 	hResult = E_OUTOFMEMORY;
-
-    OCOverlay *lrOverlay = 
-		new (std::nothrow) OCOverlay();
-
-	if (!lrOverlay)
-    {
-		return hResult;
-	}
+    OCOverlay *lrOverlay = new (std::nothrow) OCOverlay(_state);
+	if (!lrOverlay) { return hResult; }
 
     hResult = lrOverlay->QueryInterface(riid, ppv);
-	
 	lrOverlay->Release();
 
 	return hResult;
@@ -92,12 +82,9 @@ IFACEMETHODIMP OCOverlayFactory::CreateInstance(
 
 IFACEMETHODIMP OCOverlayFactory::LockServer(BOOL fLock)
 {
-    if (fLock)
-    {
+    if (fLock) {
         InterlockedIncrement(&dllReferenceCount);
-    }
-    else
-    {
+    } else {
         InterlockedDecrement(&dllReferenceCount);
     }
     return S_OK;
diff --git a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayFactory.h b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayFactory.h
index 6751e5b..9f3ece8 100644
--- a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayFactory.h
+++ b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayFactory.h
@@ -19,10 +19,17 @@
 
 #include "stdafx.h"
 
+enum State {
+	State_Error = 0, State_ErrorShared,
+	State_OK, State_OKShared,
+	State_Sync, State_SyncShared,
+	State_Warning, State_WarningShared
+};
+
 class OCOverlayFactory : public IClassFactory
 {
 public:
-	OCOverlayFactory(wchar_t* path);
+	OCOverlayFactory(int state);
 
 	IFACEMETHODIMP_(ULONG) AddRef();
     IFACEMETHODIMP CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppv);
@@ -35,7 +42,7 @@ protected:
 
 private:
     long _referenceCount;
-	wchar_t* _path;
+	int _state;
 };
 
 #endif
\ No newline at end of file
diff --git a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.cpp b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.cpp
index 3fc0729..0271ee9 100644
--- a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.cpp
+++ b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.cpp
@@ -20,7 +20,7 @@
 
 using namespace std;
 
-HRESULT OCOverlayRegistrationHandler::MakeRegistryEntries(const CLSID& clsid, PWSTR friendlyName)
+HRESULT OCOverlayRegistrationHandler::MakeRegistryEntries(const CLSID& clsid, PCWSTR friendlyName)
 {
 	HRESULT hResult;
 	HKEY shellOverlayKey = NULL;
@@ -50,7 +50,7 @@ HRESULT OCOverlayRegistrationHandler::MakeRegistryEntries(const CLSID& clsid, PW
 	return hResult;
 }
 
-HRESULT OCOverlayRegistrationHandler::RemoveRegistryEntries(PWSTR friendlyName)
+HRESULT OCOverlayRegistrationHandler::RemoveRegistryEntries(PCWSTR friendlyName)
 {
 	HRESULT hResult;
 	HKEY shellOverlayKey = NULL;
diff --git a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.h b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.h
index 1fdef93..606b9e8 100644
--- a/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.h
+++ b/shell_integration/windows/OCShellExtensions/OCOverlays/OCOverlayRegistrationHandler.h
@@ -22,9 +22,9 @@
 class __declspec(dllexport) OCOverlayRegistrationHandler 
 {
 	public:
-		static HRESULT MakeRegistryEntries(const CLSID& clsid, PWSTR fileType);
+		static HRESULT MakeRegistryEntries(const CLSID& clsid, PCWSTR fileType);
 		static HRESULT RegisterCOMObject(PCWSTR modulePath, const CLSID& clsid);
-		static HRESULT RemoveRegistryEntries(PWSTR friendlyName);
+		static HRESULT RemoveRegistryEntries(PCWSTR friendlyName);
 		static HRESULT UnregisterCOMObject(const CLSID& clsid);
 };
 
diff --git a/shell_integration/windows/OCShellExtensions/OCOverlays/OverlayConstants.h b/shell_integration/windows/OCShellExtensions/OCOverlays/OverlayConstants.h
index 9df0bc5..d93ea98 100644
--- a/shell_integration/windows/OCShellExtensions/OCOverlays/OverlayConstants.h
+++ b/shell_integration/windows/OCShellExtensions/OCOverlays/OverlayConstants.h
@@ -12,9 +12,24 @@
 * details.
 */
 
-#define	OVERLAY_ID					1
-#define OVERLAY_GUID				L"{0960F09E-F328-48A3-B746-276B1E3C3722}"
-#define OVERLAY_NAME				L"OwnCloudStatusOverlay"
+
+#define OVERLAY_GUID_ERROR			L"{0960F090-F328-48A3-B746-276B1E3C3722}"
+#define OVERLAY_GUID_ERROR_SHARED	L"{0960F091-F328-48A3-B746-276B1E3C3722}"
+#define OVERLAY_GUID_OK				L"{0960F092-F328-48A3-B746-276B1E3C3722}"
+#define OVERLAY_GUID_OK_SHARED		L"{0960F093-F328-48A3-B746-276B1E3C3722}"
+#define OVERLAY_GUID_SYNC			L"{0960F094-F328-48A3-B746-276B1E3C3722}"
+#define OVERLAY_GUID_SYNC_SHARED	L"{0960F095-F328-48A3-B746-276B1E3C3722}"
+#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 REGISTRY_OVERLAY_KEY		L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellIconOverlayIdentifiers"
 #define REGISTRY_CLSID				L"CLSID"
diff --git a/shell_integration/windows/OCShellExtensions/OCOverlays/resource.h b/shell_integration/windows/OCShellExtensions/OCOverlays/resource.h
index dbb1edc..3a3dab3 100644
Binary files a/shell_integration/windows/OCShellExtensions/OCOverlays/resource.h and b/shell_integration/windows/OCShellExtensions/OCOverlays/resource.h differ
diff --git a/shell_integration/windows/OCShellExtensions/OCShellExtensions.sln b/shell_integration/windows/OCShellExtensions/OCShellExtensions.sln
index 979c155..1bfbbf3 100644
--- a/shell_integration/windows/OCShellExtensions/OCShellExtensions.sln
+++ b/shell_integration/windows/OCShellExtensions/OCShellExtensions.sln
@@ -3,14 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 2013
 VisualStudioVersion = 12.0.30501.0
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCUtil", "OCUtil\OCUtil.vcxproj", "{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCOverlays", "OCOverlays\OCOverlays.vcxproj", "{42EFEC79-5ACA-4F76-955F-15CE4340F6BC}"
 	ProjectSection(ProjectDependencies) = postProject
 		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3} = {E4F63E19-808D-4234-8DF0-69C5F47C9CD3}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCUtilTest", "ConsoleApplication1\ConsoleApplication1.vcxproj", "{A81E3DAE-8FE7-4BD0-82F9-939B2D59D033}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCUtil", "OCUtil\OCUtil.vcxproj", "{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -20,14 +18,6 @@ Global
 		Release|x64 = Release|x64
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Debug|Win32.Build.0 = Debug|Win32
-		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Debug|x64.ActiveCfg = Debug|x64
-		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Debug|x64.Build.0 = Debug|x64
-		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Release|Win32.ActiveCfg = Release|Win32
-		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Release|Win32.Build.0 = Release|Win32
-		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Release|x64.ActiveCfg = Release|x64
-		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Release|x64.Build.0 = Release|x64
 		{42EFEC79-5ACA-4F76-955F-15CE4340F6BC}.Debug|Win32.ActiveCfg = Debug|Win32
 		{42EFEC79-5ACA-4F76-955F-15CE4340F6BC}.Debug|Win32.Build.0 = Debug|Win32
 		{42EFEC79-5ACA-4F76-955F-15CE4340F6BC}.Debug|x64.ActiveCfg = Debug|x64
@@ -36,12 +26,14 @@ Global
 		{42EFEC79-5ACA-4F76-955F-15CE4340F6BC}.Release|Win32.Build.0 = Release|Win32
 		{42EFEC79-5ACA-4F76-955F-15CE4340F6BC}.Release|x64.ActiveCfg = Release|x64
 		{42EFEC79-5ACA-4F76-955F-15CE4340F6BC}.Release|x64.Build.0 = Release|x64
-		{A81E3DAE-8FE7-4BD0-82F9-939B2D59D033}.Debug|Win32.ActiveCfg = Debug|Win32
-		{A81E3DAE-8FE7-4BD0-82F9-939B2D59D033}.Debug|Win32.Build.0 = Debug|Win32
-		{A81E3DAE-8FE7-4BD0-82F9-939B2D59D033}.Debug|x64.ActiveCfg = Debug|Win32
-		{A81E3DAE-8FE7-4BD0-82F9-939B2D59D033}.Release|Win32.ActiveCfg = Release|Win32
-		{A81E3DAE-8FE7-4BD0-82F9-939B2D59D033}.Release|Win32.Build.0 = Release|Win32
-		{A81E3DAE-8FE7-4BD0-82F9-939B2D59D033}.Release|x64.ActiveCfg = Release|Win32
+		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Debug|Win32.Build.0 = Debug|Win32
+		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Debug|x64.ActiveCfg = Debug|x64
+		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Debug|x64.Build.0 = Debug|x64
+		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Release|Win32.ActiveCfg = Release|Win32
+		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Release|Win32.Build.0 = Release|Win32
+		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Release|x64.ActiveCfg = Release|x64
+		{E4F63E19-808D-4234-8DF0-69C5F47C9CD3}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
diff --git a/shell_integration/windows/OCShellExtensions/OCUtil/RemotePathChecker.cpp b/shell_integration/windows/OCShellExtensions/OCUtil/RemotePathChecker.cpp
index 2eec3c2..e2eba1d 100644
--- a/shell_integration/windows/OCShellExtensions/OCUtil/RemotePathChecker.cpp
+++ b/shell_integration/windows/OCShellExtensions/OCUtil/RemotePathChecker.cpp
@@ -37,7 +37,7 @@ RemotePathChecker::RemotePathChecker(int port)
 {
 }
 
-bool RemotePathChecker::IsMonitoredPath(const wchar_t* filePath, bool isDir)
+bool RemotePathChecker::IsMonitoredPath(const wchar_t* filePath, int* state)
 {
 	wstring request;
 	wstring response;
@@ -45,11 +45,7 @@ bool RemotePathChecker::IsMonitoredPath(const wchar_t* filePath, bool isDir)
 
 	CommunicationSocket socket(_port);
 	socket.Connect();
-	if (isDir) {
-		request = L"RETRIEVE_FOLDER_STATUS:";
-	} else {
-		request = L"RETRIEVE_FILE_STATUS:";
-	}
+	request = L"RETRIEVE_FILE_STATUS:";
 	request += filePath;
 	request += L'\n';
 
@@ -76,8 +72,11 @@ bool RemotePathChecker::IsMonitoredPath(const wchar_t* filePath, bool isDir)
 	wstring responseStatus = response.substr(statusBegin+1, statusEnd - statusBegin-1);
 	wstring responsePath = response.substr(statusEnd+1);
 	if (responsePath == filePath) {
-		int status = _StrToFileState(responseStatus);
-		if (status == StateNone) {
+		if (!state) {
+			return false;
+		}
+		*state = _StrToFileState(responseStatus);
+		if (*state == StateNone) {
 			return false;
 		}
 		needed = true;
diff --git a/shell_integration/windows/OCShellExtensions/OCUtil/RemotePathChecker.h b/shell_integration/windows/OCShellExtensions/OCUtil/RemotePathChecker.h
index 5e58c6d..47b76f2 100644
--- a/shell_integration/windows/OCShellExtensions/OCUtil/RemotePathChecker.h
+++ b/shell_integration/windows/OCShellExtensions/OCUtil/RemotePathChecker.h
@@ -29,7 +29,7 @@ public:
 		StateNone
 	};
 	RemotePathChecker(int port);
-	bool IsMonitoredPath(const wchar_t* filePath, bool isDir);
+	bool IsMonitoredPath(const wchar_t* filePath, int* state);
 
 private:
 	int _StrToFileState(const std::wstring &str);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list