Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
sinpowei@gmail.com committed Nov 30, 2011
1 parent 4e2b15c commit 17eb411
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 38 deletions.
3 changes: 3 additions & 0 deletions build/win32/vs2010/sokit.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@
<Outputs Condition="'$(Configuration)|$(Platform)'=='release|Win32'">.\..\..\..\tmp\ui_%(Filename).h;%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='release|Win32'">"$(QTDIR)\bin\uic.exe" -o ".\..\..\..\tmp\ui_%(Filename).h" "%(FullPath)"</Command>
</CustomBuild>
<None Include="..\..\..\doc\sokit\change.log" />
<None Include="..\..\..\doc\sokit\license.gpl3" />
<None Include="..\..\..\doc\sokit\readme.txt" />
<None Include="..\..\..\src\sokit\sokit.ico" />
<None Include="..\..\..\src\sokit\sokit.png">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">true</ExcludedFromBuild>
Expand Down
12 changes: 12 additions & 0 deletions build/win32/vs2010/sokit.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<Extensions>cpp;moc</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="doc">
<UniqueIdentifier>{de80990b-4b4f-4245-b787-dc984296caaa}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\sokit\baseform.cpp">
Expand Down Expand Up @@ -227,6 +230,15 @@
<None Include="..\..\..\src\sokit\sokit.ts">
<Filter>resource</Filter>
</None>
<None Include="..\..\..\doc\sokit\change.log">
<Filter>doc</Filter>
</None>
<None Include="..\..\..\doc\sokit\license.gpl3">
<Filter>doc</Filter>
</None>
<None Include="..\..\..\doc\sokit\readme.txt">
<Filter>doc</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\src\sokit\sokit.rc">
Expand Down
20 changes: 10 additions & 10 deletions src/sokit/baseform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,22 @@ void BaseForm::select()
}
}

void BaseForm::countRecv(quint32 bytes)
void BaseForm::countRecv(qint32 bytes)
{
if (bytes > 0)
m_cntRecv += bytes;
else
if (bytes < 0)
m_cntRecv = 0;
else
m_cntRecv += bytes;

m_labRecv->setText(QString::number(m_cntRecv));
}

void BaseForm::countSend(quint32 bytes)
void BaseForm::countSend(qint32 bytes)
{
if (bytes > 0)
m_cntSend += bytes;
else
if (bytes < 0)
m_cntSend = 0;
else
m_cntSend += bytes;

m_labSend->setText(QString::number(m_cntSend));
}
Expand All @@ -181,8 +181,8 @@ void BaseForm::clear()
m_logger.clear();

lock();
countRecv(0);
countSend(0);
countRecv(-1);
countSend(-1);
unlock();
}

Expand Down
4 changes: 2 additions & 2 deletions src/sokit/baseform.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ protected slots:
void select();
void hotOutput();

void countRecv(quint32 bytes);
void countSend(quint32 bytes);
void countRecv(qint32 bytes);
void countSend(qint32 bytes);

void listerAdd(const QString& caption);
void listerRemove(const QString& caption);
Expand Down
4 changes: 2 additions & 2 deletions src/sokit/clientform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ bool ClientForm::plug(bool istcp)
connect(m_client, SIGNAL(unpluged()), this, SLOT(unpluged()));
connect(m_client, SIGNAL(message(const QString&)), this, SIGNAL(output(const QString&)));
connect(m_client, SIGNAL(dumpbin(const QString&,const char*,quint32)), this, SIGNAL(output(const QString&,const char*,quint32)));
connect(m_client, SIGNAL(countRecv(quint32)), this, SLOT(countRecv(quint32)));
connect(m_client, SIGNAL(countSend(quint32)), this, SLOT(countSend(quint32)));
connect(m_client, SIGNAL(countRecv(qint32)), this, SLOT(countRecv(qint32)));
connect(m_client, SIGNAL(countSend(qint32)), this, SLOT(countSend(qint32)));

skt = m_client;
}
Expand Down
6 changes: 3 additions & 3 deletions src/sokit/clientskt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ void ClientSkt::setError(const QString& err)

void ClientSkt::recordRecv(qint32 bytes)
{
emit countRecv((quint32)bytes);
emit countRecv(bytes);
}

void ClientSkt::recordSend(qint32 bytes)
{
emit countSend((quint32)bytes);
emit countSend(bytes);
}

void ClientSkt::send(const QString& data)
Expand All @@ -61,7 +61,7 @@ void ClientSkt::send(const QString& data)

void ClientSkt::dump(const char* buf, qint32 len, bool isSend)
{
emit dumpbin(QString("DAT %1").arg(isSend?"<<<<":">>>>"), buf, (quint32)len);
emit dumpbin(QString("DAT %1").arg(isSend?"<---":"--->"), buf, (quint32)len);
}

void ClientSkt::show(const QString& msg)
Expand Down
4 changes: 2 additions & 2 deletions src/sokit/clientskt.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class ClientSkt : public QObject
void message(const QString& msg);
void dumpbin(const QString& title, const char* data, quint32 len);

void countRecv(quint32 bytes);
void countSend(quint32 bytes);
void countRecv(qint32 bytes);
void countSend(qint32 bytes);

protected:
void dump(const char* buf, qint32 len, bool isSend);
Expand Down
8 changes: 4 additions & 4 deletions src/sokit/serverform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ bool ServerForm::initForm()
connect(&m_tcp, SIGNAL(connClose(const QString&)), this, SLOT(listerRemove(const QString&)));
connect(&m_tcp, SIGNAL(message(const QString&)), this, SIGNAL(output(const QString&)));
connect(&m_tcp, SIGNAL(dumpbin(const QString&,const char*,quint32)), this, SIGNAL(output(const QString&,const char*,quint32)));
connect(&m_tcp, SIGNAL(countRecv(quint32)), this, SLOT(countRecv(quint32)));
connect(&m_tcp, SIGNAL(countSend(quint32)), this, SLOT(countSend(quint32)));
connect(&m_tcp, SIGNAL(countRecv(qint32)), this, SLOT(countRecv(qint32)));
connect(&m_tcp, SIGNAL(countSend(qint32)), this, SLOT(countSend(qint32)));

connect(&m_udp, SIGNAL(connOpen(const QString&)), this, SLOT(listerAdd(const QString&)));
connect(&m_udp, SIGNAL(connClose(const QString&)), this, SLOT(listerRemove(const QString&)));
connect(&m_udp, SIGNAL(message(const QString&)), this, SIGNAL(output(const QString&)));
connect(&m_udp, SIGNAL(dumpbin(const QString&,const char*,quint32)), this, SIGNAL(output(const QString&,const char*,quint32)));
connect(&m_udp, SIGNAL(countRecv(quint32)), this, SLOT(countRecv(quint32)));
connect(&m_udp, SIGNAL(countSend(quint32)), this, SLOT(countSend(quint32)));
connect(&m_udp, SIGNAL(countRecv(qint32)), this, SLOT(countRecv(qint32)));
connect(&m_udp, SIGNAL(countSend(qint32)), this, SLOT(countSend(qint32)));

return true;
}
Expand Down
6 changes: 3 additions & 3 deletions src/sokit/serverskt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ void ServerSkt::setError(const QString& err)

void ServerSkt::recordRecv(qint32 bytes)
{
emit countRecv((quint32)bytes);
emit countRecv(bytes);
}

void ServerSkt::recordSend(qint32 bytes)
{
emit countSend((quint32)bytes);
emit countSend(bytes);
}

void ServerSkt::getKeys(QStringList& res)
Expand Down Expand Up @@ -146,7 +146,7 @@ void ServerSkt::send(const QString& key, const QString& data)

void ServerSkt::dump(const char* buf, qint32 len, bool isSend, const QString& key)
{
emit dumpbin(QString("DAT %1 %2").arg(isSend?"<<<<":">>>>",key), buf, (quint32)len);
emit dumpbin(QString("DAT %1 %2").arg(isSend?"<---":"--->",key), buf, (quint32)len);
}

void ServerSkt::show(const QString& msg)
Expand Down
4 changes: 2 additions & 2 deletions src/sokit/serverskt.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class ServerSkt : public QObject
void message(const QString& msg);
void dumpbin(const QString& title, const char* data, quint32 len);

void countRecv(quint32 bytes);
void countSend(quint32 bytes);
void countRecv(qint32 bytes);
void countSend(qint32 bytes);

protected:
void dump(const char* buf, qint32 len, bool isSend, const QString& key);
Expand Down
4 changes: 2 additions & 2 deletions src/sokit/transferform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ void TransferForm::trigger(bool start)
connect(m_server, SIGNAL(connClose(const QString&)), this, SLOT(listerRemove(const QString&)));
connect(m_server, SIGNAL(message(const QString&)), this, SIGNAL(output(const QString&)));
connect(m_server, SIGNAL(dumpbin(const QString&,const char*,quint32)), this, SIGNAL(output(const QString&,const char*,quint32)));
connect(m_server, SIGNAL(countRecv(quint32)), this, SLOT(countRecv(quint32)));
connect(m_server, SIGNAL(countSend(quint32)), this, SLOT(countSend(quint32)));
connect(m_server, SIGNAL(countRecv(qint32)), this, SLOT(countRecv(qint32)));
connect(m_server, SIGNAL(countSend(qint32)), this, SLOT(countSend(qint32)));
connect(m_server, SIGNAL(stopped()), this, SLOT(stop()));

start = m_server->start(sa.ip, sa.port, da.ip, da.port);
Expand Down
12 changes: 6 additions & 6 deletions src/sokit/transferskt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ void TransferSkt::setError(const QString& err)

void TransferSkt::recordRecv(qint32 bytes)
{
emit countRecv((quint32)bytes);
emit countRecv(bytes);
}

void TransferSkt::recordSend(qint32 bytes)
{
emit countSend((quint32)bytes);
emit countSend(bytes);
}

void TransferSkt::getKeys(QStringList& res)
Expand Down Expand Up @@ -146,10 +146,10 @@ void TransferSkt::dump(const char* buf, qint32 len, TransferSkt::DIR dir, const
QString title("TRN");
switch (dir)
{
case TS2D: title += " >>>> "; break;
case TD2S: title += " <<<< "; break;
case SS2D: title += " ++>> "; break;
case SD2S: title += " <<++ "; break;
case TS2D: title += " -->> "; break;
case TD2S: title += " <<-- "; break;
case SS2D: title += " --+> "; break;
case SD2S: title += " <+-- "; break;
default: title += " ???? "; break;
}
title += key;
Expand Down
4 changes: 2 additions & 2 deletions src/sokit/transferskt.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class TransferSkt : public QObject
void dumpbin(const QString& title, const char* data, quint32 len);
void stopped();

void countRecv(quint32 bytes);
void countSend(quint32 bytes);
void countRecv(qint32 bytes);
void countSend(qint32 bytes);

protected:
enum DIR { TS2D, TD2S, SS2D, SD2S, };
Expand Down

0 comments on commit 17eb411

Please sign in to comment.