Skip to content

Commit 57f439f

Browse files
authored
Merge pull request #3721 from softins/remove-htmlstatus
Remove -m/--htmlstatus option and related code.
2 parents bbcd3fe + 31800e9 commit 57f439f

3 files changed

Lines changed: 0 additions & 94 deletions

File tree

src/main.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ int main ( int argc, char** argv )
105105
ELicenceType eLicenceType = LT_NO_LICENCE;
106106
QString strConnOnStartupAddress = "";
107107
QString strIniFileName = "";
108-
QString strHTMLStatusFileName = "";
109108
QString strLoggingFileName = "";
110109
QString strRecordingDirName = "";
111110
QString strDirectoryAddress = "";
@@ -343,19 +342,6 @@ int main ( int argc, char** argv )
343342
continue;
344343
}
345344

346-
// HTML status file ----------------------------------------------------
347-
if ( GetStringArgument ( argc, argv, i, "-m", "--htmlstatus", strArgument ) )
348-
{
349-
qWarning() << qUtf8Printable (
350-
QString ( "- The HTML status file option (\"--htmlstatus\" or \"-m\") is deprecated and will be removed soon. Please use JSON-RPC "
351-
"instead. See https://github.com/jamulussoftware/jamulus/blob/main/docs/JSON-RPC.md" ) );
352-
strHTMLStatusFileName = strArgument;
353-
qInfo() << qUtf8Printable ( QString ( "- HTML status file name: %1" ).arg ( strHTMLStatusFileName ) );
354-
CommandLineOptions << "--htmlstatus";
355-
ServerOnlyOptions << "--htmlstatus";
356-
continue;
357-
}
358-
359345
// Server info ---------------------------------------------------------
360346
if ( GetStringArgument ( argc, argv, i, "-o", "--serverinfo", strArgument ) )
361347
{
@@ -993,7 +979,6 @@ int main ( int argc, char** argv )
993979
strServerBindIP,
994980
iPortNumber,
995981
iQosNumber,
996-
strHTMLStatusFileName,
997982
strDirectoryAddress,
998983
strServerListFileName,
999984
strServerInfo,
@@ -1121,7 +1106,6 @@ QString UsageArguments ( char** argv )
11211106
" -F, --fastupdate use 64 samples frame size mode\n"
11221107
" -l, --log enable logging, set file name\n"
11231108
" -L, --licence show an agreement window before users can connect\n"
1124-
" -m, --htmlstatus deprecated, please use JSON-RPC instead\n"
11251109
" -o, --serverinfo registration info for this Server. Format:\n"
11261110
" [name];[city];[country as two-letter ISO country code or Qt5 QLocale ID]\n"
11271111
" --serverpublicip public IP address for this Server. Needed when\n"

src/server.cpp

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ CServer::CServer ( const int iNewMaxNumChan,
3030
const QString& strServerBindIP,
3131
const quint16 iPortNumber,
3232
const quint16 iQosNumber,
33-
const QString& strHTMLStatusFileName,
3433
const QString& strDirectoryAddress,
3534
const QString& strServerListFileName,
3635
const QString& strServerInfo,
@@ -54,8 +53,6 @@ CServer::CServer ( const int iNewMaxNumChan,
5453
Socket ( this, iPortNumber, iQosNumber, strServerBindIP, bNEnableIPv6 ),
5554
Logging(),
5655
iFrameCount ( 0 ),
57-
bWriteStatusHTMLFile ( false ),
58-
strServerHTMLFileListName ( strHTMLStatusFileName ),
5956
HighPrecisionTimer ( bNUseDoubleSystemFrameSize ),
6057
ServerListManager ( iPortNumber,
6158
strDirectoryAddress,
@@ -193,14 +190,6 @@ CServer::CServer ( const int iNewMaxNumChan,
193190
Logging.Start ( strLoggingFileName );
194191
}
195192

196-
// HTML status file writing
197-
if ( !strServerHTMLFileListName.isEmpty() )
198-
{
199-
// activate HTML file writing and write initial file
200-
bWriteStatusHTMLFile = true;
201-
WriteHTMLChannelList();
202-
}
203-
204193
// manage welcome message: if the welcome message is a valid link to a local
205194
// file, the content of that file is used as the welcome message (#361)
206195
SetWelcomeMessage ( strNewWelcomeMessage ); // first use given text, may be overwritten
@@ -504,11 +493,6 @@ void CServer::OnAboutToQuit()
504493
}
505494

506495
Stop();
507-
508-
if ( bWriteStatusHTMLFile )
509-
{
510-
WriteHTMLServerQuit();
511-
}
512496
}
513497

514498
void CServer::OnHandledSignal ( int sigNum )
@@ -1267,12 +1251,6 @@ void CServer::CreateAndSendChanListForAllConChannels()
12671251
vecChannels[i].CreateConClientListMes ( vecChanInfo );
12681252
}
12691253
}
1270-
1271-
// create status HTML file if enabled
1272-
if ( bWriteStatusHTMLFile )
1273-
{
1274-
WriteHTMLChannelList();
1275-
}
12761254
}
12771255

12781256
void CServer::CreateAndSendChanListForThisChan ( const int iCurChanID )
@@ -1571,54 +1549,6 @@ void CServer::SetWelcomeMessage ( const QString& strNWelcMess )
15711549
strWelcomeMessage = strWelcomeMessage.left ( MAX_LEN_CHAT_TEXT );
15721550
}
15731551

1574-
void CServer::WriteHTMLChannelList()
1575-
{
1576-
// prepare file and stream
1577-
QFile serverFileListFile ( strServerHTMLFileListName );
1578-
1579-
if ( serverFileListFile.open ( QIODevice::WriteOnly | QIODevice::Text ) )
1580-
{
1581-
QTextStream streamFileOut ( &serverFileListFile );
1582-
1583-
// depending on number of connected clients write list
1584-
if ( GetNumberOfConnectedClients() == 0 )
1585-
{
1586-
// no clients are connected -> empty server
1587-
streamFileOut << " No client connected\n";
1588-
}
1589-
else
1590-
{
1591-
streamFileOut << "<ul>\n";
1592-
1593-
// write entry for each connected client
1594-
for ( int i = 0; i < iMaxNumChannels; i++ )
1595-
{
1596-
if ( vecChannels[i].IsConnected() )
1597-
{
1598-
streamFileOut << " <li>" << vecChannels[i].GetName().toHtmlEscaped() << "</li>\n";
1599-
}
1600-
}
1601-
1602-
streamFileOut << "</ul>\n";
1603-
}
1604-
}
1605-
}
1606-
1607-
void CServer::WriteHTMLServerQuit()
1608-
{
1609-
// prepare file and stream
1610-
QFile serverFileListFile ( strServerHTMLFileListName );
1611-
1612-
if ( !serverFileListFile.open ( QIODevice::WriteOnly | QIODevice::Text ) )
1613-
{
1614-
return;
1615-
}
1616-
1617-
QTextStream streamFileOut ( &serverFileListFile );
1618-
streamFileOut << " Server terminated\n";
1619-
serverFileListFile.close();
1620-
}
1621-
16221552
void CServer::customEvent ( QEvent* pEvent )
16231553
{
16241554
if ( pEvent->type() == QEvent::User + 11 )

src/server.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ class CServer : public QObject, public CServerSlots<MAX_NUM_CHANNELS>
9090
const QString& strServerBindIP,
9191
const quint16 iPortNumber,
9292
const quint16 iQosNumber,
93-
const QString& strHTMLStatusFileName,
9493
const QString& strDirectoryAddress,
9594
const QString& strServerListFileName,
9695
const QString& strServerInfo,
@@ -194,9 +193,6 @@ class CServer : public QObject, public CServerSlots<MAX_NUM_CHANNELS>
194193
template<unsigned int slotId>
195194
inline void connectChannelSignalsToServerSlots();
196195

197-
void WriteHTMLChannelList();
198-
void WriteHTMLServerQuit();
199-
200196
static void DecodeReceiveDataBlocks ( CServer* pServer, const int iStartChanCnt, const int iStopChanCnt, const int iNumClients );
201197

202198
static void MixEncodeTransmitDataBlocks ( CServer* pServer, const int iStartChanCnt, const int iStopChanCnt, const int iNumClients );
@@ -281,10 +277,6 @@ class CServer : public QObject, public CServerSlots<MAX_NUM_CHANNELS>
281277
// channel level update frame interval counter
282278
int iFrameCount;
283279

284-
// HTML file server status
285-
bool bWriteStatusHTMLFile;
286-
QString strServerHTMLFileListName;
287-
288280
CHighPrecisionTimer HighPrecisionTimer;
289281

290282
// server list

0 commit comments

Comments
 (0)