diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:05:30 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:05:30 +0200 |
commit | c0fce877c478ddbf71a1b651c789e5ea00a00144 (patch) | |
tree | de01b0ae8fd296bd24fbca54a80f2f0ba071d461 /shared/dragAndDrop.cpp | |
parent | 3.3 (diff) | |
download | FreeFileSync-c0fce877c478ddbf71a1b651c789e5ea00a00144.tar.gz FreeFileSync-c0fce877c478ddbf71a1b651c789e5ea00a00144.tar.bz2 FreeFileSync-c0fce877c478ddbf71a1b651c789e5ea00a00144.zip |
3.4
Diffstat (limited to 'shared/dragAndDrop.cpp')
-rw-r--r-- | shared/dragAndDrop.cpp | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/shared/dragAndDrop.cpp b/shared/dragAndDrop.cpp index 89f4da4d..581aac96 100644 --- a/shared/dragAndDrop.cpp +++ b/shared/dragAndDrop.cpp @@ -1,3 +1,9 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// #include "dragAndDrop.h" #include <wx/dnd.h> #include <wx/window.h> @@ -5,7 +11,8 @@ #include <wx/textctrl.h> #include <wx/filepicker.h> #include <wx/filename.h> - +#include "fileHandling.h" +#include "stringConv.h" //define new event type const wxEventType FFS_DROP_FILE_EVENT = wxNewEventType(); @@ -115,24 +122,14 @@ void DragDropOnMainDlg::OnFilesDropped(FFSFileDropEvent& event) } else //should never be reached event.Skip(); -}; - - -wxString formatDirectory(const wxString& dirname) -{ - wxString dirnameTmp = dirname; - dirnameTmp.Trim(true); //remove whitespace characters from right - dirnameTmp.Trim(false); //remove whitespace characters from left - - return dirnameTmp; } void DragDropOnMainDlg::OnWriteDirManually(wxCommandEvent& event) { - const wxString newDir = formatDirectory(event.GetString()); - if (wxDirExists(newDir)) - dirPicker_->SetPath(newDir); + const Zstring newDir = getFormattedDirectoryName(wxToZ(event.GetString())); + if (dirExists(newDir)) + dirPicker_->SetPath(zToWx(newDir)); event.Skip(); } @@ -193,14 +190,14 @@ void DragDropOnDlg::OnFilesDropped(FFSFileDropEvent& event) } else //should never be reached event.Skip(); -}; +} void DragDropOnDlg::OnWriteDirManually(wxCommandEvent& event) { - const wxString newDir = formatDirectory(event.GetString()); - if (wxDirExists(newDir)) - dirPicker_->SetPath(newDir); + const Zstring newDir = FreeFileSync::getFormattedDirectoryName(wxToZ(event.GetString())); + if (dirExists(newDir)) + dirPicker_->SetPath(zToWx(newDir)); event.Skip(); } |