From 3ee4f55a61b1b7266582df6028daf548a361e073 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Fri, 7 Feb 2014 15:54:01 +0000 Subject: [PATCH] "dir" was used by mistake instead of "filename" --- .../platform/CMSWindowsHookLibraryLoader.cpp | 6 ++-- .../platform/CMSWindowsHookLibraryLoader.h | 2 +- src/lib/platform/CMSWindowsScreen.cpp | 28 +++++++++---------- src/lib/platform/CMSWindowsScreen.h | 2 +- src/lib/platform/COSXScreen.cpp | 12 ++++---- src/lib/platform/COSXScreen.h | 2 +- src/lib/server/CServer.cpp | 4 +-- src/lib/synergy/CPlatformScreen.h | 4 +-- src/lib/synergy/CScreen.cpp | 4 +-- src/lib/synergy/CScreen.h | 2 +- src/lib/synergy/IPlatformScreen.h | 2 +- src/lib/synwinxt/CDataHandlerExtension.cpp | 10 +++---- src/lib/synwinxt/CDataHandlerExtension.h | 2 +- src/lib/synwinxt/synwinxt.cpp | 18 ++++++------ src/lib/synwinxt/synwinxt.def | 2 +- src/lib/synwinxt/synwinxt.h | 4 +-- 16 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/lib/platform/CMSWindowsHookLibraryLoader.cpp b/src/lib/platform/CMSWindowsHookLibraryLoader.cpp index 2e13e4e6..f12da420 100644 --- a/src/lib/platform/CMSWindowsHookLibraryLoader.cpp +++ b/src/lib/platform/CMSWindowsHookLibraryLoader.cpp @@ -26,7 +26,7 @@ CMSWindowsHookLibraryLoader::CMSWindowsHookLibraryLoader() : m_setSides(NULL), m_setZone(NULL), m_setMode(NULL), - m_getDraggingFileDir(NULL) + m_getDraggingFilename(NULL) { } @@ -91,9 +91,9 @@ CMSWindowsHookLibraryLoader::openShellLibrary(const char* name) } // look up functions - m_getDraggingFileDir = (GetDraggingFileDir)GetProcAddress(shellLibrary, "getDraggingFileDir"); + m_getDraggingFilename = (GetDraggingFilename)GetProcAddress(shellLibrary, "getDraggingFilename"); - if (m_getDraggingFileDir == NULL) { + if (m_getDraggingFilename == NULL) { LOG((CLOG_ERR "invalid shell library, use a newer %s.dll", name)); throw XScreenOpenFailure(); } diff --git a/src/lib/platform/CMSWindowsHookLibraryLoader.h b/src/lib/platform/CMSWindowsHookLibraryLoader.h index 898d321d..ed374cae 100644 --- a/src/lib/platform/CMSWindowsHookLibraryLoader.h +++ b/src/lib/platform/CMSWindowsHookLibraryLoader.h @@ -41,7 +41,7 @@ public: SetZoneFunc m_setZone; SetModeFunc m_setMode; - GetDraggingFileDir m_getDraggingFileDir; + GetDraggingFilename m_getDraggingFilename; }; #endif \ No newline at end of file diff --git a/src/lib/platform/CMSWindowsScreen.cpp b/src/lib/platform/CMSWindowsScreen.cpp index da0bb7cb..1b57e127 100644 --- a/src/lib/platform/CMSWindowsScreen.cpp +++ b/src/lib/platform/CMSWindowsScreen.cpp @@ -362,8 +362,8 @@ CMSWindowsScreen::leave() forceShowCursor(); if (getDraggingStarted()) { - CString& draggingDir = getDraggingFileDir(); - size_t size = draggingDir.size(); + CString& draggingFilename = getDraggingFilename(); + size_t size = draggingFilename.size(); if (!m_isPrimary) { // TODO: fake these keys properly @@ -372,14 +372,14 @@ CMSWindowsScreen::leave() fakeMouseButton(kButtonLeft, false); - if (draggingDir.empty() == false) { + if (draggingFilename.empty() == false) { CClientApp& app = CClientApp::instance(); CClient* client = app.getClientPtr(); UInt32 fileCount = 1; - LOG((CLOG_DEBUG "send dragging info to server: %s", draggingDir.c_str())); - client->draggingInfoSending(fileCount, draggingDir, size); + LOG((CLOG_DEBUG "send dragging info to server: %s", draggingFilename.c_str())); + client->draggingInfoSending(fileCount, draggingFilename, size); LOG((CLOG_DEBUG "send dragging file to server")); - client->sendFileToServer(draggingDir.c_str()); + client->sendFileToServer(draggingFilename.c_str()); } } @@ -1332,8 +1332,8 @@ CMSWindowsScreen::onMouseButton(WPARAM wParam, LPARAM lParam) if (pressed) { m_buttons[button] = true; if (button == kButtonLeft) { - m_draggingFileDir.clear(); - LOG((CLOG_DEBUG2 "dragging file directory is cleared")); + m_draggingFilename.clear(); + LOG((CLOG_DEBUG2 "dragging filename is cleared")); } } else { @@ -1896,17 +1896,17 @@ CMSWindowsScreen::fakeDraggingFiles(CString str) } CString& -CMSWindowsScreen::getDraggingFileDir() +CMSWindowsScreen::getDraggingFilename() { if (m_draggingStarted) { - // temporarily log out dragging file directory + // temporarily log out dragging filename char dir[MAX_PATH]; - m_hookLibraryLoader.m_getDraggingFileDir(dir); - m_draggingFileDir.clear(); - m_draggingFileDir.append(dir); + m_hookLibraryLoader.m_getDraggingFilename(dir); + m_draggingFilename.clear(); + m_draggingFilename.append(dir); } - return m_draggingFileDir; + return m_draggingFilename; } const CString& diff --git a/src/lib/platform/CMSWindowsScreen.h b/src/lib/platform/CMSWindowsScreen.h index ed7957e1..762f3ea6 100644 --- a/src/lib/platform/CMSWindowsScreen.h +++ b/src/lib/platform/CMSWindowsScreen.h @@ -116,7 +116,7 @@ public: virtual void setSequenceNumber(UInt32); virtual bool isPrimary() const; virtual void fakeDraggingFiles(CString str); - virtual CString& getDraggingFileDir(); + virtual CString& getDraggingFilename(); virtual const CString& getDropTarget() const; diff --git a/src/lib/platform/COSXScreen.cpp b/src/lib/platform/COSXScreen.cpp index 234bf304..0945dc91 100644 --- a/src/lib/platform/COSXScreen.cpp +++ b/src/lib/platform/COSXScreen.cpp @@ -912,7 +912,7 @@ COSXScreen::leave() hideCursor(); if (getDraggingStarted()) { - CString& fileList = getDraggingFileDir(); + CString& fileList = getDraggingFilename(); size_t size = fileList.size(); if (!m_isPrimary) { @@ -1228,7 +1228,7 @@ COSXScreen::onMouseButton(bool pressed, UInt16 macButton) MouseButtonState state = pressed ? kMouseButtonDown : kMouseButtonUp; m_buttonState.set(kButtonLeft - 1, state); if (pressed) { - m_draggingFileDir.clear(); + m_draggingFilename.clear(); LOG((CLOG_DEBUG2 "dragging file directory is cleared")); } else { @@ -2105,21 +2105,21 @@ COSXScreen::fakeDraggingFiles(CString str) } CString& -COSXScreen::getDraggingFileDir() +COSXScreen::getDraggingFilename() { if (m_draggingStarted) { CFStringRef dragInfo = getDraggedFileURL(); char* info = NULL; info = CFStringRefToUTF8String(dragInfo); if (info == NULL) { - m_draggingFileDir.clear(); + m_draggingFilename.clear(); } else { LOG((CLOG_DEBUG "drag info: %s", info)); CFRelease(dragInfo); CString fileList(info); - m_draggingFileDir = fileList; + m_draggingFilename = fileList; } } - return m_draggingFileDir; + return m_draggingFilename; } diff --git a/src/lib/platform/COSXScreen.h b/src/lib/platform/COSXScreen.h index cea276fe..d7eee312 100644 --- a/src/lib/platform/COSXScreen.h +++ b/src/lib/platform/COSXScreen.h @@ -98,7 +98,7 @@ public: virtual void setSequenceNumber(UInt32); virtual bool isPrimary() const; virtual void fakeDraggingFiles(CString str); - virtual CString& getDraggingFileDir(); + virtual CString& getDraggingFilename(); const CString& getDropTarget() const { return m_dropTarget; } diff --git a/src/lib/server/CServer.cpp b/src/lib/server/CServer.cpp index 0d7ea807..bd66e2e3 100644 --- a/src/lib/server/CServer.cpp +++ b/src/lib/server/CServer.cpp @@ -1669,7 +1669,7 @@ CServer::onMouseUp(ButtonID id) } if (m_enableDragDrop && !m_screen->isOnScreen()) { - CString& dir = m_screen->getDraggingFileDir(); + CString& dir = m_screen->getDraggingFilename(); if (!dir.empty()) { LOG((CLOG_DEBUG "send file to client: %s", dir.c_str())); sendFileToClient(dir.c_str()); @@ -1750,7 +1750,7 @@ CServer::onMouseMovePrimary(SInt32 x, SInt32 y) // should we switch or not? if (isSwitchOkay(newScreen, dir, x, y, xc, yc)) { if (m_enableDragDrop && m_screen->getDraggingStarted() && m_active != newScreen) { - CString& dragFileList = m_screen->getDraggingFileDir(); + CString& dragFileList = m_screen->getDraggingFilename(); size_t size = dragFileList.size() + 1; char* fileList = NULL; UInt32 fileCount = 1; diff --git a/src/lib/synergy/CPlatformScreen.h b/src/lib/synergy/CPlatformScreen.h index 27fb9b09..9f202620 100644 --- a/src/lib/synergy/CPlatformScreen.h +++ b/src/lib/synergy/CPlatformScreen.h @@ -80,7 +80,7 @@ public: virtual void setDraggingStarted(bool started) { m_draggingStarted = started; } virtual bool getDraggingStarted(); virtual bool getFakeDraggingStarted() { return m_fakeDraggingStarted; } - virtual CString& getDraggingFileDir() { return m_draggingFileDir; } + virtual CString& getDraggingFilename() { return m_draggingFilename; } // IPlatformScreen overrides virtual void enable() = 0; @@ -120,7 +120,7 @@ protected: virtual void handleSystemEvent(const CEvent& event, void*) = 0; protected: - CString m_draggingFileDir; + CString m_draggingFilename; bool m_draggingStarted; bool m_fakeDraggingStarted; }; diff --git a/src/lib/synergy/CScreen.cpp b/src/lib/synergy/CScreen.cpp index dc15541e..5a291bb5 100644 --- a/src/lib/synergy/CScreen.cpp +++ b/src/lib/synergy/CScreen.cpp @@ -447,9 +447,9 @@ CScreen::setEnableDragDrop(bool enabled) } CString& -CScreen::getDraggingFileDir() const +CScreen::getDraggingFilename() const { - return m_screen->getDraggingFileDir(); + return m_screen->getDraggingFilename(); } const CString& diff --git a/src/lib/synergy/CScreen.h b/src/lib/synergy/CScreen.h index 76b99986..027bf75d 100644 --- a/src/lib/synergy/CScreen.h +++ b/src/lib/synergy/CScreen.h @@ -284,7 +284,7 @@ public: //! Get dragging file's directory. - CString& getDraggingFileDir() const; + CString& getDraggingFilename() const; //! Get drop target directory. diff --git a/src/lib/synergy/IPlatformScreen.h b/src/lib/synergy/IPlatformScreen.h index ec5e4e9e..6166d260 100644 --- a/src/lib/synergy/IPlatformScreen.h +++ b/src/lib/synergy/IPlatformScreen.h @@ -188,7 +188,7 @@ public: virtual SInt32 pollActiveGroup() const = 0; virtual void pollPressedKeys(KeyButtonSet& pressedKeys) const = 0; - virtual CString& getDraggingFileDir() = 0; + virtual CString& getDraggingFilename() = 0; virtual bool getDraggingStarted() = 0; virtual bool getFakeDraggingStarted() = 0; diff --git a/src/lib/synwinxt/CDataHandlerExtension.cpp b/src/lib/synwinxt/CDataHandlerExtension.cpp index 8ba30b22..a90e241c 100644 --- a/src/lib/synwinxt/CDataHandlerExtension.cpp +++ b/src/lib/synwinxt/CDataHandlerExtension.cpp @@ -21,7 +21,7 @@ extern LONG g_refCount; extern GUID g_CLSID; -extern void updateDraggingDir(char*); +extern void updateDraggingFilename(char*); extern void outputDebugStringF(const char *str, ...); CDataHandlerExtension::CDataHandlerExtension() : @@ -86,10 +86,10 @@ CDataHandlerExtension::Load(__RPC__in LPCOLESTR pszFileName, DWORD dwMode) { outputDebugStringF("synwinxt: > CDataHandlerExtension::Load\n"); - char selectedFileDir[MAX_PATH]; - StringCchCopyW(m_selectedFileDir, ARRAYSIZE(m_selectedFileDir), pszFileName); - WideCharToMultiByte(CP_ACP, 0, m_selectedFileDir, -1, selectedFileDir, MAX_PATH, NULL, NULL); - updateDraggingDir(selectedFileDir); + char selectedFilename[MAX_PATH]; + StringCchCopyW(m_selectedFilename, ARRAYSIZE(m_selectedFilename), pszFileName); + WideCharToMultiByte(CP_ACP, 0, m_selectedFilename, -1, selectedFilename, MAX_PATH, NULL, NULL); + updateDraggingFilename(selectedFilename); outputDebugStringF("synwinxt: < CDataHandlerExtension::Load\n"); return S_OK; diff --git a/src/lib/synwinxt/CDataHandlerExtension.h b/src/lib/synwinxt/CDataHandlerExtension.h index d1991407..97c381bb 100644 --- a/src/lib/synwinxt/CDataHandlerExtension.h +++ b/src/lib/synwinxt/CDataHandlerExtension.h @@ -53,5 +53,5 @@ public: private: LONG m_refCount; - WCHAR m_selectedFileDir[MAX_PATH]; + WCHAR m_selectedFilename[MAX_PATH]; }; diff --git a/src/lib/synwinxt/synwinxt.cpp b/src/lib/synwinxt/synwinxt.cpp index 96cd8a56..9d147713 100644 --- a/src/lib/synwinxt/synwinxt.cpp +++ b/src/lib/synwinxt/synwinxt.cpp @@ -28,7 +28,7 @@ #pragma data_seg("sharedData") #endif -static BYTE g_draggingFileDir[MAX_PATH] = { 0 }; +static BYTE g_draggingFilename[MAX_PATH] = { 0 }; #if defined(_MSC_VER) #pragma data_seg() @@ -282,17 +282,17 @@ unregisterShellExtDataHandler(CHAR* fileType, const CLSID& clsid) } void -updateDraggingDir(char* dir) +updateDraggingFilename(char* filename) { - outputDebugStringF("synwinxt: > updateDraggingDir, dir=%s\n", dir); - memcpy(g_draggingFileDir, dir, MAX_PATH); - outputDebugStringF("synwinxt: < updateDraggingDir, g_draggingFileDir=%s\n", g_draggingFileDir); + outputDebugStringF("synwinxt: > updateDraggingFilename, filename=%s\n", filename); + memcpy(g_draggingFilename, filename, MAX_PATH); + outputDebugStringF("synwinxt: < updateDraggingFilename, g_draggingFilename=%s\n", g_draggingFilename); } void -getDraggingFileDir(char* dir) +getDraggingFilename(char* filename) { - outputDebugStringF("synwinxt: > getDraggingFileDir\n"); - memcpy(dir, g_draggingFileDir, MAX_PATH); - outputDebugStringF("synwinxt: < getDraggingFileDir, dir=%s\n", dir); + outputDebugStringF("synwinxt: > getDraggingFilename\n"); + memcpy(filename, g_draggingFilename, MAX_PATH); + outputDebugStringF("synwinxt: < getDraggingFilename, filename=%s\n", filename); } diff --git a/src/lib/synwinxt/synwinxt.def b/src/lib/synwinxt/synwinxt.def index d2bb952d..c13e3d61 100644 --- a/src/lib/synwinxt/synwinxt.def +++ b/src/lib/synwinxt/synwinxt.def @@ -4,4 +4,4 @@ EXPORTS DllCanUnloadNow PRIVATE DllRegisterServer PRIVATE DllUnregisterServer PRIVATE - getDraggingFileDir + getDraggingFilename diff --git a/src/lib/synwinxt/synwinxt.h b/src/lib/synwinxt/synwinxt.h index 12e23b35..d1b87123 100644 --- a/src/lib/synwinxt/synwinxt.h +++ b/src/lib/synwinxt/synwinxt.h @@ -25,6 +25,6 @@ #define CSYNERGYSHELLEXE_API __declspec(dllimport) #endif -typedef void (*GetDraggingFileDir)(CHAR*); +typedef void (*GetDraggingFilename)(CHAR*); -CSYNERGYSHELLEXE_API void getDraggingFileDir(char*); +CSYNERGYSHELLEXE_API void getDraggingFilename(char*);