Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit de87cab0 authored by Michael Reeves's avatar Michael Reeves

Apply some clazzy fixes

*no static globals
*fix missing qglobals.h
*QWidget::scroll is not a signal and does not need to be redefined in
every sub-class
*add missing emit keyword
parent b3d893e3
......@@ -44,7 +44,7 @@
#include <cmath>
#include <cstdlib>
static QAtomicInt s_runnableCount = 0;
QAtomicInt s_runnableCount = 0;
class DiffTextWindowData
{
......@@ -277,7 +277,7 @@ void DiffTextWindow::setFirstLine(int firstLine)
}
else
{
QWidget::scroll(0, deltaY);
scroll(0, deltaY);
}
d->m_pDiffTextWindowFrame->setFirstLine(d->m_firstLine);
}
......@@ -313,7 +313,7 @@ void DiffTextWindow::setHorizScrollOffset(int horizScrollOffset)
}
else
{
QWidget::scroll(deltaX, 0, r);
scroll(deltaX, 0, r);
}
}
......@@ -583,7 +583,7 @@ void DiffTextWindow::mouseMoveEvent(QMouseEvent* e)
{
d->m_scrollDeltaX = deltaX;
d->m_scrollDeltaY = deltaY;
emit scroll(deltaX, deltaY);
scroll(deltaX, deltaY);
if(d->m_delayedDrawTimer)
killTimer(d->m_delayedDrawTimer);
d->m_delayedDrawTimer = startTimer(50);
......@@ -644,7 +644,7 @@ void DiffTextWindow::timerEvent(QTimerEvent*)
if(d->m_scrollDeltaX != 0 || d->m_scrollDeltaY != 0)
{
d->m_selection.end(d->m_selection.getLastLine() + d->m_scrollDeltaY, d->m_selection.getLastPos() + d->m_scrollDeltaX);
emit scroll(d->m_scrollDeltaX, d->m_scrollDeltaY);
scroll(d->m_scrollDeltaX, d->m_scrollDeltaY);
killTimer(d->m_delayedDrawTimer);
d->m_delayedDrawTimer = startTimer(50);
}
......@@ -1616,7 +1616,7 @@ class RecalcWordWrapRunnable : public QRunnable
}
};
static QList<QRunnable*> s_runnables;
QList<QRunnable*> s_runnables;
bool startRunnables()
{
......@@ -1641,8 +1641,8 @@ bool startRunnables()
return true;
}
}
static const int s_linesPerRunnable = 2000;
// Use conexpr when supported. QT
const int s_linesPerRunnable = 2000;
void DiffTextWindow::recalcWordWrap(bool bWordWrap, int wrapLineVectorSize, int visibleTextWidth)
{
......
......@@ -82,7 +82,6 @@ public:
Q_SIGNALS:
void resizeHeightChangedSignal(int nofVisibleLines);
void resizeWidthChangedSignal(int nofVisibleColumns);
void scroll(int deltaX, int deltaY);
void newSelection();
void selectionEnd();
void setFastSelectorLine( int line );
......
......@@ -14,6 +14,8 @@
* (at your option) any later version. *
* *
***************************************************************************/
#include <qglobal.h>
#ifdef Q_OS_WIN
#include <qt_windows.h>
#endif
......@@ -1475,11 +1477,11 @@ void DirectoryMergeWindow::keyPressEvent(QKeyEvent* e)
void DirectoryMergeWindow::focusInEvent(QFocusEvent*)
{
updateAvailabilities();
emit updateAvailabilities();
}
void DirectoryMergeWindow::focusOutEvent(QFocusEvent*)
{
updateAvailabilities();
emit updateAvailabilities();
}
void DirectoryMergeWindow::Data::setAllMergeOperations(e_MergeOperation eDefaultOperation)
......@@ -2346,12 +2348,12 @@ void DirectoryMergeWindow::Data::selectItemAndColumn(const QModelIndex& mi, bool
{
m_selection3Index = mi;
}
if(old1.isValid()) dataChanged(old1, old1);
if(old2.isValid()) dataChanged(old2, old2);
if(old3.isValid()) dataChanged(old3, old3);
if(m_selection1Index.isValid()) dataChanged(m_selection1Index, m_selection1Index);
if(m_selection2Index.isValid()) dataChanged(m_selection2Index, m_selection2Index);
if(m_selection3Index.isValid()) dataChanged(m_selection3Index, m_selection3Index);
if(old1.isValid()) emit dataChanged(old1, old1);
if(old2.isValid()) emit dataChanged(old2, old2);
if(old3.isValid()) emit dataChanged(old3, old3);
if(m_selection1Index.isValid()) emit dataChanged(m_selection1Index, m_selection1Index);
if(m_selection2Index.isValid()) emit dataChanged(m_selection2Index, m_selection2Index);
if(m_selection3Index.isValid()) emit dataChanged(m_selection3Index, m_selection3Index);
emit q->updateAvailabilities();
}
......@@ -2581,7 +2583,9 @@ void DirectoryMergeWindow::mergeResultSaved(const QString& fileName)
bool DirectoryMergeWindow::Data::canContinue()
{
bool bCanContinue = false;
q->checkIfCanContinue(&bCanContinue);
emit q->checkIfCanContinue(&bCanContinue);
if(bCanContinue && !m_bError)
{
QModelIndex mi = (m_mergeItemList.empty() || m_currentIndexForOperation == m_mergeItemList.end()) ? QModelIndex() : *m_currentIndexForOperation;
......
......@@ -541,7 +541,7 @@ void MergeResultWindow::merge(bool bAutoSolve, int defaultSelector, bool bConfli
m_currentMergeLineIt = m_mergeLineList.begin();
slotGoTop();
updateAvailabilities();
emit updateAvailabilities();
update();
}
......@@ -1617,7 +1617,7 @@ void MergeResultWindow::timerEvent(QTimerEvent*)
if(m_scrollDeltaX != 0 || m_scrollDeltaY != 0)
{
m_selection.end(m_selection.getLastLine() + m_scrollDeltaY, m_selection.getLastPos() + m_scrollDeltaX);
emit scroll(m_scrollDeltaX, m_scrollDeltaY);
scroll(m_scrollDeltaX, m_scrollDeltaY);
killTimer(m_delayedDrawTimer);
m_delayedDrawTimer = startTimer(50);
}
......@@ -2079,7 +2079,7 @@ void MergeResultWindow::mousePressEvent(QMouseEvent* e)
if(bRMB)
{
showPopupMenu(QCursor::pos());
emit showPopupMenu(QCursor::pos());
}
}
else if(bLMB) // Normal cursor placement
......@@ -2208,7 +2208,7 @@ void MergeResultWindow::mouseMoveEvent(QMouseEvent* e)
m_scrollDeltaY = deltaY;
if(deltaX != 0 || deltaY != 0)
{
emit scroll(deltaX, deltaY);
scroll(deltaX, deltaY);
}
}
}
......
......@@ -163,7 +163,6 @@ public Q_SLOTS:
void slotStatusMessageChanged( const QString& );
Q_SIGNALS:
void scroll( int deltaX, int deltaY );
void modifiedChanged(bool bModified);
void setFastSelectorRange( int line1, int nofLines );
void sourceMask( int srcMask, int enabledMask );
......
......@@ -55,10 +55,10 @@
#define KDIFF3_CONFIG_GROUP "KDiff3 Options"
static QString s_historyEntryStartRegExpToolTip;
static QString s_historyEntryStartSortKeyOrderToolTip;
static QString s_autoMergeRegExpToolTip;
static QString s_historyStartRegExpToolTip;
QString s_historyEntryStartRegExpToolTip;
QString s_historyEntryStartSortKeyOrderToolTip;
QString s_autoMergeRegExpToolTip;
QString s_historyStartRegExpToolTip;
void OptionDialog::addOptionItem(OptionItem* p)
{
......
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