Commit e29d3a4b authored by Michael Reeves's avatar Michael Reeves

Switch all QString::isNull to QString::isEmpty so we get expected results.

parent 1e68b415
......@@ -84,7 +84,7 @@ QList<QAction*> KDiff3FileItemAction::actions( const KFileItemListProperties& fi
{
QList< QAction* > actions;
if (QStandardPaths::findExecutable("kdiff3").isNull ())
if (QStandardPaths::findExecutable("kdiff3").isEmpty ())
return actions;
KDiff3FileItemAction *pThis = const_cast<KDiff3FileItemAction*>(this);
......
......@@ -81,7 +81,7 @@ KDiff3Plugin::KDiff3Plugin( KonqPopupMenu* pPopupMenu, const QStringList & /* li
void KDiff3Plugin::setup( KActionCollection* actionCollection, const KonqPopupMenuInformation& popupMenuInfo, QMenu* pMenu )
{
if (KStandardDirs::findExe("kdiff3").isNull ())
if (KStandardDirs::findExe("kdiff3").isEmpty ())
return;
// remember currently selected files (copy to a QStringList)
......
......@@ -1103,9 +1103,9 @@ static void findHistoryRange( const QRegExp& historyStart, bool bThreeFiles, con
QString sA = iEnd->getString(A);
QString sB = iEnd->getString(B);
QString sC = iEnd->getString(C);
if ( ! ((sA.isNull() || historyLead == calcHistoryLead(sA) ) &&
(sB.isNull() || historyLead == calcHistoryLead(sB) ) &&
(!bThreeFiles || sC.isNull() || historyLead == calcHistoryLead(sC) )
if ( ! ((sA.isEmpty() || historyLead == calcHistoryLead(sA) ) &&
(sB.isEmpty() || historyLead == calcHistoryLead(sB) ) &&
(!bThreeFiles || sC.isEmpty() || historyLead == calcHistoryLead(sC) )
))
{
break; // End of the history
......@@ -1222,7 +1222,7 @@ void MergeResultWindow::collectHistoryInformation(
const LineData* pld = id3l->getLineData(src);
if ( !pld ) continue;
QString s( pld->pLine, pld->size );
if (historyLead.isNull()) historyLead = calcHistoryLead(s);
if (historyLead.isEmpty()) historyLead = calcHistoryLead(s);
QString sLine = s.mid(historyLead.length());
if ( ( !bUseRegExp && !sLine.trimmed().isEmpty() && bPrevLineIsEmpty )
|| (bUseRegExp && newHistoryEntry.exactMatch( sLine ) )
......
......@@ -202,13 +202,13 @@ private:
public:
MergeEditLine(Diff3LineList::const_iterator i, int src=0){m_id3l=i; m_src=src; m_bLineRemoved=false; }
void setConflict() { m_src=0; m_bLineRemoved=false; m_str=QString(); }
bool isConflict() { return m_src==0 && !m_bLineRemoved && m_str.isNull(); }
bool isConflict() { return m_src==0 && !m_bLineRemoved && m_str.isEmpty(); }
void setRemoved(int src=0) { m_src=src; m_bLineRemoved=true; m_str=QString(); }
bool isRemoved() { return m_bLineRemoved; }
bool isEditableText() { return !isConflict() && !isRemoved(); }
void setString( const QString& s ){ m_str=s; m_bLineRemoved=false; m_src=0; }
QString getString( const MergeResultWindow* );
bool isModified() { return ! m_str.isNull() || (m_bLineRemoved && m_src==0); }
bool isModified() { return ! m_str.isEmpty() || (m_bLineRemoved && m_src==0); }
void setSource( int src, bool bLineRemoved ) { m_src=src; m_bLineRemoved =bLineRemoved; }
int src() { return m_src; }
......
......@@ -1187,7 +1187,7 @@ void KDiff3App::slotEditCut()
m_pMergeResultWindow->update();
}
if ( !s.isNull() )
if ( !s.isEmpty() )
{
QApplication::clipboard()->setText( s, QClipboard::Clipboard );
}
......@@ -1200,10 +1200,10 @@ void KDiff3App::slotEditCopy()
slotStatusMsg(i18n("Copying selection to clipboard..."));
QString s;
if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection();
if ( s.isNull() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->getSelection();
if ( s.isNull() && m_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection();
if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection();
if ( !s.isNull() )
if ( s.isEmpty() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->getSelection();
if ( s.isEmpty() && m_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection();
if ( s.isEmpty() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection();
if ( !s.isEmpty() )
{
QApplication::clipboard()->setText( s, QClipboard::Clipboard );
}
......@@ -1500,10 +1500,10 @@ void KDiff3App::slotSelectionEnd()
{
QString s;
if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection();
if ( s.isNull() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->getSelection();
if ( s.isNull() && m_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection();
if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection();
if ( !s.isNull() )
if ( s.isEmpty() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->getSelection();
if ( s.isEmpty() && m_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection();
if ( s.isEmpty() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection();
if ( !s.isEmpty() )
{
clipBoard->setText( s, QClipboard::Selection );
}
......@@ -1967,10 +1967,10 @@ void KDiff3App::slotEditFind()
// Use currently selected text:
QString s;
if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection();
if ( s.isNull() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->getSelection();
if ( s.isNull() && m_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection();
if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection();
if ( !s.isNull() && !s.contains('\n') )
if ( s.isEmpty() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->getSelection();
if ( s.isEmpty() && m_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection();
if ( s.isEmpty() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection();
if ( !s.isEmpty() && !s.contains('\n') )
{
m_pFindDialog->m_pSearchString->setText( s );
}
......
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