avoid showing IP address if no name in the musician profile is given #316
This commit is contained in:
parent
850883f3fc
commit
b1c97c2d36
6 changed files with 12 additions and 46 deletions
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
- added check in acknowledge message, coded by atsampson (#302)
|
- added check in acknowledge message, coded by atsampson (#302)
|
||||||
|
|
||||||
|
- avoid showing IP address if no name in the musician profile is given #316
|
||||||
|
|
||||||
- bug fix: on MacOS declare an activity to ensure the process doesn't get throttled
|
- bug fix: on MacOS declare an activity to ensure the process doesn't get throttled
|
||||||
by OS level Nap, Sleep, and Thread Priority systems, coded by AronVietti (#23)
|
by OS level Nap, Sleep, and Thread Priority systems, coded by AronVietti (#23)
|
||||||
|
|
||||||
|
|
|
@ -439,7 +439,7 @@ void CChannelFader::SetText ( const CChannelInfo& ChanInfo )
|
||||||
// break text at predefined position
|
// break text at predefined position
|
||||||
const int iBreakPos = MAX_LEN_FADER_TAG / 2;
|
const int iBreakPos = MAX_LEN_FADER_TAG / 2;
|
||||||
|
|
||||||
QString strModText = ChanInfo.GenNameForDisplay();
|
QString strModText = ChanInfo.strName;
|
||||||
|
|
||||||
if ( strModText.length() > iBreakPos )
|
if ( strModText.length() > iBreakPos )
|
||||||
{
|
{
|
||||||
|
|
|
@ -430,7 +430,7 @@ void CConnectDlg::SetConnClientsList ( const CHostAddress& InetAddr,
|
||||||
pNewChildListViewItem->setFirstColumnSpanned ( true );
|
pNewChildListViewItem->setFirstColumnSpanned ( true );
|
||||||
|
|
||||||
// set the clients name
|
// set the clients name
|
||||||
QString sClientText = vecChanInfo[i].GenNameForDisplay();
|
QString sClientText = vecChanInfo[i].strName;
|
||||||
|
|
||||||
// set the icon: country flag has priority over instrument
|
// set the icon: country flag has priority over instrument
|
||||||
bool bCountryFlagIsUsed = false;
|
bool bCountryFlagIsUsed = false;
|
||||||
|
|
|
@ -1303,13 +1303,6 @@ void CServer::CreateAndSendChatTextForAllConChannels ( const int iCurChanID
|
||||||
// get client name, if name is empty, use IP address instead
|
// get client name, if name is empty, use IP address instead
|
||||||
QString ChanName = vecChannels[iCurChanID].GetName();
|
QString ChanName = vecChannels[iCurChanID].GetName();
|
||||||
|
|
||||||
if ( ChanName.isEmpty() )
|
|
||||||
{
|
|
||||||
// convert IP address to text and show it
|
|
||||||
ChanName = vecChannels[iCurChanID].GetAddress().
|
|
||||||
toString ( CHostAddress::SM_IP_NO_LAST_BYTE );
|
|
||||||
}
|
|
||||||
|
|
||||||
// add time and name of the client at the beginning of the message text and
|
// add time and name of the client at the beginning of the message text and
|
||||||
// use different colors
|
// use different colors
|
||||||
QString sCurColor = vstrChatColors[iCurChanID % vstrChatColors.Size()];
|
QString sCurColor = vstrChatColors[iCurChanID % vstrChatColors.Size()];
|
||||||
|
@ -1552,18 +1545,7 @@ void CServer::WriteHTMLChannelList()
|
||||||
{
|
{
|
||||||
if ( vecChannels[i].IsConnected() )
|
if ( vecChannels[i].IsConnected() )
|
||||||
{
|
{
|
||||||
QString strCurChanName = vecChannels[i].GetName();
|
streamFileOut << " <li>" << vecChannels[i].GetName() << "</li>" << endl;
|
||||||
|
|
||||||
// if text is empty, show IP address instead
|
|
||||||
if ( strCurChanName.isEmpty() )
|
|
||||||
{
|
|
||||||
// convert IP address to text and show it, remove last
|
|
||||||
// digits
|
|
||||||
strCurChanName = vecChannels[i].GetAddress().
|
|
||||||
toString ( CHostAddress::SM_IP_NO_LAST_BYTE );
|
|
||||||
}
|
|
||||||
|
|
||||||
streamFileOut << " <li>" << strCurChanName << "</li>" << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,8 @@ void CSettings::Load()
|
||||||
|
|
||||||
// name
|
// name
|
||||||
pClient->ChannelInfo.strName = FromBase64ToString (
|
pClient->ChannelInfo.strName = FromBase64ToString (
|
||||||
GetIniSetting ( IniXMLDocument, "client", "name_base64" ) );
|
GetIniSetting ( IniXMLDocument, "client", "name_base64",
|
||||||
|
ToBase64 ( QCoreApplication::translate ( "CMusProfDlg", "No Name" ) ) ) );
|
||||||
|
|
||||||
// instrument
|
// instrument
|
||||||
if ( GetNumericIniSet ( IniXMLDocument, "client", "instrument",
|
if ( GetNumericIniSet ( IniXMLDocument, "client", "instrument",
|
||||||
|
|
19
src/util.h
19
src/util.h
|
@ -917,25 +917,6 @@ public:
|
||||||
iChanID ( NiID ),
|
iChanID ( NiID ),
|
||||||
iIpAddr ( NiIP ) {}
|
iIpAddr ( NiIP ) {}
|
||||||
|
|
||||||
QString GenNameForDisplay() const
|
|
||||||
{
|
|
||||||
// if text is empty, show IP address instead
|
|
||||||
if ( strName.isEmpty() )
|
|
||||||
{
|
|
||||||
// convert IP address to text and show it (use dummy port number
|
|
||||||
// since it is not used here)
|
|
||||||
const CHostAddress TempAddr =
|
|
||||||
CHostAddress ( QHostAddress ( iIpAddr ), 0 );
|
|
||||||
|
|
||||||
return TempAddr.toString ( CHostAddress::SM_IP_NO_LAST_BYTE );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// show name of channel
|
|
||||||
return strName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ID of the channel
|
// ID of the channel
|
||||||
int iChanID;
|
int iChanID;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue