~ubuntu-branches/ubuntu/raring/mumble/raring

« back to all changes in this revision

Viewing changes to src/mumble/os_win.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Thorvald Natvig
  • Date: 2010-01-09 19:28:50 UTC
  • mfrom: (9.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100109192850-zs4g5vwrrpd71kob
Tags: 1.2.1-2
Fix upgrade failure when upgrading mumble-server directly from 1.1.x
to 1.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2005-2009, Thorvald Natvig <thorvald@natvig.com>
 
1
/* Copyright (C) 2005-2010, Thorvald Natvig <thorvald@natvig.com>
2
2
 
3
3
   All rights reserved.
4
4
 
162
162
        mumble_speex_init();
163
163
 
164
164
#ifdef QT_NO_DEBUG
 
165
#ifdef COMPAT_CLIENT
 
166
        errno_t res = 0;
 
167
        size_t reqSize, bSize;
 
168
        _wgetenv_s(&reqSize, NULL, 0, L"APPDATA");
 
169
        if (reqSize > 0) {
 
170
                reqSize += strlen("/Mumble/Console11x.txt");
 
171
                bSize = reqSize;
 
172
 
 
173
                STACKVAR(wchar_t, buff, reqSize+1);
 
174
 
 
175
                _wgetenv_s(&reqSize, buff, bSize, L"APPDATA");
 
176
                wcscat_s(buff, bSize, L"/Mumble/Console11x.txt");
 
177
                res = _wfopen_s(&fConsole, buff, L"a+");
 
178
        }
 
179
        if ((res != 0) || (! fConsole)) {
 
180
                res=_wfopen_s(&fConsole, L"Console11x.txt", L"a+");
 
181
        }
 
182
#else
165
183
        QString console = g.qdBasePath.filePath(QLatin1String("Console.txt"));
166
184
        errno_t res = _wfopen_s(&fConsole, console.utf16(), L"a+");
 
185
#endif
167
186
 
168
187
        if ((res == 0) && fConsole)
169
188
                qInstallMsgHandler(mumbleMessageOutput);
188
207
        musComment.Buffer = wcComment;
189
208
        musComment.BufferSize = wcslen(wcComment) * sizeof(wchar_t);
190
209
 
 
210
#ifdef COMPAT_CLIENT
 
211
        QString dump = QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QLatin1String("\\mumble11x.dmp");
 
212
#else
191
213
        QString dump = g.qdBasePath.filePath(QLatin1String("mumble.dmp"));
 
214
#endif
 
215
 
 
216
        QFileInfo fi(dump);
 
217
        QDir::root().mkpath(fi.absolutePath());
 
218
 
192
219
        if (wcscpy_s(wcCrashDumpPath, PATH_MAX, dump.utf16()) == 0)
193
220
                SetUnhandledExceptionFilter(MumbleUnhandledExceptionFilter);
194
221