Commit c81d08ef authored by Michael Reeves's avatar Michael Reeves

Scub uneeded member variable

parent 79db39e7
......@@ -1504,13 +1504,11 @@ class RecalcWordWrapRunnable : public QRunnable
{
Q_UNUSED(pData) // TODO really unused?
setAutoDelete(true);
//++s_runnableCount; // in Qt>=5.3 only
s_runnableCount.fetchAndAddOrdered(1);
}
void run() override
{
m_pDTW->recalcWordWrapHelper(0, m_visibleTextWidth, m_cacheIdx);
// int newValue = --s_runnableCount; // in Qt>=5.3 only
int newValue = s_runnableCount.fetchAndAddOrdered(-1) - 1;
g_pProgressDialog->setCurrent(s_maxNofRunnables - getAtomic(s_runnableCount));
if(newValue == 0)
......@@ -1521,7 +1519,7 @@ class RecalcWordWrapRunnable : public QRunnable
p = p->parentWidget();
if(KDiff3App* pKDiff3App = dynamic_cast<KDiff3App*>(p))
{
QMetaObject::invokeMethod(pKDiff3App, "slotFinishRecalcWordWrap", Qt::QueuedConnection);
QMetaObject::invokeMethod(pKDiff3App, "slotFinishRecalcWordWrap", Qt::QueuedConnection, Q_ARG(int, m_visibleTextWidth));
break;
}
}
......@@ -1586,7 +1584,6 @@ void DiffTextWindow::recalcWordWrap(bool bWordWrap, int wrapLineVectorSize, int
d->m_wrapLineCacheList.append(QVector<DiffTextWindowData::WrapLineCacheData>());
s_runnables.push_back(new RecalcWordWrapRunnable(this, d, visibleTextWidth, j));
}
//recalcWordWrap( bWordWrap, wrapLineVectorSize, visibleTextWidth, 0 );
}
else
{
......
......@@ -186,7 +186,7 @@ class KDiff3App : public QSplitter
void resizeMergeResultWindow();
void slotRecalcWordWrap();
void postRecalcWordWrap();
void slotFinishRecalcWordWrap();
void slotFinishRecalcWordWrap(int visibleTextWidth);
void showPopupMenu(const QPoint& point);
......@@ -417,8 +417,6 @@ class KDiff3App : public QSplitter
void setHScrollBarRange();
int m_iCumulativeWheelDelta;
int m_visibleTextWidthForPrinting; // only needed during recalcWordWrap
int m_firstD3LIdx; // only needed during recalcWordWrap
QPointer<QEventLoop> m_pEventLoopForPrinting;
};
......
......@@ -1583,7 +1583,6 @@ void KDiff3App::recalcWordWrap(int visibleTextWidthForPrinting)
m_bRecalcWordWrapPosted = true;
mainWindowEnable(false);
m_visibleTextWidthForPrinting = visibleTextWidthForPrinting;
if(m_firstD3LIdx < 0)
{
m_firstD3LIdx = 0;
......@@ -1618,15 +1617,15 @@ void KDiff3App::recalcWordWrap(int visibleTextWidthForPrinting)
// Let every window calc how many lines will be needed.
if(m_pDiffTextWindow1)
{
m_pDiffTextWindow1->recalcWordWrap(true, 0, m_visibleTextWidthForPrinting);
m_pDiffTextWindow1->recalcWordWrap(true, 0, visibleTextWidthForPrinting);
}
if(m_pDiffTextWindow2)
{
m_pDiffTextWindow2->recalcWordWrap(true, 0, m_visibleTextWidthForPrinting);
m_pDiffTextWindow2->recalcWordWrap(true, 0, visibleTextWidthForPrinting);
}
if(m_pDiffTextWindow3)
{
m_pDiffTextWindow3->recalcWordWrap(true, 0, m_visibleTextWidthForPrinting);
m_pDiffTextWindow3->recalcWordWrap(true, 0, visibleTextWidthForPrinting);
}
}
else
......@@ -1641,7 +1640,7 @@ void KDiff3App::recalcWordWrap(int visibleTextWidthForPrinting)
}
bool bRunnablesStarted = startRunnables();
if(!bRunnablesStarted)
slotFinishRecalcWordWrap();
slotFinishRecalcWordWrap(visibleTextWidthForPrinting);
else
{
g_pProgressDialog->setInformation(m_pOptions->m_bWordWrap
......@@ -1653,11 +1652,11 @@ void KDiff3App::recalcWordWrap(int visibleTextWidthForPrinting)
else
{
//don't leave proccessing incomplete if m_diff3LineList isEmpty as when an error occures during reading.
slotFinishRecalcWordWrap();
slotFinishRecalcWordWrap(visibleTextWidthForPrinting);
}
}
void KDiff3App::slotFinishRecalcWordWrap()
void KDiff3App::slotFinishRecalcWordWrap(int visibleTextWidthForPrinting)
{
g_pProgressDialog->pop();
......@@ -1682,7 +1681,7 @@ void KDiff3App::slotFinishRecalcWordWrap()
g_pProgressDialog->setStayHidden(false);
bool bPrinting = m_visibleTextWidthForPrinting >= 0;
bool bPrinting = visibleTextWidthForPrinting >= 0;
if(!m_diff3LineList.empty())
{
......@@ -1699,11 +1698,11 @@ void KDiff3App::slotFinishRecalcWordWrap()
// Finish the word wrap
if(m_pDiffTextWindow1)
m_pDiffTextWindow1->recalcWordWrap(true, sumOfLines, m_visibleTextWidthForPrinting);
m_pDiffTextWindow1->recalcWordWrap(true, sumOfLines, visibleTextWidthForPrinting);
if(m_pDiffTextWindow2)
m_pDiffTextWindow2->recalcWordWrap(true, sumOfLines, m_visibleTextWidthForPrinting);
m_pDiffTextWindow2->recalcWordWrap(true, sumOfLines, visibleTextWidthForPrinting);
if(m_pDiffTextWindow3)
m_pDiffTextWindow3->recalcWordWrap(true, sumOfLines, m_visibleTextWidthForPrinting);
m_pDiffTextWindow3->recalcWordWrap(true, sumOfLines, visibleTextWidthForPrinting);
m_neededLines = sumOfLines;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment