changeset 713:56a36f633431

Differ between UNICODE and none UNICODE variant if trying the get the short notation windows path name. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@984 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Mon, 27 Jul 2009 14:40:13 +0000
parents afe3d40fbc5c
children 3363b7bb0d41
files src/IndentHandler.cpp
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/IndentHandler.cpp	Thu Jul 16 11:59:57 2009 +0000
+++ b/src/IndentHandler.cpp	Mon Jul 27 14:40:13 2009 +0000
@@ -457,9 +457,15 @@
     // If the short path could be retrieved, create a correct sized buffer, store the
     // short path in it and convert all back to QString.
     if ( length != 0 ) {
+#ifdef UNICODE
         buffer = new WCHAR[length];
         length = GetShortPathName((LPCTSTR)tempDirctoryWindowsStr, buffer, length);
         tempDirctoryStrHelper = QString::fromWCharArray( buffer );
+#else
+        buffer = new TCHAR[length];
+        length = GetShortPathName((LPCTSTR)tempDirctoryWindowsStr, buffer, length);
+        tempDirctoryStrHelper = buffer;
+#endif
         tempDirctoryStr = QDir::fromNativeSeparators(tempDirctoryStrHelper).replace("//", "/");
         delete buffer;