[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kwooty/frameworks] src: Rename variables
From: Montel Laurent <montel () kde ! org>
Date: 2015-05-02 9:40:47
Message-ID: E1YoTuh-00060o-6v () scm ! kde ! org
[Download RAW message or body]
Git commit d234875d5e9c97c3d09723fa33b95bbd1fee4a7f by Montel Laurent.
Committed on 02/05/2015 at 09:40.
Pushed by mlaurent into branch 'frameworks'.
Rename variables
M +14 -14 src/jobs/concatsplitfilesjob.cpp
M +22 -22 src/observers/clientsobserver.cpp
M +5 -5 src/observers/clientsobserver.h
M +23 -23 src/observers/clientsobserverbase.cpp
M +8 -8 src/observers/clientsobserverbase.h
M +26 -26 src/observers/clientsperserverobserver.cpp
M +7 -7 src/observers/clientsperserverobserver.h
http://commits.kde.org/kwooty/d234875d5e9c97c3d09723fa33b95bbd1fee4a7f
diff --git a/src/jobs/concatsplitfilesjob.cpp b/src/jobs/concatsplitfilesjob.cpp
index 1da4ed7..7af64b4 100644
--- a/src/jobs/concatsplitfilesjob.cpp
+++ b/src/jobs/concatsplitfilesjob.cpp
@@ -33,8 +33,8 @@
ConcatSplitFilesJob::ConcatSplitFilesJob(ExtractSplit *parent)
{
- this->mDedicatedThread = new QThread();
- this->moveToThread(this->mDedicatedThread);
+ mDedicatedThread = new QThread();
+ moveToThread(mDedicatedThread);
qRegisterMetaType< QList<NzbFileData> >("QList<NzbFileData>");
// launch joining process from parent :
@@ -44,30 +44,30 @@ ConcatSplitFilesJob::ConcatSplitFilesJob(ExtractSplit *parent)
&ConcatSplitFilesJob::joinFilesSlot);
// start current thread :
- this->mDedicatedThread->start();
+ mDedicatedThread->start();
}
ConcatSplitFilesJob::~ConcatSplitFilesJob()
{
- this->mDedicatedThread->quit();
+ mDedicatedThread->quit();
// if query close is requested during joining file process,
// forces kwooty to close by terminating the running thread (maximum 3 seconds \
later) :
- this->mDedicatedThread->wait(3000);
+ mDedicatedThread->wait(3000);
- delete this->mDedicatedThread;
+ delete mDedicatedThread;
}
void ConcatSplitFilesJob::joinFilesSlot(const QList<NzbFileData> &nzbFileDataList, \
const QString &fileSavePath, const QString &joinFileName) {
- this->mNzbFileDataList = nzbFileDataList;
- this->mFileSavePath = fileSavePath;
- this->mJoinFileName = joinFileName;
+ mNzbFileDataList = nzbFileDataList;
+ mFileSavePath = fileSavePath;
+ mJoinFileName = joinFileName;
// join split files together :
- bool processFailed = this->joinSplittedFiles();
+ bool processFailed = joinSplittedFiles();
int error = QProcess::NormalExit;
if (processFailed) {
@@ -85,7 +85,7 @@ bool ConcatSplitFilesJob::joinSplittedFiles()
int fileProcessedNumber = 0;
// retrieve and open joined file :
- QFile joinFile(Utility::buildFullPath(this->mFileSavePath, \
this->mJoinFileName)); + QFile joinFile(Utility::buildFullPath(mFileSavePath, \
mJoinFileName));
// check if file already exists :
bool joinFileExists = joinFile.exists();
@@ -93,14 +93,14 @@ bool ConcatSplitFilesJob::joinSplittedFiles()
joinFile.open(QIODevice::WriteOnly | QIODevice::Append);
// join split files (list of files is assumed to be ordered at this stage) :
- foreach (const NzbFileData& currentNzbFileData, this->mNzbFileDataList) {
+ foreach (const NzbFileData& currentNzbFileData, mNzbFileDataList) {
fileProcessedNumber++;
// get current archive name :
QString archiveName = currentNzbFileData.getDecodedFileName();
- QString fullPathArchiveName = Utility::buildFullPath(this->mFileSavePath, \
archiveName); + QString fullPathArchiveName = \
Utility::buildFullPath(mFileSavePath, archiveName);
// if file already exists, it means that it has been created during repair \
processing.
// in that case target file is already joined and this process does not have \
to be done : @@ -138,7 +138,7 @@ bool ConcatSplitFilesJob::joinSplittedFiles()
}
// emit progress percentage :
- int progress = qRound((double)(fileProcessedNumber * PROGRESS_COMPLETE / \
this->mNzbFileDataList.size())); + int progress = \
qRound((double)(fileProcessedNumber * PROGRESS_COMPLETE / mNzbFileDataList.size())); \
emit progressPercentSignal(progress, archiveName);
}
diff --git a/src/observers/clientsobserver.cpp b/src/observers/clientsobserver.cpp
index 95ea78a..61b3d54 100644
--- a/src/observers/clientsobserver.cpp
+++ b/src/observers/clientsobserver.cpp
@@ -31,11 +31,11 @@
ClientsObserver::ClientsObserver(Core *parent) : ClientsObserverBase(parent)
{
- this->parent = parent;
+ mParent = parent;
- this->resetVariables();
+ resetVariables();
- this->statsInfoBuilder = new StatsInfoBuilder(this, parent);
+ mStatsInfoBuilder = new StatsInfoBuilder(this, parent);
}
@@ -44,8 +44,8 @@ void ClientsObserver::resetVariables()
ClientsObserverBase::resetVariables();
- this->totalFiles = 0;
- this->totalSize = 0;
+ mTotalFiles = 0;
+ mTotalSize = 0;
}
@@ -53,44 +53,44 @@ void ClientsObserver::sendFullUpdate()
{
// send reset values to status bar :
- emit updateFileSizeInfoSignal(this->totalFiles, this->totalSize);
+ emit updateFileSizeInfoSignal(mTotalFiles, mTotalSize);
emit updateConnectionStatusSignal();
- this->statsInfoBuilder->sendFullUpdate();
+ mStatsInfoBuilder->sendFullUpdate();
}
void ClientsObserver::nntpClientSpeedSlot(const int bytesDownloaded)
{
- this->addBytesDownloaded(bytesDownloaded);
+ addBytesDownloaded(bytesDownloaded);
}
void ClientsObserver::decrementSlot(const quint64 size, const int fileNumber = 1)
{
- this->totalFiles -= fileNumber;
- this->totalSize -= size;
+ mTotalFiles -= fileNumber;
+ mTotalSize -= size;
// status bar updates :
- emit updateFileSizeInfoSignal(this->totalFiles, this->totalSize);
+ emit updateFileSizeInfoSignal(mTotalFiles, mTotalSize);
}
void ClientsObserver::fullFileSizeUpdate(const quint64 size, const quint64 files)
{
- this->totalSize = size;
- this->totalFiles = files;
+ mTotalSize = size;
+ mTotalFiles = files;
// status bar updates :
- emit updateFileSizeInfoSignal(this->totalFiles, this->totalSize);
+ emit updateFileSizeInfoSignal(mTotalFiles, mTotalSize);
}
void ClientsObserver::connectionStatusSlot(const int connectionStatus)
{
- this->updateTotalConnections(connectionStatus);
+ updateTotalConnections(connectionStatus);
emit updateConnectionStatusSignal();
@@ -99,7 +99,7 @@ void ClientsObserver::connectionStatusSlot(const int \
connectionStatus) void ClientsObserver::nntpErrorSlot(const int nttpErrorStatus)
{
- this->setNntpErrorStatus(nttpErrorStatus);
+ setNntpErrorStatus(nttpErrorStatus);
emit updateConnectionStatusSignal();
@@ -110,7 +110,7 @@ void ClientsObserver::encryptionStatusSlot(const bool sslActive, \
const QString &
//qCDebug(KWOOTY_LOG) << "sslActive : " << sslActive << "encryptionMethod" << \
encryptionMethod;
- this->setSslHandshakeParameters(sslActive, encryptionMethod, \
certificateVerified, issuerOrgranisation, sslErrors); + \
setSslHandshakeParameters(sslActive, encryptionMethod, certificateVerified, \
issuerOrgranisation, sslErrors); emit updateConnectionStatusSignal();
}
@@ -120,7 +120,7 @@ bool ClientsObserver::isSingleServer(QString &hostName) const
bool singleServer = true;
- ServerManager *serverManager = this->parent->getServerManager();
+ ServerManager *serverManager = mParent->getServerManager();
if (serverManager->getServerNumber() > 1) {
singleServer = false;
@@ -136,21 +136,21 @@ bool ClientsObserver::isSingleServer(QString &hostName) const
bool ClientsObserver::isSslActive() const
{
- return this->parent->getServerManager()->areAllServersEncrypted();
+ return mParent->getServerManager()->areAllServersEncrypted();
}
void ClientsObserver::resetTotalBytesDownloaded()
{
- this->totalBytesDownloaded = 0;
+ mTotalBytesDownloaded = 0;
}
quint64 ClientsObserver::getTotalSize() const
{
- return this->totalSize;
+ return mTotalSize;
}
StatsInfoBuilder *ClientsObserver::getStatsInfoBuilder() const
{
- return this->statsInfoBuilder;
+ return mStatsInfoBuilder;
}
diff --git a/src/observers/clientsobserver.h b/src/observers/clientsobserver.h
index 9077fea..99b5c18 100644
--- a/src/observers/clientsobserver.h
+++ b/src/observers/clientsobserver.h
@@ -31,7 +31,7 @@ class ClientsObserver : public ClientsObserverBase
Q_OBJECT
public:
- ClientsObserver(Core *);
+ explicit ClientsObserver(Core *);
StatsInfoBuilder *getStatsInfoBuilder() const;
void fullFileSizeUpdate(const quint64, const quint64);
void sendFullUpdate();
@@ -42,10 +42,10 @@ public:
private:
- Core *parent;
- StatsInfoBuilder *statsInfoBuilder;
- quint64 totalFiles;
- quint64 totalSize;
+ Core *mParent;
+ StatsInfoBuilder *mStatsInfoBuilder;
+ quint64 mTotalFiles;
+ quint64 mTotalSize;
void resetVariables();
diff --git a/src/observers/clientsobserverbase.cpp \
b/src/observers/clientsobserverbase.cpp index 0cfc755..eb82428 100644
--- a/src/observers/clientsobserverbase.cpp
+++ b/src/observers/clientsobserverbase.cpp
@@ -28,84 +28,84 @@ ClientsObserverBase::ClientsObserverBase(QObject *parent) : \
QObject(parent) void ClientsObserverBase::resetVariables()
{
- this->totalBytesDownloaded = 0;
- this->totalConnections = 0;
- this->sslActive = false;
- this->certificateVerified = false;
- this->sslErrors = QStringList();
- this->nttpErrorStatus = NoError;
+ mTotalBytesDownloaded = 0;
+ mTotalConnections = 0;
+ mSslActive = false;
+ mCertificateVerified = false;
+ mSslErrors = QStringList();
+ mNttpErrorStatus = NoError;
}
void ClientsObserverBase::addBytesDownloaded(const int &bytesDownloaded)
{
- this->totalBytesDownloaded += bytesDownloaded;
+ mTotalBytesDownloaded += bytesDownloaded;
}
void ClientsObserverBase::updateTotalConnections(const int &connectionStatus)
{
if (connectionStatus == Connected) {
- this->totalConnections++;
+ mTotalConnections++;
}
if (connectionStatus == Disconnected) {
- this->totalConnections--;
+ mTotalConnections--;
}
}
void ClientsObserverBase::setNntpErrorStatus(const int &nttpErrorStatus)
{
- this->nttpErrorStatus = nttpErrorStatus;
+ mNttpErrorStatus = nttpErrorStatus;
}
void ClientsObserverBase::setSslHandshakeParameters(const bool &sslActive, const \
QString &encryptionMethod, const bool &certificateVerified, const QString \
&issuerOrgranisation, const QStringList &sslErrors) {
- this->encryptionMethod = encryptionMethod;
- this->sslActive = sslActive;
- this->certificateVerified = certificateVerified;
- this->issuerOrgranisation = issuerOrgranisation;
- this->sslErrors = sslErrors;
+ mEncryptionMethod = encryptionMethod;
+ mSslActive = sslActive;
+ mCertificateVerified = certificateVerified;
+ mIssuerOrgranisation = issuerOrgranisation;
+ mSslErrors = sslErrors;
}
bool ClientsObserverBase::isConnected() const
{
- return (this->totalConnections > 0);
+ return (mTotalConnections > 0);
}
QString ClientsObserverBase::getEncryptionMethod() const
{
- return this->encryptionMethod;
+ return mEncryptionMethod;
}
QString ClientsObserverBase::getIssuerOrgranisation() const
{
- return this->issuerOrgranisation;
+ return mIssuerOrgranisation;
}
QStringList ClientsObserverBase::getSslErrors() const
{
- return this->sslErrors;
+ return mSslErrors;
}
int ClientsObserverBase::getTotalConnections() const
{
- return this->totalConnections;
+ return mTotalConnections;
}
bool ClientsObserverBase::isCertificateVerified() const
{
- return this->certificateVerified;
+ return mCertificateVerified;
}
int ClientsObserverBase::getNttpErrorStatus() const
{
- return this->nttpErrorStatus;
+ return mNttpErrorStatus;
}
quint64 ClientsObserverBase::getTotalBytesDownloaded() const
{
- return this->totalBytesDownloaded;
+ return mTotalBytesDownloaded;
}
diff --git a/src/observers/clientsobserverbase.h \
b/src/observers/clientsobserverbase.h index 61af49e..e937005 100644
--- a/src/observers/clientsobserverbase.h
+++ b/src/observers/clientsobserverbase.h
@@ -45,14 +45,14 @@ public:
virtual bool isSslActive() const = 0;
protected:
- quint64 totalBytesDownloaded;
- QStringList sslErrors;
- QString encryptionMethod;
- QString issuerOrgranisation;
- int totalConnections;
- int nttpErrorStatus;
- bool sslActive;
- bool certificateVerified;
+ quint64 mTotalBytesDownloaded;
+ QStringList mSslErrors;
+ QString mEncryptionMethod;
+ QString mIssuerOrgranisation;
+ int mTotalConnections;
+ int mNttpErrorStatus;
+ bool mSslActive;
+ bool mCertificateVerified;
void resetVariables();
void addBytesDownloaded(const int &);
diff --git a/src/observers/clientsperserverobserver.cpp \
b/src/observers/clientsperserverobserver.cpp index b7ab9ac..a6d6565 100644
--- a/src/observers/clientsperserverobserver.cpp
+++ b/src/observers/clientsperserverobserver.cpp
@@ -33,7 +33,7 @@
ClientsPerServerObserver::ClientsPerServerObserver(ServerGroup *parent) : \
ClientsObserverBase(parent) {
- this->parent = parent;
+ this->mParent = parent;
this->resetVariables();
this->setupConnections();
@@ -43,7 +43,7 @@ ClientsPerServerObserver::ClientsPerServerObserver(ServerGroup \
*parent) : Client void ClientsPerServerObserver::setupConnections()
{
- ClientsObserver *clientsObserver = \
this->parent->getCore()->getClientsObserver(); + ClientsObserver *clientsObserver \
= this->mParent->getCore()->getClientsObserver();
// send connection status (connected, deconnected) to client observer for the \
current server : connect(this,
SIGNAL(connectionStatusSignal(int)),
@@ -71,7 +71,7 @@ void ClientsPerServerObserver::setupConnections()
// notify sidebar that some nntpClient info have been updated :
connect(this,
SIGNAL(serverStatisticsUpdateSignal(int)),
- this->parent->getCore(),
+ this->mParent->getCore(),
SLOT(serverStatisticsUpdateSlot(int)));
// calculate average download speed for all nntp client instances of this server \
group : @@ -86,12 +86,12 @@ void ClientsPerServerObserver::resetVariables()
ClientsObserverBase::resetVariables() ;
- this->downloadSpeed = 0;
- this->averageDownloadSpeed = 0;
- this->effectiveMeanDownloadSpeed = 0;
- this->segmentInfoData = SegmentInfoData();
- this->bytesDownloadedForCurrentSession = 0;
- this->meanDownloadSpeedCounter = 0;
+ this->mDownloadSpeed = 0;
+ this->mAverageDownloadSpeed = 0;
+ this->mEffectiveMeanDownloadSpeed = 0;
+ this->mSegmentInfoData = SegmentInfoData();
+ this->mBytesDownloadedForCurrentSession = 0;
+ this->mMeanDownloadSpeedCounter = 0;
}
@@ -103,10 +103,10 @@ void \
ClientsPerServerObserver::nntpClientSpeedPerServerSlot(const SegmentInfoDat \
this->addBytesDownloaded(bytesDownloaded);
// store the number of bytes downloaded for the whole session in order to \
display it in sidebar :
- this->bytesDownloadedForCurrentSession += bytesDownloaded;
+ this->mBytesDownloadedForCurrentSession += bytesDownloaded;
// store info to compute remaining time and to display additional data in side \
bar :
- this->segmentInfoData = segmentInfoData;
+ this->mSegmentInfoData = segmentInfoData;
// forward current server download speed to global observer :
emit speedSignal(bytesDownloaded);
@@ -121,7 +121,7 @@ void \
ClientsPerServerObserver::connectionStatusPerServerSlot(const int connectio // \
forward current server download speed to global observer : emit \
connectionStatusSignal(connectionStatus);
- emit serverStatisticsUpdateSignal(this->parent->getRealServerGroupId());
+ emit serverStatisticsUpdateSignal(this->mParent->getRealServerGroupId());
}
@@ -145,66 +145,66 @@ void \
ClientsPerServerObserver::encryptionStatusPerServerSlot(const bool sslActiv // \
forward current server download speed to global observer :
emit encryptionStatusSignal(sslActive, encryptionMethod, certificateVerified, \
issuerOrgranisation, sslErrors);
- emit serverStatisticsUpdateSignal(this->parent->getRealServerGroupId());
+ emit serverStatisticsUpdateSignal(this->mParent->getRealServerGroupId());
}
void ClientsPerServerObserver::updateDownloadSpeedSlot()
{
// get current download speed :
- this->downloadSpeed = this->totalBytesDownloaded / \
StatsInfoBuilder::SPEED_AVERAGE_SECONDS; + this->mDownloadSpeed = \
this->mTotalBytesDownloaded / StatsInfoBuilder::SPEED_AVERAGE_SECONDS;
// compute average download speed :
- this->averageDownloadSpeed = (this->averageDownloadSpeed + this->downloadSpeed) \
/ 2; + this->mAverageDownloadSpeed = (this->mAverageDownloadSpeed + \
this->mDownloadSpeed) / 2;
// compute the effective mean download speed :
if (this->isDownloading()) {
- this->effectiveMeanDownloadSpeed = (this->effectiveMeanDownloadSpeed * \
this->meanDownloadSpeedCounter + this->downloadSpeed) / \
(this->meanDownloadSpeedCounter + 1);
- this->meanDownloadSpeedCounter++;
+ this->mEffectiveMeanDownloadSpeed = (this->mEffectiveMeanDownloadSpeed * \
this->mMeanDownloadSpeedCounter + this->mDownloadSpeed) / \
(this->mMeanDownloadSpeedCounter + 1); + this->mMeanDownloadSpeedCounter++;
}
// notify side bar that download speed has been updated :
- emit serverStatisticsUpdateSignal(this->parent->getRealServerGroupId());
+ emit serverStatisticsUpdateSignal(this->mParent->getRealServerGroupId());
// reset number of bytes downloaded after text update :
- this->totalBytesDownloaded = 0;
+ this->mTotalBytesDownloaded = 0;
}
bool ClientsPerServerObserver::isSslActive() const
{
- return this->sslActive;
+ return this->mSslActive;
}
bool ClientsPerServerObserver::isDownloading() const
{
- return (this->downloadSpeed > 0);
+ return (this->mDownloadSpeed > 0);
}
quint64 ClientsPerServerObserver::getDownloadSpeed() const
{
- return this->downloadSpeed;
+ return this->mDownloadSpeed;
}
quint64 ClientsPerServerObserver::getAverageDownloadSpeed() const
{
- return this->averageDownloadSpeed;
+ return this->mAverageDownloadSpeed;
}
quint64 ClientsPerServerObserver::getEffectiveMeanDownloadSpeed() const
{
- return this->effectiveMeanDownloadSpeed;
+ return this->mEffectiveMeanDownloadSpeed;
}
SegmentInfoData ClientsPerServerObserver::getSegmentInfoData() const
{
- return this->segmentInfoData;
+ return this->mSegmentInfoData;
}
quint64 ClientsPerServerObserver::getBytesDownloadedForCurrentSession() const
{
- return this->bytesDownloadedForCurrentSession;
+ return this->mBytesDownloadedForCurrentSession;
}
diff --git a/src/observers/clientsperserverobserver.h \
b/src/observers/clientsperserverobserver.h index 8f7ac80..caba7eb 100644
--- a/src/observers/clientsperserverobserver.h
+++ b/src/observers/clientsperserverobserver.h
@@ -42,13 +42,13 @@ public:
bool isDownloading() const;
private:
- ServerGroup *parent;
- SegmentInfoData segmentInfoData;
- quint64 downloadSpeed;
- quint64 averageDownloadSpeed;
- quint64 effectiveMeanDownloadSpeed;
- quint64 bytesDownloadedForCurrentSession;
- quint64 meanDownloadSpeedCounter;
+ ServerGroup *mParent;
+ SegmentInfoData mSegmentInfoData;
+ quint64 mDownloadSpeed;
+ quint64 mAverageDownloadSpeed;
+ quint64 mEffectiveMeanDownloadSpeed;
+ quint64 mBytesDownloadedForCurrentSession;
+ quint64 mMeanDownloadSpeedCounter;
void setupConnections();
void resetVariables();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic