Commit 7ad6a2b8 authored by Michael Reeves's avatar Michael Reeves

remove tabs

parent 3775209b
......@@ -2193,24 +2193,24 @@ void DirectoryMergeWindow::Data::selectItemAndColumn(const QModelIndex& mi, bool
class MfiCompare
{
Qt::SortOrder mOrder;
Qt::SortOrder mOrder;
public:
MfiCompare( Qt::SortOrder order ) {
mOrder = order;
mOrder = order;
}
bool operator()( MergeFileInfos* pMFI1, MergeFileInfos* pMFI2 )
{
bool bDir1 = pMFI1->dirA() || pMFI1->dirB() || pMFI1->dirC();
bool bDir2 = pMFI2->dirA() || pMFI2->dirB() || pMFI2->dirC();
if( bDir1 == bDir2 ) {
if( mOrder == Qt::AscendingOrder)
if( mOrder == Qt::AscendingOrder)
{
return pMFI1->fileName().compare( pMFI2->fileName(), Qt::CaseInsensitive ) < 0;
}
else{
return pMFI1->fileName().compare( pMFI2->fileName(), Qt::CaseInsensitive ) > 0;
}
return pMFI1->fileName().compare( pMFI2->fileName(), Qt::CaseInsensitive ) < 0;
}
else{
return pMFI1->fileName().compare( pMFI2->fileName(), Qt::CaseInsensitive ) > 0;
}
}
else
return bDir1;
......@@ -2960,7 +2960,7 @@ bool DirectoryMergeWindow::Data::copyFLD( const QString& srcName, const QString&
if ( fi.isDir() )
{
if ( faDest.exists() )
return true;
return true;
else
{
bool bSuccess = makeDir( destName );
......
......@@ -587,16 +587,16 @@ QString FileAccess::absoluteFilePath() const
else
{
if ( m_filePath.isEmpty() )
return QString();
return QString();
if ( ! isLocal() )
return m_filePath; // return complete url
QFileInfo fi( m_filePath );
if ( fi.isAbsolute() )
return m_filePath;
return m_filePath;
else
return fi.absoluteFilePath(); // Probably never reached
return fi.absoluteFilePath(); // Probably never reached
}
} // Full abs path
......
......@@ -18,7 +18,7 @@
#include <KIO/UDSEntry>
namespace KIO {
class Job;
class Job;
}
bool wildcardMultiMatch( const QString& wildcard, const QString& testString, bool bCaseSensitive );
......
This diff is collapsed.
......@@ -162,107 +162,107 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current)
/* Hash this line until we find a newline or bufend is reached. */
if (ignore_case)
switch (ignore_white_space)
{
case IGNORE_ALL_SPACE:
while ( p<bufend && !isEndOfLine(c = *p) )
switch (ignore_white_space)
{
case IGNORE_ALL_SPACE:
while ( p<bufend && !isEndOfLine(c = *p) )
{
if (! (isWhite(c) || (bIgnoreNumbers && (c.isDigit() || c=='-' || c=='.' )) ))
h = HASH (h, c.toLower().unicode());
++p;
}
break;
break;
default:
while ( p<bufend && !isEndOfLine(c = *p) )
default:
while ( p<bufend && !isEndOfLine(c = *p) )
{
h = HASH (h, c.toLower().unicode());
++p;
}
break;
}
break;
}
else
switch (ignore_white_space)
{
case IGNORE_ALL_SPACE:
while ( p<bufend && !isEndOfLine(c = *p) )
switch (ignore_white_space)
{
case IGNORE_ALL_SPACE:
while ( p<bufend && !isEndOfLine(c = *p) )
{
if (! (isWhite(c)|| (bIgnoreNumbers && (c.isDigit() || c=='-' || c=='.' )) ))
h = HASH (h, c.unicode());
++p;
}
break;
break;
default:
while ( p<bufend && !isEndOfLine(c = *p) )
default:
while ( p<bufend && !isEndOfLine(c = *p) )
{
h = HASH (h, c.unicode());
++p;
}
break;
}
break;
}
bucket = &buckets[h % nbuckets];
length = p - ip;
++p;
for (i = *bucket; ; i = eqs[i].next)
if (!i)
{
/* Create a new equivalence class in this bucket. */
i = eqs_index++;
if (i == eqs_alloc)
{
if ((lin)(PTRDIFF_MAX / (2 * sizeof *eqs)) <= eqs_alloc)
xalloc_die ();
eqs_alloc *= 2;
eqs = (equivclass*)xrealloc (eqs, eqs_alloc * sizeof *eqs);
}
eqs[i].next = *bucket;
eqs[i].hash = h;
eqs[i].line = ip;
eqs[i].length = length;
*bucket = i;
break;
}
else if (eqs[i].hash == h)
{
const QChar *eqline = eqs[i].line;
/* Reuse existing class if lines_differ reports the lines
if (!i)
{
/* Create a new equivalence class in this bucket. */
i = eqs_index++;
if (i == eqs_alloc)
{
if ((lin)(PTRDIFF_MAX / (2 * sizeof *eqs)) <= eqs_alloc)
xalloc_die ();
eqs_alloc *= 2;
eqs = (equivclass*)xrealloc (eqs, eqs_alloc * sizeof *eqs);
}
eqs[i].next = *bucket;
eqs[i].hash = h;
eqs[i].line = ip;
eqs[i].length = length;
*bucket = i;
break;
}
else if (eqs[i].hash == h)
{
const QChar *eqline = eqs[i].line;
/* Reuse existing class if lines_differ reports the lines
equal. */
if (eqs[i].length == length)
{
/* Reuse existing equivalence class if the lines are identical.
This detects the common case of exact identity
faster than lines_differ would. */
if (memcmp (eqline, ip, length*sizeof(QChar)) == 0)
break;
if (!same_length_diff_contents_compare_anyway)
continue;
}
else if (!diff_length_compare_anyway)
continue;
if (! lines_differ (eqline, eqs[i].length, ip, length))
break;
}
if (eqs[i].length == length)
{
/* Reuse existing equivalence class if the lines are identical.
This detects the common case of exact identity
faster than lines_differ would. */
if (memcmp (eqline, ip, length*sizeof(QChar)) == 0)
break;
if (!same_length_diff_contents_compare_anyway)
continue;
}
else if (!diff_length_compare_anyway)
continue;
if (! lines_differ (eqline, eqs[i].length, ip, length))
break;
}
/* Maybe increase the size of the line table. */
if (line == alloc_lines)
{
/* Double (alloc_lines - linbuf_base) by adding to alloc_lines. */
if ((lin)(PTRDIFF_MAX / 3) <= alloc_lines
|| (lin)(PTRDIFF_MAX / sizeof *cureqs) <= 2 * alloc_lines - linbuf_base
|| (lin)(PTRDIFF_MAX / sizeof *linbuf) <= alloc_lines - linbuf_base)
xalloc_die ();
alloc_lines = 2 * alloc_lines - linbuf_base;
cureqs =(lin*) xrealloc (cureqs, alloc_lines * sizeof *cureqs);
linbuf += linbuf_base;
linbuf = (const QChar**) xrealloc (linbuf,
(alloc_lines - linbuf_base) * sizeof *linbuf);
linbuf -= linbuf_base;
}
{
/* Double (alloc_lines - linbuf_base) by adding to alloc_lines. */
if ((lin)(PTRDIFF_MAX / 3) <= alloc_lines
|| (lin)(PTRDIFF_MAX / sizeof *cureqs) <= 2 * alloc_lines - linbuf_base
|| (lin)(PTRDIFF_MAX / sizeof *linbuf) <= alloc_lines - linbuf_base)
xalloc_die ();
alloc_lines = 2 * alloc_lines - linbuf_base;
cureqs =(lin*) xrealloc (cureqs, alloc_lines * sizeof *cureqs);
linbuf += linbuf_base;
linbuf = (const QChar**) xrealloc (linbuf,
(alloc_lines - linbuf_base) * sizeof *linbuf);
linbuf -= linbuf_base;
}
linbuf[line] = ip;
cureqs[line] = i;
++line;
......@@ -273,28 +273,28 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current)
for (i = 0; ; i++)
{
/* Record the line start for lines in the suffix that we care about.
Record one more line start than lines,
so that we can compute the length of any buffered line. */
Record one more line start than lines,
so that we can compute the length of any buffered line. */
if (line == alloc_lines)
{
/* Double (alloc_lines - linbuf_base) by adding to alloc_lines. */
if ((lin)(PTRDIFF_MAX / 3) <= alloc_lines
|| (lin)(PTRDIFF_MAX / sizeof *cureqs) <= 2 * alloc_lines - linbuf_base
|| (lin)(PTRDIFF_MAX / sizeof *linbuf) <= alloc_lines - linbuf_base)
xalloc_die ();
alloc_lines = 2 * alloc_lines - linbuf_base;
linbuf += linbuf_base;
linbuf = (const QChar**)xrealloc (linbuf,
(alloc_lines - linbuf_base) * sizeof *linbuf);
linbuf -= linbuf_base;
}
{
/* Double (alloc_lines - linbuf_base) by adding to alloc_lines. */
if ((lin)(PTRDIFF_MAX / 3) <= alloc_lines
|| (lin)(PTRDIFF_MAX / sizeof *cureqs) <= 2 * alloc_lines - linbuf_base
|| (lin)(PTRDIFF_MAX / sizeof *linbuf) <= alloc_lines - linbuf_base)
xalloc_die ();
alloc_lines = 2 * alloc_lines - linbuf_base;
linbuf += linbuf_base;
linbuf = (const QChar**)xrealloc (linbuf,
(alloc_lines - linbuf_base) * sizeof *linbuf);
linbuf -= linbuf_base;
}
linbuf[line] = p;
if ( p >= bufend)
break;
break;
if (context <= i && no_diff_means_no_output)
break;
break;
line++;
......@@ -426,9 +426,9 @@ void GnuDiff::find_identical_ends (struct file_data filevec[])
middle_guess = guess_lines (0, 0, p0 - filevec[0].prefix_end);
suffix_guess = guess_lines (0, 0, buffer0 + n0 - p0);
for (prefix_count = 1; prefix_count <= context; prefix_count *= 2)
continue;
continue;
alloc_lines0 = (prefix_count + middle_guess
+ MIN (context, suffix_guess));
+ MIN (context, suffix_guess));
}
else
{
......@@ -443,24 +443,24 @@ void GnuDiff::find_identical_ends (struct file_data filevec[])
/* If the prefix is needed, find the prefix lines. */
if (! (no_diff_means_no_output
&& filevec[0].prefix_end == p0
&& filevec[1].prefix_end == p1))
&& filevec[0].prefix_end == p0
&& filevec[1].prefix_end == p1))
{
end0 = filevec[0].prefix_end;
while (p0 != end0)
{
lin l = lines++ & prefix_mask;
if (l == alloc_lines0)
{
if ((lin)(PTRDIFF_MAX / (2 * sizeof *linbuf0)) <= alloc_lines0)
xalloc_die ();
alloc_lines0 *= 2;
{
lin l = lines++ & prefix_mask;
if (l == alloc_lines0)
{
if ((lin)(PTRDIFF_MAX / (2 * sizeof *linbuf0)) <= alloc_lines0)
xalloc_die ();
alloc_lines0 *= 2;
linbuf0 = (const QChar**) xrealloc (linbuf0, alloc_lines0 * sizeof(*linbuf0));
}
linbuf0[l] = p0;
while ( p0<pEnd0 && !isEndOfLine(*p0++) )
continue;
}
}
linbuf0[l] = p0;
while ( p0<pEnd0 && !isEndOfLine(*p0++) )
continue;
}
}
buffered_prefix = prefix_count && context < lines ? context : lines;
......@@ -479,9 +479,9 @@ void GnuDiff::find_identical_ends (struct file_data filevec[])
{
/* Rotate prefix lines to proper location. */
for (i = 0; i < buffered_prefix; i++)
linbuf1[i] = linbuf0[(lines - context + i) & prefix_mask];
linbuf1[i] = linbuf0[(lines - context + i) & prefix_mask];
for (i = 0; i < buffered_prefix; i++)
linbuf0[i] = linbuf1[i];
linbuf0[i] = linbuf1[i];
}
/* Initialize line buffer 1 from line buffer 0. */
......@@ -513,7 +513,7 @@ static unsigned char const prime_offset[] =
/* Verify that this host's size_t is not too wide for the above table. */
verify (enough_prime_offsets,
sizeof (size_t) * CHAR_BIT <= sizeof prime_offset);
sizeof (size_t) * CHAR_BIT <= sizeof prime_offset);
/* Given a vector of two file_data objects, read the file associated
with each one, and build the table of equivalence classes.
......
......@@ -46,8 +46,8 @@
#endif
#ifndef TYPE_MINIMUM
# define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \
: (t) 0))
? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \
: (t) 0))
#endif
#ifndef TYPE_MAXIMUM
# define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
......
......@@ -22,11 +22,11 @@ namespace KDiff3 {
template <class T>
T* createAction(
const QString& text,
const QObject* receiver,
const char* slot,
KActionCollection* ac,
const char* actionName);
const QString& text,
const QObject* receiver,
const char* slot,
KActionCollection* ac,
const char* actionName);
template <>
inline QAction * createAction<QAction>(
......@@ -58,12 +58,12 @@ namespace KDiff3 {
template <class T>
T* createAction(
const QString& text,
const QKeySequence& shortcut,
const QObject* receiver,
const char* slot,
KActionCollection* ac,
const char* actionName)
const QString& text,
const QKeySequence& shortcut,
const QObject* receiver,
const char* slot,
KActionCollection* ac,
const char* actionName)
{
T* theAction = createAction<T>( text, receiver, slot, ac, actionName );
ac->setDefaultShortcut(theAction, shortcut);
......@@ -99,13 +99,13 @@ namespace KDiff3 {
}
template <class T>
T* createAction(
const QString& text,
const QIcon& icon,
const QKeySequence& shortcut,
const QObject* receiver,
const char* slot,
KActionCollection* ac,
const char* actionName)
const QString& text,
const QIcon& icon,
const QKeySequence& shortcut,
const QObject* receiver,
const char* slot,
KActionCollection* ac,
const char* actionName)
{
T* theAction = createAction<T>( text, shortcut, receiver, slot, ac, actionName );
theAction->setIcon( icon );
......
......@@ -216,9 +216,9 @@ KDiff3App::KDiff3App( QWidget* pParent, const char* /*name*/, KDiff3Part* pKDiff
if( hasArgs ) {
m_outputFilename = KDiff3Shell::getParser()->value( "output" );
if( m_outputFilename.isEmpty() )
if( m_outputFilename.isEmpty() )
m_outputFilename = KDiff3Shell::getParser()->value( "out" );
if( ! m_outputFilename.isEmpty() )
m_outputFilename = FileAccess( m_outputFilename, true ).absoluteFilePath();
......@@ -239,10 +239,10 @@ KDiff3App::KDiff3App( QWidget* pParent, const char* /*name*/, KDiff3Part* pKDiff
}
else {
m_bDefaultFilename = false;
}
}
g_bAutoSolve = !KDiff3Shell::getParser()->isSet( "qall" ); // Note that this is effective only once.
QStringList args = KDiff3Shell::getParser()->positionalArguments();
QStringList args = KDiff3Shell::getParser()->positionalArguments();
m_sd1.setFilename( KDiff3Shell::getParser()->value( "base" ) );
if( m_sd1.isEmpty() ) {
......@@ -286,7 +286,7 @@ KDiff3App::KDiff3App( QWidget* pParent, const char* /*name*/, KDiff3Part* pKDiff
}
}
else {
m_bDefaultFilename = false;
m_bDefaultFilename = false;
g_bAutoSolve = false;
}
g_pProgressDialog->setStayHidden( m_bAutoMode );
......
......@@ -71,7 +71,7 @@ KDiff3Shell::KDiff3Shell( bool bCompleteInit )
setCentralWidget(m_part->widget());
if (bCompleteInit)
((KDiff3App*)m_part->widget())->completeInit();
((KDiff3App*)m_part->widget())->completeInit();
connect(((KDiff3App*)m_part->widget()), SIGNAL(createNewInstance(const QString&, const QString&, const QString&)), this, SLOT(slotNewInstance(const QString&, const QString&, const QString&)));
}
else
......
This diff is collapsed.
......@@ -29,32 +29,32 @@
class CShellContextMenu
{
public:
HMENU GetMenu ();
void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST pidlItem);
void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST * pidlArray, int nItemCount);
void SetObjects (LPITEMIDLIST pidl);
void SetObjects (const QString& strObject);
void SetObjects (const QStringList& strList);
UINT ShowContextMenu (QWidget* pParent, QPoint pt, QMenu* pMenu);
CShellContextMenu();
virtual ~CShellContextMenu();
HMENU GetMenu ();
void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST pidlItem);
void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST * pidlArray, int nItemCount);
void SetObjects (LPITEMIDLIST pidl);
void SetObjects (const QString& strObject);
void SetObjects (const QStringList& strList);
UINT ShowContextMenu (QWidget* pParent, QPoint pt, QMenu* pMenu);
CShellContextMenu();
virtual ~CShellContextMenu();
private:
int nItems;
BOOL bDelete;
HMENU m_hMenu;
IShellFolder * m_psfFolder;
LPITEMIDLIST * m_pidlArray;
void InvokeCommand (LPCONTEXTMENU pContextMenu, UINT idCommand);
BOOL GetContextMenu (void ** ppContextMenu, int & iMenuType);
HRESULT SHBindToParentEx (LPCITEMIDLIST pidl, REFIID riid, VOID **ppv, LPCITEMIDLIST *ppidlLast);
static LRESULT CALLBACK HookWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
void FreePIDLArray (LPITEMIDLIST * pidlArray);
LPITEMIDLIST CopyPIDL (LPCITEMIDLIST pidl, int cb = -1);
UINT GetPIDLSize (LPCITEMIDLIST pidl);
LPBYTE GetPIDLPos (LPCITEMIDLIST pidl, int nPos);
int GetPIDLCount (LPCITEMIDLIST pidl);
int nItems;
BOOL bDelete;
HMENU m_hMenu;
IShellFolder * m_psfFolder;
LPITEMIDLIST * m_pidlArray;
void InvokeCommand (LPCONTEXTMENU pContextMenu, UINT idCommand);
BOOL GetContextMenu (void ** ppContextMenu, int & iMenuType);
HRESULT SHBindToParentEx (LPCITEMIDLIST pidl, REFIID riid, VOID **ppv, LPCITEMIDLIST *ppidlLast);
static LRESULT CALLBACK HookWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
void FreePIDLArray (LPITEMIDLIST * pidlArray);
LPITEMIDLIST CopyPIDL (LPCITEMIDLIST pidl, int cb = -1);
UINT GetPIDLSize (LPCITEMIDLIST pidl);
LPBYTE GetPIDLPos (LPCITEMIDLIST pidl, int nPos);
int GetPIDLCount (LPCITEMIDLIST pidl);
};
#endif
......@@ -1943,7 +1943,7 @@ QString OptionDialog::parseOptions( const QStringList& optionList )
{
if ( (*j)->getSaveName()==key )
{
(*j)->doPreserve();
(*j)->doPreserve();
ValueMap config;
config.writeEntry( key, val ); // Write the value as a string and
(*j)->read(&config); // use the internal conversion from string to the needed value.
......
......@@ -242,8 +242,8 @@ void OpenDialog::selectURL( QComboBox* pLine, bool bDir, int i, bool bSave )
currentUrl = QUrl::fromUserInput(current, QString(), QUrl::AssumeLocalFile);
QUrl newURL = bDir ? QFileDialog::getExistingDirectoryUrl( this, i18n("Open Directory"), currentUrl)
: bSave ? QFileDialog::getSaveFileUrl( this, i18n("Select Output File"), currentUrl, QLatin1Literal("all/allfiles") )
: QFileDialog::getOpenFileUrl( this, i18n("Open File"), currentUrl, QLatin1Literal("all/allfiles") );
: bSave ? QFileDialog::getSaveFileUrl( this, i18n("Select Output File"), currentUrl, QLatin1Literal("all/allfiles") )
: QFileDialog::getOpenFileUrl( this, i18n("Open File"), currentUrl, QLatin1Literal("all/allfiles") );
if( !newURL.isEmpty() ) {
/*
Since we are selecting a directory open in the parent directory
......
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