Updated for building with the latest version of the Exception class which
does not include two-argument constructor any more.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@338 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/rfbplayer/FbsInputStream.cxx b/rfbplayer/FbsInputStream.cxx
index a173beb..539a0b5 100644
--- a/rfbplayer/FbsInputStream.cxx
+++ b/rfbplayer/FbsInputStream.cxx
@@ -43,7 +43,7 @@
char *msg = new char[12 + sizeof(FileName)];
strcpy(msg, "Can't open ");
strcat(msg, FileName);
- throw rfb::Exception(msg,"RfbPlayer Error");
+ throw rfb::Exception(msg);
}
byte b[12];
@@ -53,7 +53,7 @@
b[4] != '0' || b[5] != '0' || b[6] != '1' || b[7] != '.' ||
b[8] < '0' || b[8] > '9' || b[9] < '0' || b[9] > '9' ||
b[10] < '0' || b[10] > '9' || b[11] != '\n') {
- throw rfb::Exception("Incorrect protocol version", "RfbPlayer Error");
+ throw rfb::Exception("Incorrect protocol version");
}
}
@@ -98,7 +98,7 @@
// Perform backwardSeek (throws the special exception)
if (seekBackwards) {
- throw rfb::Exception("[REWIND]", "RfbPlayer");
+ throw rfb::Exception("[REWIND]");
}
// Save a tail of data
@@ -179,9 +179,9 @@
int count = fread(b, 1, n - off, fbsFile);
if (count < n) {
if (ferror(fbsFile))
- throw rfb::Exception("Read error from session file", "RfbPlayer Error");
+ throw rfb::Exception("Read error from session file");
if (feof(fbsFile))
- throw rfb::Exception("[End Of File]", "RfbPlayer Error");
+ throw rfb::Exception("[End Of File]");
}
off += count;
}
diff --git a/rfbplayer/PlayerOptions.cxx b/rfbplayer/PlayerOptions.cxx
index 4494e26..5384c6e 100644
--- a/rfbplayer/PlayerOptions.cxx
+++ b/rfbplayer/PlayerOptions.cxx
@@ -45,7 +45,7 @@
askPixelFormat = regKey.getBool(_T("AskPixelFormat"), DEFAULT_ASK_PF);
if (pPF) delete pPF;
} catch (rdr::Exception e) {
- MessageBox(0, e.str(), e.type(), MB_OK | MB_ICONERROR);
+ MessageBox(0, e.str(), "RFB Player", MB_OK | MB_ICONERROR);
}
}
@@ -63,7 +63,7 @@
regKey.setBool(_T("AutoPlay"), autoPlay);
regKey.setBool(_T("AskPixelFormat"), askPixelFormat);
} catch (rdr::Exception e) {
- MessageBox(0, e.str(), e.type(), MB_OK | MB_ICONERROR);
+ MessageBox(0, e.str(), "RFB Player", MB_OK | MB_ICONERROR);
}
}
diff --git a/rfbplayer/RfbProto.cxx b/rfbplayer/RfbProto.cxx
index add2096..5a7ff7f 100644
--- a/rfbplayer/RfbProto.cxx
+++ b/rfbplayer/RfbProto.cxx
@@ -89,7 +89,7 @@
bool done;
if (!cp.readVersion(is, &done)) {
state_ = RFBSTATE_INVALID;
- throw rfb::Exception("reading version failed: wrong file format?", "RfbPlayer");
+ throw rfb::Exception("reading version failed: wrong file format?");
}
if (!done) return;
@@ -99,7 +99,7 @@
sprintf(msg,"File have unsupported RFB protocol version %d.%d",
cp.majorVersion, cp.minorVersion);
state_ = RFBSTATE_INVALID;
- throw rfb::Exception(msg, "RfbPlayer Error");
+ throw rfb::Exception(msg);
}
state_ = RFBSTATE_SECURITY;
@@ -120,12 +120,11 @@
int reasonLen = is->readU32();
char *reason = new char[reasonLen];
is->readBytes(reason, reasonLen);
- throw rfb::Exception(reason, "RfbPlayer");
+ throw rfb::Exception(reason);
}
if (secType != secTypeNone) {
- throw rfb::Exception("Wrong authentication type in the session file",
- "RfbPlayer Error");
+ throw rfb::Exception("Wrong authentication type in the session file");
}
state_ = RFBSTATE_INITIALISATION;
diff --git a/rfbplayer/rfbSessionReader.h b/rfbplayer/rfbSessionReader.h
index 115b1d3..31985bc 100644
--- a/rfbplayer/rfbSessionReader.h
+++ b/rfbplayer/rfbSessionReader.h
@@ -47,7 +47,7 @@
try {
rfbSession->processMsg();
} catch (rdr::Exception e) {
- MessageBox(0, e.str(), e.type(), MB_OK | MB_ICONERROR);
+ MessageBox(0, e.str(), "RFB Player", MB_OK | MB_ICONERROR);
break;
}
}
diff --git a/rfbplayer/rfbplayer.cxx b/rfbplayer/rfbplayer.cxx
index bd8fa07..0a92802 100644
--- a/rfbplayer/rfbplayer.cxx
+++ b/rfbplayer/rfbplayer.cxx
@@ -756,7 +756,7 @@
char message[256] = "\0";
strcat(message, e.str());
strcat(message, "\nMaybe you force wrong the pixel format for this session");
- MessageBox(getMainHandle(), message, e.type(), MB_OK | MB_ICONERROR);
+ MessageBox(getMainHandle(), message, "RFB Player", MB_OK | MB_ICONERROR);
sessionTerminateThread *terminate = new sessionTerminateThread(this);
terminate->start();
return;
@@ -835,7 +835,7 @@
void RfbPlayer::setColourMapEntries(int first, int count, U16* rgbs) {
vlog.debug("setColourMapEntries: first=%d, count=%d", first, count);
- throw rdr::Exception("Can't handle SetColourMapEntries message", "RfbPlayer");
+ throw rdr::Exception("Can't handle SetColourMapEntries message");
/* int i;
for (i=0;i<count;i++) {
buffer->setColour(i+first, rgbs[i*3], rgbs[i*3+1], rgbs[i*3+2]);
@@ -913,7 +913,7 @@
if (strcmp(e.str(), "[End Of File]") == 0) {
return sessionFile.getTimeOffset();
} else {
- MessageBox(getMainHandle(), e.str(), e.type(), MB_OK | MB_ICONERROR);
+ MessageBox(getMainHandle(), e.str(), "RFB Player", MB_OK | MB_ICONERROR);
return 0;
}
}
@@ -1262,7 +1262,7 @@
try {
player = new RfbPlayer(fileName, &playerOptions);
} catch (rdr::Exception e) {
- MessageBox(NULL, e.str(), e.type(), MB_OK | MB_ICONERROR);
+ MessageBox(NULL, e.str(), "RFB Player", MB_OK | MB_ICONERROR);
delete player;
return 0;
}
@@ -1281,7 +1281,7 @@
try{
if (player) delete player;
} catch (rdr::Exception e) {
- MessageBox(NULL, e.str(), e.type(), MB_OK | MB_ICONERROR);
+ MessageBox(NULL, e.str(), "RFB Player", MB_OK | MB_ICONERROR);
}
return 0;