introduce functions for ToBase64 and FromBase64 for cleaner code
This commit is contained in:
parent
b66e22379a
commit
6034dab1b3
2 changed files with 17 additions and 12 deletions
|
@ -236,20 +236,20 @@ void CSettings::Load()
|
||||||
}
|
}
|
||||||
|
|
||||||
// window position of the main window
|
// window position of the main window
|
||||||
pClient->vecWindowPosMain = QByteArray().fromBase64 (
|
pClient->vecWindowPosMain = FromBase64 (
|
||||||
GetIniSetting ( IniXMLDocument, "client", "winposmain" ).toLatin1() );
|
GetIniSetting ( IniXMLDocument, "client", "winposmain" ) );
|
||||||
|
|
||||||
// window position of the settings window
|
// window position of the settings window
|
||||||
pClient->vecWindowPosSettings = QByteArray().fromBase64 (
|
pClient->vecWindowPosSettings = FromBase64 (
|
||||||
GetIniSetting ( IniXMLDocument, "client", "winposset" ).toLatin1() );
|
GetIniSetting ( IniXMLDocument, "client", "winposset" ) );
|
||||||
|
|
||||||
// window position of the chat window
|
// window position of the chat window
|
||||||
pClient->vecWindowPosChat = QByteArray().fromBase64 (
|
pClient->vecWindowPosChat = FromBase64 (
|
||||||
GetIniSetting ( IniXMLDocument, "client", "winposchat" ).toLatin1() );
|
GetIniSetting ( IniXMLDocument, "client", "winposchat" ) );
|
||||||
|
|
||||||
// window position of the connect window
|
// window position of the connect window
|
||||||
pClient->vecWindowPosConnect = QByteArray().fromBase64 (
|
pClient->vecWindowPosConnect = FromBase64 (
|
||||||
GetIniSetting ( IniXMLDocument, "client", "winposcon" ).toLatin1() );
|
GetIniSetting ( IniXMLDocument, "client", "winposcon" ) );
|
||||||
|
|
||||||
// visibility state of the settings window
|
// visibility state of the settings window
|
||||||
if ( GetFlagIniSet ( IniXMLDocument, "client", "winvisset", bValue ) )
|
if ( GetFlagIniSet ( IniXMLDocument, "client", "winvisset", bValue ) )
|
||||||
|
@ -429,19 +429,19 @@ void CSettings::Save()
|
||||||
|
|
||||||
// window position of the main window
|
// window position of the main window
|
||||||
PutIniSetting ( IniXMLDocument, "client", "winposmain",
|
PutIniSetting ( IniXMLDocument, "client", "winposmain",
|
||||||
QString().fromLatin1 ( pClient->vecWindowPosMain.toBase64() ) );
|
ToBase64 ( pClient->vecWindowPosMain ) );
|
||||||
|
|
||||||
// window position of the settings window
|
// window position of the settings window
|
||||||
PutIniSetting ( IniXMLDocument, "client", "winposset",
|
PutIniSetting ( IniXMLDocument, "client", "winposset",
|
||||||
QString().fromLatin1 ( pClient->vecWindowPosSettings.toBase64() ) );
|
ToBase64 ( pClient->vecWindowPosSettings ) );
|
||||||
|
|
||||||
// window position of the chat window
|
// window position of the chat window
|
||||||
PutIniSetting ( IniXMLDocument, "client", "winposchat",
|
PutIniSetting ( IniXMLDocument, "client", "winposchat",
|
||||||
QString().fromLatin1 ( pClient->vecWindowPosChat.toBase64() ) );
|
ToBase64 ( pClient->vecWindowPosChat ) );
|
||||||
|
|
||||||
// window position of the connect window
|
// window position of the connect window
|
||||||
PutIniSetting ( IniXMLDocument, "client", "winposcon",
|
PutIniSetting ( IniXMLDocument, "client", "winposcon",
|
||||||
QString().fromLatin1 ( pClient->vecWindowPosConnect.toBase64() ) );
|
ToBase64 ( pClient->vecWindowPosConnect ) );
|
||||||
|
|
||||||
// visibility state of the settings window
|
// visibility state of the settings window
|
||||||
SetFlagIniSet ( IniXMLDocument, "client", "winvisset",
|
SetFlagIniSet ( IniXMLDocument, "client", "winvisset",
|
||||||
|
|
|
@ -53,6 +53,11 @@ public:
|
||||||
protected:
|
protected:
|
||||||
void SetFileName ( const QString& sNFiName );
|
void SetFileName ( const QString& sNFiName );
|
||||||
|
|
||||||
|
QString ToBase64 ( const QByteArray strIn ) const
|
||||||
|
{ return QString::fromLatin1 ( strIn.toBase64() ); }
|
||||||
|
QByteArray FromBase64 ( const QString strIn ) const
|
||||||
|
{ return QByteArray::fromBase64 ( strIn.toLatin1() ); }
|
||||||
|
|
||||||
// init file access function for read/write
|
// init file access function for read/write
|
||||||
void SetNumericIniSet ( QDomDocument& xmlFile,
|
void SetNumericIniSet ( QDomDocument& xmlFile,
|
||||||
const QString& strSection,
|
const QString& strSection,
|
||||||
|
|
Loading…
Reference in a new issue