# HG changeset patch # User Chris Cannam # Date 1290247860 0 # Node ID d575a8f76a53fc5cf2af32907467fdb920fc5c8c # Parent 295e3ee4a2576e45f6c9edb2a4b1ed04034dfeb2 * Win32 build fixes diff -r 295e3ee4a257 -r d575a8f76a53 common.cpp --- a/common.cpp Fri Nov 19 18:39:40 2010 +0000 +++ b/common.cpp Sat Nov 20 10:11:00 2010 +0000 @@ -23,7 +23,14 @@ #include #include + +#ifdef Q_OS_WIN32 +#define _WIN32_WINNT 0x0500 +#include +#include +#else #include +#endif QString findExecutable(QString name) { @@ -90,15 +97,20 @@ #ifdef Q_OS_WIN32 QString getUserRealName() { - const int maxlen = 1023; - TCHAR buf[maxlen + 2]; + TCHAR buf[1024]; + long unsigned int maxlen = 1000; LPTSTR info = buf; - if (!GetUserNameEx(NameDisplay, info, maxlen)) { + if (!GetUserNameEx(NameDisplay, info, &maxlen)) { + DEBUG << "GetUserNameEx failed: " << GetLastError() << endl; return ""; } - return QString::fromUcs2(info); +#ifdef UNICODE + return QString::fromUtf16((const unsigned short *)info); +#else + return QString::fromLocal8Bit(info); +#endif } #else #ifdef Q_OS_MAC diff -r 295e3ee4a257 -r d575a8f76a53 easyhg.pro --- a/easyhg.pro Fri Nov 19 18:39:40 2010 +0000 +++ b/easyhg.pro Sat Nov 20 10:11:00 2010 +0000 @@ -61,7 +61,13 @@ LIBS += -framework Foundation } -LIBS += -lutil +linux* { + LIBS += -lutil +} + +win* { + LIBS += -lSecur32 +} # ! [0] RESOURCES = easyhg.qrc diff -r 295e3ee4a257 -r d575a8f76a53 easyhg.rc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/easyhg.rc Sat Nov 20 10:11:00 2010 +0000 @@ -0,0 +1,1 @@ +IDI_ICON1 ICON DISCARDABLE "hgexplorer.ico" diff -r 295e3ee4a257 -r d575a8f76a53 hgexplorer.rc --- a/hgexplorer.rc Fri Nov 19 18:39:40 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "hgexplorer.ico" diff -r 295e3ee4a257 -r d575a8f76a53 hgrunner.cpp --- a/hgrunner.cpp Fri Nov 19 18:39:40 2010 +0000 +++ b/hgrunner.cpp Sat Nov 20 10:11:00 2010 +0000 @@ -29,10 +29,13 @@ #include #include -#include #include #include +#ifndef Q_OS_WIN32 +#include +#endif + HgRunner::HgRunner(QWidget * parent): QProgressBar(parent) { proc = new QProcess(this); @@ -50,6 +53,7 @@ stdErr.clear(); procInput = 0; +#ifndef Q_OS_WIN32 char name[1024]; if (openpty(&ptyMasterFd, &ptySlaveFd, name, NULL, NULL)) { perror("openpty failed"); @@ -62,7 +66,7 @@ proc->setStandardInputFile(ptySlaveFilename); ::close(ptySlaveFd); } - +#endif connect(proc, SIGNAL(started()), this, SLOT(started())); connect(proc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(finished(int, QProcess::ExitStatus))); diff -r 295e3ee4a257 -r d575a8f76a53 mainwindow.cpp --- a/mainwindow.cpp Fri Nov 19 18:39:40 2010 +0000 +++ b/mainwindow.cpp Sat Nov 20 10:11:00 2010 +0000 @@ -1021,9 +1021,9 @@ { case ACT_PATHS: { - QString stdout = runner->getStdOut(); - DEBUG << "stdout is " << stdout << endl; - LogParser lp(stdout, "="); + QString sout = runner->getStdOut(); + DEBUG << "stdout is " << sout << endl; + LogParser lp(sout, "="); LogList ll = lp.parse(); DEBUG << ll.size() << " results" << endl; if (!ll.empty()) {