- checked filename's validation before sending drag info

- refactored duplicated write to drop dir code
- removed legacy member variables
- fixed code style
- fixed typo
This commit is contained in:
jerry
2014-05-14 14:45:15 +00:00
parent 935ca0b2f2
commit f87bd9e860
11 changed files with 113 additions and 71 deletions

View File

@@ -1873,7 +1873,12 @@ CMSWindowsScreen::getDraggingFilename()
ShowWindow(m_dropWindow, SW_HIDE);
if (!filename.empty()) {
m_draggingFilename = filename;
if (CDragInformation::isFileValid(filename)) {
m_draggingFilename = filename;
}
else {
LOG((CLOG_DEBUG "drag file name is invalid: %s", filename.c_str()));
}
}
if (m_draggingFilename.empty()) {

View File

@@ -82,7 +82,7 @@ fakeDragging(const char* str, int cursorX, int cursorY)
[g_dragWindow setFrame:rect display:NO];
[g_dragWindow makeKeyAndOrderFront:nil];
[NSApp activateIgnoringOtherApps:YES];
[NSApp activateIgnoringOtherApps:YES];
[g_dragView setFileExt:g_ext];

View File

@@ -911,12 +911,6 @@ COSXScreen::leave()
CString& fileList = getDraggingFilename();
if (!m_isPrimary) {
// TODO: is this duplicated?
// fake esc key down and up
fakeKeyDown(kKeyEscape, 8192, 1);
fakeKeyUp(1);
fakeMouseButton(kButtonLeft, false);
if (fileList.empty() == false) {
CClientApp& app = CClientApp::instance();
CClient* client = app.getClientPtr();