summaryrefslogtreecommitdiffstats
path: root/src/qt3support/other
diff options
context:
space:
mode:
authorminiak <milan.burda@gmail.com>2009-07-01 09:50:10 (GMT)
committerMarius Storm-Olsen <marius@trolltech.com>2009-07-01 09:51:19 (GMT)
commit8a7fb1881afe6b358a35cec71247d7e6681efe0a (patch)
treed290ba7a2bb25d98ed2826e0002bd1e3eebdb356 /src/qt3support/other
parent22ab94871c4a924e37eca720a1620da2e1a7259d (diff)
downloadQt-8a7fb1881afe6b358a35cec71247d7e6681efe0a.zip
Qt-8a7fb1881afe6b358a35cec71247d7e6681efe0a.tar.gz
Qt-8a7fb1881afe6b358a35cec71247d7e6681efe0a.tar.bz2
src/qt3support: Remove QT_WA and non-Unicode code paths, dropping Win9x and NT support
Merge-request: 604 Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
Diffstat (limited to 'src/qt3support/other')
-rw-r--r--src/qt3support/other/q3dragobject.cpp7
-rw-r--r--src/qt3support/other/q3process_win.cpp152
2 files changed, 53 insertions, 106 deletions
diff --git a/src/qt3support/other/q3dragobject.cpp b/src/qt3support/other/q3dragobject.cpp
index 0c17e0c..93a6079 100644
--- a/src/qt3support/other/q3dragobject.cpp
+++ b/src/qt3support/other/q3dragobject.cpp
@@ -191,8 +191,7 @@ Q3DragObject::~Q3DragObject()
Set the pixmap, \a pm, to display while dragging the object. The
platform-specific implementation will use this where it can - so
provide a small masked pixmap, and do not assume that the user
- will actually see it. For example, cursors on Windows 95 are of
- limited size.
+ will actually see it.
The \a hotspot is the point on (or off) the pixmap that should be
under the cursor as it is dragged. It is relative to the top-left
@@ -553,10 +552,6 @@ QTextCodec* qt_findcharset(const QByteArray& mimetype)
i = cs.indexOf(';');
if (i >= 0)
cs = cs.left(i);
- // win98 often has charset=utf16, and we need to get the correct codec for
- // it to be able to get Unicode text drops.
- if (cs == "utf16")
- cs = "ISO-10646-UCS-2";
// May return 0 if unknown charset
return QTextCodec::codecForName(cs);
}
diff --git a/src/qt3support/other/q3process_win.cpp b/src/qt3support/other/q3process_win.cpp
index 352e497..0952663 100644
--- a/src/qt3support/other/q3process_win.cpp
+++ b/src/qt3support/other/q3process_win.cpp
@@ -308,108 +308,60 @@ bool Q3Process::start( QStringList *env )
// CreateProcess()
bool success;
d->newPid();
-#ifdef UNICODE
- if (!(QSysInfo::WindowsVersion & QSysInfo::WV_DOS_based)) {
- STARTUPINFOW startupInfo = {
- sizeof( STARTUPINFO ), 0, 0, 0,
- (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT,
- 0, 0, 0,
- STARTF_USESTDHANDLES,
- 0, 0, 0,
- d->pipeStdin[0], d->pipeStdout[1], d->pipeStderr[1]
- };
- TCHAR *applicationName;
- if ( appName.isNull() )
- applicationName = 0;
- else
- applicationName = _wcsdup( (TCHAR*)appName.ucs2() );
- TCHAR *commandLine = _wcsdup( (TCHAR*)args.ucs2() );
- QByteArray envlist;
- if ( env != 0 ) {
- int pos = 0;
- // add PATH if necessary (for DLL loading)
- QByteArray path = qgetenv( "PATH" );
- if ( env->grep( QRegExp(QLatin1String("^PATH="),FALSE) ).empty() && !path.isNull() ) {
- QString tmp = QString::fromLatin1("PATH=%1").arg(QLatin1String(path.constData()));
- uint tmpSize = sizeof(TCHAR) * (tmp.length()+1);
- envlist.resize( envlist.size() + tmpSize );
- memcpy( envlist.data()+pos, tmp.ucs2(), tmpSize );
- pos += tmpSize;
- }
- // add the user environment
- for ( QStringList::Iterator it = env->begin(); it != env->end(); it++ ) {
- QString tmp = *it;
- uint tmpSize = sizeof(TCHAR) * (tmp.length()+1);
- envlist.resize( envlist.size() + tmpSize );
- memcpy( envlist.data()+pos, tmp.ucs2(), tmpSize );
- pos += tmpSize;
- }
- // add the 2 terminating 0 (actually 4, just to be on the safe side)
- envlist.resize( envlist.size()+4 );
- envlist[pos++] = 0;
- envlist[pos++] = 0;
- envlist[pos++] = 0;
- envlist[pos++] = 0;
- }
- success = CreateProcessW( applicationName, commandLine,
- 0, 0, TRUE, ( comms==0 ? CREATE_NEW_CONSOLE : CREATE_NO_WINDOW )
+
+ STARTUPINFOW startupInfo = {
+ sizeof( STARTUPINFO ), 0, 0, 0,
+ (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT,
+ 0, 0, 0,
+ STARTF_USESTDHANDLES,
+ 0, 0, 0,
+ d->pipeStdin[0], d->pipeStdout[1], d->pipeStderr[1]
+ };
+ wchar_t *applicationName;
+ if ( appName.isNull() )
+ applicationName = 0;
+ else
+ applicationName = _wcsdup( (wchar_t*)appName.utf16() );
+ wchar_t *commandLine = _wcsdup( (wchar_t*)args.utf16() );
+ QByteArray envlist;
+ if ( env != 0 ) {
+ int pos = 0;
+ // add PATH if necessary (for DLL loading)
+ QByteArray path = qgetenv( "PATH" );
+ if ( env->grep( QRegExp(QLatin1String("^PATH="),FALSE) ).empty() && !path.isNull() ) {
+ QString tmp = QString::fromLatin1("PATH=%1").arg(QLatin1String(path.constData()));
+ uint tmpSize = sizeof(wchar_t) * (tmp.length() + 1);
+ envlist.resize( envlist.size() + tmpSize );
+ memcpy( envlist.data() + pos, tmp.utf16(), tmpSize );
+ pos += tmpSize;
+ }
+ // add the user environment
+ for ( QStringList::Iterator it = env->begin(); it != env->end(); it++ ) {
+ QString tmp = *it;
+ uint tmpSize = sizeof(wchar_t) * (tmp.length() + 1);
+ envlist.resize( envlist.size() + tmpSize );
+ memcpy( envlist.data() + pos, tmp.utf16(), tmpSize );
+ pos += tmpSize;
+ }
+ // add the 2 terminating 0 (actually 4, just to be on the safe side)
+ envlist.resize( envlist.size()+4 );
+ envlist[pos++] = 0;
+ envlist[pos++] = 0;
+ envlist[pos++] = 0;
+ envlist[pos++] = 0;
+ }
+ success = CreateProcess( applicationName, commandLine,
+ 0, 0, TRUE, ( comms == 0 ? CREATE_NEW_CONSOLE : CREATE_NO_WINDOW )
#ifndef Q_OS_WINCE
- | CREATE_UNICODE_ENVIRONMENT
+ | CREATE_UNICODE_ENVIRONMENT
#endif
- , env==0 ? 0 : envlist.data(),
- (TCHAR*)QDir::toNativeSeparators(workingDir.absPath()).ucs2(),
- &startupInfo, d->pid );
- free( applicationName );
- free( commandLine );
- } else
-#endif // UNICODE
- {
-#ifndef Q_OS_WINCE
- STARTUPINFOA startupInfo = { sizeof( STARTUPINFOA ), 0, 0, 0,
- (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT,
- 0, 0, 0,
- STARTF_USESTDHANDLES,
- 0, 0, 0,
- d->pipeStdin[0], d->pipeStdout[1], d->pipeStderr[1]
- };
- QByteArray envlist;
- if ( env != 0 ) {
- int pos = 0;
- // add PATH if necessary (for DLL loading)
- QByteArray path = qgetenv( "PATH" );
- if ( env->grep( QRegExp(QLatin1String("^PATH="),FALSE) ).empty() && !path.isNull() ) {
- Q3CString tmp = QString::fromLatin1("PATH=%1").arg(QString::fromLatin1(path.constData())).local8Bit();
- uint tmpSize = tmp.length() + 1;
- envlist.resize( envlist.size() + tmpSize );
- memcpy( envlist.data()+pos, tmp.data(), tmpSize );
- pos += tmpSize;
- }
- // add the user environment
- for ( QStringList::Iterator it = env->begin(); it != env->end(); it++ ) {
- Q3CString tmp = (*it).local8Bit();
- uint tmpSize = tmp.length() + 1;
- envlist.resize( envlist.size() + tmpSize );
- memcpy( envlist.data()+pos, tmp.data(), tmpSize );
- pos += tmpSize;
- }
- // add the terminating 0 (actually 2, just to be on the safe side)
- envlist.resize( envlist.size()+2 );
- envlist[pos++] = 0;
- envlist[pos++] = 0;
- }
- char *applicationName;
- if ( appName.isNull() )
- applicationName = 0;
- else
- applicationName = const_cast<char *>(appName.toLocal8Bit().data());
- success = CreateProcessA( applicationName,
- const_cast<char *>(args.toLocal8Bit().data()),
- 0, 0, TRUE, comms==0 ? CREATE_NEW_CONSOLE : DETACHED_PROCESS,
- env==0 ? 0 : envlist.data(),
- (const char*)QDir::toNativeSeparators(workingDir.absPath()).local8Bit(),
- &startupInfo, d->pid );
-#endif // Q_OS_WINCE
- }
+ , env == 0 ? 0 : envlist.data(),
+ (wchar_t*)QDir::toNativeSeparators(workingDir.absPath()).utf16(),
+ &startupInfo, d->pid );
+
+ free( applicationName );
+ free( commandLine );
+
if ( !success ) {
d->deletePid();
return false;