Code: Alles auswählen
1113 QFileSystemEntry QFileSystemEngine::currentPath()
1114 {
1115 QString ret;
1116 #if !defined(Q_OS_WINCE)
1117 DWORD size = 0;
1118 wchar_t currentName[PATH_MAX];
1119 size = ::GetCurrentDirectory(PATH_MAX, currentName);
1120 if (size != 0) {
1121 if (size > PATH_MAX) {
1122 wchar_t *newCurrentName = new wchar_t[size];
1123 if (::GetCurrentDirectory(PATH_MAX, newCurrentName) != 0)
1124 ret = QString::fromWCharArray(newCurrentName, size);
1125 delete [] newCurrentName;
1126 } else {
1127 ret = QString::fromWCharArray(currentName, size);
1128 }
1129 }
1130 if (ret.length() >= 2 && ret[1] == QLatin1Char(':'))
1131 ret[0] = ret.at(0).toUpper(); // Force uppercase drive letters.
1132 #else
1133 //TODO - a race condition exists when using currentPath / setCurrentPath from multiple threads
1134 if (qfsPrivateCurrentDir.isEmpty())
1135 qfsPrivateCurrentDir = QCoreApplication::applicationDirPath();
1136
1137 ret = qfsPrivateCurrentDir;
1138 #endif
1139 return QFileSystemEntry(ret, QFileSystemEntry::FromNativePath());
1140 }Bevor ich einen Bugreport im Qt-Bugtracker aufmache, wie seht ihr das?