X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Foidentdconfiggenerator.cpp;h=e69f76f28701fcf0ecb962640070f71ae8a1fba4;hp=7e7587100d523de45b09b8acab746ae6898012a9;hb=c1cf157116de7fc3da96203aa6f03c38c7ebb650;hpb=30b159cb876a9495de42e9a3e70ca050516f0805 diff --git a/src/core/oidentdconfiggenerator.cpp b/src/core/oidentdconfiggenerator.cpp index 7e758710..e69f76f2 100644 --- a/src/core/oidentdconfiggenerator.cpp +++ b/src/core/oidentdconfiggenerator.cpp @@ -19,8 +19,8 @@ ***************************************************************************/ #ifdef HAVE_UMASK -# include -# include +# include +# include #endif /* HAVE_UMASK */ #include @@ -28,14 +28,13 @@ #include "corenetwork.h" #include "oidentdconfiggenerator.h" -OidentdConfigGenerator::OidentdConfigGenerator(QObject *parent) : - QObject(parent) +OidentdConfigGenerator::OidentdConfigGenerator(QObject* parent) + : QObject(parent) { if (!_initialized) init(); } - OidentdConfigGenerator::~OidentdConfigGenerator() { _quasselConfig.clear(); @@ -43,7 +42,6 @@ OidentdConfigGenerator::~OidentdConfigGenerator() _configFile->deleteLater(); } - bool OidentdConfigGenerator::init() { _configDir = QDir::homePath(); @@ -72,17 +70,18 @@ bool OidentdConfigGenerator::init() return _initialized; } - -QString OidentdConfigGenerator::sysIdentForIdentity(const CoreIdentity *identity) const { +QString OidentdConfigGenerator::sysIdentForIdentity(const CoreIdentity* identity) const +{ // Make sure the identity's ident complies with strict mode if enabled - const CoreNetwork *network = qobject_cast(sender()); + const CoreNetwork* network = qobject_cast(sender()); return network->coreSession()->strictCompliantIdent(identity); } - -bool OidentdConfigGenerator::addSocket(const CoreIdentity *identity, - const QHostAddress &localAddress, quint16 localPort, - const QHostAddress &peerAddress, quint16 peerPort, +bool OidentdConfigGenerator::addSocket(const CoreIdentity* identity, + const QHostAddress& localAddress, + quint16 localPort, + const QHostAddress& peerAddress, + quint16 peerPort, qint64 socketId) { Q_UNUSED(localAddress) @@ -99,11 +98,12 @@ bool OidentdConfigGenerator::addSocket(const CoreIdentity *identity, return ret; } - //! not yet implemented -bool OidentdConfigGenerator::removeSocket(const CoreIdentity *identity, - const QHostAddress &localAddress, quint16 localPort, - const QHostAddress &peerAddress, quint16 peerPort, +bool OidentdConfigGenerator::removeSocket(const CoreIdentity* identity, + const QHostAddress& localAddress, + quint16 localPort, + const QHostAddress& peerAddress, + quint16 peerPort, qint64 socketId) { Q_UNUSED(identity) @@ -116,7 +116,6 @@ bool OidentdConfigGenerator::removeSocket(const CoreIdentity *identity, return true; } - bool OidentdConfigGenerator::parseConfig(bool readQuasselStanzas) { if (!_configFile->exists()) @@ -142,11 +141,10 @@ bool OidentdConfigGenerator::parseConfig(bool readQuasselStanzas) return true; } - bool OidentdConfigGenerator::writeConfig() { #ifdef HAVE_UMASK - mode_t prev_umask = umask(S_IXUSR | S_IWGRP | S_IXGRP | S_IWOTH | S_IXOTH); // == 0133, rw-r--r-- + mode_t prev_umask = umask(S_IXUSR | S_IWGRP | S_IXGRP | S_IWOTH | S_IXOTH); // == 0133, rw-r--r-- #endif bool not_open = (!_configFile->isOpen() && !_configFile->open(QIODevice::ReadWrite | QIODevice::Text)); #ifdef HAVE_UMASK @@ -168,8 +166,7 @@ bool OidentdConfigGenerator::writeConfig() return true; } - -bool OidentdConfigGenerator::lineByUs(const QByteArray &line) +bool OidentdConfigGenerator::lineByUs(const QByteArray& line) { return _quasselStanzaRx.exactMatch(line); }