"dir" was used by mistake instead of "filename"

This commit is contained in:
Nick Bolton 2014-02-07 15:54:01 +00:00
parent 8a8ae6c0b1
commit 3ee4f55a61
16 changed files with 52 additions and 52 deletions

View File

@ -26,7 +26,7 @@ CMSWindowsHookLibraryLoader::CMSWindowsHookLibraryLoader() :
m_setSides(NULL), m_setSides(NULL),
m_setZone(NULL), m_setZone(NULL),
m_setMode(NULL), m_setMode(NULL),
m_getDraggingFileDir(NULL) m_getDraggingFilename(NULL)
{ {
} }
@ -91,9 +91,9 @@ CMSWindowsHookLibraryLoader::openShellLibrary(const char* name)
} }
// look up functions // 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)); LOG((CLOG_ERR "invalid shell library, use a newer %s.dll", name));
throw XScreenOpenFailure(); throw XScreenOpenFailure();
} }

View File

@ -41,7 +41,7 @@ public:
SetZoneFunc m_setZone; SetZoneFunc m_setZone;
SetModeFunc m_setMode; SetModeFunc m_setMode;
GetDraggingFileDir m_getDraggingFileDir; GetDraggingFilename m_getDraggingFilename;
}; };
#endif #endif

View File

@ -362,8 +362,8 @@ CMSWindowsScreen::leave()
forceShowCursor(); forceShowCursor();
if (getDraggingStarted()) { if (getDraggingStarted()) {
CString& draggingDir = getDraggingFileDir(); CString& draggingFilename = getDraggingFilename();
size_t size = draggingDir.size(); size_t size = draggingFilename.size();
if (!m_isPrimary) { if (!m_isPrimary) {
// TODO: fake these keys properly // TODO: fake these keys properly
@ -372,14 +372,14 @@ CMSWindowsScreen::leave()
fakeMouseButton(kButtonLeft, false); fakeMouseButton(kButtonLeft, false);
if (draggingDir.empty() == false) { if (draggingFilename.empty() == false) {
CClientApp& app = CClientApp::instance(); CClientApp& app = CClientApp::instance();
CClient* client = app.getClientPtr(); CClient* client = app.getClientPtr();
UInt32 fileCount = 1; UInt32 fileCount = 1;
LOG((CLOG_DEBUG "send dragging info to server: %s", draggingDir.c_str())); LOG((CLOG_DEBUG "send dragging info to server: %s", draggingFilename.c_str()));
client->draggingInfoSending(fileCount, draggingDir, size); client->draggingInfoSending(fileCount, draggingFilename, size);
LOG((CLOG_DEBUG "send dragging file to server")); 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) { if (pressed) {
m_buttons[button] = true; m_buttons[button] = true;
if (button == kButtonLeft) { if (button == kButtonLeft) {
m_draggingFileDir.clear(); m_draggingFilename.clear();
LOG((CLOG_DEBUG2 "dragging file directory is cleared")); LOG((CLOG_DEBUG2 "dragging filename is cleared"));
} }
} }
else { else {
@ -1896,17 +1896,17 @@ CMSWindowsScreen::fakeDraggingFiles(CString str)
} }
CString& CString&
CMSWindowsScreen::getDraggingFileDir() CMSWindowsScreen::getDraggingFilename()
{ {
if (m_draggingStarted) { if (m_draggingStarted) {
// temporarily log out dragging file directory // temporarily log out dragging filename
char dir[MAX_PATH]; char dir[MAX_PATH];
m_hookLibraryLoader.m_getDraggingFileDir(dir); m_hookLibraryLoader.m_getDraggingFilename(dir);
m_draggingFileDir.clear(); m_draggingFilename.clear();
m_draggingFileDir.append(dir); m_draggingFilename.append(dir);
} }
return m_draggingFileDir; return m_draggingFilename;
} }
const CString& const CString&

View File

@ -116,7 +116,7 @@ public:
virtual void setSequenceNumber(UInt32); virtual void setSequenceNumber(UInt32);
virtual bool isPrimary() const; virtual bool isPrimary() const;
virtual void fakeDraggingFiles(CString str); virtual void fakeDraggingFiles(CString str);
virtual CString& getDraggingFileDir(); virtual CString& getDraggingFilename();
virtual const CString& virtual const CString&
getDropTarget() const; getDropTarget() const;

View File

@ -912,7 +912,7 @@ COSXScreen::leave()
hideCursor(); hideCursor();
if (getDraggingStarted()) { if (getDraggingStarted()) {
CString& fileList = getDraggingFileDir(); CString& fileList = getDraggingFilename();
size_t size = fileList.size(); size_t size = fileList.size();
if (!m_isPrimary) { if (!m_isPrimary) {
@ -1228,7 +1228,7 @@ COSXScreen::onMouseButton(bool pressed, UInt16 macButton)
MouseButtonState state = pressed ? kMouseButtonDown : kMouseButtonUp; MouseButtonState state = pressed ? kMouseButtonDown : kMouseButtonUp;
m_buttonState.set(kButtonLeft - 1, state); m_buttonState.set(kButtonLeft - 1, state);
if (pressed) { if (pressed) {
m_draggingFileDir.clear(); m_draggingFilename.clear();
LOG((CLOG_DEBUG2 "dragging file directory is cleared")); LOG((CLOG_DEBUG2 "dragging file directory is cleared"));
} }
else { else {
@ -2105,21 +2105,21 @@ COSXScreen::fakeDraggingFiles(CString str)
} }
CString& CString&
COSXScreen::getDraggingFileDir() COSXScreen::getDraggingFilename()
{ {
if (m_draggingStarted) { if (m_draggingStarted) {
CFStringRef dragInfo = getDraggedFileURL(); CFStringRef dragInfo = getDraggedFileURL();
char* info = NULL; char* info = NULL;
info = CFStringRefToUTF8String(dragInfo); info = CFStringRefToUTF8String(dragInfo);
if (info == NULL) { if (info == NULL) {
m_draggingFileDir.clear(); m_draggingFilename.clear();
} }
else { else {
LOG((CLOG_DEBUG "drag info: %s", info)); LOG((CLOG_DEBUG "drag info: %s", info));
CFRelease(dragInfo); CFRelease(dragInfo);
CString fileList(info); CString fileList(info);
m_draggingFileDir = fileList; m_draggingFilename = fileList;
} }
} }
return m_draggingFileDir; return m_draggingFilename;
} }

View File

@ -98,7 +98,7 @@ public:
virtual void setSequenceNumber(UInt32); virtual void setSequenceNumber(UInt32);
virtual bool isPrimary() const; virtual bool isPrimary() const;
virtual void fakeDraggingFiles(CString str); virtual void fakeDraggingFiles(CString str);
virtual CString& getDraggingFileDir(); virtual CString& getDraggingFilename();
const CString& getDropTarget() const { return m_dropTarget; } const CString& getDropTarget() const { return m_dropTarget; }

View File

@ -1669,7 +1669,7 @@ CServer::onMouseUp(ButtonID id)
} }
if (m_enableDragDrop && !m_screen->isOnScreen()) { if (m_enableDragDrop && !m_screen->isOnScreen()) {
CString& dir = m_screen->getDraggingFileDir(); CString& dir = m_screen->getDraggingFilename();
if (!dir.empty()) { if (!dir.empty()) {
LOG((CLOG_DEBUG "send file to client: %s", dir.c_str())); LOG((CLOG_DEBUG "send file to client: %s", dir.c_str()));
sendFileToClient(dir.c_str()); sendFileToClient(dir.c_str());
@ -1750,7 +1750,7 @@ CServer::onMouseMovePrimary(SInt32 x, SInt32 y)
// should we switch or not? // should we switch or not?
if (isSwitchOkay(newScreen, dir, x, y, xc, yc)) { if (isSwitchOkay(newScreen, dir, x, y, xc, yc)) {
if (m_enableDragDrop && m_screen->getDraggingStarted() && m_active != newScreen) { 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; size_t size = dragFileList.size() + 1;
char* fileList = NULL; char* fileList = NULL;
UInt32 fileCount = 1; UInt32 fileCount = 1;

View File

@ -80,7 +80,7 @@ public:
virtual void setDraggingStarted(bool started) { m_draggingStarted = started; } virtual void setDraggingStarted(bool started) { m_draggingStarted = started; }
virtual bool getDraggingStarted(); virtual bool getDraggingStarted();
virtual bool getFakeDraggingStarted() { return m_fakeDraggingStarted; } virtual bool getFakeDraggingStarted() { return m_fakeDraggingStarted; }
virtual CString& getDraggingFileDir() { return m_draggingFileDir; } virtual CString& getDraggingFilename() { return m_draggingFilename; }
// IPlatformScreen overrides // IPlatformScreen overrides
virtual void enable() = 0; virtual void enable() = 0;
@ -120,7 +120,7 @@ protected:
virtual void handleSystemEvent(const CEvent& event, void*) = 0; virtual void handleSystemEvent(const CEvent& event, void*) = 0;
protected: protected:
CString m_draggingFileDir; CString m_draggingFilename;
bool m_draggingStarted; bool m_draggingStarted;
bool m_fakeDraggingStarted; bool m_fakeDraggingStarted;
}; };

View File

@ -447,9 +447,9 @@ CScreen::setEnableDragDrop(bool enabled)
} }
CString& CString&
CScreen::getDraggingFileDir() const CScreen::getDraggingFilename() const
{ {
return m_screen->getDraggingFileDir(); return m_screen->getDraggingFilename();
} }
const CString& const CString&

View File

@ -284,7 +284,7 @@ public:
//! Get dragging file's directory. //! Get dragging file's directory.
CString& getDraggingFileDir() const; CString& getDraggingFilename() const;
//! Get drop target directory. //! Get drop target directory.

View File

@ -188,7 +188,7 @@ public:
virtual SInt32 pollActiveGroup() const = 0; virtual SInt32 pollActiveGroup() const = 0;
virtual void pollPressedKeys(KeyButtonSet& pressedKeys) const = 0; virtual void pollPressedKeys(KeyButtonSet& pressedKeys) const = 0;
virtual CString& getDraggingFileDir() = 0; virtual CString& getDraggingFilename() = 0;
virtual bool getDraggingStarted() = 0; virtual bool getDraggingStarted() = 0;
virtual bool getFakeDraggingStarted() = 0; virtual bool getFakeDraggingStarted() = 0;

View File

@ -21,7 +21,7 @@
extern LONG g_refCount; extern LONG g_refCount;
extern GUID g_CLSID; extern GUID g_CLSID;
extern void updateDraggingDir(char*); extern void updateDraggingFilename(char*);
extern void outputDebugStringF(const char *str, ...); extern void outputDebugStringF(const char *str, ...);
CDataHandlerExtension::CDataHandlerExtension() : CDataHandlerExtension::CDataHandlerExtension() :
@ -86,10 +86,10 @@ CDataHandlerExtension::Load(__RPC__in LPCOLESTR pszFileName, DWORD dwMode)
{ {
outputDebugStringF("synwinxt: > CDataHandlerExtension::Load\n"); outputDebugStringF("synwinxt: > CDataHandlerExtension::Load\n");
char selectedFileDir[MAX_PATH]; char selectedFilename[MAX_PATH];
StringCchCopyW(m_selectedFileDir, ARRAYSIZE(m_selectedFileDir), pszFileName); StringCchCopyW(m_selectedFilename, ARRAYSIZE(m_selectedFilename), pszFileName);
WideCharToMultiByte(CP_ACP, 0, m_selectedFileDir, -1, selectedFileDir, MAX_PATH, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, m_selectedFilename, -1, selectedFilename, MAX_PATH, NULL, NULL);
updateDraggingDir(selectedFileDir); updateDraggingFilename(selectedFilename);
outputDebugStringF("synwinxt: < CDataHandlerExtension::Load\n"); outputDebugStringF("synwinxt: < CDataHandlerExtension::Load\n");
return S_OK; return S_OK;

View File

@ -53,5 +53,5 @@ public:
private: private:
LONG m_refCount; LONG m_refCount;
WCHAR m_selectedFileDir[MAX_PATH]; WCHAR m_selectedFilename[MAX_PATH];
}; };

View File

@ -28,7 +28,7 @@
#pragma data_seg("sharedData") #pragma data_seg("sharedData")
#endif #endif
static BYTE g_draggingFileDir[MAX_PATH] = { 0 }; static BYTE g_draggingFilename[MAX_PATH] = { 0 };
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma data_seg() #pragma data_seg()
@ -282,17 +282,17 @@ unregisterShellExtDataHandler(CHAR* fileType, const CLSID& clsid)
} }
void void
updateDraggingDir(char* dir) updateDraggingFilename(char* filename)
{ {
outputDebugStringF("synwinxt: > updateDraggingDir, dir=%s\n", dir); outputDebugStringF("synwinxt: > updateDraggingFilename, filename=%s\n", filename);
memcpy(g_draggingFileDir, dir, MAX_PATH); memcpy(g_draggingFilename, filename, MAX_PATH);
outputDebugStringF("synwinxt: < updateDraggingDir, g_draggingFileDir=%s\n", g_draggingFileDir); outputDebugStringF("synwinxt: < updateDraggingFilename, g_draggingFilename=%s\n", g_draggingFilename);
} }
void void
getDraggingFileDir(char* dir) getDraggingFilename(char* filename)
{ {
outputDebugStringF("synwinxt: > getDraggingFileDir\n"); outputDebugStringF("synwinxt: > getDraggingFilename\n");
memcpy(dir, g_draggingFileDir, MAX_PATH); memcpy(filename, g_draggingFilename, MAX_PATH);
outputDebugStringF("synwinxt: < getDraggingFileDir, dir=%s\n", dir); outputDebugStringF("synwinxt: < getDraggingFilename, filename=%s\n", filename);
} }

View File

@ -4,4 +4,4 @@ EXPORTS
DllCanUnloadNow PRIVATE DllCanUnloadNow PRIVATE
DllRegisterServer PRIVATE DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE DllUnregisterServer PRIVATE
getDraggingFileDir getDraggingFilename

View File

@ -25,6 +25,6 @@
#define CSYNERGYSHELLEXE_API __declspec(dllimport) #define CSYNERGYSHELLEXE_API __declspec(dllimport)
#endif #endif
typedef void (*GetDraggingFileDir)(CHAR*); typedef void (*GetDraggingFilename)(CHAR*);
CSYNERGYSHELLEXE_API void getDraggingFileDir(char*); CSYNERGYSHELLEXE_API void getDraggingFilename(char*);